Fix BLEClient disconnect bug (#3876)
By default the disconnect is broadcasted to every clients. So if you call disconnect on one connected client, they'll all be disconnected if we don't filter the event by conn_id.
This commit is contained in:
parent
7e9d42da68
commit
5197916983
@ -178,6 +178,8 @@ void BLEClient::gattClientEventHandler(
|
|||||||
// - uint16_t conn_id
|
// - uint16_t conn_id
|
||||||
// - esp_bd_addr_t remote_bda
|
// - esp_bd_addr_t remote_bda
|
||||||
case ESP_GATTC_DISCONNECT_EVT: {
|
case ESP_GATTC_DISCONNECT_EVT: {
|
||||||
|
if (evtParam->disconnect.conn_id != m_conn_id)
|
||||||
|
break;
|
||||||
// If we receive a disconnect event, set the class flag that indicates that we are
|
// If we receive a disconnect event, set the class flag that indicates that we are
|
||||||
// no longer connected.
|
// no longer connected.
|
||||||
m_isConnected = false;
|
m_isConnected = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user