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
when "OnConnectionStateChange: GattStatus: InsufficientAuthorization" is shown, the ble will hang forever #831
Comments
Hi @ygl-rg, I'm the friendly issue checker. |
I noticed when "[Warning]: Can't disconnect XXX. Gatt is null." is thrown, the BLE won't work anymore. Do you have an idea what cause the gatt is null? |
what happens if you provide sufficient credentials? |
I have no idea. It looks like this issue is related to some old samsung phones. |
How so? It appears to me that as soon as you attempt to Write Not sure this is an issue whatsoever |
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
connect to a ble device
walk away until it disconnects, and go back reconnect it again
after several times, the trace will print "OnConnectionStateChange: GattStatus: InsufficientAuthorization"
Expected behavior
dispose the device and scan again, everything should be fine.
Actual behavior
the ble is mailfunctional, the only way to bring it back is to restart the app.
Crashlog
Adapter: Already cancelled scan.
2024-03-25 16:31:07.285 +08:00 [INF] connect needs 0.0044007 secs
2024-03-25 16:31:07.305 +08:00 [INF] XXX connected
2024-03-25 16:31:07.307 +08:00 [INF] Characteristic.StartUpdates
2024-03-25 16:31:08.806 +08:00 [INF] OnDescriptorWrite: 00-00
2024-03-25 16:31:08.808 +08:00 [INF] References of parent device and gatt callback device equal? TRUE
2024-03-25 16:31:08.808 +08:00 [INF] OnConnectionStateChange: GattStatus: InsufficientAuthorization
2024-03-25 16:31:08.808 +08:00 [INF] References of parent device gatt and callback gatt equal? TRUE
2024-03-25 16:31:08.811 +08:00 [ERR] disconnect dongle error
System.Exception: GattStatus: 133
at Plugin.BLE.Abstractions.Utils.TaskBuilder.d__11
1[[System.Boolean, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].MoveNext() at Plugin.BLE.Abstractions.Utils.TaskBuilder.<FromEvent>d__9
3[[System.Boolean, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.EventHandler`1[[Plugin.BLE.Android.CallbackEventArgs.DescriptorCallbackEventArgs, Plugin.BLE, Version=3.1.0.0, Culture=neutral, PublicKeyToken=null]], System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.EventHandler, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].MoveNext()at Plugin.BLE.Android.Characteristic.StopUpdatesNativeAsync(CancellationToken cancellationToken)
2024-03-25 16:31:08.813 +08:00 [INF] Disconnected 'XXX' by lost connection
2024-03-25 16:31:08.813 +08:00 [INF] DisconnectedPeripheral by lost signal: XXX
2024-03-25 16:31:08.813 +08:00 [INF] Removed device from discovered devices list: XXX
2024-03-25 16:31:08.831 +08:00 [INF] [Warning]: Can't disconnect XXX. Gatt is null.
2024-03-25 16:33:05.203 +08:00 [INF] Adapter: Already cancelled scan.
Configuration
Version of the Plugin: e.g. 3.0.0/3.1.0-beta
Platform: e.g. Android 11, 12 and 13
Device: e.g. Samsung S21, Realme 9i, Redmi 9T
The text was updated successfully, but these errors were encountered: