Storm32GimbalManagerControl.parse constructor

Storm32GimbalManagerControl.parse(
  1. ByteData data_
)

Implementation

factory Storm32GimbalManagerControl.parse(ByteData data_) {
  if (data_.lengthInBytes <
      Storm32GimbalManagerControl.mavlinkEncodedLength) {
    var len = Storm32GimbalManagerControl.mavlinkEncodedLength -
        data_.lengthInBytes;
    var d = data_.buffer.asUint8List() + List<int>.filled(len, 0);
    data_ = Uint8List.fromList(d).buffer.asByteData();
  }
  var q = MavlinkMessage.asFloat32List(data_, 0, 4);
  var angularVelocityX = data_.getFloat32(16, Endian.little);
  var angularVelocityY = data_.getFloat32(20, Endian.little);
  var angularVelocityZ = data_.getFloat32(24, Endian.little);
  var deviceFlags = data_.getUint16(28, Endian.little);
  var managerFlags = data_.getUint16(30, Endian.little);
  var targetSystem = data_.getUint8(32);
  var targetComponent = data_.getUint8(33);
  var gimbalId = data_.getUint8(34);
  var client = data_.getUint8(35);

  return Storm32GimbalManagerControl(
      q: q,
      angularVelocityX: angularVelocityX,
      angularVelocityY: angularVelocityY,
      angularVelocityZ: angularVelocityZ,
      deviceFlags: deviceFlags,
      managerFlags: managerFlags,
      targetSystem: targetSystem,
      targetComponent: targetComponent,
      gimbalId: gimbalId,
      client: client);
}