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

Restore bonding after timeout

Hey everybody!

I'm trying to implement the following use case.

Android device connects to nRF52, bonding occurs, android device is put into nRF52 whitelist, after this user can press the button on nRF52 to drop bonding and whitelist. Relation is one android and one peripheral nRF52 device. Up to this point everything is implemented and works.

I want to implement the functionality of restoring previous bonding information if no one has connected within 1 minute after button press. How do I do that? Is it possible to take bonding info and save it in FDS somehow? Which steps should I take to accomplish this?

Parents
  • Hi,

    If you are deleting the bond information on the button press event, then maybe you could instead start a 1 minute timer when the button is pressed, and call ble_advertising_restart_without_whitelist(). If someone else connects within 1 minute, only then would you delete the bond.

  • I have to delete bond info because of the following scenario:

    1) devices are bonded and everything works
    2) I delete bond info in android settings
    3) I try to bond again and get an error because the peripheral still thinks it is bonded
    4) pressing the button does not help because we don't delete bond info on peripheral but only advertising without whitelist

    Correct me if I'm wrong please. Maybe something is wrong in my understanding. Or something can be done to the above scenario to prevent 'bricking'

Reply
  • I have to delete bond info because of the following scenario:

    1) devices are bonded and everything works
    2) I delete bond info in android settings
    3) I try to bond again and get an error because the peripheral still thinks it is bonded
    4) pressing the button does not help because we don't delete bond info on peripheral but only advertising without whitelist

    Correct me if I'm wrong please. Maybe something is wrong in my understanding. Or something can be done to the above scenario to prevent 'bricking'

Children
Related