SerialUdbExtraF22.parse constructor

SerialUdbExtraF22.parse(
  1. ByteData data_
)

Implementation

factory SerialUdbExtraF22.parse(ByteData data_) {
  if (data_.lengthInBytes < SerialUdbExtraF22.mavlinkEncodedLength) {
    var len = SerialUdbExtraF22.mavlinkEncodedLength - data_.lengthInBytes;
    var d = data_.buffer.asUint8List() + List<int>.filled(len, 0);
    data_ = Uint8List.fromList(d).buffer.asByteData();
  }
  var sueAccelXAtCalibration = data_.getInt16(0, Endian.little);
  var sueAccelYAtCalibration = data_.getInt16(2, Endian.little);
  var sueAccelZAtCalibration = data_.getInt16(4, Endian.little);
  var sueGyroXAtCalibration = data_.getInt16(6, Endian.little);
  var sueGyroYAtCalibration = data_.getInt16(8, Endian.little);
  var sueGyroZAtCalibration = data_.getInt16(10, Endian.little);

  return SerialUdbExtraF22(
      sueAccelXAtCalibration: sueAccelXAtCalibration,
      sueAccelYAtCalibration: sueAccelYAtCalibration,
      sueAccelZAtCalibration: sueAccelZAtCalibration,
      sueGyroXAtCalibration: sueGyroXAtCalibration,
      sueGyroYAtCalibration: sueGyroYAtCalibration,
      sueGyroZAtCalibration: sueGyroZAtCalibration);
}