[riot-notifications] [RIOT-OS/RIOT] gcoap: Add 'observable' option to resources (#11587)
notifications at github.com
Mon May 27 13:35:41 CEST 2019
### Contribution description
Currently gcoap supports observing on its resources, but the user cannot select which resources can be observed (right not all of them). Also, a request to `/.well-known/core` will not give any [hint](https://tools.ietf.org/html/rfc7641#section-6) if a resource could be observed or not (this is not mandatory but nice to have).
This PR adds a `COAP_OBSERVABLE` option to indicate that an 'observe' request should be accepted on a particular resource, and that the 'obs' attribute should be added on the `/.well-known/core` response.
### Testing procedure
Run the gcoap example. The `/cli/stats` should have the 'obs' attribute, and an attempt to observe it should succeed. On the other hand, the observe request to `/riot/board` should be ignored.
### Issues/PRs references
Somehow related to #11171
You can view, comment on, or merge this pull request online at:
-- Commit Summary --
* net/nanocoap: Add Observable option
* net/gcoap: Observe only observable resources
* net/gcoap: Add 'obs' attribute
* examples/gcoap: Make resource observable
-- File Changes --
M examples/gcoap/gcoap_cli.c (2)
M sys/include/net/nanocoap.h (1)
M sys/net/application_layer/gcoap/gcoap.c (141)
-- Patch Links --
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the notifications