Skip to content

Add scan parameters to beacontool (Bugfix)#2521

Open
xanthein wants to merge 2 commits into
mainfrom
add_scan_parameters_to_beacontool
Open

Add scan parameters to beacontool (Bugfix)#2521
xanthein wants to merge 2 commits into
mainfrom
add_scan_parameters_to_beacontool

Conversation

@xanthein

@xanthein xanthein commented May 6, 2026

Copy link
Copy Markdown
Contributor

Description

In PR #2260, it remove the blutoothctl scan on, and introduce issue #2466. In x86 enablement project also encounter similar issue SOMERVILLE-4545. From chip vendor's investigation, the root cause of this issue is scan with RANDOM address in scan parameter and not set the RANDOM address in advance, which had been addressed in BT spec

If Enable is set to 0x01, the scanning parameters' Own_Address_Type parameter is set to 0x01 or 0x03, and the random address for the device has not been initialized using the HCI_LE_Set_Random_Address command, the Controller shall return the error code Invalid HCI Command Parameters (0x12).

This PR change the scan type to PUBLIC which don't need to set RANDOM address in advance. And can revert the workaround introduced by #2475.

Resolved issues

Fixes #2466

Documentation

Tests

Install checkbox-support from Test PPA and other checkbox packages from checkbox-beta. And run run test plan bluetooth-cert-automated on required machines

  1. Origin platform: https://certification.canonical.com/hardware/202604-38592/submission/491156/test-results/
  2. RPi3: https://certification.canonical.com/hardware/202311-32357/submission/491154/test-results/
  3. RPi4: https://certification.canonical.com/hardware/202004-27866/submission/491373/test-results/
  4. RPi5: https://certification.canonical.com/hardware/202512-38178/submission/491171/test-results/

xanthein added 2 commits May 6, 2026 15:46
Default address_type in set_scan_paramters is BluetoothAddressType.RANDOM
 which may cause issue if not set random address to Bluetooth
 controller in advance.
@codecov

codecov Bot commented May 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 58.92%. Comparing base (a9d93d2) to head (2fed4fd).
⚠️ Report is 41 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2521      +/-   ##
==========================================
- Coverage   58.92%   58.92%   -0.01%     
==========================================
  Files         476      476              
  Lines       48033    48032       -1     
  Branches     8575     8575              
==========================================
- Hits        28305    28304       -1     
  Misses      18835    18835              
  Partials      893      893              
Flag Coverage Δ
checkbox-support 67.90% <100.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@xanthein xanthein requested review from Hook25 and stanley31huang May 6, 2026 08:57

@Hook25 Hook25 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please improve the description explaining exactly why this is done this way because I can't quite understand. Also provide 4 submissions:

  • Rpi3/4/5
  • "prove" the fix worked on the original platform

@p-gentili

Copy link
Copy Markdown
Collaborator

Also, the issue is still present on UC18 (see #2466 (comment)). Hopefully this fixes it.

@xanthein xanthein requested a review from Hook25 June 3, 2026 08:06
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.

eddystone_scanner failing to enable scanning on some devices

3 participants