New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Windows: More than one lost connection does not work correctly #826
Comments
Hi @CodeMusher, I'm the friendly issue checker. |
This is supposed to be 3.1.0-beta.2, I assume? |
Sorry, my bad! 3.1.0-beta.2 is correct |
This could be solved by adding this line |
Hm, looks like that line is there already ... dotnet-bluetooth-le/Source/Plugin.BLE/Windows/Adapter.cs Lines 148 to 151 in 04a5d27
... but maybe it's not always called? @AskBojesen This seems to be your code (see #809). Care to have a look? |
@CodeMusher So this fails with 3.1.0-beta.2. Does it work with any prior version, like 3.1.0-beta.1 or 3.0.0? (Then it would be regression.) Or a later version like 3.1.0-rc.1? (Probably not?) |
I will try to reproduce with latest later today or tomorrow |
@janusw, @AskBojesen |
@CodeMusher: Please register a new issue, so we don't get more confused... |
@AskBojesen Sorry, I'll do that of course. |
IMO this is not a bug in the plugin, but wrong usage of the API in the example code, which I have made myself to test something.... This method does in fact not test connection lost > reconnect... correctly as I believe the API should be used In our application, where we use the plugin in both Android + iOS + Windows. We listen for connection lost and handles connection lost -> reconnect,.. and it works on all three platforms :-) If this is to be "fixed" the WinConsole demo method must be fixed to show how it can work. But it is not related to the API and the functionality itself of the plugin - I can fix the demo method within a week - but remember it is only the winconsole demo... The WinConsole demo is now used - and I appreciate that :-), but I also see it has consequences: All test methods must be valid with respect to how how a client must use the API.... @janusw: IMO the other client implementations are not even close to the winconsole client with respect to correct usage and functionality... I vote fixing up the clients with functionality and correct usage (whatever that is) for some next release. What do you say @janusw : Should I use the effort to show how this can work with the existing API for connection lost -> reconnect now (within a week)? |
@AskBojesen Does the WinConsole demo work the same when you tried it or have I missed something? |
@AskBojesen, @janusw In my application I also listen for lost connection event and start a reconnection process. Since I only managed to get the lost connection event once I tried to find any errors. If this is not a bug and it works for you on all platforms, then something must be missing in my use of the API. |
Well now I have improved the demo in the winconsole. |
I found the bug and fixed the issue - sorry for my stubbornness from believing there was a bug. |
@AskBojesen good to hear that I wasn’t wrong about this😉 |
No I don't see it as an error with the GattSession_SessionStatusChanged - we could leave it out of the log. |
To help us fix your issue, please provide the information in the below template. If something causes a crash, provide as much information as you can gather.
Just imagine: we do not know what you are doing!
Steps to reproduce
I run the WinConsole application. Press D1 to listen for devices, Select my Device and press D9 to run Connect -> Loop: ConnectionLost -> Connect
The first time I power cycle my device it clearly state : DisconnectedPeripheral by lost signal:
Power up the device => Normal behavior
Power cycle the device again. Now it states: DisconnectedPeripheral by user:
Expected behavior
It should not matter now many times I power cycle the device. It should always be DisconnectedPeripheral by lost signal
Actual behavior
It works one time! The first power cycle operation causes the device to be put in the disconnectingRegistry
Crashlog
If something causes an exception paste full stack trace + Exception here
Configuration
Version of the Plugin:
3..0-beta-2.
Platform: e.g. iOS 10.1 / Android 4.4 / ... (including version!!! e.g. Android 5.1 / i0S 10)
Windows
Device: e.g. HTC Sensation /i Phone 7 ...
Laptop
The text was updated successfully, but these errors were encountered: