mirror of
https://github.com/esphome/esphome.git
synced 2026-09-11 15:27:33 +00:00
[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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user