mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
Fix firmware version comparison, filter the node list when it appears
This commit is contained in:
parent
d9ab828d4a
commit
78095caf08
2 changed files with 5 additions and 3 deletions
|
|
@ -36,8 +36,9 @@ class MqttClientProxyManager {
|
|||
defaultServerPort = Int(fullHost.components(separatedBy: ":")[1]) ?? (useSsl ? 8883 : 1883)
|
||||
}
|
||||
}
|
||||
let minimumVersion = "2.3.0"
|
||||
let latestVersion = minimumVersion.compare(UserDefaults.firmwareVersion, options: .numeric) == .orderedSame
|
||||
let minimumVersion = "2.3.3"
|
||||
let currentVersion = UserDefaults.firmwareVersion
|
||||
let supportedVersion = minimumVersion.compare(currentVersion, options: .numeric) == .orderedAscending || minimumVersion.compare(currentVersion, options: .numeric) == .orderedSame
|
||||
|
||||
if let host = host {
|
||||
let port = defaultServerPort
|
||||
|
|
@ -45,7 +46,7 @@ class MqttClientProxyManager {
|
|||
let password = node.mqttConfig?.password
|
||||
let root = node.mqttConfig?.root?.count ?? 0 > 0 ? node.mqttConfig?.root : "msh"
|
||||
let prefix = root!
|
||||
topic = prefix + (latestVersion ? "/2/e" : "/2/c") + "/#"
|
||||
topic = prefix + (supportedVersion ? "/2/e" : "/2/c") + "/#"
|
||||
let qos = CocoaMQTTQoS(rawValue: UInt8(1))!
|
||||
connect(host: host, port: port, useSsl: useSsl, username: username, password: password, topic: topic, qos: qos, cleanSession: true)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -267,6 +267,7 @@ struct NodeList: View {
|
|||
if self.bleManager.context == nil {
|
||||
self.bleManager.context = context
|
||||
}
|
||||
searchNodeList()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue