-
Notifications
You must be signed in to change notification settings - Fork 2k
CoAP Home
This page is an introduction to RIOT's CoAP support. RIOT includes two native implementations as well as packages for other libraries.
nanocoap has a more granular, flexible, and lower level API. Messages are processed synchronously. A CoAP client sends and receives messages in the calling application thread, or a CoAP server runs in a dedicated application thread.
nanocoap is well suited for devices with less resources, or for dedicated client or server applications.
gcoap has a simpler, higher level API, and reuses nanocoap's functions internally when possible. gcoap runs in its own thread, and messages are processed asynchronously. A CoAP client sends messages from the calling application thread, but responses are received via a callback from the gcoap thread. The gcoap thread also acts as a CoAP server that executes callbacks for application defined resources.
gcoap is well suited as a hub for more extensive message processing, or just as a simple API if resource use is not a primary concern.
RIOT provides packages for the libcoap and microcoap libraries.