mirror of
https://github.com/espressif/esp-idf.git
synced 2025-07-30 10:47:19 +02:00
fix(bt/bluedroid): Fix ble adv and scan status when deinit bluedroid
This commit is contained in:
@ -577,6 +577,14 @@ void bta_dm_disable (tBTA_DM_MSG *p_data)
|
|||||||
bta_dm_disable_search_and_disc();
|
bta_dm_disable_search_and_disc();
|
||||||
bta_dm_cb.disabling = TRUE;
|
bta_dm_cb.disabling = TRUE;
|
||||||
|
|
||||||
|
#if BLE_INCLUDED == TRUE
|
||||||
|
/* reset scan activity status*/
|
||||||
|
btm_cb.ble_ctr_cb.scan_activity = 0;
|
||||||
|
|
||||||
|
/* reset advertising activity status*/
|
||||||
|
btm_cb.ble_ctr_cb.inq_var.state = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
#if BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE
|
#if BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE
|
||||||
BTM_BleClearBgConnDev();
|
BTM_BleClearBgConnDev();
|
||||||
#endif
|
#endif
|
||||||
|
@ -122,9 +122,9 @@ void bta_gattc_reset_discover_st(tBTA_GATTC_SERV *p_srcb, tBTA_GATT_STATUS statu
|
|||||||
static void bta_gattc_enable(tBTA_GATTC_CB *p_cb)
|
static void bta_gattc_enable(tBTA_GATTC_CB *p_cb)
|
||||||
{
|
{
|
||||||
APPL_TRACE_DEBUG("bta_gattc_enable");
|
APPL_TRACE_DEBUG("bta_gattc_enable");
|
||||||
/* This is a workaround because the task priority of btc (BTA_GATTC_CLOSE_EVT
|
/* This is a workaround because the task priority of btc (BTA_GATTC_CLOSE_EVT
|
||||||
in that task) is lower than the priority of the btu task.
|
in that task) is lower than the priority of the btu task.
|
||||||
Consequently, the p_cb->state fails to be restored to BTA_GATTC_STATE_DISABLED
|
Consequently, the p_cb->state fails to be restored to BTA_GATTC_STATE_DISABLED
|
||||||
and remains in the BTA_GATTC_STATE_DISABLING state. */
|
and remains in the BTA_GATTC_STATE_DISABLING state. */
|
||||||
if (p_cb->state == BTA_GATTC_STATE_DISABLED || p_cb->state == BTA_GATTC_STATE_DISABLING) {
|
if (p_cb->state == BTA_GATTC_STATE_DISABLED || p_cb->state == BTA_GATTC_STATE_DISABLING) {
|
||||||
/* initialize control block */
|
/* initialize control block */
|
||||||
@ -204,9 +204,9 @@ void bta_gattc_register(tBTA_GATTC_CB *p_cb, tBTA_GATTC_DATA *p_data)
|
|||||||
cb_data.reg_oper.status = BTA_GATT_NO_RESOURCES;
|
cb_data.reg_oper.status = BTA_GATT_NO_RESOURCES;
|
||||||
|
|
||||||
/* check if GATTC module is already enabled . Else enable */
|
/* check if GATTC module is already enabled . Else enable */
|
||||||
/* This is a workaround because the task priority of btc (BTA_GATTC_CLOSE_EVT
|
/* This is a workaround because the task priority of btc (BTA_GATTC_CLOSE_EVT
|
||||||
in that task) is lower than the priority of the btu task.
|
in that task) is lower than the priority of the btu task.
|
||||||
Consequently, the p_cb->state fails to be restored to BTA_GATTC_STATE_DISABLED
|
Consequently, the p_cb->state fails to be restored to BTA_GATTC_STATE_DISABLED
|
||||||
and remains in the BTA_GATTC_STATE_DISABLING state. */
|
and remains in the BTA_GATTC_STATE_DISABLING state. */
|
||||||
if (p_cb->state == BTA_GATTC_STATE_DISABLED || p_cb->state == BTA_GATTC_STATE_DISABLING) {
|
if (p_cb->state == BTA_GATTC_STATE_DISABLED || p_cb->state == BTA_GATTC_STATE_DISABLING) {
|
||||||
bta_gattc_enable (p_cb);
|
bta_gattc_enable (p_cb);
|
||||||
|
Reference in New Issue
Block a user