Clear the scan-end skip on every promotion

This commit is contained in:
J. Nick Koston
2026-08-21 19:05:42 -05:00
parent af09df10f3
commit aa344a6107
@@ -567,8 +567,6 @@ void ESP32BLETracker::try_promote_discovered_clients_() {
if (this->scanner_state_ == ScannerState::RUNNING) { if (this->scanner_state_ == ScannerState::RUNNING) {
ESP_LOGD(TAG, "Stopping scan to make connection"); ESP_LOGD(TAG, "Stopping scan to make connection");
// A connect ends the scan period a window-change restart was continuing.
this->skip_next_scan_end_ = false;
this->stop_scan_(); this->stop_scan_();
// Don't wait for scan stop complete - promote immediately. // Don't wait for scan stop complete - promote immediately.
// This is safe because ESP-IDF processes BLE commands sequentially through its internal mailbox queue. // This is safe because ESP-IDF processes BLE commands sequentially through its internal mailbox queue.
@@ -577,6 +575,8 @@ void ESP32BLETracker::try_promote_discovered_clients_() {
} }
ESP_LOGD(TAG, "Promoting client to connect"); ESP_LOGD(TAG, "Promoting client to connect");
// A connect ends the scan period a window-change restart was continuing.
this->skip_next_scan_end_ = false;
#ifdef USE_ESP32_BLE_SOFTWARE_COEXISTENCE #ifdef USE_ESP32_BLE_SOFTWARE_COEXISTENCE
this->update_coex_preference_(true); this->update_coex_preference_(true);
#endif #endif