Tizen Native API  6.5

IoTCon List provides API to get data from list and set data to list.

Required Header

#include <iotcon.h>

Overview

The IoTCon list API provides list of bool, integer, double, string, byte string, list and attributes handle. Example :

static void _request_handler(iotcon_resource_h resource, iotcon_request_h request,
        void *user_data)
{
    int ret;
    iotcon_request_type_e type;

    ret = iotcon_request_get_request_type(request, &type);
    if (IOTCON_ERROR_NONE != ret)
        return;

    if (IOTCON_REQUEST_GET == type) {
        iotcon_response_h response = NULL;
        iotcon_representation_h representation = NULL;
        iotcon_attributes_h attributes = NULL;
        iotcon_list_h list = NULL;

        ret = iotcon_response_create(request, &response);
        if (IOTCON_ERROR_NONE != ret)
            return;

        ret = iotcon_representation_create(&representation);
        if (IOTCON_ERROR_NONE != ret) {
            iotcon_response_destroy(response);
            return;
        }

        ...

        ret = iotcon_attributes_create(&attributes);
        if (IOTCON_ERROR_NONE != ret) {
            iotcon_representation_destroy(representation);
            iotcon_response_destroy(response);
            return;
        }

        ret = iotcon_list_create(IOTCON_TYPE_INT, &list);
        if (IOTCON_ERROR_NONE != ret) {
            iotcon_attributes_destroy(attributes);
            iotcon_representation_destroy(representation);
            iotcon_response_destroy(response);
            return;
        }

        ret = iotcon_list_add_int(list, 1);
        if (IOTCON_ERROR_NONE != ret) {
            iotcon_list_destroy(list);
            iotcon_attributes_destroy(attributes);
            iotcon_representation_destroy(representation);
            iotcon_response_destroy(response);
            return;
        }

        ret = iotcon_list_add_int(list, 2);
        if (IOTCON_ERROR_NONE != ret) {
            iotcon_list_destroy(list);
            iotcon_attributes_destroy(attributes);
            iotcon_representation_destroy(representation);
            iotcon_response_destroy(response);
            return;
        }

        ret = iotcon_list_add_int(list, 10);
        if (IOTCON_ERROR_NONE != ret) {
            iotcon_list_destroy(list);
            iotcon_attributes_destroy(attributes);
            iotcon_representation_destroy(representation);
            iotcon_response_destroy(response);
            return;
        }

        ret = itocon_attributes_add_list(attributes, "ids", list);
        if (IOTCON_ERROR_NONE != ret) {
            iotcon_list_destroy(list);
            iotcon_attributes_destroy(attributes);
            iotcon_representation_destroy(representation);
            iotcon_response_destroy(response);
            return;
        }

        ret = iotcon_representation_set_attributes(representation, attributes);
        if (IOTCON_ERROR_NONE != ret) {
            iotcon_list_destroy(list);
            iotcon_attributes_destroy(attributes);
            iotcon_representation_destroy(representation);
            iotcon_response_destroy(response);
            return;
        }

        ...

        ret = iotcon_response_set_representation(response, representation);
        if (IOTCON_ERROR_NONE != ret) {
            iotcon_list_destroy(list);
            iotcon_attributes_destroy(attributes);
            iotcon_representation_destroy(representation);
            iotcon_response_destroy(response);
            return;
        }

        ret = iotcon_response_send(response);
        if (IOTCON_ERROR_NONE != ret) {
            iotcon_list_destroy(list);
            iotcon_attributes_destroy(attributes);
            iotcon_representation_destroy(representation);
            iotcon_response_destroy(response);
            return;
        }

        iotcon_list_destroy(list);
        iotcon_attributes_destroy(attributes);
        iotcon_representation_destroy(representation);
        iotcon_response_destroy(response);
    }
    ...
}

Related Features

This API is related with the following features:

  • http://tizen.org/feature/iot.ocf
    It is recommended to design feature related codes in your application for reliability.
    You can check if a device supports the related features for this API by using System Information, thereby controlling the procedure of your application.
    To ensure your application is only running on the device with specific features, please define the features in your manifest file using the manifest editor in the SDK.
    More details on featuring your application can be found from Feature Element.

