CBPeripheralmanager not able to keep connection after app re-launch

Hi guys,

I am developing an iOS application that turns iPhone into a HID peripheral. I have successfully added services and characteristics, and it can be paired with a Windows PC and works as expected.

However, after the app relaunch and services re-added, PC not able to re-connect to it automatically. It still shows "Paired" on the PC rather than "Connnected" and no subscribe event received from CB. The user has to remove the device and do the pair again.

I think the reason is that a new peripheral manager created after re-launch, it doesn't have previous connections' information (uuid or secure key). Hence, PC not able to talk to it anymore.

My questions are:

  1. Is it the real reason for this?
  2. Any chance app can store the peripheral manager or the connection information? So that can pick it up next run.
  3. Any chance can setup to "Just works" mode? Maybe can make the reconnection working?

I have read thru the CB documents, and didn't find answer there. Just trying with the forum if any luck...

CBPeripheralmanager not able to keep connection after app re-launch
 
 
Q