Telink TLSR8232 BLE SDK Developer Handbook
AN-19112700-E1
82
Ver.1.0.0
3.2.8.16 Whitelist & Resolvinglist
As introduced above,
“filter_policy” of Advertising involves Whitelist, and actual
operations depend on devices in Whitelist. Actually Whitelist contains two parts: Whitelist
and Resolvinglist.
Users can check whether address type of peer device is RPA (Resolvable Private
Address) via
“peer_addr_type” and “peer_addr”. The API below can be called directly.
#define
IS_NON_RESOLVABLE_PRIVATE_ADDR(type, addr)
( (type)==BLE_ADDR_RANDOM && (addr[5] & 0xC0) == 0x00 )
Only non-RPA address can be stored in whitelist. In current SDK, whitelist can store up
to four devices.
#define
MAX_WHITE_LIST_SIZE
4
The API below is for whitelist reset:
ble_sts_t
ll_whiteList_reset
(
void
);
The return value is “BLE_SUCCESS”.
ble_sts_t
ll_whiteList_add
(
u8
type,
u8
*addr);
Add a device to whitelist and the return values are shown below:
ble_sts_t
Value
ERR Reason
BLE_SUCCESS
0
Add success
HCI_ERR_MEM_CAP_EXCEE
DED
0x07
Whitelist is full, add failure
ble_sts_t
ll_whiteList_delete
(
u8
type,
u8
*addr);
Delete a device from whitelist and t
he return value is “BLE_SUCCESS”.
RPA (Resolvable Private Address) device needs to use Resolvinglist. To save RAM
space, “Resolvinglist” can store up to two devices only in current SDK.
#define
MAX_WHITE_IRK_LIST_SIZE 2
The API below is for Resolvinglist reset:
ble_sts_t
ll_resolvingList_reset
(
void
);
Reset Resolvinglist, t
he return value is “BLE_SUCCESS”.
ble_sts_t
ll_resolvingList_setAddrResolutionEnable
(
u8
resolutionEn);
The API above is for address resolution. Resolvinglist must be enabled for address
resolution. It can be disabled if there is no need for address resolution.
ble_sts_t
ll_resolvingList_add
(
u8
peerIdAddrType,
u8
*peerIdAddr,
u8
*peer_irk,
u8
*local_irk);
peerIdAddrType/ peerIdAddr and peer-irk indicate identity address and irk declared by
peer device. These information will be stored into Flash during pairing encryption