not using thread.sleep
Not tested by me! Co-Authored-By: bjornoleh <63544115+bjornoleh@users.noreply.github.com> Co-Authored-By: Liroy van Hoewijk <4643445+liroyvh@users.noreply.github.com>
This commit is contained in:
parent
b67e7e1385
commit
60b13942a2
|
@ -289,7 +289,11 @@ class CGMG5Transmitter:BluetoothTransmitter, CGMTransmitter {
|
||||||
|
|
||||||
override func centralManager(_ central: CBCentralManager, didDisconnectPeripheral peripheral: CBPeripheral, error: Error?) {
|
override func centralManager(_ central: CBCentralManager, didDisconnectPeripheral peripheral: CBPeripheral, error: Error?) {
|
||||||
|
|
||||||
|
let delayInSeconds = 2.0
|
||||||
|
|
||||||
|
DispatchQueue.main.asyncAfter(deadline: .now() + delayInSeconds) {
|
||||||
super.centralManager(central, didDisconnectPeripheral: peripheral, error: error)
|
super.centralManager(central, didDisconnectPeripheral: peripheral, error: error)
|
||||||
|
}
|
||||||
|
|
||||||
if waitingPairingConfirmation {
|
if waitingPairingConfirmation {
|
||||||
// device has requested a pairing request and is now in a status of verifying if pairing was successfull or not, this by doing setNotify to writeCharacteristic. If a disconnect occurs now, it means pairing has failed (probably because user didn't approve it
|
// device has requested a pairing request and is now in a status of verifying if pairing was successfull or not, this by doing setNotify to writeCharacteristic. If a disconnect occurs now, it means pairing has failed (probably because user didn't approve it
|
||||||
|
|
Loading…
Reference in New Issue