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())

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. 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.
@coveralls
Copy link

Coverage Status

coverage: 56.406%. remained the same
when pulling 5bb845e on jaguilar:ev3-bluetooth-scan
into 16e461e on pybricks:master.

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