Gps2Rtk.parse constructor

Gps2Rtk.parse(
  1. ByteData data_
)

Implementation

factory Gps2Rtk.parse(ByteData data_) {
  if (data_.lengthInBytes < Gps2Rtk.mavlinkEncodedLength) {
    var len = Gps2Rtk.mavlinkEncodedLength - data_.lengthInBytes;
    var d = data_.buffer.asUint8List() + List<int>.filled(len, 0);
    data_ = Uint8List.fromList(d).buffer.asByteData();
  }
  var timeLastBaselineMs = data_.getUint32(0, Endian.little);
  var tow = data_.getUint32(4, Endian.little);
  var baselineAMm = data_.getInt32(8, Endian.little);
  var baselineBMm = data_.getInt32(12, Endian.little);
  var baselineCMm = data_.getInt32(16, Endian.little);
  var accuracy = data_.getUint32(20, Endian.little);
  var iarNumHypotheses = data_.getInt32(24, Endian.little);
  var wn = data_.getUint16(28, Endian.little);
  var rtkReceiverId = data_.getUint8(30);
  var rtkHealth = data_.getUint8(31);
  var rtkRate = data_.getUint8(32);
  var nsats = data_.getUint8(33);
  var baselineCoordsType = data_.getUint8(34);

  return Gps2Rtk(
      timeLastBaselineMs: timeLastBaselineMs,
      tow: tow,
      baselineAMm: baselineAMm,
      baselineBMm: baselineBMm,
      baselineCMm: baselineCMm,
      accuracy: accuracy,
      iarNumHypotheses: iarNumHypotheses,
      wn: wn,
      rtkReceiverId: rtkReceiverId,
      rtkHealth: rtkHealth,
      rtkRate: rtkRate,
      nsats: nsats,
      baselineCoordsType: baselineCoordsType);
}