From 4c53460dcc0ea85ee02c3876b21b601f3171c8e0 Mon Sep 17 00:00:00 2001 From: Zhou Xiao Date: Sat, 9 May 2026 16:13:02 +0800 Subject: [PATCH] fix(ble): remove BLE service UUID scan filter --- tools/ble/ble_uart_bridge/src/core/scanner.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tools/ble/ble_uart_bridge/src/core/scanner.py b/tools/ble/ble_uart_bridge/src/core/scanner.py index 73696aa7ecc..12fdf47697c 100644 --- a/tools/ble/ble_uart_bridge/src/core/scanner.py +++ b/tools/ble/ble_uart_bridge/src/core/scanner.py @@ -10,12 +10,11 @@ from bleak.backends.scanner import AdvertisementData from loguru import logger from .constants import DEFAULT_SCAN_TIMEOUT -from .constants import NUS_SERVICE_UUID from .models import DeviceInfo from .probe import has_accessible_bluetooth -async def scan_devices(timeout: float = DEFAULT_SCAN_TIMEOUT, service_uuid: str = NUS_SERVICE_UUID) -> list[DeviceInfo]: +async def scan_devices(timeout: float = DEFAULT_SCAN_TIMEOUT) -> list[DeviceInfo]: """List available devices discovered by Bleak.""" # Check if there's any available bluetooth device before scanning (Bleak limitation) @@ -39,8 +38,8 @@ async def scan_devices(timeout: float = DEFAULT_SCAN_TIMEOUT, service_uuid: str logger.success(f'Found: {device_id}, with name {device_info.name}, rssi={device_info.rssi}') devices_seen[device_id] = device_info - logger.info(f'Scanning for devices with BLE UART service in {timeout}s...') - async with BleakScanner(detection_callback=on_detect, service_uuids=[service_uuid]): + logger.info(f'Scanning for nearby BLE devices in {timeout}s...') + async with BleakScanner(detection_callback=on_detect): await asyncio.sleep(timeout) # Synthesis