NamedValueInt.parse constructor

NamedValueInt.parse(
  1. ByteData data_
)

Implementation

factory NamedValueInt.parse(ByteData data_) {
  if (data_.lengthInBytes < NamedValueInt.mavlinkEncodedLength) {
    var len = NamedValueInt.mavlinkEncodedLength - data_.lengthInBytes;
    var d = data_.buffer.asUint8List() + List<int>.filled(len, 0);
    data_ = Uint8List.fromList(d).buffer.asByteData();
  }
  var timeBootMs = data_.getUint32(0, Endian.little);
  var value = data_.getInt32(4, Endian.little);
  var name = MavlinkMessage.asInt8List(data_, 8, 10);

  return NamedValueInt(timeBootMs: timeBootMs, value: value, name: name);
}