Skip to content

Commit 3db68d9

Browse files
rahult-githubsjanc
authored andcommitted
nimble/host: Add support for Anonymous address type
Devices can send anonymous address type during advertising Add support for this address type needed while Adding device to filter accept list
1 parent 0061748 commit 3db68d9

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

nimble/host/src/ble_gap.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2404,7 +2404,8 @@ ble_gap_wl_tx_add(const ble_addr_t *addr)
24042404
{
24052405
struct ble_hci_le_add_whte_list_cp cmd;
24062406

2407-
if (addr->type > BLE_ADDR_RANDOM) {
2407+
if (addr->type > BLE_ADDR_RANDOM &&
2408+
addr->type != BLE_ADDR_ANONYMOUS) {
24082409
return BLE_HS_EINVAL;
24092410
}
24102411

@@ -2459,7 +2460,8 @@ ble_gap_wl_set(const ble_addr_t *addrs, uint8_t white_list_count)
24592460

24602461
for (i = 0; i < white_list_count; i++) {
24612462
if (addrs[i].type != BLE_ADDR_PUBLIC &&
2462-
addrs[i].type != BLE_ADDR_RANDOM) {
2463+
addrs[i].type != BLE_ADDR_RANDOM &&
2464+
addrs[i].type != BLE_ADDR_ANONYMOUS) {
24632465

24642466
rc = BLE_HS_EINVAL;
24652467
goto done;

nimble/include/nimble/ble.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,12 @@ enum ble_error_codes
359359
*/
360360
#define BLE_ADDR_RANDOM_ID (0x03)
361361

362+
/**
363+
* Bluetooth Device Address Type: Anonymous
364+
* (Corresponds to devices sending anonymous advertisements).
365+
*/
366+
#define BLE_ADDR_ANONYMOUS (0xFF)
367+
362368
/** @} */
363369

364370
/**

0 commit comments

Comments
 (0)