Skip to content

Commit

Permalink
Fix the problem of hang after BLE discovery fails during commission (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
tianfeng-yang authored and pull[bot] committed Oct 30, 2023
1 parent 60a0df5 commit 2372608
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/controller/CHIPDeviceController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -792,6 +792,13 @@ void DeviceCommissioner::OnDiscoveredDeviceOverBleError(void * appState, CHIP_ER
{
self->ReleaseCommissioneeDevice(device);
self->mRendezvousParametersForDeviceDiscoveredOverBle = RendezvousParameters();

// Callback is required when BLE discovery fails, otherwise the caller will always be in a suspended state
// A better way to handle it should define a new error code
if (self->mPairingDelegate != nullptr)
{
self->mPairingDelegate->OnPairingComplete(err);
}
}
}
#endif // CONFIG_NETWORK_LAYER_BLE
Expand Down
1 change: 1 addition & 0 deletions src/platform/Linux/BLEManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -825,6 +825,7 @@ void BLEManagerImpl::OnScanComplete()

void BLEManagerImpl::OnScanError(CHIP_ERROR err)
{
BleConnectionDelegate::OnConnectionError(mBLEScanConfig.mAppState, err);
ChipLogError(Ble, "BLE scan error: %" CHIP_ERROR_FORMAT, err.Format());
}

Expand Down

0 comments on commit 2372608

Please sign in to comment.