Skip to content

Commit 497d5e0

Browse files
committed
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
2 parents 4b666f7 + 74cc3eb commit 497d5e0

File tree

7 files changed

+32
-7
lines changed

7 files changed

+32
-7
lines changed

components/bt/controller/esp32/bt.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1690,7 +1690,10 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
16901690

16911691
btdm_cfg_mask = btdm_config_mask_load();
16921692

1693-
if (btdm_controller_init(btdm_cfg_mask, cfg) != 0) {
1693+
err = btdm_controller_init(btdm_cfg_mask, cfg);
1694+
1695+
if (err != 0) {
1696+
ESP_LOGE(BTDM_LOG_TAG, "%s %d\n",__func__,err);
16941697
err = ESP_ERR_NO_MEM;
16951698
goto error;
16961699
}

components/bt/controller/esp32c3/bt.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1463,7 +1463,10 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
14631463
periph_module_enable(PERIPH_BT_MODULE);
14641464
periph_module_reset(PERIPH_BT_MODULE);
14651465

1466-
if (btdm_controller_init(cfg) != 0) {
1466+
err = btdm_controller_init(cfg);
1467+
1468+
if (err != 0) {
1469+
ESP_LOGE(BT_LOG_TAG, "%s %d\n",__func__,err);
14671470
err = ESP_ERR_NO_MEM;
14681471
goto error;
14691472
}

components/bt/host/bluedroid/Kconfig.in

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ config BT_A2DP_ENABLE
5959
depends on BT_CLASSIC_ENABLED
6060
default n
6161
help
62-
Advanced Audio Distrubution Profile
62+
Advanced Audio Distribution Profile
6363

6464
config BT_SPP_ENABLED
6565
bool "SPP"
@@ -114,7 +114,7 @@ config BT_HFP_WBS_ENABLE
114114
default y
115115
help
116116
This enables Wide Band Speech. Should disable it when SCO data path is PCM.
117-
Otherwise there will be no data transmited via GPIOs.
117+
Otherwise there will be no data transmitted via GPIOs.
118118

119119

120120
menuconfig BT_HID_ENABLED
@@ -1065,7 +1065,7 @@ config BT_ACL_CONNECTIONS
10651065
is used.
10661066

10671067
config BT_MULTI_CONNECTION_ENBALE
1068-
bool "Enable BLE multi-conections"
1068+
bool "Enable BLE multi-connections"
10691069
depends on BT_BLE_ENABLED
10701070
default y
10711071
help

components/bt/host/bluedroid/btc/core/btc_main.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,12 @@ uint32_t btc_get_ble_status(void)
141141
status |= BIT(BTC_BLE_STATUS_CONN);
142142
}
143143

144+
// Address resolve status
145+
extern uint8_t btm_get_ble_addr_resolve_disable_status(void);
146+
if (btm_get_ble_addr_resolve_disable_status()) {
147+
status |= BIT(BTC_BLE_STATUS_ADDR_RESOLVE_DISABLE);
148+
}
149+
144150
#if (SMP_INCLUDED == TRUE)
145151
// Number of recorded devices
146152
extern uint8_t btm_ble_sec_dev_active_count(void);

components/bt/host/bluedroid/btc/include/btc/btc_main.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ typedef enum {
4040
BTC_BLE_STATUS_GATTC_APP, // GATTC application exist
4141
BTC_BLE_STATUS_GATTS_SRVC, // GATTS service exist
4242
BTC_BLE_STATUS_PRIVACY, // Privacy enabled
43+
BTC_BLE_STATUS_ADDR_RESOLVE_DISABLE,// Address resolution disable status
4344
} tBTC_BLE_STATUS;
4445

4546
future_t **btc_main_get_future_p(btc_main_future_type_t type);

components/bt/host/bluedroid/hci/packet_fragmenter.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,12 @@ static void reassemble_and_dispatch(BT_HDR *packet)
171171
return;
172172
}
173173
partial_packet = (BT_HDR *)osi_calloc(full_length + sizeof(BT_HDR));
174+
175+
if (partial_packet == NULL) {
176+
HCI_TRACE_WARNING("%s full_length %d no memory.\n", __func__, full_length);
177+
assert(0);
178+
}
179+
174180
partial_packet->event = packet->event;
175181
partial_packet->len = full_length;
176182
partial_packet->offset = packet->len;

components/bt/host/bluedroid/stack/btm/btm_main.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,16 @@ uint8_t btm_acl_active_count(void)
134134

135135
return count;
136136
}
137+
#if (BLE_INCLUDED == TRUE)
138+
// Address resolution status
139+
uint8_t btm_get_ble_addr_resolve_disable_status(void)
140+
{
141+
// Returns false if address resolution is enabled, true if disabled
142+
return (btm_cb.addr_res_en) ? 0 : 1;
143+
}
137144

138145
void btm_ble_addr_resolve_enable(bool enable)
139146
{
140-
#if (BLE_INCLUDED == TRUE)
141147
btm_cb.addr_res_en = enable;
142-
#endif
143148
}
149+
#endif /*BLE_INCLUDED*/

0 commit comments

Comments
 (0)