Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Async API #201

Open
rvadhavk opened this issue Aug 30, 2024 · 1 comment
Open

Async API #201

rvadhavk opened this issue Aug 30, 2024 · 1 comment

Comments

@rvadhavk
Copy link

Looking through the documentation at https://docs.circuitpython.org/projects/ble/en/latest/api.htm and example code at https://learn.adafruit.com/circuitpython-nrf52840/location, it seems that you have to poll the BLERadio.connected instance variable as opposed to awaiting a central connecting to the peripheral. Is there an async API to avoid having to poll for things like new connections or writes to writable characteristics?

@dhalbert
Copy link
Collaborator

There is no async API, though you can write an async task that polls and asyncio.sleep()'s. We are gradually looking at async support for HTTPServer and the like. If you have some ideas, or like an existing API, feel free to comment.

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

No branches or pull requests

2 participants