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

nRF52840 SDK16 s140 - Delete bonds

Hi everyone,

I am looking the ble_app_template_pca10056_s140 example and I have a question regarding the advertising_start(erase_bonds) function in main();

When you call the advertising_start() function you pass a bool (in our case erase_bonds) as parameter and if the bool is true you call the delete_bonds();

What I can understand from this example is that the erase_bonds is become true only if you press the button used to wake up the application and delete all bonding information. I s this true?

I am new to this an I try to understand when should I delete bonding information.

In my application I won't use any buttons but I will use an IMU for external interrupt. In general when do I need to call delete_bonds()? Is it required in any case?

Thanks in advance

Nick

Parents
  • Hi Nikos

    This is just an example for you to demonstrate when you can delete the bonds.

    In this example, like you figured out, when you press the button while system restart, erase_bonds will be set to true by the button handler. An we send this parameter to advertise_start so that the device only starts advertising after it deletes all the bond information for it. But the use case for deleting bond information is different in different applications. If you do not use any buttons, then most like you do not need to have this erase_bonds parameter controlled by button handler, but something else.

Reply
  • Hi Nikos

    This is just an example for you to demonstrate when you can delete the bonds.

    In this example, like you figured out, when you press the button while system restart, erase_bonds will be set to true by the button handler. An we send this parameter to advertise_start so that the device only starts advertising after it deletes all the bond information for it. But the use case for deleting bond information is different in different applications. If you do not use any buttons, then most like you do not need to have this erase_bonds parameter controlled by button handler, but something else.

Children
Related