Skip to content

Commit afe9a5d

Browse files
committed
Merge branch 'bugfix/btdm_fix_adv_pending_in_smp' into 'master'
Component/bt: fix stop adv failed in smp See merge request idf/esp-idf!1881
2 parents dc11c88 + e64d78d commit afe9a5d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

components/bt/bluedroid/stack/btm/btm_ble_gap.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3598,6 +3598,14 @@ void btm_ble_write_adv_enable_complete(UINT8 *p)
35983598
} else if (p_cb->p_stop_adv_cb && p_cb->adv_mode == BTM_BLE_ADV_DISABLE) {
35993599
p_cb->state = BTM_BLE_STOP_ADV;
36003600
(*p_cb->p_stop_adv_cb)(status);
3601+
}else {
3602+
// p_cb->p_adv_cb is NULL or p_cb->p_stop_adv_cb is NULL
3603+
if (p_cb->adv_mode == BTM_BLE_ADV_ENABLE) {
3604+
p_cb->state = BTM_BLE_ADVERTISING;
3605+
}else {
3606+
p_cb->state = BTM_BLE_STOP_ADV;
3607+
}
3608+
p_cb->adv_callback_twice = FALSE;
36013609
}
36023610
/* if write adv enable/disbale not succeed */
36033611
if (*p != HCI_SUCCESS) {

0 commit comments

Comments
 (0)