Skip to content

Commit 518af75

Browse files
committed
Minor bugfixes
1 parent 5341ada commit 518af75

7 files changed

Lines changed: 12 additions & 9 deletions

File tree

Infini-iOS/BLE/BLEDelegates.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,13 @@ extension BLEManager: CBPeripheralDelegate {
5656
func peripheral(_ peripheral: CBPeripheral, didUpdateValueFor characteristic: CBCharacteristic, error: Error?) {
5757
let getDeviceInfo = DeviceInfoManager()
5858
getDeviceInfo.updateInfo(characteristic: characteristic)
59+
DownloadManager.shared.getDownloadUrls()
5960

6061
switch characteristic.uuid {
6162
case cbuuidList.shared.musicControl:
6263
// listen for the music controller notifications
6364
let musicControl = [UInt8](characteristic.value!)
6465
controlMusic(controlNumber: Int(musicControl[0]))
65-
print(musicControl)
6666

6767
case cbuuidList.shared.musicTrack:
6868
// select track characteristic for writing to music app

Infini-iOS/BLE/BLEManager.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,10 +165,11 @@ class BLEManager: NSObject, ObservableObject, CBCentralManagerDelegate {
165165
if error != nil {
166166
chartReconnect = true
167167
connect(peripheral: peripheral)
168-
UptimeManager.shared.lastDisconnect = Date()
169168
} else {
170169
DeviceInfoManager.init().clearDeviceInfo()
171170
}
171+
UptimeManager.shared.lastDisconnect = Date()
172+
UptimeManager.shared.connectTime = nil
172173
}
173174

174175
func centralManagerDidUpdateState(_ central: CBCentralManager) {

Infini-iOS/DFU/DFU.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ class DFU_Updater: ObservableObject, DFUServiceDelegate, DFUProgressDelegate, Lo
7474
func stopTransfer() {
7575
if dfuController != nil {
7676
_ = dfuController.abort()
77+
dfuController = nil
7778
}
7879
}
7980

@@ -84,6 +85,7 @@ class DFU_Updater: ObservableObject, DFUServiceDelegate, DFUProgressDelegate, Lo
8485
if state.rawValue == 6 {
8586
transferCompleted = true
8687
print(transferCompleted)
88+
dfuController = nil
8789
}
8890
}
8991

@@ -99,7 +101,7 @@ class DFU_Updater: ObservableObject, DFUServiceDelegate, DFUProgressDelegate, Lo
99101
}
100102

101103
func logWith(_ level: LogLevel, message: String) {
102-
//print("DFU \(level.name()): \(message)")
104+
print("DFU \(level.name()): \(message)")
103105
}
104106

105107

Infini-iOS/DFU/DownloadManager.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class DownloadManager: NSObject, ObservableObject {
4343
if i.tag_name.first != "v" {
4444
let comparison = BLEDeviceInfo.shared.firmware.compare(i.tag_name, options: .numeric)
4545
if comparison == .orderedAscending {
46-
print(i.tag_name)
46+
updateAvailable = true
4747
autoUpgrade = i
4848
return true
4949
}

Infini-iOS/View Components/HomeScreen.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ struct HomeScreen: View {
4848
Text("Last disconnect: ")
4949
} else {
5050
Text("Last disconnect: " + uptimeManager.dateFormatter.string(from: uptimeManager.lastDisconnect))
51+
5152
}
5253
if currentUptime == nil {
5354
Text("Uptime: ")
@@ -76,9 +77,7 @@ struct HomeScreen: View {
7677
}
7778
}
7879
}
79-
.onAppear() {
80-
downloadManager.getDownloadUrls()
81-
}
80+
8281

8382
Spacer()
8483
Button(action: {

Infini-iOS/View Components/SettingsView.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ struct Settings_Page: View {
6262
}
6363
}
6464

65-
Section(header: Text("Updates")) {
66-
Toggle("Show Upgrades Only", isOn: $showNewDownloadsOnly)
65+
Section(header: Text("Firmware Updates")) {
66+
Toggle("Show Newer Versions Only", isOn: $showNewDownloadsOnly)
6767
}
6868

6969

Infini-iOS/View Components/SideMenu.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ struct SideMenu: View {
7272
HStack {
7373
if !self.bleManager.isConnectedToPinetime {
7474
Button(action: {
75+
SheetManager.shared.sheetSelection = .connect
7576
SheetManager.shared.showSheet = true
7677
pageSwitcher.showMenu = false
7778
}) {

0 commit comments

Comments
 (0)