1. STM32WB-WBA - Bluetooth® Low Energy filter accept list
"Filter accept list consists in a list of addresses of peer devices that a device intends to interact with."
Security is the first reason.
Bluetooth® Low Energy filter accept list |
---|
Filter accept list helps reducing power consumption, there is no communication with devices not in the filter accept list.
- Host specifies the required devices to communicate with.
- Link layer responds to devices in the filter accept list.
- Interactions between layers are reduced.
Connection accept list filters devices based on a list of Bluetooth® LE addresses on both central and peripheral side.
If accept list is on the central side, scan results from nonlisted devices are dropped and connecting to nonlisted devices is not enabled.
If accept list is on the peripheral side, only listed devices can connect and receive scan responses (scan requests and connection requests from nonlisted devices are dropped).
2. From advertiser point of view
As soon as a device advertises using aci_gap_set_undirected_connectable command with advertising filter policy parameter set to 0x03: "Allow Scan Request from Filter Accept List Only, Allow Connect Request from Filter Accept List Only".
HCI_LE_ADVERTISING_REPORT events are sent by the device without AD_TYPE_FLAGS but it answers to scan request from devices in the filter accept list.
3. For advertiser and scanner
To add a device in the filter accept list:
If the devices are bonded:
- Use aci_gap_get_bonded_devices to know the address type and address of bonded devices.
- Then, use aci_gap_configure_filter_accept_list, which adds bonded devices address and address type to the filter accept list.
In case devices are not bonded, it is possible to add devices to the filter accept list using:
- aci_gap_add_devices_to_list and set Mode parameter either to Append to the Filter Accept List Only (0x02) or to clear and set to Filter Accept List only (0x03).
The filter accept list is written in RAM.
4. For scanner
Another possibility is to use for connection:
aci_gap_start_auto_connection_establish_proc
aci_gap_start_selective_connection_establish_proc
These commands allow the adding of devices in the filter accept list at connection.
With aci_gap_start_selective_connection_establish_proc command, scanning_filter_policy parameter set to "ignore device not in the whitelist" allows the device to receive LE_ADVERTISING_EVENT from devices in the filter accept list.
5. First example: Connection between a smartphone and a STM32WB-WBA
5.1. First phase - add a device in filter accept list - connection and pairing
After pairing, smartphones that are using resolvable private address (RPA), modify their own RPA.
For the STM32WB-WBA to be able to resolve the peer address, it is necessary to initialize the device with privacy enable and add peer address to resolving list using aci_gap_add_devices_to resolving_list and aci_gap_configure_filter_accept_list or aci_gap_add_devices_to_list with Mode set to Append to both resolving and Filter Accept List (0x04) or Clear and set both resolving and Filter Accept List (0x05).
5.2. Second phase - add a device in filter accept list and resolving list - connection and pairing
6. Second example: Connection between two STM32WB-WBA
6.1. First phase - add a device in filter accept list - connection and pairing
6.2. Second phase - add a device in filter accept list - connection and pairing
7. References