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.

Link copied to clipboard
abstract val subscriptionRefusal: StateFlow<MqttException.SubscriptionRefused?>

The broker's refusal of one or more topic filters on the current connection, or null when every filter was granted or nothing has been subscribed yet. Cleared when the session ends.

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.