Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
3d57f45
net/unicoap/udp: add UDP transport driver
carl-tud May 8, 2026
4afa652
net/unicoap/dtls: add DTLS transport driver
carl-tud May 8, 2026
a279302
net/unicoap/rfc7252: add RFC7252 messaging driver
carl-tud May 8, 2026
58662ea
net/unicoap: add transport interface
carl-tud May 8, 2026
0ad963e
net/unicoap/server: add simple CoAP server
carl-tud May 8, 2026
125112e
net/unicoap: add state management and private API
carl-tud May 8, 2026
a24784e
net/unicoap: add public lifecycle and config API
carl-tud May 8, 2026
1db939c
net/unicoap: prefixed logging in options.c
carl-tud May 8, 2026
51f6842
net/unicoap: docs and gardening in message headers
carl-tud May 8, 2026
a95c30e
auto_init: unicoap auto-init
carl-tud May 8, 2026
2f0be42
net/unicoap: add docs for server module
carl-tud May 8, 2026
07dead9
tests/unittests: test unicoap server APIs
carl-tud May 8, 2026
c40dc02
examples/networking/coap/unicoap_server: add unicoap server example
carl-tud May 8, 2026
640e78d
(temporary) unicoap client impl + example
carl-tud May 9, 2026
181218b
fix CON response ACK (new state notif sys)
carl-tud May 10, 2026
bc42004
client DNS logging
carl-tud May 10, 2026
0104be0
allow optional cancellation of pending requests
carl-tud May 10, 2026
66866bf
fix changed messaging API in server
carl-tud May 10, 2026
9571833
fix changed messaging API in server, vol 2
carl-tud May 10, 2026
185b973
keep client functions out of server
carl-tud May 10, 2026
acd5b1c
(temporary) unicoap observation impl
carl-tud May 11, 2026
b2d568a
check in missing observation units
carl-tud May 11, 2026
0bbebf9
init notification to all zeroes to zero .payload_representation
carl-tud May 12, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 78 additions & 0 deletions examples/networking/coap/unicoap_client/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Default Makefile, for simple unicoap server sample application

# name of your application
APPLICATION = unicoap_client

# If no BOARD is found in the environment, use this default:
BOARD ?= native

# This has to be the absolute path to the RIOT base directory:
RIOTBASE ?= $(CURDIR)/../../../..

# Include packages that pull up and auto-init the link layer.
# NOTE: 6LoWPAN will be included if IEEE802.15.4 devices are present
USEMODULE += netdev_default

# use GNRC by default
LWIP_IPV4 ?= 0
LWIP_IPV6 ?= 0

ifeq (,$(filter 1, $(LWIP_IPV4) $(LWIP_IPV6)))
USEMODULE += auto_init_gnrc_netif
# Specify the mandatory networking modules
USEMODULE += gnrc_ipv6_default
# Additional networking modules that can be dropped if not needed
USEMODULE += gnrc_icmpv6_echo
else
ifeq (1,$(LWIP_IPV4))
USEMODULE += ipv4_addr

USEMODULE += lwip_arp
USEMODULE += lwip_ipv4
USEMODULE += lwip_dhcp_auto
CFLAGS += -DETHARP_SUPPORT_STATIC_ENTRIES=1
endif

ifeq (1,$(LWIP_IPV6))
USEMODULE += ipv6_addr

USEMODULE += lwip_ipv6
USEMODULE += lwip_ipv6_autoconfig
endif
endif

# Import unicoap
USEMODULE += unicoap

# Import client submodule
USEMODULE += unicoap_client
# URI support
USEMODULE += unicoap_client_uri

# Observation support
USEMODULE += unicoap_observation

# This module is needed for CoAP over UDP
USEMODULE += unicoap_driver_udp

# This module is needed for CoAP over DTLS
USEMODULE += unicoap_driver_dtls

# Use object dump to print response payload in hex
USEMODULE += od

# Use shell module to accept and parse RIOT shell commands to send requests with configurable
# CoAP request methods.
USEMODULE += shell

# It is okay to import only either of the CoAP over UDP and CoAP over DTLS drivers.

# Comment this out to disable code in RIOT that does safety checking
# which is not needed in a production environment but helps in the
# development process:
DEVELHELP ?= 1

# Change this to 0 show compiler invocation lines by default:
QUIET ?= 1

include $(RIOTBASE)/Makefile.include
Empty file.
30 changes: 30 additions & 0 deletions examples/networking/coap/unicoap_client/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Sample Client Application With `unicoap`

This a sample application demonstrating how you send CoAP requests using `unicoap`,
the unified and modular CoAP suite in RIOT. Visit the
[`unicoap` client tutorial on doc.riot-os.org](http://doc.riot-os.org/group__net__unicoap__client__tutorial.html)
for a detailed code-level instructions.

## Running the Example on RIOT's Native Board

Create a tap interface (to which RIOT will connect):

```sh
sudo ip tuntap add tap0 mode tap user ${USER}
sudo ip link set tap0 up
```

To try this example on your host, run:
```sh
BOARD=native make flash term
```
This will compile and run the application.
The application will print a network-layer address.

In a second terminal session, you can run

```sh
python3 server.py"
```

to send a CoAP request through the tap interface to the CoAP server.
14 changes: 14 additions & 0 deletions examples/networking/coap/unicoap_client/app.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# This is a lighter version of debug logging where only API misuse, missing modules, and
# tips to fix these issues are logged, without trace logs.
CONFIG_UNICOAP_ASSIST=y

# This is the full version of debug logging, including trace logs. When this is enabled,
# the previously mentioned API misuse, missing modules, and fix-its will also be diagnosed.
# So when you enable debug logging, you do not need to set CONFIG_UNICOAP_ASSIST.
CONFIG_UNICOAP_DEBUG_LOGGING=n

CONFIG_UNICOAP_CREATE_THREAD=y

CONFIG_UNICOAP_CLIENT_CANCELLABLE=y

CONFIG_UNICOAP_DEBUG_LOGGING=y
Loading
Loading