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

Disconnected state called multiple times on stream #869

Open
riccardocescon opened this issue May 21, 2024 · 0 comments
Open

Disconnected state called multiple times on stream #869

riccardocescon opened this issue May 21, 2024 · 0 comments

Comments

@riccardocescon
Copy link

Describe the bug
I have the connectionStream listened, if i disconnect there are no issues.
If i manually remove the ble peripherical while it is connected to the phone, then the disconnected state got called multiple times

To Reproduce
Steps to reproduce the behavior:

  1. on the main start a Listener on FlutterReactiveBle.connectionStream that simply logs the event
  2. Connect to one device using connectTo()
  3. Manually remove the ble device or power it off
  4. Observe the log called multiple dimes with the disconnected state

Expected behavior
I expect to receive 1 state for the disconnected value

Smartphone / tablet

  • Device: Pixel 6
  • OS: Android 15
  • Package version: 5.3.1

Peripheral device

  • nRF52832
  • Does it run a custom firmware: yes

Additional context
Here is the log i am getting

[event.connectedDeviceStream] Connected device: ConnectionStateUpdate(deviceId: D8:17:35:2A:C1:70, connectionState: DeviceConnectionState.connecting, failure: null)
[event.connectedDeviceStream] Connected device: ConnectionStateUpdate(deviceId: D8:17:35:2A:C1:70, connectionState: DeviceConnectionState.connected, failure: null)
[event.connectedDeviceStream] Connected device: ConnectionStateUpdate(deviceId: D8:17:35:2A:C1:70, connectionState: DeviceConnectionState.disconnected, failure: GenericFailure<ConnectionError>(code: ConnectionError.failedToConnect, message: "Disconnected from MAC='XX:XX:XX:XX:XX:XX' with status 8 (GATT_INSUF_AUTHORIZATION or GATT_CONN_TIMEOUT)"))
[event.connectedDeviceStream] Connected device: ConnectionStateUpdate(deviceId: D8:17:35:2A:C1:70, connectionState: DeviceConnectionState.disconnected, failure: GenericFailure<ConnectionError>(code: ConnectionError.failedToConnect, message: "Disconnected from MAC='XX:XX:XX:XX:XX:XX' with status 8 (GATT_INSUF_AUTHORIZATION or GATT_CONN_TIMEOUT)"))
[event.connectedDeviceStream] Connected device: ConnectionStateUpdate(deviceId: D8:17:35:2A:C1:70, connectionState: DeviceConnectionState.disconnecting, failure: null)
[event.connectedDeviceStream] Connected device: ConnectionStateUpdate(deviceId: D8:17:35:2A:C1:70, connectionState: DeviceConnectionState.disconnected, failure: null)
[event.connectedDeviceStream] Connected device: ConnectionStateUpdate(deviceId: D8:17:35:2A:C1:70, connectionState: DeviceConnectionState.disconnected, failure: null)
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

1 participant