GetNextLoggedCmd
Pops the first message from the command logger and returns it. If the logger is empty, then NULL is returned.
Syntax
const char * GetNextLoggedCmd();
Parameters
None
Returns
const char * - Pointer to the command string. The format of the strings may change at any time, but are typically something like the following:
[HEADER] [BOARD ID] [COMMAND] [ARGUMENTS] -> [REPLY]    // Controller log message
[PCI COMMAND] [ARGUMENTS] -> [REPLY]                    // PCI board log message
[DRIVER COMMAND] [ARGUMENTS] -> [REPLY]                 // Device driver log message
Required Headers
CController.h
Namespace
arc
Throws
None
Remarks
The command logger is useful for seeing exactly what commands and data values are being sent to the controller, pci board, or device driver. Caution must be used with this method, as the strings are stored in a vector that may consume a lot of memory or exceed its maximum if too many values are stored. This may also result in performance loss.
Example
        // This code demonstrates how to log and print
        // debug messages for a TDL to the controller,
        // RESET_CONTROLLER to the PCI board, and then
        // read the device driver status register.

        #include <iostream.h>
        #include "CController.h"
        using namespace std;
        using namespace arc;

        CController cController;

        // .... open driver, initialize, etc ....

        try {
            cController.SetLogCmds( true );

            cController.Command( TIM_ID, TDL, 0x112233 );
            cout << cController.GetNextLoggedCmd() << endl;

            cController.PCICommand( RESET_CONTROLLER );
            cout << cController.GetNextLoggedCmd() << endl;

            cController.IoctlDriver( ASTROPCI_GET_HSTR );
            cout << cController.GetNextLoggedCmd() << endl;

            cController.SetLogCmds( false );
		}
        catch ( std::exception &e )
        {
            cerr << "Exception Occurred: " << e.what() << endl;
        }

        Output:
        
        0x203 TDL 0x112233 -> 0x112233  // TDL ( controller )
        0x87 -> 0x535952                // RESET_CONTROLLER ( pci board )
        ASTROPCI_GET_HSTR -> 0x3        // ASTROPCI_GET_HSTR ( device driver )

© Astronomical Research Cameras, Inc.