STM32WB-WBA Filter Accept List

Revision as of 12:03, 29 August 2023 by Registered User (→‎From advertiser point of view)
Under construction.png Coming soon

1. STM32WB-WBA - Bluetooth® Low Energy (BLE) Filter Accept List

Connection Accept List filters devices based on a list of Bluetooth addresses on both central and peripheral side.
If accept list is on the central side, scan results from non-listed devices are dropped and connecting to non-listed 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 non-listed devices are dropped).

2. From advertiser point of view

As soon as a device advertises with the parameter "allow scan request - allow connect request from devices in white list" (use of aci_gap_set_undirected_connectable, advertising filter policy = 0x03)
No HCI_LE_ADVERTISING_REPORT events are sent by the device but it answers to SCAN_REQ.

3. For advertiser and scanner

To add a device in white list, devices need to be bonded.
To know the addresses of the bonded devices: use of aci_gap_get_bonded_devices thanks to which we get the number of bonded devices, address types and addresses of bonded devices.
Then use aci_gap_configure_whitelist or aci_gap_add_devices_to_list.
The whitelist is written in RAM.

4. For scanner

An other possibility is to use for connection:
aci_gap_start_auto_connection_establish_proc
aci_gap_start_selective_connection_establish_proc

These commands allow the add of devices in whitelist 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 whitelist.

5. First example: Connection between a smartphone and a STM32WB

5.1. first phase - add a device in Filter Accept List - connection and pairing

5.2. second phase - add a device in Filter Accept List - connection and pairing

6. Second example: Connection between two STM32WB

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

6.3. References