DigicamConfigure.parse constructor

DigicamConfigure.parse(
  1. ByteData data_
)

Implementation

factory DigicamConfigure.parse(ByteData data_) {
  if (data_.lengthInBytes < DigicamConfigure.mavlinkEncodedLength) {
    var len = DigicamConfigure.mavlinkEncodedLength - data_.lengthInBytes;
    var d = data_.buffer.asUint8List() + List<int>.filled(len, 0);
    data_ = Uint8List.fromList(d).buffer.asByteData();
  }
  var extraValue = data_.getFloat32(0, Endian.little);
  var shutterSpeed = data_.getUint16(4, Endian.little);
  var targetSystem = data_.getUint8(6);
  var targetComponent = data_.getUint8(7);
  var mode = data_.getUint8(8);
  var aperture = data_.getUint8(9);
  var iso = data_.getUint8(10);
  var exposureType = data_.getUint8(11);
  var commandId = data_.getUint8(12);
  var engineCutOff = data_.getUint8(13);
  var extraParam = data_.getUint8(14);

  return DigicamConfigure(
      extraValue: extraValue,
      shutterSpeed: shutterSpeed,
      targetSystem: targetSystem,
      targetComponent: targetComponent,
      mode: mode,
      aperture: aperture,
      iso: iso,
      exposureType: exposureType,
      commandId: commandId,
      engineCutOff: engineCutOff,
      extraParam: extraParam);
}