Skip to content
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

getDiscoverServices throws fatal exception #887

Open
rsubramanyam2994 opened this issue Nov 15, 2024 · 1 comment
Open

getDiscoverServices throws fatal exception #887

rsubramanyam2994 opened this issue Nov 15, 2024 · 1 comment

Comments

@rsubramanyam2994
Copy link

Describe the bug
We are seeing a variety of fatal exceptions like: java:1311)] reactive_ble_mobile_platform.dart in ReactiveBleMobilePlatform.getDiscoverServices.<fn>, where the line of java code keeps varying like java:1457)], etc and the exception remains the same.

To Reproduce
Steps to reproduce the behavior:

  1. We connect to a single device using connectTo()
  2. We read and write to a single non-protected characteristic
  3. We aren't able to consistently replicate this but this keeps happening now and then. Sorry about that.

Stack trace:

PlatformException(service_discovery_failure, java.lang.Exception: Disconnected from MAC='XX:XX:XX:XX:XX:XX' with status 8 (GATT_INSUF_AUTHORIZATION or GATT_CONN_TIMEOUT), [com.signify.hue.flutterreactiveble.ble.ReactiveBleClient.discoverServices$lambda$10(SourceFile:71), com.signify.hue.flutterreactiveble.ble.ReactiveBleClient.v(SourceFile:1), com.signify.hue.flutterreactiveble.ble.M.invoke(SourceFile:1), com.signify.hue.flutterreactiveble.ble.ReactiveBleClient.discoverServices$lambda$11(SourceFile:11), com.signify.hue.flutterreactiveble.ble.ReactiveBleClient.E(SourceFile:1), com.signify.hue.flutterreactiveble.ble.N.apply(SourceFile:1), T6.w$a.d(SourceFile:3), Z6.h.c(SourceFile:22), e7.a$a.test(SourceFile:7), e7.a$a.c(SourceFile:57), e7.a.d(SourceFile:38), com.signify.hue.flutterreactiveble.ble.DeviceConnector.establishConnection$lambda$19(SourceFile:8), com.signify.hue.flutterreactiveble.ble.DeviceConnector.n(SourceFile:1), com.signify.hue.flutterreactiveble.ble.f.invoke(SourceFile:1), com.signify.hue.flutterreactiveble.ble.DeviceConnector.establishConnection$lambda$20(SourceFile:6), com.signify.hue.flutterreactiveble.ble.DeviceConnector.E(SourceFile:1), com.signify.hue.flutterreactiveble.ble.g.accept(SourceFile:1), O6.h.d(SourceFile:9), T6.n$a.d(SourceFile:13), T6.n$a.d(SourceFile:13), T6.J$a.onError(SourceFile:27), T6.W$b.f(SourceFile:73), T6.W$b.g(SourceFile:31), T6.W$a.onError(SourceFile:3), O6.a.onError(SourceFile:14), T6.b0$c.onError(SourceFile:21), T6.m$a.onError(SourceFile:3), T6.f0$a.onError(SourceFile:13), T6.V$a.onError(SourceFile:3), T6.m$a.onError(SourceFile:3), O6.g.onError(SourceFile:11), T6.k$a$a.onError(SourceFile:5), T6.v$b.f(SourceFile:36), T6.v$b.j(SourceFile:5), T6.v$b.h(SourceFile:7), T6.v$a.onError(SourceFile:25), T6.v$b.f(SourceFile:36), T6.v$b.j(SourceFile:5), T6.v$b.h(SourceFile:7), T6.v$a.onError(SourceFile:25), L6.d.o(SourceFile:6), T6.t.v0(SourceFile:20), F6.k.f(SourceFile:15), T6.v$b.l(SourceFile:68), T6.v$b.d(SourceFile:51), Z6.h.c(SourceFile:22), T6.Q$k.h(SourceFile:40), T6.Q$g.g(SourceFile:17), T6.Q$g.d(SourceFile:10), T6.n$a.d(SourceFile:13), T6.p$a.d(SourceFile:24), z5.b$a.test(SourceFile:7), z5.b$a.c(SourceFile:57), z5.b.accept(SourceFile:22), F5.y.d(SourceFile:3), F5.j0$b.onConnectionStateChange(SourceFile:46), android.bluetooth.BluetoothGatt$1$4.run(BluetoothGatt.java:390), android.bluetooth.BluetoothGatt.runOrQueueCallback(BluetoothGatt.java:1081), android.bluetooth.BluetoothGatt.-$$Nest$mrunOrQueueCallback(Unknown Source:0), android.bluetooth.BluetoothGatt$1.onClientConnectionState(BluetoothGatt.java:384), android.bluetooth.IBluetoothGattCallback$Stub.onTransact(IBluetoothGattCallback.java:209), android.os.Binder.execTransactInternal(Binder.java:1523), android.os.Binder.execTransact(Binder.java:1457)], null)

Expected behavior
We don't understand why this happens. Based on ble logs, we do observe that, even after disconnecting, the getDiscoverServices continues to happen.

Smartphone / tablet

  • Only Android devices (Android 11, Android 12, Android 13)

Peripheral device

Additional context
I understand the above information may not suffice. Please let us what kind of things to try/replicate so that we can give you further info to debug this.

@gabrielgarciagava
Copy link
Contributor

The library does not invoke getDiscoverServices by itself, so it is not clear what you mean by getDiscoverServices continues to happen even after disconnecting. Are you sure this is not being triggered by your code?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants