Data Structures | |
struct | _CPhidget_Timestamp |
Typedefs | |
typedef struct _CPhidget * | CPhidgetHandle |
typedef struct _CPhidget_Timestamp | CPhidget_Timestamp |
typedef struct _CPhidget_Timestamp * | CPhidget_TimestampHandle |
Functions | |
int | CPhidget_openRemote (CPhidgetHandle phid, int serial, const char *serverID, const char *password) |
int | CPhidget_openLabelRemote (CPhidgetHandle phid, const char *label, const char *serverID, const char *password) |
int | CPhidget_openRemoteIP (CPhidgetHandle phid, int serial, const char *address, int port, const char *password) |
int | CPhidget_openLabelRemoteIP (CPhidgetHandle phid, const char *label, const char *address, int port, const char *password) |
int | CPhidget_open (CPhidgetHandle phid, int serialNumber) |
int | CPhidget_openLabel (CPhidgetHandle phid, const char *label) |
int | CPhidget_close (CPhidgetHandle phid) |
int | CPhidget_delete (CPhidgetHandle phid) |
int | CPhidget_set_OnDetach_Handler (CPhidgetHandle phid, int(*fptr)(CPhidgetHandle phid, void *userPtr), void *userPtr) |
int | CPhidget_set_OnAttach_Handler (CPhidgetHandle phid, int(*fptr)(CPhidgetHandle phid, void *userPtr), void *userPtr) |
int | CPhidget_set_OnServerConnect_Handler (CPhidgetHandle phid, int(*fptr)(CPhidgetHandle phid, void *userPtr), void *userPtr) |
int | CPhidget_set_OnServerDisconnect_Handler (CPhidgetHandle phid, int(*fptr)(CPhidgetHandle phid, void *userPtr), void *userPtr) |
int | CPhidget_set_OnError_Handler (CPhidgetHandle phid, int(*fptr)(CPhidgetHandle phid, void *userPtr, int errorCode, const char *errorString), void *userPtr) |
int | CPhidget_getDeviceName (CPhidgetHandle phid, const char **deviceName) |
int | CPhidget_getSerialNumber (CPhidgetHandle phid, int *serialNumber) |
int | CPhidget_getDeviceVersion (CPhidgetHandle phid, int *deviceVersion) |
int | CPhidget_getDeviceStatus (CPhidgetHandle phid, int *deviceStatus) |
int | CPhidget_getLibraryVersion (const char **libraryVersion) |
int | CPhidget_getDeviceType (CPhidgetHandle phid, const char **deviceType) |
int | CPhidget_getDeviceLabel (CPhidgetHandle phid, const char **deviceLabel) |
int | CPhidget_setDeviceLabel (CPhidgetHandle phid, const char *deviceLabel) |
int | CPhidget_getErrorDescription (int errorCode, const char **errorString) |
int | CPhidget_waitForAttachment (CPhidgetHandle phid, int milliseconds) |
int | CPhidget_getServerID (CPhidgetHandle phid, const char **serverID) |
int | CPhidget_getServerAddress (CPhidgetHandle phid, const char **address, int *port) |
int | CPhidget_getServerStatus (CPhidgetHandle phid, int *serverStatus) |
int | CPhidget_getDeviceID (CPhidgetHandle phid, CPhidget_DeviceID *deviceID) |
int | CPhidget_getDeviceClass (CPhidgetHandle phid, CPhidget_DeviceClass *deviceClass) |
typedef struct _CPhidget* CPhidgetHandle |
A phidget handle.
typedef struct _CPhidget_Timestamp CPhidget_Timestamp |
Timestamp structure - usually initialized to 0.
int CPhidget_openRemote | ( | CPhidgetHandle | phid, | |
int | serial, | |||
const char * | serverID, | |||
const char * | password | |||
) |
Opens a Phidget remotely by ServerID. Note that this requires Bonjour (mDNS) to be running on both the host and the server.
phid | A phidget handle. | |
serial | Serial number. Specify -1 to open any. | |
serverID | Server ID. Specify NULL to open any. | |
password | Password. Can be NULL if the server is running unsecured. |
int CPhidget_openLabelRemote | ( | CPhidgetHandle | phid, | |
const char * | label, | |||
const char * | serverID, | |||
const char * | password | |||
) |
Opens a Phidget remotely by ServerID. Note that this requires Bonjour (mDNS) to be running on both the host and the server.
phid | A phidget handle. | |
label | Label string. Labels can be up to 10 characters (UTF-8 encoding). Specify NULL to open any. | |
serverID | Server ID. Specify NULL to open any. | |
password | Password. Can be NULL if the server is running unsecured. |
int CPhidget_openRemoteIP | ( | CPhidgetHandle | phid, | |
int | serial, | |||
const char * | address, | |||
int | port, | |||
const char * | password | |||
) |
Opens a Phidget remotely by address and port, with optional serial number.
phid | A phidget handle. | |
serial | Serial number. Specify -1 to open any. | |
address | Address. This can be a hostname or IP address. | |
port | Port number. Default is 5001. | |
password | Password. Can be NULL if the server is running unsecured. |
int CPhidget_openLabelRemoteIP | ( | CPhidgetHandle | phid, | |
const char * | label, | |||
const char * | address, | |||
int | port, | |||
const char * | password | |||
) |
Opens a Phidget remotely by address and port, with optional label.
phid | A phidget handle. | |
label | Label string. Labels can be up to 10 characters (UTF-8 encoding). Specify NULL to open any. | |
address | Address. This can be a hostname or IP address. | |
port | Port number. Default is 5001. | |
password | Password. Can be NULL if the server is running unsecured. |
int CPhidget_open | ( | CPhidgetHandle | phid, | |
int | serialNumber | |||
) |
Opens a Phidget.
phid | A phidget handle. | |
serialNumber | Serial number. Specify -1 to open any. |
int CPhidget_openLabel | ( | CPhidgetHandle | phid, | |
const char * | label | |||
) |
Opens a Phidget by label.
phid | A phidget handle. | |
label | Label string. Labels can be up to 10 characters (UTF-8 encoding). Specify NULL to open any. |
int CPhidget_close | ( | CPhidgetHandle | phid | ) |
Closes a Phidget.
phid | An opened phidget handle. |
int CPhidget_delete | ( | CPhidgetHandle | phid | ) |
Frees a Phidget handle.
phid | A closed phidget handle. |
int CPhidget_set_OnDetach_Handler | ( | CPhidgetHandle | phid, | |
int(*)(CPhidgetHandle phid, void *userPtr) | fptr, | |||
void * | userPtr | |||
) |
Sets a detach handler callback function. This is called when this Phidget is unplugged from the system.
phid | A phidget handle. | |
fptr | Callback function pointer. | |
userPtr | A pointer for use by the user - this value is passed back into the callback function. |
int CPhidget_set_OnAttach_Handler | ( | CPhidgetHandle | phid, | |
int(*)(CPhidgetHandle phid, void *userPtr) | fptr, | |||
void * | userPtr | |||
) |
Sets an attach handler callback function. This is called when this Phidget is plugged into the system, and is ready for use.
phid | A phidget handle. | |
fptr | Callback function pointer. | |
userPtr | A pointer for use by the user - this value is passed back into the callback function. |
int CPhidget_set_OnServerConnect_Handler | ( | CPhidgetHandle | phid, | |
int(*)(CPhidgetHandle phid, void *userPtr) | fptr, | |||
void * | userPtr | |||
) |
Sets a server connect handler callback function. This is used for opening Phidgets remotely, and is called when a connection to the sever has been made.
phid | A phidget handle. | |
fptr | Callback function pointer. | |
userPtr | A pointer for use by the user - this value is passed back into the callback function. |
int CPhidget_set_OnServerDisconnect_Handler | ( | CPhidgetHandle | phid, | |
int(*)(CPhidgetHandle phid, void *userPtr) | fptr, | |||
void * | userPtr | |||
) |
Sets a server disconnect handler callback function. This is used for opening Phidgets remotely, and is called when a connection to the server has been lost.
phid | A phidget handle. | |
fptr | Callback function pointer. | |
userPtr | A pointer for use by the user - this value is passed back into the callback function. |
int CPhidget_set_OnError_Handler | ( | CPhidgetHandle | phid, | |
int(*)(CPhidgetHandle phid, void *userPtr, int errorCode, const char *errorString) | fptr, | |||
void * | userPtr | |||
) |
Sets the error handler callback function. This is called when an asynchronous error occurs.
phid | A phidget handle. | |
fptr | Callback function pointer. | |
userPtr | A pointer for use by the user - this value is passed back into the callback function. |
int CPhidget_getDeviceName | ( | CPhidgetHandle | phid, | |
const char ** | deviceName | |||
) |
Gets the specific name of a Phidget.
phid | An attached phidget handle. | |
deviceName | A pointer which will be set to point to a char array containing the device name. |
int CPhidget_getSerialNumber | ( | CPhidgetHandle | phid, | |
int * | serialNumber | |||
) |
Gets the serial number of a Phidget.
phid | An attached phidget handle. | |
serialNumber | An int pointer for returning the serial number. |
int CPhidget_getDeviceVersion | ( | CPhidgetHandle | phid, | |
int * | deviceVersion | |||
) |
Gets the firmware version of a Phidget.
phid | An attached phidget handle. | |
deviceVersion | An int pointer for returning the device version. |
int CPhidget_getDeviceStatus | ( | CPhidgetHandle | phid, | |
int * | deviceStatus | |||
) |
Gets the attached status of a Phidget.
phid | A phidget handle. | |
deviceStatus | An int pointer for returning the device status. Possible codes are PHIDGET_ATTACHED and PHIDGET_NOTATTACHED. |
int CPhidget_getLibraryVersion | ( | const char ** | libraryVersion | ) |
Gets the library version. This contains a version number and a build date.
libraryVersion | A pointer which will be set to point to a char array containing the library version string. |
int CPhidget_getDeviceType | ( | CPhidgetHandle | phid, | |
const char ** | deviceType | |||
) |
Gets the type (class) of a Phidget.
phid | An attached phidget handle. | |
deviceType | A pointer which will be set to a char array containing the device type string. |
int CPhidget_getDeviceLabel | ( | CPhidgetHandle | phid, | |
const char ** | deviceLabel | |||
) |
Gets the label of a Phidget.
phid | An attached phidget handle. | |
deviceLabel | A pointer which will be set to a char array containing the device label string. |
int CPhidget_setDeviceLabel | ( | CPhidgetHandle | phid, | |
const char * | deviceLabel | |||
) |
Sets the label of a Phidget. Note that this is nut supported on very old Phidgets, and not yet supported in Windows.
phid | An attached phidget handle. | |
deviceLabel | A string containing the label to be set. |
int CPhidget_getErrorDescription | ( | int | errorCode, | |
const char ** | errorString | |||
) |
Gets the description for an error code.
errorCode | The error code to get the description of. | |
errorString | A pointer which will be set to a char array containing the error description string. |
int CPhidget_waitForAttachment | ( | CPhidgetHandle | phid, | |
int | milliseconds | |||
) |
Waits for attachment to happen. This can be called wirght after calling CPhidget_open, as an alternative to using the attach handler.
phid | An opened phidget handle. | |
milliseconds | Time to wait for the attachment. Specify 0 to wait forever. |
int CPhidget_getServerID | ( | CPhidgetHandle | phid, | |
const char ** | serverID | |||
) |
Gets the server ID of a remotely opened Phidget. This will fail if the Phidget was opened locally.
phid | A connected phidget handle. | |
serverID | A pointer which will be set to a char array containing the server ID string. |
int CPhidget_getServerAddress | ( | CPhidgetHandle | phid, | |
const char ** | address, | |||
int * | port | |||
) |
Gets the address and port of a remotely opened Phidget. This will fail if the Phidget was opened locally.
phid | A connected phidget handle. | |
address | A pointer which will be set to a char array containing the address string. | |
port | An int pointer for returning the port number. |
int CPhidget_getServerStatus | ( | CPhidgetHandle | phid, | |
int * | serverStatus | |||
) |
Gets the connected to server status of a remotely opened Phidget. This will fail if the Phidget was opened locally.
phid | An opened phidget handle. | |
serverStatus | An int pointer for returning the server status. Possible codes are PHIDGET_ATTACHED and PHIDGET_NOTATTACHED. |
int CPhidget_getDeviceID | ( | CPhidgetHandle | phid, | |
CPhidget_DeviceID * | deviceID | |||
) |
Gets the device ID of a Phidget.
phid | An attached phidget handle. | |
deviceID | The device ID constant. |
int CPhidget_getDeviceClass | ( | CPhidgetHandle | phid, | |
CPhidget_DeviceClass * | deviceClass | |||
) |
Gets the class of a Phidget Handle.
phid | A phidget handle. | |
deviceClass | The device class constant. |