Functions

int iotcon_list_create (iotcon_type_e type, iotcon_list_h *list)
 Creates a new list handle.
int iotcon_list_destroy (iotcon_list_h list)
 Destroys a list handle.
int iotcon_list_add_int (iotcon_list_h list, int val, int pos)
 Adds a new element integer value into the list at the given position.
int iotcon_list_add_bool (iotcon_list_h list, bool val, int pos)
 Adds a new element boolean value into the list at the given position.
int iotcon_list_add_double (iotcon_list_h list, double val, int pos)
 Adds a new element double value into the list at the given position.
int iotcon_list_add_str (iotcon_list_h list, char *val, int pos)
 Adds a new element string value into the list at the given position.
int iotcon_list_add_byte_str (iotcon_list_h list, unsigned char *val, int len, int pos)
 Adds a new element byte string value into the list at the given position.
int iotcon_list_add_list (iotcon_list_h list, iotcon_list_h val, int pos)
 Adds a new element list into the list at the given position.
int iotcon_list_add_attributes (iotcon_list_h list, iotcon_attributes_h val, int pos)
 Adds a new element attributes value into the list at the given position.
int iotcon_list_get_nth_int (iotcon_list_h list, int pos, int *val)
 Gets the integer value at the given position.
int iotcon_list_get_nth_bool (iotcon_list_h list, int pos, bool *val)
 Gets the boolean value at the given position.
int iotcon_list_get_nth_double (iotcon_list_h list, int pos, double *val)
 Gets the double value at the given position.
int iotcon_list_get_nth_str (iotcon_list_h list, int pos, char **val)
 Gets the string value at the given position.
int iotcon_list_get_nth_byte_str (iotcon_list_h list, int pos, unsigned char **val, int *len)
 Gets the string value at the given position.
int iotcon_list_get_nth_list (iotcon_list_h src, int pos, iotcon_list_h *dest)
 Gets the list value at the given position.
int iotcon_list_get_nth_attributes (iotcon_list_h list, int pos, iotcon_attributes_h *attributes)
 Gets the attributes value at the given position.
int iotcon_list_remove_nth (iotcon_list_h list, int pos)
 Removes the value at the given position.
int iotcon_list_get_type (iotcon_list_h list, iotcon_type_e *type)
 Gets the type of the list.
int iotcon_list_get_length (iotcon_list_h list, unsigned int *length)
 Gets the number of elements in a list.
int iotcon_list_foreach_int (iotcon_list_h list, iotcon_list_int_cb cb, void *user_data)
 Gets all integer values of the given list by invoking the callback function.
int iotcon_list_foreach_bool (iotcon_list_h list, iotcon_list_bool_cb cb, void *user_data)
 Gets all boolean values of the given list by invoking the callback function.
int iotcon_list_foreach_double (iotcon_list_h list, iotcon_list_double_cb cb, void *user_data)
 Gets all double values of the given list by invoking the callback function.
int iotcon_list_foreach_byte_str (iotcon_list_h list, iotcon_list_byte_str_cb cb, void *user_data)
 Gets all string values of the given list by invoking the callback function.
int iotcon_list_foreach_str (iotcon_list_h list, iotcon_list_str_cb cb, void *user_data)
 Gets all string values of the given list by invoking the callback function.
int iotcon_list_foreach_list (iotcon_list_h list, iotcon_list_list_cb cb, void *user_data)
 Gets all sub lists of the given list by invoking the callback function.
int iotcon_list_foreach_attributes (iotcon_list_h list, iotcon_list_attributes_cb cb, void *user_data)
 Gets all attributes of the given list by invoking the callback function.

Typedefs

typedef bool(* iotcon_list_int_cb )(int pos, int value, void *user_data)
 Specifies the type of function passed to iotcon_list_foreach_int().
