fix(nimble): Add support for anonymous address type for whitelist

This commit is contained in:
Rahul Tank
2025-05-07 17:13:54 +05:30
parent 0cc70adeba
commit 6fb5ece270
2 changed files with 5 additions and 2 deletions
+4 -2
View File
@@ -3126,7 +3126,8 @@ ble_gap_wl_tx_add(const ble_addr_t *addr)
{
struct ble_hci_le_add_whte_list_cp cmd;
if (addr->type > BLE_ADDR_RANDOM) {
if (addr->type > BLE_ADDR_RANDOM &&
addr->type != BLE_ADDR_ANONYMOUS) {
return BLE_HS_EINVAL;
}
@@ -3206,7 +3207,8 @@ ble_gap_wl_set(const ble_addr_t *addrs, uint8_t white_list_count)
for (i = 0; i < white_list_count; i++) {
if (addrs[i].type != BLE_ADDR_PUBLIC &&
addrs[i].type != BLE_ADDR_RANDOM) {
addrs[i].type != BLE_ADDR_RANDOM &&
addrs[i].type != BLE_ADDR_ANONYMOUS) {
rc = BLE_HS_EINVAL;
goto done;
+1
View File
@@ -282,6 +282,7 @@ enum ble_error_codes
#define BLE_ADDR_RANDOM (0x01)
#define BLE_ADDR_PUBLIC_ID (0x02)
#define BLE_ADDR_RANDOM_ID (0x03)
#define BLE_ADDR_ANONYMOUS (0xFF)
#define BLE_ADDR_ANY (&(ble_addr_t) { 0, {0, 0, 0, 0, 0, 0} })