CommandLongStamped.parse constructor

CommandLongStamped.parse(
  1. ByteData data_
)

Implementation

factory CommandLongStamped.parse(ByteData data_) {
  if (data_.lengthInBytes < CommandLongStamped.mavlinkEncodedLength) {
    var len = CommandLongStamped.mavlinkEncodedLength - data_.lengthInBytes;
    var d = data_.buffer.asUint8List() + List<int>.filled(len, 0);
    data_ = Uint8List.fromList(d).buffer.asByteData();
  }
  var vehicleTimestamp = data_.getUint64(0, Endian.little);
  var utcTime = data_.getUint32(8, Endian.little);
  var param1 = data_.getFloat32(12, Endian.little);
  var param2 = data_.getFloat32(16, Endian.little);
  var param3 = data_.getFloat32(20, Endian.little);
  var param4 = data_.getFloat32(24, Endian.little);
  var param5 = data_.getFloat32(28, Endian.little);
  var param6 = data_.getFloat32(32, Endian.little);
  var param7 = data_.getFloat32(36, Endian.little);
  var command = data_.getUint16(40, Endian.little);
  var targetSystem = data_.getUint8(42);
  var targetComponent = data_.getUint8(43);
  var confirmation = data_.getUint8(44);

  return CommandLongStamped(
      vehicleTimestamp: vehicleTimestamp,
      utcTime: utcTime,
      param1: param1,
      param2: param2,
      param3: param3,
      param4: param4,
      param5: param5,
      param6: param6,
      param7: param7,
      command: command,
      targetSystem: targetSystem,
      targetComponent: targetComponent,
      confirmation: confirmation);
}