Bluetooth IOS11 connection issue

Hello

Bluetooth connected to a device, access to services and feature values, the subscription feature value is completed, the Bluetooth connection is disconnected, the following error occurs.

Bluetooth One device lost connection: uuid: 59BA1B9A-8BFA-F7BB-B937-7A7E1216FD2E Error: Error Domain = CBErrorDomain Code = 7 "The specified device has disconnected from us." UserInfo = {NSLocalizedDescription = The specified device has disconnected from us.}

After this error occurs, the phone can search for the Bluetooth device, but no Bluetooth device can be linked anymore, and the Bluetooth device must be connected after restarting the phone each time (for IOS11 and above).

Urgently hope to answer, thank you!

Replies

CBErrorDomain 7 indicates that the remote peripheral has initiated the disconnection.


You should double check your code on the peripheral to make sure you are not disconnecting by mistake.

I checked my code, did not find any problems, but still can not connect, restart the phone later, you can connect to the normal!

Hi,


Our case is little bit different but the error is same. here are the steps: -

  1. Initiate the connection request
  2. Device got connected and discovered the services & characteristcs
  3. Set the nitification on a characteristcs
  4. Due to manual pairing process, Peripheral will ask for authentication. So, iOS device will present the pairing alert which have 1 textfield ( numeric passkey)
  5. Once user enter the correct passkey, app will be able to subscribe the notification.
  6. After that peripheral will disconnect the connected centeral device for security purpose.
  7. After that app has to re-initiate the connection
  8. App receive the disconnect delegate method immediately after connection
  9. Message that app side used to receive is "The specified device has disconnected from us."
  10. Disconnect happens so quickly and app is not even able to discover the services & characteristcs.
  11. Even after restart or forget device and go through all the process again but the error is same.
  12. But if firmware side gives 400 ms of sleep, everythings work perfectly.
  13. Do iOS need any time interval after pairing ?


Can you please help on the same ?