diff --git a/Meshtastic.xcodeproj/project.pbxproj b/Meshtastic.xcodeproj/project.pbxproj index f2871112..068225ef 100644 --- a/Meshtastic.xcodeproj/project.pbxproj +++ b/Meshtastic.xcodeproj/project.pbxproj @@ -180,6 +180,7 @@ DD90860D26F69BAE00DC5189 /* NodeMap.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NodeMap.swift; sourceTree = ""; }; DD913638270DFF4C00D7ACF3 /* LocalNotificationManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocalNotificationManager.swift; sourceTree = ""; }; DD9D8F2E2764403B00080993 /* CoreDataSample.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = CoreDataSample.xcdatamodel; sourceTree = ""; }; + DDA1C48528D77310009933EC /* MeshtasticDataModel v 12.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = "MeshtasticDataModel v 12.xcdatamodel"; sourceTree = ""; }; DDA6B2E828419CF2003E8C16 /* MeshPackets.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MeshPackets.swift; sourceTree = ""; }; DDA6B2EA28420A7B003E8C16 /* NodeAnnotation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NodeAnnotation.swift; sourceTree = ""; }; DDAF8C5226EB1DF10058C060 /* BLEManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BLEManager.swift; sourceTree = ""; }; @@ -1168,6 +1169,7 @@ DD9D8F2D2764403B00080993 /* Meshtastic.xcdatamodeld */ = { isa = XCVersionGroup; children = ( + DDA1C48528D77310009933EC /* MeshtasticDataModel v 12.xcdatamodel */, DD1925B528CD591B00720036 /* MeshtasticDataModel v 11.xcdatamodel */, DD2160AD28C5536B00C17253 /* MeshtasticDataModel v 10.xcdatamodel */, DD5929A528C0F292003DB21D /* MeshtasticDataModel v 9.xcdatamodel */, @@ -1180,7 +1182,7 @@ DD45C77427BD4EF80011784F /* MeshtasticDataModel v2.xcdatamodel */, DD9D8F2E2764403B00080993 /* CoreDataSample.xcdatamodel */, ); - currentVersion = DD1925B528CD591B00720036 /* MeshtasticDataModel v 11.xcdatamodel */; + currentVersion = DDA1C48528D77310009933EC /* MeshtasticDataModel v 12.xcdatamodel */; name = Meshtastic.xcdatamodeld; path = Meshtastic/Meshtastic.xcdatamodeld; sourceTree = ""; diff --git a/Meshtastic/Helpers/MeshPackets.swift b/Meshtastic/Helpers/MeshPackets.swift index 09401138..1c290ba8 100644 --- a/Meshtastic/Helpers/MeshPackets.swift +++ b/Meshtastic/Helpers/MeshPackets.swift @@ -197,6 +197,13 @@ func localConfig (config: Config, meshlogging: Bool, context:NSManagedObjectCont newLoRaConfig.modemPreset = Int32(config.lora.modemPreset.rawValue) newLoRaConfig.hopLimit = Int32(config.lora.hopLimit) newLoRaConfig.txPower = Int32(config.lora.txPower) + newLoRaConfig.txEnabled = config.lora.txEnabled + newLoRaConfig.usePreset = config.lora.usePreset + newLoRaConfig.bandwidth = Int32(config.lora.bandwidth) + newLoRaConfig.spreadFactor = Int32(config.lora.spreadFactor) + newLoRaConfig.codingRate = Int32(config.lora.codingRate) + newLoRaConfig.spreadFactor = Int32(config.lora.spreadFactor) + newLoRaConfig.frequencyOffset = Int32(config.lora.frequencyOffset) fetchedNode[0].loRaConfig = newLoRaConfig @@ -206,6 +213,13 @@ func localConfig (config: Config, meshlogging: Bool, context:NSManagedObjectCont fetchedNode[0].loRaConfig?.modemPreset = Int32(config.lora.modemPreset.rawValue) fetchedNode[0].loRaConfig?.hopLimit = Int32(config.lora.hopLimit) fetchedNode[0].loRaConfig?.txPower = Int32(config.lora.txPower) + fetchedNode[0].loRaConfig?.txEnabled = config.lora.txEnabled + fetchedNode[0].loRaConfig?.usePreset = config.lora.usePreset + fetchedNode[0].loRaConfig?.bandwidth = Int32(config.lora.bandwidth) + fetchedNode[0].loRaConfig?.spreadFactor = Int32(config.lora.spreadFactor) + fetchedNode[0].loRaConfig?.codingRate = Int32(config.lora.codingRate) + fetchedNode[0].loRaConfig?.spreadFactor = Int32(config.lora.spreadFactor) + fetchedNode[0].loRaConfig?.frequencyOffset = Int32(config.lora.frequencyOffset) } do { diff --git a/Meshtastic/Meshtastic.xcdatamodeld/.xccurrentversion b/Meshtastic/Meshtastic.xcdatamodeld/.xccurrentversion index 0d87f123..8c5ea2ac 100644 --- a/Meshtastic/Meshtastic.xcdatamodeld/.xccurrentversion +++ b/Meshtastic/Meshtastic.xcdatamodeld/.xccurrentversion @@ -3,6 +3,6 @@ _XCCurrentVersionName - MeshtasticDataModel v 11.xcdatamodel + MeshtasticDataModel v 12.xcdatamodel diff --git a/Meshtastic/Meshtastic.xcdatamodeld/MeshtasticDataModel v 12.xcdatamodel/contents b/Meshtastic/Meshtastic.xcdatamodeld/MeshtasticDataModel v 12.xcdatamodel/contents new file mode 100644 index 00000000..225e9842 --- /dev/null +++ b/Meshtastic/Meshtastic.xcdatamodeld/MeshtasticDataModel v 12.xcdatamodel/contents @@ -0,0 +1,219 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Meshtastic/Views/Settings/Config/LoRaConfig.swift b/Meshtastic/Views/Settings/Config/LoRaConfig.swift index e660a94b..2ea1f756 100644 --- a/Meshtastic/Views/Settings/Config/LoRaConfig.swift +++ b/Meshtastic/Views/Settings/Config/LoRaConfig.swift @@ -22,6 +22,8 @@ struct LoRaConfig: View { @State var modemPreset = 0 @State var hopLimit = 0 @State var txPower = 0 + @State var txEnabled = true + @State var usePreset = true var body: some View { @@ -120,8 +122,11 @@ struct LoRaConfig: View { self.hopLimit = Int(node!.loRaConfig?.hopLimit ?? 0) self.region = Int(node!.loRaConfig?.regionCode ?? 0) + self.usePreset = node!.loRaConfig?.usePreset ?? true self.modemPreset = Int(node!.loRaConfig?.modemPreset ?? 0) + self.txEnabled = node!.loRaConfig?.txEnabled ?? true self.txPower = Int(node!.loRaConfig?.txPower ?? 0) + self.hasChanges = false self.initialLoad = false }