[esp32_ble_tracker] Clear scan failure latches when the stack goes down

A set-param or start failure latched by the old stack was otherwise handled
against the next one as a spurious stop and restart.
This commit is contained in:
J. Nick Koston
2026-09-10 10:04:49 -05:00
parent 2b4e94901f
commit 969f71338a
2 changed files with 4 additions and 1 deletions
@@ -140,7 +140,7 @@ class BLEClientBase : public espbt::ESPBTClient, public Component {
uint8_t pending_notify_regs_{0};
bool auto_connect_{false};
bool paired_{false};
// Always set by release_services(); the stack's GATT database must not be walked after it
// Set by release_services() on RAM-cache builds; the stack's GATT database must not be walked after it
bool services_released_{false};
// 8 bytes used, no padding
@@ -234,6 +234,9 @@ void ESP32BLETracker::ble_before_disabled_event_handler() {
if (this->scanner_state_ != ScannerState::IDLE) {
this->cleanup_scan_state_(true);
}
// A failure latched by the old stack must not be handled against the next.
this->scan_start_failed_ = ESP_BT_STATUS_SUCCESS;
this->scan_set_param_failed_ = ESP_BT_STATUS_SUCCESS;
this->ble_was_disabled_ = true;
}