mirror of
https://github.com/espressif/esp-nimble.git
synced 2026-10-14 17:57:22 +00:00
btshell: Fix restarting advertising instances
Connection handle needs to be cleared on disconnect. Otherwise with multiple advertising instances active incorrect instance may be matched and attempted to restart (ie if connection handle is reused).
This commit is contained in:
@@ -1165,9 +1165,9 @@ btshell_restart_adv(struct ble_gap_event *event)
|
||||
|
||||
#if MYNEWT_VAL(BLE_EXT_ADV)
|
||||
for (i = 0; i < BLE_ADV_INSTANCES; ++i) {
|
||||
if (ext_adv_restart[i].restart &&
|
||||
(ext_adv_restart[i].conn_handle ==
|
||||
event->disconnect.conn.conn_handle)) {
|
||||
if (ext_adv_restart[i].restart && (ext_adv_restart[i].conn_handle ==
|
||||
event->disconnect.conn.conn_handle)) {
|
||||
ext_adv_restart[i].conn_handle = BLE_HS_CONN_HANDLE_NONE;
|
||||
rc = ble_gap_ext_adv_start(i, 0, 0);
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user