Tizen IoT Extension SDK 1.0  1.0.1
Payload

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.

Detailed Description

The Payload API provides functions for handling resource payloads.

Overview

Required Header

#include <smartthings_payload.h>

The SmartThings Thing Payload API provides the following functionalities:


Function Documentation

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.

Remarks:
The resource_uri is key value, one of several child resources of the collection resource.
The value is SmartThings payload handle.
The function replaces any existing payload for the given resource_uri.
Parameters:
[in]payloadThe SmartThings payload handle
[in]resource_uriThe resource URI of child resource
[in]valueThe payload associated with the given resource URI
Returns:
0 on success, otherwise a negative error value
Return values:
SMARTTHINGS_RESOURCE_ERROR_NONESuccessful
SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETERInvalid parameter

Creates a SmartThings payload handle. 1.

Remarks:
The payload must be released using smartthings_payload_destroy().
If the payload is set to parent payload as an object or object array using smartthings_payload_set_object() or smartthings_payload_set_object_array(), the payload must not be released.
Parameters:
[out]payloadThe SmartThings payload handle to be newly created on success
Returns:
0 on success, otherwise a negative error value
Return values:
SMARTTHINGS_RESOURCE_ERROR_NONESuccessful
SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETERInvalid parameter
SMARTTHINGS_RESOURCE_ERROR_OUT_OF_MEMORYOut of memory
See also:
smartthings_payload_destroy()

Destroys a SmartThings payload handle and releases all its resources. 1.

Remarks:
If the payload has child payload, its child payload will be released as well.
Parameters:
[in]payloadThe SmartThings payload handle
Returns:
0 on success, otherwise a negative error value
Return values:
SMARTTHINGS_RESOURCE_ERROR_NONESuccessful
SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETERInvalid parameter
See also:
smartthings_payload_create()
int smartthings_payload_get_bool ( smartthings_payload_h  payload,
const char *  attr_name,
bool *  value 
)

Gets a boolean value for the attribute name. 1.

Remarks:
The attr_name is key value, one of several properties of the resource type.
Parameters:
[in]payloadThe SmartThings payload handle
[in]attr_nameThe attribute name
[out]valueThe value associated with the given attribute name
Returns:
0 on success, otherwise a negative error value
Return values:
SMARTTHINGS_RESOURCE_ERROR_NONESuccessful
SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETERInvalid parameter
SMARTTHINGS_RESOURCE_ERROR_NO_DATANo 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.

Remarks:
The attr_name is key value, one of several properties of the resource type.
The array must be released using smartthings_payload_release_bool_array().
Parameters:
[in]payloadThe SmartThings payload handle
[in]attr_nameThe attribute name
[out]arrayThe array associated with the given attribute name
[out]lengthThe length of array
Returns:
0 on success, otherwise a negative error value
Return values:
SMARTTHINGS_RESOURCE_ERROR_NONESuccessful
SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETERInvalid parameter
SMARTTHINGS_RESOURCE_ERROR_OUT_OF_MEMORYOut of memory
SMARTTHINGS_RESOURCE_ERROR_NO_DATANo data
See also:
smartthings_payload_release_bool_array()
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.

Remarks:
The attr_name is key value, one of several properties of the resource type.
The value should be released using free().
Parameters:
[in]payloadThe SmartThings payload handle
[in]attr_nameThe attribute name
[out]valueThe value associated with the given attribute name
[out]lengthThe size of value
Returns:
0 on success, otherwise a negative error value
Return values:
SMARTTHINGS_RESOURCE_ERROR_NONESuccessful
SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETERInvalid parameter
SMARTTHINGS_RESOURCE_ERROR_NO_DATANo 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.

Remarks:
The resource_uri is key value, one of several child resources of the collection resource.
The value is SmartThings payload handle.
The value must be released using smartthings_payload_release_object().
Parameters:
[in]payloadThe SmartThings payload handle
[in]resource_uriThe resource URI of child resource
[out]valueThe payload associated with the given resource URI
Returns:
0 on success, otherwise a negative error value
Return values:
SMARTTHINGS_RESOURCE_ERROR_NONESuccessful
SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETERInvalid parameter
SMARTTHINGS_RESOURCE_ERROR_OUT_OF_MEMORYOut of memory
SMARTTHINGS_RESOURCE_ERROR_NO_DATANo 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.

