CoreBluetooth rare glitches

Max
1 min readJul 7, 2016

Recently I found when working with a slightly problematic peripheral, after calling cancelPeripheralConnection, CoreBluetooth does not call didDisconnectPeripheral or didFailToConnectPeripheral as mentioned in the documentation, which seems to indicate that CoreBluetooth is actually waiting for something to happen between the peripheral and itself…

The workaround is to start a guard timer to ensure we can deliver a disconnected notification to the UI layer :D

Reference:

https://developer.apple.com/library/ios/documentation/CoreBluetooth/Reference/CBCentralManager_Class/#//apple_ref/doc/uid/TP40011284-CH1-SW3

--

--