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

add BleakAdapter class #1060

Open
dlech opened this issue Oct 3, 2022 · 3 comments
Open

add BleakAdapter class #1060

dlech opened this issue Oct 3, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@dlech
Copy link
Collaborator

dlech commented Oct 3, 2022

This is a feature request to add a new BleakAdapter class to provide access to the system Bluetooth adapter.

This class should have a property for getting the adapter state (powered on, powered off, not present, not authorized) and allow registering a callback for when the adapter state changes. This could fix #320.

It could also have a method to get already connected Bluetooth devices. This could fix #367.

Additionally, it could provide an eaiser way to specify which adapter to use on Linux (instead of passing the adapter arg to each BleakScanner and BleakClient).

Creation of this object will necessarily be async due to the OS APIs that would need to be used, so this should have an async default_adapter() class (or static) method to get the adapter (currently all OSes other than Linux only allow one Bluetooth adapter) instead of an __init__ method.

@dlech dlech added the enhancement New feature or request label Oct 3, 2022
@JPHutchins
Copy link
Contributor

This seems to be a requirement in the case that Windows 10 has bonded with the device, I will be investigating.

@bdraco
Copy link
Contributor

bdraco commented Jan 5, 2023

Feel free to lift any code that might be useful from https://github.com/bluetooth-devices/bluetooth-adapters

@JPHutchins
Copy link
Contributor

Another resource for future reference https://github.com/IanSavchenko/BleLab. I've confirmed that I can (only) access bonded devices with this tool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants