cancel
Showing results for 
Search instead for 
Did you mean: 

Enable BLE pairing of new devices on button press only

hagaimoshe
Associate

As apart of the BLE capabilities in our project, which runs on STM32WB55
We want to allow pairing of new devices only when pressing a button.
When the button is not pressed, we want to allow connections of only devices which are already bonded.

From what I see that the SDK has no API for rejecting new pairing requests.
I also see that the HCI has an "authentication request command" which the SDK does not pass to the application layer.


The only two options I can think of are:

1. upon connection event (or "encryption changed event") disconnect the peer if it isn't in the bonding list.

2. The SDK does allow to manage a "white list" (which we can manage in parallel to the bonding list) and use it as a filter on the connection.
The white list is being managed on the RAM, which means we'll have to take care of its persistency on our own.

 

Am I missing something here? is there a better way to do it?
And isn't allowing only bonded devices a part of the core specifications?

Thank. Hagai

1 REPLY 1
STTwo-32
ST Employee

Hello @hagaimoshe 

You have nice ideas. Did you test this behavior. What I suggest you is to Just take a simple example and try to limit the number of connections to the number of devices already bonded and add more connections just when clicking on the button.

Best Regards.

STTwo-32

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.