LogData.parse constructor

LogData.parse(
  1. ByteData data_
)

Implementation

factory LogData.parse(ByteData data_) {
  if (data_.lengthInBytes < LogData.mavlinkEncodedLength) {
    var len = LogData.mavlinkEncodedLength - data_.lengthInBytes;
    var d = data_.buffer.asUint8List() + List<int>.filled(len, 0);
    data_ = Uint8List.fromList(d).buffer.asByteData();
  }
  var ofs = data_.getUint32(0, Endian.little);
  var id = data_.getUint16(4, Endian.little);
  var count = data_.getUint8(6);
  var data = MavlinkMessage.asUint8List(data_, 7, 90);

  return LogData(ofs: ofs, id: id, count: count, data: data);
}