Cloud resource fix 85/25385/1
authorkoushik.girijala <g.koushik@samsung.com>
Fri, 18 May 2018 05:16:34 +0000 (10:46 +0530)
committerkoushik girijala <g.koushik@samsung.com>
Wed, 23 May 2018 04:51:35 +0000 (04:51 +0000)
fixed resource uri for issue [IOT- 3069]
removed unsecure enpoints from cloud payload [IOT-3071]
adding oic.if.rw interface to cloud resource [IOT-3070]

Change-Id: I719d54bd846f77a5cf2905ccc130ab0434005491
Signed-off-by: koushik.girijala <g.koushik@samsung.com>
resource/csdk/include/octypes.h
resource/csdk/security/provisioning/include/cloud/cloudresource.h
resource/csdk/security/provisioning/src/cloud/cloudresource.c

index adc8862..9547fe9 100644 (file)
@@ -78,7 +78,7 @@ extern "C" {
 #define OC_RSRVD_KEEPALIVE_URI                "/oic/ping"
 
 /** Cloudconf URI.*/
-#define OC_RSRVD_CLOUDCONF_URI                "/oic/cloudconf"
+#define OC_RSRVD_CLOUDCONF_URI                "/CoapCloudConfResURI"
 
 /** Presence */
 
index fbb2c05..ede0455 100644 (file)
@@ -26,8 +26,8 @@ extern "C" {
 #endif
 
 #define OIC_RSRC_TYPE_SEC_CLOUDCONF             "oic.r.coapcloudconf"
-#define OIC_RSRC_CLOUDCONF_URI                  "/oic/cloudconf"
-#define OIC_JSON_CLOUDCONF_NAME                 "cloudconf"
+#define OIC_RSRC_CLOUDCONF_URI                  "/CoapCloudConfResURI"
+#define OIC_JSON_CLOUDCONF_NAME                 "CoAPCloudConf"
 #define OIC_RSRC_CLOUDCONF_TOKEN_REFRESH        "/oic/sec/tokenrefresh"
 #define OC_RSRVD_ACCESS_TOKENTYPE               "tokentype"
 
index 9624dd4..91b9125 100644 (file)
@@ -300,6 +300,7 @@ OCRepPayload *CreateCloudGetPayload(const OicCloud_t *cloud)
     VERIFY_NOT_NULL(TAG, payload, ERROR);
 
     OCRepPayloadAddInterface(payload, OC_RSRVD_INTERFACE_DEFAULT);
+    OCRepPayloadAddInterface(payload, OC_RSRVD_INTERFACE_READ_WRITE);
     OCRepPayloadAddResourceType(payload, OIC_RSRC_TYPE_SEC_CLOUDCONF);
 
     if (NULL == cloud)
@@ -551,14 +552,21 @@ OCStackResult CreateCloudResource()
                                          OIC_RSRC_CLOUDCONF_URI,
                                          CloudEntityHandler,
                                          NULL,
-                                         OC_SECURE | OC_NONSECURE |
-                                         OC_DISCOVERABLE);
+                                         OC_SECURE | OC_DISCOVERABLE);
 
     if (OC_STACK_OK != ret)
     {
         OIC_LOG (FATAL, TAG, "Unable to create cloud config resource");
         DeInitCloudResource();
     }
+
+    ret = OCBindResourceInterfaceToResource(gCloudHandle, OC_RSRVD_INTERFACE_READ_WRITE);
+    if (ret != OC_STACK_OK)
+    {
+        OIC_LOG_V(ERROR, TAG, "Binding Resource interface with result: %d", ret);
+        return ret;
+    }
+
     return ret;
 }