Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.5.0 #928

Merged
merged 3 commits into from
Sep 12, 2024
Merged

2.5.0 #928

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -5068,9 +5068,6 @@
},
"Debug" : {

},
"Debug Log" : {

},
"Debug Logs" : {

Expand Down Expand Up @@ -15914,6 +15911,9 @@
},
"OK" : {

},
"Ok to MQTT" : {

},
"OLED Type" : {

Expand Down
4 changes: 3 additions & 1 deletion Meshtastic.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,7 @@
DD77093C2AA1AFA3007A8BF0 /* ChannelTips.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChannelTips.swift; sourceTree = "<group>"; };
DD77093E2AA1B146007A8BF0 /* UIColor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIColor.swift; sourceTree = "<group>"; };
DD798B062915928D005217CD /* ChannelMessageList.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChannelMessageList.swift; sourceTree = "<group>"; };
DD7CF8DA2C93663C008BD10E /* MeshtasticDataModelV 44.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = "MeshtasticDataModelV 44.xcdatamodel"; sourceTree = "<group>"; };
DD7E235F2C7AA3E50078ACDF /* MeshtasticDataModelV 43.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = "MeshtasticDataModelV 43.xcdatamodel"; sourceTree = "<group>"; };
DD8169F8271F1A6100F4AB02 /* MeshLogger.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MeshLogger.swift; sourceTree = "<group>"; };
DD8169FA271F1F3A00F4AB02 /* MeshLog.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MeshLog.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1898,6 +1899,7 @@
DD3CC6BA28E366DF00FA9159 /* Meshtastic.xcdatamodeld */ = {
isa = XCVersionGroup;
children = (
DD7CF8DA2C93663C008BD10E /* MeshtasticDataModelV 44.xcdatamodel */,
DD7E235F2C7AA3E50078ACDF /* MeshtasticDataModelV 43.xcdatamodel */,
DD1BD0F12C61D3AD008C0C70 /* MeshtasticDataModelV 42.xcdatamodel */,
DD2984A82C5AEF7500B1268D /* MeshtasticDataModelV 41.xcdatamodel */,
Expand Down Expand Up @@ -1942,7 +1944,7 @@
DD5D0A9A2931AD6B00F7EA61 /* MeshtasticDataModelV2.xcdatamodel */,
DD3CC6BB28E366DF00FA9159 /* MeshtasticDataModel.xcdatamodel */,
);
currentVersion = DD7E235F2C7AA3E50078ACDF /* MeshtasticDataModelV 43.xcdatamodel */;
currentVersion = DD7CF8DA2C93663C008BD10E /* MeshtasticDataModelV 44.xcdatamodel */;
name = Meshtastic.xcdatamodeld;
path = Meshtastic/Meshtastic.xcdatamodeld;
sourceTree = "<group>";
Expand Down
2 changes: 1 addition & 1 deletion Meshtastic/Meshtastic.xcdatamodeld/.xccurrentversion
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
<plist version="1.0">
<dict>
<key>_XCCurrentVersionName</key>
<string>MeshtasticDataModelV 43.xcdatamodel</string>
<string>MeshtasticDataModelV 44.xcdatamodel</string>
</dict>
</plist>

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions Meshtastic/Persistence/UpdateCoreData.swift
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,6 @@ func upsertDeviceConfigPacket(config: Config.DeviceConfig, nodeNum: Int64, sessi
let newDeviceConfig = DeviceConfigEntity(context: context)
newDeviceConfig.role = Int32(config.role.rawValue)
newDeviceConfig.serialEnabled = config.serialEnabled
newDeviceConfig.debugLogEnabled = config.debugLogEnabled
newDeviceConfig.buttonGpio = Int32(config.buttonGpio)
newDeviceConfig.buzzerGpio = Int32(config.buzzerGpio)
newDeviceConfig.rebroadcastMode = Int32(config.rebroadcastMode.rawValue)
Expand All @@ -476,7 +475,6 @@ func upsertDeviceConfigPacket(config: Config.DeviceConfig, nodeNum: Int64, sessi
} else {
fetchedNode[0].deviceConfig?.role = Int32(config.role.rawValue)
fetchedNode[0].deviceConfig?.serialEnabled = config.serialEnabled
fetchedNode[0].deviceConfig?.debugLogEnabled = config.debugLogEnabled
fetchedNode[0].deviceConfig?.buttonGpio = Int32(config.buttonGpio)
fetchedNode[0].deviceConfig?.buzzerGpio = Int32(config.buzzerGpio)
fetchedNode[0].deviceConfig?.rebroadcastMode = Int32(config.rebroadcastMode.rawValue)
Expand Down Expand Up @@ -818,21 +816,23 @@ func upsertSecurityConfigPacket(config: Config.SecurityConfig, nodeNum: Int64, s
let newSecurityConfig = SecurityConfigEntity(context: context)
newSecurityConfig.publicKey = config.publicKey
newSecurityConfig.privateKey = config.privateKey
newSecurityConfig.adminKey = config.adminKey
if config.adminKey.count > 0 {
newSecurityConfig.adminKey = config.adminKey[0]
}
newSecurityConfig.isManaged = config.isManaged
newSecurityConfig.serialEnabled = config.serialEnabled
newSecurityConfig.debugLogApiEnabled = config.debugLogApiEnabled
newSecurityConfig.bluetoothLoggingEnabled = config.bluetoothLoggingEnabled
newSecurityConfig.adminChannelEnabled = config.adminChannelEnabled
fetchedNode[0].securityConfig = newSecurityConfig
} else {
fetchedNode[0].securityConfig?.publicKey = config.publicKey
fetchedNode[0].securityConfig?.privateKey = config.privateKey
fetchedNode[0].securityConfig?.adminKey = config.adminKey
if config.adminKey.count > 0 {
fetchedNode[0].securityConfig?.adminKey = config.adminKey[0]
}
fetchedNode[0].securityConfig?.isManaged = config.isManaged
fetchedNode[0].securityConfig?.serialEnabled = config.serialEnabled
fetchedNode[0].securityConfig?.debugLogApiEnabled = config.debugLogApiEnabled
fetchedNode[0].securityConfig?.bluetoothLoggingEnabled = config.bluetoothLoggingEnabled
fetchedNode[0].securityConfig?.adminChannelEnabled = config.adminChannelEnabled
}
if sessionPasskey?.count != 0 {
Expand Down
10 changes: 0 additions & 10 deletions Meshtastic/Views/Settings/Config/DeviceConfig.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ struct DeviceConfig: View {
@State var buzzerGPIO = 0
@State var buttonGPIO = 0
@State var serialEnabled = true
@State var debugLogEnabled = false
@State var rebroadcastMode = 0
@State var nodeInfoBroadcastSecs = 10800
@State var doubleTapAsButtonPress = false
Expand Down Expand Up @@ -89,10 +88,6 @@ struct DeviceConfig: View {
Label("Serial Console", systemImage: "terminal")
}
.toggleStyle(SwitchToggleStyle(tint: .accentColor))
Toggle(isOn: $debugLogEnabled) {
Label("Debug Log", systemImage: "ant.fill")
}
.toggleStyle(SwitchToggleStyle(tint: .accentColor))
VStack(alignment: .leading) {
HStack {
Label("Time Zone", systemImage: "clock.badge.exclamationmark")
Expand Down Expand Up @@ -200,7 +195,6 @@ struct DeviceConfig: View {
var dc = Config.DeviceConfig()
dc.role = DeviceRoles(rawValue: deviceRole)!.protoEnumValue()
dc.serialEnabled = serialEnabled
dc.debugLogEnabled = debugLogEnabled
dc.buttonGpio = UInt32(buttonGPIO)
dc.buzzerGpio = UInt32(buzzerGPIO)
dc.rebroadcastMode = RebroadcastModes(rawValue: rebroadcastMode)?.protoEnumValue() ?? RebroadcastModes.all.protoEnumValue()
Expand Down Expand Up @@ -259,9 +253,6 @@ struct DeviceConfig: View {
.onChange(of: serialEnabled) {
if $0 != node?.deviceConfig?.serialEnabled { hasChanges = true }
}
.onChange(of: debugLogEnabled) {
if $0 != node?.deviceConfig?.debugLogEnabled { hasChanges = true }
}
.onChange(of: buttonGPIO) { newButtonGPIO in
if newButtonGPIO != node?.deviceConfig?.buttonGpio ?? -1 { hasChanges = true }
}
Expand Down Expand Up @@ -289,7 +280,6 @@ struct DeviceConfig: View {
func setDeviceValues() {
self.deviceRole = Int(node?.deviceConfig?.role ?? 0)
self.serialEnabled = (node?.deviceConfig?.serialEnabled ?? true)
self.debugLogEnabled = node?.deviceConfig?.debugLogEnabled ?? false
self.buttonGPIO = Int(node?.deviceConfig?.buttonGpio ?? 0)
self.buzzerGPIO = Int(node?.deviceConfig?.buzzerGpio ?? 0)
self.rebroadcastMode = Int(node?.deviceConfig?.rebroadcastMode ?? 0)
Expand Down
10 changes: 10 additions & 0 deletions Meshtastic/Views/Settings/Config/LoRaConfig.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ struct LoRaConfig: View {
@State var rxBoostedGain = false
@State var overrideFrequency: Float = 0.0
@State var ignoreMqtt = false
@State var okToMqtt = false

let floatFormatter: NumberFormatter = {
let formatter = NumberFormatter()
Expand Down Expand Up @@ -100,6 +101,10 @@ struct LoRaConfig: View {
Label("Ignore MQTT", systemImage: "server.rack")
}
.toggleStyle(SwitchToggleStyle(tint: .accentColor))
Toggle(isOn: $okToMqtt) {
Label("Ok to MQTT", systemImage: "network")
}
.toggleStyle(SwitchToggleStyle(tint: .accentColor))

Toggle(isOn: $txEnabled) {
Label("Transmit Enabled", systemImage: "waveform.path")
Expand Down Expand Up @@ -209,6 +214,7 @@ struct LoRaConfig: View {
lc.sx126XRxBoostedGain = rxBoostedGain
lc.overrideFrequency = overrideFrequency
lc.ignoreMqtt = ignoreMqtt
lc.configOkToMqtt = okToMqtt
if connectedNode?.num ?? -1 == node?.user?.num ?? 0 {
UserDefaults.modemPreset = modemPreset
}
Expand Down Expand Up @@ -292,6 +298,9 @@ struct LoRaConfig: View {
.onChange(of: ignoreMqtt) {
if $0 != node?.loRaConfig?.ignoreMqtt { hasChanges = true }
}
.onChange(of: okToMqtt) {
if $0 != node?.loRaConfig?.okToMqtt { hasChanges = true }
}
}
func setLoRaValues() {
self.hopLimit = Int(node?.loRaConfig?.hopLimit ?? 3)
Expand All @@ -307,6 +316,7 @@ struct LoRaConfig: View {
self.rxBoostedGain = node?.loRaConfig?.sx126xRxBoostedGain ?? false
self.overrideFrequency = node?.loRaConfig?.overrideFrequency ?? 0.0
self.ignoreMqtt = node?.loRaConfig?.ignoreMqtt ?? false
self.okToMqtt = node?.loRaConfig?.okToMqtt ?? false
self.hasChanges = false
}
}
2 changes: 1 addition & 1 deletion Meshtastic/Views/Settings/Config/SecurityConfig.swift
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ struct SecurityConfig: View {
var config = Config.SecurityConfig()
config.publicKey = Data(base64Encoded: publicKey) ?? Data()
config.privateKey = Data(base64Encoded: privateKey) ?? Data()
config.adminKey = Data(base64Encoded: adminKey) ?? Data()
config.adminKey = [Data(base64Encoded: adminKey) ?? Data()]
config.isManaged = isManaged
config.serialEnabled = serialEnabled
config.debugLogApiEnabled = debugLogApiEnabled
Expand Down
Loading