-
Notifications
You must be signed in to change notification settings - Fork 146
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
[Linux] Scanning in progress gets out of sync if starting to scan while adapter is powered off #340
Comments
@Lenart12 what do you think should happen in this case? Some possibilities:
|
I think it should be handled by the user manualy. Here in the example adapter is restarted by hand but on linux it can be reset (or powered down) by other applications as well. Probably best way in my mind is only to fix getting out of sync and report an error that can be handled by the user, maybe with a call to Enable() |
OK, I think I misunderstood the original question. My bad. My current understanding is that if the adaptor is powered down while already scanning, you want to return right away from scan with an error. If that is the case, then this is probably the place to try to catch that event happening: |
When I live tested on my local machine, and powered off the Bluetooth adaptor while scanning with this branch: $ go run ./examples/scanner/
scanning...
found device: *****************
found device: *****************
found device: *****************
found device: *****************
found device: *****************
found device: *****************
found device: *****************
panic: failed to start scan: bluetooth: adaptor is not powered So it appears to work correctly. |
As in the title, when trying to start scan but adapter is powered off it will internaly think scan is active but that is not the case.
Minimal reproduction:
The text was updated successfully, but these errors were encountered: