golioth / golioth-zephyr-sdk

Golioth SDK For Zephyr
https://www.golioth.io
Apache License 2.0
66 stars 19 forks source link

coap_req: add timestamp comparison to OBSERVE notifications #323

Closed mniestroj closed 1 year ago

mniestroj commented 1 year ago

As per CoAP OBSERVE RFC7641 section "4.4. Reordering", server can choose any arbitrary number as initial sequence number as OBSERVE CoAP option value. In paticular, local clock can be used to generate sequence numbers, so that specific sequence number values do not need to be remembered on server side.

In order to handle that successfully, client needs to implement timestamp comparison as per RFC7641 section "3.4. Reordering". So far only sequence number comparison was used, so add missing timestamp comparison to be compliant with CoAP OBSERVE spec and handle newest Golioth backend behavior.

While at it, change wording of 'age' to 'seq' and/or 'sequence number', so it will match what is used in RFC7641 specification.

github-actions[bot] commented 1 year ago

Visit the preview URL for this PR (updated for commit 24a1e82):

https://golioth-zephyr-sdk-doxygen-dev--pr323-coap-observe-tim-f10989hu.web.app

(expires Tue, 13 Dec 2022 17:32:52 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: a389eefadf4b4b68a539327b3459dd66c142cf49