Files
libcoap/examples/riot/examples_libcoap_client
Jon Shallow d80fa1497d Client: Remove (D)TLS / WebSocket startup call-back timing window
Add in new functions
  coap_new_client_session3()
  coap_new_client_session_pki3()
  coap_new_client_session_psk3()
  coap_new_client_session_oscore3()
  coap_new_client_session_oscore_pki3()
  coap_new_client_session_oscore_psk3()
which effectively does coap_session_set_app_data2() and
coap_ws_set_host_request() early on in the session set up cycle.
2026-01-08 17:51:10 +00:00
..
2026-01-05 10:37:26 +00:00

libcoap client example

This example shows how to configure a client to use libcoap

Fast configuration (Between RIOT instances):

Preparing the logical interfaces:

sudo ./../../dist/tools/tapsetup/tapsetup --create 2

Client invocation

For the client:

PORT=tap0 make term
coapc coap://[ip6-address]/some/path

The IP address to connect to needs to be that as returned by libcoap_server, or that of the tap0 interface, etc.

Handling the static memory allocation

libcoap for RIOT is using the sys/memarray module and therefore there are certain limits. Said resources are defined in libcoap/src/coap_mem.c, but can be overwritten at compile time.