Remarks:
The attr_name is key value, one of several properties of the resource type.
Parameters:
[in]payloadThe SmartThings payload handle
[in]attr_nameThe attribute name
[out]valueThe value associated with the given attribute name
Returns:
0 on success, otherwise a negative error value
Return values:
SMARTTHINGS_RESOURCE_ERROR_NONESuccessful
SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETERInvalid parameter
SMARTTHINGS_RESOURCE_ERROR_NO_DATANo 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.

Remarks:
The attr_name is key value, one of several properties of the resource type.
The array must be released using smartthings_payload_release_double_array().
Parameters:
[in]payloadThe SmartThings payload handle
[in]attr_nameThe attribute name
[out]arrayThe array associated with the given attribute name
[out]lengthThe length of array
Returns:
0 on success, otherwise a negative error value
Return values:
SMARTTHINGS_RESOURCE_ERROR_NONESuccessful
SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETERInvalid parameter
SMARTTHINGS_RESOURCE_ERROR_OUT_OF_MEMORYOut of memory
SMARTTHINGS_RESOURCE_ERROR_NO_DATANo data
See also:
smartthings_payload_release_double_array()
int smartthings_payload_get_int ( smartthings_payload_h  payload,
const char *  attr_name,
int *  value 
)

Gets an integer value for the attribute name. 1.

Remarks:
The attr_name is key value, one of several properties of the resource type.
Parameters:
[in]payloadThe SmartThings payload handle
[in]attr_nameThe attribute name
[out]valueThe value associated with the given attribute name
Returns:
0 on success, otherwise a negative error value
Return values:
SMARTTHINGS_RESOURCE_ERROR_NONESuccessful
SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETERInvalid parameter
SMARTTHINGS_RESOURCE_ERROR_NO_DATANo 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.

Remarks:
The attr_name is key value, one of several properties of the resource type.
The array must be released using smartthings_payload_release_int_array().
Parameters:
[in]payloadThe SmartThings payload handle
[in]attr_nameThe attribute name
[out]arrayThe array associated with the given attribute name
[out]lengthThe length of array
Returns:
0 on success, otherwise a negative error value
Return values:
SMARTTHINGS_RESOURCE_ERROR_NONESuccessful
SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETERInvalid parameter
SMARTTHINGS_RESOURCE_ERROR_OUT_OF_MEMORYOut of memory
SMARTTHINGS_RESOURCE_ERROR_NO_DATANo data
See also:
smartthings_payload_release_int_array()
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.

Remarks:
The attr_name is key value, one of several properties of the resource type.
The value is SmartThings payload handle.
The value must be released using smartthings_payload_release_object().
Parameters:
[in]payloadThe SmartThings payload handle
[in]attr_nameThe attribute name
[out]valueThe value associated with the given attribute name
Returns:
0 on success, otherwise a negative error value
Return values:
SMARTTHINGS_RESOURCE_ERROR_NONESuccessful
SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETERInvalid parameter
SMARTTHINGS_RESOURCE_ERROR_OUT_OF_MEMORYOut of memory
SMARTTHINGS_RESOURCE_ERROR_NO_DATANo 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.

Remarks:
The attr_name is key value, one of several properties of the resource type.
The array is a list of SmartThings payload handle.
The array must be released using smartthings_payload_release_object_array().
Parameters:
[in]payloadThe SmartThings payload handle
[in]attr_nameThe attribute name
[out]arrayThe array associated with the given attribute name
[out]lengthThe length of array
Returns:
0 on success, otherwise a negative error value
Return values:
SMARTTHINGS_RESOURCE_ERROR_NONESuccessful
SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETERInvalid parameter
SMARTTHINGS_RESOURCE_ERROR_OUT_OF_MEMORYOut of memory
SMARTTHINGS_RESOURCE_ERROR_NO_DATANo data
See also:
smartthings_payload_release_object_array()
int smartthings_payload_get_string ( smartthings_payload_h  payload,
const char *  attr_name,
char **  value 
)

Gets a string value for the attribute name. 1.

