When cancel observe is requested by client, the callback should return
a sequence number greater than MAX_SEQUENCE_NUMBER, and with no observe
header option.
Currently it is returning 0 which is not correct.So stack has been
modified to return a higher sequence number with the callback
for cancel observe confirmed response.
Change-Id: I85ea87454e3ca96f22fe7e414189ec0be7ea8dd8
Signed-off-by: arya.k <arya.kumar@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/19651
Reviewed-by: Uze Choi <uzchoi@samsung.com>
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Ashok Babu Channa <ashok.channa@samsung.com>
}
response->devAddr.adapter = OC_DEFAULT_ADAPTER;
+ response->sequenceNumber = MAX_SEQUENCE_NUMBER + 1;
CopyEndpointToDevAddr(endPoint, &response->devAddr);
FixUpClientResponse(response);
response->resourceUri = responseInfo->info.resourceUri;
std::cout << "No observe option header is returned in the response." << std::endl;
std::cout << "For a registration request, it means the registration failed"
<< std::endl;
+ std::cout << "For a cancelation request, it means the cancelation was successful"
+ << std::endl;
}
else
{
#include <windows.h>
#endif
+#define MAX_SEQUENCE_NUMBER (0xFFFFFF)
+
using namespace OC;
struct dereference_compare
{
std::cout << "\tObserve Registration Confirmed: "<< std::endl;
}
- else if (sequenceNumber == (int) ObserveAction::ObserveUnregister)
+ else if (sequenceNumber == (MAX_SEQUENCE_NUMBER + 1))
{
std::cout << "\tObserve Cancel Confirmed: "<< std::endl;
sleep(10);