Merge branch 'feat/get_ble_resolve_address_status_v5.0' into 'release/v5.0'

feat(ble/bluedroid): Support resolve BLE address for interval usage (v5.0)

See merge request espressif/esp-idf!33805
This commit is contained in:
Island 2024-09-29 10:30:15 +08:00
commit 497d5e0c8d
7 changed files with 32 additions and 7 deletions

View File

@ -1690,7 +1690,10 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
btdm_cfg_mask = btdm_config_mask_load(); btdm_cfg_mask = btdm_config_mask_load();
if (btdm_controller_init(btdm_cfg_mask, cfg) != 0) { err = btdm_controller_init(btdm_cfg_mask, cfg);
if (err != 0) {
ESP_LOGE(BTDM_LOG_TAG, "%s %d\n",__func__,err);
err = ESP_ERR_NO_MEM; err = ESP_ERR_NO_MEM;
goto error; goto error;
} }

View File

@ -1463,7 +1463,10 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
periph_module_enable(PERIPH_BT_MODULE); periph_module_enable(PERIPH_BT_MODULE);
periph_module_reset(PERIPH_BT_MODULE); periph_module_reset(PERIPH_BT_MODULE);
if (btdm_controller_init(cfg) != 0) { err = btdm_controller_init(cfg);
if (err != 0) {
ESP_LOGE(BT_LOG_TAG, "%s %d\n",__func__,err);
err = ESP_ERR_NO_MEM; err = ESP_ERR_NO_MEM;
goto error; goto error;
} }

View File

@ -59,7 +59,7 @@ config BT_A2DP_ENABLE
depends on BT_CLASSIC_ENABLED depends on BT_CLASSIC_ENABLED
default n default n
help help
Advanced Audio Distrubution Profile Advanced Audio Distribution Profile
config BT_SPP_ENABLED config BT_SPP_ENABLED
bool "SPP" bool "SPP"
@ -114,7 +114,7 @@ config BT_HFP_WBS_ENABLE
default y default y
help help
This enables Wide Band Speech. Should disable it when SCO data path is PCM. This enables Wide Band Speech. Should disable it when SCO data path is PCM.
Otherwise there will be no data transmited via GPIOs. Otherwise there will be no data transmitted via GPIOs.
menuconfig BT_HID_ENABLED menuconfig BT_HID_ENABLED
@ -1065,7 +1065,7 @@ config BT_ACL_CONNECTIONS
is used. is used.
config BT_MULTI_CONNECTION_ENBALE config BT_MULTI_CONNECTION_ENBALE
bool "Enable BLE multi-conections" bool "Enable BLE multi-connections"
depends on BT_BLE_ENABLED depends on BT_BLE_ENABLED
default y default y
help help

View File

@ -141,6 +141,12 @@ uint32_t btc_get_ble_status(void)
status |= BIT(BTC_BLE_STATUS_CONN); status |= BIT(BTC_BLE_STATUS_CONN);
} }
// Address resolve status
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) #if (SMP_INCLUDED == TRUE)
// Number of recorded devices // Number of recorded devices
extern uint8_t btm_ble_sec_dev_active_count(void); extern uint8_t btm_ble_sec_dev_active_count(void);

View File

@ -40,6 +40,7 @@ typedef enum {
BTC_BLE_STATUS_GATTC_APP, // GATTC application exist BTC_BLE_STATUS_GATTC_APP, // GATTC application exist
BTC_BLE_STATUS_GATTS_SRVC, // GATTS service exist BTC_BLE_STATUS_GATTS_SRVC, // GATTS service exist
BTC_BLE_STATUS_PRIVACY, // Privacy enabled BTC_BLE_STATUS_PRIVACY, // Privacy enabled
BTC_BLE_STATUS_ADDR_RESOLVE_DISABLE,// Address resolution disable status
} tBTC_BLE_STATUS; } tBTC_BLE_STATUS;
future_t **btc_main_get_future_p(btc_main_future_type_t type); future_t **btc_main_get_future_p(btc_main_future_type_t type);

View File

@ -171,6 +171,12 @@ static void reassemble_and_dispatch(BT_HDR *packet)
return; return;
} }
partial_packet = (BT_HDR *)osi_calloc(full_length + sizeof(BT_HDR)); partial_packet = (BT_HDR *)osi_calloc(full_length + sizeof(BT_HDR));
if (partial_packet == NULL) {
HCI_TRACE_WARNING("%s full_length %d no memory.\n", __func__, full_length);
assert(0);
}
partial_packet->event = packet->event; partial_packet->event = packet->event;
partial_packet->len = full_length; partial_packet->len = full_length;
partial_packet->offset = packet->len; partial_packet->offset = packet->len;

View File

@ -134,10 +134,16 @@ uint8_t btm_acl_active_count(void)
return count; return count;
} }
#if (BLE_INCLUDED == TRUE)
// Address resolution status
uint8_t btm_get_ble_addr_resolve_disable_status(void)
{
// 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) void btm_ble_addr_resolve_enable(bool enable)
{ {
#if (BLE_INCLUDED == TRUE)
btm_cb.addr_res_en = enable; btm_cb.addr_res_en = enable;
#endif
} }
#endif /*BLE_INCLUDED*/