diff --git a/Meshtastic.xcodeproj/project.pbxproj b/Meshtastic.xcodeproj/project.pbxproj index a1e85937..f7cfa598 100644 --- a/Meshtastic.xcodeproj/project.pbxproj +++ b/Meshtastic.xcodeproj/project.pbxproj @@ -43,7 +43,7 @@ DD6193752862F6E600E59241 /* ExternalNotificationConfig.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD6193742862F6E600E59241 /* ExternalNotificationConfig.swift */; }; DD6193772862F90F00E59241 /* CannedMessagesConfig.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD6193762862F90F00E59241 /* CannedMessagesConfig.swift */; }; DD6193792863875F00E59241 /* SerialConfig.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD6193782863875F00E59241 /* SerialConfig.swift */; }; - DD6B85A828009258000ACD6B /* ShareChannel.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD6B85A728009258000ACD6B /* ShareChannel.swift */; }; + DD6B85A828009258000ACD6B /* ShareChannels.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD6B85A728009258000ACD6B /* ShareChannels.swift */; }; DD73FD1128750779000852D6 /* PositionLog.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD73FD1028750779000852D6 /* PositionLog.swift */; }; DD769E0328D18BF1001A3F05 /* DeviceMetricsLog.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD769E0228D18BF0001A3F05 /* DeviceMetricsLog.swift */; }; DD8169F9271F1A6100F4AB02 /* MeshLogger.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD8169F8271F1A6100F4AB02 /* MeshLogger.swift */; }; @@ -157,7 +157,7 @@ DD6193742862F6E600E59241 /* ExternalNotificationConfig.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExternalNotificationConfig.swift; sourceTree = ""; }; DD6193762862F90F00E59241 /* CannedMessagesConfig.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CannedMessagesConfig.swift; sourceTree = ""; }; DD6193782863875F00E59241 /* SerialConfig.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SerialConfig.swift; sourceTree = ""; }; - DD6B85A728009258000ACD6B /* ShareChannel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShareChannel.swift; sourceTree = ""; }; + DD6B85A728009258000ACD6B /* ShareChannels.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShareChannels.swift; sourceTree = ""; }; DD73FD1028750779000852D6 /* PositionLog.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PositionLog.swift; sourceTree = ""; }; DD769E0228D18BF0001A3F05 /* DeviceMetricsLog.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DeviceMetricsLog.swift; sourceTree = ""; }; DD769E0428D24E32001A3F05 /* MeshtasticDataModel v 12.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = "MeshtasticDataModel v 12.xcdatamodel"; sourceTree = ""; }; @@ -306,7 +306,7 @@ DD3501882852FC3B000FC853 /* Settings.swift */, DD4A911D2708C65400501B7E /* AppSettings.swift */, DD8169FA271F1F3A00F4AB02 /* MeshLog.swift */, - DD6B85A728009258000ACD6B /* ShareChannel.swift */, + DD6B85A728009258000ACD6B /* ShareChannels.swift */, DD86D40B287F401000BAEB7A /* SaveChannelQRCode.swift */, DDCE4E2B2869F92900BE9F8F /* UserConfig.swift */, DD0F791A28713C8A00A6FDAD /* AdminMessageList.swift */, @@ -717,7 +717,7 @@ DD4C158C2824A91E0032668E /* module_config.pb.swift in Sources */, DDB6ABE828B141AF00384BA1 /* WiFiModes.swift in Sources */, DD4F23CD28779A3C001D37CB /* EnvironmentMetricsLog.swift in Sources */, - DD6B85A828009258000ACD6B /* ShareChannel.swift in Sources */, + DD6B85A828009258000ACD6B /* ShareChannels.swift in Sources */, DDB6ABD628AE742000384BA1 /* BluetoothConfig.swift in Sources */, DD769E0328D18BF1001A3F05 /* DeviceMetricsLog.swift in Sources */, DDAF8C5326EB1DF10058C060 /* BLEManager.swift in Sources */, diff --git a/Meshtastic/Assets.xcassets/AppIcon.appiconset/1024.png b/Meshtastic/Assets.xcassets/AppIcon.appiconset/1024.png deleted file mode 100644 index 403f4f2f..00000000 Binary files a/Meshtastic/Assets.xcassets/AppIcon.appiconset/1024.png and /dev/null differ diff --git a/Meshtastic/Assets.xcassets/AppIcon.appiconset/120-1.png b/Meshtastic/Assets.xcassets/AppIcon.appiconset/120-1.png deleted file mode 100644 index 6e571624..00000000 Binary files a/Meshtastic/Assets.xcassets/AppIcon.appiconset/120-1.png and /dev/null differ diff --git a/Meshtastic/Assets.xcassets/AppIcon.appiconset/120.png b/Meshtastic/Assets.xcassets/AppIcon.appiconset/120.png deleted file mode 100644 index 6e571624..00000000 Binary files a/Meshtastic/Assets.xcassets/AppIcon.appiconset/120.png and /dev/null differ diff --git a/Meshtastic/Assets.xcassets/AppIcon.appiconset/152.png b/Meshtastic/Assets.xcassets/AppIcon.appiconset/152.png deleted file mode 100644 index a930e23a..00000000 Binary files a/Meshtastic/Assets.xcassets/AppIcon.appiconset/152.png and /dev/null differ diff --git a/Meshtastic/Assets.xcassets/AppIcon.appiconset/167.png b/Meshtastic/Assets.xcassets/AppIcon.appiconset/167.png deleted file mode 100644 index 35658530..00000000 Binary files a/Meshtastic/Assets.xcassets/AppIcon.appiconset/167.png and /dev/null differ diff --git a/Meshtastic/Assets.xcassets/AppIcon.appiconset/180.png b/Meshtastic/Assets.xcassets/AppIcon.appiconset/180.png deleted file mode 100644 index fff06a76..00000000 Binary files a/Meshtastic/Assets.xcassets/AppIcon.appiconset/180.png and /dev/null differ diff --git a/Meshtastic/Assets.xcassets/AppIcon.appiconset/20.png b/Meshtastic/Assets.xcassets/AppIcon.appiconset/20.png deleted file mode 100644 index 988c8ade..00000000 Binary files a/Meshtastic/Assets.xcassets/AppIcon.appiconset/20.png and /dev/null differ diff --git a/Meshtastic/Assets.xcassets/AppIcon.appiconset/29.png b/Meshtastic/Assets.xcassets/AppIcon.appiconset/29.png deleted file mode 100644 index 553bb7a3..00000000 Binary files a/Meshtastic/Assets.xcassets/AppIcon.appiconset/29.png and /dev/null differ diff --git a/Meshtastic/Assets.xcassets/AppIcon.appiconset/40-1.png b/Meshtastic/Assets.xcassets/AppIcon.appiconset/40-1.png deleted file mode 100644 index e78f4105..00000000 Binary files a/Meshtastic/Assets.xcassets/AppIcon.appiconset/40-1.png and /dev/null differ diff --git a/Meshtastic/Assets.xcassets/AppIcon.appiconset/40-2.png b/Meshtastic/Assets.xcassets/AppIcon.appiconset/40-2.png deleted file mode 100644 index e78f4105..00000000 Binary files a/Meshtastic/Assets.xcassets/AppIcon.appiconset/40-2.png and /dev/null differ diff --git a/Meshtastic/Assets.xcassets/AppIcon.appiconset/40.png b/Meshtastic/Assets.xcassets/AppIcon.appiconset/40.png deleted file mode 100644 index e78f4105..00000000 Binary files a/Meshtastic/Assets.xcassets/AppIcon.appiconset/40.png and /dev/null differ diff --git a/Meshtastic/Assets.xcassets/AppIcon.appiconset/58-1.png b/Meshtastic/Assets.xcassets/AppIcon.appiconset/58-1.png deleted file mode 100644 index ea3829e7..00000000 Binary files a/Meshtastic/Assets.xcassets/AppIcon.appiconset/58-1.png and /dev/null differ diff --git a/Meshtastic/Assets.xcassets/AppIcon.appiconset/58.png b/Meshtastic/Assets.xcassets/AppIcon.appiconset/58.png deleted file mode 100644 index ea3829e7..00000000 Binary files a/Meshtastic/Assets.xcassets/AppIcon.appiconset/58.png and /dev/null differ diff --git a/Meshtastic/Assets.xcassets/AppIcon.appiconset/60.png b/Meshtastic/Assets.xcassets/AppIcon.appiconset/60.png deleted file mode 100644 index f384f426..00000000 Binary files a/Meshtastic/Assets.xcassets/AppIcon.appiconset/60.png and /dev/null differ diff --git a/Meshtastic/Assets.xcassets/AppIcon.appiconset/76.png b/Meshtastic/Assets.xcassets/AppIcon.appiconset/76.png deleted file mode 100644 index bd7db1b2..00000000 Binary files a/Meshtastic/Assets.xcassets/AppIcon.appiconset/76.png and /dev/null differ diff --git a/Meshtastic/Assets.xcassets/AppIcon.appiconset/80-1.png b/Meshtastic/Assets.xcassets/AppIcon.appiconset/80-1.png deleted file mode 100644 index ed42f91e..00000000 Binary files a/Meshtastic/Assets.xcassets/AppIcon.appiconset/80-1.png and /dev/null differ diff --git a/Meshtastic/Assets.xcassets/AppIcon.appiconset/80.png b/Meshtastic/Assets.xcassets/AppIcon.appiconset/80.png deleted file mode 100644 index ed42f91e..00000000 Binary files a/Meshtastic/Assets.xcassets/AppIcon.appiconset/80.png and /dev/null differ diff --git a/Meshtastic/Assets.xcassets/AppIcon.appiconset/87.png b/Meshtastic/Assets.xcassets/AppIcon.appiconset/87.png deleted file mode 100644 index a3720d5a..00000000 Binary files a/Meshtastic/Assets.xcassets/AppIcon.appiconset/87.png and /dev/null differ diff --git a/Meshtastic/Assets.xcassets/AppIcon.appiconset/Contents.json b/Meshtastic/Assets.xcassets/AppIcon.appiconset/Contents.json index 1cd4ae9f..937092d6 100644 --- a/Meshtastic/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/Meshtastic/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -1,111 +1,9 @@ { "images" : [ { - "filename" : "40-2.png", - "idiom" : "iphone", - "scale" : "2x", - "size" : "20x20" - }, - { - "filename" : "60.png", - "idiom" : "iphone", - "scale" : "3x", - "size" : "20x20" - }, - { - "filename" : "58.png", - "idiom" : "iphone", - "scale" : "2x", - "size" : "29x29" - }, - { - "filename" : "87.png", - "idiom" : "iphone", - "scale" : "3x", - "size" : "29x29" - }, - { - "filename" : "80.png", - "idiom" : "iphone", - "scale" : "2x", - "size" : "40x40" - }, - { - "filename" : "120-1.png", - "idiom" : "iphone", - "scale" : "3x", - "size" : "40x40" - }, - { - "filename" : "120.png", - "idiom" : "iphone", - "scale" : "2x", - "size" : "60x60" - }, - { - "filename" : "180.png", - "idiom" : "iphone", - "scale" : "3x", - "size" : "60x60" - }, - { - "filename" : "20.png", - "idiom" : "ipad", - "scale" : "1x", - "size" : "20x20" - }, - { - "filename" : "40-1.png", - "idiom" : "ipad", - "scale" : "2x", - "size" : "20x20" - }, - { - "filename" : "29.png", - "idiom" : "ipad", - "scale" : "1x", - "size" : "29x29" - }, - { - "filename" : "58-1.png", - "idiom" : "ipad", - "scale" : "2x", - "size" : "29x29" - }, - { - "filename" : "40.png", - "idiom" : "ipad", - "scale" : "1x", - "size" : "40x40" - }, - { - "filename" : "80-1.png", - "idiom" : "ipad", - "scale" : "2x", - "size" : "40x40" - }, - { - "filename" : "76.png", - "idiom" : "ipad", - "scale" : "1x", - "size" : "76x76" - }, - { - "filename" : "152.png", - "idiom" : "ipad", - "scale" : "2x", - "size" : "76x76" - }, - { - "filename" : "167.png", - "idiom" : "ipad", - "scale" : "2x", - "size" : "83.5x83.5" - }, - { - "filename" : "1024.png", - "idiom" : "ios-marketing", - "scale" : "1x", + "filename" : "logo-3.png", + "idiom" : "universal", + "platform" : "ios", "size" : "1024x1024" } ], diff --git a/Meshtastic/Assets.xcassets/AppIcon.appiconset/logo-3.png b/Meshtastic/Assets.xcassets/AppIcon.appiconset/logo-3.png new file mode 100644 index 00000000..4e2504d4 Binary files /dev/null and b/Meshtastic/Assets.xcassets/AppIcon.appiconset/logo-3.png differ diff --git a/Meshtastic/Helpers/BLEManager.swift b/Meshtastic/Helpers/BLEManager.swift index c7109a56..65c05f49 100644 --- a/Meshtastic/Helpers/BLEManager.swift +++ b/Meshtastic/Helpers/BLEManager.swift @@ -642,7 +642,18 @@ class BLEManager: NSObject, ObservableObject, CBCentralManagerDelegate, CBPeriph peripherals.removeAll(where: { $0.peripheral.state == CBPeripheralState.disconnected }) // Config conplete returns so we don't read the characteristic again - self.getChannel(channelIndex: 0, wantResponse: true) + // Get all the channels + var i: UInt32 = 0; + while i < 8 { + // this should actually loop over MyNodeInfo.maxChannels to get all channels + //let timer = Timer.scheduledTimer(withTimeInterval: 2.0, repeats: false) { (timer) in + print("requesting channel",i) + let resp = self.getChannel(channelIndex: i, wantResponse: true) + i+=1; + DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + .seconds(3)) {} + //} + + } diff --git a/Meshtastic/Helpers/MeshPackets.swift b/Meshtastic/Helpers/MeshPackets.swift index abf5baf4..6c84a589 100644 --- a/Meshtastic/Helpers/MeshPackets.swift +++ b/Meshtastic/Helpers/MeshPackets.swift @@ -1077,8 +1077,10 @@ func adminAppPacket (packet: MeshPacket, meshLogging: Bool, context: NSManagedOb } else if let channel = try? Channel(serializedData: packet.decoded.payload) { print(try! channel.jsonUTF8Data()) print("channel settings:", channel.settings) + } else if let channel = try? ChannelSettings(serializedData: packet.decoded.payload) { + print(try! channel.jsonUTF8Data()) + print("channel settings:", channel) } - if meshLogging { MeshLogger.log("ℹ️ MESH PACKET received for Admin App UNHANDLED \(try! packet.jsonString())") } diff --git a/Meshtastic/Views/Settings/Config/Module/CannedMessagesConfig.swift b/Meshtastic/Views/Settings/Config/Module/CannedMessagesConfig.swift index 02ca60df..b4b07dde 100644 --- a/Meshtastic/Views/Settings/Config/Module/CannedMessagesConfig.swift +++ b/Meshtastic/Views/Settings/Config/Module/CannedMessagesConfig.swift @@ -205,6 +205,7 @@ struct CannedMessagesConfig: View { } .disabled(configPreset > 0) } + .scrollDismissesKeyboard(.immediately) .disabled(bleManager.connectedPeripheral == nil) Button { diff --git a/Meshtastic/Views/Settings/Config/Module/MQTTConfig.swift b/Meshtastic/Views/Settings/Config/Module/MQTTConfig.swift index 16c905ff..205bb957 100644 --- a/Meshtastic/Views/Settings/Config/Module/MQTTConfig.swift +++ b/Meshtastic/Views/Settings/Config/Module/MQTTConfig.swift @@ -80,8 +80,9 @@ struct MQTTConfig: View { hasChanges = true }) .foregroundColor(.gray) + .keyboardType(.default) } - .keyboardType(.default) + .autocorrectionDisabled() HStack { Label("Username", systemImage: "person.text.rectangle") @@ -109,6 +110,7 @@ struct MQTTConfig: View { .foregroundColor(.gray) } .keyboardType(.default) + .scrollDismissesKeyboard(.interactively) HStack { @@ -137,8 +139,10 @@ struct MQTTConfig: View { .foregroundColor(.gray) } .keyboardType(.default) + .scrollDismissesKeyboard(.interactively) } } + .scrollDismissesKeyboard(.interactively) .disabled(!(node != nil && node!.myInfo?.hasWifi ?? false)) Button { diff --git a/Meshtastic/Views/Settings/Config/Module/TelemetryConfig.swift b/Meshtastic/Views/Settings/Config/Module/TelemetryConfig.swift index 70ac4680..f593e068 100644 --- a/Meshtastic/Views/Settings/Config/Module/TelemetryConfig.swift +++ b/Meshtastic/Views/Settings/Config/Module/TelemetryConfig.swift @@ -112,7 +112,7 @@ struct TelemetryConfig: View { Section(header: Text("Sensor Options")) { - Text("I2C Connected sensors will be detected automatically. Supported sensors are BMP280, BME280, BME680, MCP9808, INA219 and INA260.") + Text("Supported I2C Connected sensors will be detected automatically, sensors are BMP280, BME280, BME680, MCP9808, INA219 and INA260.") .font(.caption) Toggle(isOn: $environmentMeasurementEnabled) { diff --git a/Meshtastic/Views/Settings/Config/NetworkConfig.swift b/Meshtastic/Views/Settings/Config/NetworkConfig.swift index db25c040..3000d0ff 100644 --- a/Meshtastic/Views/Settings/Config/NetworkConfig.swift +++ b/Meshtastic/Views/Settings/Config/NetworkConfig.swift @@ -103,6 +103,7 @@ struct NetworkConfig: View { .keyboardType(.default) } } + .scrollDismissesKeyboard(.interactively) .disabled(!(node != nil && node!.myInfo?.hasWifi ?? false)) Button { diff --git a/Meshtastic/Views/Settings/Settings.swift b/Meshtastic/Views/Settings/Settings.swift index d0eb1e05..b998e532 100644 --- a/Meshtastic/Views/Settings/Settings.swift +++ b/Meshtastic/Views/Settings/Settings.swift @@ -38,11 +38,11 @@ struct Settings: View { Section("Radio Configuration") { NavigationLink { - ShareChannel(node: nodes.first(where: { $0.num == connectedNodeNum })) + ShareChannels(node: nodes.first(where: { $0.num == connectedNodeNum })) } label: { Image(systemName: "qrcode") .symbolRenderingMode(.hierarchical) - Text("Share Channel QR Code") + Text("Share Channels QR Code") } .disabled(bleManager.connectedPeripheral == nil) diff --git a/Meshtastic/Views/Settings/ShareChannel.swift b/Meshtastic/Views/Settings/ShareChannels.swift similarity index 88% rename from Meshtastic/Views/Settings/ShareChannel.swift rename to Meshtastic/Views/Settings/ShareChannels.swift index 04ab6842..ae221d22 100644 --- a/Meshtastic/Views/Settings/ShareChannel.swift +++ b/Meshtastic/Views/Settings/ShareChannels.swift @@ -31,7 +31,7 @@ struct QrCodeImage { } } -struct ShareChannel: View { +struct ShareChannels: View { @Environment(\.managedObjectContext) var context @EnvironmentObject var bleManager: BLEManager @@ -73,10 +73,11 @@ struct ShareChannel: View { ShareLink( item: text, preview: SharePreview( - "Meshtastic Channel Settings Link", + "Meshtastic Channel Settings From Node \(node?.user?.shortName ?? "????")", image: Image(systemName: "qrcode") ) ) + .presentationDetents([.large, .large]) .font(.title3) } @@ -107,13 +108,6 @@ struct ShareChannel: View { .onAppear { self.bleManager.context = context - 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; -// } } }