File tree Expand file tree Collapse file tree 3 files changed +18
-2
lines changed
Expand file tree Collapse file tree 3 files changed +18
-2
lines changed Original file line number Diff line number Diff line change 994994 43CABE081C3506F100005705 /* Debug */ = {
995995 isa = XCBuildConfiguration;
996996 buildSettings = {
997+ APPLICATION_EXTENSION_API_ONLY = YES;
997998 CLANG_ENABLE_MODULES = YES;
998999 CODE_SIGN_IDENTITY = "iPhone Developer";
9991000 "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
10161017 43CABE091C3506F100005705 /* Release */ = {
10171018 isa = XCBuildConfiguration;
10181019 buildSettings = {
1020+ APPLICATION_EXTENSION_API_ONLY = YES;
10191021 CLANG_ENABLE_MODULES = YES;
10201022 CODE_SIGN_IDENTITY = "iPhone Developer";
10211023 "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
Original file line number Diff line number Diff line change @@ -79,10 +79,14 @@ class BluetoothManager: NSObject {
7979 }
8080 }
8181
82+ var peripheralIdentifier : UUID ?
83+
8284 var peripheralManager : PeripheralManager ? {
8385 didSet {
8486 oldValue? . delegate = nil
8587 peripheralManager? . delegate = self
88+
89+ peripheralIdentifier = peripheralManager? . peripheral. identifier
8690 }
8791 }
8892
@@ -108,7 +112,7 @@ class BluetoothManager: NSObject {
108112 return
109113 }
110114
111- if let peripheralID = self . peripheral ? . identifier , let peripheral = manager. retrievePeripherals ( withIdentifiers: [ peripheralID] ) . first {
115+ if let peripheralID = peripheralIdentifier , let peripheral = manager. retrievePeripherals ( withIdentifiers: [ peripheralID] ) . first {
112116 log. debug ( " Re-connecting to known peripheral %{public}@ " , peripheral. identifier. uuidString)
113117 self . peripheral = peripheral
114118 self . manager. connect ( peripheral)
Original file line number Diff line number Diff line change @@ -90,10 +90,11 @@ public final class Transmitter: BluetoothManagerDelegate {
9090
9191 private let delegateQueue = DispatchQueue ( label: " com.loudnate.CGMBLEKit.delegateQueue " , qos: . utility)
9292
93- public init ( id: String , passiveModeEnabled: Bool = false ) {
93+ public init ( id: String , peripheralIdentifier : UUID ? = nil , passiveModeEnabled: Bool = false ) {
9494 self . id = TransmitterID ( id: id)
9595 self . passiveModeEnabled = passiveModeEnabled
9696
97+ bluetoothManager. peripheralIdentifier = peripheralIdentifier
9798 bluetoothManager. delegate = self
9899 }
99100
@@ -111,6 +112,15 @@ public final class Transmitter: BluetoothManagerDelegate {
111112 return bluetoothManager. isScanning
112113 }
113114
115+ public var peripheralIdentifier : UUID ? {
116+ get {
117+ return bluetoothManager. peripheralIdentifier
118+ }
119+ set {
120+ bluetoothManager. peripheralIdentifier = newValue
121+ }
122+ }
123+
114124 public var stayConnected : Bool {
115125 get {
116126 return bluetoothManager. stayConnected
You can’t perform that action at this time.
0 commit comments