Skip to content

Commit 2af2919

Browse files
authored
Merge branch 'espressif:release/v5.1' into release/v5.1
2 parents 464b3e0 + 632e0c2 commit 2af2919

File tree

33 files changed

+376
-83
lines changed

33 files changed

+376
-83
lines changed

components/bt/common/btc/profile/esp/blufi/nimble_host/esp_blufi.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,8 +442,10 @@ uint8_t esp_blufi_init(void)
442442
void esp_blufi_deinit(void)
443443
{
444444
blufi_env.enabled = false;
445-
btc_msg_t msg;
446445
esp_blufi_cb_param_t param;
446+
btc_msg_t msg;
447+
memset (&msg, 0x0, sizeof (msg));
448+
msg.sig = BTC_SIG_API_CB;
447449
msg.pid = BTC_PID_BLUFI;
448450
msg.act = ESP_BLUFI_EVENT_DEINIT_FINISH;
449451
param.deinit_finish.state = ESP_BLUFI_DEINIT_OK;

components/bt/host/bluedroid/api/include/api/esp_gap_bt_api.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -406,8 +406,9 @@ typedef union {
406406
* @brief ESP_BT_GAP_MODE_CHG_EVT
407407
*/
408408
struct mode_chg_param {
409-
esp_bd_addr_t bda; /*!< remote bluetooth device address*/
410-
esp_bt_pm_mode_t mode; /*!< PM mode*/
409+
esp_bd_addr_t bda; /*!< remote bluetooth device address */
410+
esp_bt_pm_mode_t mode; /*!< PM mode */
411+
uint16_t interval; /*!< Number of baseband slots. unit is 0.625ms */
411412
} mode_chg; /*!< mode change event parameter struct */
412413

413414
/**

components/bt/host/bluedroid/bta/dm/bta_dm_pm.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ void bta_dm_init_pm(void)
7575
{
7676
memset(&bta_dm_conn_srvcs, 0x00, sizeof(bta_dm_conn_srvcs));
7777

78-
/* if there are no power manger entries, so not register */
78+
/* if there are no power manager entries, so not register */
7979
if (p_bta_dm_pm_cfg[0].app_id != 0) {
8080
bta_sys_pm_register((tBTA_SYS_CONN_CBACK *)bta_dm_pm_cback);
8181

@@ -694,9 +694,9 @@ static BOOLEAN bta_dm_pm_sniff(tBTA_DM_PEER_DEVICE *p_peer_dev, UINT8 index)
694694
#endif
695695
{
696696
#if (BTM_SSR_INCLUDED == TRUE)
697-
/* Dont initiate Sniff if controller has alreay accepted
697+
/* Dont initiate Sniff if controller has already accepted
698698
* remote sniff params. This avoid sniff loop issue with
699-
* some agrresive headsets who use sniff latencies more than
699+
* some aggressive headsets who use sniff latencies more than
700700
* DUT supported range of Sniff intervals.*/
701701
if ((mode == BTM_PM_MD_SNIFF) && (p_peer_dev->info & BTA_DM_DI_ACP_SNIFF)) {
702702
APPL_TRACE_DEBUG("%s: already in remote initiate sniff", __func__);
@@ -917,7 +917,7 @@ void bta_dm_pm_btm_status(tBTA_DM_MSG *p_data)
917917
} else {
918918
#if (BTM_SSR_INCLUDED == TRUE)
919919
if (p_dev->prev_low) {
920-
/* need to send the SSR paramaters to controller again */
920+
/* need to send the SSR parameters to controller again */
921921
bta_dm_pm_ssr(p_dev->peer_bdaddr);
922922
}
923923
p_dev->prev_low = BTM_PM_STS_ACTIVE;
@@ -980,6 +980,7 @@ void bta_dm_pm_btm_status(tBTA_DM_MSG *p_data)
980980
) {
981981
tBTA_DM_SEC conn;
982982
conn.mode_chg.mode = p_data->pm_status.status;
983+
conn.mode_chg.interval = p_data->pm_status.value;
983984
bdcpy(conn.mode_chg.bd_addr, p_data->pm_status.bd_addr);
984985
bta_dm_cb.p_sec_cback(BTA_DM_PM_MODE_CHG_EVT, (tBTA_DM_SEC *)&conn);
985986
}

components/bt/host/bluedroid/bta/include/bta/bta_api.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -993,6 +993,7 @@ typedef struct {
993993
typedef struct {
994994
BD_ADDR bd_addr; /* BD address peer device. */
995995
tBTA_PM_MODE mode; /* the new connection role */
996+
UINT16 interval; /* Number of baseband slots */
996997
} tBTA_DM_MODE_CHG;
997998

998999
typedef struct {

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -602,6 +602,7 @@ static void btc_dm_pm_mode_chg_evt(tBTA_DM_MODE_CHG *p_mode_chg)
602602
msg->act = BTC_GAP_BT_MODE_CHG_EVT;
603603
memcpy(param.mode_chg.bda, p_mode_chg->bd_addr, ESP_BD_ADDR_LEN);
604604
param.mode_chg.mode = p_mode_chg->mode;
605+
param.mode_chg.interval= p_mode_chg->interval;
605606
memcpy(msg->arg, &param, sizeof(esp_bt_gap_cb_param_t));
606607

607608
ret = btc_inter_profile_call(msg);

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,10 @@ static BOOLEAN btm_ble_match_random_bda(tBTM_SEC_DEV_REC *p_dev_rec)
384384
void btm_ble_resolve_random_addr(BD_ADDR random_bda, tBTM_BLE_RESOLVE_CBACK *p_cback, void *p)
385385
{
386386
#if (SMP_INCLUDED == TRUE)
387+
if (btm_cb.addr_res_en == FALSE) {
388+
return;
389+
}
390+
387391
tBTM_LE_RANDOM_CB *p_mgnt_cb = &btm_cb.ble_ctr_cb.addr_mgnt_cb;
388392
list_node_t *p_node = NULL;
389393
tBTM_SEC_DEV_REC *p_dev_rec = NULL;
@@ -458,6 +462,10 @@ tBTM_SEC_DEV_REC *btm_find_dev_by_identity_addr(BD_ADDR bd_addr, UINT8 addr_type
458462
BOOLEAN btm_identity_addr_to_random_pseudo(BD_ADDR bd_addr, UINT8 *p_addr_type, BOOLEAN refresh)
459463
{
460464
#if BLE_PRIVACY_SPT == TRUE
465+
if (btm_cb.addr_res_en == FALSE) {
466+
return TRUE;
467+
}
468+
461469
tBTM_SEC_DEV_REC *p_dev_rec = btm_find_dev_by_identity_addr(bd_addr, *p_addr_type);
462470

463471
BTM_TRACE_EVENT ("%s", __func__);
@@ -491,6 +499,10 @@ BOOLEAN btm_identity_addr_to_random_pseudo(BD_ADDR bd_addr, UINT8 *p_addr_type,
491499
BOOLEAN btm_random_pseudo_to_identity_addr(BD_ADDR random_pseudo, UINT8 *p_static_addr_type)
492500
{
493501
#if BLE_PRIVACY_SPT == TRUE
502+
if (btm_cb.addr_res_en == FALSE) {
503+
return TRUE;
504+
}
505+
494506
tBTM_SEC_DEV_REC *p_dev_rec = btm_find_dev (random_pseudo);
495507

496508
if (p_dev_rec != NULL) {

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ void btm_init (void)
8484
#if BLE_INCLUDED == TRUE
8585
btm_ble_lock_init();
8686
btm_ble_sem_init();
87+
btm_cb.addr_res_en = TRUE;
8788
#endif
8889
btm_sec_dev_init();
8990
#if (BLE_50_FEATURE_SUPPORT == TRUE)
@@ -133,3 +134,10 @@ uint8_t btm_acl_active_count(void)
133134

134135
return count;
135136
}
137+
138+
void btm_ble_addr_resolve_enable(bool enable)
139+
{
140+
#if (BLE_INCLUDED == TRUE)
141+
btm_cb.addr_res_en = enable;
142+
#endif
143+
}

components/bt/host/bluedroid/stack/btm/include/btm_int.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -876,6 +876,7 @@ typedef struct {
876876
UINT16 ediv; /* received ediv value from LTK request */
877877
UINT8 key_size;
878878
tBTM_BLE_VSC_CB cmn_ble_vsc_cb;
879+
BOOLEAN addr_res_en; /* internal use for test: address resolution enable/disable */
879880
#endif
880881

881882
/* Packet types supported by the local device */

0 commit comments

Comments
 (0)