Conversation
9955621 to
81a9101
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2260 +/- ##
==========================================
+ Coverage 53.82% 55.11% +1.28%
==========================================
Files 406 410 +4
Lines 43289 44791 +1502
Branches 7997 8369 +372
==========================================
+ Hits 23301 24687 +1386
- Misses 19176 19239 +63
- Partials 812 865 +53
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
0068178 to
9c94c58
Compare
removed older beacontools
revised eddystone scanner scripts for a bluetooth controller without extended advertising support
61998df to
8262bf4
Compare
8262bf4 to
915ec8c
Compare
update eddystone unit tests
915ec8c to
1e83b7b
Compare
There was a problem hiding this comment.
Pull request overview
This PR fixes the eddystone scanner to properly support both Bluetooth 5.0 controllers without LE Extended Advertising and newer Bluetooth 5.4/6.0 controllers with extended advertising capabilities. The implementation now dynamically detects controller capabilities and issues the appropriate HCI commands.
Changes:
- Added dynamic detection of LE Extended Advertising support via HCI commands
- Updated scanner callback signature to include report type information
- Replaced fallback mechanism with retry decorator and improved error handling
Reviewed changes
Copilot reviewed 3 out of 29 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| checkbox-support/checkbox_support/tests/test_vendor_beacontools_scanner.py | Added comprehensive unit tests for Monitor class methods including extended advertising detection, scan parameter configuration, and packet processing |
| checkbox-support/checkbox_support/tests/test_eddystone_scanner.py | Updated tests to match new callback signature and replaced timeout/retry logic with mock decorators |
| checkbox-support/checkbox_support/scripts/eddystone_scanner.py | Refactored beacon_scan to use retry decorator, added debug flag, and updated callback to include report type |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
fix eddystone_scanner
fix coding style issue
pieqq
left a comment
There was a problem hiding this comment.
Sorry for the long delay, and thanks for submitting this!
I finally got the time to test it locally.
I setup an Beacon broadcast simulator on my phone (one called Virtual Beacon that allows to create URL shares), set up a virtual beacon with a URL, and ran the test in my Checkbox venv:
(checkbox) root@pieq-X870:/home/pieq/dev/work/checkbox/checkbox-support/checkbox_support/scripts# python3 eddystone_scanner.py
====================================
Attempt 1/3 (function 'beacon_scan')
====================================
# Checking the LE Extended advertising capability
Received response from controller.
Raw 8-byte LE feature mask: bd 7f ff ff 9e 1 0 0
# Extended advertising support: True
# Checking the LE Extended advertising length
# Max advertising data length: 932
# Issue LE Set Extended Scan Enable to 'False' by hci command
# Issue LE Set Extended Scan Parameters by hci command
# Issue LE Set Extended Scan Enable to 'True' by hci command
Found an eddystone report
# Issue LE Set Extended Scan Enable to 'False' by hci command
Eddystone beacon detected: [Adv Report Type: LE_EXT_ADVERTISING_REPORT(13)] URL: https://pouet.net/ <mac: 7e:d5:71:24:c3:8f> <rssi: -88>
All good. Let's land this!
Description
This PR include the fixed in #1967, also compitable with Bluetooth 5.0 controller without LE extneded advertising support.
In currently implementation, it will issue HCI command to retrieve the
LE Extended Advertising Capabilitythen issue correspondingScan EnablecommandResolved issues
Documentation
Tests
Verified on RPi4 with bluetooth 5.0 controller
Tested on an IoT product with bluetooth 6.0 and bluetooth 5.4 controller
Tested on Lenovo laptop with Realtek wireless interface: https://pastebin.canonical.com/p/M8dFbXgxmj/