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.
PamojaCoapServer
An opaque handle to a CoAP server.

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_recv_within⚠
Waits a limited time 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_coap_server_connect⚠
Binds the server’s socket and starts answering requests.
pamoja_coap_server_disconnect⚠
Closes the server’s socket, keeping its resources and filters.
pamoja_coap_server_free⚠
Releases a CoAP server handle.
pamoja_coap_server_is_connected⚠
Reports whether the server holds a bound socket.
pamoja_coap_server_local_port⚠
The port the server listens on, which names the one the system chose when it bound port 0.
pamoja_coap_server_new⚠
Creates a CoAP server that will listen on a local address.
pamoja_coap_server_observers⚠
Counts the clients observing a resource.
pamoja_coap_server_recv⚠
Waits for the next reading sent to a path the server takes.
pamoja_coap_server_recv_within⚠
Waits a limited time for the next reading sent to a path the server takes.
pamoja_coap_server_send⚠
Sets the state of a resource and notifies every observer of it.
pamoja_coap_server_subscribe⚠
Takes the readings sent to the paths a filter matches.
pamoja_transport_coap⚠
Creates a CoAP transport for composing into a ladder or a wrapper.