mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
Get out of disconnect loop
This commit is contained in:
parent
60831f6e75
commit
04fef0cba9
2 changed files with 15 additions and 0 deletions
|
|
@ -151,12 +151,15 @@ class BLEManager: NSObject, CBPeripheralDelegate, MqttClientProxyManagerDelegate
|
|||
isConnecting = false
|
||||
isConnected = false
|
||||
isSubscribed = false
|
||||
self.connectedPeripheral = nil
|
||||
invalidVersion = false
|
||||
connectedVersion = "0.0.0"
|
||||
connectedPeripheral = nil
|
||||
if timeoutTimer != nil {
|
||||
timeoutTimer!.invalidate()
|
||||
}
|
||||
automaticallyReconnect = false
|
||||
stopScanning()
|
||||
startScanning()
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -258,6 +258,18 @@ struct Connect: View {
|
|||
.controlSize(.large)
|
||||
.padding()
|
||||
}
|
||||
if bleManager.isConnecting {
|
||||
Button(role: .destructive, action: {
|
||||
bleManager.cancelPeripheralConnection()
|
||||
|
||||
}) {
|
||||
Label("disconnect", systemImage: "antenna.radiowaves.left.and.right.slash")
|
||||
}
|
||||
.buttonStyle(.bordered)
|
||||
.buttonBorderShape(.capsule)
|
||||
.controlSize(.large)
|
||||
.padding()
|
||||
}
|
||||
#endif
|
||||
Spacer()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue