EfiStatus.parse constructor

EfiStatus.parse(
  1. ByteData data_
)

Implementation

factory EfiStatus.parse(ByteData data_) {
  if (data_.lengthInBytes < EfiStatus.mavlinkEncodedLength) {
    var len = EfiStatus.mavlinkEncodedLength - data_.lengthInBytes;
    var d = data_.buffer.asUint8List() + List<int>.filled(len, 0);
    data_ = Uint8List.fromList(d).buffer.asByteData();
  }
  var ecuIndex = data_.getFloat32(0, Endian.little);
  var rpm = data_.getFloat32(4, Endian.little);
  var fuelConsumed = data_.getFloat32(8, Endian.little);
  var fuelFlow = data_.getFloat32(12, Endian.little);
  var engineLoad = data_.getFloat32(16, Endian.little);
  var throttlePosition = data_.getFloat32(20, Endian.little);
  var sparkDwellTime = data_.getFloat32(24, Endian.little);
  var barometricPressure = data_.getFloat32(28, Endian.little);
  var intakeManifoldPressure = data_.getFloat32(32, Endian.little);
  var intakeManifoldTemperature = data_.getFloat32(36, Endian.little);
  var cylinderHeadTemperature = data_.getFloat32(40, Endian.little);
  var ignitionTiming = data_.getFloat32(44, Endian.little);
  var injectionTime = data_.getFloat32(48, Endian.little);
  var exhaustGasTemperature = data_.getFloat32(52, Endian.little);
  var throttleOut = data_.getFloat32(56, Endian.little);
  var ptCompensation = data_.getFloat32(60, Endian.little);
  var health = data_.getUint8(64);
  var ignitionVoltage = data_.getFloat32(65, Endian.little);
  var fuelPressure = data_.getFloat32(69, Endian.little);

  return EfiStatus(
      ecuIndex: ecuIndex,
      rpm: rpm,
      fuelConsumed: fuelConsumed,
      fuelFlow: fuelFlow,
      engineLoad: engineLoad,
      throttlePosition: throttlePosition,
      sparkDwellTime: sparkDwellTime,
      barometricPressure: barometricPressure,
      intakeManifoldPressure: intakeManifoldPressure,
      intakeManifoldTemperature: intakeManifoldTemperature,
      cylinderHeadTemperature: cylinderHeadTemperature,
      ignitionTiming: ignitionTiming,
      injectionTime: injectionTime,
      exhaustGasTemperature: exhaustGasTemperature,
      throttleOut: throttleOut,
      ptCompensation: ptCompensation,
      health: health,
      ignitionVoltage: ignitionVoltage,
      fuelPressure: fuelPressure);
}