1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-27 15:42:22 +01:00

Update esphome/components/esp32_ble_tracker/esp32_ble_tracker.cpp

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
J. Nick Koston
2025-08-03 21:22:38 -10:00
committed by GitHub
parent 8d4f1802fb
commit dd80fcdb62

View File

@@ -238,8 +238,10 @@ void ESP32BLETracker::loop() {
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");
this->stop_scan_(); this->stop_scan_();
// Don't wait for scan stop complete - promote immediately // Don't wait for scan stop complete - promote immediately.
// The BLE stack processes commands in order through its queue // This is safe because ESP-IDF processes BLE commands sequentially through its internal mailbox queue.
// This guarantees that the stop scan command will be fully processed before any subsequent connect command,
// preventing race conditions or overlapping operations.
} }
ESP_LOGD(TAG, "Promoting client to connect"); ESP_LOGD(TAG, "Promoting client to connect");