More version updates

This commit is contained in:
Garth Vander Houwen 2022-09-27 09:01:33 -07:00
parent e2e8eb0faa
commit 8213f3db65
4 changed files with 27 additions and 9 deletions

View file

@ -439,7 +439,7 @@ class BLEManager: NSObject, ObservableObject, CBCentralManagerDelegate, CBPeriph
sendWantConfig()
self.configTimeoutTimer = Timer.scheduledTimer(timeInterval: TimeInterval(7), target: self, selector: #selector(configTimeoutTimerFired), userInfo: context, repeats: false)
self.configTimeoutTimer = Timer.scheduledTimer(timeInterval: TimeInterval(15), target: self, selector: #selector(configTimeoutTimerFired), userInfo: context, repeats: false)
RunLoop.current.add(self.configTimeoutTimer!, forMode: .common)
}
}
@ -717,6 +717,8 @@ class BLEManager: NSObject, ObservableObject, CBCentralManagerDelegate, CBPeriph
if decodedInfo.configCompleteID != 0 && decodedInfo.configCompleteID == configNonce {
invalidVersion = false
lastConnectionError = ""
if configTimeoutTimer != nil {
configTimeoutTimer?.invalidate()
@ -729,10 +731,11 @@ class BLEManager: NSObject, ObservableObject, CBCentralManagerDelegate, CBPeriph
// Get all the channels
var i: UInt32 = 1;
var max: Int32 = self.connectedPeripheral.maxChannels
Timer.scheduledTimer(withTimeInterval: 0.4,
repeats: true) { timer in
if i == (self.connectedPeripheral.maxChannels + 1) {
Timer.scheduledTimer(withTimeInterval: 0.4, repeats: true) { timer in
if i == (max + 1) {
timer.invalidate() // invalidate the timer
} else {

View file

@ -43,6 +43,7 @@ struct Connect: View {
Section(header: Text("Connected Radio").font(.title)) {
if bleManager.connectedPeripheral != nil && bleManager.connectedPeripheral.peripheral.state == .connected {
HStack {
Image(systemName: "antenna.radiowaves.left.and.right")
@ -73,6 +74,10 @@ struct Connect: View {
}
if bleManager.connectedPeripheral.subscribed {
Text("Properly Subscribed").font(.caption)
} else {
Text("Attempting to connect. . . ").font(.caption)
.foregroundColor(.orange)
}
}
Spacer()

View file

@ -23,9 +23,18 @@ struct InvalidVersion: View {
VStack {
Text("The Meshtastic Apple apps support firmware version \(minimumVersion) and above. You are running version \(version)")
.font(.title2)
.padding(.bottom)
if version != "1.2.65" {
Text("The Meshtastic Apple apps support firmware version \(minimumVersion) and above. You are running version \(version)")
.font(.title2)
.padding(.bottom)
} else {
Text("The Meshtastic Apple apps support firmware version \(minimumVersion) and above.")
.font(.title2)
.padding(.bottom)
}
Link("Firmware update docs", destination: URL(string: "https://meshtastic.org/docs/getting-started/flashing-firmware/")!)
.font(.title)
@ -46,12 +55,12 @@ struct InvalidVersion: View {
VStack{
Text("🦕 Your device is Version 1.2 🦖 ☄️")
Text("🦕 End of life Version 🦖 ☄️")
.font(.title3)
.foregroundColor(.orange)
.padding(.bottom)
Text("Version 1.3 includes breaking changes to devices and the client apps. The version 1.3 app does not support 1.2 or 1.0 nodes.")
Text("Version \(minimumVersion) includes breaking changes to devices and the client apps. Only nodes version \(minimumVersion) and above are supported.")
.font(.caption)
.padding([.leading, .trailing])

View file

@ -226,6 +226,7 @@ struct Settings: View {
// Store Forward Config - Not Working, TBEAM Only
// MQTT Config - Can do from WebUI once WiFi is enabled
}
.disabled(bleManager.connectedPeripheral == nil || !bleManager.connectedPeripheral.subscribed)
.onAppear {
self.bleManager.context = context