mirror of
https://github.com/esphome/esphome.git
synced 2025-09-05 21:02:20 +01:00
Merge branch 'integration' into memory_api
This commit is contained in:
@@ -167,19 +167,19 @@ 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_();
|
||||||
} else if (this->scanner_state_ == ScannerState::IDLE) {
|
// Don't wait for scan stop complete - promote immediately
|
||||||
ESP_LOGD(TAG, "Promoting client to connect");
|
// The BLE stack processes commands in order through its queue
|
||||||
// We only want to promote one client at a time.
|
|
||||||
// once the scanner is fully stopped.
|
|
||||||
#ifdef USE_ESP32_BLE_SOFTWARE_COEXISTENCE
|
|
||||||
ESP_LOGD(TAG, "Setting coexistence to Bluetooth to make connection.");
|
|
||||||
if (!this->coex_prefer_ble_) {
|
|
||||||
this->coex_prefer_ble_ = true;
|
|
||||||
esp_coex_preference_set(ESP_COEX_PREFER_BT); // Prioritize Bluetooth
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
client->set_state(ClientState::READY_TO_CONNECT);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ESP_LOGD(TAG, "Promoting client to connect");
|
||||||
|
#ifdef USE_ESP32_BLE_SOFTWARE_COEXISTENCE
|
||||||
|
ESP_LOGD(TAG, "Setting coexistence to Bluetooth to make connection.");
|
||||||
|
if (!this->coex_prefer_ble_) {
|
||||||
|
this->coex_prefer_ble_ = true;
|
||||||
|
esp_coex_preference_set(ESP_COEX_PREFER_BT); // Prioritize Bluetooth
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
client->set_state(ClientState::READY_TO_CONNECT);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user