typedef bool(* iotcon_list_bool_cb )(int pos, bool value, void *user_data)
 Specifies the type of function passed to iotcon_list_foreach_bool().
typedef bool(* iotcon_list_double_cb )(int pos, double value, void *user_data)
 Specifies the type of function passed to iotcon_list_foreach_double().
typedef bool(* iotcon_list_byte_str_cb )(int pos, const unsigned char *value, int len, void *user_data)
 Specifies the type of function passed to iotcon_list_foreach_byte_str().
typedef bool(* iotcon_list_str_cb )(int pos, const char *value, void *user_data)
 Specifies the type of function passed to iotcon_list_foreach_str().
typedef bool(* iotcon_list_list_cb )(int pos, iotcon_list_h value, void *user_data)
 Specifies the type of function passed to iotcon_list_foreach_list().
typedef bool(* iotcon_list_attributes_cb )(int pos, iotcon_attributes_h value, void *user_data)
 Specifies the type of function passed to iotcon_list_foreach_attributes().

Typedef Documentation

typedef bool(* iotcon_list_attributes_cb)(int pos, iotcon_attributes_h value, void *user_data)

Specifies the type of function passed to iotcon_list_foreach_attributes().

Since :
3.0
Parameters:
[in]posThe number of the attributes value (0 being the first)
[in]valueThe attributes value
[in]user_dataThe user data to pass to the function
Returns:
true to continue with the next iteration of the loop, otherwise false to break out of the loop IOTCON_FUNC_CONTINUE and IOTCON_FUNC_STOP are more friendly values for the return
Precondition:
iotcon_list_foreach_attributes() will invoke this callback function.
See also:
iotcon_list_foreach_attributes()
typedef bool(* iotcon_list_bool_cb)(int pos, bool value, void *user_data)

Specifies the type of function passed to iotcon_list_foreach_bool().

Since :
3.0
Parameters:
[in]posThe number of the boolean value (0 being the first)
[in]valueThe boolean value
[in]user_dataThe user data to pass to the function
Returns:
true to continue with the next iteration of the loop, otherwise false to break out of the loop IOTCON_FUNC_CONTINUE and IOTCON_FUNC_STOP are more friendly values for the return
Precondition:
iotcon_list_foreach_bool() will invoke this callback function.
See also:
iotcon_list_foreach_bool()
typedef bool(* iotcon_list_byte_str_cb)(int pos, const unsigned char *value, int len, void *user_data)

Specifies the type of function passed to iotcon_list_foreach_byte_str().

Since :
3.0
Parameters:
[in]posThe number of the string value (0 being the first)
[in]valueThe byte string value
[in]lenThe length of value
[in]user_dataThe user data to pass to the function
Returns:
true to continue with the next iteration of the loop, otherwise false to break out of the loop IOTCON_FUNC_CONTINUE and IOTCON_FUNC_STOP are more friendly values for the return
Precondition:
iotcon_list_foreach_byte_str() will invoke this callback function.
See also:
iotcon_list_foreach_byte_str()
typedef bool(* iotcon_list_double_cb)(int pos, double value, void *user_data)

Specifies the type of function passed to iotcon_list_foreach_double().

Since :
3.0
Parameters:
[in]posThe number of the double value (0 being the first)
[in]valueThe double value
[in]user_dataThe user data to pass to the function
Returns:
true to continue with the next iteration of the loop, otherwise false to break out of the loop IOTCON_FUNC_CONTINUE and IOTCON_FUNC_STOP are more friendly values for the return
Precondition:
iotcon_list_foreach_double() will invoke this callback function.
See also:
iotcon_list_foreach_double()
typedef bool(* iotcon_list_int_cb)(int pos, int value, void *user_data)

Specifies the type of function passed to iotcon_list_foreach_int().

