Remove connectivity_type on resource handle 01/69901/5
authorsung.goo.kim <sung.goo.kim@samsung.com>
Tue, 17 May 2016 08:39:06 +0000 (17:39 +0900)
committerSunggoo Kim <sung.goo.kim@samsung.com>
Mon, 23 May 2016 06:59:31 +0000 (23:59 -0700)
Change-Id: Ib07b4a7f860bc05d57b4a0a650fc60f93afddfb1

lib/icl-lite-resource.c
lib/icl-lite-resource.h
lib/icl-resource.c
lib/icl-resource.h
lib/icl-response.c
lib/icl-response.h

index 568743eb868434d7d8a84ab7c784e75319256f20..211d5f03336749e279c0e28051a91365344197c9 100644 (file)
@@ -56,7 +56,6 @@ API int iotcon_lite_resource_create(const char *uri_path,
                ERR("icl_ioty_lite_resource_create() Fail(%d)", ret);
                return ret;
        }
-       (*resource_handle)->connectivity_type = IOTCON_CONNECTIVITY_ALL;
 
        return IOTCON_ERROR_NONE;
 }
@@ -64,27 +63,19 @@ API int iotcon_lite_resource_create(const char *uri_path,
 
 API int iotcon_lite_resource_destroy(iotcon_lite_resource_h resource)
 {
-       int ret, connectivity_type;
+       int ret;
 
        RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(false == ic_utils_check_permission(IC_PERMISSION_INTERNET),
                        IOTCON_ERROR_PERMISSION_DENIED);
        RETV_IF(NULL == resource, IOTCON_ERROR_INVALID_PARAMETER);
 
-       connectivity_type = resource->connectivity_type;
-
-       switch (connectivity_type) {
-       case IOTCON_CONNECTIVITY_ALL:
-               ret = icl_ioty_lite_resource_destroy(resource);
-               if (IOTCON_ERROR_NONE != ret) {
-                       ERR("icl_ioty_lite_resource_destroy() Fail(%d)", ret);
-                       return ret;
-               }
-               break;
-       default:
-               ERR("Invalid Connectivity Type(%d)", connectivity_type);
-               return IOTCON_ERROR_INVALID_PARAMETER;
+       ret = icl_ioty_lite_resource_destroy(resource);
+       if (IOTCON_ERROR_NONE != ret) {
+               ERR("icl_ioty_lite_resource_destroy() Fail(%d)", ret);
+               return ret;
        }
+
        return IOTCON_ERROR_NONE;
 }
 
@@ -92,26 +83,17 @@ API int iotcon_lite_resource_destroy(iotcon_lite_resource_h resource)
 API int iotcon_lite_resource_update_state(iotcon_lite_resource_h resource,
                iotcon_state_h state)
 {
-       int ret, connectivity_type;
+       int ret;
 
        RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(false == ic_utils_check_permission(IC_PERMISSION_INTERNET),
                        IOTCON_ERROR_PERMISSION_DENIED);
        RETV_IF(NULL == resource, IOTCON_ERROR_INVALID_PARAMETER);
 
-       connectivity_type = resource->connectivity_type;
-
-       switch (connectivity_type) {
-       case IOTCON_CONNECTIVITY_ALL:
-               ret = icl_ioty_lite_resource_update_state(resource, state);
-               if (IOTCON_ERROR_NONE != ret) {
-                       ERR("icl_ioty_lite_resource_update_state() Fail(%d)", ret);
-                       return ret;
-               }
-               break;
-       default:
-               ERR("Invalid Connectivity Type(%d)", connectivity_type);
-               return IOTCON_ERROR_INVALID_PARAMETER;
+       ret = icl_ioty_lite_resource_update_state(resource, state);
+       if (IOTCON_ERROR_NONE != ret) {
+               ERR("icl_ioty_lite_resource_update_state() Fail(%d)", ret);
+               return ret;
        }
 
        return IOTCON_ERROR_NONE;
index ebc02c46077aa0e1cc556149eb1689ffbed19bd9..6b194ae1b0e6ce9bde83075d906c66c94688ea05 100644 (file)
@@ -27,7 +27,6 @@ struct icl_lite_resource {
        int properties;
        iotcon_lite_resource_post_request_cb cb;
        void *cb_data;
-       iotcon_connectivity_type_e connectivity_type;
 };
 
 #endif /* __IOT_CONNECTIVITY_LIBRARY_LITE_RESOURCE_H__ */
index c67a61aa5564c5fee574b2bd5d432aab15d8bdb9..0641507e9c270cdc27b2ab90a1d4e5ea4988102c 100644 (file)
@@ -130,7 +130,6 @@ API int iotcon_resource_create(const char *uri_path,
                ERR("icl_ioty_resource_create() Fail(%d)", ret);
                return ret;
        }
-       (*resource_handle)->connectivity_type = IOTCON_CONNECTIVITY_ALL;
 
        return IOTCON_ERROR_NONE;
 }
@@ -139,26 +138,17 @@ API int iotcon_resource_create(const char *uri_path,
 API int iotcon_resource_destroy(iotcon_resource_h resource)
 {
        FN_CALL;
-       int ret, connectivity_type;
+       int ret;
 
        RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(false == ic_utils_check_permission(IC_PERMISSION_INTERNET),
                        IOTCON_ERROR_PERMISSION_DENIED);
        RETV_IF(NULL == resource, IOTCON_ERROR_INVALID_PARAMETER);
 
-       connectivity_type = resource->connectivity_type;
-
-       switch (connectivity_type) {
-       case IOTCON_CONNECTIVITY_ALL:
-               ret = icl_ioty_resource_destroy(resource);
-               if (IOTCON_ERROR_NONE != ret) {
-                       ERR("icl_ioty_resource_destroy() Fail(%d)", ret);
-                       return ret;
-               }
-               break;
-       default:
-               ERR("Invalid Connectivity Type(%d)", connectivity_type);
-               return IOTCON_ERROR_INVALID_PARAMETER;
+       ret = icl_ioty_resource_destroy(resource);
+       if (IOTCON_ERROR_NONE != ret) {
+               ERR("icl_ioty_resource_destroy() Fail(%d)", ret);
+               return ret;
        }
 
        return IOTCON_ERROR_NONE;
@@ -169,7 +159,7 @@ API int iotcon_resource_bind_interface(iotcon_resource_h resource,
                const char *iface)
 {
        FN_CALL;
-       int ret, connectivity_type;
+       int ret;
 
        RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(false == ic_utils_check_permission(IC_PERMISSION_INTERNET),
@@ -177,19 +167,10 @@ API int iotcon_resource_bind_interface(iotcon_resource_h resource,
        RETV_IF(NULL == resource, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == iface, IOTCON_ERROR_INVALID_PARAMETER);
 
-       connectivity_type = resource->connectivity_type;
-
-       switch (connectivity_type) {
-       case IOTCON_CONNECTIVITY_ALL:
-               ret = icl_ioty_resource_bind_interface(resource, iface);
-               if (IOTCON_ERROR_NONE != ret) {
-                       ERR("icl_ioty_resource_bind_interface() Fail(%d)", ret);
-                       return ret;
-               }
-               break;
-       default:
-               ERR("Invalid Connectivity Type(%d)", connectivity_type);
-               return IOTCON_ERROR_INVALID_PARAMETER;
+       ret = icl_ioty_resource_bind_interface(resource, iface);
+       if (IOTCON_ERROR_NONE != ret) {
+               ERR("icl_ioty_resource_bind_interface() Fail(%d)", ret);
+               return ret;
        }
 
        return IOTCON_ERROR_NONE;
@@ -200,7 +181,7 @@ API int iotcon_resource_bind_type(iotcon_resource_h resource,
                const char *resource_type)
 {
        FN_CALL;
-       int ret, connectivity_type;
+       int ret;
 
        RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(false == ic_utils_check_permission(IC_PERMISSION_INTERNET),
@@ -208,19 +189,10 @@ API int iotcon_resource_bind_type(iotcon_resource_h resource,
        RETV_IF(NULL == resource, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == resource_type, IOTCON_ERROR_INVALID_PARAMETER);
 
-       connectivity_type = resource->connectivity_type;
-
-       switch (connectivity_type) {
-       case IOTCON_CONNECTIVITY_ALL:
-               ret = icl_ioty_resource_bind_type(resource, resource_type);
-               if (IOTCON_ERROR_NONE != ret) {
-                       ERR("icl_ioty_resource_bind_type() Fail(%d)", ret);
-                       return ret;
-               }
-               break;
-       default:
-               ERR("Invalid Connectivity Type(%d)", connectivity_type);
-               return IOTCON_ERROR_INVALID_PARAMETER;
+       ret = icl_ioty_resource_bind_type(resource, resource_type);
+       if (IOTCON_ERROR_NONE != ret) {
+               ERR("icl_ioty_resource_bind_type() Fail(%d)", ret);
+               return ret;
        }
 
        return IOTCON_ERROR_NONE;
@@ -392,26 +364,17 @@ API int iotcon_resource_get_properties(iotcon_resource_h resource, int *properti
 API int iotcon_resource_notify(iotcon_resource_h resource,
                iotcon_representation_h repr, iotcon_observers_h observers, iotcon_qos_e qos)
 {
-       int ret, connectivity_type;
+       int ret;
 
        RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(false == ic_utils_check_permission(IC_PERMISSION_INTERNET),
                        IOTCON_ERROR_PERMISSION_DENIED);
        RETV_IF(NULL == resource, IOTCON_ERROR_INVALID_PARAMETER);
 
-       connectivity_type = resource->connectivity_type;
-
-       switch (connectivity_type) {
-       case IOTCON_CONNECTIVITY_ALL:
-               ret = icl_ioty_resource_notify(resource, repr, observers, qos);
-               if (IOTCON_ERROR_NONE != ret) {
-                       ERR("icl_ioty_resource_notify() Fail(%d)", ret);
-                       return ret;
-               }
-               break;
-       default:
-               ERR("Invalid Connectivity Type(%d)", connectivity_type);
-               return IOTCON_ERROR_INVALID_PARAMETER;
+       ret = icl_ioty_resource_notify(resource, repr, observers, qos);
+       if (IOTCON_ERROR_NONE != ret) {
+               ERR("icl_ioty_resource_notify() Fail(%d)", ret);
+               return ret;
        }
 
        return IOTCON_ERROR_NONE;
index 464f02061a2b20caa4100e54f6d97c534d330806..10181bb8c7d1e7da8a5b4003f50f0c20b7c7603c 100644 (file)
@@ -42,7 +42,6 @@ struct icl_resource {
        void *user_data;
        int64_t handle;
        iotcon_observers_h observers;
-       iotcon_connectivity_type_e connectivity_type;
        GList *children;
 };
 
index 98b0852f2d1b4a0ac888a7a3f98589687b104ebc..43efe96807cc2c1e4575d9c503454fe24befa519 100644 (file)
@@ -48,7 +48,6 @@ API int iotcon_response_create(iotcon_request_h request,
 
        resp->oic_request_h = request->oic_request_h;
        resp->oic_resource_h = request->oic_resource_h;
-       resp->connectivity_type = request->connectivity_type;
 
        *response = resp;
 
@@ -166,28 +165,17 @@ API int iotcon_response_set_options(iotcon_response_h resp,
 API int iotcon_response_send(iotcon_response_h resp)
 {
        FN_CALL;
-       int ret, connectivity_type;
+       int ret;
 
        RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(false == ic_utils_check_permission(IC_PERMISSION_INTERNET),
                        IOTCON_ERROR_PERMISSION_DENIED);
        RETV_IF(NULL == resp, IOTCON_ERROR_INVALID_PARAMETER);
 
-       connectivity_type = resp->connectivity_type;
-
-       switch (connectivity_type) {
-       case IOTCON_CONNECTIVITY_IPV4:
-       case IOTCON_CONNECTIVITY_IPV6:
-       case IOTCON_CONNECTIVITY_ALL:
-               ret = icl_ioty_response_send(resp);
-               if (IOTCON_ERROR_NONE != ret) {
-                       ERR("icl_ioty_response_send() Fail(%d)", ret);
-                       return ret;
-               }
-               break;
-       default:
-               ERR("Invalid Connectivity Type(%d)", connectivity_type);
-               return IOTCON_ERROR_INVALID_PARAMETER;
+       ret = icl_ioty_response_send(resp);
+       if (IOTCON_ERROR_NONE != ret) {
+               ERR("icl_ioty_response_send() Fail(%d)", ret);
+               return ret;
        }
 
        return IOTCON_ERROR_NONE;
index eeb5df13174dcfe84d260e90c67298cc726352b2..ca629ec5e048575b2a045a9d5caf8558210b6b40 100644 (file)
@@ -33,7 +33,6 @@ struct icl_resource_response {
        iotcon_representation_h repr;
        int64_t oic_request_h;
        int64_t oic_resource_h;
-       iotcon_connectivity_type_e connectivity_type;
 };
 
 #endif /* __IOT_CONNECTIVITY_LIBRARY_RESPONSE_H__ */