MountControl.parse constructor

MountControl.parse(
  1. ByteData data_
)

Implementation

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

  return MountControl(
      inputA: inputA,
      inputB: inputB,
      inputC: inputC,
      targetSystem: targetSystem,
      targetComponent: targetComponent,
      savePosition: savePosition);
}