flutter_reactive_ble_uart_example
flutter_reactive_ble_uart_example copied to clipboard
Bad state: Stream has already been listened to
It seems the code runs through this block a second time for some reason which gives me the Bad State Error. Is there a way to fix this?
_receivedDataStream =
flutterReactiveBle.subscribeToCharacteristic(_txCharacteristic);
_receivedDataStream.listen((data) {
onNewReceivedData(data);
}, onError: (dynamic error) {
_logTexts = "${_logTexts}Error:$error$id\n";
});
Hi Henrique,
In my opinion it should be called only once.
Br Carl.
Op vr 15 jul. 2022 12:05 schreef Henrique Guimarães < @.***>:
It seems the code runs through this block a second time for some reason which gives me the Bad State Error. Is there a way to fix this?
_receivedDataStream = flutterReactiveBle.subscribeToCharacteristic(_txCharacteristic); _receivedDataStream.listen((data) { onNewReceivedData(data); }, onError: (dynamic error) { _logTexts = "${_logTexts}Error:$error$id\n"; });
— Reply to this email directly, view it on GitHub https://github.com/wolfc01/flutter_reactive_ble_uart_example/issues/5, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJ5CCF4MRBSDRRUORORURLVUEZW5ANCNFSM53VCR7AA . You are receiving this because you are subscribed to this thread.Message ID: @.***>