From 5486241e449054bd48a0f5a89a340fd4ad0d5f98 Mon Sep 17 00:00:00 2001 From: zhanghaipeng Date: Thu, 26 Sep 2024 19:49:40 +0800 Subject: [PATCH] feat(ble/bluedroid): Optimize address resolution status for interval use --- components/bt/host/bluedroid/btc/core/btc_main.c | 6 +++--- components/bt/host/bluedroid/btc/include/btc/btc_main.h | 2 +- components/bt/host/bluedroid/stack/btm/btm_main.c | 7 ++++--- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/components/bt/host/bluedroid/btc/core/btc_main.c b/components/bt/host/bluedroid/btc/core/btc_main.c index b170315b46..de90708e6b 100644 --- a/components/bt/host/bluedroid/btc/core/btc_main.c +++ b/components/bt/host/bluedroid/btc/core/btc_main.c @@ -142,9 +142,9 @@ uint32_t btc_get_ble_status(void) } // 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); + extern uint8_t btm_get_ble_addr_resolve_disable_status(void); + if (btm_get_ble_addr_resolve_disable_status()) { + status |= BIT(BTC_BLE_STATUS_ADDR_RESOLVE_DISABLE); } #if (SMP_INCLUDED == TRUE) 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 66495a090c..e9b6f5ba2a 100644 --- a/components/bt/host/bluedroid/btc/include/btc/btc_main.h +++ b/components/bt/host/bluedroid/btc/include/btc/btc_main.h @@ -40,7 +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 + BTC_BLE_STATUS_ADDR_RESOLVE_DISABLE,// Address resolution disable 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 ba7f041d99..e9e443380c 100644 --- a/components/bt/host/bluedroid/stack/btm/btm_main.c +++ b/components/bt/host/bluedroid/stack/btm/btm_main.c @@ -135,10 +135,11 @@ 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) +// Address resolution status +uint8_t btm_get_ble_addr_resolve_disable_status(void) { - return (uint8_t) btm_cb.addr_res_en; + // Returns false if address resolution is enabled, true if disabled + return (btm_cb.addr_res_en) ? 0 : 1; } void btm_ble_addr_resolve_enable(bool enable)