Comments (5)
Hmm I see this issue has some history perhaps #788
Yes I agree #788 is the same... It is quite annoying Windows API doesn't have a disconnect method.
In my desktop app I actually turn on / off the Bluotooth - and that works as a workaround. Turning Bluetooth off disconnects :-)
I can give it yet another shot before next release.
from dotnet-bluetooth-le.
Hi @axa88,
I'm the friendly issue checker.
Thanks for using the issue template 🌟
I appreciate it very much. I'm sure, the maintainers of this repository will answer, soon.
from dotnet-bluetooth-le.
Hmm I see this issue has some history perhaps #788
from dotnet-bluetooth-le.
@AskBojesen
I can imagine how a lack of Disconnect functionality could be problematic here... that seems fundamentally flawed.
During initial observations of this issue, I note a that after DisconnectDeviceAsync
failure, IDevice.NativeDevice
is then null and thus unusable.
My current workaround is basically appending DisconnectDeviceAsync
with WaitAsync
which takes a CancellationToken
. Then ignoring any IDevice
that is found having NativeDevice = null
, but this is be brittle.
Unfortunately as a symptom this now unusable device is left in the library cache if you will, and nothing, not even toggling Bluetooth on/off, will remove it. It cant be reacquired/replaced and the result is a catastrophic state.
Hopefully you find a solution.
Perhaps that includes overloading DisconnectDeviceAsync
to take a CancellationToken
and return Task<bool>
: success or not
from dotnet-bluetooth-le.
In my desktop app I actually turn on / off the Bluotooth - and that works as a workaround. Turning Bluetooth off disconnects :-)
This doesn't work for me, might you be able to provide any other info/advice to recover from this state?
If you hadn't found these references already:
This SO post looks informative.
There's also this post
from dotnet-bluetooth-le.
Related Issues (20)
- Windows: More than one lost connection does not work correctly HOT 17
- [WinUI] [3.1.0-beta.1] introduces null IDevice(s) to device lists HOT 9
- [BUG] NET MAUI on iOS, I read a wrong name connectiong to a Linux device HOT 8
- Can't detect device HOT 10
- when "OnConnectionStateChange: GattStatus: InsufficientAuthorization" is shown, the ble will hang forever HOT 5
- Manufacturer data packet is missing from device on iOS HOT 4
- Cannot use the package with Avalonia Cross Platform Project HOT 7
- ConnectToKnownDeviceAsync is giving null as device name HOT 2
- Regarding Plugin.BLE Connection Event HOT 1
- Plugin.BLE - Issue Regarding ambiguous connection HOT 2
- limit of bluetooth device can be connected simultaneous HOT 8
- Ble connected Device Get Service always return null HOT 2
- [WinUI] Adapter.DeviceConnected event is triggered n+1 times upon each subsequent Device Disconnect/Connect cycle HOT 7
- ISSUE: DeviceAdvertised event on Android HOT 10
- Need to be able to register for notification from characteristics that is only INDICATE HOT 9
- Windows: Check OS version runtime HOT 5
- Bluetooth stack breaks when trying connect on phone boot HOT 2
- It doesn't work with android 14 HOT 1
- It doesn't work with android 14 HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dotnet-bluetooth-le.