module documentation

Implementation of an MQTT Client helper class.

Class MQTTConnection This class implements an MQTT client. It is a wrapper around the paho MQTT client. It is implemented as a BackgroundWorker/Actor, so it runs in its own thread.
Class MQTTHandler This base class defines the interface for an MQTT handler class. The abstract methods defined here must be implemented by the implementing class.
Class MQTTTopic Structure that represents a subscribed-to topic.
Function idToMQTT Convert a oneM2M ID to an MQTT compatible path element.
Function idToMQTTClientID Convert a oneM2M ID to an MQTT client ID.
Function mqttToId Convert an MQTT compatible path element to an ID.
Type Alias MQTTCallback Type for an MQTT Callback.
def idToMQTT(id: str) -> str:

Convert a oneM2M ID to an MQTT compatible path element.

Parameters
id:strThe oneM2M ID to convert.
Returns
strThe MQTT compatible path element.
def idToMQTTClientID(id: str, isCSE: bool | None = True) -> str:

Convert a oneM2M ID to an MQTT client ID.

Parameters
id:strThe oneM2M ID to convert.
isCSE:bool | NoneWhether the ID is a CSE-ID or an AE-ID.
Returns
strThe MQTT client ID.
def mqttToId(mqttId: str, isCSE: bool | None = True) -> tuple[str, bool]:

Convert an MQTT compatible path element to an ID.

Parameters
mqttId:strThe MQTT compatible path element to convert.
isCSE:bool | NoneWhether the ID is a CSE-ID or an AE-ID.
Returns
tuple[str, bool]The ID and whether it is a CSE-ID or an AE-ID.
MQTTCallback =

Type for an MQTT Callback.

Value
Callable[[MQTTConnection, str, bytes], None]