Remarks:
The attr_name is key value, one of several properties of the resource type.
The value should be released using free().
Parameters:
[in]payloadThe SmartThings payload handle
[in]attr_nameThe attribute name
[out]valueThe value associated with the given attribute name
Returns:
0 on success, otherwise a negative error value
Return values:
SMARTTHINGS_RESOURCE_ERROR_NONESuccessful
SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETERInvalid parameter
SMARTTHINGS_RESOURCE_ERROR_NO_DATANo 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.

Remarks:
The attr_name is key value, one of several properties of the resource type.
The array must be released using smartthings_payload_release_string_array().
Parameters:
[in]payloadThe SmartThings payload handle
[in]attr_nameThe attribute name
[out]arrayThe array associated with the given attribute name
[out]lengthThe length of array
Returns:
0 on success, otherwise a negative error value
Return values:
SMARTTHINGS_RESOURCE_ERROR_NONESuccessful
SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETERInvalid parameter
SMARTTHINGS_RESOURCE_ERROR_OUT_OF_MEMORYOut of memory
SMARTTHINGS_RESOURCE_ERROR_NO_DATANo data
See also:
smartthings_payload_release_string_array()

Releases a boolean array of the SmartThings payload. 1.

Parameters:
[in]arrayThe array to release
Returns:
0 on success, otherwise a negative error value
Return values:
SMARTTHINGS_RESOURCE_ERROR_NONESuccessful
SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETERInvalid parameter
See also:
smartthings_payload_get_bool_array()

Releases a double array of the SmartThings payload. 1.

Parameters:
[in]arrayThe array to release
Returns:
0 on success, otherwise a negative error value
Return values:
SMARTTHINGS_RESOURCE_ERROR_NONESuccessful
SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETERInvalid parameter
See also:
smartthings_payload_get_double_array()

Releases an integer array of the SmartThings payload. 1.

Parameters:
[in]arrayThe array to release
Returns:
0 on success, otherwise a negative error value
Return values:
SMARTTHINGS_RESOURCE_ERROR_NONESuccessful
SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETERInvalid parameter
See also:
smartthings_payload_get_int_array()

Releases a SmartThings payload. 1.

Remarks:
The function is different with smartthings_payload_destroy().
The function releases only payload value that is obtained by smartthings_payload_get_object().
Parameters:
[in]payloadThe payload to release
Returns:
0 on success, otherwise a negative error value
Return values:
SMARTTHINGS_RESOURCE_ERROR_NONESuccessful
SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETERInvalid parameter
See also:
smartthings_payload_get_object()
int smartthings_payload_release_object_array ( smartthings_payload_h array,
unsigned int  length 
)

Releases an object array of the SmartThings payload. 1.

Parameters:
[in]arrayThe array to release
[in]lengthThe length of array
Returns:
0 on success, otherwise a negative error value
Return values:
SMARTTHINGS_RESOURCE_ERROR_NONESuccessful
SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETERInvalid parameter
See also:
smartthings_payload_get_object_array()
int smartthings_payload_release_string_array ( char **  array,
unsigned int  length 
)

Releases a string array of the SmartThings payload. 1.

Parameters:
[in]arrayThe array to release
[in]lengthThe length of array
Returns:
0 on success, otherwise a negative error value
Return values:
SMARTTHINGS_RESOURCE_ERROR_NONESuccessful
SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETERInvalid parameter
See also:
smartthings_payload_get_string_array()
int smartthings_payload_set_bool ( smartthings_payload_h  payload,
const char *  attr_name,
bool  value 
)

Sets a boolean value for the attribute name. 1.

Remarks:
The attr_name is key value, one of several properties of the resource type.
The function replaces any existing value for the given attr_name.
Parameters:
[in]payloadThe SmartThings payload handle
[in]attr_nameThe attribute name
[in]valueThe value to set
Returns:
0 on success, otherwise a negative error value
Return values:
SMARTTHINGS_RESOURCE_ERROR_NONESuccessful
SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETERInvalid 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.

Remarks:
The attr_name is key value, one of several properties of the resource type.
The function replaces any existing array for the given attr_name.
Parameters:
[in]payloadThe SmartThings payload handle
[in]attr_nameThe attribute name
[in]arrayThe array associated with the given attribute name
[in]lengthThe length of array
Returns:
0 on success, otherwise a negative error value
Return values:
SMARTTHINGS_RESOURCE_ERROR_NONESuccessful
SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETERInvalid 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.

