Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: xively-jumpstart-demo
xively.c File Reference
Xively C library [see xively.h]. More...
Go to the source code of this file.
Functions | |
| const comm_layer_t * | get_comm_layer (void) |
| Get instance of _communication layer_. | |
| xi_datapoint_t * | xi_set_value_i32 (xi_datapoint_t *p, int32_t value) |
| Sets the xi_datapoint_t value field to `int32_t` value. | |
| xi_datapoint_t * | xi_set_value_f32 (xi_datapoint_t *p, float value) |
| Sets the `xi_datapoint_t` value field to `float` value. | |
| xi_datapoint_t * | xi_set_value_str (xi_datapoint_t *p, const char *value) |
| Sets the `xi_datapoint_t` value field to zero-terminated string value. | |
| void | xi_set_network_timeout (uint32_t timeout) |
| Sets the timeout for network operations. | |
| uint32_t | xi_get_network_timeout (void) |
| Gets the current network timeout. | |
| xi_context_t * | xi_create_context (xi_protocol_t protocol, const char *api_key, int32_t feed_id) |
| Library context constructor. | |
| void | xi_delete_context (xi_context_t *context) |
| Library context destructor. | |
| const xi_response_t * | xi_feed_get (xi_context_t *xi, xi_feed_t *feed) |
| Retrieve Xively feed. | |
| const xi_response_t * | xi_feed_update (xi_context_t *xi, const xi_feed_t *feed) |
| Update Xively feed. | |
| const xi_response_t * | xi_datastream_get (xi_context_t *xi, int32_t feed_id, const char *datastream_id, xi_datapoint_t *o) |
| Retrieve latest datapoint from a given datastream. | |
| const xi_response_t * | xi_datastream_create (xi_context_t *xi, int32_t feed_id, const char *datastream_id, const xi_datapoint_value_t *value) |
| Create a datastream with given value using server timestamp. | |
| const xi_response_t * | xi_datastream_update (xi_context_t *xi, int32_t feed_id, const char *datastream_id, const xi_datapoint_value_t *value) |
| Update a datastream with given datapoint using server or local timestamp. | |
| const xi_response_t * | xi_datapoint_delete (const xi_context_t *xi, int feed_id, const char *datastream_id, const xi_datapoint_t *o) |
| Delete datapoint at a given timestamp. | |
| const xi_response_t * | xi_datapoint_delete_range (const xi_context_t *xi, int feed_id, char *datastream_id, const xi_timestamp_t *start, const xi_timestamp_t *end) |
| Delete all datapoints in given time range. | |
Detailed Description
Xively C library [see xively.h].
Definition in file xively.c.
Function Documentation
| const comm_layer_t* get_comm_layer | ( | void | ) |
Get instance of _communication layer_.
- Note:
- Although the interface is of the _communication layer_ should stay the same, some implemantation may differ.
- Returns:
- Pointer to the communication layer interface
Get instance of _communication layer_.
Initialise an implementation of the _communication layer_.
Definition at line 16 of file mbed_comm_layer.c.
| xi_context_t* xi_create_context | ( | xi_protocol_t | protocol, |
| const char * | api_key, | ||
| int32_t | feed_id | ||
| ) |
| const xi_response_t* xi_datapoint_delete | ( | const xi_context_t * | xi, |
| int | feed_id, | ||
| const char * | datastream_id, | ||
| const xi_datapoint_t * | dp | ||
| ) |
Delete datapoint at a given timestamp.
- Warning:
- This function destroys the data in Xively and there is no way to restore it!
- Note:
- You need to provide exact timestamp value to guarantee successful response from the API, i.e. it will respond with error 404 if datapoint didn't exist. If you need to determine the exact timestamp, it may be easier to call `xi_datapoint_delete_range()` with short range instead.
| const xi_response_t* xi_datapoint_delete_range | ( | const xi_context_t * | xi, |
| int | feed_id, | ||
| char * | datastream_id, | ||
| const xi_timestamp_t * | start, | ||
| const xi_timestamp_t * | end | ||
| ) |
| const xi_response_t* xi_datastream_create | ( | xi_context_t * | xi, |
| int32_t | feed_id, | ||
| const char * | datastream_id, | ||
| const xi_datapoint_value_t * | value | ||
| ) |
| const xi_response_t* xi_datastream_get | ( | xi_context_t * | xi, |
| int32_t | feed_id, | ||
| const char * | datastream_id, | ||
| xi_datapoint_t * | o | ||
| ) |
| const xi_response_t* xi_datastream_update | ( | xi_context_t * | xi, |
| int32_t | feed_id, | ||
| const char * | datastream_id, | ||
| const xi_datapoint_value_t * | value | ||
| ) |
| void xi_delete_context | ( | xi_context_t * | context ) |
| const xi_response_t* xi_feed_get | ( | xi_context_t * | xi, |
| xi_feed_t * | feed | ||
| ) |
| const xi_response_t* xi_feed_update | ( | xi_context_t * | xi, |
| const xi_feed_t * | feed | ||
| ) |
| uint32_t xi_get_network_timeout | ( | void | ) |
| void xi_set_network_timeout | ( | uint32_t | milliseconds ) |
Sets the timeout for network operations.
- Note:
- The timeout is used by the comunication layer to determine whenever it should treat the lag in a connection as an error, so if your device or your connection is slow, you can try to increase the timeout for network operations. It only affects the send/recv operations it does not work with connect but that behaviour may differ between platforms and communication layer imlementations.
| xi_datapoint_t* xi_set_value_f32 | ( | xi_datapoint_t * | dp, |
| float | v | ||
| ) |
| xi_datapoint_t* xi_set_value_i32 | ( | xi_datapoint_t * | dp, |
| int32_t | v | ||
| ) |
Sets the xi_datapoint_t value field to `int32_t` value.
- Returns:
- Pointer or `0` if an error occurred.
| xi_datapoint_t* xi_set_value_str | ( | xi_datapoint_t * | dp, |
| const char * | v | ||
| ) |
Generated on Wed Jul 13 2022 17:00:33 by
1.7.2