Hello,
I have an BLE application were I want, for security reasons, to allow a connection only if a button is pushed or if the devices already have bonded before. The Button is no problem I just wait for the BLE_GAP_EVT_CONNECTED event. Then I ask if the Button had been pushed. If the button had been pushed I do nothing and my application continues. My problem is now, if the Button hadn't been pushed, how do I find out if the devices already bonded at this point in the code to close the connection?
I know that if the devices already bonded the PM_EVT_BONDED_PEER_CONNECTED event occurs. But in case the button hadn't been pushed and the devices aren't already bonded I have no event I can wait for and then close the connection. All the other peer_manager events only occur after the device tries to bond and not after building up a connection.
I hope it gets clear where my problem is and I'm thankful for any advice.
(I'm using the nrf52 developer Board an the SDK12.2.0)
Regards Lea