[riot-notifications] [RIOT-OS/RIOT] examples: use coap_opt_finish() in gcoap based examples (#10926)

Ken Bannister notifications at github.com
Fri Feb 1 20:18:56 CET 2019


### Contribution description
#10892 updates gcoap documentation and internal message generation to use coap_opt_finish() rather than gcoap_finish(). This PR updates RIOT examples that use gcoap to also use coap_opt_finish(). The examples include the gcoap CLI example, cord_epsim, and cord_ep.

### Testing procedure
- gcoap cli: Send requests to the CLI for /riot/stats and /riot/board. Use the CLI to send a request. Have an Observe client register for /cli/stats, and then create another request in the CLI, which will send a notification to the observer.
- cord_epsim: Register with a resource directory server. Also, send requests to the cord_epsim endpoint itself for /riot/foo and /riot/info.
- cord_ep: Use the CLI to register with a resource directory server. Also use the CLI to discover RD servers and remove the cord_ep client from the server. Also, send requests to the cord_ep endpoint itself for /sense/temp and /node/info.

FWIW, review my request_response, cord_ep, and cord_epsim [automated tests](https://github.com/kb2ma/riot-coap-pytest) for examples. 

### Issues/PRs references
Depends on #10892

You can view, comment on, or merge this pull request online at:

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

-- Commit Summary --

  * net/nanocoap: add inline function for Content-Format
  * net/gcoap: use coap_opt_finish within gcoap
  * net/gcoap: use coap_opt_finish in unit tests
  * net/gcoap: update module doc for coap_opt_finish
  * examples/gcoap: use coap_opt_finish()
  * examples/cord_epsim: use coap_opt_finish()
  * examples/cord_ep: use coap_opt_finish()

-- File Changes --

    M examples/cord_ep/main.c (8)
    M examples/cord_epsim/main.c (4)
    M examples/gcoap/gcoap_cli.c (40)
    M sys/include/net/gcoap.h (85)
    M sys/include/net/nanocoap.h (17)
    M sys/net/application_layer/cord/ep/cord_ep.c (4)
    M sys/net/application_layer/cord/epsim/cord_epsim.c (2)
    M sys/net/application_layer/gcoap/gcoap.c (15)
    M tests/unittests/tests-gcoap/tests-gcoap.c (22)

-- Patch Links --

https://github.com/RIOT-OS/RIOT/pull/10926.patch
https://github.com/RIOT-OS/RIOT/pull/10926.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/10926
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190201/3d436fcd/attachment.html>


More information about the notifications mailing list