Untitled

 avatar
unknown
python
a year ago
453 B
3
Indexable
import asyncio
from bleak import BleakScanner

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

# Main function to run the scanning
async def main():
    print("Scanning for Bluetooth devices...")
    await scan_devices()

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