BLE pairing issue when BT_SECURITY_L4 with nRF5340

Hello,

I am using SDK1.5.1 with one nRf5340 as central and another nRf5340 as peripheral. My use case is, I am setting security level 4 (BT_SECURITY_L4) after establishing the connection.  In a normal scenario, it is working and I am able to establish a secure connection. Now the problem I am facing is some time during pairing if peripheral or central is unable to call bt_conn_auth_passkey_confirm() and after again restarting the scan, at the central device I am getting the following warning message:

"Found valid connection in the disconnected state"

post this, paring is not happening. I have to forcefully restart the central and start the process again to get successful pair. I can see bt_conn_unref(conn); is already called after the warning message.

Request you to help me to clear the whole stuff during the run time for such types of errors so that I can start the fresh pair process without actually restarting the central device. 

 Best Regards,

SC

Parents Reply
  • Hello Hung,

    I have already gone through the case shared by you. Please see my reply below for your question:

    You mentioned "if peripheral or central is unable to call bt_conn_auth_passkey_confirm() ", what exactly happened there ? Was bt_conn_auth_cancel() called or the connection simply dropped from one side at that time ? 

    SC: basically there is one use case because of that central and peripheral is not able to call bt_conn_auth_passkey_confirm() so after approx 10seconds I get " SMP time out " and "security failed" log I get from security_changed() call back. After this, if If I try to again pair then I get "Found valid connection in the disconnected state".

    So, I want to clear out this reference and start fresh pair.

    Best Regards,

    SC

Children
Related