diff --git a/checkbox-support/checkbox_support/scripts/eddystone_scanner.py b/checkbox-support/checkbox_support/scripts/eddystone_scanner.py index 5ac73bd299..5650afc035 100644 --- a/checkbox-support/checkbox_support/scripts/eddystone_scanner.py +++ b/checkbox-support/checkbox_support/scripts/eddystone_scanner.py @@ -27,6 +27,11 @@ BeaconScanner, EddystoneURLFrame, ) +from checkbox_support.vendor.beacontools.const import ( + BluetoothAddressType, + ScanFilter, + ScanType, +) from checkbox_support.helpers.timeout import timeout from checkbox_support.helpers.retry import retry from checkbox_support.interactive_cmd import InteractiveCommand @@ -37,11 +42,6 @@ def init_bluetooth(): with InteractiveCommand("bluetoothctl") as btctl: btctl.writeline("power on") time.sleep(3) - # workaround for some intel bluetooth controller - # if we don't enable scan on via bluetoothctl first, - # the hci 'advertising scan enable' command would failed - btctl.writeline("scan on") - time.sleep(3) btctl.writeline("exit") btctl.kill() @@ -65,6 +65,13 @@ def callback(sub_event, bt_addr, rssi, packet, additional_info): callback, bt_device_id=hci_device, packet_filter=EddystoneURLFrame, + scan_parameters={ + "scan_type": ScanType.ACTIVE, + "interval_ms": 10, + "window_ms": 10, + "address_type": BluetoothAddressType.PUBLIC, + "filter_type": ScanFilter.ALL, + }, debug=debug, ) diff --git a/checkbox-support/checkbox_support/tests/test_eddystone_scanner.py b/checkbox-support/checkbox_support/tests/test_eddystone_scanner.py index aebb76f2af..9dbf4161f8 100644 --- a/checkbox-support/checkbox_support/tests/test_eddystone_scanner.py +++ b/checkbox-support/checkbox_support/tests/test_eddystone_scanner.py @@ -117,6 +117,5 @@ def test_initial_scripts(self, mock_command, mock_sleep): eddystone_scanner.init_bluetooth() mock_command.assert_called_with("bluetoothctl") mock_btctl.writeline.assert_any_call("power on") - mock_btctl.writeline.assert_any_call("scan on") mock_btctl.writeline.assert_any_call("exit") - self.assertEqual(mock_sleep.call_count, 2) + self.assertEqual(mock_sleep.call_count, 1)