MemoryVect.parse constructor

MemoryVect.parse(
  1. ByteData data_
)

Implementation

factory MemoryVect.parse(ByteData data_) {
  if (data_.lengthInBytes < MemoryVect.mavlinkEncodedLength) {
    var len = MemoryVect.mavlinkEncodedLength - data_.lengthInBytes;
    var d = data_.buffer.asUint8List() + List<int>.filled(len, 0);
    data_ = Uint8List.fromList(d).buffer.asByteData();
  }
  var address = data_.getUint16(0, Endian.little);
  var ver = data_.getUint8(2);
  var type = data_.getUint8(3);
  var value = MavlinkMessage.asInt8List(data_, 4, 32);

  return MemoryVect(address: address, ver: ver, type: type, value: value);
}