LogRequestData.parse constructor

LogRequestData.parse(
  1. ByteData data_
)

Implementation

factory LogRequestData.parse(ByteData data_) {
  if (data_.lengthInBytes < LogRequestData.mavlinkEncodedLength) {
    var len = LogRequestData.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 count = data_.getUint32(4, Endian.little);
  var id = data_.getUint16(8, Endian.little);
  var targetSystem = data_.getUint8(10);
  var targetComponent = data_.getUint8(11);

  return LogRequestData(
      ofs: ofs,
      count: count,
      id: id,
      targetSystem: targetSystem,
      targetComponent: targetComponent);
}