MQTTRepository

Interface defining the MQTT interactions used for proxying messages to and from the mesh.

Inheritors

Properties

Link copied to clipboard
abstract val connectionState: StateFlow<ConnectionState>

Observable MQTT connection lifecycle state (DISCONNECTED → CONNECTING → CONNECTED → RECONNECTING).

Link copied to clipboard
abstract val proxyMessageFlow: Flow<MqttClientProxyMessage>

A flow of incoming messages from the subscribed MQTT topics. Connecting/subscribing is initiated when this flow is collected.

Functions

Link copied to clipboard
abstract fun disconnect()

Disconnects the MQTT client and cleans up resources.

Link copied to clipboard
abstract fun publish(topic: String, data: ByteArray, retained: Boolean)

Publishes a message to the given MQTT topic.