mirror of
https://github.com/espressif/esp-idf.git
synced 2026-08-18 06:35:35 +03:00
fix(ble): remove BLE service UUID scan filter
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user