Phidget Manager
|
Typedefs |
typedef struct _CPhidgetManager * | CPhidgetManagerHandle |
Functions |
int | CPhidgetManager_create (CPhidgetManagerHandle *phidm) |
int | CPhidgetManager_open (CPhidgetManagerHandle phidm) |
int | CPhidgetManager_close (CPhidgetManagerHandle phidm) |
int | CPhidgetManager_delete (CPhidgetManagerHandle phidm) |
int | CPhidgetManager_set_OnAttach_Handler (CPhidgetManagerHandle phidm, int(*fptr)(CPhidgetHandle phid, void *userPtr), void *userPtr) |
int | CPhidgetManager_set_OnDetach_Handler (CPhidgetManagerHandle phidm, int(*fptr)(CPhidgetHandle phid, void *userPtr), void *userPtr) |
int | CPhidgetManager_getAttachedDevices (CPhidgetManagerHandle phidm, CPhidgetHandle *phidArray[], int *count) |
int | CPhidgetManager_freeAttachedDevicesArray (CPhidgetHandle phidArray[]) |
int | CPhidgetManager_set_OnError_Handler (CPhidgetManagerHandle phidm, int(*fptr)(CPhidgetManagerHandle phidm, void *userPtr, int errorCode, const char *errorString), void *userPtr) |
int | CPhidgetManager_set_OnServerConnect_Handler (CPhidgetManagerHandle phidm, int(*fptr)(CPhidgetManagerHandle phidm, void *userPtr), void *userPtr) |
int | CPhidgetManager_set_OnServerDisconnect_Handler (CPhidgetManagerHandle phidm, int(*fptr)(CPhidgetManagerHandle phidm, void *userPtr), void *userPtr) |
int | CPhidgetManager_getServerID (CPhidgetManagerHandle phidm, const char **serverID) |
int | CPhidgetManager_getServerAddress (CPhidgetManagerHandle phidm, const char **address, int *port) |
int | CPhidgetManager_getServerStatus (CPhidgetManagerHandle phidm, int *serverStatus) |
int | CPhidgetManager_openRemote (CPhidgetManagerHandle phidm, const char *serverID, const char *password) |
int | CPhidgetManager_openRemoteIP (CPhidgetManagerHandle phidm, const char *address, int port, const char *password) |
Detailed Description
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 Documentation
A Phidget Manager handle. A Phidget Manager handle
Function Documentation
Creates a Phidget Manager handle.
- Parameters:
-
| phidm | A pointer to an empty phidget manager handle. |
Opens a Phidget Manager.
- Parameters:
-
| phidm | A phidget manager handle. |
Closes a Phidget Manager.
- Parameters:
-
| phidm | An opened phidget manager handle. |
Frees a Phidget Manager handle.
- Parameters:
-
| phidm | A closed phidget manager handle. |
Sets an attach handler callback function. This is called when a Phidget is plugged into the system.
- Parameters:
-
| 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. |
Sets a detach handler callback function. This is called when a Phidget is unplugged from the system.
- Parameters:
-
| 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. |
Gets a list of all currently attached Phidgets. When you are finished with the list, free it with CPhidgetManager_freeAttachedDevicesArray.
- Parameters:
-
| 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 |
int 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.
- Parameters:
-
| phidArray | An array of CPhidgetHandles. |
Sets the error handler callback function. This is called when an asynchronous error occurs.
- Parameters:
-
| 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. |
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.
- Parameters:
-
| 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. |
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.
- Parameters:
-
| 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. |
Gets the server ID of a remotely opened Phidget Manager. This will fail if the manager was opened locally.
- Parameters:
-
| phidm | A connected phidget manager handle. |
| serverID | A pointer which will be set to a char array containing the server ID string. |
Gets the address and port of a remotely opened Phidget Manager. This will fail if the manager was opened locally.
- Parameters:
-
| 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. |
Gets the connected to server status of a remotely opened Phidget Manager. This will fail if the manager was opened locally.
- Parameters:
-
int 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.
- Parameters:
-
| phidm | A phidget manager handle. |
| serverID | Server ID. Specify NULL to open any. |
| password | Password. Can be NULL if the server is running unsecured. |
int CPhidgetManager_openRemoteIP |
( |
CPhidgetManagerHandle |
phidm, |
|
|
const char * |
address, |
|
|
int |
port, |
|
|
const char * |
password | |
|
) |
| | |
Opens a Phidget manager remotely by address and port.
- Parameters:
-
| 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. |