Skip to main content

Module coap

Module coap 

Source
Expand description

The C ABI for CoAP.

These functions wrap [pamoja_coap] for callers that reach the SDK through the flat C boundary. CoAP is the transport for links where MQTT is more than the budget allows: it runs over UDP, its headers are a handful of bytes, and a node can fire a reading and forget it rather than holding a session open.

A client holds a socket and a background loop, so it crosses as an opaque handle and every call blocks on the shared runtime. To use CoAP as one rung of a ladder rather than driving it directly, build a PamojaTransport with pamoja_transport_coap instead.

Structs§

PamojaCoapClient
An opaque handle to a CoAP endpoint.
PamojaCoapConfig
The settings a CoAP endpoint is built from.

Enums§

PamojaCoapReliability
Whether a CoAP request is acknowledged and retried.

Functions§

pamoja_coap_client_connect
Binds the local socket so the endpoint can carry traffic.
pamoja_coap_client_disconnect
Releases the socket the endpoint holds.
pamoja_coap_client_free
Releases a CoAP endpoint handle.
pamoja_coap_client_is_connected
Reports whether the endpoint is bound.
pamoja_coap_client_new
Creates a disconnected CoAP endpoint from the given settings.
pamoja_coap_client_recv
Waits for the next message on an observed path.
pamoja_coap_client_send
Sends a payload to a resource path.
pamoja_coap_client_subscribe
Observes a resource path, so messages published to it arrive at pamoja_coap_client_recv.
pamoja_transport_coap
Creates a CoAP transport for composing into a ladder or a wrapper.