This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How to tell the host to clear and do all the bonding setup again?

Hi

I am writing an application that requires bonding/paring stuffs and face a problem as below

The maximum bonds that my device can manage is 2. When these 2 slots are fully used and another host tries to connect with my device, the least frequent used bond will be deleted to free up a slot for the new coming.

The problem comes when the deleted one comes back and requests to reconnect with my device. In this case, the connection is still re-established but the two devices can't talk to each other since I lost all the bond data for this connection. My question is, is there anyway that I can tell the host (phone) to forget my device and do all the bonding/paring setups again?

I'm using Nordic nrf51822 chip with soft device s110 v7.0.0

Thank you for any help!

Parents
  • I don't think there is a built in procedure in the Bluetooth Core specification to do this, and because of this our SoftDevices don't have an API for it.

    You may be able to implement it in the application on the nRF51 and in the app on the phone. You can have a characteristic that notifies the app when it should delete the bond information. This is assuming that the app actually is able to delete the bond information.

    It seems to be possible on Android, see this, but I haven't tested this myself.

    I couldn't find a way to do it on iOS, the only way to delete the bond information is by forgetting the device in settings.

  • Since my application uses HID services that require encryption, doing sd_ble_gap_sec_info_reply(m_conn_handle, NULL, NULL) seems to be a bad idea since my device will get stuck with this iPhone as it keep the connection unencrypted. If I do nothing, the connection is dropped, iOS will try to reconnect a couple times (about 3 or 4 times as I experienced) then give up eventually. After that, my device can connect with other devices.

Reply
  • Since my application uses HID services that require encryption, doing sd_ble_gap_sec_info_reply(m_conn_handle, NULL, NULL) seems to be a bad idea since my device will get stuck with this iPhone as it keep the connection unencrypted. If I do nothing, the connection is dropped, iOS will try to reconnect a couple times (about 3 or 4 times as I experienced) then give up eventually. After that, my device can connect with other devices.

Children
No Data
Related