From ddad4d49ceefa958d14850c1a5456481d304b84f Mon Sep 17 00:00:00 2001 From: Garth Vander Houwen Date: Mon, 14 Aug 2023 14:41:26 -0700 Subject: [PATCH] Remove ESP32 range test restriction Clean up buttons Remove min app version field --- Meshtastic.xcodeproj/project.pbxproj | 8 ++++---- Meshtastic/Helpers/MeshPackets.swift | 2 -- Meshtastic/Views/Helpers/ConnectedDevice.swift | 11 ++++++++++- Meshtastic/Views/Settings/Config/DeviceConfig.swift | 4 ++-- Meshtastic/Views/Settings/Config/LoRaConfig.swift | 2 +- .../Views/Settings/Config/Module/MQTTConfig.swift | 4 ++-- .../Settings/Config/Module/RangeTestConfig.swift | 4 ++-- 7 files changed, 21 insertions(+), 14 deletions(-) diff --git a/Meshtastic.xcodeproj/project.pbxproj b/Meshtastic.xcodeproj/project.pbxproj index c8cf64cf..83833136 100644 --- a/Meshtastic.xcodeproj/project.pbxproj +++ b/Meshtastic.xcodeproj/project.pbxproj @@ -1323,12 +1323,12 @@ INFOPLIST_FILE = Meshtastic/Info.plist; INFOPLIST_KEY_CFBundleDisplayName = Meshtastic; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities"; - IPHONEOS_DEPLOYMENT_TARGET = 16.0; + IPHONEOS_DEPLOYMENT_TARGET = 16.1; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 2.2.0; + MARKETING_VERSION = 2.2.1; PRODUCT_BUNDLE_IDENTIFIER = gvh.MeshtasticClient; PRODUCT_NAME = "$(TARGET_NAME)"; SUPPORTS_MACCATALYST = YES; @@ -1357,12 +1357,12 @@ INFOPLIST_FILE = Meshtastic/Info.plist; INFOPLIST_KEY_CFBundleDisplayName = Meshtastic; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities"; - IPHONEOS_DEPLOYMENT_TARGET = 16.0; + IPHONEOS_DEPLOYMENT_TARGET = 16.1; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 2.2.0; + MARKETING_VERSION = 2.2.1; PRODUCT_BUNDLE_IDENTIFIER = gvh.MeshtasticClient; PRODUCT_NAME = "$(TARGET_NAME)"; SUPPORTS_MACCATALYST = YES; diff --git a/Meshtastic/Helpers/MeshPackets.swift b/Meshtastic/Helpers/MeshPackets.swift index d24e5bb0..382a4619 100644 --- a/Meshtastic/Helpers/MeshPackets.swift +++ b/Meshtastic/Helpers/MeshPackets.swift @@ -90,7 +90,6 @@ func myInfoPacket (myInfo: MyNodeInfo, peripheralId: String, context: NSManagedO myInfoEntity.peripheralId = peripheralId myInfoEntity.myNodeNum = Int64(myInfo.myNodeNum) myInfoEntity.rebootCount = Int32(myInfo.rebootCount) - myInfoEntity.minAppVersion = Int32(bitPattern: myInfo.minAppVersion) do { try context.save() print("💾 Saved a new myInfo for node number: \(String(myInfo.myNodeNum))") @@ -105,7 +104,6 @@ func myInfoPacket (myInfo: MyNodeInfo, peripheralId: String, context: NSManagedO fetchedMyInfo[0].peripheralId = peripheralId fetchedMyInfo[0].myNodeNum = Int64(myInfo.myNodeNum) fetchedMyInfo[0].rebootCount = Int32(myInfo.rebootCount) - fetchedMyInfo[0].minAppVersion = Int32(bitPattern: myInfo.minAppVersion) do { try context.save() diff --git a/Meshtastic/Views/Helpers/ConnectedDevice.swift b/Meshtastic/Views/Helpers/ConnectedDevice.swift index f3373654..3e331e5e 100644 --- a/Meshtastic/Views/Helpers/ConnectedDevice.swift +++ b/Meshtastic/Views/Helpers/ConnectedDevice.swift @@ -13,7 +13,16 @@ struct ConnectedDevice: View { var body: some View { HStack { - + Image(systemName: "iphone.gen3.radiowaves.left.and.right.circle.fill") + .imageScale(.large) + .foregroundColor(.green) + .symbolRenderingMode(.hierarchical) + + Image(systemName: "xmark.circle.fill") + .imageScale(.large) + .foregroundColor(.red) + .symbolRenderingMode(.hierarchical) + if bluetoothOn { if deviceConnected { Image(systemName: "antenna.radiowaves.left.and.right.circle.fill") diff --git a/Meshtastic/Views/Settings/Config/DeviceConfig.swift b/Meshtastic/Views/Settings/Config/DeviceConfig.swift index 55b6b423..6582a1a2 100644 --- a/Meshtastic/Views/Settings/Config/DeviceConfig.swift +++ b/Meshtastic/Views/Settings/Config/DeviceConfig.swift @@ -151,7 +151,7 @@ struct DeviceConfig: View { .buttonStyle(.bordered) .buttonBorderShape(.capsule) .controlSize(.large) - .padding() + .padding(.leading) .confirmationDialog( "are.you.sure", isPresented: $isPresentingNodeDBResetConfirm, @@ -174,7 +174,7 @@ struct DeviceConfig: View { .buttonStyle(.bordered) .buttonBorderShape(.capsule) .controlSize(.large) - .padding() + .padding(.trailing) .confirmationDialog( "All device and app data will be deleted. You will also need to forget your devices under Settings > Bluetooth.", isPresented: $isPresentingFactoryResetConfirm, diff --git a/Meshtastic/Views/Settings/Config/LoRaConfig.swift b/Meshtastic/Views/Settings/Config/LoRaConfig.swift index 7c6ff3b1..67c7ef57 100644 --- a/Meshtastic/Views/Settings/Config/LoRaConfig.swift +++ b/Meshtastic/Views/Settings/Config/LoRaConfig.swift @@ -144,7 +144,7 @@ struct LoRaConfig: View { } } .pickerStyle(DefaultPickerStyle()) - Text("Sets the maximum number of hops, default is 3. Increasing hops also increases air time utilization and should be used carefully.") + Text("Sets the maximum number of hops, default is 3. Increasing hops also increases congestion and should be used carefully.") .font(.caption) HStack { diff --git a/Meshtastic/Views/Settings/Config/Module/MQTTConfig.swift b/Meshtastic/Views/Settings/Config/Module/MQTTConfig.swift index e462f9a5..c7a9d562 100644 --- a/Meshtastic/Views/Settings/Config/Module/MQTTConfig.swift +++ b/Meshtastic/Views/Settings/Config/Module/MQTTConfig.swift @@ -65,6 +65,8 @@ struct MQTTConfig: View { Label("mqtt.clientproxy", systemImage: "iphone.radiowaves.left.and.right") } .toggleStyle(SwitchToggleStyle(tint: .accentColor)) + Text("If both MQTT and the client proxy are enabled your device will utalize an available network connection to connect to the specified MQTT server.") + .font(.caption2) Toggle(isOn: $encryptionEnabled) { @@ -82,8 +84,6 @@ struct MQTTConfig: View { Label("JSON Enabled", systemImage: "ellipsis.curlybraces") } .toggleStyle(SwitchToggleStyle(tint: .accentColor)) - Text("JSON mode is not reccomended it is incomplete and unstable.") - .font(.caption2) } Section(header: Text("Custom Server")) { HStack { diff --git a/Meshtastic/Views/Settings/Config/Module/RangeTestConfig.swift b/Meshtastic/Views/Settings/Config/Module/RangeTestConfig.swift index 50b475d7..5d89dedb 100644 --- a/Meshtastic/Views/Settings/Config/Module/RangeTestConfig.swift +++ b/Meshtastic/Views/Settings/Config/Module/RangeTestConfig.swift @@ -72,13 +72,13 @@ struct RangeTestConfig: View { .font(.caption) } } - .disabled(self.bleManager.connectedPeripheral == nil || node?.rangeTestConfig == nil || !(node != nil && node?.metadata?.hasWifi ?? false)) + .disabled(self.bleManager.connectedPeripheral == nil || node?.rangeTestConfig == nil) Button { isPresentingSaveConfirm = true } label: { Label("save", systemImage: "square.and.arrow.down") } - .disabled(bleManager.connectedPeripheral == nil || !hasChanges || !(node?.metadata?.hasWifi ?? false)) + .disabled(bleManager.connectedPeripheral == nil || !hasChanges) .buttonStyle(.bordered) .buttonBorderShape(.capsule) .controlSize(.large)