diff options
-rw-r--r-- | packaging/iotcon.spec | 2 | ||||
-rw-r--r-- | src/ic-ioty-ocprocess.c | 8 | ||||
-rw-r--r-- | src/ic-ioty.c | 96 | ||||
-rw-r--r-- | src/ic-ioty.h | 2 | ||||
-rw-r--r-- | src/ic-lite-resource.h | 2 | ||||
-rw-r--r-- | src/ic-remote-resource-caching.c | 4 | ||||
-rw-r--r-- | src/ic-remote-resource-crud.c | 4 | ||||
-rw-r--r-- | src/ic-remote-resource.c | 6 | ||||
-rw-r--r-- | src/ic-remote-resource.h | 5 | ||||
-rw-r--r-- | src/ic-request.h | 4 | ||||
-rw-r--r-- | src/ic-resource.h | 2 | ||||
-rw-r--r-- | src/ic-response.h | 4 | ||||
-rw-r--r-- | src/ic-types.c | 6 | ||||
-rw-r--r-- | src/ic-types.h | 2 | ||||
-rw-r--r-- | src/ic.c | 1 |
15 files changed, 58 insertions, 90 deletions
diff --git a/packaging/iotcon.spec b/packaging/iotcon.spec index 86a8f1e..0cf7c68 100644 --- a/packaging/iotcon.spec +++ b/packaging/iotcon.spec @@ -1,6 +1,6 @@ Name: iotcon Summary: Tizen IoT Connectivity -Version: 0.3.6 +Version: 0.3.7 Release: 0 Group: Network & Connectivity/Service License: Apache-2.0 diff --git a/src/ic-ioty-ocprocess.c b/src/ic-ioty-ocprocess.c index 6d658b5..15659b1 100644 --- a/src/ic-ioty-ocprocess.c +++ b/src/ic-ioty-ocprocess.c @@ -751,8 +751,8 @@ OCEntityHandlerResult icl_ioty_ocprocess_request_cb(OCEntityHandlerFlag flag, req->observation_info.action = obs_type; req->observation_info.observe_id = observe_id; req->repr = repr; - req->oic_request_h = IC_POINTER_TO_INT64(request->requestHandle); - req->oic_resource_h = IC_POINTER_TO_INT64(request->resource); + req->oic_request_h = request->requestHandle; + req->oic_resource_h = request->resource; icl_request_container_s *req_container = calloc(1, sizeof(icl_request_container_s)); req_container->request = req; @@ -874,8 +874,8 @@ OCEntityHandlerResult icl_ioty_ocprocess_lite_request_cb(OCEntityHandlerFlag fla ERR("calloc() Fail(%d)", errno); return OC_EH_ERROR; } - res->oic_request_h = IC_POINTER_TO_INT64(request->requestHandle); - res->oic_resource_h = IC_POINTER_TO_INT64(request->resource); + res->oic_request_h = request->requestHandle; + res->oic_resource_h = request->resource; switch (req_type) { case IOTCON_REQUEST_GET: diff --git a/src/ic-ioty.c b/src/ic-ioty.c index 2be4ce6..897dda8 100644 --- a/src/ic-ioty.c +++ b/src/ic-ioty.c @@ -854,12 +854,11 @@ static int _icl_ioty_remote_resource_observe(iotcon_remote_resource_h resource, iotcon_query_h query, iotcon_remote_resource_observe_cb cb, void *user_data, - OCDoHandle *observe_handle) + OCDoHandle *obs_handle) { int ret, options_size = 0; char *uri = NULL; OCMethod method; - OCDoHandle handle; OCDevAddr dev_addr = {0}; OCCallbackData cbdata = {0}; OCConnectivityType oic_conn_type; @@ -939,7 +938,7 @@ static int _icl_ioty_remote_resource_observe(iotcon_remote_resource_h resource, return ret; } - ret = OCDoResource(&handle, method, uri, &dev_addr, NULL, oic_conn_type, + ret = OCDoResource(obs_handle, method, uri, &dev_addr, NULL, oic_conn_type, OC_HIGH_QOS, &cbdata, oic_options_ptr, options_size); icl_ioty_mutex_unlock(); @@ -951,7 +950,6 @@ static int _icl_ioty_remote_resource_observe(iotcon_remote_resource_h resource, } free(uri); - *observe_handle = handle; return IOTCON_ERROR_NONE; @@ -965,28 +963,25 @@ int icl_ioty_remote_resource_observe_register( void *user_data) { int ret; - OCDoHandle handle = NULL; RETV_IF(NULL == resource, IOTCON_ERROR_INVALID_PARAMETER); RETV_IF(NULL == cb, IOTCON_ERROR_INVALID_PARAMETER); - RETV_IF(resource->observe_handle, IOTCON_ERROR_ALREADY); + RETV_IF(resource->obs_handle, IOTCON_ERROR_ALREADY); ret = _icl_ioty_remote_resource_observe(resource, observe_policy, query, cb, user_data, - &handle); + &(resource->obs_handle)); if (IOTCON_ERROR_NONE != ret) { ERR("_icl_ioty_remote_resource_observe() Fail(%d)", ret); return ret; } - resource->observe_handle = IC_POINTER_TO_INT64(handle); return IOTCON_ERROR_NONE; } int icl_ioty_remote_resource_observe_cancel(iotcon_remote_resource_h resource, - int64_t observe_handle) + OCDoHandle obs_handle) { int ret; int options_size = 0; - OCDoHandle handle; OCHeaderOption *oic_options_ptr = NULL; OCHeaderOption oic_options[MAX_HEADER_OPTIONS]; @@ -1003,14 +998,13 @@ int icl_ioty_remote_resource_observe_cancel(iotcon_remote_resource_h resource, oic_options_ptr = oic_options; options_size = g_hash_table_size(resource->header_options->hash); } - handle = IC_INT64_TO_POINTER(observe_handle); ret = icl_ioty_mutex_lock(); if (IOTCON_ERROR_NONE != ret) { ERR("icl_ioty_mutex_lock() Fail(%d)", ret); return ret; } - ret = OCCancel(handle, OC_HIGH_QOS, oic_options_ptr, options_size); + ret = OCCancel(obs_handle, OC_HIGH_QOS, oic_options_ptr, options_size); icl_ioty_mutex_unlock(); if (OC_STACK_OK != ret) { @@ -1027,15 +1021,15 @@ int icl_ioty_remote_resource_observe_deregister( int ret; RETV_IF(NULL == resource, IOTCON_ERROR_INVALID_PARAMETER); - RETV_IF(0 == resource->observe_handle, IOTCON_ERROR_INVALID_PARAMETER); + RETV_IF(NULL == resource->obs_handle, IOTCON_ERROR_INVALID_PARAMETER); - ret = icl_ioty_remote_resource_observe_cancel(resource, resource->observe_handle); + ret = icl_ioty_remote_resource_observe_cancel(resource, resource->obs_handle); if (IOTCON_ERROR_NONE != ret) { ERR("icl_ioty_remote_resource_observe_cancel() Fail(%d)", ret); return ret; } - resource->observe_handle = 0; + resource->obs_handle = NULL; return IOTCON_ERROR_NONE; } @@ -1303,7 +1297,7 @@ static void _icl_ioty_encap_get_cb(iotcon_remote_resource_h resource, } /* CACHING */ - if (resource->caching.observe) { + if (resource->caching.obs_handle) { switch (err) { case IOTCON_ERROR_NONE: repr = response->repr; @@ -1414,7 +1408,7 @@ int icl_ioty_remote_resource_start_monitoring(iotcon_remote_resource_h resource, } /* get */ - if (resource->caching.observe) + if (resource->caching.obs_handle) return IOTCON_ERROR_NONE; ret = icl_ioty_remote_resource_set_checking_interval(resource, @@ -1433,7 +1427,7 @@ int icl_ioty_remote_resource_stop_monitoring(iotcon_remote_resource_h resource) RETV_IF(NULL == resource, IOTCON_ERROR_INVALID_PARAMETER); - if (0 == resource->caching.observe && resource->timer_id) { + if (NULL == resource->caching.obs_handle && resource->timer_id) { g_source_remove(resource->timer_id); resource->timer_id = 0; } @@ -1461,7 +1455,6 @@ int icl_ioty_remote_resource_start_caching(iotcon_remote_resource_h resource, { FN_CALL; int ret; - OCDoHandle handle = NULL; RETV_IF(NULL == resource, IOTCON_ERROR_INVALID_PARAMETER); @@ -1470,12 +1463,11 @@ int icl_ioty_remote_resource_start_caching(iotcon_remote_resource_h resource, /* observe */ ret = _icl_ioty_remote_resource_observe(resource, IOTCON_OBSERVE_IGNORE_OUT_OF_ORDER, - NULL, _icl_ioty_caching_observe_cb, NULL, &handle); + NULL, _icl_ioty_caching_observe_cb, NULL, &(resource->caching.obs_handle)); if (IOTCON_ERROR_NONE != ret) { ERR("_icl_ioty_remote_resource_observe() Fail(%d)", ret); return ret; } - resource->caching.observe = IC_POINTER_TO_INT64(handle); /* get */ if (resource->monitoring.presence) @@ -1503,12 +1495,12 @@ int icl_ioty_remote_resource_stop_caching(iotcon_remote_resource_h resource) } ret = icl_ioty_remote_resource_observe_cancel(resource, - resource->caching.observe); + resource->caching.obs_handle); if (IOTCON_ERROR_NONE != ret) { ERR("icl_ioty_remote_resource_observe_cancel() Fail(%d)", ret); return IOTCON_ERROR_INVALID_PARAMETER; } - resource->caching.observe = 0; + resource->caching.obs_handle = NULL; return IOTCON_ERROR_NONE; } @@ -1647,7 +1639,7 @@ int icl_ioty_resource_create(const char *uri_path, iotcon_resource_destroy(resource); return IOTCON_ERROR_IOTIVITY; } - resource->handle = IC_POINTER_TO_INT64(handle); + resource->res_handle = handle; for (c = res_types->type_list, i = 0; c; c = c->next, i++) { if (0 == i) /* skip a first resource type */ @@ -1671,7 +1663,6 @@ int icl_ioty_resource_bind_type(iotcon_resource_h resource, { FN_CALL; int ret; - OCResourceHandle handle; iotcon_resource_types_h resource_types; RETV_IF(NULL == resource, IOTCON_ERROR_INVALID_PARAMETER); @@ -1690,8 +1681,7 @@ int icl_ioty_resource_bind_type(iotcon_resource_h resource, return ret; } - handle = IC_INT64_TO_POINTER(resource->handle); - ret = _icl_ioty_resource_bind_type(handle, resource_type); + ret = _icl_ioty_resource_bind_type(resource->res_handle, resource_type); if (IOTCON_ERROR_NONE != ret) { ERR("_icl_ioty_resource_bind_type Fail(%d)", ret); iotcon_resource_types_destroy(resource_types); @@ -1709,7 +1699,6 @@ int icl_ioty_resource_bind_interface(iotcon_resource_h resource, { FN_CALL; int ret; - OCResourceHandle handle; RETV_IF(NULL == resource, IOTCON_ERROR_INVALID_PARAMETER); @@ -1719,8 +1708,7 @@ int icl_ioty_resource_bind_interface(iotcon_resource_h resource, return ret; } - handle = IC_INT64_TO_POINTER(resource->handle); - ret = _icl_ioty_resource_bind_interface(handle, iface); + ret = _icl_ioty_resource_bind_interface(resource->res_handle, iface); if (IOTCON_ERROR_NONE != ret) { ERR("_icl_ioty_resource_bind_interface() Fail(%d)", ret); return ret; @@ -1734,21 +1722,17 @@ int icl_ioty_resource_bind_child_resource(iotcon_resource_h parent, { FN_CALL; int ret; - OCResourceHandle handle_parent, handle_child; RETV_IF(NULL == parent, IOTCON_ERROR_INVALID_PARAMETER); RETV_IF(NULL == child, IOTCON_ERROR_INVALID_PARAMETER); RETV_IF(parent == child, IOTCON_ERROR_INVALID_PARAMETER); - handle_parent = IC_INT64_TO_POINTER(parent->handle); - handle_child = IC_INT64_TO_POINTER(child->handle); - ret = icl_ioty_mutex_lock(); if (IOTCON_ERROR_NONE != ret) { ERR("icl_ioty_mutex_lock() Fail(%d)", ret); return ret; } - ret = OCBindResource(handle_parent, handle_child); + ret = OCBindResource(parent->res_handle, child->res_handle); icl_ioty_mutex_unlock(); if (OC_STACK_OK != ret) { @@ -1764,20 +1748,16 @@ int icl_ioty_resource_unbind_child_resource(iotcon_resource_h parent, { FN_CALL; int ret; - OCResourceHandle handle_parent, handle_child; RETV_IF(NULL == parent, IOTCON_ERROR_INVALID_PARAMETER); RETV_IF(NULL == child, IOTCON_ERROR_INVALID_PARAMETER); - handle_parent = IC_INT64_TO_POINTER(parent->handle); - handle_child = IC_INT64_TO_POINTER(child->handle); - ret = icl_ioty_mutex_lock(); if (IOTCON_ERROR_NONE != ret) { ERR("icl_ioty_mutex_lock() Fail(%d)", ret); return ret; } - ret = OCUnBindResource(handle_parent, handle_child); + ret = OCUnBindResource(parent->res_handle, child->res_handle); icl_ioty_mutex_unlock(); if (OC_STACK_OK != ret) { @@ -1797,7 +1777,6 @@ int icl_ioty_resource_notify(iotcon_resource_h resource, iotcon_representation_h iotcon_observers_h observers_ori; OCObservationId obs_ids[IC_OBSERVE_ID_MAX_LEN]; OCQualityOfService oc_qos; - OCResourceHandle handle; RETV_IF(NULL == resource, IOTCON_ERROR_INVALID_PARAMETER); @@ -1823,17 +1802,15 @@ int icl_ioty_resource_notify(iotcon_resource_h resource, iotcon_representation_h oc_qos = ic_ioty_convert_qos(qos); - handle = IC_INT64_TO_POINTER(resource->handle); - ret = icl_ioty_mutex_lock(); if (IOTCON_ERROR_NONE != ret) { ERR("icl_ioty_mutex_lock() Fail(%d)", ret); return ret; } if (payload) - ret = OCNotifyListOfObservers(handle, obs_ids, obs_length, payload, oc_qos); + ret = OCNotifyListOfObservers(resource->res_handle, obs_ids, obs_length, payload, oc_qos); else - ret = OCNotifyAllObservers(handle, oc_qos); + ret = OCNotifyAllObservers(resource->res_handle, oc_qos); icl_ioty_mutex_unlock(); if (OC_STACK_NO_OBSERVERS == ret) { @@ -1851,25 +1828,22 @@ int icl_ioty_resource_destroy(iotcon_resource_h resource) { FN_CALL; int ret; - OCResourceHandle handle; RETV_IF(NULL == resource, IOTCON_ERROR_INVALID_PARAMETER); - handle = IC_INT64_TO_POINTER(resource->handle); - ret = icl_ioty_mutex_lock(); if (IOTCON_ERROR_NONE != ret) { ERR("icl_ioty_mutex_lock() Fail(%d)", ret); return ret; } - ret = OCDeleteResource(handle); + ret = OCDeleteResource(resource->res_handle); icl_ioty_mutex_unlock(); if (OC_STACK_OK != ret) { ERR("OCDeleteResource() Fail(%d)", ret); return ic_ioty_parse_oic_error(ret); } - resource->handle = 0; + resource->res_handle = NULL; return IOTCON_ERROR_NONE; } @@ -1886,7 +1860,6 @@ int icl_ioty_lite_resource_create(const char *uri_path, FN_CALL; int ret, i; GList *c; - OCResourceHandle handle; iotcon_lite_resource_h resource; const char *res_iface = NULL; @@ -1919,7 +1892,7 @@ int icl_ioty_lite_resource_create(const char *uri_path, icl_ioty_lite_resource_destroy(resource); return ret; } - ret = OCCreateResource(&handle, res_types->type_list->data, res_iface, uri_path, + ret = OCCreateResource(&(resource->res_handle), res_types->type_list->data, res_iface, uri_path, icl_ioty_ocprocess_lite_request_cb, resource, policies); icl_ioty_mutex_unlock(); if (OC_STACK_OK != ret) { @@ -1927,12 +1900,11 @@ int icl_ioty_lite_resource_create(const char *uri_path, icl_ioty_lite_resource_destroy(resource); return IOTCON_ERROR_IOTIVITY; } - resource->handle = IC_POINTER_TO_INT64(handle); for (c = res_types->type_list, i = 0; c; c = c->next, i++) { if (0 == i) /* skip a first resource type */ continue; - _icl_ioty_resource_bind_type(handle, c->data); + _icl_ioty_resource_bind_type(resource->res_handle, c->data); } *resource_handle = resource; @@ -1944,25 +1916,22 @@ int icl_ioty_lite_resource_destroy(iotcon_lite_resource_h resource) { FN_CALL; int ret; - OCResourceHandle handle; RETV_IF(NULL == resource, IOTCON_ERROR_INVALID_PARAMETER); - handle = IC_INT64_TO_POINTER(resource->handle); - ret = icl_ioty_mutex_lock(); if (IOTCON_ERROR_NONE != ret) { ERR("icl_ioty_mutex_lock() Fail(%d)", ret); return ret; } - ret = OCDeleteResource(handle); + ret = OCDeleteResource(resource->res_handle); icl_ioty_mutex_unlock(); if (OC_STACK_OK != ret) { ERR("OCDeleteResource() Fail(%d)", ret); return ic_ioty_parse_oic_error(ret); } - resource->handle = 0; + resource->res_handle = NULL; free(resource->uri_path); free(resource); @@ -1973,18 +1942,15 @@ int icl_ioty_lite_resource_notify(iotcon_lite_resource_h resource) { FN_CALL; int ret; - OCResourceHandle handle; RETV_IF(NULL == resource, IOTCON_ERROR_INVALID_PARAMETER); - handle = IC_INT64_TO_POINTER(resource->handle); - ret = icl_ioty_mutex_lock(); if (IOTCON_ERROR_NONE != ret) { ERR("icl_ioty_mutex_lock() Fail(%d)", ret); return ret; } - ret = OCNotifyAllObservers(handle, IOTCON_QOS_HIGH); + ret = OCNotifyAllObservers(resource->res_handle, IOTCON_QOS_HIGH); icl_ioty_mutex_unlock(); if (OC_STACK_NO_OBSERVERS == ret) { @@ -2029,8 +1995,8 @@ int icl_ioty_response_send(iotcon_response_h response_handle) RETV_IF(NULL == response_handle, IOTCON_ERROR_INVALID_PARAMETER); - response.requestHandle = (unsigned int)(response_handle->oic_request_h); - response.resourceHandle = IC_INT64_TO_POINTER(response_handle->oic_resource_h); + response.requestHandle = response_handle->oic_request_h; + response.resourceHandle = response_handle->oic_resource_h; response.ehResult = ic_ioty_convert_response_result(response_handle->result); if (response_handle->header_options && response_handle->header_options->hash) { diff --git a/src/ic-ioty.h b/src/ic-ioty.h index 249085b..f8fcfa2 100644 --- a/src/ic-ioty.h +++ b/src/ic-ioty.h @@ -102,7 +102,7 @@ int icl_ioty_remote_resource_delete(iotcon_remote_resource_h resource, iotcon_remote_resource_response_cb cb, void *user_data); int icl_ioty_remote_resource_observe_cancel(iotcon_remote_resource_h resource, - int64_t handle); + OCDoHandle obs_handle); int icl_ioty_remote_resource_start_monitoring(iotcon_remote_resource_h resource, iotcon_remote_resource_state_changed_cb cb, void *user_data); int icl_ioty_remote_resource_stop_monitoring(iotcon_remote_resource_h resource); diff --git a/src/ic-lite-resource.h b/src/ic-lite-resource.h index 00b05d7..315bc26 100644 --- a/src/ic-lite-resource.h +++ b/src/ic-lite-resource.h @@ -23,7 +23,7 @@ struct icl_lite_resource { char *uri_path; iotcon_attributes_h attributes; - int64_t handle; + OCResourceHandle res_handle; uint8_t policies; iotcon_lite_resource_post_request_cb cb; void *cb_data; diff --git a/src/ic-remote-resource-caching.c b/src/ic-remote-resource-caching.c index d54727f..e22cb77 100644 --- a/src/ic-remote-resource-caching.c +++ b/src/ic-remote-resource-caching.c @@ -40,7 +40,7 @@ API int iotcon_remote_resource_start_caching(iotcon_remote_resource_h resource, ERR("The resource should be cloned."); return IOTCON_ERROR_INVALID_PARAMETER; } - if (resource->caching.observe) { + if (resource->caching.obs_handle) { ERR("Already Start Caching"); return IOTCON_ERROR_ALREADY; } @@ -68,7 +68,7 @@ API int iotcon_remote_resource_stop_caching(iotcon_remote_resource_h resource) IOTCON_ERROR_PERMISSION_DENIED); RETV_IF(NULL == resource, IOTCON_ERROR_INVALID_PARAMETER); - if (0 == resource->caching.observe) { + if (0 == resource->caching.obs_handle) { ERR("Not Cached"); return IOTCON_ERROR_INVALID_PARAMETER; } diff --git a/src/ic-remote-resource-crud.c b/src/ic-remote-resource-crud.c index d8dc861..0de99b8 100644 --- a/src/ic-remote-resource-crud.c +++ b/src/ic-remote-resource-crud.c @@ -147,7 +147,7 @@ API int iotcon_remote_resource_observe_register( IOTCON_ERROR_PERMISSION_DENIED); RETV_IF(NULL == resource, IOTCON_ERROR_INVALID_PARAMETER); RETV_IF(NULL == cb, IOTCON_ERROR_INVALID_PARAMETER); - RETV_IF(resource->observe_handle, IOTCON_ERROR_ALREADY); + RETV_IF(resource->obs_handle, IOTCON_ERROR_ALREADY); if (true == resource->is_found) { ERR("The resource should be cloned."); @@ -180,7 +180,7 @@ API int iotcon_remote_resource_observe_deregister( return IOTCON_ERROR_INVALID_PARAMETER; } - if (0 == resource->observe_handle) { + if (NULL == resource->obs_handle) { ERR("It doesn't have a observe_handle"); return IOTCON_ERROR_INVALID_PARAMETER; } diff --git a/src/ic-remote-resource.c b/src/ic-remote-resource.c index d094a80..d2999cb 100644 --- a/src/ic-remote-resource.c +++ b/src/ic-remote-resource.c @@ -141,7 +141,7 @@ static void _icl_remote_resource_destroy(iotcon_remote_resource_h resource) if (resource->monitoring.presence) iotcon_remote_resource_stop_monitoring(resource); - if (resource->caching.observe) + if (resource->caching.obs_handle) iotcon_remote_resource_stop_caching(resource); free(resource); @@ -169,7 +169,7 @@ API int iotcon_remote_resource_destroy(iotcon_remote_resource_h resource) RETV_IF(false == ic_utils_check_ocf_feature(), IOTCON_ERROR_NOT_SUPPORTED); RETV_IF(NULL == resource, IOTCON_ERROR_INVALID_PARAMETER); - if (resource->observe_handle) + if (resource->obs_handle) iotcon_remote_resource_observe_deregister(resource); icl_remote_resource_unref(resource); @@ -428,7 +428,7 @@ API int iotcon_remote_resource_set_checking_interval(iotcon_remote_resource_h re RETV_IF(ICL_REMOTE_RESOURCE_MAX_CHECKING_INTERVAL < interval || interval <= 0, IOTCON_ERROR_INVALID_PARAMETER); - if (resource->monitoring.presence || resource->caching.observe) { + if (resource->monitoring.presence || resource->caching.obs_handle) { ret = icl_ioty_remote_resource_set_checking_interval(resource, interval); if (IOTCON_ERROR_NONE != ret) { ERR("icl_ioty_remote_resource_set_checking_interval() Fail(%d)", ret); diff --git a/src/ic-remote-resource.h b/src/ic-remote-resource.h index 6e2cc04..fb4221a 100644 --- a/src/ic-remote-resource.h +++ b/src/ic-remote-resource.h @@ -22,12 +22,13 @@ #include "iotcon-types.h" #include "iotcon-remote-resource.h" #include "ic-options.h" +#include <octypes.h> typedef struct icl_remote_resource_caching { iotcon_representation_h repr; iotcon_remote_resource_cached_representation_changed_cb cb; void *user_data; - int64_t observe; + OCDoHandle obs_handle; } icl_remote_resource_caching_s; typedef struct icl_remote_resource_monitoring { @@ -50,7 +51,7 @@ struct icl_remote_resource { iotcon_resource_interfaces_h ifaces; iotcon_connectivity_type_e connectivity_type; int connectivity_options; - int64_t observe_handle; + OCDoHandle obs_handle; int checking_interval; unsigned int timer_id; icl_remote_resource_caching_s caching; diff --git a/src/ic-request.h b/src/ic-request.h index 8b77a66..4b7fb79 100644 --- a/src/ic-request.h +++ b/src/ic-request.h @@ -32,8 +32,8 @@ struct icl_resource_request { iotcon_query_h query; struct icl_observe_info observation_info; iotcon_representation_h repr; - int64_t oic_request_h; - int64_t oic_resource_h; + OCRequestHandle oic_request_h; + OCResourceHandle oic_resource_h; }; #endif /* __IOTCON_INTERNAL_REQUEST_H__ */ diff --git a/src/ic-resource.h b/src/ic-resource.h index b6fda39..56ea383 100644 --- a/src/ic-resource.h +++ b/src/ic-resource.h @@ -40,7 +40,7 @@ struct icl_resource { iotcon_resource_interfaces_h ifaces; iotcon_request_handler_cb cb; void *user_data; - int64_t handle; + OCResourceHandle res_handle; iotcon_observers_h observers; GList *children; }; diff --git a/src/ic-response.h b/src/ic-response.h index aae9395..29143fb 100644 --- a/src/ic-response.h +++ b/src/ic-response.h @@ -31,8 +31,8 @@ struct icl_resource_response { char *iface; int result; iotcon_representation_h repr; - int64_t oic_request_h; - int64_t oic_resource_h; + OCRequestHandle oic_request_h; + OCResourceHandle oic_resource_h; }; #endif /* __IOTCON_INTERNAL_RESPONSE_H__ */ diff --git a/src/ic-types.c b/src/ic-types.c index a823997..e44069b 100644 --- a/src/ic-types.c +++ b/src/ic-types.c @@ -296,10 +296,10 @@ void icl_destroy_caching_container(void *data) return; } - if (cb_container->observe_handle) { + if (cb_container->obs_handle) { icl_ioty_remote_resource_observe_cancel(cb_container->resource, - cb_container->observe_handle); - cb_container->observe_handle = 0; + cb_container->obs_handle); + cb_container->obs_handle = NULL; } if (cb_container->timeout) { diff --git a/src/ic-types.h b/src/ic-types.h index 45d5b2b..e0b4c12 100644 --- a/src/ic-types.h +++ b/src/ic-types.h @@ -88,7 +88,7 @@ typedef struct { iotcon_remote_resource_cached_representation_changed_cb cb; void *user_data; iotcon_remote_resource_h resource; - int64_t observe_handle; + OCDoHandle obs_handle; int timeout; } icl_caching_container_s; @@ -86,6 +86,7 @@ API int iotcon_initialize(const char *file_path) API int iotcon_deinitialize(void) { + FN_CALL; RETV_IF(false == ic_utils_check_ocf_feature(), IOTCON_ERROR_NOT_SUPPORTED); ic_utils_mutex_lock(IC_UTILS_MUTEX_INIT); |