Since :
3.0
Parameters:
[in]posThe number of the integer value (0 being the first)
[in]valueThe integer value
[in]user_dataThe user data to pass to the function
Returns:
true to continue with the next iteration of the loop, otherwise false to break out of the loop IOTCON_FUNC_CONTINUE and IOTCON_FUNC_STOP are more friendly values for the return
Precondition:
iotcon_list_foreach_int() will invoke this callback function.
See also:
iotcon_list_foreach_int()
typedef bool(* iotcon_list_list_cb)(int pos, iotcon_list_h value, void *user_data)

Specifies the type of function passed to iotcon_list_foreach_list().

Since :
3.0
Parameters:
[in]posThe number of the list value (0 being the first)
[in]valueThe list value
[in]user_dataThe user data to pass to the function
Returns:
true to continue with the next iteration of the loop, otherwise false to break out of the loop IOTCON_FUNC_CONTINUE and IOTCON_FUNC_STOP are more friendly values for the return
Precondition:
iotcon_list_foreach_list() will invoke this callback function.
See also:
iotcon_list_foreach_list()
typedef bool(* iotcon_list_str_cb)(int pos, const char *value, void *user_data)

Specifies the type of function passed to iotcon_list_foreach_str().

Since :
3.0
Parameters:
[in]posThe number of the string value (0 being the first)
[in]valueThe string value
[in]user_dataThe user data to pass to the function
Returns:
true to continue with the next iteration of the loop, otherwise false to break out of the loop IOTCON_FUNC_CONTINUE and IOTCON_FUNC_STOP are more friendly values for the return
Precondition:
iotcon_list_foreach_str() will invoke this callback function.
See also:
iotcon_list_foreach_str()

Function Documentation

int iotcon_list_add_attributes ( iotcon_list_h  list,
iotcon_attributes_h  val,
int  pos 
)

Adds a new element attributes value into the list at the given position.

If pos is negative, or is larger than the number of elements in the list, the new value is added on to the end of the list.

Since :
3.0
Parameters:
[in]listThe list handle
[in]valThe new attributes value
[in]posThe position to insert value
Returns:
0 on success, otherwise a negative error value
Return values:
IOTCON_ERROR_NONESuccessful
IOTCON_ERROR_NOT_SUPPORTEDNot supported
IOTCON_ERROR_OUT_OF_MEMORYOut of memory
IOTCON_ERROR_INVALID_PARAMETERInvalid parameter
IOTCON_ERROR_INVALID_TYPEInvalid type
int iotcon_list_add_bool ( iotcon_list_h  list,
bool  val,
int  pos 
)

Adds a new element boolean value into the list at the given position.

If pos is negative, or is larger than the number of elements in the list, the new value is added on to the end of the list.

Since :
3.0
Parameters:
[in]listThe list handle
[in]valThe new boolean value
[in]posThe position to insert value
Returns:
0 on success, otherwise a negative error value
Return values:
IOTCON_ERROR_NONESuccessful
IOTCON_ERROR_NOT_SUPPORTEDNot supported
IOTCON_ERROR_OUT_OF_MEMORYOut of memory
IOTCON_ERROR_INVALID_PARAMETERInvalid parameter
IOTCON_ERROR_INVALID_TYPEInvalid type
int iotcon_list_add_byte_str ( iotcon_list_h  list,
unsigned char *  val,
int  len,
int  pos 
)

Adds a new element byte string value into the list at the given position.

If pos is negative, or is larger than the number of elements in the list, the new value is added on to the end of the list.

Since :
3.0
Parameters:
[in]listThe list handle
[in]valThe new byte string value
[in]lenThe length of val
[in]posThe position to insert value
Returns:
0 on success, otherwise a negative error value
Return values:
IOTCON_ERROR_NONESuccessful
IOTCON_ERROR_NOT_SUPPORTEDNot supported
IOTCON_ERROR_OUT_OF_MEMORYOut of memory
IOTCON_ERROR_INVALID_PARAMETERInvalid parameter
IOTCON_ERROR_INVALID_TYPEInvalid type
int iotcon_list_add_double ( iotcon_list_h  list,
double  val,
int  pos 
)

Adds a new element double value into the list at the given position.

If pos is negative, or is larger than the number of elements in the list, the new value is added on to the end of the list.

