diff --git a/Meshtastic/Helpers/BLEManager.swift b/Meshtastic/Helpers/BLEManager.swift index a37697c6..313b154e 100644 --- a/Meshtastic/Helpers/BLEManager.swift +++ b/Meshtastic/Helpers/BLEManager.swift @@ -448,11 +448,8 @@ class BLEManager: NSObject, ObservableObject, CBCentralManagerDelegate, CBPeriph decodedInfo = try FromRadio(serializedData: characteristic.value!) } catch { - print(characteristic.value!) } - print("Incoming packet with portnum", decodedInfo.packet.decoded.portnum) - print("decodedInfo.packet.decoded", decodedInfo.packet.decoded) switch decodedInfo.packet.decoded.portnum { @@ -468,7 +465,6 @@ class BLEManager: NSObject, ObservableObject, CBCentralManagerDelegate, CBPeriph let myInfo = myInfoPacket(myInfo: decodedInfo.myInfo, meshLogging: meshLoggingEnabled, context: context!) if myInfo != nil { - print("my info packet", decodedInfo.myInfo) self.connectedPeripheral.bitrate = myInfo!.bitrate self.connectedPeripheral.num = myInfo!.myNodeNum lastConnnectionVersion = myInfo?.firmwareVersion ?? myInfo!.firmwareVersion ?? "Unknown" @@ -1188,6 +1184,7 @@ class BLEManager: NSObject, ObservableObject, CBCentralManagerDelegate, CBPeriph var dataMessage = DataMessage() dataMessage.payload = try! adminPacket.serializedData() dataMessage.portnum = PortNum.adminApp + dataMessage.wantResponse = true meshPacket.decoded = dataMessage diff --git a/Meshtastic/Helpers/MeshPackets.swift b/Meshtastic/Helpers/MeshPackets.swift index 370cd226..ba7555b9 100644 --- a/Meshtastic/Helpers/MeshPackets.swift +++ b/Meshtastic/Helpers/MeshPackets.swift @@ -1133,6 +1133,9 @@ func adminAppPacket (packet: MeshPacket, meshLogging: Bool, context: NSManagedOb print(try! powerConfig.jsonUTF8Data()) print(powerConfig.meshSdsTimeoutSecs) + } else if let channel = try? Channel(serializedData: packet.decoded.payload) { + print(try! channel.jsonUTF8Data()) + print("channel settings:", channel.settings) } if meshLogging { MeshLogger.log("ℹ️ MESH PACKET received for Admin App UNHANDLED \(try! packet.jsonString())") } diff --git a/Meshtastic/Views/Settings/ShareChannel.swift b/Meshtastic/Views/Settings/ShareChannel.swift index 614ea480..17a78be2 100644 --- a/Meshtastic/Views/Settings/ShareChannel.swift +++ b/Meshtastic/Views/Settings/ShareChannel.swift @@ -86,13 +86,13 @@ struct ShareChannel: View { .onAppear { self.bleManager.context = context - var i: UInt32 = 1; - while i < 9 { + let i: UInt32 = 1; +// while i < 9 { // this should actually loop over MyNodeInfo.maxChannels to get all channels print("requesting channel",i) let resp = self.bleManager.getChannel(channelIndex: i, wantResponse: true) print("resp from getChannel", resp) - i+=1; - } +// i+=1; +// } } }