How to check if bluetooth is enabled
Hi,
On macos if I run
auto adapter_list = SimpleBLE::Adapter::get_adapters();
with bluetooth enable or not I get the exact same result:
Default Adapter [00:00:00:00:00:00]
How can I detect if the bluetooth is enabled or not on the computer ?
Thank you
This specific problem is a bit tricky, because the underlying API is soooo different for each operating system. There is an MR that has solved this problem for MacOS, but I haven't had time to look into equivalents for Windows and Linux.
The fact that you always get one adapter regardless of the BLE state is a horrible workaround I made, which I apologize for. I will dig deeper into this once I get v0.4.0, which is almost there besides from a very specific segfault that I just can't find.
This has been fixed with the provided Adapter::bluetooth_enabled() function.