MountStatus.parse constructor

MountStatus.parse(
  1. ByteData data_
)

Implementation

factory MountStatus.parse(ByteData data_) {
  if (data_.lengthInBytes < MountStatus.mavlinkEncodedLength) {
    var len = MountStatus.mavlinkEncodedLength - data_.lengthInBytes;
    var d = data_.buffer.asUint8List() + List<int>.filled(len, 0);
    data_ = Uint8List.fromList(d).buffer.asByteData();
  }
  var pointingA = data_.getInt32(0, Endian.little);
  var pointingB = data_.getInt32(4, Endian.little);
  var pointingC = data_.getInt32(8, Endian.little);
  var targetSystem = data_.getUint8(12);
  var targetComponent = data_.getUint8(13);
  var mountMode = data_.getUint8(14);

  return MountStatus(
      pointingA: pointingA,
      pointingB: pointingB,
      pointingC: pointingC,
      targetSystem: targetSystem,
      targetComponent: targetComponent,
      mountMode: mountMode);
}