|
Tizen IoT Extension SDK 1.0
1.0.1
|
The Payload API provides functions for handling resource payloads. More...
Typedefs | |
|
typedef struct smartthings_payload_s * | smartthings_payload_h |
| The SmartThings payload handle. 1. | |
Functions | |
| int | smartthings_payload_create (smartthings_payload_h *payload) |
| Creates a SmartThings payload handle. 1. | |
| int | smartthings_payload_destroy (smartthings_payload_h payload) |
| Destroys a SmartThings payload handle and releases all its resources. 1. | |
| int | smartthings_payload_set_int (smartthings_payload_h payload, const char *attr_name, int value) |
| Sets an integer value for the attribute name. 1. | |
| int | smartthings_payload_set_bool (smartthings_payload_h payload, const char *attr_name, bool value) |
| Sets a boolean value for the attribute name. 1. | |
| int | smartthings_payload_set_double (smartthings_payload_h payload, const char *attr_name, double value) |
| Sets a double value for the attribute name. 1. | |
| int | smartthings_payload_set_string (smartthings_payload_h payload, const char *attr_name, const char *value) |
| Sets a string value for the attribute name. 1. | |
| int | smartthings_payload_set_byte_string (smartthings_payload_h payload, const char *attr_name, const char *value, unsigned int length) |
| Sets a byte string value and length for the attribute name. 1. | |
| int | smartthings_payload_set_object (smartthings_payload_h payload, const char *attr_name, smartthings_payload_h value) |
| Sets an object value for the attribute name. 1. | |
| int | smartthings_payload_set_int_array (smartthings_payload_h payload, const char *attr_name, const int *array, unsigned int length) |
| Sets an integer array for the attribute name. 1. | |
| int | smartthings_payload_set_bool_array (smartthings_payload_h payload, const char *attr_name, const bool *array, unsigned int length) |
| Sets a boolean array for the attribute name. 1. | |
| int | smartthings_payload_set_double_array (smartthings_payload_h payload, const char *attr_name, const double *array, unsigned int length) |
| Sets a double array for the attribute name. 1. | |
| int | smartthings_payload_set_string_array (smartthings_payload_h payload, const char *attr_name, const char **array, unsigned int length) |
| Sets a string array for the attribute name. 1. | |
| int | smartthings_payload_set_object_array (smartthings_payload_h payload, const char *attr_name, smartthings_payload_h *array, unsigned int length) |
| Sets an object array for the attribute name. 1. | |
| int | smartthings_payload_add_collection_object (smartthings_payload_h payload, const char *resource_uri, smartthings_payload_h value) |
| Adds a payload for child resource of collection resource. 1. | |
| int | smartthings_payload_get_int (smartthings_payload_h payload, const char *attr_name, int *value) |
| Gets an integer value for the attribute name. 1. | |
| int | smartthings_payload_get_bool (smartthings_payload_h payload, const char *attr_name, bool *value) |
| Gets a boolean value for the attribute name. 1. | |
| int | smartthings_payload_get_double (smartthings_payload_h payload, const char *attr_name, double *value) |
| Gets a double value for the attribute name. 1. | |
| int | smartthings_payload_get_string (smartthings_payload_h payload, const char *attr_name, char **value) |
| Gets a string value for the attribute name. 1. | |
| int | smartthings_payload_get_byte_string (smartthings_payload_h payload, const char *attr_name, char **value, unsigned int *length) |
| Gets a byte string value and length for the attribute name. 1. | |
| int | smartthings_payload_get_object (smartthings_payload_h payload, const char *attr_name, smartthings_payload_h *value) |
| Gets an object value for the attribute name. 1. | |
| int | smartthings_payload_get_int_array (smartthings_payload_h payload, const char *attr_name, int **array, unsigned int *length) |
| Gets an integer array for the attribute name. 1. | |
| int | smartthings_payload_get_bool_array (smartthings_payload_h payload, const char *attr_name, bool **array, unsigned int *length) |
| Gets a boolean array for the attribute name. 1. | |
| int | smartthings_payload_get_double_array (smartthings_payload_h payload, const char *attr_name, double **array, unsigned int *length) |
| Gets a double array for the attribute name. 1. | |
| int | smartthings_payload_get_string_array (smartthings_payload_h payload, const char *attr_name, char ***array, unsigned int *length) |
| Gets a string array for the attribute name. 1. | |
| int | smartthings_payload_get_object_array (smartthings_payload_h payload, const char *attr_name, smartthings_payload_h **array, unsigned int *length) |
| Gets an object array for the attribute name. 1. | |
| int | smartthings_payload_get_collection_object (smartthings_payload_h payload, const char *resource_uri, smartthings_payload_h *value) |
| Gets a payload for child resource of collection resource. 1. | |
| int | smartthings_payload_release_int_array (int *array) |
| Releases an integer array of the SmartThings payload. 1. | |
| int | smartthings_payload_release_bool_array (bool *array) |
| Releases a boolean array of the SmartThings payload. 1. | |
| int | smartthings_payload_release_double_array (double *array) |
| Releases a double array of the SmartThings payload. 1. | |
| int | smartthings_payload_release_string_array (char **array, unsigned int length) |
| Releases a string array of the SmartThings payload. 1. | |
| int | smartthings_payload_release_object_array (smartthings_payload_h *array, unsigned int length) |
| Releases an object array of the SmartThings payload. 1. | |
| int | smartthings_payload_release_object (smartthings_payload_h payload) |
| Releases a SmartThings payload. 1. | |
The Payload API provides functions for handling resource payloads.
#include <smartthings_payload.h>
The SmartThings Thing Payload API provides the following functionalities:
| int smartthings_payload_add_collection_object | ( | smartthings_payload_h | payload, |
| const char * | resource_uri, | ||
| smartthings_payload_h | value | ||
| ) |
Adds a payload for child resource of collection resource. 1.
| [in] | payload | The SmartThings payload handle |
| [in] | resource_uri | The resource URI of child resource |
| [in] | value | The payload associated with the given resource URI |
0 on success, otherwise a negative error value | SMARTTHINGS_RESOURCE_ERROR_NONE | Successful |
| SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER | Invalid parameter |
| int smartthings_payload_create | ( | smartthings_payload_h * | payload | ) |
Creates a SmartThings payload handle. 1.
| [out] | payload | The SmartThings payload handle to be newly created on success |
0 on success, otherwise a negative error value | SMARTTHINGS_RESOURCE_ERROR_NONE | Successful |
| SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER | Invalid parameter |
| SMARTTHINGS_RESOURCE_ERROR_OUT_OF_MEMORY | Out of memory |
| int smartthings_payload_destroy | ( | smartthings_payload_h | payload | ) |
Destroys a SmartThings payload handle and releases all its resources. 1.
| [in] | payload | The SmartThings payload handle |
0 on success, otherwise a negative error value | SMARTTHINGS_RESOURCE_ERROR_NONE | Successful |
| SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER | Invalid parameter |
| int smartthings_payload_get_bool | ( | smartthings_payload_h | payload, |
| const char * | attr_name, | ||
| bool * | value | ||
| ) |
Gets a boolean value for the attribute name. 1.
| [in] | payload | The SmartThings payload handle |
| [in] | attr_name | The attribute name |
| [out] | value | The value associated with the given attribute name |
0 on success, otherwise a negative error value | SMARTTHINGS_RESOURCE_ERROR_NONE | Successful |
| SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER | Invalid parameter |
| SMARTTHINGS_RESOURCE_ERROR_NO_DATA | No data |
| int smartthings_payload_get_bool_array | ( | smartthings_payload_h | payload, |
| const char * | attr_name, | ||
| bool ** | array, | ||
| unsigned int * | length | ||
| ) |
Gets a boolean array for the attribute name. 1.
| [in] | payload | The SmartThings payload handle |
| [in] | attr_name | The attribute name |
| [out] | array | The array associated with the given attribute name |
| [out] | length | The length of array |
0 on success, otherwise a negative error value | SMARTTHINGS_RESOURCE_ERROR_NONE | Successful |
| SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER | Invalid parameter |
| SMARTTHINGS_RESOURCE_ERROR_OUT_OF_MEMORY | Out of memory |
| SMARTTHINGS_RESOURCE_ERROR_NO_DATA | No data |
| int smartthings_payload_get_byte_string | ( | smartthings_payload_h | payload, |
| const char * | attr_name, | ||
| char ** | value, | ||
| unsigned int * | length | ||
| ) |
Gets a byte string value and length for the attribute name. 1.
| [in] | payload | The SmartThings payload handle |
| [in] | attr_name | The attribute name |
| [out] | value | The value associated with the given attribute name |
| [out] | length | The size of value |
0 on success, otherwise a negative error value | SMARTTHINGS_RESOURCE_ERROR_NONE | Successful |
| SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER | Invalid parameter |
| SMARTTHINGS_RESOURCE_ERROR_NO_DATA | No data |
| int smartthings_payload_get_collection_object | ( | smartthings_payload_h | payload, |
| const char * | resource_uri, | ||
| smartthings_payload_h * | value | ||
| ) |
Gets a payload for child resource of collection resource. 1.
| [in] | payload | The SmartThings payload handle |
| [in] | resource_uri | The resource URI of child resource |
| [out] | value | The payload associated with the given resource URI |
0 on success, otherwise a negative error value | SMARTTHINGS_RESOURCE_ERROR_NONE | Successful |
| SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER | Invalid parameter |
| SMARTTHINGS_RESOURCE_ERROR_OUT_OF_MEMORY | Out of memory |
| SMARTTHINGS_RESOURCE_ERROR_NO_DATA | No data |
| int smartthings_payload_get_double | ( | smartthings_payload_h | payload, |
| const char * | attr_name, | ||
| double * | value | ||
| ) |
Gets a double value for the attribute name. 1.
| [in] | payload | The SmartThings payload handle |
| [in] | attr_name | The attribute name |
| [out] | value | The value associated with the given attribute name |
0 on success, otherwise a negative error value | SMARTTHINGS_RESOURCE_ERROR_NONE | Successful |
| SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER | Invalid parameter |
| SMARTTHINGS_RESOURCE_ERROR_NO_DATA | No data |
| int smartthings_payload_get_double_array | ( | smartthings_payload_h | payload, |
| const char * | attr_name, | ||
| double ** | array, | ||
| unsigned int * | length | ||
| ) |
Gets a double array for the attribute name. 1.
| [in] | payload | The SmartThings payload handle |
| [in] | attr_name | The attribute name |
| [out] | array | The array associated with the given attribute name |
| [out] | length | The length of array |
0 on success, otherwise a negative error value | SMARTTHINGS_RESOURCE_ERROR_NONE | Successful |
| SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER | Invalid parameter |
| SMARTTHINGS_RESOURCE_ERROR_OUT_OF_MEMORY | Out of memory |
| SMARTTHINGS_RESOURCE_ERROR_NO_DATA | No data |
| int smartthings_payload_get_int | ( | smartthings_payload_h | payload, |
| const char * | attr_name, | ||
| int * | value | ||
| ) |
Gets an integer value for the attribute name. 1.
| [in] | payload | The SmartThings payload handle |
| [in] | attr_name | The attribute name |
| [out] | value | The value associated with the given attribute name |
0 on success, otherwise a negative error value | SMARTTHINGS_RESOURCE_ERROR_NONE | Successful |
| SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER | Invalid parameter |
| SMARTTHINGS_RESOURCE_ERROR_NO_DATA | No data |
| int smartthings_payload_get_int_array | ( | smartthings_payload_h | payload, |
| const char * | attr_name, | ||
| int ** | array, | ||
| unsigned int * | length | ||
| ) |
Gets an integer array for the attribute name. 1.
| [in] | payload | The SmartThings payload handle |
| [in] | attr_name | The attribute name |
| [out] | array | The array associated with the given attribute name |
| [out] | length | The length of array |
0 on success, otherwise a negative error value | SMARTTHINGS_RESOURCE_ERROR_NONE | Successful |
| SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER | Invalid parameter |
| SMARTTHINGS_RESOURCE_ERROR_OUT_OF_MEMORY | Out of memory |
| SMARTTHINGS_RESOURCE_ERROR_NO_DATA | No data |
| int smartthings_payload_get_object | ( | smartthings_payload_h | payload, |
| const char * | attr_name, | ||
| smartthings_payload_h * | value | ||
| ) |
Gets an object value for the attribute name. 1.
| [in] | payload | The SmartThings payload handle |
| [in] | attr_name | The attribute name |
| [out] | value | The value associated with the given attribute name |
0 on success, otherwise a negative error value | SMARTTHINGS_RESOURCE_ERROR_NONE | Successful |
| SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER | Invalid parameter |
| SMARTTHINGS_RESOURCE_ERROR_OUT_OF_MEMORY | Out of memory |
| SMARTTHINGS_RESOURCE_ERROR_NO_DATA | No data |
| int smartthings_payload_get_object_array | ( | smartthings_payload_h | payload, |
| const char * | attr_name, | ||
| smartthings_payload_h ** | array, | ||
| unsigned int * | length | ||
| ) |
Gets an object array for the attribute name. 1.
| [in] | payload | The SmartThings payload handle |
| [in] | attr_name | The attribute name |
| [out] | array | The array associated with the given attribute name |
| [out] | length | The length of array |
0 on success, otherwise a negative error value | SMARTTHINGS_RESOURCE_ERROR_NONE | Successful |
| SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER | Invalid parameter |
| SMARTTHINGS_RESOURCE_ERROR_OUT_OF_MEMORY | Out of memory |
| SMARTTHINGS_RESOURCE_ERROR_NO_DATA | No data |
| int smartthings_payload_get_string | ( | smartthings_payload_h | payload, |
| const char * | attr_name, | ||
| char ** | value | ||
| ) |
Gets a string value for the attribute name. 1.
| [in] | payload | The SmartThings payload handle |
| [in] | attr_name | The attribute name |
| [out] | value | The value associated with the given attribute name |
0 on success, otherwise a negative error value | SMARTTHINGS_RESOURCE_ERROR_NONE | Successful |
| SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER | Invalid parameter |
| SMARTTHINGS_RESOURCE_ERROR_NO_DATA | No data |
| int smartthings_payload_get_string_array | ( | smartthings_payload_h | payload, |
| const char * | attr_name, | ||
| char *** | array, | ||
| unsigned int * | length | ||
| ) |
Gets a string array for the attribute name. 1.
| [in] | payload | The SmartThings payload handle |
| [in] | attr_name | The attribute name |
| [out] | array | The array associated with the given attribute name |
| [out] | length | The length of array |
0 on success, otherwise a negative error value | SMARTTHINGS_RESOURCE_ERROR_NONE | Successful |
| SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER | Invalid parameter |
| SMARTTHINGS_RESOURCE_ERROR_OUT_OF_MEMORY | Out of memory |
| SMARTTHINGS_RESOURCE_ERROR_NO_DATA | No data |
| int smartthings_payload_release_bool_array | ( | bool * | array | ) |
Releases a boolean array of the SmartThings payload. 1.
| [in] | array | The array to release |
0 on success, otherwise a negative error value | SMARTTHINGS_RESOURCE_ERROR_NONE | Successful |
| SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER | Invalid parameter |
| int smartthings_payload_release_double_array | ( | double * | array | ) |
Releases a double array of the SmartThings payload. 1.
| [in] | array | The array to release |
0 on success, otherwise a negative error value | SMARTTHINGS_RESOURCE_ERROR_NONE | Successful |
| SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER | Invalid parameter |
| int smartthings_payload_release_int_array | ( | int * | array | ) |
Releases an integer array of the SmartThings payload. 1.
| [in] | array | The array to release |
0 on success, otherwise a negative error value | SMARTTHINGS_RESOURCE_ERROR_NONE | Successful |
| SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER | Invalid parameter |
| int smartthings_payload_release_object | ( | smartthings_payload_h | payload | ) |
Releases a SmartThings payload. 1.
| [in] | payload | The payload to release |
0 on success, otherwise a negative error value | SMARTTHINGS_RESOURCE_ERROR_NONE | Successful |
| SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER | Invalid parameter |
| int smartthings_payload_release_object_array | ( | smartthings_payload_h * | array, |
| unsigned int | length | ||
| ) |
Releases an object array of the SmartThings payload. 1.
| [in] | array | The array to release |
| [in] | length | The length of array |
0 on success, otherwise a negative error value | SMARTTHINGS_RESOURCE_ERROR_NONE | Successful |
| SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER | Invalid parameter |
| int smartthings_payload_release_string_array | ( | char ** | array, |
| unsigned int | length | ||
| ) |
Releases a string array of the SmartThings payload. 1.
| [in] | array | The array to release |
| [in] | length | The length of array |
0 on success, otherwise a negative error value | SMARTTHINGS_RESOURCE_ERROR_NONE | Successful |
| SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER | Invalid parameter |
| int smartthings_payload_set_bool | ( | smartthings_payload_h | payload, |
| const char * | attr_name, | ||
| bool | value | ||
| ) |
Sets a boolean value for the attribute name. 1.
| [in] | payload | The SmartThings payload handle |
| [in] | attr_name | The attribute name |
| [in] | value | The value to set |
0 on success, otherwise a negative error value | SMARTTHINGS_RESOURCE_ERROR_NONE | Successful |
| SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER | Invalid parameter |
| int smartthings_payload_set_bool_array | ( | smartthings_payload_h | payload, |
| const char * | attr_name, | ||
| const bool * | array, | ||
| unsigned int | length | ||
| ) |
Sets a boolean array for the attribute name. 1.
| [in] | payload | The SmartThings payload handle |
| [in] | attr_name | The attribute name |
| [in] | array | The array associated with the given attribute name |
| [in] | length | The length of array |
0 on success, otherwise a negative error value | SMARTTHINGS_RESOURCE_ERROR_NONE | Successful |
| SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER | Invalid parameter |
| int smartthings_payload_set_byte_string | ( | smartthings_payload_h | payload, |
| const char * | attr_name, | ||
| const char * | value, | ||
| unsigned int | length | ||
| ) |
Sets a byte string value and length for the attribute name. 1.
| [in] | payload | The SmartThings payload handle |
| [in] | attr_name | The attribute name |
| [in] | value | The value to set |
| [in] | length | The size of value |
0 on success, otherwise a negative error value | SMARTTHINGS_RESOURCE_ERROR_NONE | Successful |
| SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER | Invalid parameter |
| SMARTTHINGS_RESOURCE_ERROR_OPERATION_FAILED | Operation failed |
| int smartthings_payload_set_double | ( | smartthings_payload_h | payload, |
| const char * | attr_name, | ||
| double | value | ||
| ) |
Sets a double value for the attribute name. 1.
| [in] | payload | The SmartThings payload handle |
| [in] | attr_name | The attribute name |
| [in] | value | The value to set |
0 on success, otherwise a negative error value | SMARTTHINGS_RESOURCE_ERROR_NONE | Successful |
| SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER | Invalid parameter |
| int smartthings_payload_set_double_array | ( | smartthings_payload_h | payload, |
| const char * | attr_name, | ||
| const double * | array, | ||
| unsigned int | length | ||
| ) |
Sets a double array for the attribute name. 1.
| [in] | payload | The SmartThings payload handle |
| [in] | attr_name | The attribute name |
| [in] | array | The array associated with the given attribute name |
| [in] | length | The length of array |
0 on success, otherwise a negative error value | SMARTTHINGS_RESOURCE_ERROR_NONE | Successful |
| SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER | Invalid parameter |
| int smartthings_payload_set_int | ( | smartthings_payload_h | payload, |
| const char * | attr_name, | ||
| int | value | ||
| ) |
Sets an integer value for the attribute name. 1.
| [in] | payload | The SmartThings payload handle |
| [in] | attr_name | The attribute name |
| [in] | value | The value to set |
0 on success, otherwise a negative error value | SMARTTHINGS_RESOURCE_ERROR_NONE | Successful |
| SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER | Invalid parameter |
| int smartthings_payload_set_int_array | ( | smartthings_payload_h | payload, |
| const char * | attr_name, | ||
| const int * | array, | ||
| unsigned int | length | ||
| ) |
Sets an integer array for the attribute name. 1.
| [in] | payload | The SmartThings payload handle |
| [in] | attr_name | The attribute name |
| [in] | array | The array associated with the given attribute name |
| [in] | length | The length of array |
0 on success, otherwise a negative error value | SMARTTHINGS_RESOURCE_ERROR_NONE | Successful |
| SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER | Invalid parameter |
| int smartthings_payload_set_object | ( | smartthings_payload_h | payload, |
| const char * | attr_name, | ||
| smartthings_payload_h | value | ||
| ) |
Sets an object value for the attribute name. 1.
| [in] | payload | The SmartThings payload handle |
| [in] | attr_name | The attribute name |
| [in] | value | The value to set |
0 on success, otherwise a negative error value | SMARTTHINGS_RESOURCE_ERROR_NONE | Successful |
| SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER | Invalid parameter |
| int smartthings_payload_set_object_array | ( | smartthings_payload_h | payload, |
| const char * | attr_name, | ||
| smartthings_payload_h * | array, | ||
| unsigned int | length | ||
| ) |
Sets an object array for the attribute name. 1.
| [in] | payload | The SmartThings payload handle |
| [in] | attr_name | The attribute name |
| [in] | array | The array associated with the given attribute name |
| [in] | length | The length of array |
0 on success, otherwise a negative error value | SMARTTHINGS_RESOURCE_ERROR_NONE | Successful |
| SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER | Invalid parameter |
| SMARTTHINGS_RESOURCE_ERROR_OUT_OF_MEMORY | Out of memory |
| int smartthings_payload_set_string | ( | smartthings_payload_h | payload, |
| const char * | attr_name, | ||
| const char * | value | ||
| ) |
Sets a string value for the attribute name. 1.
| [in] | payload | The SmartThings payload handle |
| [in] | attr_name | The attribute name |
| [in] | value | The value to set |
0 on success, otherwise a negative error value | SMARTTHINGS_RESOURCE_ERROR_NONE | Successful |
| SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER | Invalid parameter |
| int smartthings_payload_set_string_array | ( | smartthings_payload_h | payload, |
| const char * | attr_name, | ||
| const char ** | array, | ||
| unsigned int | length | ||
| ) |
Sets a string array for the attribute name. 1.
| [in] | payload | The SmartThings payload handle |
| [in] | attr_name | The attribute name |
| [in] | array | The array associated with the given attribute name |
| [in] | length | The length of array |
0 on success, otherwise a negative error value | SMARTTHINGS_RESOURCE_ERROR_NONE | Successful |
| SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER | Invalid parameter |