pamoja.coap
Idiomatic CoAP facade.
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.
1"""Idiomatic CoAP facade. 2 3CoAP is the transport for links where MQTT is more than the budget allows: it 4runs over UDP, its headers are a handful of bytes, and a node can fire a reading 5and forget it rather than holding a session open. 6""" 7 8from __future__ import annotations 9 10import enum 11 12from pamoja._native import CoapClient, Message 13 14__all__ = [ 15 "CoapClient", 16 "Message", 17 "Reliability", 18] 19 20 21class Reliability(str, enum.Enum): 22 """Whether a request is acknowledged and retried.""" 23 24 #: Fire and forget: the request is sent once and not acknowledged. 25 NON_CONFIRMABLE = "NonConfirmable" 26 #: The request is acknowledged, and retransmitted until an ACK arrives. 27 CONFIRMABLE = "Confirmable"
class
CoapClient:
A CoAP endpoint.
class
Message:
A message that arrived on a subscribed topic.
CoAP and the loopback broker both hand back a topic and a payload, so one class serves them rather than a near-identical type per transport.
class
Reliability(builtins.str, enum.Enum):
22class Reliability(str, enum.Enum): 23 """Whether a request is acknowledged and retried.""" 24 25 #: Fire and forget: the request is sent once and not acknowledged. 26 NON_CONFIRMABLE = "NonConfirmable" 27 #: The request is acknowledged, and retransmitted until an ACK arrives. 28 CONFIRMABLE = "Confirmable"
Whether a request is acknowledged and retried.
NON_CONFIRMABLE =
<Reliability.NON_CONFIRMABLE: 'NonConfirmable'>
CONFIRMABLE =
<Reliability.CONFIRMABLE: 'Confirmable'>