cancel
Showing results for 
Search instead for 
Did you mean: 

How to use filter accept list

crwper
Senior

My application is a BLE peripheral with no display and no keyboard. When idling, the device advertises once every 1-2.5 seconds. When the user presses the button on the device, it goes into "pairing mode" and starts advertising once every 80-100 ms.

What I would like to do now is to prevent unauthorized central devices from connecting to my peripheral. When the unit is in idle, I want it to accept connections only from devices it recognizes. When it's in "pairing mode", I want it to accept connections from any device, then add devices which make a connection to the filter accept list.

At the moment, when the peripheral is in "pairing mode", I initialize advertising like this:

ret = aci_gap_set_discoverable(ADV_IND,
                               Min_Inter,
                               Max_Inter,
                               CFG_BLE_ADDRESS_TYPE,
                               NO_WHITE_LIST_USE,
                               0,
                               0,
                               0,
                               0,
                               0,
                               0);

When the peripheral is idle, I initialize advertising like this:

ret = aci_gap_set_undirected_connectable(Min_Inter,
                                         Max_Inter,
                                         CFG_BLE_ADDRESS_TYPE,
                                         WHITE_LIST_FOR_ALL);

If the peripheral is in pairing mode, then after disconnect is complete, but before I restart advertising, I call this command:

ret = hci_le_add_device_to_filter_accept_list(Peer_Address_Type, Peer_Address);

However, when this is called, I get result `0x01`, which according to AN5270 is "Unknown HCI command".

How can I implement a minimal filter accept list? I have not been able to find a working example online, but I imagine this is a fairly common requirement for BLE devices.

Thank you!

1 REPLY 1
STTwo-32
ST Employee

Hello @crwper 

I suggest you take a look at this FAQ (3 consecutive articles). It should be helpful.

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.