Remarks:
The attr_name is key value, one of several properties of the resource type.
The function replaces any existing value for the given attr_name.
Parameters:
[in]payloadThe SmartThings payload handle
[in]attr_nameThe attribute name
[in]valueThe value to set
[in]lengthThe size of value
Returns:
0 on success, otherwise a negative error value
Return values:
SMARTTHINGS_RESOURCE_ERROR_NONESuccessful
SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETERInvalid parameter
SMARTTHINGS_RESOURCE_ERROR_OPERATION_FAILEDOperation 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.

Remarks:
The attr_name is key value, one of several properties of the resource type.
The function replaces any existing value for the given attr_name.
Parameters:
[in]payloadThe SmartThings payload handle
[in]attr_nameThe attribute name
[in]valueThe value to set
Returns:
0 on success, otherwise a negative error value
Return values:
SMARTTHINGS_RESOURCE_ERROR_NONESuccessful
SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETERInvalid 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.

Remarks:
The attr_name is key value, one of several properties of the resource type.
The function replaces any existing array for the given attr_name.
Parameters:
[in]payloadThe SmartThings payload handle
[in]attr_nameThe attribute name
[in]arrayThe array associated with the given attribute name
[in]lengthThe length of array
Returns:
0 on success, otherwise a negative error value
Return values:
SMARTTHINGS_RESOURCE_ERROR_NONESuccessful
SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETERInvalid 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.

Remarks:
The attr_name is key value, one of several properties of the resource type.
The function replaces any existing value for the given attr_name.
Parameters:
[in]payloadThe SmartThings payload handle
[in]attr_nameThe attribute name
[in]valueThe value to set
Returns:
0 on success, otherwise a negative error value
Return values:
SMARTTHINGS_RESOURCE_ERROR_NONESuccessful
SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETERInvalid 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.

Remarks:
The attr_name is key value, one of several properties of the resource type.
The function replaces any existing array for the given attr_name.
Parameters:
[in]payloadThe SmartThings payload handle
[in]attr_nameThe attribute name
[in]arrayThe array associated with the given attribute name
[in]lengthThe length of array
Returns:
0 on success, otherwise a negative error value
Return values:
SMARTTHINGS_RESOURCE_ERROR_NONESuccessful
SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETERInvalid 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.

Remarks:
The attr_name is key value, one of several properties of the resource type.
The value is SmartThings payload handle.
The function replaces any existing value for the given attr_name.
Parameters:
[in]payloadThe SmartThings payload handle
[in]attr_nameThe attribute name
[in]valueThe value to set
Returns:
0 on success, otherwise a negative error value
Return values:
SMARTTHINGS_RESOURCE_ERROR_NONESuccessful
SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETERInvalid 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.

Remarks:
The attr_name is key value, one of several properties of the resource type.
The function replaces any existing array for the given attr_name.
Parameters:
[in]payloadThe SmartThings payload handle
[in]attr_nameThe attribute name
[in]arrayThe array associated with the given attribute name
[in]lengthThe length of array
Returns:
0 on success, otherwise a negative error value
Return values:
SMARTTHINGS_RESOURCE_ERROR_NONESuccessful
SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETERInvalid parameter
SMARTTHINGS_RESOURCE_ERROR_OUT_OF_MEMORYOut 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.

Remarks:
The attr_name is key value, one of several properties of the resource type.
The function replaces any existing value for the given attr_name.
Parameters:
[in]payloadThe SmartThings payload handle
[in]attr_nameThe attribute name
[in]valueThe value to set
Returns:
0 on success, otherwise a negative error value
Return values:
SMARTTHINGS_RESOURCE_ERROR_NONESuccessful
SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETERInvalid 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.

Remarks:
The attr_name is key value, one of several properties of the resource type.
The function replaces any existing array for the given attr_name.
Parameters:
[in]payloadThe SmartThings payload handle
[in]attr_nameThe attribute name
[in]arrayThe array associated with the given attribute name
[in]lengthThe length of array
Returns:
0 on success, otherwise a negative error value
Return values:
SMARTTHINGS_RESOURCE_ERROR_NONESuccessful
SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETERInvalid parameter
 All Files Functions Typedefs Enumerations Enumerator