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% 53.86% +0.03%
==========================================
Files 406 406
Lines 43289 43286 -3
Branches 7997 7998 +1
==========================================
+ Hits 23301 23314 +13
+ Misses 19176 19160 -16
Partials 812 812
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.
| while time.time() - start < TIMEOUT: | ||
| if beacon_packet: |
There was a problem hiding this comment.
The while loop continuously checks conditions without any delay between iterations, potentially consuming excessive CPU resources. Consider adding a small sleep interval (e.g., time.sleep(0.1)) inside the loop to reduce CPU usage while waiting for beacon packets.
| break | ||
| scanner.stop() | ||
| if beacon_packet: |
There was a problem hiding this comment.
The condition 'if beacon_packet' is checked twice: once inside the loop (line 69) and again after the loop (line 82). This is redundant since breaking from the loop guarantees beacon_packet is truthy. Consider restructuring to eliminate the duplicate check.
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/