mirror of
https://github.com/esphome/esphome.git
synced 2025-03-16 15:48:16 +00:00
Debug disconnecting before connected
This commit is contained in:
parent
6ee10540f6
commit
1f04f4632c
@ -145,7 +145,6 @@ void BLEClientBase::_unconditional_disconnect() {
|
|||||||
if (this->state_ == espbt::ClientState::SEARCHING || this->state_ == espbt::ClientState::READY_TO_CONNECT ||
|
if (this->state_ == espbt::ClientState::SEARCHING || this->state_ == espbt::ClientState::READY_TO_CONNECT ||
|
||||||
this->state_ == espbt::ClientState::DISCOVERED || this->state_ == espbt::ClientState::DISCONNECTING) {
|
this->state_ == espbt::ClientState::DISCOVERED || this->state_ == espbt::ClientState::DISCONNECTING) {
|
||||||
this->set_address(0);
|
this->set_address(0);
|
||||||
this->conn_id_ = UNSET_CONN_ID;
|
|
||||||
this->set_state(espbt::ClientState::IDLE);
|
this->set_state(espbt::ClientState::IDLE);
|
||||||
} else {
|
} else {
|
||||||
this->set_state(espbt::ClientState::DISCONNECTING);
|
this->set_state(espbt::ClientState::DISCONNECTING);
|
||||||
@ -205,6 +204,7 @@ bool BLEClientBase::gattc_event_handler(esp_gattc_cb_event_t event, esp_gatt_if_
|
|||||||
// Disconnect we requested before after connecting started,
|
// Disconnect we requested before after connecting started,
|
||||||
// but before the connection was established.
|
// but before the connection was established.
|
||||||
this->_unconditional_disconnect();
|
this->_unconditional_disconnect();
|
||||||
|
this->conn_id_ = UNSET_CONN_ID;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
auto ret = esp_ble_gattc_send_mtu_req(this->gattc_if_, param->open.conn_id);
|
auto ret = esp_ble_gattc_send_mtu_req(this->gattc_if_, param->open.conn_id);
|
||||||
@ -230,6 +230,7 @@ bool BLEClientBase::gattc_event_handler(esp_gattc_cb_event_t event, esp_gatt_if_
|
|||||||
// Disconnect we requested before after connecting started,
|
// Disconnect we requested before after connecting started,
|
||||||
// but before the connection was established.
|
// but before the connection was established.
|
||||||
this->_unconditional_disconnect();
|
this->_unconditional_disconnect();
|
||||||
|
this->conn_id_ = UNSET_CONN_ID;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user