Dear Nordic engineers
I made some modifications to the keyboard examples in the SDK based on the NRF5 17.0.2 version. I changed to use a static password for pairing and connection, but I currently encounter a problem. After my mobile phone and my device have been paired and bound, I have phone is disconnected from the device. Then I use my mobile phone to connect my device again. At this time, there will be an error in the BLE_GAP_EVT_CONNECTED event. I checked the log, and the error code is 8. I think it is because the mobile phone has been paired with the device, and the connection is disconnected at this time. After connecting to the BLE_GAP_EVT_CONNECTED event again, the BLE_GAP_EVT_CONNECTED event will send the request for binding and pairing again, which will cause this error.


Although I tested with my phone, this error will not affect the connection. But I am worried that this problem will cause some other models of mobile phones to be disconnected and unable to connect to the device again, and the binding must be deleted before they can be connected again. I think it is necessary to add a judgment here to determine whether the connected mobile phone has been bound and paired. If it has not been bound and paired, send a binding and pairing request. But I didn't find the definition of the relevant state, please help me, how should I judge in the BLE_GAP_EVT_CONNECTED event whether the phone has completed the pairing and binding before.
Best regards