Bluetooth: make BT_SCAN discovery robust with retry-based scanning#453
Open
smuppand wants to merge 3 commits into
Open
Bluetooth: make BT_SCAN discovery robust with retry-based scanning#453smuppand wants to merge 3 commits into
smuppand wants to merge 3 commits into
Conversation
Update bt_scan_devices() to make Bluetooth scanning more robust on minimal and CI images. The helper now parses both live bluetoothctl scan output and cached bluetoothctl devices output across multiple scan attempts. This avoids false failures where advertisements are visible during scan but BlueZ does not immediately populate the devices cache. Also accept MAC-only discovery because name resolution can be delayed or unavailable on minimal images. This keeps the existing bt_scan_devices() API and avoids adding another parallel scan helper. Signed-off-by: Srikanth Muppandam <smuppand@qti.qualcomm.com>
Update BT_SCAN/run.sh to use the common bt_scan_devices() helper instead of open-coding a single scan window followed by one bluetoothctl devices cache check. Add scan tuning knobs for CI stability: - BT_SCAN_SECONDS - BT_SCAN_RETRIES - BT_SCAN_RETRY_DELAY Also add matching CLI options: - --scan-seconds - --scan-retries - --scan-retry-delay This keeps generic scan mode unchanged while making it less flaky when BlueZ cache updates are delayed. Signed-off-by: Srikanth Muppandam <smuppand@qti.qualcomm.com>
Add README.md for BT_SCAN covering generic scan mode, target MAC mode, adapter selection, scan retry tuning, result handling, LAVA usage, and debugging steps. Signed-off-by: Srikanth Muppandam <smuppand@qti.qualcomm.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR improves the robustness of the
BT_SCANtestcase by reusing and hardening the common Bluetooth scan helper instead of relying on a single scan window followed by onebluetoothctl devicescache lookup.Why this PR is needed
BT_SCANwas intermittently failing in LAVA even when a Bluetooth peer/dongle was present nearby. The failure happened because the test only checkedbluetoothctl devicesafter scan completion:lava jobs for reference: https://lava.infra.foundries.io/scheduler/job/209191
https://lava.infra.foundries.io/scheduler/job/209192