Change-Id: If39d3efab3786e834aac2389c759c076f258689a
- ret = iotcon_state_set_bool(resp_repr, "opened", true);
+ ret = iotcon_state_add_bool(resp_repr, "opened", true);
if (IOTCON_ERROR_NONE != ret) {
iotcon_state_destroy(state);
iotcon_representation_destroy(resp_repr);
if (IOTCON_ERROR_NONE != ret) {
iotcon_state_destroy(state);
iotcon_representation_destroy(resp_repr);
return IOTCON_ERROR_NONE;
}
return IOTCON_ERROR_NONE;
}
-API int iotcon_state_set_int(iotcon_state_h state, const char *key, int val)
+API int iotcon_state_add_int(iotcon_state_h state, const char *key, int val)
return IOTCON_ERROR_NONE;
}
return IOTCON_ERROR_NONE;
}
-API int iotcon_state_unset(iotcon_state_h state, const char *key)
+API int iotcon_state_remove(iotcon_state_h state, const char *key)
return IOTCON_ERROR_NONE;
}
return IOTCON_ERROR_NONE;
}
-API int iotcon_state_set_bool(iotcon_state_h state, const char *key, bool val)
+API int iotcon_state_add_bool(iotcon_state_h state, const char *key, bool val)
{
iotcon_value_h value = NULL;
{
iotcon_value_h value = NULL;
return IOTCON_ERROR_NONE;
}
return IOTCON_ERROR_NONE;
}
-API int iotcon_state_set_double(iotcon_state_h state, const char *key, double val)
+API int iotcon_state_add_double(iotcon_state_h state, const char *key, double val)
{
iotcon_value_h value = NULL;
{
iotcon_value_h value = NULL;
return IOTCON_ERROR_NONE;
}
return IOTCON_ERROR_NONE;
}
-API int iotcon_state_set_str(iotcon_state_h state, const char *key, char *val)
+API int iotcon_state_add_str(iotcon_state_h state, const char *key, char *val)
{
iotcon_value_h value = NULL;
{
iotcon_value_h value = NULL;
return IOTCON_ERROR_NONE;
}
return IOTCON_ERROR_NONE;
}
-API int iotcon_state_set_null(iotcon_state_h state, const char *key)
+API int iotcon_state_add_null(iotcon_state_h state, const char *key)
{
iotcon_value_h value = NULL;
{
iotcon_value_h value = NULL;
return IOTCON_ERROR_NONE;
}
return IOTCON_ERROR_NONE;
}
-API int iotcon_state_set_list(iotcon_state_h state, const char *key, iotcon_list_h list)
+API int iotcon_state_add_list(iotcon_state_h state, const char *key, iotcon_list_h list)
{
iotcon_value_h value = NULL;
{
iotcon_value_h value = NULL;
return IOTCON_ERROR_NONE;
}
return IOTCON_ERROR_NONE;
}
-API int iotcon_state_set_state(iotcon_state_h state, const char *key, iotcon_state_h val)
+API int iotcon_state_add_state(iotcon_state_h state, const char *key, iotcon_state_h val)
{
iotcon_value_h value = NULL;
{
iotcon_value_h value = NULL;
- ret = iotcon_state_set_bool(state, "power", true);
+ ret = iotcon_state_add_bool(state, "power", true);
if (IOTCON_ERROR_NONE != ret) {
iotcon_state_destroy(state);
iotcon_resource_types_destroy(resource_types);
return;
}
if (IOTCON_ERROR_NONE != ret) {
iotcon_state_destroy(state);
iotcon_resource_types_destroy(resource_types);
return;
}
- ret = iotcon_state_set_int(state, "brightness", 75);
+ ret = iotcon_state_add_int(state, "brightness", 75);
if (IOTCON_ERROR_NONE != ret) {
iotcon_state_destroy(state);
iotcon_resource_types_destroy(resource_types);
if (IOTCON_ERROR_NONE != ret) {
iotcon_state_destroy(state);
iotcon_resource_types_destroy(resource_types);
if (IOTCON_ERROR_NONE != ret)
return;
if (IOTCON_ERROR_NONE != ret)
return;
- ret = iotcon_state_set_int(state_clone, "brightness", brightness);
+ ret = iotcon_state_add_int(state_clone, "brightness", brightness);
if (IOTCON_ERROR_NONE != ret) {
iotcon_state_destroy(state_clone);
return;
if (IOTCON_ERROR_NONE != ret) {
iotcon_state_destroy(state_clone);
return;
- ret = iotcon_state_set_str(resp_repr, "type", "lamp");
+ ret = iotcon_state_add_str(resp_repr, "type", "lamp");
if (IOTCON_ERROR_NONE != ret) {
iotcon_resource_types_destroy(types);
iotcon_representation_destroy(resp_repr);
return;
}
if (IOTCON_ERROR_NONE != ret) {
iotcon_resource_types_destroy(types);
iotcon_representation_destroy(resp_repr);
return;
}
- ret = iotcon_state_set_str(resp_repr, "where", "desk");
+ ret = iotcon_state_add_str(resp_repr, "where", "desk");
if (IOTCON_ERROR_NONE != ret) {
iotcon_resource_types_destroy(types);
iotcon_representation_destroy(resp_repr);
return;
}
if (IOTCON_ERROR_NONE != ret) {
iotcon_resource_types_destroy(types);
iotcon_representation_destroy(resp_repr);
return;
}
- ret = iotcon_state_set_double(resp_repr, "default_bright", 200.0);
+ ret = iotcon_state_add_double(resp_repr, "default_bright", 200.0);
if (IOTCON_ERROR_NONE != ret) {
iotcon_resource_types_destroy(types);
iotcon_representation_destroy(resp_repr);
return;
}
if (IOTCON_ERROR_NONE != ret) {
iotcon_resource_types_destroy(types);
iotcon_representation_destroy(resp_repr);
return;
}
- ret = iotcon_state_set_str(resp_repr, "unit", "lux");
+ ret = iotcon_state_add_str(resp_repr, "unit", "lux");
if (IOTCON_ERROR_NONE != ret) {
iotcon_resource_types_destroy(types);
iotcon_representation_destroy(resp_repr);
return;
}
if (IOTCON_ERROR_NONE != ret) {
iotcon_resource_types_destroy(types);
iotcon_representation_destroy(resp_repr);
return;
}
- ret = iotcon_state_set_bool(resp_repr, "bright_step", true);
+ ret = iotcon_state_add_bool(resp_repr, "bright_step", true);
if (IOTCON_ERROR_NONE != ret) {
iotcon_resource_types_destroy(types);
iotcon_representation_destroy(resp_repr);
if (IOTCON_ERROR_NONE != ret) {
iotcon_resource_types_destroy(types);
iotcon_representation_destroy(resp_repr);
- ret = iotcon_state_set_list(resp_repr, "bright_step_list", bright_step_list);
+ ret = iotcon_state_add_list(resp_repr, "bright_step_list", bright_step_list);
if (IOTCON_ERROR_NONE != ret) {
iotcon_list_destroy(bright_step_list);
iotcon_resource_types_destroy(types);
if (IOTCON_ERROR_NONE != ret) {
iotcon_list_destroy(bright_step_list);
iotcon_resource_types_destroy(types);
- ret = iotcon_state_set_bool(state, "power", true);
+ ret = iotcon_state_add_bool(state, "power", true);
if (IOTCON_ERROR_NONE != ret) {
iotcon_state_destroy(state);
iotcon_representation_destroy(representation);
if (IOTCON_ERROR_NONE != ret) {
iotcon_state_destroy(state);
iotcon_representation_destroy(representation);
int iotcon_state_clone(iotcon_state_h state, iotcon_state_h *state_clone);
/**
int iotcon_state_clone(iotcon_state_h state, iotcon_state_h *state_clone);
/**
- * @brief Sets a new key and integer value into the representation.
+ * @brief Adds a new key and integer value into the representation.
* @details If @a key is already exists, current value will be replaced with new @a val.
*
* @since_tizen 3.0
* @details If @a key is already exists, current value will be replaced with new @a val.
*
* @since_tizen 3.0
* @retval #IOTCON_ERROR_OUT_OF_MEMORY Out of memory
* @retval #IOTCON_ERROR_INVALID_PARAMETER Invalid parameter
*/
* @retval #IOTCON_ERROR_OUT_OF_MEMORY Out of memory
* @retval #IOTCON_ERROR_INVALID_PARAMETER Invalid parameter
*/
-int iotcon_state_set_int(iotcon_state_h state, const char *key, int val);
+int iotcon_state_add_int(iotcon_state_h state, const char *key, int val);
- * @brief Sets a new key and boolean value into the representation.
+ * @brief Adds a new key and boolean value into the representation.
* @details If @a key is already exists, current value will be replaced with new @a val.
*
* @since_tizen 3.0
* @details If @a key is already exists, current value will be replaced with new @a val.
*
* @since_tizen 3.0
* @retval #IOTCON_ERROR_OUT_OF_MEMORY Out of memory
* @retval #IOTCON_ERROR_INVALID_PARAMETER Invalid parameter
*/
* @retval #IOTCON_ERROR_OUT_OF_MEMORY Out of memory
* @retval #IOTCON_ERROR_INVALID_PARAMETER Invalid parameter
*/
-int iotcon_state_set_bool(iotcon_state_h state, const char *key, bool val);
+int iotcon_state_add_bool(iotcon_state_h state, const char *key, bool val);
- * @brief Sets a new key and double value into the representation.
+ * @brief Adds a new key and double value into the representation.
* @details If @a key is already exists, current value will be replaced with new @a val.
*
* @since_tizen 3.0
* @details If @a key is already exists, current value will be replaced with new @a val.
*
* @since_tizen 3.0
* @retval #IOTCON_ERROR_OUT_OF_MEMORY Out of memory
* @retval #IOTCON_ERROR_INVALID_PARAMETER Invalid parameter
*/
* @retval #IOTCON_ERROR_OUT_OF_MEMORY Out of memory
* @retval #IOTCON_ERROR_INVALID_PARAMETER Invalid parameter
*/
-int iotcon_state_set_double(iotcon_state_h state, const char *key, double val);
+int iotcon_state_add_double(iotcon_state_h state, const char *key, double val);
- * @brief Sets a new key and string value into the representation.
+ * @brief Adds a new key and string value into the representation.
* @details If @a key is already exists, current value will be replaced with new @a val.
*
* @since_tizen 3.0
* @details If @a key is already exists, current value will be replaced with new @a val.
*
* @since_tizen 3.0
* @retval #IOTCON_ERROR_OUT_OF_MEMORY Out of memory
* @retval #IOTCON_ERROR_INVALID_PARAMETER Invalid parameter
*/
* @retval #IOTCON_ERROR_OUT_OF_MEMORY Out of memory
* @retval #IOTCON_ERROR_INVALID_PARAMETER Invalid parameter
*/
-int iotcon_state_set_str(iotcon_state_h state, const char *key, char *val);
+int iotcon_state_add_str(iotcon_state_h state, const char *key, char *val);
- * @brief Sets a new key and list value into the representation.
+ * @brief Adds a new key and list value into the representation.
* @details If @a key is already exists, current list will be replaced with new @a list.
*
* @since_tizen 3.0
* @details If @a key is already exists, current list will be replaced with new @a list.
*
* @since_tizen 3.0
* @retval #IOTCON_ERROR_OUT_OF_MEMORY Out of memory
* @retval #IOTCON_ERROR_INVALID_PARAMETER Invalid parameter
*/
* @retval #IOTCON_ERROR_OUT_OF_MEMORY Out of memory
* @retval #IOTCON_ERROR_INVALID_PARAMETER Invalid parameter
*/
-int iotcon_state_set_list(iotcon_state_h state, const char *key, iotcon_list_h list);
+int iotcon_state_add_list(iotcon_state_h state, const char *key, iotcon_list_h list);
- * @brief Sets a new key and state value into the representation.
+ * @brief Adds a new key and state value into the representation.
* @details If @a key is already exists, current state will be replaced with new @a src.
*
* @since_tizen 3.0
* @details If @a key is already exists, current state will be replaced with new @a src.
*
* @since_tizen 3.0
* @retval #IOTCON_ERROR_OUT_OF_MEMORY Out of memory
* @retval #IOTCON_ERROR_INVALID_PARAMETER Invalid parameter
*/
* @retval #IOTCON_ERROR_OUT_OF_MEMORY Out of memory
* @retval #IOTCON_ERROR_INVALID_PARAMETER Invalid parameter
*/
-int iotcon_state_set_state(iotcon_state_h dest, const char *key, iotcon_state_h src);
+int iotcon_state_add_state(iotcon_state_h dest, const char *key, iotcon_state_h src);
- * @brief Sets a new key with NULL value into the representation.
+ * @brief Adds a new key with NULL value into the representation.
* @details If @a key is already exists, current value will be replaced with NULL
*
* @since_tizen 3.0
* @details If @a key is already exists, current value will be replaced with NULL
*
* @since_tizen 3.0
* @retval #IOTCON_ERROR_OUT_OF_MEMORY Out of memory
* @retval #IOTCON_ERROR_INVALID_PARAMETER Invalid parameter
*/
* @retval #IOTCON_ERROR_OUT_OF_MEMORY Out of memory
* @retval #IOTCON_ERROR_INVALID_PARAMETER Invalid parameter
*/
-int iotcon_state_set_null(iotcon_state_h state, const char *key);
+int iotcon_state_add_null(iotcon_state_h state, const char *key);
/**
* @brief Gets the integer value from the given key.
/**
* @brief Gets the integer value from the given key.
int iotcon_state_is_null(iotcon_state_h state, const char *key, bool *is_null);
/**
int iotcon_state_is_null(iotcon_state_h state, const char *key, bool *is_null);
/**
- * @brief Unsets the key and its associated value from the state.
+ * @brief Removes the key and its associated value from the state.
* @retval #IOTCON_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #IOTCON_ERROR_NO_DATA No data available
*/
* @retval #IOTCON_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #IOTCON_ERROR_NO_DATA No data available
*/
-int iotcon_state_unset(iotcon_state_h state, const char *key);
+int iotcon_state_remove(iotcon_state_h state, const char *key);
/**
* @brief Gets the type of a value at the given key.
/**
* @brief Gets the type of a value at the given key.
- ret = iotcon_state_set_bool(send_state, "opened", !opened);
+ ret = iotcon_state_add_bool(send_state, "opened", !opened);
if (IOTCON_ERROR_NONE != ret) {
if (IOTCON_ERROR_NONE != ret) {
- ERR("iotcon_state_set_bool() Fail(%d)", ret);
+ ERR("iotcon_state_add_bool() Fail(%d)", ret);
iotcon_state_destroy(send_state);
iotcon_representation_destroy(send_repr);
return;
iotcon_state_destroy(send_state);
iotcon_representation_destroy(send_repr);
return;
- ret = iotcon_state_set_bool(state, "opened", door->state);
+ ret = iotcon_state_add_bool(state, "opened", door->state);
if (IOTCON_ERROR_NONE != ret) {
if (IOTCON_ERROR_NONE != ret) {
- ERR("iotcon_state_set_bool() Fail(%d)", ret);
+ ERR("iotcon_state_add_bool() Fail(%d)", ret);
iotcon_state_destroy(state);
iotcon_representation_destroy(repr);
return NULL;
iotcon_state_destroy(state);
iotcon_representation_destroy(repr);
return NULL;
- ret = iotcon_state_set_str(resp_state, "createduripath", DOOR_RESOURCE_URI2);
+ ret = iotcon_state_add_str(resp_state, "createduripath", DOOR_RESOURCE_URI2);
if (IOTCON_ERROR_NONE != ret) {
if (IOTCON_ERROR_NONE != ret) {
- ERR("iotcon_state_set_str() Fail(%d)", ret);
+ ERR("iotcon_state_add_str() Fail(%d)", ret);
iotcon_state_destroy(resp_state);
iotcon_representation_destroy(resp_repr);
return -1;
iotcon_state_destroy(resp_state);
iotcon_representation_destroy(resp_repr);
return -1;
return G_SOURCE_CONTINUE;
}
return G_SOURCE_CONTINUE;
}
- ret = iotcon_state_set_bool(send_state, "opened", door->state);
+ ret = iotcon_state_add_bool(send_state, "opened", door->state);
if (IOTCON_ERROR_NONE != ret) {
if (IOTCON_ERROR_NONE != ret) {
- ERR("iotcon_state_set_bool() Fail(%d)", ret);
+ ERR("iotcon_state_add_bool() Fail(%d)", ret);
iotcon_state_destroy(send_state);
return G_SOURCE_CONTINUE;
}
iotcon_state_destroy(send_state);
return G_SOURCE_CONTINUE;
}
- ret = iotcon_state_set_bool(state, "opened", false);
+ ret = iotcon_state_add_bool(state, "opened", false);
if (IOTCON_ERROR_NONE != ret) {
if (IOTCON_ERROR_NONE != ret) {
- ERR("iotcon_state_set_bool() Fail(%d)", ret);
+ ERR("iotcon_state_add_bool() Fail(%d)", ret);
iotcon_state_destroy(state);
iotcon_resource_types_destroy(resource_types);
return NULL;
iotcon_state_destroy(state);
iotcon_resource_types_destroy(resource_types);
return NULL;
- ret = iotcon_state_set_int(state, "brightness", light->brightness);
+ ret = iotcon_state_add_int(state, "brightness", light->brightness);
if (IOTCON_ERROR_NONE != ret) {
if (IOTCON_ERROR_NONE != ret) {
- ERR("iotcon_state_set_int() Fail(%d)", ret);
+ ERR("iotcon_state_add_int() Fail(%d)", ret);
iotcon_state_destroy(state);
iotcon_representation_destroy(repr);
return NULL;
iotcon_state_destroy(state);
iotcon_representation_destroy(repr);
return NULL;
- ret = iotcon_state_set_bool(state, "state", fan->state);
+ ret = iotcon_state_add_bool(state, "state", fan->state);
if (IOTCON_ERROR_NONE != ret) {
if (IOTCON_ERROR_NONE != ret) {
- ERR("iotcon_state_set_bool() Fail(%d)", ret);
+ ERR("iotcon_state_add_bool() Fail(%d)", ret);
iotcon_state_destroy(state);
iotcon_representation_destroy(repr);
return NULL;
iotcon_state_destroy(state);
iotcon_representation_destroy(repr);
return NULL;
- ret = iotcon_state_set_str(state, "name", room->name);
+ ret = iotcon_state_add_str(state, "name", room->name);
if (IOTCON_ERROR_NONE != ret) {
if (IOTCON_ERROR_NONE != ret) {
- ERR("iotcon_state_set_str() Fail(%d)", ret);
+ ERR("iotcon_state_add_str() Fail(%d)", ret);
iotcon_state_destroy(state);
iotcon_representation_destroy(repr);
return NULL;
}
/* set null */
iotcon_state_destroy(state);
iotcon_representation_destroy(repr);
return NULL;
}
/* set null */
- ret = iotcon_state_set_null(state, "null value");
+ ret = iotcon_state_add_null(state, "null value");
if (IOTCON_ERROR_NONE != ret) {
if (IOTCON_ERROR_NONE != ret) {
- ERR("iotcon_state_set_null() Fail(%d)", ret);
+ ERR("iotcon_state_add_null() Fail(%d)", ret);
iotcon_state_destroy(state);
iotcon_representation_destroy(repr);
return NULL;
iotcon_state_destroy(state);
iotcon_representation_destroy(repr);
return NULL;
- ret = iotcon_state_set_list(state, "today_temp", today_temp);
+ ret = iotcon_state_add_list(state, "today_temp", today_temp);
if (IOTCON_ERROR_NONE != ret) {
if (IOTCON_ERROR_NONE != ret) {
- ERR("iotcon_state_set_list() Fail(%d)", ret);
+ ERR("iotcon_state_add_list() Fail(%d)", ret);
iotcon_list_destroy(today_temp);
iotcon_state_destroy(state);
iotcon_representation_destroy(repr);
iotcon_list_destroy(today_temp);
iotcon_state_destroy(state);
iotcon_representation_destroy(repr);