btleplug
btleplug copied to clipboard
Allow to set custom timeout for connect
Feature Description
Disclaimer: I can only speak for the Linux version. I don't know how this is handled for iOS or Windows.
At the moment, the timeout for a connect action is hard coded into the library: https://github.com/deviceplug/btleplug/blob/master/src/bluez/adapter/peripheral.rs#L404
It would be nice to have a connect_with_timeout(&self, timeout: Duration)
method to be able to adjust the timeout at runtime.
Agreed, and this is still an issue in the new dbus bluez stuff. Will take this into consideration for the new API (cc @qwandor)
As I can see that feature needs enhancing in bluez-async code at least.
I added that PR in bluez-async /first. https://github.com/bluez-rs/bluez-async/pull/10
Added PR in btleplug https://github.com/deviceplug/btleplug/pull/213/files
This issue has hit me too, so am pleased to see work is going on here.
Currently the timeout is infinite? Because if that I'm gonna need this feature
Not finished for Windows, macos.
https://github.com/deviceplug/btleplug/pull/213