31 #ifndef PHIDGETS_API_PHIDGET_H 32 #define PHIDGETS_API_PHIDGET_H 34 #include <libphidget21/phidget21.h> 53 int open(
int serial_number);
89 void init(CPhidgetHandle handle);
98 static int AttachHandler(CPhidgetHandle handle,
void *userptr);
99 static int DetachHandler(CPhidgetHandle handle,
void *userptr);
100 static int ErrorHandler (CPhidgetHandle handle,
void *userptr,
int ErrorCode,
const char *unknown);
105 #endif // PHIDGETS_API_PHIDGET_H
static int DetachHandler(CPhidgetHandle handle, void *userptr)
static int AttachHandler(CPhidgetHandle handle, void *userptr)
virtual void registerHandlers()
int getDeviceSerialNumber()
Get the Phidget's serial number.
virtual void detachHandler()
static int ErrorHandler(CPhidgetHandle handle, void *userptr, int ErrorCode, const char *unknown)
int open(int serial_number)
Open a connection to a Phidget.
int waitForAttachment(int timeout)
Block until the unit is attached or timeout occurs.
static std::string getErrorDescription(int errorCode)
Lookup the string for a CPhidget Error Code.
int close()
Close the connection to the phidget.
virtual void errorHandler(int error)
virtual void attachHandler()
std::string getDeviceType()
Get the device type string.
std::string getDeviceLabel()
Get the device label string.
std::string getLibraryVersion()
Get the library version string.
int getDeviceVersion()
Get the Phidget's version.
void init(CPhidgetHandle handle)
std::string getDeviceName()
Get the device name string.