Closed changewhite closed 1 year ago
logs are needed. Ideally verbose logs.
please reopen when you have logs.
I'm not aware of any code in FBP that would cause this.
you need to stop listening to the stream (i.e. call cancel
) when you disconnect
// Setup Listener for characteristic reads
final subscription = characteristic.onValueReceived.listen((value) {
// do something with new value
});
// listen for disconnection
device.connectionState.listen((BluetoothConnectionState state) async {
if (state == BluetoothConnectionState.disconnected) {
// stop listening to characteristic
subscription.cancel();
}
});
// enable notifications
await characteristic.setNotifyValue(true);
FlutterBluePlus Version
1.15.5
Flutter Version
3.10.6
What OS?
Android
OS Version
Android 13
What happened?
Characteristics are sending duplicate notifications when device is reconnected
Logs