diff --git a/src/platform/ESP32/nimble/BLEManagerImpl.cpp b/src/platform/ESP32/nimble/BLEManagerImpl.cpp index 6a63e626a2c5a1..a6eb116ab5cc9b 100644 --- a/src/platform/ESP32/nimble/BLEManagerImpl.cpp +++ b/src/platform/ESP32/nimble/BLEManagerImpl.cpp @@ -1273,6 +1273,8 @@ CHIP_ERROR BLEManagerImpl::HandleGAPDisconnect(struct ble_gap_event * gapEvent) peer_delete(gapEvent->disconnect.conn.conn_handle); #endif + // There can be a case where the BLE central disconnects without unsubscribing from the BLE characteristic. + // In such situations, it is necessary to clear the subscription and post a connection error event. if (UnsetSubscribed(gapEvent->disconnect.conn.conn_handle)) { CHIP_ERROR disconReason;