mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Merge branch 'bugfix/btdm_fix_stop_adv_error_in_dual_core_v3.1' into 'release/v3.1'
component/bt: fix stop adv error in dual core for v3.1 See merge request idf/esp-idf!2661
This commit is contained in:
commit
f4f563bc7b
@ -3492,15 +3492,30 @@ tBTM_STATUS btm_ble_stop_adv(void)
|
|||||||
tBTM_STATUS rt = BTM_SUCCESS;
|
tBTM_STATUS rt = BTM_SUCCESS;
|
||||||
|
|
||||||
if (p_cb->adv_mode == BTM_BLE_ADV_ENABLE) {
|
if (p_cb->adv_mode == BTM_BLE_ADV_ENABLE) {
|
||||||
if (btsnd_hcic_ble_set_adv_enable (BTM_BLE_ADV_DISABLE)) {
|
UINT8 temp_adv_mode = p_cb->adv_mode;
|
||||||
p_cb->fast_adv_on = FALSE;
|
BOOLEAN temp_fast_adv_on = p_cb->fast_adv_on;
|
||||||
p_cb->adv_mode = BTM_BLE_ADV_DISABLE;
|
tBTM_BLE_GAP_STATE temp_state = p_cb->state;
|
||||||
p_cb->state = BTM_BLE_ADV_PENDING;
|
tBTM_BLE_WL_STATE temp_wl_state = btm_cb.ble_ctr_cb.wl_state;
|
||||||
btm_cb.ble_ctr_cb.wl_state &= ~BTM_BLE_WL_ADV;
|
tBTM_BLE_STATE_MASK temp_mask = btm_ble_get_topology_mask ();
|
||||||
|
|
||||||
|
p_cb->fast_adv_on = FALSE;
|
||||||
|
p_cb->adv_mode = BTM_BLE_ADV_DISABLE;
|
||||||
|
p_cb->state = BTM_BLE_ADV_PENDING;
|
||||||
|
btm_cb.ble_ctr_cb.wl_state &= ~BTM_BLE_WL_ADV;
|
||||||
|
|
||||||
|
/* clear all adv states */
|
||||||
|
btm_ble_clear_topology_mask (BTM_BLE_STATE_ALL_ADV_MASK);
|
||||||
|
|
||||||
|
if (btsnd_hcic_ble_set_adv_enable (BTM_BLE_ADV_DISABLE)) {
|
||||||
|
|
||||||
/* clear all adv states */
|
|
||||||
btm_ble_clear_topology_mask (BTM_BLE_STATE_ALL_ADV_MASK);
|
|
||||||
} else {
|
} else {
|
||||||
|
// reset state
|
||||||
|
p_cb->fast_adv_on = temp_fast_adv_on;
|
||||||
|
p_cb->adv_mode = temp_adv_mode;
|
||||||
|
p_cb->state = temp_state;
|
||||||
|
btm_cb.ble_ctr_cb.wl_state = temp_wl_state;
|
||||||
|
btm_ble_set_topology_mask (temp_mask);
|
||||||
|
|
||||||
rt = BTM_NO_RESOURCES;
|
rt = BTM_NO_RESOURCES;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3745,6 +3760,20 @@ BOOLEAN btm_ble_clear_topology_mask (tBTM_BLE_STATE_MASK request_state_mask)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
**
|
||||||
|
** Function btm_ble_get_topology_mask
|
||||||
|
**
|
||||||
|
** Description Get BLE topology bit mask
|
||||||
|
**
|
||||||
|
** Returns state mask.
|
||||||
|
**
|
||||||
|
*******************************************************************************/
|
||||||
|
tBTM_BLE_STATE_MASK btm_ble_get_topology_mask (void)
|
||||||
|
{
|
||||||
|
return btm_cb.ble_ctr_cb.cur_states;
|
||||||
|
}
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
**
|
**
|
||||||
** Function btm_ble_update_link_topology_mask
|
** Function btm_ble_update_link_topology_mask
|
||||||
|
@ -481,6 +481,7 @@ void btm_ble_adv_filter_cleanup(void);
|
|||||||
BOOLEAN btm_ble_topology_check(tBTM_BLE_STATE_MASK request);
|
BOOLEAN btm_ble_topology_check(tBTM_BLE_STATE_MASK request);
|
||||||
BOOLEAN btm_ble_clear_topology_mask(tBTM_BLE_STATE_MASK request_state);
|
BOOLEAN btm_ble_clear_topology_mask(tBTM_BLE_STATE_MASK request_state);
|
||||||
BOOLEAN btm_ble_set_topology_mask(tBTM_BLE_STATE_MASK request_state);
|
BOOLEAN btm_ble_set_topology_mask(tBTM_BLE_STATE_MASK request_state);
|
||||||
|
tBTM_BLE_STATE_MASK btm_ble_get_topology_mask(void);
|
||||||
|
|
||||||
#if BTM_BLE_CONFORMANCE_TESTING == TRUE
|
#if BTM_BLE_CONFORMANCE_TESTING == TRUE
|
||||||
void btm_ble_set_no_disc_if_pair_fail (BOOLEAN disble_disc);
|
void btm_ble_set_no_disc_if_pair_fail (BOOLEAN disble_disc);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user