Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[rtl872x] BLE scanning panic #2650

Merged
merged 2 commits into from
Apr 24, 2023
Merged

Conversation

XuGuohui
Copy link
Member

Problem

BLE scanning may finally panic after running for a long time, bacause of corrupted BLE stack.

Solution

Restart BLE stack, instead of panic.

Steps to Test

user/tests/app/ble/scanner or user/tests/app/ble/uart_central

References

N/A


Completeness

  • User is totes amazing for contributing!
  • Contributor has signed CLA (Info here)
  • Problem and Solution clearly stated
  • Run unit/integration/application tests on device
  • Added documentation
  • Added to CHANGELOG.md after merging (add links to docs and issues)

@XuGuohui XuGuohui requested a review from avtolstoy April 18, 2023 08:39
@@ -1626,7 +1628,12 @@ int BleGap::startScanning(hal_ble_on_scan_result_cb_t callback, void* context) {
}
HAL_Delay_Milliseconds(10);
}
SPARK_ASSERT(!isScanning_);
if (isScanning_) {
stop();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if it's deadlocked etc? Should we check return values here and SPARK_ASSERT if it fails to reinitialize perhaps?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds good.

@XuGuohui XuGuohui requested a review from avtolstoy April 20, 2023 05:48
@XuGuohui XuGuohui force-pushed the fix/rtl872x_ble_scan/sc117514 branch from a858d4c to 5bf3091 Compare April 24, 2023 15:31
@XuGuohui XuGuohui merged commit dbbe4cb into develop Apr 24, 2023
@XuGuohui XuGuohui deleted the fix/rtl872x_ble_scan/sc117514 branch April 24, 2023 15:58
@scott-brust scott-brust added this to the 5.3.2 milestone May 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants