From 8db992903acf22446b3bd37466de04f2409200e2 Mon Sep 17 00:00:00 2001 From: Zhang Hai Peng Date: Wed, 25 Sep 2024 12:13:19 +0800 Subject: [PATCH] feat(ble/bluedroid): Support resolve BLE address for interval usage (cherry picked from commit b88b511362e4fa8da70d59df04bbc172a52c9e59) Co-authored-by: zhanghaipeng --- components/bt/host/bluedroid/btc/core/btc_main.c | 6 ++++++ components/bt/host/bluedroid/btc/include/btc/btc_main.h | 1 + components/bt/host/bluedroid/stack/btm/btm_main.c | 9 +++++++-- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/components/bt/host/bluedroid/btc/core/btc_main.c b/components/bt/host/bluedroid/btc/core/btc_main.c index c1c694b8a2..b170315b46 100644 --- a/components/bt/host/bluedroid/btc/core/btc_main.c +++ b/components/bt/host/bluedroid/btc/core/btc_main.c @@ -141,6 +141,12 @@ uint32_t btc_get_ble_status(void) status |= BIT(BTC_BLE_STATUS_CONN); } + // Address resolve status + extern uint8_t btm_get_ble_addr_resolve_status(void); + if (btm_get_ble_addr_resolve_status()) { + status |= BIT(BTC_BLE_STATUS_ADDR_RESOLVE); + } + #if (SMP_INCLUDED == TRUE) // Number of recorded devices extern uint8_t btm_ble_sec_dev_active_count(void); diff --git a/components/bt/host/bluedroid/btc/include/btc/btc_main.h b/components/bt/host/bluedroid/btc/include/btc/btc_main.h index df20a63878..66495a090c 100644 --- a/components/bt/host/bluedroid/btc/include/btc/btc_main.h +++ b/components/bt/host/bluedroid/btc/include/btc/btc_main.h @@ -40,6 +40,7 @@ typedef enum { BTC_BLE_STATUS_GATTC_APP, // GATTC application exist BTC_BLE_STATUS_GATTS_SRVC, // GATTS service exist BTC_BLE_STATUS_PRIVACY, // Privacy enabled + BTC_BLE_STATUS_ADDR_RESOLVE,// Address resolution status } tBTC_BLE_STATUS; future_t **btc_main_get_future_p(btc_main_future_type_t type); diff --git a/components/bt/host/bluedroid/stack/btm/btm_main.c b/components/bt/host/bluedroid/stack/btm/btm_main.c index c7b5b8b6c0..ba7f041d99 100644 --- a/components/bt/host/bluedroid/stack/btm/btm_main.c +++ b/components/bt/host/bluedroid/stack/btm/btm_main.c @@ -134,10 +134,15 @@ uint8_t btm_acl_active_count(void) return count; } +#if (BLE_INCLUDED == TRUE) +// address resolution status +uint8_t btm_get_ble_addr_resolve_status(void) +{ + return (uint8_t) btm_cb.addr_res_en; +} void btm_ble_addr_resolve_enable(bool enable) { -#if (BLE_INCLUDED == TRUE) btm_cb.addr_res_en = enable; -#endif } +#endif /*BLE_INCLUDED*/