mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
Update Mqtt proxy indicator on Bluetooth view to actually work.
This commit is contained in:
parent
119043bc06
commit
0231e110fb
2 changed files with 4 additions and 1 deletions
|
|
@ -13,12 +13,14 @@ class BLEManager: NSObject, CBPeripheralDelegate, MqttClientProxyManagerDelegate
|
|||
// MqttClientProxyManagerDelegate
|
||||
func onMqttConnected() {
|
||||
mqttManager.status = .connected
|
||||
mqttProxyConnected = true
|
||||
print("📲 Mqtt Client Proxy onMqttConnected now subscribing to \(mqttManager.topic).")
|
||||
mqttManager.mqttClientProxy?.subscribe(mqttManager.topic)
|
||||
}
|
||||
|
||||
func onMqttDisconnected() {
|
||||
mqttManager.status = .disconnected
|
||||
mqttProxyConnected = false
|
||||
print("MQTT Disconnected")
|
||||
}
|
||||
|
||||
|
|
@ -66,6 +68,7 @@ class BLEManager: NSObject, CBPeripheralDelegate, MqttClientProxyManagerDelegate
|
|||
@Published var invalidVersion = false
|
||||
@Published var isSwitchedOn: Bool = false
|
||||
@Published var automaticallyReconnect: Bool = true
|
||||
@Published var mqttProxyConnected: Bool = false
|
||||
public var minimumVersion = "2.0.0"
|
||||
public var connectedVersion: String
|
||||
public var isConnecting: Bool = false
|
||||
|
|
|
|||
|
|
@ -251,7 +251,7 @@ struct Connect: View {
|
|||
.navigationTitle("bluetooth")
|
||||
.navigationBarItems(leading: MeshtasticLogo(), trailing:
|
||||
ZStack {
|
||||
ConnectedDevice(bluetoothOn: bleManager.isSwitchedOn, deviceConnected: bleManager.connectedPeripheral != nil, name: (bleManager.connectedPeripheral != nil) ? bleManager.connectedPeripheral.shortName : "????", mqttProxyConnected: bleManager.mqttManager.status == MqttClientProxyManager.ConnectionStatus.connected)
|
||||
ConnectedDevice(bluetoothOn: bleManager.isSwitchedOn, deviceConnected: bleManager.connectedPeripheral != nil, name: (bleManager.connectedPeripheral != nil) ? bleManager.connectedPeripheral.shortName : "????", mqttProxyConnected: bleManager.mqttProxyConnected)
|
||||
})
|
||||
}
|
||||
.sheet(isPresented: $invalidFirmwareVersion, onDismiss: didDismissSheet) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue