Fix missing conn_id check in bluetooth_proxy disconnect event

Pointed out by @elupus while debugging
https://github.com/home-assistant/core/issues/103117
This commit is contained in:
J. Nick Koston 2024-04-20 01:54:47 +02:00
parent 655dbc48b5
commit dd346263f3
No known key found for this signature in database
1 changed files with 2 additions and 0 deletions

View File

@ -20,6 +20,8 @@ bool BluetoothConnection::gattc_event_handler(esp_gattc_cb_event_t event, esp_ga
switch (event) {
case ESP_GATTC_DISCONNECT_EVT: {
if (param->disconnect.conn_id != this->conn_id_)
break;
this->proxy_->send_device_connection(this->address_, false, 0, param->disconnect.reason);
this->set_address(0);
this->proxy_->send_connections_free();