mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
QR Code fixes
This commit is contained in:
parent
091874a9f2
commit
288b35d6fc
3 changed files with 6 additions and 3 deletions
|
|
@ -410,11 +410,9 @@ class BLEManager: NSObject, ObservableObject, CBCentralManagerDelegate, CBPeriph
|
|||
guard (connectedPeripheral!.peripheral.state == CBPeripheralState.connected) else { return }
|
||||
|
||||
if FROMRADIO_characteristic == nil {
|
||||
|
||||
MeshLogger.log("🚨 Unsupported Firmware Version Detected, unable to connect to device.")
|
||||
invalidVersion = true
|
||||
return
|
||||
|
||||
} else {
|
||||
MeshLogger.log("ℹ️ Issuing wantConfig to \(connectedPeripheral!.peripheral.name ?? "Unknown")")
|
||||
//BLE Characteristics discovered, issue wantConfig
|
||||
|
|
@ -423,7 +421,6 @@ class BLEManager: NSObject, ObservableObject, CBCentralManagerDelegate, CBPeriph
|
|||
toRadio.wantConfigID = configNonce
|
||||
let binaryData: Data = try! toRadio.serializedData()
|
||||
connectedPeripheral!.peripheral.writeValue(binaryData, for: TORADIO_characteristic, type: .withResponse)
|
||||
|
||||
// Either Read the config complete value or from num notify value
|
||||
connectedPeripheral!.peripheral.readValue(for: FROMRADIO_characteristic)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -773,8 +773,13 @@ func channelPacket (channel: Channel, fromNum: Int64, context: NSManagedObjectCo
|
|||
newChannel.name = channel.settings.name
|
||||
newChannel.role = Int32(channel.role.rawValue)
|
||||
newChannel.psk = channel.settings.psk
|
||||
|
||||
|
||||
let mutableChannels = fetchedMyInfo[0].channels!.mutableCopy() as! NSMutableOrderedSet
|
||||
if channel.role.rawValue == 1 {
|
||||
mutableChannels.removeAllObjects()
|
||||
}
|
||||
|
||||
|
||||
mutableChannels.add(newChannel)
|
||||
fetchedMyInfo[0].channels = mutableChannels.copy() as? NSOrderedSet
|
||||
|
|
|
|||
|
|
@ -282,6 +282,7 @@ struct ShareChannels: View {
|
|||
loRaConfig.hopLimit = UInt32(node?.loRaConfig?.hopLimit ?? 3)
|
||||
loRaConfig.txEnabled = node?.loRaConfig?.txEnabled ?? false
|
||||
loRaConfig.txPower = node?.loRaConfig?.txPower ?? 0
|
||||
loRaConfig.usePreset = node?.loRaConfig?.usePreset ?? true
|
||||
loRaConfig.channelNum = UInt32(node?.loRaConfig?.channelNum ?? 0)
|
||||
channelSet.loraConfig = loRaConfig
|
||||
if node != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue