FlightInformation.parse constructor

FlightInformation.parse(
  1. ByteData data_
)

Implementation

factory FlightInformation.parse(ByteData data_) {
  if (data_.lengthInBytes < FlightInformation.mavlinkEncodedLength) {
    var len = FlightInformation.mavlinkEncodedLength - data_.lengthInBytes;
    var d = data_.buffer.asUint8List() + List<int>.filled(len, 0);
    data_ = Uint8List.fromList(d).buffer.asByteData();
  }
  var armingTimeUtc = data_.getUint64(0, Endian.little);
  var takeoffTimeUtc = data_.getUint64(8, Endian.little);
  var flightUuid = data_.getUint64(16, Endian.little);
  var timeBootMs = data_.getUint32(24, Endian.little);
  var landingTime = data_.getUint32(28, Endian.little);

  return FlightInformation(
      armingTimeUtc: armingTimeUtc,
      takeoffTimeUtc: takeoffTimeUtc,
      flightUuid: flightUuid,
      timeBootMs: timeBootMs,
      landingTime: landingTime);
}