SensAtmos.parse constructor

SensAtmos.parse(
  1. ByteData data_
)

Implementation

factory SensAtmos.parse(ByteData data_) {
  if (data_.lengthInBytes < SensAtmos.mavlinkEncodedLength) {
    var len = SensAtmos.mavlinkEncodedLength - data_.lengthInBytes;
    var d = data_.buffer.asUint8List() + List<int>.filled(len, 0);
    data_ = Uint8List.fromList(d).buffer.asByteData();
  }
  var timestamp = data_.getUint64(0, Endian.little);
  var tempambient = data_.getFloat32(8, Endian.little);
  var humidity = data_.getFloat32(12, Endian.little);

  return SensAtmos(
      timestamp: timestamp, tempambient: tempambient, humidity: humidity);
}