This is an automated email from the ASF dual-hosted git repository.

janc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git


The following commit(s) were added to refs/heads/master by this push:
     new 3db68d930 nimble/host: Add support for Anonymous address type
3db68d930 is described below

commit 3db68d930d19b81ed6f1b33ce413847863359eb3
Author: Rahul Tank <[email protected]>
AuthorDate: Wed May 7 17:22:28 2025 +0530

    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
---
 nimble/host/src/ble_gap.c   | 6 ++++--
 nimble/include/nimble/ble.h | 6 ++++++
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/nimble/host/src/ble_gap.c b/nimble/host/src/ble_gap.c
index 6369b4478..64f96bd27 100644
--- a/nimble/host/src/ble_gap.c
+++ b/nimble/host/src/ble_gap.c
@@ -2404,7 +2404,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;
     }
 
@@ -2459,7 +2460,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;
diff --git a/nimble/include/nimble/ble.h b/nimble/include/nimble/ble.h
index d5e41a37c..0370f966c 100644
--- a/nimble/include/nimble/ble.h
+++ b/nimble/include/nimble/ble.h
@@ -359,6 +359,12 @@ enum ble_error_codes
  */
 #define BLE_ADDR_RANDOM_ID   (0x03)
 
+/**
+ * Bluetooth Device Address Type: Anonymous
+ * (Corresponds to devices sending anonymous advertisements).
+ */
+#define BLE_ADDR_ANONYMOUS   (0xFF)
+
 /** @} */
 
 /**

Reply via email to