Skip to content

Commit

Permalink
[rtl872x] hal: assert if failed to restart BLE stack.
Browse files Browse the repository at this point in the history
  • Loading branch information
XuGuohui committed Apr 20, 2023
1 parent d6f3d5d commit a858d4c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions hal/src/rtl872x/ble_hal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1629,9 +1629,12 @@ int BleGap::startScanning(hal_ble_on_scan_result_cb_t callback, void* context) {
HAL_Delay_Milliseconds(10);
}
if (isScanning_) {
stop();
init();
start();
int ret = stop();
SPARK_ASSERT(ret == SYSTEM_ERROR_NONE);
ret = init();
SPARK_ASSERT(ret == SYSTEM_ERROR_NONE);
ret = start();
SPARK_ASSERT(ret == SYSTEM_ERROR_NONE);
}
isScanning_ = false;
clearPendingResult();
Expand Down

0 comments on commit a858d4c

Please sign in to comment.