//The only case when this entity handler is for a non-existing resource.
OCEntityHandlerResult
OCDeviceEntityHandlerCb (OCEntityHandlerFlag flag,
- OCEntityHandlerRequest *entityHandlerRequest, char* uri, void* callbackParam)
+ OCEntityHandlerRequest *entityHandlerRequest, char* uri, void* /*callbackParam*/)
{
OC_LOG_V(INFO, TAG, "Inside device default entity handler - flags: 0x%x, uri: %s", flag, uri);
OCEntityHandlerResult OCEntityHandlerRoomCb(OCEntityHandlerFlag flag,
OCEntityHandlerRequest * ehRequest,
- void* callback)
+ void* /*callback*/)
{
OCEntityHandlerResult ret = OC_EH_OK;
OCEntityHandlerResponse response;
- OCRepPayload* payload = OCRepPayloadCreate();
OC_LOG_V(INFO, TAG, "Callback for Room");
PrintReceivedMsgInfo(flag, ehRequest );
if(ehRequest && flag == OC_REQUEST_FLAG )
{
std::string query = (const char*)ehRequest->query;
+ OCRepPayload* payload = OCRepPayloadCreate();
if(OC_REST_GET == ehRequest->method)
{
{
OC_LOG_V (INFO, TAG, "Received unsupported method %d from client",
ehRequest->method);
+ OCRepPayloadDestroy(payload);
ret = OC_EH_ERROR;
}
}
}
OCEntityHandlerResult OCEntityHandlerLightCb(OCEntityHandlerFlag flag,
- OCEntityHandlerRequest * ehRequest,void* callbackParam)
+ OCEntityHandlerRequest * ehRequest,void* /*callbackParam*/)
{
OCEntityHandlerResult ret = OC_EH_OK;
OCEntityHandlerResponse response;
- OCRepPayload* payload = OCRepPayloadCreate();
OC_LOG_V(INFO, TAG, "Callback for Light");
PrintReceivedMsgInfo(flag, ehRequest );
if(ehRequest && flag == OC_REQUEST_FLAG)
{
+ OCRepPayload* payload = OCRepPayloadCreate();
if(OC_REST_GET == ehRequest->method)
{
OCRepPayloadSetUri(payload, gLightResourceUri);
ret = OC_EH_ERROR;
}
}
+ else
+ {
+ OCRepPayloadDestroy(payload);
+ }
}
else if (ehRequest && flag == OC_OBSERVE_FLAG)
{
}
OCEntityHandlerResult OCEntityHandlerFanCb(OCEntityHandlerFlag flag,
- OCEntityHandlerRequest * ehRequest, void* callback)
+ OCEntityHandlerRequest * ehRequest, void* /*callback*/)
{
OCEntityHandlerResult ret = OC_EH_OK;
OCEntityHandlerResponse response;
- OCRepPayload* payload = OCRepPayloadCreate();
OC_LOG_V(INFO, TAG, "Callback for Fan");
PrintReceivedMsgInfo(flag, ehRequest );
if(ehRequest && flag == OC_REQUEST_FLAG)
{
+ OCRepPayload* payload = OCRepPayloadCreate();
+
if(OC_REST_GET == ehRequest->method)
{
OCRepPayloadSetUri(payload, gFanResourceUri);
ret = OC_EH_ERROR;
}
}
+ OCRepPayloadDestroy(payload);
}
else if (ehRequest && flag == OC_OBSERVE_FLAG)