cancel
Showing results for 
Search instead for 
Did you mean: 

BlueNRG-MS paring cancel issue

aes2
Associate II
Posted on November 28, 2017 at 11:47

Hi 

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)

Best regards

Anders

#bluenrg-ms #bluenrg-pairing
4 REPLIES 4
Antonio Vilei
Senior III
Posted on November 29, 2017 at 17:19

Hi Anders,

you cantryto delete the security database by calling aci_gap_clear_security_db() on your peripheral device. This should do trick byprogrammatically clearingthe internal state of your BlueNRG-MS.

For more information, please take a look at this

https://community.st.com/0D50X00009XkeEoSAJ

.

Best regards,

Antonio

Posted on November 30, 2017 at 13:47

Hi Antonio

Thank you for the answer.

However I don't think it will fit my application, since i cannot allow to clear the security database run-time because the device can have multiple bonding's.   Are there other ways to clear the internal state of the security manager ?  As mentioned above, it seems to work if I wait a certain time before trying to pair again.

Best regards

Anders

Posted on November 30, 2017 at 17:27

Hi Anders,

you could try calling hci_reset() to reset your device and bring it to the initial state, without clearing the security database.

Best regards,

Antonio

Posted on December 01, 2017 at 13:36

Hi Antonio

I changed my code to reset the stack in the SM_PAIRING_FAILED situation.

This seems to fix the issue however I don't find this the most elegant solution, since i need to setup the characteristics and advertisement data again. 

It might be a good idea to feed this info back to the development team in order to get this fixed for future stack releases.

Best regards

Anders