code cleanup 51/103651/1
authorJooseok Park <jooseok.park@samsung.com>
Fri, 9 Dec 2016 04:59:55 +0000 (13:59 +0900)
committerJooseok Park <jooseok.park@samsung.com>
Fri, 9 Dec 2016 04:59:55 +0000 (13:59 +0900)
Change-Id: I6bd285e0239ef8d405acec06536e0fd7bff5c2da

packaging/iotcon.spec
src/ic-ioty-ocprocess.c
src/ic-ioty-parse.c
src/ic-ioty.c
src/ic-ioty.h
src/ic-presence.c
src/ic-provisioning.c
src/ic-utils.c

index adf7d86..86a8f1e 100644 (file)
@@ -1,6 +1,6 @@
 Name:       iotcon
 Summary:    Tizen IoT Connectivity
-Version:    0.3.5
+Version:    0.3.6
 Release:    0
 Group:      Network & Connectivity/Service
 License:    Apache-2.0
index a35c3dd..6d658b5 100644 (file)
@@ -94,8 +94,6 @@ void* icl_ioty_ocprocess_thread(void *data)
        FN_CALL;
        int ret;
 
-       // TODO: Current '100ms' is not proven sleep time. Revise the time after test.
-       // TODO: Or recommend changes to event driven architecture
        icl_ioty_polling_interval = ICL_IOTY_TIME_INTERVAL_DEFAULT;
 
        /* For setting this thread name */
index a60b58b..188df57 100644 (file)
@@ -905,7 +905,7 @@ int ic_ioty_parse_oic_rep_payload(OCRepPayload *payload, bool is_parent,
                        node = node->next;
                }
        } else {
-               // TODO: verify spec
+               /* TODO: verify spec */
                iotcon_resource_interfaces_add(ifaces, IOTCON_INTERFACE_DEFAULT);
        }
 
index e6cff72..2be4ce6 100644 (file)
@@ -459,7 +459,6 @@ int icl_ioty_find_resource(const char *host_address,
                return ret;
        }
 
-       // TODO: QoS is come from lib.
        ret = OCDoResource(&handle, OC_REST_DISCOVER, full_uri, NULL, NULL, oic_conn_type,
                        OC_LOW_QOS, &cbdata, NULL, 0);
        icl_ioty_mutex_unlock();
@@ -549,7 +548,7 @@ int icl_ioty_find_device_info(const char *host_address,
                free(full_uri);
                return ret;
        }
-       // TODO: QoS is come from lib. And user can set QoS to client structure.
+
        ret = OCDoResource(&handle, OC_REST_DISCOVER, full_uri, NULL, NULL, oic_conn_type,
                        OC_LOW_QOS, &cbdata, NULL, 0);
        icl_ioty_mutex_unlock();
@@ -638,7 +637,7 @@ int icl_ioty_find_platform_info(const char *host_address,
                free(full_uri);
                return ret;
        }
-       // TODO: QoS is come from lib. And user can set QoS to client structure.
+
        ret = OCDoResource(&handle, OC_REST_DISCOVER, full_uri, NULL, NULL, oic_conn_type,
                        OC_LOW_QOS, &cbdata, NULL, 0);
        icl_ioty_mutex_unlock();
