These calls are specific to the Phidget Dictionary.
typedef struct _CPhidgetDictionary CPhidgetDictionary |
typedef int(CCONV * CPhidgetDictionary_OnKeyChange_Function)(CPhidgetDictionaryHandle dict, void *userPtr, const char *key, const char *value, CPhidgetDictionary_keyChangeReason reason) |
Callback function for KeyChange events.
dict | Dictionary from which this event originated. |
userPtr | User defined data. |
key | Key value. |
value | Value value. |
reason | Reason for KeyChange event. |
Definition at line 118 of file cphidgetdictionary.h.
typedef struct _CPhidgetDictionaryList CPhidgetDictionaryList |
typedef struct _CPhidgetDictionaryListener CPhidgetDictionaryListener |
A Phidget Dictionary handle. A Dictionary key listener handle.
typedef struct _CPhidgetDictionaryListenerList CPhidgetDictionaryListenerList |
typedef struct _CPhidgetDictionaryListenerList * CPhidgetDictionaryListenerListHandle |
typedef struct _CPhidgetDictionaryList * CPhidgetDictionaryListHandle |
Possible reasons for a key event.
Definition at line 13 of file cphidgetdictionary.h.
PHIDGET21_API int CCONV CPhidgetDictionary_addKey | ( | CPhidgetDictionaryHandle | dict, |
const char * | key, | ||
const char * | value, | ||
int | persistent | ||
) |
Adds a key/value pair to the dictionary. Or, changes an existing key's value.
dict | A connected dictionary handle. |
key | The key value. |
value | The value value. |
persistent | Whether the key stays in the dictionary after disconnection. |
Definition at line 127 of file cphidgetdictionary.c.
int CPhidgetDictionary_areEqual | ( | void * | arg1, |
void * | arg2 | ||
) |
Definition at line 17 of file cphidgetdictionary.c.
Closes the connection to a Phidget Dictionary.
dict | An opened phidget dictionary handle. |
Definition at line 74 of file cphidgetdictionary.c.
PHIDGET21_API int CCONV CPhidgetDictionary_create | ( | CPhidgetDictionaryHandle * | dict | ) |
Creates a Phidget Dictionary handle.
dict | A pointer to an unallocated phidget dictionary handle. |
Definition at line 56 of file cphidgetdictionary.c.
Frees a Phidget Dictionary handle.
dict | A closed dictionary handle. |
Definition at line 98 of file cphidgetdictionary.c.
void CPhidgetDictionary_free | ( | void * | arg | ) |
Definition at line 23 of file cphidgetdictionary.c.
PHIDGET21_API int CCONV CPhidgetDictionary_getKey | ( | CPhidgetDictionaryHandle | dict, |
const char * | key, | ||
char * | value, | ||
int | valuelen | ||
) |
Gets a key value. If more then one key matches, only the first value is returned.
dict | A phidget dictionary handle. |
key | A key value to look up. |
value | A user array for the value to be stored in. Set to NULL if the key does not exist. |
valuelen | Length of the value array. |
Definition at line 171 of file cphidgetdictionary.c.
PHIDGET21_API int CCONV CPhidgetDictionary_getServerAddress | ( | CPhidgetDictionaryHandle | dict, |
const char ** | address, | ||
int * | port | ||
) |
Gets the address and port.
dict | A connected dictionary 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 108 of file cphidgetdictionary.c.
PHIDGET21_API int CCONV CPhidgetDictionary_getServerID | ( | CPhidgetDictionaryHandle | dict, |
const char ** | serverID | ||
) |
Gets the server ID.
dict | A connected dictionary handle. |
serverID | A pointer which will be set to a char array containing the server ID string. |
Definition at line 104 of file cphidgetdictionary.c.
PHIDGET21_API int CCONV CPhidgetDictionary_getServerStatus | ( | CPhidgetDictionaryHandle | dict, |
int * | serverStatus | ||
) |
Gets the connected to server status.
dict | An opened dictionary handle. |
serverStatus | An int pointer for returning the server status. Possible codes are PHIDGET_ATTACHED and PHIDGET_NOTATTACHED. |
Definition at line 112 of file cphidgetdictionary.c.
PHIDGET21_API int CCONV CPhidgetDictionary_openRemote | ( | CPhidgetDictionaryHandle | dict, |
const char * | serverID, | ||
const char * | password | ||
) |
Opens a Phidget dictionary by ServerID. Note that this requires Bonjour (mDNS) to be running on both the host and the server.
dict | A phidget dictionary handle. |
serverID | Server ID. Specify NULL to open any. |
password | Password. Can be NULL if the server is running unsecured. |
Definition at line 2540 of file csocketopen.c.
PHIDGET21_API int CCONV CPhidgetDictionary_openRemoteIP | ( | CPhidgetDictionaryHandle | dict, |
const char * | address, | ||
int | port, | ||
const char * | password | ||
) |
Opens a Phidget dictionary by address and port.
dict | A phidget dictionary 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 2468 of file csocketopen.c.
PHIDGET21_API int CCONV CPhidgetDictionary_remove_OnKeyChange_Handler | ( | CPhidgetDictionaryListenerHandle | dictlistener | ) |
Removes a key listener.
dictlistener | The dictionary key listener created by CPhidgetDictionary_set_OnKeyChange_Handler |
Definition at line 310 of file cphidgetdictionary.c.
PHIDGET21_API int CCONV CPhidgetDictionary_removeKey | ( | CPhidgetDictionaryHandle | dict, |
const char * | pattern | ||
) |
Removes a set of keys from the dictionary.
dict | A connected dictionary handle. |
pattern | A regular expression representing th eset of keys to remove. |
Definition at line 146 of file cphidgetdictionary.c.
PHIDGET21_API int CCONV CPhidgetDictionary_set_OnError_Handler | ( | CPhidgetDictionaryHandle | dict, |
int(CCONV *fptr)(CPhidgetDictionaryHandle, void *userPtr, int errorCode, const char *errorString) | , | ||
void * | userPtr | ||
) |
Sets the error handler callback function. This is called when an asynchronous error occurs.
dict | A phidget dictionary 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 CPhidgetDictionary_set_OnKeyChange_Handler | ( | CPhidgetDictionaryHandle | dict, |
CPhidgetDictionaryListenerHandle * | dictlistener, | ||
const char * | pattern, | ||
CPhidgetDictionary_OnKeyChange_Function | fptr, | ||
void * | userPtr | ||
) |
Adds a key listener to an opened dictionary. Note that this should only be called after the connection to the dictionary has been made - unlike all other events.
dict | A connected dictionary handle. |
dictlistener | A pointer to an unallocated dictionary key listener handle. |
pattern | A regular expression representing the set of keys to monitor. |
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 CPhidgetDictionary_set_OnServerConnect_Handler | ( | CPhidgetDictionaryHandle | dict, |
int(CCONV *fptr)(CPhidgetDictionaryHandle dict, void *userPtr) | , | ||
void * | userPtr | ||
) |
Sets a server connect handler callback function. This is called when a connection to the sever has been made.
dict | A phidget dictionary 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 235 of file cphidgetdictionary.c.
PHIDGET21_API int CCONV CPhidgetDictionary_set_OnServerDisconnect_Handler | ( | CPhidgetDictionaryHandle | dict, |
int(CCONV *fptr)(CPhidgetDictionaryHandle dict, void *userPtr) | , | ||
void * | userPtr | ||
) |
Sets a server disconnect handler callback function. This is called when a connection to the server has been lost.
dict | A phidget dictionary 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 242 of file cphidgetdictionary.c.
int CPhidgetDictionaryListener_areEqual | ( | void * | arg1, |
void * | arg2 | ||
) |
Definition at line 41 of file cphidgetdictionary.c.
void CPhidgetDictionaryListener_free | ( | void * | arg | ) |
Definition at line 47 of file cphidgetdictionary.c.