#include <CGenericDevice.h>
Public Member Functions | |
cGenericDevice () | |
Constructor of cGenericDevice. | |
virtual | ~cGenericDevice () |
Destructor of cGenericDevice. | |
virtual int | open () |
Open connection to device (0 indicates success). | |
virtual int | close () |
Close connection to device (0 indicates success). | |
virtual int | initialize (const bool a_resetEncoders=false) |
Initialize or calibrate device (0 indicates success). | |
virtual int | command (int a_command, void *a_data) |
Send a command to the device (0 indicates success). | |
virtual unsigned int | getNumDevices () |
Returns the number of devices available from this class of device. | |
bool | isSystemAvailable () |
Returns true if the device is available for communication. | |
bool | isSystemReady () |
Returns true if the connection to the device has been created. | |
virtual bool | setCallback (cCallback *a_callback) |
Ask the device to call me back periodically. | |
Protected Attributes | |
bool | m_systemAvailable |
Flag that indicates if the hardware device is available to the computer. | |
bool | m_systemReady |
Flag that indicates if connection to system was opened successfully. | |
cCallback * | m_callback |
A callback method for this device (or zero if none has been registered). |
bool cGenericDevice::setCallback | ( | cCallback * | m_callback | ) | [virtual] |
Ask the device to call me back periodically.
Ask the device to call me back periodically. If this device supports timed callbacks, this function will return 'true' and will call the supplied m_callback method at haptic rates. If not, this function will return 'false', and you should create your own haptic thread.
m_callback | The callback to trigger periodically, or 0 to cancel an existing callback. |