RawRpm.parse constructor

RawRpm.parse(
  1. ByteData data_
)

Implementation

factory RawRpm.parse(ByteData data_) {
  if (data_.lengthInBytes < RawRpm.mavlinkEncodedLength) {
    var len = RawRpm.mavlinkEncodedLength - data_.lengthInBytes;
    var d = data_.buffer.asUint8List() + List<int>.filled(len, 0);
    data_ = Uint8List.fromList(d).buffer.asByteData();
  }
  var frequency = data_.getFloat32(0, Endian.little);
  var index = data_.getUint8(4);

  return RawRpm(frequency: frequency, index: index);
}