These calls are specific to the Phidget Manager. The Phidget Manager allows enumeration of all connected devices and notification of device attach and detach events.
typedef struct _CPhidgetManager CPhidgetManager |
typedef struct _CPhidgetManagerList CPhidgetManagerList |
typedef struct _CPhidgetManagerList * CPhidgetManagerListHandle |
enum CPhidgetManagerState |
A Phidget Manager handle.
Definition at line 18 of file cphidgetmanager.h.
int CPhidgetAttachEvent | ( | CPhidgetHandle | phid | ) |
Definition at line 54 of file cphidgetmanager.c.
int CPhidgetDetachEvent | ( | CPhidgetHandle | phid | ) |
Definition at line 82 of file cphidgetmanager.c.
int CPhidgetManager_areEqual | ( | void * | arg1, |
void * | arg2 | ||
) |
Definition at line 18 of file cphidgetmanager.c.
PHIDGET21_API int CCONV CPhidgetManager_close | ( | CPhidgetManagerHandle | phidm | ) |
Closes a Phidget Manager.
phidm | An opened phidget manager handle. |
Definition at line 276 of file cphidgetmanager.c.
PHIDGET21_API int CCONV CPhidgetManager_create | ( | CPhidgetManagerHandle * | phidm | ) |
Creates a Phidget Manager handle.
phidm | A pointer to an empty phidget manager handle. |
Definition at line 252 of file cphidgetmanager.c.
PHIDGET21_API int CCONV CPhidgetManager_delete | ( | CPhidgetManagerHandle | phidm | ) |
Frees a Phidget Manager handle.
phidm | A closed phidget manager handle. |
Definition at line 324 of file cphidgetmanager.c.
void CPhidgetManager_free | ( | void * | arg | ) |
Definition at line 24 of file cphidgetmanager.c.
PHIDGET21_API int CCONV CPhidgetManager_freeAttachedDevicesArray | ( | CPhidgetHandle | phidArray[] | ) |
Frees the array that is allocated when CPhidgetManager_getAttachedDevices is called. Since the array is malloced internally to the library, it should also be freed internally to the library.
phidArray | An array of CPhidgetHandles. |
Definition at line 428 of file cphidgetmanager.c.
PHIDGET21_API int CCONV CPhidgetManager_getAttachedDevices | ( | CPhidgetManagerHandle | phidm, |
CPhidgetHandle * | phidArray[], | ||
int * | count | ||
) |
Gets a list of all currently attached Phidgets. When you are finished with the list, free it with CPhidgetManager_freeAttachedDevicesArray.
phidm | An opened phidget manager handle. |
phidArray | An empty pointer for returning the list of Phidgets. Note that this list is created internally, you don't need to pass in a array. |
count | An int pointer for returning the list size |
Definition at line 435 of file cphidgetmanager.c.
PHIDGET21_API int CCONV CPhidgetManager_getServerAddress | ( | CPhidgetManagerHandle | phidm, |
const char ** | address, | ||
int * | port | ||
) |
Gets the address and port of a remotely opened Phidget Manager. This will fail if the manager was opened locally.
phidm | A connected phidget manager 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. |
Definition at line 334 of file cphidgetmanager.c.
PHIDGET21_API int CCONV CPhidgetManager_getServerID | ( | CPhidgetManagerHandle | phidm, |
const char ** | serverID | ||
) |
Gets the server ID of a remotely opened Phidget Manager. This will fail if the manager was opened locally.
phidm | A connected phidget manager handle. |
serverID | A pointer which will be set to a char array containing the server ID string. |
Definition at line 330 of file cphidgetmanager.c.
PHIDGET21_API int CCONV CPhidgetManager_getServerStatus | ( | CPhidgetManagerHandle | phidm, |
int * | serverStatus | ||
) |
Gets the connected to server status of a remotely opened Phidget Manager. This will fail if the manager was opened locally.
phidm | An opened phidget manager handle. |
serverStatus | An int pointer for returning the server status. Possible codes are PHIDGET_ATTACHED and PHIDGET_NOTATTACHED. |
Definition at line 338 of file cphidgetmanager.c.
PHIDGET21_API int CCONV CPhidgetManager_open | ( | CPhidgetManagerHandle | phidm | ) |
Opens a Phidget Manager.
phidm | A phidget manager handle. |
Definition at line 343 of file cphidgetmanager.c.
PHIDGET21_API int CCONV CPhidgetManager_openRemote | ( | CPhidgetManagerHandle | phidm, |
const char * | serverID, | ||
const char * | password | ||
) |
Opens a Phidget manager remotely by ServerID. Note that this requires Bonjour (mDNS) to be running on both the host and the server.
phidm | A phidget manager handle. |
serverID | Server ID. Specify NULL to open any. |
password | Password. Can be NULL if the server is running unsecured. |
Definition at line 2386 of file csocketopen.c.
PHIDGET21_API int CCONV CPhidgetManager_openRemoteIP | ( | CPhidgetManagerHandle | phidm, |
const char * | address, | ||
int | port, | ||
const char * | password | ||
) |
Opens a Phidget manager remotely by address and port.
phidm | A phidget manager handle. |
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. |
Definition at line 2325 of file csocketopen.c.
int CPhidgetManager_poll | ( | ) |
Definition at line 177 of file cphidgetmanager.c.
PHIDGET21_API int CCONV CPhidgetManager_set_OnAttach_Handler | ( | CPhidgetManagerHandle | phidm, |
int(CCONV *fptr)(CPhidgetHandle phid, void *userPtr) | , | ||
void * | userPtr | ||
) |
Sets an attach handler callback function. This is called when a Phidget is plugged into the system.
phidm | A phidget manager handle. |
fptr | Callback function pointer. |
userPtr | A pointer for use by the user - this value is passed back into the callback function. |
Definition at line 399 of file cphidgetmanager.c.
PHIDGET21_API int CCONV CPhidgetManager_set_OnDetach_Handler | ( | CPhidgetManagerHandle | phidm, |
int(CCONV *fptr)(CPhidgetHandle phid, void *userPtr) | , | ||
void * | userPtr | ||
) |
Sets a detach handler callback function. This is called when a Phidget is unplugged from the system.
phidm | A phidget manager handle. |
fptr | Callback function pointer. |
userPtr | A pointer for use by the user - this value is passed back into the callback function. |
Definition at line 406 of file cphidgetmanager.c.
PHIDGET21_API int CCONV CPhidgetManager_set_OnError_Handler | ( | CPhidgetManagerHandle | phidm, |
int(CCONV *fptr)(CPhidgetManagerHandle phidm, void *userPtr, int errorCode, const char *errorString) | , | ||
void * | userPtr | ||
) |
Sets the error handler callback function. This is called when an asynchronous error occurs.
phidm | A phidget manager handle. |
fptr | Callback function pointer. |
userPtr | A pointer for use by the user - this value is passed back into the callback function. |
PHIDGET21_API int CCONV CPhidgetManager_set_OnServerConnect_Handler | ( | CPhidgetManagerHandle | phidm, |
int(CCONV *fptr)(CPhidgetManagerHandle phidm, void *userPtr) | , | ||
void * | userPtr | ||
) |
Sets a server connect handler callback function. This is used for opening Phidget Managers remotely, and is called when a connection to the sever has been made.
phidm | A phidget manager handle. |
fptr | Callback function pointer. |
userPtr | A pointer for use by the user - this value is passed back into the callback function. |
Definition at line 413 of file cphidgetmanager.c.
PHIDGET21_API int CCONV CPhidgetManager_set_OnServerDisconnect_Handler | ( | CPhidgetManagerHandle | phidm, |
int(CCONV *fptr)(CPhidgetManagerHandle phidm, void *userPtr) | , | ||
void * | userPtr | ||
) |
Sets a server disconnect handler callback function. This is used for opening Phidget Managers remotely, and is called when a connection to the server has been lost.
phidm | A phidget manager handle. |
fptr | Callback function pointer. |
userPtr | A pointer for use by the user - this value is passed back into the callback function. |
Definition at line 420 of file cphidgetmanager.c.
Definition at line 12 of file cphidgetmanager.c.
Definition at line 11 of file cphidgetmanager.c.