OC_LOG(INFO, TAG, "-t 8 : Discover Resources and Initiate Confirmable Get Request");
OC_LOG(INFO, TAG, "-t 9 : Discover Resources and Initiate Confirmable Post Request");
OC_LOG(INFO, TAG, "-t 10 : Discover Resources and Initiate Confirmable Delete Requests");
- OC_LOG(INFO, TAG, "-t 11 : Discover Resources and Initiate Confirmable Observe Requests");
+ OC_LOG(INFO, TAG, "-t 11 : Discover Resources and Initiate Confirmable Observe Requests"\
+ " and cancel with Low QoS");
#ifdef WITH_PRESENCE
OC_LOG(INFO, TAG, "-t 12 : Discover Resources and Initiate Nonconfirmable presence");
#endif
OC_LOG(INFO, TAG, "-t 15 : Discover Resources and Initiate Nonconfirmable Observe Requests "\
- "then cancel immediately");
+ "then cancel immediately with High QOS");
OC_LOG(INFO, TAG, "-t 16 : Discover Resources and Initiate Nonconfirmable Get Request and "\
"add vendor specific header options");
OC_LOG(INFO, TAG, "-t 17 : Discover Devices");
OC_LOG_V(INFO, TAG, "JSON = %s =============> Obs Response",
clientResponse->resJSONPayload);
gNumObserveNotifies++;
- if (gNumObserveNotifies == 3) //large number to test observing in DELETE case.
+ if (gNumObserveNotifies == 15) //large number to test observing in DELETE case.
{
if(TEST_CASE == TEST_OBS_REQ_NON || TEST_CASE == TEST_OBS_REQ_CON)
{
&(responseInfo->info.options[i]), sizeof(OCHeaderOption));
}
}
- if (cbNode->callBack(cbNode->context,
- cbNode->handle, &response) == OC_STACK_DELETE_TRANSACTION)
+
+ if (cbNode->method == OC_REST_OBSERVE &&
+ response.sequenceNumber > OC_OFFSET_SEQUENCE_NUMBER &&
+ response.sequenceNumber <= cbNode->sequenceNumber)
+ {
+ OC_LOG_V(INFO, TAG, PCF("Received stale notification. Number :%d"),
+ response.sequenceNumber);
+ }
+ else
{
- FindAndDeleteClientCB(cbNode);
+ OCStackApplicationResult appFeedback = cbNode->callBack(cbNode->context,
+ cbNode->handle,
+ &response);
+ cbNode->sequenceNumber = response.sequenceNumber;
+
+ if (appFeedback == OC_STACK_DELETE_TRANSACTION)
+ {
+ FindAndDeleteClientCB(cbNode);
+ }
}
//Need to send ACK when the response is CON