Webcom C SDK
|
typedef void(* | wc_on_req_result_t) (wc_context_t *cnx, int64_t id, wc_action_type_t type, wc_req_pending_result_t status, char *reason, char *data, void *user) |
int64_t | wc_datasync_put (wc_context_t *cnx, char *path, char *json, wc_on_req_result_t callback, void *user) |
int64_t | wc_datasync_merge (wc_context_t *cnx, char *path, char *json, wc_on_req_result_t callback, void *user) |
int64_t | wc_datasync_push (wc_context_t *cnx, char *path, char *json, wc_on_req_result_t callback, void *user) |
int64_t | wc_datasync_listen (wc_context_t *cnx, char *path, wc_on_req_result_t callback, void *user) |
int64_t | wc_datasync_unlisten (wc_context_t *cnx, char *path, wc_on_req_result_t callback, void *user) |
int64_t | wc_datasync_auth (wc_context_t *cnx, char *cred, wc_on_req_result_t callback, void *user) |
int64_t | wc_datasync_unauth (wc_context_t *cnx, wc_on_req_result_t callback, void *user) |
int64_t | wc_datasync_on_disc_put (wc_context_t *cnx, char *path, char *json, wc_on_req_result_t callback, void *user) |
int64_t | wc_datasync_on_disc_merge (wc_context_t *cnx, char *path, char *json, wc_on_req_result_t callback, void *user) |
int64_t | wc_datasync_on_disc_cancel (wc_context_t *cnx, char *path, wc_on_req_result_t callback, void *user) |
typedef void(* wc_on_req_result_t) (wc_context_t *cnx, int64_t id, wc_action_type_t type, wc_req_pending_result_t status, char *reason, char *data, void *user) |
callback type for request status notification
cnx | the webcomm connection |
id | the request id |
type | what kind of action (wc_action_type_t) is this notification about |
status | did the request succeed (WC_REQ_OK) or failed (WC_REQ_ERROR) |
reason | the success or error reason string |
data | some optional JSON data from the server |
int64_t wc_datasync_auth | ( | wc_context_t * | cnx, |
char * | cred, | ||
wc_on_req_result_t | callback, | ||
void * | user | ||
) |
sends an authentication request to the webcom server and get notified of the status
cnx | the webcom connection |
callback | callback that will be called when the status of the request is sent back from the server |
cred | a string containing the secret token |
user | a custom pointer that will be passed to the callback |
int64_t wc_datasync_listen | ( | wc_context_t * | cnx, |
char * | path, | ||
wc_on_req_result_t | callback, | ||
void * | user | ||
) |
sends a listen request to the webcom server and get notified of the status
This function builds and sends a listen request to the webcom server.
cnx | the webcom connection |
callback | callback that will be called when the status of the request is sent back from the server |
path | a string representing the path to listen to |
user | a custom pointer that will be passed to the callback |
int64_t wc_datasync_merge | ( | wc_context_t * | cnx, |
char * | path, | ||
char * | json, | ||
wc_on_req_result_t | callback, | ||
void * | user | ||
) |
sends a data merge request to the webcom server and get notified of the status
This function builds and sends a data merge request to the webcom server.
cnx | the webcom connection |
callback | callback that will be called when the status of the request is sent back from the server |
path | a string representing the path of the data |
json | a string containing the JSON-encoded data to merge on the server at the given path |
user | a custom pointer that will be passed to the callback |
int64_t wc_datasync_on_disc_cancel | ( | wc_context_t * | cnx, |
char * | path, | ||
wc_on_req_result_t | callback, | ||
void * | user | ||
) |
sends an on-disconnect-cancel request to the webcom server and get notified of the status
cnx | the webcom connection |
callback | callback that will be called when the status of the request is sent back from the server |
path | a string representing the path of the data |
user | a custom pointer that will be passed to the callback |
int64_t wc_datasync_on_disc_merge | ( | wc_context_t * | cnx, |
char * | path, | ||
char * | json, | ||
wc_on_req_result_t | callback, | ||
void * | user | ||
) |
sends an on-disconnect-merge request to the webcom server and get notified of the status
cnx | the webcom connection |
callback | callback that will be called when the status of the request is sent back from the server |
path | a string representing the path of the data |
json | a string containing the JSON-encoded data to merge on the server at the given path on disconnection |
user | a custom pointer that will be passed to the callback |
int64_t wc_datasync_on_disc_put | ( | wc_context_t * | cnx, |
char * | path, | ||
char * | json, | ||
wc_on_req_result_t | callback, | ||
void * | user | ||
) |
sends an on-disconnect-put request to the webcom server and get notified of the status
cnx | the webcom connection |
callback | callback that will be called when the status of the request is sent back from the server |
path | a string representing the path of the data |
json | a string containing the JSON-encoded data to store on the server at the given path on disconnection |
user | a custom pointer that will be passed to the callback |
int64_t wc_datasync_push | ( | wc_context_t * | cnx, |
char * | path, | ||
char * | json, | ||
wc_on_req_result_t | callback, | ||
void * | user | ||
) |
sends a data push request to the webcom server and get notified of the status
This function builds and sends a data push request to the webcom server. It slightly differs from the put request: in the push case, the SDK adds a unique, time-ordered, partly random key to the path and sends a put request to this new path.
cnx | the webcom connection |
callback | callback that will be called when the status of the request is sent back from the server |
path | a string representing the path of the data |
json | a string containing the JSON-encoded data to push |
user | a custom pointer that will be passed to the callback |
int64_t wc_datasync_put | ( | wc_context_t * | cnx, |
char * | path, | ||
char * | json, | ||
wc_on_req_result_t | callback, | ||
void * | user | ||
) |
sends a data put request to the webcom server and get notified of the status
This function builds and sends a data put request to the webcom server.
cnx | the webcom connection |
callback | callback that will be called when the status of the request is sent back from the server |
path | a string representing the path of the data |
json | a string containing the JSON-encoded data to store on the server at the given path |
user | a custom pointer that will be passed to the callback |
int64_t wc_datasync_unauth | ( | wc_context_t * | cnx, |
wc_on_req_result_t | callback, | ||
void * | user | ||
) |
sends a un-authentication request to the webcom server and get notified of the status
cnx | the webcom connection |
callback | callback that will be called when the status of the request is sent back from the server |
user | a custom pointer that will be passed to the callback |
int64_t wc_datasync_unlisten | ( | wc_context_t * | cnx, |
char * | path, | ||
wc_on_req_result_t | callback, | ||
void * | user | ||
) |
sends a un-listen request to the webcom server and get notified of the status
This function builds and sends a un-listen request to the webcom server, to stop listening a given path.
cnx | the webcom connection |
callback | callback that will be called when the status of the request is sent back from the server |
path | a string representing the path |
user | a custom pointer that will be passed to the callback |