Skip to content

Commit

Permalink
Fix crash for eps32 commissioner if ble disconnect during commissioning
Browse files Browse the repository at this point in the history
  • Loading branch information
DejinChen committed May 7, 2024
1 parent 4319ab1 commit 16b6bdb
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 @@ -503,6 +503,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 @@ -537,6 +541,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 16b6bdb

Please sign in to comment.