Untitled

 avatar
unknown
python
a year ago
432 B
4
Indexable
import asyncio
import bleak
from bleak import BleakScanner, BleakClient

# Scan for nearby Bluetooth devices and print them on the screen
async def scan_devices():
    print("Scanning for Bluetooth devices...")
    devices = await BleakScanner.discover()
    for device in devices:
        print(f"Found device: {device.name} - {device.address}")
    await scan_devices()

if __name__ == "__main__":
    asyncio.run(scan_devices())
Editor is loading...
Leave a Comment