Since :
3.0
Parameters:
[in]listThe list handle
[in]valThe new double value
[in]posThe position to insert value
Returns:
0 on success, otherwise a negative error value
Return values:
IOTCON_ERROR_NONESuccessful
IOTCON_ERROR_NOT_SUPPORTEDNot supported
IOTCON_ERROR_OUT_OF_MEMORYOut of memory
IOTCON_ERROR_INVALID_PARAMETERInvalid parameter
IOTCON_ERROR_INVALID_TYPEInvalid type
int iotcon_list_add_int ( iotcon_list_h  list,
int  val,
int  pos 
)

Adds a new element integer value into the list at the given position.

If pos is negative, or is larger than the number of elements in the list, the new value is added on to the end of the list.

Since :
3.0
Parameters:
[in]listThe list handle
[in]valThe new integer value
[in]posThe position to insert value
Returns:
0 on success, otherwise a negative error value
Return values:
IOTCON_ERROR_NONESuccessful
IOTCON_ERROR_NOT_SUPPORTEDNot supported
IOTCON_ERROR_OUT_OF_MEMORYOut of memory
IOTCON_ERROR_INVALID_PARAMETERInvalid parameter
IOTCON_ERROR_INVALID_TYPEInvalid type
int iotcon_list_add_list ( iotcon_list_h  list,
iotcon_list_h  val,
int  pos 
)

Adds a new element list into the list at the given position.

If pos is negative, or is larger than the number of elements in the list, the new value is added on to the end of the list.

Since :
3.0
Parameters:
[in]listThe list handle
[in]valThe new list value
[in]posThe position to insert value
Returns:
0 on success, otherwise a negative error value
Return values:
IOTCON_ERROR_NONESuccessful
IOTCON_ERROR_NOT_SUPPORTEDNot supported
IOTCON_ERROR_OUT_OF_MEMORYOut of memory
IOTCON_ERROR_INVALID_PARAMETERInvalid parameter
IOTCON_ERROR_INVALID_TYPEInvalid type
int iotcon_list_add_str ( iotcon_list_h  list,
char *  val,
int  pos 
)

Adds a new element string value into the list at the given position.

If pos is negative, or is larger than the number of elements in the list, the new value is added on to the end of the list.

Since :
3.0
Parameters:
[in]listThe list handle
[in]valThe new char value
[in]posThe position to insert value
Returns:
0 on success, otherwise a negative error value
Return values:
IOTCON_ERROR_NONESuccessful
IOTCON_ERROR_NOT_SUPPORTEDNot supported
IOTCON_ERROR_OUT_OF_MEMORYOut of memory
IOTCON_ERROR_INVALID_PARAMETERInvalid parameter
IOTCON_ERROR_INVALID_TYPEInvalid type
int iotcon_list_create ( iotcon_type_e  type,
iotcon_list_h list 
)

Creates a new list handle.

Since :
3.0
Remarks:
You must destroy list by calling iotcon_list_destroy() if list is no longer needed.
Parameters:
[in]typeThe type of list
[out]listA newly allocated list handle
Returns:
0 on success, otherwise a negative error value
Return values:
IOTCON_ERROR_NONESuccessful
IOTCON_ERROR_NOT_SUPPORTEDNot supported
IOTCON_ERROR_OUT_OF_MEMORYOut of memory
IOTCON_ERROR_INVALID_PARAMETERInvalid parameter
IOTCON_ERROR_INVALID_TYPEInvalid type

Destroys a list handle.

Releases a list and its internal data.

Since :
3.0
Parameters:
[in]listThe handle to the list
Returns:
0 on success, otherwise a negative error value
Return values:
IOTCON_ERROR_NONESuccessful
IOTCON_ERROR_NOT_SUPPORTEDNot supported
IOTCON_ERROR_INVALID_PARAMETERInvalid parameter
int iotcon_list_foreach_attributes ( iotcon_list_h  list,
iotcon_list_attributes_cb  cb,
void *  user_data 
)

