Skip to main content
Visitor II
February 20, 2024
Question

Enable BLE pairing of new devices on button press only

  • February 20, 2024
  • 2 replies
  • 1243 views

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

2 replies

STTwo-32
Technical Moderator
April 15, 2024

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

MKles
Associate
January 7, 2025

@hagaimoshe Did you find any solution for that problem?