Files
libcoap/examples/riot
Jon Shallow eff1f38f9f path_query parsing: Remove need to define scratch buffer
Create new options coap_uri_into_optlist(), coap_path_into_optlist() and
coap_query_into_optlist() to be used instead of coap_uri_into_options(),
coap_split_path() and coap_split_query() functions so the requirement
for a scratch buffer is not needed.

Getting the minimum size for a scratch buffer is not straight forward and
potential for unexpected boundary condition errors to occurif too small.

Correct parsing and stripping out of "%2E%2E" ("..") and "%2E" (".")
path segments.  ".." now removes the previous segment (if it exists).

Update documentation and unit testcases.

Update examples to use new options.
2024-06-25 08:23:33 +01:00
..

Example of libcoap running on RIOT
==================================

To build the examples, do

    $ make

This will

* download RIOT from the upstream git sources
* update the RIOT environment with pkg/libcoap, examples/libcoap-client
  and examples/libcoap-server taken from pkg_libcoap/, examples_client/
  and examples_server respectively/.
  (updates RIOT's libcoap code to the latest commited version in your
   environment).
* build the client application
* build the server application

To run (and/or rebuild) the server application

* cd RIOT/examples-libcoap-server
* make RIOT_CI_BUILD=1
* make term
* (at the shell prompt) coaps start

The server creates a resource for 'time' with a query 'ticks'.  This is
reported for `.well-known/core`. The work flow for adding more resources does
not differ from regular libcoap usage.

To run (and/or rebuild) the client application

* cd RIOT/examples-libcoap-client
* make RIOT_CI_BUILD=1
* make term
* (at the shell prompt) coapc

The client will try to connect to the URI defined in app.config named
CONFIG_LIBCOAP_CLIENT_URI (unless overridden by running 'make menuconfig').

Note to developers
==================

PKG_VERSION= in pkg_libcoap/Makefile needs updating if you need a different
version of libcoap to get initially installed into RIOT/pkg/libcoap.

Kconfig support is available. Running make in the libcoap distribution
examples/riot directory will try to add in a 'rsource "libcoap/Kconfig"'
entry into RIOT/pkg/Kconfig