Skip to content

Commit

Permalink
Fix crash for eps32 commissioner if ble disconnect during commissioni…
Browse files Browse the repository at this point in the history
  • Loading branch information
DejinChen authored and shubhamdp committed Jun 28, 2024
1 parent 9b4cd84 commit b71e4f0
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/platform/ESP32/nimble/BLEManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,10 @@ bool BLEManagerImpl::SubscribeCharacteristic(BLE_CONNECTION_OBJECT conId, const
uint8_t value[2];
int rc;
struct peer * peer = peer_find(conId);
if (peer == nullptr)
{
return false;
}

dsc = peer_dsc_find_uuid(peer, (ble_uuid_t *) (&ShortUUID_CHIPoBLEService), (ble_uuid_t *) (&UUID_CHIPoBLEChar_TX),
(ble_uuid_t *) (&ShortUUID_CHIPoBLE_CharTx_Desc));
Expand Down Expand Up @@ -533,6 +537,10 @@ bool BLEManagerImpl::UnsubscribeCharacteristic(BLE_CONNECTION_OBJECT conId, cons
uint8_t value[2];
int rc;
struct peer * peer = peer_find(conId);
if (peer == nullptr)
{
return false;
}

dsc = peer_dsc_find_uuid(peer, (ble_uuid_t *) (&ShortUUID_CHIPoBLEService), (ble_uuid_t *) (&UUID_CHIPoBLEChar_TX),
(ble_uuid_t *) (&ShortUUID_CHIPoBLE_CharTx_Desc));
Expand Down

0 comments on commit b71e4f0

Please sign in to comment.