You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ken Bannister edited this page Sep 17, 2018
·
1 revision
This page is an introduction to RIOT's CoAP support. RIOT includes two native implementations as well as packages for other libraries.
nanocoap
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
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.