RallyPoint.parse constructor

RallyPoint.parse(
  1. ByteData data_
)

Implementation

factory RallyPoint.parse(ByteData data_) {
  if (data_.lengthInBytes < RallyPoint.mavlinkEncodedLength) {
    var len = RallyPoint.mavlinkEncodedLength - data_.lengthInBytes;
    var d = data_.buffer.asUint8List() + List<int>.filled(len, 0);
    data_ = Uint8List.fromList(d).buffer.asByteData();
  }
  var lat = data_.getInt32(0, Endian.little);
  var lng = data_.getInt32(4, Endian.little);
  var alt = data_.getInt16(8, Endian.little);
  var breakAlt = data_.getInt16(10, Endian.little);
  var landDir = data_.getUint16(12, Endian.little);
  var targetSystem = data_.getUint8(14);
  var targetComponent = data_.getUint8(15);
  var idx = data_.getUint8(16);
  var count = data_.getUint8(17);
  var flags = data_.getUint8(18);

  return RallyPoint(
      lat: lat,
      lng: lng,
      alt: alt,
      breakAlt: breakAlt,
      landDir: landDir,
      targetSystem: targetSystem,
      targetComponent: targetComponent,
      idx: idx,
      count: count,
      flags: flags);
}