hashtagchris / DotNet-BlueZ

A quick and dirty library for BlueZ's D-Bus APIs. Focus is on Bluetooth Low Energy APIs.
Apache License 2.0
104 stars 37 forks source link

ConnectAsync() is blocking Task #14

Open rkops-bd opened 3 years ago

rkops-bd commented 3 years ago

'await device.ConnectAsync(); await device.WaitForPropertyValueAsync("Connected", value: true, timeout);'

Line 2 will never be invocked when device can't connect (because it is out of range, for example). IN this case the BlueZ stack will throw an exception -> 'org.bluez.Error.Failed: Software caused connection abort', but does not respect the timeout sit in the second line.