From d698f81a3ff115d6f31021bbe5fc2c9a325373e8 Mon Sep 17 00:00:00 2001 From: Senthil Kumar G S Date: Wed, 22 Nov 2017 22:55:16 +0530 Subject: [PATCH] [IOT-2906][ES] Remove "href" from child response. For requests which come directly to child resources (/WiFiConfResURI, /CoapCloudConfResURI and /DevConfResURI), this patch will remove the "href" property from the response as spec doesn't mandate the addition of "href" in the response. And also, CTT expects the response from direct request to any child to be same as the response which comes for the same child through collection. For example: Properties in "rep" for '/WiFiConfResURI' should be same as the properties in the direct response for GET from '/WiFiConfResURI' resource. Currently "href" is not included in "rep" for child resources. But it is included in the direct response for GET/POST. When CTT compares both responses, it finds them different due of "href". This patch resolves the issue and still conforms to spec. Change-Id: I017bed18d3e0ad568b662a03d9bd80134538a8c0 Signed-off-by: Senthil Kumar G S --- service/easy-setup/enrollee/src/easysetup.c | 2 +- service/easy-setup/enrollee/src/resourcehandler.c | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/service/easy-setup/enrollee/src/easysetup.c b/service/easy-setup/enrollee/src/easysetup.c index 0bf3d739f2..5d88a13d18 100644 --- a/service/easy-setup/enrollee/src/easysetup.c +++ b/service/easy-setup/enrollee/src/easysetup.c @@ -281,7 +281,7 @@ ESResult ESTerminateEnrollee() return ES_ERROR; } - OIC_LOG(ERROR, ES_ENROLLEE_TAG, "ESTerminateEnrollee success"); + OIC_LOG(INFO, ES_ENROLLEE_TAG, "ESTerminateEnrollee success"); return ES_OK; } diff --git a/service/easy-setup/enrollee/src/resourcehandler.c b/service/easy-setup/enrollee/src/resourcehandler.c index cab9ac4c33..cad86ce59d 100644 --- a/service/easy-setup/enrollee/src/resourcehandler.c +++ b/service/easy-setup/enrollee/src/resourcehandler.c @@ -854,12 +854,13 @@ OCRepPayload* constructResponseOfWiFiConf(char *interface, ES_BATCH_UPDATE_RESPO } OIC_LOG(DEBUG, ES_RH_TAG, "constructResponse WiFiConf res"); - OCRepPayloadSetUri(payload, OC_RSRVD_ES_URI_WIFICONF); OCRepPayload* repPayload = NULL; OCRepPayload* tempPayload = NULL; if (!strcmp(interface, OC_RSRVD_INTERFACE_BATCH)) { + OCRepPayloadSetUri(payload, OC_RSRVD_ES_URI_WIFICONF); + repPayload = OCRepPayloadCreate(); if (!repPayload) { @@ -991,12 +992,13 @@ OCRepPayload* constructResponseOfCoapCloudConf(char *interface, ES_BATCH_UPDATE_ } OIC_LOG(DEBUG, ES_RH_TAG, "constructResponse CoapCloudConf res"); - OCRepPayloadSetUri(payload, OC_RSRVD_ES_URI_COAPCLOUDCONF); OCRepPayload* repPayload = NULL; OCRepPayload* tempPayload = NULL; if (!strcmp(interface, OC_RSRVD_INTERFACE_BATCH)) { + OCRepPayloadSetUri(payload, OC_RSRVD_ES_URI_COAPCLOUDCONF); + repPayload = OCRepPayloadCreate(); if (!repPayload) { @@ -1087,12 +1089,13 @@ OCRepPayload* constructResponseOfDevConf(char *interface, ES_BATCH_UPDATE_RESPON } OIC_LOG(DEBUG, ES_RH_TAG, "constructResponse DevConf res"); - OCRepPayloadSetUri(payload, OC_RSRVD_ES_URI_DEVCONF); OCRepPayload* repPayload = NULL; OCRepPayload* tempPayload = NULL; if (!strcmp(interface, OC_RSRVD_INTERFACE_BATCH)) { + OCRepPayloadSetUri(payload, OC_RSRVD_ES_URI_DEVCONF); + repPayload = OCRepPayloadCreate(); if (!repPayload) { -- GitLab