Gets all attributes of the given list by invoking the callback function.

iotcon_list_attributes_cb() will be called for each child.

Since :
3.0
Parameters:
[in]listThe handle to the list
[in]cbThe callback function to get each attributes
[in]user_dataThe user data to be passed to the callback function
Returns:
0 on success, otherwise a negative error value
Return values:
IOTCON_ERROR_NONESuccessful
IOTCON_ERROR_NOT_SUPPORTEDNot supported
IOTCON_ERROR_INVALID_PARAMETERInvalid parameter
Postcondition:
iotcon_list_attributes_cb() will be called for each item.
See also:
iotcon_list_attributes_cb()
int iotcon_list_foreach_bool ( iotcon_list_h  list,
iotcon_list_bool_cb  cb,
void *  user_data 
)

Gets all boolean values of the given list by invoking the callback function.

iotcon_list_bool_cb() will be called for each child.

Since :
3.0
Parameters:
[in]listThe handle to the list
[in]cbThe callback function to get each boolean value
[in]user_dataThe user data to be passed to the callback function
Returns:
0 on success, otherwise a negative error value
Return values:
IOTCON_ERROR_NONESuccessful
IOTCON_ERROR_NOT_SUPPORTEDNot supported
IOTCON_ERROR_INVALID_PARAMETERInvalid parameter
Postcondition:
iotcon_list_bool_cb() will be called for each item.
See also:
iotcon_list_bool_cb()
int iotcon_list_foreach_byte_str ( iotcon_list_h  list,
iotcon_list_byte_str_cb  cb,
void *  user_data 
)

Gets all string values of the given list by invoking the callback function.

iotcon_list_byte_str_cb() will be called for each child.

Since :
3.0
Parameters:
[in]listThe handle to the list
[in]cbThe callback function to get each string value
[in]user_dataThe user data to be passed to the callback function
Returns:
0 on success, otherwise a negative error value
Return values:
IOTCON_ERROR_NONESuccessful
IOTCON_ERROR_NOT_SUPPORTEDNot supported
IOTCON_ERROR_INVALID_PARAMETERInvalid parameter
Postcondition:
iotcon_list_byte_str_cb() will be called for each item.
See also:
iotcon_list_byte_str_cb()
int iotcon_list_foreach_double ( iotcon_list_h  list,
iotcon_list_double_cb  cb,
void *  user_data 
)

Gets all double values of the given list by invoking the callback function.

iotcon_list_double_cb() will be called for each child.

Since :
3.0
Parameters:
[in]listThe handle to the list
[in]cbThe callback function to get each double value
[in]user_dataThe user data to be passed to the callback function
Returns:
0 on success, otherwise a negative error value
Return values:
IOTCON_ERROR_NONESuccessful
IOTCON_ERROR_NOT_SUPPORTEDNot supported
IOTCON_ERROR_INVALID_PARAMETERInvalid parameter
Postcondition:
iotcon_list_double_cb() will be called for each item.
See also:
iotcon_list_double_cb()
int iotcon_list_foreach_int ( iotcon_list_h  list,
iotcon_list_int_cb  cb,
void *  user_data 
)

Gets all integer values of the given list by invoking the callback function.

iotcon_list_int_cb() will be called for each child.

Since :
3.0
Parameters:
[in]listThe handle to the list
[in]cbThe callback function to get each integer value
[in]user_dataThe user data to be passed to the callback function
Returns:
0 on success, otherwise a negative error value
Return values:
IOTCON_ERROR_NONESuccessful
IOTCON_ERROR_NOT_SUPPORTEDNot supported
IOTCON_ERROR_INVALID_PARAMETERInvalid parameter
Postcondition:
iotcon_list_int_cb() will be called for each item.
See also:
iotcon_list_int_cb()
int iotcon_list_foreach_list ( iotcon_list_h  list,
iotcon_list_list_cb  cb,
void *  user_data 
)

Gets all sub lists of the given list by invoking the callback function.

iotcon_list_list_cb() will be called for each child.

