Skip to content

Conversation

@jaguilar
Copy link
Contributor

@jaguilar jaguilar commented Dec 5, 2025

Any Pybricks device running btstack can now issue Bluetooth classic inquiry scans to find and report discoverable devices.

This API is experimental and we can change it later if we don't like it. But it's nice because it can be used to concretely demonstrate that the EV3's BTStack layer is doing something! This also should give some indication of the structure by which we'll add further classic functionality (more functions and switch entries in bluetooth_btstack_classic.c). If it's preferred to have it in the same file as the LE code, we can, but this structure is scarcely more expensive and a little more neatly organized.

You can test it with this program:

from pybricks.tools import run_task
from pybricks.experimental.btc import scan


async def do_scan():
    print("Start bluetooth scan...")
    devices = await scan()
    print("Scan complete, devices found: ")
    for device in devices:
        print(device)


run_task(do_scan())

@coveralls
Copy link

coveralls commented Dec 5, 2025

Coverage Status

coverage: 50.566% (+0.02%) from 50.55%
when pulling ebf3c1e on jaguilar:ev3-bluetooth-scan
into fcfdf4e on pybricks:master.

@jaguilar jaguilar force-pushed the ev3-bluetooth-scan branch from de407e3 to cb7bfec Compare January 4, 2026 03:03
@jaguilar
Copy link
Contributor Author

jaguilar commented Jan 4, 2026

Rebased this commit atop all the other refactoring work that has happened recently to btstack, and verified that everything is still working.

The ev3 can now scan for discoverable Bluetooth
devices.
@jaguilar jaguilar force-pushed the ev3-bluetooth-scan branch from cb7bfec to ebf3c1e Compare January 4, 2026 03:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants