From e44e3dd846f56412d044f47e223fc602ddbed3c0 Mon Sep 17 00:00:00 2001 From: Garth Vander Houwen Date: Thu, 13 Jan 2022 18:18:24 -0800 Subject: [PATCH] Add error 15 mkinney found when writing Mac BLE python --- MeshtasticClient/Helpers/BLEManager.swift | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/MeshtasticClient/Helpers/BLEManager.swift b/MeshtasticClient/Helpers/BLEManager.swift index 2148ae2a..d8f325f9 100644 --- a/MeshtasticClient/Helpers/BLEManager.swift +++ b/MeshtasticClient/Helpers/BLEManager.swift @@ -384,6 +384,15 @@ class BLEManager: NSObject, ObservableObject, CBCentralManagerDelegate, CBPeriph self.centralManager?.cancelPeripheralConnection(peripheral) } + if errorCode == 15 { // CBATTErrorDomain Code=15 "Encryption is insufficient." + + // BLE Pin connection error + // We will try and re-connect to this device + lastConnectionError = "🚫 BLE \(e.localizedDescription) This may be a Meshtastic Firmware bug affecting BLE 4.0 devices." + if meshLoggingEnabled { MeshLogger.log("🚫 BLE \(e.localizedDescription) Please try connecting again. You may need to forget the device under Settings > General > Bluetooth.") } + self.centralManager?.cancelPeripheralConnection(peripheral) + + } } switch characteristic.uuid {