/** De-register observation, intended for internal use.*/
OC_REST_CANCEL_OBSERVE = (1 << 6),
- #ifdef WITH_PRESENCE
+#ifdef WITH_PRESENCE
/** Subscribe for all presence notifications of a particular resource.*/
OC_REST_PRESENCE = (1 << 7),
- #endif
+#endif
/** Allows OCDoResource caller to do discovery.*/
OC_REST_DISCOVER = (1 << 8)
} OCMethod;
OC_STACK_AUTHENTICATION_FAILURE,
/** Insert all new error codes here!.*/
- #ifdef WITH_PRESENCE
+#ifdef WITH_PRESENCE
OC_STACK_PRESENCE_STOPPED = 128,
OC_STACK_PRESENCE_TIMEOUT,
OC_STACK_PRESENCE_DO_NOT_HANDLE,
- #endif
+#endif
/** ERROR in stack.*/
OC_STACK_ERROR = 255
/** Error status code - END HERE.*/
{
OIC_LOG(INFO, TAG, "Received a message without callbacks. Sending RESET");
SendDirectStackResponse(endPoint, responseInfo->info.messageId, CA_EMPTY,
- CA_MSG_RESET, 0, NULL, NULL, 0, NULL);
+ CA_MSG_RESET, 0, NULL, NULL, 0, NULL);
}
}
case OC_REST_OBSERVE:
case OC_REST_OBSERVE_ALL:
- OIC_LOG_V(INFO, TAG, "Canceling observation for resource %s",
- clientCB->requestUri);
- if (qos != OC_HIGH_QOS)
+ OIC_LOG_V(INFO, TAG, "Canceling observation for resource %s", clientCB->requestUri);
+
+ CopyDevAddrToEndpoint(clientCB->devAddr, &endpoint);
+
+ if ((endpoint.adapter & CA_ADAPTER_IP) && qos != OC_HIGH_QOS)
{
FindAndDeleteClientCB(clientCB);
break;
requestInfo.info.numOptions = numOptions + 1;
requestInfo.info.resourceUri = OICStrdup (clientCB->requestUri);
- CopyDevAddrToEndpoint(clientCB->devAddr, &endpoint);
ret = OCSendRequest(&endpoint, &requestInfo);