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

Peer Manager – Lost Bond – Example handling?

Could you, please, direct me to any example (if available) how to manage lost bond with nRF52832/ SDK16 BLE?

Let say very common situation that will try to demonstrate with the simplest example I found within the   SDK\examples\ble_peripheral\ble_app_template :

 Connect to nRF 52832 from a client (Android) and bond. After disconnect, then clear bonding information at the client (Android)side.

Next time when try connect to nRF (which still keep bonding information), I get this:

<info> peer_manager_handler: Peer data updated in flash: peer_id: 0, data_id: Peer rank, action: Update, no change
<info> app: Connected.
<info> peer_manager_handler: Connection security failed: role: Peripheral, conn_handle: 0x0, procedure: Bonding, error: 133
<info> app: Fast advertising.

 

If there is no such example, will appreciate any help on these questions:

Q1. Who initiate the disconnection for “Bonding, error: 133”: nRF or the client/central/(Android in my case)?

Q2. If nRF initiate the disconnection – can I avoid it, then delete only bonding info that failed and leave to the client/central reinitiate the bonding eventually when request later access to an attribute that requires security connection?

Q3. If nRF initiate the disconnection - Can I send to the client disconnection reason with some specific code that would give me hint at the Android side what happened?

Q4. At nRF side, can I distinguish that the current connected client address (assume is RPA) , but with lost bond info at the client side, can match with any static addresses and LTK pairs saved in the nRF’s flash and if so delete only this bonding information?

Thanks

  • Could you, please, direct me to any example (if available) how to manage lost bond with nRF52832/ SDK16 BLE?

     Try to allow re-pairing, as suggested in this thread. That will makes it possible to re-pair with an already bonded peer.

    Also, take a look at this thread where I explain what is causing this error message in details (don't use my suggested solution, as it was written in a rush and not a "clean" way of solving it).

    Best regards,

    Simon

  • Thanks Simon, First link that you refer me to was quite helpful - fix the problem right away. Didn't get the details what was the communication between the client and server to resolve it, but will dive in the details when have more time to waste or get similar problem

  • I'm happy to help and glad the provided link was helpful.

    Best regards,

    Simon