Since :
3.0
Parameters:
[in]listThe handle to the origin list
[in]cbThe callback function to get each sub list
[in]user_dataThe user data to be passed to the callback function
Returns:
0 on success, otherwise a negative error value
Return values:
IOTCON_ERROR_NONESuccessful
IOTCON_ERROR_NOT_SUPPORTEDNot supported
IOTCON_ERROR_INVALID_PARAMETERInvalid parameter
Postcondition:
iotcon_list_list_cb() will be called for each item.
See also:
iotcon_list_list_cb()
int iotcon_list_foreach_str ( iotcon_list_h  list,
iotcon_list_str_cb  cb,
void *  user_data 
)

Gets all string values of the given list by invoking the callback function.

iotcon_list_str_cb() will be called for each child.

Since :
3.0
Parameters:
[in]listThe handle to the list
[in]cbThe callback function to get each string value
[in]user_dataThe user data to be passed to the callback function
Returns:
0 on success, otherwise a negative error value
Return values:
IOTCON_ERROR_NONESuccessful
IOTCON_ERROR_NOT_SUPPORTEDNot supported
IOTCON_ERROR_INVALID_PARAMETERInvalid parameter
Postcondition:
iotcon_list_str_cb() will be called for each item.
See also:
iotcon_list_str_cb()
int iotcon_list_get_length ( iotcon_list_h  list,
unsigned int *  length 
)

Gets the number of elements in a list.

Since :
3.0
Parameters:
[in]listThe handle to the list
[out]lengthThe length of list
Returns:
0 on success, otherwise a negative error value
Return values:
IOTCON_ERROR_NONESuccessful
IOTCON_ERROR_NOT_SUPPORTEDNot supported
IOTCON_ERROR_INVALID_PARAMETERInvalid parameter
int iotcon_list_get_nth_attributes ( iotcon_list_h  list,
int  pos,
iotcon_attributes_h attributes 
)

Gets the attributes value at the given position.

Iterates over the list until it reaches the pos-1 position.

Since :
3.0
Remarks:
attributes must not be released using iotcon_attributes_destroy().
Parameters:
[in]listThe list handle
[in]posThe position
[out]attributesThe attributes value to get
Returns:
0 on success, otherwise a negative error value
Return values:
IOTCON_ERROR_NONESuccessful
IOTCON_ERROR_NOT_SUPPORTEDNot supported
IOTCON_ERROR_INVALID_PARAMETERInvalid parameter
IOTCON_ERROR_NO_DATANo data available
IOTCON_ERROR_REPRESENTATIONRepresentation errors
int iotcon_list_get_nth_bool ( iotcon_list_h  list,
int  pos,
bool *  val 
)

Gets the boolean value at the given position.

Iterates over the list until it reaches the pos-1 position.

Since :
3.0
Parameters:
[in]listThe list handle
[in]posThe position
[out]valThe boolean value to get
Returns:
0 on success, otherwise a negative error value
Return values:
IOTCON_ERROR_NONESuccessful
IOTCON_ERROR_NOT_SUPPORTEDNot supported
IOTCON_ERROR_INVALID_PARAMETERInvalid parameter
IOTCON_ERROR_NO_DATANo data available
IOTCON_ERROR_REPRESENTATIONRepresentation errors
int iotcon_list_get_nth_byte_str ( iotcon_list_h  list,
int  pos,
unsigned char **  val,
int *  len 
)

Gets the string value at the given position.

Iterates over the list until it reaches the pos-1 position.

Since :
3.0
Remarks:
val must not be released using free().
Parameters:
[in]listThe list handle
[in]posThe position
[out]valThe byte string value to get
[out]lenThe length of the val
Returns:
0 on success, otherwise a negative error value
Return values:
IOTCON_ERROR_NONESuccessful
IOTCON_ERROR_NOT_SUPPORTEDNot supported
IOTCON_ERROR_INVALID_PARAMETERInvalid parameter
IOTCON_ERROR_NO_DATANo data available
IOTCON_ERROR_REPRESENTATIONRepresentation errors
int iotcon_list_get_nth_double ( iotcon_list_h  list,
int  pos,
double *  val 
)

