- Created a separate function to handle Device and Platform payload.
- rt, if and attribute information are the only included in the payload.
- BuildResponseRepresentation updated to avoid information about device and platform payload.
- Updated dmv value from res.1.1.0,sh.1.2.0 to res.1.1.0,sh.1.1.0.
Change-Id: I59059997f170d177663e87eddea9df32275ca882
Signed-off-by: Habib Virji <habib.virji@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/14979
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
Tested-by: Uze Choi <uzchoi@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/15265
Reviewed-by: Ziran Sun <ziran.sun@samsung.com>
const char *version = "myVersion";
const char *systemTime = "2015-05-15T11.04";
const char *specVersion = "core.1.1.0";
-const char *dataModelVersions = "res.1.1.0";
+const char *dataModelVersions = "res.1.1.0,sh.1.1.0";
// Entity handler should check for resourceTypeName and ResourceInterface in order to GET
// the existence of a known resource
const char *version = "myVersion";
const char *systemTime = "2015-05-15T11.04";
const char *specVersion = "core.1.1.0";
-const char *dataModelVersions = "res.1.1.0";
+const char *dataModelVersions = "res.1.1.0,sh.1.1.0";
// Entity handler should check for resourceTypeName and ResourceInterface in order to GET
// the existence of a known resource
static OCStackResult BuildDevicePlatformPayload(const OCResource *resourcePtr, OCRepPayload** payload, bool addDeviceId)
{
+ OCRepPayload *tempPayload = OCRepPayloadCreate();
+
if (!resourcePtr)
{
+ OCRepPayloadDestroy(tempPayload);
return OC_STACK_INVALID_PARAM;
}
- OCRepPayload *tempPayload = OCRepPayloadCreate();
if (!tempPayload)
{
return OC_STACK_NO_MEMORY;
{
OCResource *resourcePtr = FindResourceByUri(OC_RSRVD_DEVICE_URI);
VERIFY_PARAM_NON_NULL(TAG, resourcePtr, "Device URI not found.");
- discoveryResult = BuildResponseRepresentation(resourcePtr, (OCRepPayload **)&payload, &request->devAddr);
+ discoveryResult = BuildDevicePlatformPayload(resourcePtr, (OCRepPayload **)&payload, true);
}
else if (virtualUriInRequest == OC_PLATFORM_URI)
{
OCResource *resourcePtr = FindResourceByUri(OC_RSRVD_PLATFORM_URI);
VERIFY_PARAM_NON_NULL(TAG, resourcePtr, "Platform URI not found.");
- discoveryResult = BuildResponseRepresentation(resourcePtr, (OCRepPayload **)&payload, &request->devAddr);
+ discoveryResult = BuildDevicePlatformPayload(resourcePtr, (OCRepPayload **)&payload, false);
}
#ifdef ROUTING_GATEWAY
else if (OC_GATEWAY_URI == virtualUriInRequest)
// Set of strings for each of device info fields
std::string deviceName = "Bill's Battlestar";
std::string specVersion = "core.1.1.0";
-std::string dataModelVersions = "res.1.1.0";
+std::string dataModelVersions = "res.1.1.0,sh.1.1.0";
// OCPlatformInfo Contains all the platform info to be stored
OCPlatformInfo platformInfo;
// Set of strings for each of device info fields
std::string deviceName = "IoTivity Simple Server";
std::string specVersion = "core.1.1.0";
-std::string dataModelVersions = "res.1.1.0";
+std::string dataModelVersions = "res.1.1.0,sh.1.1.0";
// OCPlatformInfo Contains all the platform info to be stored
OCPlatformInfo platformInfo;