FlexifunctionReadReq.parse constructor

FlexifunctionReadReq.parse(
  1. ByteData data_
)

Implementation

factory FlexifunctionReadReq.parse(ByteData data_) {
  if (data_.lengthInBytes < FlexifunctionReadReq.mavlinkEncodedLength) {
    var len = FlexifunctionReadReq.mavlinkEncodedLength - data_.lengthInBytes;
    var d = data_.buffer.asUint8List() + List<int>.filled(len, 0);
    data_ = Uint8List.fromList(d).buffer.asByteData();
  }
  var readReqType = data_.getInt16(0, Endian.little);
  var dataIndex = data_.getInt16(2, Endian.little);
  var targetSystem = data_.getUint8(4);
  var targetComponent = data_.getUint8(5);

  return FlexifunctionReadReq(
      readReqType: readReqType,
      dataIndex: dataIndex,
      targetSystem: targetSystem,
      targetComponent: targetComponent);
}