Add Core portnums, reduce MQTT password size

This commit is contained in:
Garth Vander Houwen 2025-02-25 07:02:10 -08:00
parent 6e6de4da64
commit b9e99fbe0e
3 changed files with 9 additions and 2 deletions

View file

@ -9171,6 +9171,7 @@
}
},
"Empty" : {
"extractionState" : "stale",
"localizations" : {
"sr" : {
"stringUnit" : {

View file

@ -144,6 +144,7 @@ enum RebroadcastModes: Int, CaseIterable, Identifiable {
case allSkipDecoding = 1
case localOnly = 2
case knownOnly = 3
case corePortnums = 4
var id: Int { self.rawValue }
@ -157,6 +158,8 @@ enum RebroadcastModes: Int, CaseIterable, Identifiable {
return "Local Only"
case .knownOnly:
return "Known Only"
case .corePortnums:
return "Core Portnums Only"
}
}
var description: String {
@ -169,6 +172,8 @@ enum RebroadcastModes: Int, CaseIterable, Identifiable {
return "Ignores observed messages from foreign meshes that are open or those which it cannot decrypt. Only rebroadcasts message on the nodes local primary / secondary channels."
case .knownOnly:
return "Ignores observed messages from foreign meshes like Local Only, but takes it step further by also ignoring messages from nodes not already in the node's known list."
case .corePortnums:
return "Only rebroadcasts packets from the core portnums: NodeInfo, Text, Position, Telemetry, and Routing."
}
}
func protoEnumValue() -> Config.DeviceConfig.RebroadcastMode {
@ -182,6 +187,8 @@ enum RebroadcastModes: Int, CaseIterable, Identifiable {
return Config.DeviceConfig.RebroadcastMode.localOnly
case .knownOnly:
return Config.DeviceConfig.RebroadcastMode.knownOnly
case .corePortnums:
return Config.DeviceConfig.RebroadcastMode.corePortnumsOnly
}
}
}

View file

@ -196,7 +196,6 @@ struct MQTTConfig: View {
}
.keyboardType(.default)
.scrollDismissesKeyboard(.interactively)
HStack {
Label("password", systemImage: "wallet.pass")
TextField("password", text: $password)
@ -206,7 +205,7 @@ struct MQTTConfig: View {
.onChange(of: password) {
var totalBytes = password.utf8.count
// Only mess with the value if it is too big
while totalBytes > 62 {
while totalBytes > 30 {
password = String(password.dropLast())
totalBytes = password.utf8.count
}