-
Notifications
You must be signed in to change notification settings - Fork 137
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
Startup requirements in Linux #184
Comments
This is a problem on macOS and presumably Windows as well. Not so much the boot-up race condition, but the ability to check the adaptor status at run time which would provide a means of working around this. On macOS at least you will receive an error when calling Unfortunately, I don't have the ability to explore this on Windows or bare metal. However, I suspect on the bare metal side this is largely a non-issue. @deadprogram what are your thoughts on exposing adapter state updates? I will do some digging. |
I have a need for this also. I have hacked around it for the time being as I wasn't sure about the design decisions, and because probably I'm the wrong person as I would immediately want a fully event-based interface for this project. Needs a longer-term understanding of the design decisions behind the current interface. I forgot that I also really want this 🤔 |
A full event-based system would be nice, but given that the interface needs to be efficient for bare metal targets I expect it would be a bit much. My plan is to implement it as a simple callback on adapter state change. This is the same interface approach used for the GAP connect handler and scanning callback. |
I've found systemd to be rather confusing, and dependencies don't always do what you'd expect. I guess the Bluetooth service isn't fully started (BT adapter powered on and all) before your custom service starts. Here is something that may or may not help (I'm still confused after reading these descriptions, they seem way more vague than necessary): |
Hi, I'm having an issue with a code that uses this library running in Raspberry.
The code works properly if I start it once the system has been turned on for a few minutes. If I run the code with systemctl (
After=bluetooth.target
) it returns 0 BLE devices when scanning, but there is no error returned in any of the library functions.I'm not sure if I should wait for a different service (other than
bluetooth.target
), but I think the library should be aware that is not "scanning properly" and return an error if it fails.Thank you
The text was updated successfully, but these errors were encountered: