ExtendedSysState.parse constructor

ExtendedSysState.parse(
  1. ByteData data_
)

Implementation

factory ExtendedSysState.parse(ByteData data_) {
  if (data_.lengthInBytes < ExtendedSysState.mavlinkEncodedLength) {
    var len = ExtendedSysState.mavlinkEncodedLength - data_.lengthInBytes;
    var d = data_.buffer.asUint8List() + List<int>.filled(len, 0);
    data_ = Uint8List.fromList(d).buffer.asByteData();
  }
  var vtolState = data_.getUint8(0);
  var landedState = data_.getUint8(1);

  return ExtendedSysState(vtolState: vtolState, landedState: landedState);
}