I have a BlueNRG-MS peripheral device, that requires pairing for encrypted data transfer. Overall it works, but when cancelling the paring procedure from the central (IOS) then the following reconnect attempt fails to start the paring procedure.
If I let the pairing prompt on the IOS dev timeout, a get EVT_BLUE_GAP_PAIRING_CMPLT with result = 1 ( timeout)
And if i actively cancel the pairing on the IOS device, then i get a get EVT_BLUE_GAP_PAIRING_CMPLT with
result = 2 ( Failed).
In both cases the peripheral terminates the connection.
The behavior above is expected, but the issue is when trying to do a reconnect and restart the pairing procedure.
In the timeout situation, the pairing procedure can successfully be restarted at the next connection attempt, but for the "active cancel" situation, the aci_gap_slave_security_request returns 12 ( ERR_COMMAND_DISALLOWED), and the pairng procedure is not started ( EVT_BLUE_GAP_SLAVE_SECURITY_INITIATED not received). However if i wait for a certain time before reconnecting i does also work in the latter case.
To me it looks like some internal state isn't cleared on the "cancel" event but only on the timeout.
Any suggestions will be appreciated.
I am using stack verison 7.2c (FW 07.23)