mtu property

Stream<int> mtu

Stream emits a value:

  • immediately when first listened to
  • whenever the mtu changes

Implementation

Stream<int> get mtu {
  // get initial value from our cache
  int initialValue = FlutterBluePlus._mtuValues[remoteId]?.mtu ?? 23;
  return FlutterBluePlus._methodStream.stream
      .where((m) => m.method == "OnMtuChanged")
      .map((m) => m.arguments)
      .map((args) => BmMtuChangedResponse.fromMap(args))
      .where((p) => p.remoteId == remoteId)
      .map((p) => p.mtu)
      .newStreamWithInitialValue(initialValue);
}