Search code examples
iosiphonebluetoothbluetooth-lowenergycore-bluetooth

iOS CoreBluetooth suddenly in CBManagerStateResetting state


Issue:

Recently, I am frequently getting CBManagerStateResetting state in CBPeripheralManager. After getting CBManagerStateResetting state, CBManagerStatePoweredOn comes within 3~5 seconds. However, this not only effect the application but also peer device is getting disconnect status due to link loss error.

Scenario:

This issue occurs specially during continuous data transaction in BLE while parallelly using 3G Data from iPhone.

When CBManagerStateResetting occurs, peer device gets disconnected. It is so annoying now a days as it is occurring frequently.

My question,

  • Why CBManagerStateResetting state comes while app is already connected to a BLE device?
  • What steps can be taken from iOS Application side and peer device side to prevent this reset issue ?

Extra information: CBPeripheralManagerStates are as follows:

typedef NS_ENUM(NSInteger, CBPeripheralManagerState) {
CBPeripheralManagerStateUnknown = CBManagerStateUnknown,
**CBPeripheralManagerStateResetting = CBManagerStateResetting,**
CBPeripheralManagerStateUnsupported = CBManagerStateUnsupported,
CBPeripheralManagerStateUnauthorized = CBManagerStateUnauthorized,
CBPeripheralManagerStatePoweredOff = CBManagerStatePoweredOff,
CBPeripheralManagerStatePoweredOn = CBManagerStatePoweredOn,
};

Solution

  • This issue happens due to an unstable Bluetooth stack when Apple first released iOS 10. In the subsequent update, the issue has been solved. In current releases "CBPeripheralManagerStateResetting" comes rarely.