Pairing failing after forgetting the device

Hello, I am working on iOS app acting as a central that connects to a peripheral which triggers bonding on connection. The pairing is successful on the first connection and after resetting the peripheral (and forgetting the device in Bluetooth Settings). It fails, however, after this devices is forgotten in the Bluetooth Settings at DHKey check, but the peripheral remains turned on.

The peripheral is a linux device using BlueZ. This issue does not happen with Android device.

Steps:

  1. Connect with the peripheral in the app using Core Bluetooth for the first time.
  2. Accept the pairing prompt.
  3. Bonding is successful and the peripheral is under MY DEVICES in Bluetooth Settings.
  4. Forget the device in Bluetooth Settings.
  5. Connect with the peripheral in the app using Core Bluetooth.
  6. Pairing prompt pops up repeatedly. Sometimes it pops up once, but the pairing is not successful as the device is not present under MY DEVICES.
  7. Connect with the peripheral in the app using Core Bluetooth another time.
  8. Pairing prompt still shows app.
  9. Restarting the peripheral fixes it and central iOS device is able to pair again.

Sharing a screen shot from nRF Sniffer for SMP packets which indicate DHKey check failing. I was not able to attach whole log files because of size, let me know if needed I can share them in a different way somehow.

Is there anything different in the flow between pairing for the first time and after forgetting the device?

In your repro steps you haven't mentioned if your app is still running between steps 4 and 5.

We are aware of an issue where this might happen, and releasing and reinitializing your CBCentralManager (or restarting your app, or restarting the device) might resolve the issue.

You indicate restarting the peripheral does fix it, so perhaps in your case it is the peripheral that might be causing this issue.

In any case, this would be best handled by investigating further via a bug report

and include a diagnostic log. Please go to https://developer.apple.com/bug-reporting/profiles-and-logs/ and follow the instructions for Bluetooth for iOS to install a logging profile on your device. Then reproduce the issue, and follow the instructions at the above link to create a sysdiagnose. And attach that to the Feedback report as well.

Pairing failing after forgetting the device
 
 
Q