TimeEstimateToTarget.parse constructor

TimeEstimateToTarget.parse(
  1. ByteData data_
)

Implementation

factory TimeEstimateToTarget.parse(ByteData data_) {
  if (data_.lengthInBytes < TimeEstimateToTarget.mavlinkEncodedLength) {
    var len = TimeEstimateToTarget.mavlinkEncodedLength - data_.lengthInBytes;
    var d = data_.buffer.asUint8List() + List<int>.filled(len, 0);
    data_ = Uint8List.fromList(d).buffer.asByteData();
  }
  var safeReturn = data_.getInt32(0, Endian.little);
  var land = data_.getInt32(4, Endian.little);
  var missionNextItem = data_.getInt32(8, Endian.little);
  var missionEnd = data_.getInt32(12, Endian.little);
  var commandedAction = data_.getInt32(16, Endian.little);

  return TimeEstimateToTarget(
      safeReturn: safeReturn,
      land: land,
      missionNextItem: missionNextItem,
      missionEnd: missionEnd,
      commandedAction: commandedAction);
}