Skip to content

Commit

Permalink
comment explaining why we are posting connection error event
Browse files Browse the repository at this point in the history
  • Loading branch information
shubhamdp committed Oct 18, 2023
1 parent 5046f86 commit 020460e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/platform/ESP32/nimble/BLEManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 020460e

Please sign in to comment.