mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
Merge pull request #1256 from RCGV1/want-config-69420
First get config to subscribe then fetch nodes
This commit is contained in:
commit
a75fdd4f1c
1 changed files with 11 additions and 2 deletions
|
|
@ -511,7 +511,10 @@ class BLEManager: NSObject, CBPeripheralDelegate, MqttClientProxyManagerDelegate
|
|||
Logger.mesh.info("🛎️ \(logString, privacy: .public)")
|
||||
// BLE Characteristics discovered, issue wantConfig
|
||||
var toRadio: ToRadio = ToRadio()
|
||||
configNonce += 1
|
||||
configNonce = UInt32(69421)
|
||||
if !isSubscribed {
|
||||
configNonce = UInt32(69420) // Get config first
|
||||
}
|
||||
toRadio.wantConfigID = configNonce
|
||||
guard let binaryData: Data = try? toRadio.serializedData() else {
|
||||
return
|
||||
|
|
@ -982,7 +985,7 @@ class BLEManager: NSObject, CBPeripheralDelegate, MqttClientProxyManagerDelegate
|
|||
Logger.mesh.warning("🕸️ MESH PACKET received for Key Verification App UNHANDLED \((try? decodedInfo.packet.jsonString()) ?? "JSON Decode Failure", privacy: .public)")
|
||||
}
|
||||
|
||||
if decodedInfo.configCompleteID != 0 && decodedInfo.configCompleteID == configNonce {
|
||||
if decodedInfo.configCompleteID != 0 && decodedInfo.configCompleteID == 69420 {
|
||||
invalidVersion = false
|
||||
lastConnectionError = ""
|
||||
isSubscribed = true
|
||||
|
|
@ -1022,6 +1025,12 @@ class BLEManager: NSObject, CBPeripheralDelegate, MqttClientProxyManagerDelegate
|
|||
} catch {
|
||||
Logger.data.error("Failed to find a node info for the connected node \(error.localizedDescription, privacy: .public)")
|
||||
}
|
||||
Logger.mesh.info("🤜 [BLE] Want Config Complete. ID:\(decodedInfo.configCompleteID, privacy: .public)")
|
||||
sendWantConfig()
|
||||
|
||||
}
|
||||
if decodedInfo.configCompleteID != 0 && decodedInfo.configCompleteID == 69421 {
|
||||
Logger.mesh.info("🤜 [BLE] Want Config DB Complete. ID:\(decodedInfo.configCompleteID, privacy: .public)")
|
||||
}
|
||||
|
||||
// MARK: Share Location Position Update Timer
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue