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.
Fork of mbed-libxively-6eca970 by
xively.h File Reference
Xively C library. More...
Go to the source code of this file.
Data Structures | |
| struct | xi_context_t |
| _The context structure_ - it's the first agument for all functions that communicate with Xively API (_i.e. More... | |
| struct | xi_response_t |
| _The response structure_ - it's the return type for all functions that communicate with Xively API (_i.e. More... | |
| union | xi_datapoint_value_t |
| The datapoint value union. More... | |
| struct | xi_timestamp_t |
| The datapoint timestamp. More... | |
| struct | xi_datapoint_t |
| _Xively datapoint structure_ - it contains value and timestamp More... | |
| struct | xi_feed_t |
| _Xively feed structure_ - it contains a fixed array of datastream More... | |
Enumerations | |
| enum | xi_protocol_t { XI_HTTP, XI_HTTPS, XI_TCP, XI_TCPS, XI_WS, XI_WSS } |
The protocols currently supported by Xively. More... | |
| enum | http_header_type_t { XI_HTTP_HEADER_DATE = 0, XI_HTTP_HEADER_CONTENT_TYPE, XI_HTTP_HEADER_CONTENT_LENGTH, XI_HTTP_HEADER_CONNECTION, XI_HTTP_HEADER_X_REQUEST_ID, XI_HTTP_HEADER_CACHE_CONTROL, XI_HTTP_HEADER_VARY, XI_HTTP_HEADER_COUNT, XI_HTTP_HEADER_AGE } |
HTTP headers. More... | |
| enum | xi_value_type_t { XI_VALUE_TYPE_I32 = 0, XI_VALUE_TYPE_F32, XI_VALUE_TYPE_STR } |
Datapoint value types. More... | |
Functions | |
| 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. | |
| xi_datapoint_t * | xi_set_value_f32 (xi_datapoint_t *dp, float v) |
| Sets the `xi_datapoint_t` value field to `float` value. | |
| xi_datapoint_t * | xi_set_value_str (xi_datapoint_t *dp, const char *v) |
| Sets the `xi_datapoint_t` value field to zero-terminated string value. | |
| void | xi_set_network_timeout (uint32_t milliseconds) |
| 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_update (xi_context_t *xi, const xi_feed_t *value) |
| Update Xively feed. | |
| const xi_response_t * | xi_feed_get (xi_context_t *xi, xi_feed_t *value) |
| Retrieve Xively feed. | |
| const xi_response_t * | xi_datastream_create (xi_context_t *xi, int32_t feed_id, const char *datastream_id, const xi_datapoint_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_t *value) |
| Update a datastream with given datapoint using server or local timestamp. | |
| const xi_response_t * | xi_datastream_get (xi_context_t *xi, int32_t feed_id, const char *datastream_id, xi_datapoint_t *dp) |
| Retrieve latest datapoint from a given datastream. | |
| const xi_response_t * | xi_datastream_delete (xi_context_t *xi, int feed_id, const char *datastream_id) |
| Delete datastream. | |
| 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. | |
| const xi_response_t * | xi_datapoint_delete_range (const xi_context_t *xi, int feed_id, const 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.
Definition in file xively.h.
Enumeration Type Documentation
| enum http_header_type_t |
HTTP headers.
- Enumerator:
| enum xi_protocol_t |
The protocols currently supported by Xively.
- Note:
- See source code for details of what's implemented.
| enum xi_value_type_t |
Function Documentation
| 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, | ||
| const 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_t * | value | ||
| ) |
| const xi_response_t* xi_datastream_delete | ( | xi_context_t * | xi, |
| int | feed_id, | ||
| const char * | datastream_id | ||
| ) |
Delete datastream.
- Warning:
- This function destroys the data in Xively and there is no way to restore it!
| const xi_response_t* xi_datastream_get | ( | xi_context_t * | xi, |
| int32_t | feed_id, | ||
| const char * | datastream_id, | ||
| xi_datapoint_t * | dp | ||
| ) |
| const xi_response_t* xi_datastream_update | ( | xi_context_t * | xi, |
| int32_t | feed_id, | ||
| const char * | datastream_id, | ||
| const xi_datapoint_t * | value | ||
| ) |
| void xi_delete_context | ( | xi_context_t * | context ) |
| const xi_response_t* xi_feed_get | ( | xi_context_t * | xi, |
| xi_feed_t * | value | ||
| ) |
| const xi_response_t* xi_feed_update | ( | xi_context_t * | xi, |
| const xi_feed_t * | value | ||
| ) |
| 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 02:16:23 by
1.7.2
