Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CentralManager State Resetting - what causes this and how can i prevent it?

I have an issue with my centralManger object, its working great I can connect and disconnect to a peripheral. Once I pair 2 peripherals, after half an hour (more or less..) the centralManger state becomes "CentralManagerStateResetting" which causes my peripherals to disconnect automatically and not call delegate: didDisconnectPeripheral.

This is from apple's documentation: @constant CBCentralManagerStateResetting The connection with the system service was momentarily lost, update imminent.

  1. What does this state mean?
  2. Why does the centralManger get to this state?
  3. How can i prevent it from getting to this state?
  4. How can i overcome this issue?

Seen in all iPhones and checked in version iOS 9+

like image 591
Gili Ariel Avatar asked Jan 21 '16 10:01

Gili Ariel


1 Answers

Most propably this means that BTServer crashed. Normally it recovers within a few seconds and the state should change to CBCentralManagerStatePoweredOn again.

Check your device logs for output from BTServer.

This can happen if there is a lot of load on the BLE stack and the system has to manage a lot of simultaneous connections to different peripherals.

like image 132
p2pkit Avatar answered Sep 30 '22 20:09

p2pkit