hello there!
I am working on a project in which two devices(one is central and other is peripheral ) uses Nordic bluetooth controller nRF51822 for connection and data exchange.
Currently the peripheral device that will connect and pair with one central.
The sequence I am trying out.
1, Raw firmware without any bonds
2, The central pairs with peripheral and is bonded.
3, Over this connection, the central tries to re pair and bond with the peripheral. Currently in our code, the old bonding is deleted by calling pm_manager_delete() at the beginning of pairing sequence, which is not right. The issue happens when the old bond has been deleted and new pairing attempt is aborted or not successful, there is no pairing since the 2nd pairing is not successful.
2, The central pairs with peripheral and is bonded.
3, Over this connection, the central tries to re pair and bond with the peripheral. Currently in our code, the old bonding is deleted by calling pm_manager_delete() at the beginning of pairing sequence, which is not right. The issue happens when the old bond has been deleted and new pairing attempt is aborted or not successful, there is no pairing since the 2nd pairing is not successful.
As part of the fix, I tried deleting the old bond only when PM_EVT_CONN_SEC_SUCCEEDED event is received. Even though pairing is successful, the central is not able to connect to peripheral.
Has anyone faced this before? It would be great if someone can help with few points on this issue.