RequestDataStream.parse constructor

RequestDataStream.parse(
  1. ByteData data_
)

Implementation

factory RequestDataStream.parse(ByteData data_) {
  if (data_.lengthInBytes < RequestDataStream.mavlinkEncodedLength) {
    var len = RequestDataStream.mavlinkEncodedLength - data_.lengthInBytes;
    var d = data_.buffer.asUint8List() + List<int>.filled(len, 0);
    data_ = Uint8List.fromList(d).buffer.asByteData();
  }
  var reqMessageRate = data_.getUint16(0, Endian.little);
  var targetSystem = data_.getUint8(2);
  var targetComponent = data_.getUint8(3);
  var reqStreamId = data_.getUint8(4);
  var startStop = data_.getUint8(5);

  return RequestDataStream(
      reqMessageRate: reqMessageRate,
      targetSystem: targetSystem,
      targetComponent: targetComponent,
      reqStreamId: reqStreamId,
      startStop: startStop);
}