SetLogCmds
Turns command logging on/off. This logging can be used for debugging to see command details in one of the following forms:

Controller log message:    [HEADER] [BOARD ID] [COMMAND] [ARGUMENTS] -> [REPLY]
PCI board log message:     [PCI COMMAND] [ARGUMENTS] -> [REPLY]
Device driver log message: [DRIVER COMMAND] [ARGUMENTS] -> [REPLY]
Syntax
void SetLogCmds( onOff );
Parameters
bool onOff
Set to 'true' to turn command logging on. Set to 'false' otherwise.
Returns
None
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.