从 Flutter 蓝牙设备读取响应

Read response from Flutter Bluetooth device

我正在使用 Flutter Blue 写入设备(在本例中为 tx),它会在 tx 引脚(在本例中为 rx)上自动发回带有 List 的响应。我如何阅读回复?我得到的价值总是为空。设备将发送多个 20 字节长度的数据包。

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

我也试过:

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

Flutter Blue 维护有问题。我选择了 Flutter_Reactive_Ble,它得到 Phillips 开发人员的支持并且非常稳定。那里不会发生此错误。

会推荐浏览过此处的任何人都这样做。