Skip to content

Comments

Bluetooth: BT_SCAN reuse lib_bluetooth scan helpers and de-noise stdout#305

Merged
abbajaj806 merged 4 commits intoqualcomm-linux:mainfrom
smuppand:bt-scan-fix
Feb 20, 2026
Merged

Bluetooth: BT_SCAN reuse lib_bluetooth scan helpers and de-noise stdout#305
abbajaj806 merged 4 commits intoqualcomm-linux:mainfrom
smuppand:bt-scan-fix

Conversation

@smuppand
Copy link
Contributor

bluetoothctl list often returns no controllers in non-interactive mode. BT_SCAN correctly falls back to interactive bluetoothctl, but today that leads to:

Repeated fallback banner/diagnostics (same WARN/INFO block printed multiple times).

“Devices seen …” log being polluted with interactive bluetoothctl transcript (prompt lines / ANSI escapes / controller events), making CI/LAVA logs noisy and harder to parse.

What this PR changes (This PR fixes #303 )

  1. Runner/utils/lib_bluetooth.sh

Ensure the “non-interactive list empty -> interactive fallback” banner + optional diagnostics are emitted only once per run.

Keep the same controller visibility logic (non-interactive fast path, interactive fallback), but avoid duplicated WARN/INFO blocks during later BT operations.

  1. BT_*/run.sh
    Implement the new interactive fallback so that CI won't fail, but we will still generate log_warn. This way, CI engineers can identify and debug any issues.

…isibility

BT_ON_OFF was skipping when bluetoothctl did not immediately show the controller.
Poll for controller visibility after public-addr and keep output sanitization to
handle CR/ANSI noise in piped output. Also drop leading-underscore temp vars.

Signed-off-by: Srikanth Muppandam <smuppand@qti.qualcomm.com>
Call btloghcidiag() after adapter selection and before controller checks so failures
provide immediate service/journal context.

Signed-off-by: Srikanth Muppandam <smuppand@qti.qualcomm.com>
Replace plain  diagnostics with btctl_script list+quit so
controller listing is consistent on ramdisk/minimal images where non-interactive
output can be empty.

Signed-off-by: Srikanth Muppandam <smuppand@qti.qualcomm.com>
…oothctl is flaky

Signed-off-by: Srikanth Muppandam <smuppand@qti.qualcomm.com>
Copy link
Contributor

@abbajaj806 abbajaj806 left a comment

Choose a reason for hiding this comment

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

LGTM

@abbajaj806 abbajaj806 merged commit 40b09f4 into qualcomm-linux:main Feb 20, 2026
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bt Testcase failed on all Targets

2 participants