btleplug icon indicating copy to clipboard operation
btleplug copied to clipboard

added Connect with timeout method on Peripheral

Open blandger opened this issue 4 years ago • 6 comments

  1. I added method connect_with_timeout(&self, timeout: Duration) to Peripheral (ble device)

  2. Looks like bluez/async changed enum variant to DeviceEvent::Rssi

Checked on linux only. I don't know how to implement that for Windows, macOS though.

blandger avatar Sep 25 '21 14:09 blandger

I'm not sure what you've done here, but you've somehow included a bunch of other commits. Can you rebase so this only has your new commits? You probably want to rebase on top of https://github.com/deviceplug/btleplug/pull/214 for the new version of bluez-async.

qwandor avatar Oct 02 '21 11:10 qwandor

Only 4 files with changes. Sorry, I can't rebase all that stuff properly. Updated bluez-async to 0.5.0

blandger avatar Oct 02 '21 17:10 blandger

Okay, I've rebased for you and fixed the formatting. The build is still broken on MacOS and Windows though, you'll need to implement the new method on all three platforms before we can merge this.

qwandor avatar Oct 02 '21 21:10 qwandor

I looked at windows-rs MS code and docs (around BLEDevice) and I don't see the clear way to introduce 'connect timeout' using exposed Win API. I'll appreciate If someone can give a right direction.

blandger avatar Oct 09 '21 17:10 blandger

This needs rebasing again, and I'm still not sure the lack of windows/macOS has been addressed, plus now we also need to consider android?

qdot avatar Sep 04 '22 01:09 qdot

I looked MS docs for making such 'connect variant' and don't see simple approach to implement that. I hope that is possible but don't have a good idea how to combine timeout with the ble win api. I have capabilities to test such thing locally too. As for MacOs I don't have any ability to implement and check such functionality at all, sorry. I didn't see Android sources yet to think on that.

Looked through this MS docs https://microsoft.github.io/windows-docs-rs/doc/windows/Devices/Bluetooth/index.html

blandger avatar Sep 04 '22 07:09 blandger

This never got updated for the newer platforms, and we've moved on enough that it probably needs a full rebuild if it's going to happen. Closing, can open a new impl PR if one happens.

qdot avatar Oct 05 '24 23:10 qdot