@@ -720,7 +719,7 @@ int icl_ioty_set_platform_info()
 }
 
 int icl_ioty_add_presence_cb(const char *host_address,
-               int connectivity_type,
+               iotcon_connectivity_type_e connectivity_type,
                const char *resource_type,
                iotcon_presence_cb cb,
                void *user_data,
@@ -792,9 +791,9 @@ int icl_ioty_add_presence_cb(const char *host_address,
        if (NULL != host_address) {
                DBG("dev_addr.addr:[%s], dev_addr.port:[%d]", dev_addr.addr, dev_addr.port);
                ret = OCDoResource(&handle, OC_REST_PRESENCE, uri, &dev_addr, NULL, oic_conn_type,
-                               OC_LOW_QOS, &cbdata, NULL, 0);
+                       OC_LOW_QOS, &cbdata, NULL, 0);
        } else {
-       ret = OCDoResource(&handle, OC_REST_PRESENCE, uri, NULL, NULL, oic_conn_type,
+               ret = OCDoResource(&handle, OC_REST_PRESENCE, uri, NULL, NULL, oic_conn_type,
                        OC_LOW_QOS, &cbdata, NULL, 0);
        }
        DBG("handle:[%p]", handle);
@@ -939,7 +938,7 @@ static int _icl_ioty_remote_resource_observe(iotcon_remote_resource_h resource,
                free(uri);
                return ret;
        }
-       // TODO: QoS is come from lib. And user can set QoS to client structure.
+
        ret = OCDoResource(&handle, method, uri, &dev_addr, NULL, oic_conn_type,
                        OC_HIGH_QOS, &cbdata, oic_options_ptr, options_size);
        icl_ioty_mutex_unlock();
@@ -1519,13 +1518,13 @@ int icl_ioty_start_presence(unsigned int time_to_live)
 {
        int ret;
 
-       RETV_IF(IC_PRESENCE_TTL_SECONDS_MAX < time_to_live, IOTCON_ERROR_INVALID_PARAMETER);
-
        ret = icl_ioty_mutex_lock();
        if (IOTCON_ERROR_NONE != ret) {
                ERR("icl_ioty_mutex_lock() Fail(%d)", ret);
                return ret;
        }
+
+       DBG("time_to_live:[%d]", time_to_live);
        ret = OCStartPresence(time_to_live);
        icl_ioty_mutex_unlock();
 
index 293b609..249085b 100644 (file)
@@ -72,7 +72,7 @@ int icl_ioty_find_platform_info(const char *host_address,
                void *user_data);
 
 int icl_ioty_add_presence_cb(const char *host_address,
-               int connectivity_type,
+               iotcon_connectivity_type_e connectivity_type,
                const char *resource_type,
                iotcon_presence_cb cb,
                void *user_data,
index 9b2d409..7c59cbc 100644 (file)
@@ -34,11 +34,6 @@ API int iotcon_start_presence(unsigned int time_to_live)
        RETV_IF(false == ic_utils_check_permission(IC_PERMISSION_INTERNET),
                        IOTCON_ERROR_PERMISSION_DENIED);
 
-       if (0 == time_to_live)
-               time_to_live = IC_PRESENCE_TTL_SECONDS_DEFAULT;
-       else if (IC_PRESENCE_TTL_SECONDS_MAX < time_to_live)
-               time_to_live = IC_PRESENCE_TTL_SECONDS_MAX;
-
        ret = icl_ioty_start_presence(time_to_live);
        if (IOTCON_ERROR_NONE != ret) {
                ERR("icl_ioty_start_presence() Fail(%d)", ret);
index ee50147..7f052a2 100644 (file)
@@ -569,8 +569,7 @@ static OicSecAcl_t* _provisioning_convert_acl(iotcon_provisioning_device_h devic
                }
                resource->href = ic_utils_strdup(uri_path);
 
-               // TODO: resource types & resource interfaces
-               // temp code
+               /* TODO: resource types & resource interfaces */
                resource->types = calloc(1, sizeof(char*));
                if (NULL == resource->types) {
                        ERR("calloc() Fail(%d)", errno);
index 6de3247..ba7937f 100644 (file)
@@ -36,7 +36,6 @@ static int _ic_ocf_feature = -1;
 static const char *IC_FEATURE_OCF = "http://tizen.org/feature/iot.ocf";
 #endif
 
-// TODO: Can't access in user side daemon
 #if 0
 #ifdef TZ_VER_3
 static const char *IC_PRIV_FILE_NETWORK_GET = "/usr/share/iotcon/iotcon-network-get";
@@ -44,7 +43,7 @@ static const char *IC_PRIV_FILE_INTERNET = "/usr/share/iotcon/iotcon-internet";
 #endif
 #endif
 
-// TODO: Temporary code (need guide from security team)
+/*  TODO : need guide from security team */
 #define SMACK_LABEL_LEN 255
 static const char *IC_PRIVILEGE_INTERNET = "http://tizen.org/privilege/internet";
 static const char *IC_PRIVILEGE_NETWORK_GET = "http://tizen.org/privilege/network.get";