[esp32_ble] Name the event queue drain

This commit is contained in:
J. Nick Koston
2026-09-10 08:02:38 -05:00
parent 6629de81b8
commit 64b4465df3
2 changed files with 9 additions and 6 deletions
+1 -6
View File
@@ -580,12 +580,7 @@ void ESP32BLE::loop_handle_state_transition_not_active_() {
this->mark_failed();
return;
}
// Drop what the old stack queued; the next stack reuses the same interface ids.
BLEEvent *ble_event;
while ((ble_event = this->ble_events_.pop()) != nullptr) {
this->ble_event_pool_.release(ble_event);
}
this->ble_events_.get_and_reset_dropped_count();
this->drain_ble_events_();
this->state_ = BLE_COMPONENT_STATE_DISABLED;
} else if (this->state_ == BLE_COMPONENT_STATE_ENABLE) {
ESP_LOGD(TAG, "Enabling");
+8
View File
@@ -176,6 +176,14 @@ class ESP32BLE final : public Component {
bool ble_setup_();
bool ble_dismantle_();
// Drop what the old stack queued; the next stack reuses the same interface ids.
void drain_ble_events_() {
BLEEvent *ble_event;
while ((ble_event = this->ble_events_.pop()) != nullptr) {
this->ble_event_pool_.release(ble_event);
}
this->ble_events_.get_and_reset_dropped_count();
}
bool ble_pre_setup_();
#ifdef USE_ESP32_BLE_ADVERTISING
void advertising_init_();