1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-06 21:32:21 +01:00

Fix BLE connection loop caused by timeout and pending disconnect race (#8597)

This commit is contained in:
J. Nick Koston
2025-04-21 23:17:09 -10:00
committed by Jesse Hills
parent 86033b6612
commit aa6e172e14
2 changed files with 8 additions and 0 deletions

View File

@@ -173,6 +173,8 @@ class ESPBTClient : public ESPBTDeviceListener {
virtual void gap_event_handler(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t *param) = 0;
virtual void connect() = 0;
virtual void disconnect() = 0;
bool disconnect_pending() const { return this->want_disconnect_; }
void cancel_pending_disconnect() { this->want_disconnect_ = false; }
virtual void set_state(ClientState st) {
this->state_ = st;
if (st == ClientState::IDLE) {