Client API
[libplayerc]
Detailed Description
The client object manages the connection with the Player server; it is responsible for reading new data, setting data transmission modes and so on.The client object must be created and connected before device proxies are initialized.
Classes | |
struct | playerc_device_info_t |
Info about an available (but not necessarily subscribed) device. More... | |
struct | _playerc_client_t |
Client object data. More... | |
Typedefs | |
typedef void(* | playerc_putmsg_fn_t )(void *device, char *header, char *data) |
Typedef for proxy callback function. | |
typedef void(* | playerc_callback_fn_t )(void *data) |
Typedef for proxy callback function. | |
typedef _playerc_client_t | playerc_client_t |
Client object data. | |
Functions | |
playerc_client_t * | playerc_client_create (playerc_mclient_t *mclient, const char *host, int port) |
Create a client object. | |
void | playerc_client_destroy (playerc_client_t *client) |
Destroy a client object. | |
void | playerc_client_set_transport (playerc_client_t *client, unsigned int transport) |
Set the transport type. | |
int | playerc_client_connect (playerc_client_t *client) |
Connect to the server. | |
int | playerc_client_disconnect (playerc_client_t *client) |
Disconnect from the server. | |
int | playerc_client_datamode (playerc_client_t *client, uint8_t mode) |
Change the server's data delivery mode. | |
int | playerc_client_requestdata (playerc_client_t *client) |
Request a round of data. | |
int | playerc_client_set_replace_rule (playerc_client_t *client, int interf, int index, int type, int subtype, int replace) |
Set a replace rule for the client queue on the server. | |
int | playerc_client_adddevice (playerc_client_t *client, struct _playerc_device_t *device) |
Add a device proxy. | |
int | playerc_client_deldevice (playerc_client_t *client, struct _playerc_device_t *device) |
Remove a device proxy. | |
int | playerc_client_addcallback (playerc_client_t *client, struct _playerc_device_t *device, playerc_callback_fn_t callback, void *data) |
Add user callbacks (called when new data arrives). | |
int | playerc_client_delcallback (playerc_client_t *client, struct _playerc_device_t *device, playerc_callback_fn_t callback, void *data) |
Remove user callbacks (called when new data arrives). | |
int | playerc_client_get_devlist (playerc_client_t *client) |
Get the list of available device ids. | |
int | playerc_client_subscribe (playerc_client_t *client, int code, int index, int access, char *drivername, size_t len) |
Subscribe a device. | |
int | playerc_client_unsubscribe (playerc_client_t *client, int code, int index) |
Unsubscribe a device. | |
int | playerc_client_request (playerc_client_t *client, struct _playerc_device_t *device, uint8_t reqtype, void *req_data, void *rep_data, int rep_len) |
Issue a request to the server and await a reply (blocking). | |
int | playerc_client_peek (playerc_client_t *client, int timeout) |
Test to see if there is pending data. | |
void * | playerc_client_read (playerc_client_t *client) |
Read data from the server (blocking). | |
void | playerc_client_set_request_timeout (playerc_client_t *client, uint seconds) |
Set the timeout for client requests. | |
void | playerc_client_set_retry_limit (playerc_client_t *client, int limit) |
Set the connection retry limit. | |
void | playerc_client_set_retry_time (playerc_client_t *client, double time) |
Set the connection retry sleep time. | |
int | playerc_client_write (playerc_client_t *client, struct _playerc_device_t *device, uint8_t subtype, void *cmd, double *timestamp) |
Write data to the server. |
Function Documentation
|
Add user callbacks (called when new data arrives).
For internal use only.
|
|
Add a device proxy.
For internal use only.
|
|
Connect to the server.
|
|
Create a client object.
|
|
Change the server's data delivery mode. Be sure to read about data modes before using this function.
|
|
Remove user callbacks (called when new data arrives).
For internal use only.
|
|
Remove a device proxy.
For internal use only.
|
|
Destroy a client object.
|
|
Disconnect from the server.
|
|
Get the list of available device ids. This function queries the server for the list of available devices, and write result to the devinfos list in the client object.
|
|
Test to see if there is pending data.
|
|
Read data from the server (blocking).
|
|
Issue a request to the server and await a reply (blocking).
For internal use only.
|
|
Request a round of data.
Use playerc_client_datamode to change modes. |
|
Set a replace rule for the client queue on the server. If a rule with the same pattern already exists, it will be replaced with the new rule (i.e., its setting to replace will be updated).
|
|
Set the timeout for client requests.
|
|
Set the connection retry limit.
|
|
Set the connection retry sleep time.
|
|
Set the transport type.
|
|
Subscribe a device.
For internal use only.
|
|
Unsubscribe a device.
For internal use only.
|
|
Write data to the server.
For internal use only.
|