Function coap_run
pub async fn coap_run(handler: impl Handler + Reporting) -> !
Available on crate features
coap
and coap-server
only.Expand description
Runs a CoAP server with the given handler on the system’s CoAP transports.
§Note
The application needs to run this in a task; otherwise, other components (e.g., system components that also run on the CoAP server, or the CoAP client that depends on the server loop to run) get stalled.
As the CoAP stack gets ready (which may take some time if the network is not ready yet), it also
unblocks coap_client()
.
§Panics
This can only be run once, as it sets up a system wide CoAP handler.