mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
Stop a couple of mesh log items from crashing
This commit is contained in:
parent
12fdddd565
commit
4467c7ab9e
2 changed files with 2 additions and 4 deletions
|
|
@ -357,8 +357,7 @@ class BLEManager: NSObject, CBPeripheralDelegate, ObservableObject {
|
|||
} else {
|
||||
|
||||
let nodeName = connectedPeripheral!.peripheral.name ?? NSLocalizedString("unknown", comment: NSLocalizedString("unknown", comment: "Unknown"))
|
||||
let logString = String.localizedStringWithFormat(NSLocalizedString("mesh.log.wantconfig %@",
|
||||
comment: "Issuing Want Config to %@"), nodeName)
|
||||
let logString = String.localizedStringWithFormat(NSLocalizedString("mesh.log.wantconfig %@", comment: "Issuing Want Config to %@"), nodeName)
|
||||
MeshLogger.log("🛎️ \(logString)")
|
||||
//BLE Characteristics discovered, issue wantConfig
|
||||
var toRadio: ToRadio = ToRadio()
|
||||
|
|
@ -1029,7 +1028,7 @@ class BLEManager: NSObject, CBPeripheralDelegate, ObservableObject {
|
|||
let binaryData: Data = try! toRadio.serializedData()
|
||||
if connectedPeripheral!.peripheral.state == CBPeripheralState.connected {
|
||||
self.connectedPeripheral.peripheral.writeValue(binaryData, for: self.TORADIO_characteristic, type: .withResponse)
|
||||
let logString = String.localizedStringWithFormat(NSLocalizedString("mesh.log.channel.sent %d", comment: "Sent a Channel for: %d Channel Index %d"), connectedPeripheral.num, chan.index)
|
||||
let logString = String.localizedStringWithFormat(NSLocalizedString("mesh.log.channel.sent %@ %d", comment: "Sent a Channel for: %@ Channel Index %d"), String(connectedPeripheral.num), chan.index)
|
||||
MeshLogger.log("🎛️ \(logString)")
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -913,7 +913,6 @@ func nodeInfoPacket (nodeInfo: NodeInfo, channel: UInt32, context: NSManagedObje
|
|||
do {
|
||||
try context.save()
|
||||
print("💾 NodeInfo saved for \(nodeInfo.num)")
|
||||
|
||||
return fetchedNode[0]
|
||||
} catch {
|
||||
context.rollback()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue