btleplug icon indicating copy to clipboard operation
btleplug copied to clipboard

Allow to set custom timeout for connect

Open MattesWhite opened this issue 4 years ago • 5 comments

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.

MattesWhite avatar Dec 02 '20 07:12 MattesWhite

Agreed, and this is still an issue in the new dbus bluez stuff. Will take this into consideration for the new API (cc @qwandor)

qdot avatar Feb 05 '21 02:02 qdot

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

blandger avatar Sep 25 '21 14:09 blandger

This issue has hit me too, so am pleased to see work is going on here.

osynge avatar Oct 26 '21 19:10 osynge

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

blandger avatar Aug 15 '23 05:08 blandger