SensPower.parse constructor

SensPower.parse(
  1. ByteData data_
)

Implementation

factory SensPower.parse(ByteData data_) {
  if (data_.lengthInBytes < SensPower.mavlinkEncodedLength) {
    var len = SensPower.mavlinkEncodedLength - data_.lengthInBytes;
    var d = data_.buffer.asUint8List() + List<int>.filled(len, 0);
    data_ = Uint8List.fromList(d).buffer.asByteData();
  }
  var adc121VspbVolt = data_.getFloat32(0, Endian.little);
  var adc121CspbAmp = data_.getFloat32(4, Endian.little);
  var adc121Cs1Amp = data_.getFloat32(8, Endian.little);
  var adc121Cs2Amp = data_.getFloat32(12, Endian.little);

  return SensPower(
      adc121VspbVolt: adc121VspbVolt,
      adc121CspbAmp: adc121CspbAmp,
      adc121Cs1Amp: adc121Cs1Amp,
      adc121Cs2Amp: adc121Cs2Amp);
}