Commit 43551e03 authored by Omkar Hegde's avatar Omkar Hegde Committed by Erich Keane

Fixing collection samples

Wrong property name was being used for resource and
values being added incorrectly to the payload after
CBOR changes.


Change-Id: Id3e4c8c20bae0feee33efb1f5c1479da76f680c9
Signed-off-by: default avatarOmkar Hegde <omkar.m.hegde@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/1673Reviewed-by: default avatarErich Keane <erich.keane@intel.com>
Tested-by: default avatarjenkins-iotivity <jenkins-iotivity@opendaylight.org>
parent 550efad2
......@@ -153,13 +153,13 @@ OCEntityHandlerResult OCEntityHandlerRoomCb(OCEntityHandlerFlag flag,
OCRepPayload *tempPayload = OCRepPayloadCreate();
OCRepPayloadSetUri(tempPayload, gLightResourceUri);
OCRepPayloadSetPropBool(tempPayload, "state", false);
OCRepPayloadSetPropInt(tempPayload, "color", 0);
OCRepPayloadSetPropInt(tempPayload, "power", 0);
OCRepPayloadAppend(payload, tempPayload);
OCRepPayload *tempPayload2 = OCRepPayloadCreate();
OCRepPayloadSetUri(tempPayload2, gFanResourceUri);
OCRepPayloadSetPropBool(tempPayload, "state", true);
OCRepPayloadSetPropInt(tempPayload, "speed", 10);
OCRepPayloadSetPropBool(tempPayload2, "state", true);
OCRepPayloadSetPropInt(tempPayload2, "speed", 10);
OCRepPayloadAppend(payload, tempPayload2);
}
if (ret == OC_EH_OK)
......@@ -223,7 +223,7 @@ OCEntityHandlerResult OCEntityHandlerRoomCb(OCEntityHandlerFlag flag,
OCRepPayload *tempPayload = OCRepPayloadCreate();
OCRepPayloadSetUri(tempPayload, gLightResourceUri);
OCRepPayloadSetPropBool(tempPayload, "state", true);
OCRepPayloadSetPropInt(tempPayload, "color", 0);
OCRepPayloadSetPropInt(tempPayload, "power", 0);
OCRepPayloadAppend(payload, tempPayload);
}
if(ret != OC_EH_ERROR)
......@@ -286,13 +286,13 @@ OCEntityHandlerResult OCEntityHandlerLightCb(OCEntityHandlerFlag flag,
{
OCRepPayloadSetUri(payload, gLightResourceUri);
OCRepPayloadSetPropBool(payload, "state", false);
OCRepPayloadSetPropInt(payload, "color", 0);
OCRepPayloadSetPropInt(payload, "power", 0);
}
else if(OC_REST_PUT == ehRequest->method)
{
OCRepPayloadSetUri(payload, gLightResourceUri);
OCRepPayloadSetPropBool(payload, "state", true);
OCRepPayloadSetPropInt(payload, "color", 0);
OCRepPayloadSetPropInt(payload, "power", 0);
}
else
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment