sleep for a second to allow the official app to upload to LibreView
also removed the call to heartbeat after didConnect, that's a bit too early, should not be necessary.
This commit is contained in:
parent
f631d54bd8
commit
b3dc269c3d
|
@ -56,21 +56,6 @@ class Libre3HeartBeatBluetoothTransmitter: BluetoothTransmitter {
|
|||
|
||||
// MARK: CBCentralManager overriden functions
|
||||
|
||||
override func centralManager(_ central: CBCentralManager, didConnect peripheral: CBPeripheral) {
|
||||
|
||||
super.centralManager(central, didConnect: peripheral)
|
||||
|
||||
// this is the trigger for calling the heartbeat
|
||||
if (Date()).timeIntervalSince(lastHeartBeatTimeStamp) > ConstantsHeartBeat.minimumTimeBetweenTwoHeartBeats {
|
||||
|
||||
bluetoothTransmitterDelegate?.heartBeat()
|
||||
|
||||
lastHeartBeatTimeStamp = Date()
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
override func peripheral(_ peripheral: CBPeripheral, didUpdateValueFor characteristic: CBCharacteristic, error: Error?) {
|
||||
|
||||
// trace the received value and uuid
|
||||
|
@ -81,6 +66,9 @@ class Libre3HeartBeatBluetoothTransmitter: BluetoothTransmitter {
|
|||
// this is the trigger for calling the heartbeat
|
||||
if (Date()).timeIntervalSince(lastHeartBeatTimeStamp) > ConstantsHeartBeat.minimumTimeBetweenTwoHeartBeats {
|
||||
|
||||
// sleep for a second to allow the official app to upload to LibreView
|
||||
Thread.sleep(forTimeInterval: 1)
|
||||
|
||||
bluetoothTransmitterDelegate?.heartBeat()
|
||||
|
||||
lastHeartBeatTimeStamp = Date()
|
||||
|
|
Loading…
Reference in New Issue