diff --git a/Meshtastic/Helpers/BLEManager.swift b/Meshtastic/Helpers/BLEManager.swift index 971aa6ae..a7337c94 100644 --- a/Meshtastic/Helpers/BLEManager.swift +++ b/Meshtastic/Helpers/BLEManager.swift @@ -240,9 +240,20 @@ class BLEManager: NSObject, ObservableObject, CBCentralManagerDelegate, CBPeriph self.timeoutTimer!.invalidate() } - // Map the peripheral to the connectedNode and connectedPeripheral ObservedObjects + // Map the peripheral to the connectedPeripheral ObservedObjects connectedPeripheral = peripherals.filter({ $0.peripheral.identifier == peripheral.identifier }).first - connectedPeripheral.peripheral.delegate = self + + if connectedPeripheral != nil { + + connectedPeripheral.peripheral.delegate = self + } + else { + + // we are null just disconnect and start over + self.lastConnectionError = "Bluetooth connection error, please try again." + self.disconnectPeripheral() + return + } // Discover Services peripheral.discoverServices([meshtasticServiceCBUUID, DFUSERVICE_UUID]) diff --git a/Meshtastic/Views/Bluetooth/Connect.swift b/Meshtastic/Views/Bluetooth/Connect.swift index 21f96bcf..405cff0d 100644 --- a/Meshtastic/Views/Bluetooth/Connect.swift +++ b/Meshtastic/Views/Bluetooth/Connect.swift @@ -262,7 +262,7 @@ struct Connect: View { .navigationViewStyle(StackNavigationViewStyle()) .sheet(isPresented: $invalidVersion) { - InvalidVersion(errorText: "1.3 ALPHA PREVIEW this version of the app supports only version \(minimumVersion) and above. Your device has been disconnected.") + InvalidVersion(errorText: "1.3 Beta this version of the app supports only version \(minimumVersion) and above. Your device has been disconnected.") } .onChange(of: (self.bleManager.connectedVersion)) { ic in diff --git a/Meshtastic/Views/Bluetooth/InvalidVersion.swift b/Meshtastic/Views/Bluetooth/InvalidVersion.swift index 25cc1fda..190456c8 100644 --- a/Meshtastic/Views/Bluetooth/InvalidVersion.swift +++ b/Meshtastic/Views/Bluetooth/InvalidVersion.swift @@ -22,7 +22,7 @@ struct InvalidVersion: View { .font(.title2) .padding() - Text("Version 1.3 includes breaking changes to devices and the client apps. The version 1.3 app does not support 1.2 nodes, there are two builds for 1.2 under Versions & Build Groups in TestFlight that will be available until early September 2022.") + Text("Version 1.3 includes breaking changes to devices and the client apps. The version 1.3 app does not support 1.2 nodes, there is one build for 1.2 under Versions & Build Groups in TestFlight that will be available until the end of November 2022.") .font(.callout) .padding()