Bug: https://jira.iotivity.org/browse/IOT-1317
Change-Id: I4e5ef2a1c848b963c036efe4ddf73dfd76b2b262
Signed-off-by: Ziran Sun <ziran.sun@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/12055
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
(cherry picked from commit
888bc96303a22443ab4d75e225803268267956b0)
Reviewed-on: https://gerrit.iotivity.org/gerrit/12213
Reviewed-by: Habib Virji <habib.virji@samsung.com>
#ifndef OC_OBSERVE_H
#define OC_OBSERVE_H
-/** Sequence number is a 24 bit field, per https://tools.ietf.org/html/draft-ietf-core-observe-16.*/
-#define MAX_SEQUENCE_NUMBER (0xFFFFFF)
-
/** Maximum number of observers to reach */
#define MAX_OBSERVER_FAILED_COMM (2)
*/
typedef uint8_t OCObservationId;
+/**
+ * Sequence number is a 24 bit field,
+ * per https://tools.ietf.org/html/rfc7641.
+ */
+#define MAX_SEQUENCE_NUMBER (0xFFFFFF)
+
/**
* Action associated with observation.
*/
std::thread exec(context->callback, serverHeaderOptions, attrs,
result, sequenceNumber);
exec.detach();
+ if (sequenceNumber == MAX_SEQUENCE_NUMBER + 1)
+ {
+ return OC_STACK_DELETE_TRANSACTION;
+ }
return OC_STACK_KEEP_TRANSACTION;
}