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

Gen4 BLE fixes #2813

Merged
merged 2 commits into from
Aug 22, 2024
Merged

Gen4 BLE fixes #2813

merged 2 commits into from
Aug 22, 2024

Conversation

XuGuohui
Copy link
Member

@XuGuohui XuGuohui commented Aug 20, 2024

Problem

  1. connectionsMutex_ may block the application thread for prolonged amount of time. For example:
    • onBLEPairingEvent()hold the connectionsMutex_
    • waiting for some cloud data in the BLE pairing event handler
    • received data from cloud and the subscription handler is scheduled from application thread
    • application thread calls waitFor(][(return BLE.isPaired)), which is blocked by connectionsMutex_
    • cloud data cannot be handled
  2. assertTrue(results[i].scanResponse().length() > 0); may fail in ble_central_peripheral/ble_central test

Solution

  1. Do not acquire connectionsMutex_ in notifyLinkEvent() and acquire it where necessary.
  2. To be consistent with Gen3, BLE HAL doesn't notify the pending scanned adv data

Example App

user/tests/wiring/ble_central_peripheral

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 added 5.x ble Bluetooth Low Energy labels Aug 20, 2024
@XuGuohui XuGuohui merged commit af75cf2 into develop Aug 22, 2024
13 checks passed
@XuGuohui XuGuohui deleted the fix/gen4-ble-pairing branch August 22, 2024 17:14
@technobly technobly added the bug label Sep 5, 2024
@technobly technobly added this to the 5.9.0 milestone Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5.x ble Bluetooth Low Energy bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants