SetActuatorControlTarget.parse constructor

SetActuatorControlTarget.parse(
  1. ByteData data_
)

Implementation

factory SetActuatorControlTarget.parse(ByteData data_) {
  if (data_.lengthInBytes < SetActuatorControlTarget.mavlinkEncodedLength) {
    var len =
        SetActuatorControlTarget.mavlinkEncodedLength - data_.lengthInBytes;
    var d = data_.buffer.asUint8List() + List<int>.filled(len, 0);
    data_ = Uint8List.fromList(d).buffer.asByteData();
  }
  var timeUsec = data_.getUint64(0, Endian.little);
  var controls = MavlinkMessage.asFloat32List(data_, 8, 8);
  var groupMlx = data_.getUint8(40);
  var targetSystem = data_.getUint8(41);
  var targetComponent = data_.getUint8(42);

  return SetActuatorControlTarget(
      timeUsec: timeUsec,
      controls: controls,
      groupMlx: groupMlx,
      targetSystem: targetSystem,
      targetComponent: targetComponent);
}