Read response from Flutter Bluetooth device

342

Flutter Blue has problems with maintenance. I've opted for Flutter_Reactive_Ble which is supported by developers from Phillips and is very stable. This error does not happen there.

Would recommend anyone who navigated here to do the same.

Share:
342
RealRK
Author by

RealRK

Updated on December 26, 2022

Comments

  • RealRK
    RealRK over 1 year

    I am using Flutter Blue to write to device (tx in this case), which automatically sends back a response with List on the tx pin (rx in this case). How do I read the response? I'm getting value always as null. The device will send multiple packets of 20 bytes length.

    getBackgroundFunction() async {
        await _tx.write(setSetting, withoutResponse: false);
        List<int> value = await _rx.read();
        print(value);
      }
    

    I also tried:

    getBackgroundFunction() async {
        List<int> value = await _tx.write(setSetting, withoutResponse: false);
        print(value);
      }