[riot-notifications] [RIOT-OS/RIOT] gcoap: Add 'observable' option to resources (#11587)

Leandro Lanzieri 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:

  https://github.com/RIOT-OS/RIOT/pull/11587

-- 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 --

https://github.com/RIOT-OS/RIOT/pull/11587.patch
https://github.com/RIOT-OS/RIOT/pull/11587.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/11587
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190527/c6f217b7/attachment-0001.html>


More information about the notifications mailing list