1c87c5fbaSopenharmony_ciExample of libcoap running on RIOT 2c87c5fbaSopenharmony_ci================================== 3c87c5fbaSopenharmony_ci 4c87c5fbaSopenharmony_ciTo build the examples, do 5c87c5fbaSopenharmony_ci 6c87c5fbaSopenharmony_ci $ make 7c87c5fbaSopenharmony_ci 8c87c5fbaSopenharmony_ciThis will 9c87c5fbaSopenharmony_ci 10c87c5fbaSopenharmony_ci* download RIOT from the upstream git sources 11c87c5fbaSopenharmony_ci* update the RIOT environment with pkg/libcoap, examples/libcoap-client 12c87c5fbaSopenharmony_ci and examples/libcoap-server taken from pkg_libcoap/, examples_client/ 13c87c5fbaSopenharmony_ci and examples_server respectively/. 14c87c5fbaSopenharmony_ci (updates RIOT's libcoap code to the latest commited version in your 15c87c5fbaSopenharmony_ci environment). 16c87c5fbaSopenharmony_ci* build the client application 17c87c5fbaSopenharmony_ci* build the server application 18c87c5fbaSopenharmony_ci 19c87c5fbaSopenharmony_ciTo run (and/or rebuild) the server application 20c87c5fbaSopenharmony_ci 21c87c5fbaSopenharmony_ci* cd RIOT/examples-libcoap-server 22c87c5fbaSopenharmony_ci* make RIOT_CI_BUILD=1 23c87c5fbaSopenharmony_ci* make term 24c87c5fbaSopenharmony_ci* (at the shell prompt) coaps start 25c87c5fbaSopenharmony_ci 26c87c5fbaSopenharmony_ciThe server creates a resource for 'time' with a query 'ticks'. This is 27c87c5fbaSopenharmony_cireported for `.well-known/core`. The work flow for adding more resources does 28c87c5fbaSopenharmony_cinot differ from regular libcoap usage. 29c87c5fbaSopenharmony_ci 30c87c5fbaSopenharmony_ciTo run (and/or rebuild) the client application 31c87c5fbaSopenharmony_ci 32c87c5fbaSopenharmony_ci* cd RIOT/examples-libcoap-client 33c87c5fbaSopenharmony_ci* make RIOT_CI_BUILD=1 34c87c5fbaSopenharmony_ci* make term 35c87c5fbaSopenharmony_ci* (at the shell prompt) coapc 36c87c5fbaSopenharmony_ci 37c87c5fbaSopenharmony_ciThe client will try to connect to the URI defined in app.config named 38c87c5fbaSopenharmony_ciCONFIG_LIBCOAP_CLIENT_URI (unless overridden by running 'make menuconfig'). 39c87c5fbaSopenharmony_ci 40c87c5fbaSopenharmony_ciNote to developers 41c87c5fbaSopenharmony_ci================== 42c87c5fbaSopenharmony_ci 43c87c5fbaSopenharmony_ciPKG_VERSION= in pkg_libcoap/Makefile needs updating if you need a different 44c87c5fbaSopenharmony_civersion of libcoap to get initially installed into RIOT/pkg/libcoap. 45c87c5fbaSopenharmony_ci 46c87c5fbaSopenharmony_ciKconfig support is available. Running make in the libcoap distribution 47c87c5fbaSopenharmony_ciexamples/riot directory will try to add in a 'rsource "libcoap/Kconfig"' 48c87c5fbaSopenharmony_cientry into RIOT/pkg/Kconfig 49