Skip to content

Commit de06d90

Browse files
committed
Moved some unnecessarily global variables inside BLEManager. Mostly just committing before switching to DFU stuff.
1 parent f208d7d commit de06d90

1 file changed

Lines changed: 16 additions & 15 deletions

File tree

Infini-iOS/BLEManager.swift

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,6 @@
88
import Foundation
99
import CoreBluetooth
1010

11-
struct Peripheral: Identifiable {
12-
let id: Int
13-
let name: String
14-
let rssi: Int
15-
let peripheralHash: Int
16-
}
17-
18-
// declare some CBUUIDs for easier reference
19-
let hrmCBUUID = CBUUID(string: "2A37")
20-
let batCBUUID = CBUUID(string: "2A19")
21-
let timeCBUUID = CBUUID(string: "2A2B")
22-
let notifyCBUUID = CBUUID(string: "2A46")
23-
let musicControlCBUUID = CBUUID(string: "00000001-78FC-48FE-8E23-433B3A1942D0")
24-
let musicTrackCBUUID = CBUUID(string: "00000004-78FC-48FE-8E23-433B3A1942D0")
25-
let musicArtistCBUUID = CBUUID(string: "00000003-78FC-48FE-8E23-433B3A1942D0")
2611

2712
class BLEManager: NSObject, ObservableObject, CBCentralManagerDelegate {
2813

@@ -50,6 +35,22 @@ class BLEManager: NSObject, ObservableObject, CBCentralManagerDelegate {
5035
@Published var peripheralDictionary: [Int: CBPeripheral] = [:] // this is the dictionary that relates human-readable peripheral names to the CBPeripheral class that CoreBluetooth actually interacts with
5136
@Published var infiniTime: CBPeripheral! // variable to save the CBPeripheral that you're connecting to
5237

38+
// declare some CBUUIDs for easier reference
39+
let hrmCBUUID = CBUUID(string: "2A37")
40+
let batCBUUID = CBUUID(string: "2A19")
41+
let timeCBUUID = CBUUID(string: "2A2B")
42+
let notifyCBUUID = CBUUID(string: "2A46")
43+
let musicControlCBUUID = CBUUID(string: "00000001-78FC-48FE-8E23-433B3A1942D0")
44+
let musicTrackCBUUID = CBUUID(string: "00000004-78FC-48FE-8E23-433B3A1942D0")
45+
let musicArtistCBUUID = CBUUID(string: "00000003-78FC-48FE-8E23-433B3A1942D0")
46+
47+
struct Peripheral: Identifiable {
48+
let id: Int
49+
let name: String
50+
let rssi: Int
51+
let peripheralHash: Int
52+
}
53+
5354
override init() {
5455
super.init()
5556

0 commit comments

Comments
 (0)