Gets the double value at the given position.

Iterates over the list until it reaches the pos-1 position.

Since :
3.0
Parameters:
[in]listThe list handle
[in]posThe position
[out]valThe double value to get
Returns:
0 on success, otherwise a negative error value
Return values:
IOTCON_ERROR_NONESuccessful
IOTCON_ERROR_NOT_SUPPORTEDNot supported
IOTCON_ERROR_INVALID_PARAMETERInvalid parameter
IOTCON_ERROR_NO_DATANo data available
IOTCON_ERROR_REPRESENTATIONRepresentation errors
int iotcon_list_get_nth_int ( iotcon_list_h  list,
int  pos,
int *  val 
)

Gets the integer value at the given position.

Iterates over the list until it reaches the pos-1 position.

Since :
3.0
Parameters:
[in]listThe list handle
[in]posThe position
[out]valThe integer value to get
Returns:
0 on success, otherwise a negative error value
Return values:
IOTCON_ERROR_NONESuccessful
IOTCON_ERROR_NOT_SUPPORTEDNot supported
IOTCON_ERROR_INVALID_PARAMETERInvalid parameter
IOTCON_ERROR_NO_DATANo data available
IOTCON_ERROR_REPRESENTATIONRepresentation errors
int iotcon_list_get_nth_list ( iotcon_list_h  src,
int  pos,
iotcon_list_h dest 
)

Gets the list value at the given position.

Iterates over the list until it reaches the pos-1 position.

Since :
3.0
Remarks:
dest must not be released using iotcon_list_destroy().
Parameters:
[in]srcThe list handle
[in]posThe position
[out]destThe list value to get
Returns:
0 on success, otherwise a negative error value
Return values:
IOTCON_ERROR_NONESuccessful
IOTCON_ERROR_NOT_SUPPORTEDNot supported
IOTCON_ERROR_INVALID_PARAMETERInvalid parameter
IOTCON_ERROR_NO_DATANo data available
IOTCON_ERROR_REPRESENTATIONRepresentation errors
int iotcon_list_get_nth_str ( iotcon_list_h  list,
int  pos,
char **  val 
)

Gets the string value at the given position.

Iterates over the list until it reaches the pos-1 position.

Since :
3.0
Remarks:
val must not be released using free().
Parameters:
[in]listThe list handle
[in]posThe position
[out]valThe string value to get
Returns:
0 on success, otherwise a negative error value
Return values:
IOTCON_ERROR_NONESuccessful
IOTCON_ERROR_NOT_SUPPORTEDNot supported
IOTCON_ERROR_INVALID_PARAMETERInvalid parameter
IOTCON_ERROR_NO_DATANo data available
IOTCON_ERROR_REPRESENTATIONRepresentation errors
int iotcon_list_get_type ( iotcon_list_h  list,
iotcon_type_e type 
)

Gets the type of the list.

It gets the data type of value related to the key in attributes. The data type could be one of iotcon_type_e.

Since :
3.0
Parameters:
[in]listThe list handle
[out]typeThe data type of list
Returns:
0 on success, otherwise a negative error value
Return values:
IOTCON_ERROR_NONESuccessful
IOTCON_ERROR_NOT_SUPPORTEDNot supported
IOTCON_ERROR_INVALID_PARAMETERInvalid parameter
int iotcon_list_remove_nth ( iotcon_list_h  list,
int  pos 
)

Removes the value at the given position.

Iterates over the list until it reaches the pos-1 position.

Since :
3.0
Parameters:
[in]listThe list handle
[in]posThe position to delete
Returns:
0 on success, otherwise a negative error value
Return values:
IOTCON_ERROR_NONESuccessful
IOTCON_ERROR_NOT_SUPPORTEDNot supported
IOTCON_ERROR_INVALID_PARAMETERInvalid parameter
IOTCON_ERROR_NO_DATANo data available