MqttManager

interface MqttManager(source)

Interface for managing MQTT proxy communication.

Properties

Link copied to clipboard
abstract val mqttConnectionState: StateFlow<MqttConnectionState>

Observable MQTT proxy connection state for UI consumption.

Link copied to clipboard
abstract val proxyActive: StateFlow<Boolean>

Observable phone-local proxy state: true while this phone is actively running the MQTT proxy (relaying broker traffic to the connected device). This reflects only the phone-side proxy lifecycle and is independent of the device's persisted MQTT config — stop and startProxy flip it without any device read/write round-trip.

Functions

Link copied to clipboard
abstract fun handleMqttProxyMessage(message: MqttClientProxyMessage)

Handles an MQTT proxy message from the radio.

Link copied to clipboard
abstract suspend fun probe(address: String, tlsEnabled: Boolean, username: String?, password: String?): MqttProbeStatus

Probe an MQTT broker to verify connectivity and credentials without joining the proxy lifecycle. Intended for UI "Test Connection" affordances.

Link copied to clipboard
abstract fun startProxy(enabled: Boolean, proxyToClientEnabled: Boolean)

Starts the MQTT proxy with the given settings.

Link copied to clipboard
abstract fun stop()

Stops the MQTT manager.