From: sung.goo.kim Date: Mon, 2 Nov 2015 07:20:06 +0000 (+0900) Subject: (ACR) Apply comments about resource_is_observable API (change to resource_get_properties) X-Git-Tag: accepted/tizen/mobile/20151201.031626~55 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=135d061ea4838f1a978cb17b897f40b5d409e37d;p=platform%2Fcore%2Fiot%2Fiotcon.git (ACR) Apply comments about resource_is_observable API (change to resource_get_properties) Change-Id: Icf78e0c270cad2dbe4f70bb54ebb2488edfb6a8e --- diff --git a/lib/icl-lite-resource.c b/lib/icl-lite-resource.c index 2b525b4..df93d2f 100644 --- a/lib/icl-lite-resource.c +++ b/lib/icl-lite-resource.c @@ -38,7 +38,7 @@ struct icl_lite_resource { iotcon_state_h state; int64_t handle; unsigned int sub_id; - bool is_observable; + int properties; }; @@ -113,7 +113,7 @@ static int _icl_lite_resource_notify(iotcon_lite_resource_h lite_resource) struct icl_resource resource = {0}; RETV_IF(NULL == lite_resource, IOTCON_ERROR_INVALID_PARAMETER); - if (false == lite_resource->is_observable) + if (false == (IOTCON_OBSERVABLE & lite_resource->properties)) return IOTCON_ERROR_NONE; resource.handle = lite_resource->handle; @@ -322,7 +322,7 @@ API int iotcon_lite_resource_create(const char *uri_path, return IOTCON_ERROR_IOTIVITY; } - resource->is_observable = properties & IOTCON_OBSERVABLE; + resource->properties = properties; resource->uri_path = ic_utils_strdup(uri_path); ret = icl_state_clone(state, &(resource->state)); diff --git a/lib/icl-resource.c b/lib/icl-resource.c index f4e6e87..ee69af1 100644 --- a/lib/icl-resource.c +++ b/lib/icl-resource.c @@ -214,7 +214,7 @@ API int iotcon_resource_create(const char *uri_path, resource->types = icl_resource_types_ref(res_types); resource->uri_path = ic_utils_strdup(uri_path); resource->ifaces = ifaces; - resource->is_observable = properties & IOTCON_OBSERVABLE; + resource->properties = properties; snprintf(sig_name, sizeof(sig_name), "%s_%u", IC_DBUS_SIGNAL_REQUEST_HANDLER, signal_number); @@ -520,12 +520,12 @@ API int iotcon_resource_get_interfaces(iotcon_resource_h resource, int *ifaces) } -API int iotcon_resource_is_observable(iotcon_resource_h resource, bool *observable) +API int iotcon_resource_get_properties(iotcon_resource_h resource, int *properties) { RETV_IF(NULL == resource, IOTCON_ERROR_INVALID_PARAMETER); - RETV_IF(NULL == observable, IOTCON_ERROR_INVALID_PARAMETER); + RETV_IF(NULL == properties, IOTCON_ERROR_INVALID_PARAMETER); - *observable = resource->is_observable; + *properties = resource->properties; return IOTCON_ERROR_NONE; } diff --git a/lib/icl-resource.h b/lib/icl-resource.h index dd8738f..2f08dc1 100644 --- a/lib/icl-resource.h +++ b/lib/icl-resource.h @@ -42,7 +42,7 @@ struct icl_notify_msg { struct icl_resource { char *uri_path; - bool is_observable; + int properties; iotcon_resource_types_h types; int ifaces; iotcon_request_handler_cb cb; diff --git a/lib/include/iotcon-resource.h b/lib/include/iotcon-resource.h index 1cd6512..218b613 100644 --- a/lib/include/iotcon-resource.h +++ b/lib/include/iotcon-resource.h @@ -331,7 +331,7 @@ int iotcon_resource_notify(iotcon_resource_h resource, iotcon_notimsg_h msg, * @see iotcon_resource_get_uri_path() * @see iotcon_resource_get_types() * @see iotcon_resource_get_interfaces() - * @see iotcon_resource_is_observable() + * @see iotcon_resource_get_properties() */ int iotcon_resource_get_number_of_children(iotcon_resource_h resource, int *number); @@ -352,7 +352,7 @@ int iotcon_resource_get_number_of_children(iotcon_resource_h resource, int *numb * @see iotcon_resource_get_uri_path() * @see iotcon_resource_get_types() * @see iotcon_resource_get_interfaces() - * @see iotcon_resource_is_observable() + * @see iotcon_resource_get_properties() */ int iotcon_resource_get_nth_child(iotcon_resource_h parent, int index, iotcon_resource_h *child); @@ -373,7 +373,7 @@ int iotcon_resource_get_nth_child(iotcon_resource_h parent, int index, * @see iotcon_resource_get_nth_child() * @see iotcon_resource_get_types() * @see iotcon_resource_get_interfaces() - * @see iotcon_resource_is_observable() + * @see iotcon_resource_get_properties() */ int iotcon_resource_get_uri_path(iotcon_resource_h resource, char **uri_path); @@ -393,7 +393,7 @@ int iotcon_resource_get_uri_path(iotcon_resource_h resource, char **uri_path); * @see iotcon_resource_get_nth_child() * @see iotcon_resource_get_uri_path() * @see iotcon_resource_get_interfaces() - * @see iotcon_resource_is_observable() + * @see iotcon_resource_get_properties() */ int iotcon_resource_get_types(iotcon_resource_h resource, iotcon_resource_types_h *types); @@ -413,7 +413,7 @@ int iotcon_resource_get_types(iotcon_resource_h resource, iotcon_resource_types_ * @see iotcon_resource_get_nth_child() * @see iotcon_resource_get_uri_path() * @see iotcon_resource_get_types() - * @see iotcon_resource_is_observable() + * @see iotcon_resource_get_properties() */ int iotcon_resource_get_interfaces(iotcon_resource_h resource, int *ifaces); @@ -423,7 +423,7 @@ int iotcon_resource_get_interfaces(iotcon_resource_h resource, int *ifaces); * @since_tizen 3.0 * * @param[in] resource The handle of the resource - * @param[out] observable The value of observable + * @param[out] properties The properties of resource * * @return 0 on success, otherwise a negative error value. * @retval #IOTCON_ERROR_NONE Successful @@ -435,7 +435,7 @@ int iotcon_resource_get_interfaces(iotcon_resource_h resource, int *ifaces); * @see iotcon_resource_get_types() * @see iotcon_resource_get_interfaces() */ -int iotcon_resource_is_observable(iotcon_resource_h resource, bool *observable); +int iotcon_resource_get_properties(iotcon_resource_h resource, int *properties); /** * @}