add address encoding for provisiong 69/103569/2 accepted/tizen/3.0/common/20161209.160919 accepted/tizen/3.0/ivi/20161209.103515 accepted/tizen/3.0/mobile/20161209.103417 accepted/tizen/3.0/tv/20161209.103435 accepted/tizen/3.0/wearable/20161209.103453 submit/tizen_3.0/20161209.001010
authorJooseok Park <jooseok.park@samsung.com>
Thu, 8 Dec 2016 23:54:17 +0000 (08:54 +0900)
committerJooseok Park <jooseok.park@samsung.com>
Fri, 9 Dec 2016 00:04:35 +0000 (09:04 +0900)
 - to support iotivity 1.2.1, add address encoding for ipv6 (RFC6874)

Change-Id: I066e62d0bfaa1f29ea982c2894b9d3aeb15d557b

packaging/iotcon.spec
src/ic-ioty.c
src/ic-provisioning-find.c
src/ic-provisioning-struct.c

index 7225060..adf7d86 100644 (file)
@@ -1,6 +1,6 @@
 Name:       iotcon
 Summary:    Tizen IoT Connectivity
-Version:    0.3.4
+Version:    0.3.5
 Release:    0
 Group:      Network & Connectivity/Service
 License:    Apache-2.0
index f5b74c7..e6cff72 100644 (file)
@@ -2030,7 +2030,7 @@ int icl_ioty_response_send(iotcon_response_h response_handle)
 
        RETV_IF(NULL == response_handle, IOTCON_ERROR_INVALID_PARAMETER);
 
-       response.requestHandle = IC_INT64_TO_POINTER(response_handle->oic_request_h);
+       response.requestHandle = (unsigned int)(response_handle->oic_request_h);
        response.resourceHandle = IC_INT64_TO_POINTER(response_handle->oic_resource_h);
        response.ehResult = ic_ioty_convert_response_result(response_handle->result);
 
index 9e599f4..e5dfc3d 100644 (file)
@@ -544,8 +544,9 @@ static int _provisioning_find_secure_port(icl_provisioning_find_cb_container_s *
        }
        ICL_PROVISIONING_MUTEX_FIND_UNLOCK(container->cb_data);
 
+       DBG("uri:[%s]", uri);
        ret = OCDoResource(&container->handle, OC_REST_DISCOVER, uri, 0, 0,
-                       container->oic_device->connType, OC_LOW_QOS, &cbdata, NULL, 0);
+                       container->oic_device->connType, OC_HIGH_QOS, &cbdata, NULL, 0);
        icl_ioty_mutex_unlock();
        if (OC_STACK_OK != ret) {
                ERR("OCDoResource() Fail(%d)", ret);
index 0bfd799..fef6060 100644 (file)
@@ -153,7 +153,14 @@ int icl_provisioning_parse_oic_dev_address(OCDevAddr *dev_addr, int secure_port,
                if (CT_IP_USE_V4 & conn_type) {
                        snprintf(temp, sizeof(temp), "%s:%d", dev_addr->addr, port);
                } else if (CT_IP_USE_V6 & conn_type) {
-                       snprintf(temp, sizeof(temp), "[%s]:%d", dev_addr->addr, port);
+                       char addressEncoded[128] = {0};
+                       OCStackResult ret = OCEncodeAddressForRFC6874(addressEncoded,
+                               sizeof(addressEncoded), dev_addr->addr);
+                       if (OC_STACK_OK != ret) {
+                               ERR("OCEncodeAddressForRFC6874 : encoding error (%d)", ret);
+                               return IOTCON_ERROR_INVALID_PARAMETER;
+                       }
+                       snprintf(temp, sizeof(temp), "[%s]:%d", addressEncoded, port);
                } else {
                        ERR("Invalid Connectivity Type(%d)", conn_type);
                        return IOTCON_ERROR_INVALID_PARAMETER;
@@ -162,6 +169,7 @@ int icl_provisioning_parse_oic_dev_address(OCDevAddr *dev_addr, int secure_port,
                ERR("Invalid Connectivity Type(%d)", conn_type);
                return IOTCON_ERROR_INVALID_PARAMETER;
        }
+       DBG("temp:[%s]", temp);
 
        *host_address = strdup(temp);