IOT-1079 /oic/d & /oic/p to include oic.if.baseline
[platform/upstream/iotivity.git] / resource / csdk / stack / src / ocpayload.c
index 7955152..5486e9b 100755 (executable)
@@ -1574,6 +1574,9 @@ OCDevicePayload* OCDevicePayloadCreate(const char* sid, const char* dname,
         goto exit;
     }
 
+    OCResourcePayloadAddStringLL(&payload->interfaces, OC_RSRVD_INTERFACE_DEFAULT);
+    OCResourcePayloadAddStringLL(&payload->interfaces, OC_RSRVD_INTERFACE_READ);
+
     payload->types = CloneOCStringLL((OCStringLL *)types);
     if (types && !payload->types)
     {
@@ -1599,6 +1602,7 @@ void OCDevicePayloadDestroy(OCDevicePayload* payload)
     OICFree(payload->specVersion);
     OICFree(payload->dataModelVersion);
     OCFreeOCStringLL(payload->types);
+    OCFreeOCStringLL(payload->interfaces);
     OICFree(payload);
 }
 
@@ -1654,14 +1658,11 @@ OCPlatformPayload* OCPlatformPayloadCreate(const OCPlatformInfo* platformInfo)
     }
 
     payload->base.type = PAYLOAD_TYPE_PLATFORM;
-
-    payload->interfaces = (OCStringLL*)OICCalloc(1, sizeof(OCStringLL));
-    if (!payload->interfaces)
-    {
-        return NULL;
-    }
-    payload->interfaces->value = OICStrdup(OC_RSRVD_INTERFACE_READ);
     payload->rt = OICStrdup(OC_RSRVD_RESOURCE_TYPE_PLATFORM);
+
+    OCResourcePayloadAddStringLL(&payload->interfaces, OC_RSRVD_INTERFACE_DEFAULT);
+    OCResourcePayloadAddStringLL(&payload->interfaces, OC_RSRVD_INTERFACE_READ);
+
     OCCopyPlatformInfo(platformInfo, payload);
 
     return payload;