diff --git a/.gitignore b/.gitignore
index e54141d807c..39a55e142e7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,6 @@
# User-specific stuff:
-.idea/**
-*/.idea/**
+.idea/*.xml
+*/.idea/*.xml
*.iml
.vscode/**
.java-version
@@ -196,3 +196,5 @@ link.txt*/
CMakeFiles/
CMakeCache.txt
DartConfiguration.tcl
+/.idea/libraries/
+/.idea/inspectionProfiles/
diff --git a/.idea/.gitignore b/.idea/.gitignore
new file mode 100644
index 00000000000..3dea668358a
--- /dev/null
+++ b/.idea/.gitignore
@@ -0,0 +1,13 @@
+# Default ignored files
+/shelf/
+/workspace.xml
+# Editor-based HTTP Client requests
+/httpRequests/
+# Datasource local storage ignored files
+/dataSources/
+/dataSources.local.xml
+# Zeppelin ignored files
+/ZeppelinRemoteNotebooks/
+/libraries/
+/inspectionProfiles/
+
diff --git a/.idea/fileTemplates/includes/File Header Yml.yml b/.idea/fileTemplates/includes/File Header Yml.yml
deleted file mode 100644
index 11705982b67..00000000000
--- a/.idea/fileTemplates/includes/File Header Yml.yml
+++ /dev/null
@@ -1,18 +0,0 @@
-# ----------------------------------------------------------------------------
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# https://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-# ----------------------------------------------------------------------------
diff --git a/plc4j/drivers/profinet/pom.xml b/plc4j/drivers/profinet/pom.xml
index d60f5b16544..88abfdb470a 100644
--- a/plc4j/drivers/profinet/pom.xml
+++ b/plc4j/drivers/profinet/pom.xml
@@ -47,6 +47,11 @@
java
read-write
src/main/generated
+
+ true
+
+ true
+
@@ -149,10 +154,6 @@
io.netty
netty-buffer
-
- io.netty
- netty-transport
-
org.apache.commons
commons-lang3
@@ -218,6 +219,14 @@
test-jar
test
+
+ com.fasterxml.jackson.core
+ jackson-annotations
+
+
+ com.fasterxml.jackson.dataformat
+ jackson-dataformat-xml
+
diff --git a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/CheckPeers.java b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/CheckPeers.java
new file mode 100644
index 00000000000..f58c7578656
--- /dev/null
+++ b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/CheckPeers.java
@@ -0,0 +1,280 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.plc4x.java.profinet.readwrite;
+
+import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*;
+import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*;
+import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*;
+import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*;
+import static org.apache.plc4x.java.spi.generation.StaticHelper.*;
+
+import java.time.*;
+import java.util.*;
+import org.apache.plc4x.java.api.exceptions.*;
+import org.apache.plc4x.java.api.value.*;
+import org.apache.plc4x.java.spi.codegen.*;
+import org.apache.plc4x.java.spi.codegen.fields.*;
+import org.apache.plc4x.java.spi.codegen.io.*;
+import org.apache.plc4x.java.spi.generation.*;
+
+// Code generated by code-generation. DO NOT EDIT.
+
+public class CheckPeers extends PnIoCm_Block implements Message {
+
+ // Accessors for discriminator values.
+ public PnIoCm_BlockType getBlockType() {
+ return PnIoCm_BlockType.CHECK_PEERS;
+ }
+
+ // Constant values.
+ public static final Short NOOFPEERS = 0x01;
+
+ // Properties.
+ protected final short blockVersionHigh;
+ protected final short blockVersionLow;
+ protected final PascalString peerPortId;
+ protected final PascalString peerChassisId;
+
+ public CheckPeers(
+ short blockVersionHigh,
+ short blockVersionLow,
+ PascalString peerPortId,
+ PascalString peerChassisId) {
+ super();
+ this.blockVersionHigh = blockVersionHigh;
+ this.blockVersionLow = blockVersionLow;
+ this.peerPortId = peerPortId;
+ this.peerChassisId = peerChassisId;
+ }
+
+ public short getBlockVersionHigh() {
+ return blockVersionHigh;
+ }
+
+ public short getBlockVersionLow() {
+ return blockVersionLow;
+ }
+
+ public PascalString getPeerPortId() {
+ return peerPortId;
+ }
+
+ public PascalString getPeerChassisId() {
+ return peerChassisId;
+ }
+
+ public short getNoOfPeers() {
+ return NOOFPEERS;
+ }
+
+ @Override
+ protected void serializePnIoCm_BlockChild(WriteBuffer writeBuffer) throws SerializationException {
+ PositionAware positionAware = writeBuffer;
+ int startPos = positionAware.getPos();
+ writeBuffer.pushContext("CheckPeers");
+
+ // Implicit Field (blockLength) (Used for parsing, but its value is not stored as it's
+ // implicitly given by the objects content)
+ int blockLength = (int) ((getLengthInBytes()) - (4));
+ writeImplicitField(
+ "blockLength",
+ blockLength,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Simple Field (blockVersionHigh)
+ writeSimpleField(
+ "blockVersionHigh",
+ blockVersionHigh,
+ writeUnsignedShort(writeBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Simple Field (blockVersionLow)
+ writeSimpleField(
+ "blockVersionLow",
+ blockVersionLow,
+ writeUnsignedShort(writeBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Const Field (noOfPeers)
+ writeConstField(
+ "noOfPeers",
+ NOOFPEERS,
+ writeUnsignedShort(writeBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Simple Field (peerPortId)
+ writeSimpleField(
+ "peerPortId",
+ peerPortId,
+ new DataWriterComplexDefault<>(writeBuffer),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Simple Field (peerChassisId)
+ writeSimpleField(
+ "peerChassisId",
+ peerChassisId,
+ new DataWriterComplexDefault<>(writeBuffer),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ writeBuffer.popContext("CheckPeers");
+ }
+
+ @Override
+ public int getLengthInBytes() {
+ return (int) Math.ceil((float) getLengthInBits() / 8.0);
+ }
+
+ @Override
+ public int getLengthInBits() {
+ int lengthInBits = super.getLengthInBits();
+ CheckPeers _value = this;
+
+ // Implicit Field (blockLength)
+ lengthInBits += 16;
+
+ // Simple field (blockVersionHigh)
+ lengthInBits += 8;
+
+ // Simple field (blockVersionLow)
+ lengthInBits += 8;
+
+ // Const Field (noOfPeers)
+ lengthInBits += 8;
+
+ // Simple field (peerPortId)
+ lengthInBits += peerPortId.getLengthInBits();
+
+ // Simple field (peerChassisId)
+ lengthInBits += peerChassisId.getLengthInBits();
+
+ return lengthInBits;
+ }
+
+ public static PnIoCm_BlockBuilder staticParsePnIoCm_BlockBuilder(ReadBuffer readBuffer)
+ throws ParseException {
+ readBuffer.pullContext("CheckPeers");
+ PositionAware positionAware = readBuffer;
+ int startPos = positionAware.getPos();
+ int curPos;
+
+ int blockLength =
+ readImplicitField(
+ "blockLength",
+ readUnsignedInt(readBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ short blockVersionHigh =
+ readSimpleField(
+ "blockVersionHigh",
+ readUnsignedShort(readBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ short blockVersionLow =
+ readSimpleField(
+ "blockVersionLow",
+ readUnsignedShort(readBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ short noOfPeers =
+ readConstField(
+ "noOfPeers",
+ readUnsignedShort(readBuffer, 8),
+ CheckPeers.NOOFPEERS,
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ PascalString peerPortId =
+ readSimpleField(
+ "peerPortId",
+ new DataReaderComplexDefault<>(() -> PascalString.staticParse(readBuffer), readBuffer),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ PascalString peerChassisId =
+ readSimpleField(
+ "peerChassisId",
+ new DataReaderComplexDefault<>(() -> PascalString.staticParse(readBuffer), readBuffer),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ readBuffer.closeContext("CheckPeers");
+ // Create the instance
+ return new CheckPeersBuilderImpl(blockVersionHigh, blockVersionLow, peerPortId, peerChassisId);
+ }
+
+ public static class CheckPeersBuilderImpl implements PnIoCm_Block.PnIoCm_BlockBuilder {
+ private final short blockVersionHigh;
+ private final short blockVersionLow;
+ private final PascalString peerPortId;
+ private final PascalString peerChassisId;
+
+ public CheckPeersBuilderImpl(
+ short blockVersionHigh,
+ short blockVersionLow,
+ PascalString peerPortId,
+ PascalString peerChassisId) {
+ this.blockVersionHigh = blockVersionHigh;
+ this.blockVersionLow = blockVersionLow;
+ this.peerPortId = peerPortId;
+ this.peerChassisId = peerChassisId;
+ }
+
+ public CheckPeers build() {
+ CheckPeers checkPeers =
+ new CheckPeers(blockVersionHigh, blockVersionLow, peerPortId, peerChassisId);
+ return checkPeers;
+ }
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (!(o instanceof CheckPeers)) {
+ return false;
+ }
+ CheckPeers that = (CheckPeers) o;
+ return (getBlockVersionHigh() == that.getBlockVersionHigh())
+ && (getBlockVersionLow() == that.getBlockVersionLow())
+ && (getPeerPortId() == that.getPeerPortId())
+ && (getPeerChassisId() == that.getPeerChassisId())
+ && super.equals(that)
+ && true;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(
+ super.hashCode(),
+ getBlockVersionHigh(),
+ getBlockVersionLow(),
+ getPeerPortId(),
+ getPeerChassisId());
+ }
+
+ @Override
+ public String toString() {
+ WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true);
+ try {
+ writeBufferBoxBased.writeSerializable(this);
+ } catch (SerializationException e) {
+ throw new RuntimeException(e);
+ }
+ return "\n" + writeBufferBoxBased.getBox().toString() + "\n";
+ }
+}
diff --git a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/DataItem.java b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/DataItem.java
new file mode 100644
index 00000000000..b2ca0430e30
--- /dev/null
+++ b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/DataItem.java
@@ -0,0 +1,849 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.plc4x.java.profinet.readwrite;
+
+import static org.apache.plc4x.java.spi.generation.StaticHelper.*;
+
+import java.math.BigInteger;
+import java.time.*;
+import java.util.*;
+import org.apache.plc4x.java.api.value.*;
+import org.apache.plc4x.java.spi.codegen.WithOption;
+import org.apache.plc4x.java.spi.generation.ByteOrder;
+import org.apache.plc4x.java.spi.generation.EvaluationHelper;
+import org.apache.plc4x.java.spi.generation.ParseException;
+import org.apache.plc4x.java.spi.generation.ReadBuffer;
+import org.apache.plc4x.java.spi.generation.SerializationException;
+import org.apache.plc4x.java.spi.generation.WriteBuffer;
+import org.apache.plc4x.java.spi.values.*;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+// Code generated by code-generation. DO NOT EDIT.
+
+public class DataItem {
+
+ private static final Logger LOGGER = LoggerFactory.getLogger(DataItem.class);
+
+ public static PlcValue staticParse(
+ ReadBuffer readBuffer, ProfinetDataType dataType, Integer numberOfValues)
+ throws ParseException {
+ if (EvaluationHelper.equals(dataType, ProfinetDataType.BOOL)
+ && EvaluationHelper.equals(numberOfValues, 1)) { // BOOL
+
+ // Simple Field (value)
+ Boolean value = /*TODO: migrate me*/ /*TODO: migrate me*/ readBuffer.readBit("");
+
+ return new PlcBOOL(value);
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.BOOL)) { // List
+ // Array field (value)
+ // Count array
+ if (numberOfValues > Integer.MAX_VALUE) {
+ throw new ParseException(
+ "Array count of "
+ + (numberOfValues)
+ + " exceeds the maximum allowed count of "
+ + Integer.MAX_VALUE);
+ }
+ List value;
+ {
+ int itemCount = (int) numberOfValues;
+ value = new LinkedList<>();
+ for (int curItem = 0; curItem < itemCount; curItem++) {
+ value.add(
+ new PlcBOOL(
+ (Boolean) /*TODO: migrate me*/ /*TODO: migrate me*/ readBuffer.readBit("")));
+ }
+ }
+
+ return new PlcList(value);
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.BYTE)
+ && EvaluationHelper.equals(numberOfValues, 1)) { // BYTE
+
+ // Simple Field (value)
+ Short value = /*TODO: migrate me*/ /*TODO: migrate me*/ readBuffer.readUnsignedShort("", 8);
+
+ return new PlcBYTE(value);
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.BYTE)) { // List
+ // Array field (value)
+ // Count array
+ if ((numberOfValues) * (8) > Integer.MAX_VALUE) {
+ throw new ParseException(
+ "Array count of "
+ + ((numberOfValues) * (8))
+ + " exceeds the maximum allowed count of "
+ + Integer.MAX_VALUE);
+ }
+ List value;
+ {
+ int itemCount = (int) (numberOfValues) * (8);
+ value = new LinkedList<>();
+ for (int curItem = 0; curItem < itemCount; curItem++) {
+ value.add(
+ new PlcBOOL(
+ (Boolean) /*TODO: migrate me*/ /*TODO: migrate me*/ readBuffer.readBit("")));
+ }
+ }
+
+ return new PlcList(value);
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.WORD)) { // WORD
+
+ // Simple Field (value)
+ Integer value = /*TODO: migrate me*/ /*TODO: migrate me*/ readBuffer.readUnsignedInt("", 16);
+
+ return new PlcWORD(value);
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.DWORD)) { // DWORD
+
+ // Simple Field (value)
+ Long value = /*TODO: migrate me*/ /*TODO: migrate me*/ readBuffer.readUnsignedLong("", 32);
+
+ return new PlcDWORD(value);
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.LWORD)) { // LWORD
+
+ // Simple Field (value)
+ BigInteger value = /*TODO: migrate me*/ /*TODO: migrate me*/
+ readBuffer.readUnsignedBigInteger("", 64);
+
+ return new PlcLWORD(value);
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.SINT)
+ && EvaluationHelper.equals(numberOfValues, 1)) { // SINT
+
+ // Simple Field (value)
+ Byte value = /*TODO: migrate me*/ /*TODO: migrate me*/ readBuffer.readSignedByte("", 8);
+
+ return new PlcSINT(value);
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.SINT)) { // List
+ // Array field (value)
+ // Count array
+ if (numberOfValues > Integer.MAX_VALUE) {
+ throw new ParseException(
+ "Array count of "
+ + (numberOfValues)
+ + " exceeds the maximum allowed count of "
+ + Integer.MAX_VALUE);
+ }
+ List value;
+ {
+ int itemCount = (int) numberOfValues;
+ value = new LinkedList<>();
+ for (int curItem = 0; curItem < itemCount; curItem++) {
+ value.add(
+ new PlcSINT(
+ (Byte) /*TODO: migrate me*/ /*TODO: migrate me*/
+ readBuffer.readSignedByte("", 8)));
+ }
+ }
+
+ return new PlcList(value);
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.INT)
+ && EvaluationHelper.equals(numberOfValues, 1)) { // INT
+
+ // Simple Field (value)
+ Short value = /*TODO: migrate me*/ /*TODO: migrate me*/ readBuffer.readShort("", 16);
+
+ return new PlcINT(value);
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.INT)) { // List
+ // Array field (value)
+ // Count array
+ if (numberOfValues > Integer.MAX_VALUE) {
+ throw new ParseException(
+ "Array count of "
+ + (numberOfValues)
+ + " exceeds the maximum allowed count of "
+ + Integer.MAX_VALUE);
+ }
+ List value;
+ {
+ int itemCount = (int) numberOfValues;
+ value = new LinkedList<>();
+ for (int curItem = 0; curItem < itemCount; curItem++) {
+ value.add(
+ new PlcINT(
+ (Short) /*TODO: migrate me*/ /*TODO: migrate me*/ readBuffer.readShort("", 16)));
+ }
+ }
+
+ return new PlcList(value);
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.DINT)
+ && EvaluationHelper.equals(numberOfValues, 1)) { // DINT
+
+ // Simple Field (value)
+ Integer value = /*TODO: migrate me*/ /*TODO: migrate me*/ readBuffer.readInt("", 32);
+
+ return new PlcDINT(value);
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.DINT)) { // List
+ // Array field (value)
+ // Count array
+ if (numberOfValues > Integer.MAX_VALUE) {
+ throw new ParseException(
+ "Array count of "
+ + (numberOfValues)
+ + " exceeds the maximum allowed count of "
+ + Integer.MAX_VALUE);
+ }
+ List value;
+ {
+ int itemCount = (int) numberOfValues;
+ value = new LinkedList<>();
+ for (int curItem = 0; curItem < itemCount; curItem++) {
+ value.add(
+ new PlcDINT(
+ (Integer) /*TODO: migrate me*/ /*TODO: migrate me*/ readBuffer.readInt("", 32)));
+ }
+ }
+
+ return new PlcList(value);
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.LINT)
+ && EvaluationHelper.equals(numberOfValues, 1)) { // LINT
+
+ // Simple Field (value)
+ Long value = /*TODO: migrate me*/ /*TODO: migrate me*/ readBuffer.readLong("", 64);
+
+ return new PlcLINT(value);
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.LINT)) { // List
+ // Array field (value)
+ // Count array
+ if (numberOfValues > Integer.MAX_VALUE) {
+ throw new ParseException(
+ "Array count of "
+ + (numberOfValues)
+ + " exceeds the maximum allowed count of "
+ + Integer.MAX_VALUE);
+ }
+ List value;
+ {
+ int itemCount = (int) numberOfValues;
+ value = new LinkedList<>();
+ for (int curItem = 0; curItem < itemCount; curItem++) {
+ value.add(
+ new PlcLINT(
+ (Long) /*TODO: migrate me*/ /*TODO: migrate me*/ readBuffer.readLong("", 64)));
+ }
+ }
+
+ return new PlcList(value);
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.USINT)
+ && EvaluationHelper.equals(numberOfValues, 1)) { // USINT
+
+ // Simple Field (value)
+ Short value = /*TODO: migrate me*/ /*TODO: migrate me*/ readBuffer.readUnsignedShort("", 8);
+
+ return new PlcUSINT(value);
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.USINT)) { // List
+ // Array field (value)
+ // Count array
+ if (numberOfValues > Integer.MAX_VALUE) {
+ throw new ParseException(
+ "Array count of "
+ + (numberOfValues)
+ + " exceeds the maximum allowed count of "
+ + Integer.MAX_VALUE);
+ }
+ List value;
+ {
+ int itemCount = (int) numberOfValues;
+ value = new LinkedList<>();
+ for (int curItem = 0; curItem < itemCount; curItem++) {
+ value.add(
+ new PlcUINT(
+ (Short) /*TODO: migrate me*/ /*TODO: migrate me*/
+ readBuffer.readUnsignedShort("", 8)));
+ }
+ }
+
+ return new PlcList(value);
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.UINT)
+ && EvaluationHelper.equals(numberOfValues, 1)) { // UINT
+
+ // Simple Field (value)
+ Integer value = /*TODO: migrate me*/ /*TODO: migrate me*/ readBuffer.readUnsignedInt("", 16);
+
+ return new PlcUINT(value);
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.UINT)) { // List
+ // Array field (value)
+ // Count array
+ if (numberOfValues > Integer.MAX_VALUE) {
+ throw new ParseException(
+ "Array count of "
+ + (numberOfValues)
+ + " exceeds the maximum allowed count of "
+ + Integer.MAX_VALUE);
+ }
+ List value;
+ {
+ int itemCount = (int) numberOfValues;
+ value = new LinkedList<>();
+ for (int curItem = 0; curItem < itemCount; curItem++) {
+ value.add(
+ new PlcUDINT(
+ (Integer) /*TODO: migrate me*/ /*TODO: migrate me*/
+ readBuffer.readUnsignedInt("", 16)));
+ }
+ }
+
+ return new PlcList(value);
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.UDINT)
+ && EvaluationHelper.equals(numberOfValues, 1)) { // UDINT
+
+ // Simple Field (value)
+ Long value = /*TODO: migrate me*/ /*TODO: migrate me*/ readBuffer.readUnsignedLong("", 32);
+
+ return new PlcUDINT(value);
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.UDINT)) { // List
+ // Array field (value)
+ // Count array
+ if (numberOfValues > Integer.MAX_VALUE) {
+ throw new ParseException(
+ "Array count of "
+ + (numberOfValues)
+ + " exceeds the maximum allowed count of "
+ + Integer.MAX_VALUE);
+ }
+ List value;
+ {
+ int itemCount = (int) numberOfValues;
+ value = new LinkedList<>();
+ for (int curItem = 0; curItem < itemCount; curItem++) {
+ value.add(
+ new PlcULINT(
+ (Long) /*TODO: migrate me*/ /*TODO: migrate me*/
+ readBuffer.readUnsignedLong("", 32)));
+ }
+ }
+
+ return new PlcList(value);
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.ULINT)
+ && EvaluationHelper.equals(numberOfValues, 1)) { // ULINT
+
+ // Simple Field (value)
+ BigInteger value = /*TODO: migrate me*/ /*TODO: migrate me*/
+ readBuffer.readUnsignedBigInteger("", 64);
+
+ return new PlcULINT(value);
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.ULINT)) { // List
+ // Array field (value)
+ // Count array
+ if (numberOfValues > Integer.MAX_VALUE) {
+ throw new ParseException(
+ "Array count of "
+ + (numberOfValues)
+ + " exceeds the maximum allowed count of "
+ + Integer.MAX_VALUE);
+ }
+ List value;
+ {
+ int itemCount = (int) numberOfValues;
+ value = new LinkedList<>();
+ for (int curItem = 0; curItem < itemCount; curItem++) {
+ value.add(
+ new PlcLINT(
+ (BigInteger) /*TODO: migrate me*/ /*TODO: migrate me*/
+ readBuffer.readUnsignedBigInteger("", 64)));
+ }
+ }
+
+ return new PlcList(value);
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.REAL)
+ && EvaluationHelper.equals(numberOfValues, 1)) { // REAL
+
+ // Simple Field (value)
+ Float value = /*TODO: migrate me*/ /*TODO: migrate me*/ readBuffer.readFloat("", 32);
+
+ return new PlcREAL(value);
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.REAL)) { // List
+ // Array field (value)
+ // Count array
+ if (numberOfValues > Integer.MAX_VALUE) {
+ throw new ParseException(
+ "Array count of "
+ + (numberOfValues)
+ + " exceeds the maximum allowed count of "
+ + Integer.MAX_VALUE);
+ }
+ List value;
+ {
+ int itemCount = (int) numberOfValues;
+ value = new LinkedList<>();
+ for (int curItem = 0; curItem < itemCount; curItem++) {
+ value.add(
+ new PlcREAL(
+ (Float) /*TODO: migrate me*/ /*TODO: migrate me*/ readBuffer.readFloat("", 32)));
+ }
+ }
+
+ return new PlcList(value);
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.LREAL)
+ && EvaluationHelper.equals(numberOfValues, 1)) { // LREAL
+
+ // Simple Field (value)
+ Double value = /*TODO: migrate me*/ /*TODO: migrate me*/ readBuffer.readDouble("", 64);
+
+ return new PlcLREAL(value);
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.LREAL)) { // List
+ // Array field (value)
+ // Count array
+ if (numberOfValues > Integer.MAX_VALUE) {
+ throw new ParseException(
+ "Array count of "
+ + (numberOfValues)
+ + " exceeds the maximum allowed count of "
+ + Integer.MAX_VALUE);
+ }
+ List value;
+ {
+ int itemCount = (int) numberOfValues;
+ value = new LinkedList<>();
+ for (int curItem = 0; curItem < itemCount; curItem++) {
+ value.add(
+ new PlcLREAL(
+ (Double) /*TODO: migrate me*/ /*TODO: migrate me*/
+ readBuffer.readDouble("", 64)));
+ }
+ }
+
+ return new PlcList(value);
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.CHAR)
+ && EvaluationHelper.equals(numberOfValues, 1)) { // CHAR
+
+ // Simple Field (value)
+ String value = /*TODO: migrate me*/ /*TODO: migrate me*/
+ readBuffer.readString("", 8, WithOption.WithEncoding("UTF-8"));
+
+ return new PlcCHAR(value);
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.CHAR)) { // List
+ // Array field (value)
+ // Count array
+ if (numberOfValues > Integer.MAX_VALUE) {
+ throw new ParseException(
+ "Array count of "
+ + (numberOfValues)
+ + " exceeds the maximum allowed count of "
+ + Integer.MAX_VALUE);
+ }
+ List value;
+ {
+ int itemCount = (int) numberOfValues;
+ value = new LinkedList<>();
+ for (int curItem = 0; curItem < itemCount; curItem++) {
+ value.add(
+ new PlcSTRING(
+ (String) /*TODO: migrate me*/ /*TODO: migrate me*/
+ readBuffer.readString("", 8, WithOption.WithEncoding("UTF-8"))));
+ }
+ }
+
+ return new PlcList(value);
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.WCHAR)
+ && EvaluationHelper.equals(numberOfValues, 1)) { // WCHAR
+
+ // Simple Field (value)
+ String value = /*TODO: migrate me*/ /*TODO: migrate me*/
+ readBuffer.readString("", 16, WithOption.WithEncoding("UTF-16"));
+
+ return new PlcWCHAR(value);
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.WCHAR)) { // List
+ // Array field (value)
+ // Count array
+ if (numberOfValues > Integer.MAX_VALUE) {
+ throw new ParseException(
+ "Array count of "
+ + (numberOfValues)
+ + " exceeds the maximum allowed count of "
+ + Integer.MAX_VALUE);
+ }
+ List value;
+ {
+ int itemCount = (int) numberOfValues;
+ value = new LinkedList<>();
+ for (int curItem = 0; curItem < itemCount; curItem++) {
+ value.add(
+ new PlcSTRING(
+ (String) /*TODO: migrate me*/ /*TODO: migrate me*/
+ readBuffer.readString("", 16, WithOption.WithEncoding("UTF-16"))));
+ }
+ }
+
+ return new PlcList(value);
+ }
+ return null;
+ }
+
+ public static void staticSerialize(
+ WriteBuffer writeBuffer, PlcValue _value, ProfinetDataType dataType, Integer numberOfValues)
+ throws SerializationException {
+ staticSerialize(writeBuffer, _value, dataType, numberOfValues, ByteOrder.BIG_ENDIAN);
+ }
+
+ public static void staticSerialize(
+ WriteBuffer writeBuffer,
+ PlcValue _value,
+ ProfinetDataType dataType,
+ Integer numberOfValues,
+ ByteOrder byteOrder)
+ throws SerializationException {
+ if (EvaluationHelper.equals(dataType, ProfinetDataType.BOOL)
+ && EvaluationHelper.equals(numberOfValues, 1)) { // BOOL
+ // Simple Field (value)
+ boolean value = (boolean) _value.getBoolean();
+ /*TODO: migrate me*/
+ /*TODO: migrate me*/ writeBuffer.writeBit("", (boolean) (value));
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.BOOL)) { // List
+ PlcList values = (PlcList) _value;
+
+ for (PlcValue val : ((List) values.getList())) {
+ Boolean value = (Boolean) val.getBoolean();
+ /*TODO: migrate me*/
+ /*TODO: migrate me*/ writeBuffer.writeBit("", (boolean) (value));
+ }
+
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.BYTE)
+ && EvaluationHelper.equals(numberOfValues, 1)) { // BYTE
+ // Simple Field (value)
+ short value = (short) _value.getShort();
+ /*TODO: migrate me*/
+ /*TODO: migrate me*/ writeBuffer.writeUnsignedShort("", 8, ((Number) (value)).shortValue());
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.BYTE)) { // List
+ PlcList values = (PlcList) _value;
+
+ for (PlcValue val : ((List) values.getList())) {
+ Boolean value = (Boolean) val.getBoolean();
+ /*TODO: migrate me*/
+ /*TODO: migrate me*/ writeBuffer.writeBit("", (boolean) (value));
+ }
+
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.WORD)) { // WORD
+ // Simple Field (value)
+ int value = (int) _value.getInt();
+ /*TODO: migrate me*/
+ /*TODO: migrate me*/ writeBuffer.writeUnsignedInt("", 16, ((Number) (value)).intValue());
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.DWORD)) { // DWORD
+ // Simple Field (value)
+ long value = (long) _value.getLong();
+ /*TODO: migrate me*/
+ /*TODO: migrate me*/ writeBuffer.writeUnsignedLong("", 32, ((Number) (value)).longValue());
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.LWORD)) { // LWORD
+ // Simple Field (value)
+ BigInteger value = (BigInteger) _value.getBigInteger();
+ /*TODO: migrate me*/
+ /*TODO: migrate me*/ writeBuffer.writeUnsignedBigInteger("", 64, (BigInteger) (value));
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.SINT)
+ && EvaluationHelper.equals(numberOfValues, 1)) { // SINT
+ // Simple Field (value)
+ byte value = (byte) _value.getByte();
+ /*TODO: migrate me*/
+ /*TODO: migrate me*/ writeBuffer.writeSignedByte("", 8, ((Number) (value)).byteValue());
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.SINT)) { // List
+ PlcList values = (PlcList) _value;
+
+ for (PlcValue val : ((List) values.getList())) {
+ Byte value = (Byte) val.getByte();
+ /*TODO: migrate me*/
+ /*TODO: migrate me*/ writeBuffer.writeSignedByte("", 8, ((Number) (value)).byteValue());
+ }
+
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.INT)
+ && EvaluationHelper.equals(numberOfValues, 1)) { // INT
+ // Simple Field (value)
+ short value = (short) _value.getShort();
+ /*TODO: migrate me*/
+ /*TODO: migrate me*/ writeBuffer.writeShort("", 16, ((Number) (value)).shortValue());
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.INT)) { // List
+ PlcList values = (PlcList) _value;
+
+ for (PlcValue val : ((List) values.getList())) {
+ Short value = (Short) val.getShort();
+ /*TODO: migrate me*/
+ /*TODO: migrate me*/ writeBuffer.writeShort("", 16, ((Number) (value)).shortValue());
+ }
+
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.DINT)
+ && EvaluationHelper.equals(numberOfValues, 1)) { // DINT
+ // Simple Field (value)
+ int value = (int) _value.getInt();
+ /*TODO: migrate me*/
+ /*TODO: migrate me*/ writeBuffer.writeInt("", 32, ((Number) (value)).intValue());
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.DINT)) { // List
+ PlcList values = (PlcList) _value;
+
+ for (PlcValue val : ((List) values.getList())) {
+ Integer value = (Integer) val.getInteger();
+ /*TODO: migrate me*/
+ /*TODO: migrate me*/ writeBuffer.writeInt("", 32, ((Number) (value)).intValue());
+ }
+
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.LINT)
+ && EvaluationHelper.equals(numberOfValues, 1)) { // LINT
+ // Simple Field (value)
+ long value = (long) _value.getLong();
+ /*TODO: migrate me*/
+ /*TODO: migrate me*/ writeBuffer.writeLong("", 64, ((Number) (value)).longValue());
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.LINT)) { // List
+ PlcList values = (PlcList) _value;
+
+ for (PlcValue val : ((List) values.getList())) {
+ Long value = (Long) val.getLong();
+ /*TODO: migrate me*/
+ /*TODO: migrate me*/ writeBuffer.writeLong("", 64, ((Number) (value)).longValue());
+ }
+
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.USINT)
+ && EvaluationHelper.equals(numberOfValues, 1)) { // USINT
+ // Simple Field (value)
+ short value = (short) _value.getShort();
+ /*TODO: migrate me*/
+ /*TODO: migrate me*/ writeBuffer.writeUnsignedShort("", 8, ((Number) (value)).shortValue());
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.USINT)) { // List
+ PlcList values = (PlcList) _value;
+
+ for (PlcValue val : ((List) values.getList())) {
+ Short value = (Short) val.getShort();
+ /*TODO: migrate me*/
+ /*TODO: migrate me*/ writeBuffer.writeUnsignedShort("", 8, ((Number) (value)).shortValue());
+ }
+
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.UINT)
+ && EvaluationHelper.equals(numberOfValues, 1)) { // UINT
+ // Simple Field (value)
+ int value = (int) _value.getInt();
+ /*TODO: migrate me*/
+ /*TODO: migrate me*/ writeBuffer.writeUnsignedInt("", 16, ((Number) (value)).intValue());
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.UINT)) { // List
+ PlcList values = (PlcList) _value;
+
+ for (PlcValue val : ((List) values.getList())) {
+ Integer value = (Integer) val.getInteger();
+ /*TODO: migrate me*/
+ /*TODO: migrate me*/ writeBuffer.writeUnsignedInt("", 16, ((Number) (value)).intValue());
+ }
+
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.UDINT)
+ && EvaluationHelper.equals(numberOfValues, 1)) { // UDINT
+ // Simple Field (value)
+ long value = (long) _value.getLong();
+ /*TODO: migrate me*/
+ /*TODO: migrate me*/ writeBuffer.writeUnsignedLong("", 32, ((Number) (value)).longValue());
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.UDINT)) { // List
+ PlcList values = (PlcList) _value;
+
+ for (PlcValue val : ((List) values.getList())) {
+ Long value = (Long) val.getLong();
+ /*TODO: migrate me*/
+ /*TODO: migrate me*/ writeBuffer.writeUnsignedLong("", 32, ((Number) (value)).longValue());
+ }
+
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.ULINT)
+ && EvaluationHelper.equals(numberOfValues, 1)) { // ULINT
+ // Simple Field (value)
+ BigInteger value = (BigInteger) _value.getBigInteger();
+ /*TODO: migrate me*/
+ /*TODO: migrate me*/ writeBuffer.writeUnsignedBigInteger("", 64, (BigInteger) (value));
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.ULINT)) { // List
+ PlcList values = (PlcList) _value;
+
+ for (PlcValue val : ((List) values.getList())) {
+ BigInteger value = (BigInteger) val.getBigInteger();
+ /*TODO: migrate me*/
+ /*TODO: migrate me*/ writeBuffer.writeUnsignedBigInteger("", 64, (BigInteger) (value));
+ }
+
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.REAL)
+ && EvaluationHelper.equals(numberOfValues, 1)) { // REAL
+ // Simple Field (value)
+ float value = (float) _value.getFloat();
+ /*TODO: migrate me*/
+ /*TODO: migrate me*/ writeBuffer.writeFloat("", 32, (value));
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.REAL)) { // List
+ PlcList values = (PlcList) _value;
+
+ for (PlcValue val : ((List) values.getList())) {
+ Float value = (Float) val.getFloat();
+ /*TODO: migrate me*/
+ /*TODO: migrate me*/ writeBuffer.writeFloat("", 32, (value));
+ }
+
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.LREAL)
+ && EvaluationHelper.equals(numberOfValues, 1)) { // LREAL
+ // Simple Field (value)
+ double value = (double) _value.getDouble();
+ /*TODO: migrate me*/
+ /*TODO: migrate me*/ writeBuffer.writeDouble("", 64, (value));
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.LREAL)) { // List
+ PlcList values = (PlcList) _value;
+
+ for (PlcValue val : ((List) values.getList())) {
+ Double value = (Double) val.getDouble();
+ /*TODO: migrate me*/
+ /*TODO: migrate me*/ writeBuffer.writeDouble("", 64, (value));
+ }
+
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.CHAR)
+ && EvaluationHelper.equals(numberOfValues, 1)) { // CHAR
+ // Simple Field (value)
+ String value = (String) _value.getString();
+ /*TODO: migrate me*/
+ /*TODO: migrate me*/ writeBuffer.writeString(
+ "", 8, (String) (value), WithOption.WithEncoding("UTF-8"));
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.CHAR)) { // List
+ PlcList values = (PlcList) _value;
+
+ for (PlcValue val : ((List) values.getList())) {
+ String value = (String) val.getString();
+ /*TODO: migrate me*/
+ /*TODO: migrate me*/ writeBuffer.writeString(
+ "", 8, (String) (value), WithOption.WithEncoding("UTF-8"));
+ }
+
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.WCHAR)
+ && EvaluationHelper.equals(numberOfValues, 1)) { // WCHAR
+ // Simple Field (value)
+ String value = (String) _value.getString();
+ /*TODO: migrate me*/
+ /*TODO: migrate me*/ writeBuffer.writeString(
+ "", 16, (String) (value), WithOption.WithEncoding("UTF-16"));
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.WCHAR)) { // List
+ PlcList values = (PlcList) _value;
+
+ for (PlcValue val : ((List) values.getList())) {
+ String value = (String) val.getString();
+ /*TODO: migrate me*/
+ /*TODO: migrate me*/ writeBuffer.writeString(
+ "", 16, (String) (value), WithOption.WithEncoding("UTF-16"));
+ }
+ }
+ }
+
+ public static int getLengthInBytes(
+ PlcValue _value, ProfinetDataType dataType, Integer numberOfValues) {
+ return (int) Math.ceil((float) getLengthInBits(_value, dataType, numberOfValues) / 8.0);
+ }
+
+ public static int getLengthInBits(
+ PlcValue _value, ProfinetDataType dataType, Integer numberOfValues) {
+ int sizeInBits = 0;
+ if (EvaluationHelper.equals(dataType, ProfinetDataType.BOOL)
+ && EvaluationHelper.equals(numberOfValues, 1)) { // BOOL
+ // Simple Field (value)
+ sizeInBits += 1;
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.BOOL)) { // List
+ PlcList values = (PlcList) _value;
+ sizeInBits += values.getList().size() * 1;
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.BYTE)
+ && EvaluationHelper.equals(numberOfValues, 1)) { // BYTE
+ // Simple Field (value)
+ sizeInBits += 8;
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.BYTE)) { // List
+ PlcList values = (PlcList) _value;
+ sizeInBits += values.getList().size() * 1;
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.WORD)) { // WORD
+ // Simple Field (value)
+ sizeInBits += 16;
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.DWORD)) { // DWORD
+ // Simple Field (value)
+ sizeInBits += 32;
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.LWORD)) { // LWORD
+ // Simple Field (value)
+ sizeInBits += 64;
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.SINT)
+ && EvaluationHelper.equals(numberOfValues, 1)) { // SINT
+ // Simple Field (value)
+ sizeInBits += 8;
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.SINT)) { // List
+ PlcList values = (PlcList) _value;
+ sizeInBits += values.getList().size() * 8;
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.INT)
+ && EvaluationHelper.equals(numberOfValues, 1)) { // INT
+ // Simple Field (value)
+ sizeInBits += 16;
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.INT)) { // List
+ PlcList values = (PlcList) _value;
+ sizeInBits += values.getList().size() * 16;
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.DINT)
+ && EvaluationHelper.equals(numberOfValues, 1)) { // DINT
+ // Simple Field (value)
+ sizeInBits += 32;
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.DINT)) { // List
+ PlcList values = (PlcList) _value;
+ sizeInBits += values.getList().size() * 32;
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.LINT)
+ && EvaluationHelper.equals(numberOfValues, 1)) { // LINT
+ // Simple Field (value)
+ sizeInBits += 64;
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.LINT)) { // List
+ PlcList values = (PlcList) _value;
+ sizeInBits += values.getList().size() * 64;
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.USINT)
+ && EvaluationHelper.equals(numberOfValues, 1)) { // USINT
+ // Simple Field (value)
+ sizeInBits += 8;
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.USINT)) { // List
+ PlcList values = (PlcList) _value;
+ sizeInBits += values.getList().size() * 8;
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.UINT)
+ && EvaluationHelper.equals(numberOfValues, 1)) { // UINT
+ // Simple Field (value)
+ sizeInBits += 16;
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.UINT)) { // List
+ PlcList values = (PlcList) _value;
+ sizeInBits += values.getList().size() * 16;
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.UDINT)
+ && EvaluationHelper.equals(numberOfValues, 1)) { // UDINT
+ // Simple Field (value)
+ sizeInBits += 32;
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.UDINT)) { // List
+ PlcList values = (PlcList) _value;
+ sizeInBits += values.getList().size() * 32;
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.ULINT)
+ && EvaluationHelper.equals(numberOfValues, 1)) { // ULINT
+ // Simple Field (value)
+ sizeInBits += 64;
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.ULINT)) { // List
+ PlcList values = (PlcList) _value;
+ sizeInBits += values.getList().size() * 64;
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.REAL)
+ && EvaluationHelper.equals(numberOfValues, 1)) { // REAL
+ // Simple Field (value)
+ sizeInBits += 32;
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.REAL)) { // List
+ PlcList values = (PlcList) _value;
+ sizeInBits += values.getList().size() * 32;
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.LREAL)
+ && EvaluationHelper.equals(numberOfValues, 1)) { // LREAL
+ // Simple Field (value)
+ sizeInBits += 64;
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.LREAL)) { // List
+ PlcList values = (PlcList) _value;
+ sizeInBits += values.getList().size() * 64;
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.CHAR)
+ && EvaluationHelper.equals(numberOfValues, 1)) { // CHAR
+ // Simple Field (value)
+ sizeInBits += 8;
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.CHAR)) { // List
+ PlcList values = (PlcList) _value;
+ sizeInBits += values.getList().size() * 8;
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.WCHAR)
+ && EvaluationHelper.equals(numberOfValues, 1)) { // WCHAR
+ // Simple Field (value)
+ sizeInBits += 16;
+ } else if (EvaluationHelper.equals(dataType, ProfinetDataType.WCHAR)) { // List
+ PlcList values = (PlcList) _value;
+ sizeInBits += values.getList().size() * 16;
+ }
+ return sizeInBits;
+ }
+}
diff --git a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/DceRpc_Packet.java b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/DceRpc_Packet.java
index 2b37cbd80c8..a7d8a43593f 100644
--- a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/DceRpc_Packet.java
+++ b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/DceRpc_Packet.java
@@ -67,6 +67,13 @@ public class DceRpc_Packet implements Message {
protected final DceRpc_Operation operation;
protected final PnIoCm_Packet payload;
+ // Reserved Fields
+ private Boolean reservedField0;
+ private Boolean reservedField1;
+ private Short reservedField2;
+ private Boolean reservedField3;
+ private Short reservedField4;
+
public DceRpc_Packet(
DceRpc_PacketType packetType,
boolean idempotent,
@@ -229,7 +236,7 @@ public void serialize(WriteBuffer writeBuffer) throws SerializationException {
// Reserved Field (reserved)
writeReservedField(
"reserved",
- (boolean) false,
+ reservedField0 != null ? reservedField0 : (boolean) false,
writeBoolean(writeBuffer),
WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
@@ -275,14 +282,14 @@ public void serialize(WriteBuffer writeBuffer) throws SerializationException {
// Reserved Field (reserved)
writeReservedField(
"reserved",
- (boolean) false,
+ reservedField1 != null ? reservedField1 : (boolean) false,
writeBoolean(writeBuffer),
WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Reserved Field (reserved)
writeReservedField(
"reserved",
- (short) 0x00,
+ reservedField2 != null ? reservedField2 : (short) 0x00,
writeUnsignedShort(writeBuffer, 6),
WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
@@ -296,7 +303,7 @@ public void serialize(WriteBuffer writeBuffer) throws SerializationException {
// Reserved Field (reserved)
writeReservedField(
"reserved",
- (boolean) false,
+ reservedField3 != null ? reservedField3 : (boolean) false,
writeBoolean(writeBuffer),
WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
@@ -334,7 +341,7 @@ public void serialize(WriteBuffer writeBuffer) throws SerializationException {
// Reserved Field (reserved)
writeReservedField(
"reserved",
- (short) 0x00,
+ reservedField4 != null ? reservedField4 : (short) 0x00,
writeUnsignedShort(writeBuffer, 8),
WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
@@ -890,6 +897,11 @@ public static DceRpc_Packet staticParse(ReadBuffer readBuffer) throws ParseExcep
sequenceNumber,
operation,
payload);
+ _dceRpc_Packet.reservedField0 = reservedField0;
+ _dceRpc_Packet.reservedField1 = reservedField1;
+ _dceRpc_Packet.reservedField2 = reservedField2;
+ _dceRpc_Packet.reservedField3 = reservedField3;
+ _dceRpc_Packet.reservedField4 = reservedField4;
return _dceRpc_Packet;
}
diff --git a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/EndOfLldp.java b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/EndOfLldp.java
new file mode 100644
index 00000000000..29477055270
--- /dev/null
+++ b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/EndOfLldp.java
@@ -0,0 +1,120 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.plc4x.java.profinet.readwrite;
+
+import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*;
+import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*;
+import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*;
+import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*;
+import static org.apache.plc4x.java.spi.generation.StaticHelper.*;
+
+import java.time.*;
+import java.util.*;
+import org.apache.plc4x.java.api.exceptions.*;
+import org.apache.plc4x.java.api.value.*;
+import org.apache.plc4x.java.spi.codegen.*;
+import org.apache.plc4x.java.spi.codegen.fields.*;
+import org.apache.plc4x.java.spi.codegen.io.*;
+import org.apache.plc4x.java.spi.generation.*;
+
+// Code generated by code-generation. DO NOT EDIT.
+
+public class EndOfLldp extends LldpUnit implements Message {
+
+ // Accessors for discriminator values.
+ public TlvType getTlvId() {
+ return TlvType.END_OF_LLDP;
+ }
+
+ public EndOfLldp(int tlvIdLength) {
+ super(tlvIdLength);
+ }
+
+ @Override
+ protected void serializeLldpUnitChild(WriteBuffer writeBuffer) throws SerializationException {
+ PositionAware positionAware = writeBuffer;
+ int startPos = positionAware.getPos();
+ writeBuffer.pushContext("EndOfLldp");
+
+ writeBuffer.popContext("EndOfLldp");
+ }
+
+ @Override
+ public int getLengthInBytes() {
+ return (int) Math.ceil((float) getLengthInBits() / 8.0);
+ }
+
+ @Override
+ public int getLengthInBits() {
+ int lengthInBits = super.getLengthInBits();
+ EndOfLldp _value = this;
+
+ return lengthInBits;
+ }
+
+ public static LldpUnitBuilder staticParseLldpUnitBuilder(ReadBuffer readBuffer)
+ throws ParseException {
+ readBuffer.pullContext("EndOfLldp");
+ PositionAware positionAware = readBuffer;
+ int startPos = positionAware.getPos();
+ int curPos;
+
+ readBuffer.closeContext("EndOfLldp");
+ // Create the instance
+ return new EndOfLldpBuilderImpl();
+ }
+
+ public static class EndOfLldpBuilderImpl implements LldpUnit.LldpUnitBuilder {
+
+ public EndOfLldpBuilderImpl() {}
+
+ public EndOfLldp build(int tlvIdLength) {
+ EndOfLldp endOfLldp = new EndOfLldp(tlvIdLength);
+ return endOfLldp;
+ }
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (!(o instanceof EndOfLldp)) {
+ return false;
+ }
+ EndOfLldp that = (EndOfLldp) o;
+ return super.equals(that) && true;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(super.hashCode());
+ }
+
+ @Override
+ public String toString() {
+ WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true);
+ try {
+ writeBufferBoxBased.writeSerializable(this);
+ } catch (SerializationException e) {
+ throw new RuntimeException(e);
+ }
+ return "\n" + writeBufferBoxBased.getBox().toString() + "\n";
+ }
+}
diff --git a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/Ethernet_FramePayload.java b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/Ethernet_FramePayload.java
index 7200763f484..5f18c0a45c6 100644
--- a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/Ethernet_FramePayload.java
+++ b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/Ethernet_FramePayload.java
@@ -102,6 +102,8 @@ public static Ethernet_FramePayload staticParse(ReadBuffer readBuffer) throws Pa
Ethernet_FramePayload_VirtualLan.staticParseEthernet_FramePayloadBuilder(readBuffer);
} else if (EvaluationHelper.equals(packetType, (int) 0x8892)) {
builder = Ethernet_FramePayload_PnDcp.staticParseEthernet_FramePayloadBuilder(readBuffer);
+ } else if (EvaluationHelper.equals(packetType, (int) 0x88cc)) {
+ builder = Ethernet_FramePayload_LLDP.staticParseEthernet_FramePayloadBuilder(readBuffer);
}
if (builder == null) {
throw new ParseException(
diff --git a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/Ethernet_FramePayload_IPv4.java b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/Ethernet_FramePayload_IPv4.java
index 3d5412ccacd..a7dddbeb6c7 100644
--- a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/Ethernet_FramePayload_IPv4.java
+++ b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/Ethernet_FramePayload_IPv4.java
@@ -47,12 +47,13 @@ public Integer getPacketType() {
public static final Byte HEADERLENGTH = 0x5;
public static final Short DIFFERENTIATEDSERVICESCODEPOINT = 0x00;
public static final Byte EXPLICITCONGESTIONNOTIFICATION = 0x0;
- public static final Byte FLAGS = 0x00;
public static final Integer FRAGMENTOFFSET = 0x00;
public static final Short PROTOCOL = 0x11;
// Properties.
protected final int identification;
+ protected final boolean dontFragment;
+ protected final boolean moreFragments;
protected final short timeToLive;
protected final IpAddress sourceAddress;
protected final IpAddress destinationAddress;
@@ -60,8 +61,13 @@ public Integer getPacketType() {
protected final int destinationPort;
protected final DceRpc_Packet payload;
+ // Reserved Fields
+ private Boolean reservedField0;
+
public Ethernet_FramePayload_IPv4(
int identification,
+ boolean dontFragment,
+ boolean moreFragments,
short timeToLive,
IpAddress sourceAddress,
IpAddress destinationAddress,
@@ -70,6 +76,8 @@ public Ethernet_FramePayload_IPv4(
DceRpc_Packet payload) {
super();
this.identification = identification;
+ this.dontFragment = dontFragment;
+ this.moreFragments = moreFragments;
this.timeToLive = timeToLive;
this.sourceAddress = sourceAddress;
this.destinationAddress = destinationAddress;
@@ -82,6 +90,14 @@ public int getIdentification() {
return identification;
}
+ public boolean getDontFragment() {
+ return dontFragment;
+ }
+
+ public boolean getMoreFragments() {
+ return moreFragments;
+ }
+
public short getTimeToLive() {
return timeToLive;
}
@@ -122,10 +138,6 @@ public byte getExplicitCongestionNotification() {
return EXPLICITCONGESTIONNOTIFICATION;
}
- public byte getFlags() {
- return FLAGS;
- }
-
public int getFragmentOffset() {
return FRAGMENTOFFSET;
}
@@ -167,8 +179,17 @@ protected void serializeEthernet_FramePayloadChild(WriteBuffer writeBuffer)
// Simple Field (identification)
writeSimpleField("identification", identification, writeUnsignedInt(writeBuffer, 16));
- // Const Field (flags)
- writeConstField("flags", FLAGS, writeUnsignedByte(writeBuffer, 3));
+ // Reserved Field (reserved)
+ writeReservedField(
+ "reserved",
+ reservedField0 != null ? reservedField0 : (boolean) false,
+ writeBoolean(writeBuffer));
+
+ // Simple Field (dontFragment)
+ writeSimpleField("dontFragment", dontFragment, writeBoolean(writeBuffer));
+
+ // Simple Field (moreFragments)
+ writeSimpleField("moreFragments", moreFragments, writeBoolean(writeBuffer));
// Const Field (fragmentOffset)
writeConstField("fragmentOffset", FRAGMENTOFFSET, writeUnsignedInt(writeBuffer, 13));
@@ -206,9 +227,22 @@ protected void serializeEthernet_FramePayloadChild(WriteBuffer writeBuffer)
// Implicit Field (packetLength) (Used for parsing, but its value is not stored as it's
// implicitly given by the objects content)
- int packetLength = (int) (getLengthInBytes());
+ int packetLength = (int) ((8) + (getPayload().getLengthInBytes()));
writeImplicitField("packetLength", packetLength, writeUnsignedInt(writeBuffer, 16));
+ // Implicit Field (bodyChecksum) (Used for parsing, but its value is not stored as it's
+ // implicitly given by the objects content)
+ int bodyChecksum =
+ (int)
+ (org.apache.plc4x.java.profinet.readwrite.utils.StaticHelper.calculateUdpChecksum(
+ getSourceAddress(),
+ getDestinationAddress(),
+ getSourcePort(),
+ getDestinationPort(),
+ (8) + (getPayload().getLengthInBytes()),
+ getPayload()));
+ writeImplicitField("bodyChecksum", bodyChecksum, writeUnsignedInt(writeBuffer, 16));
+
// Simple Field (payload)
writeSimpleField("payload", payload, new DataWriterComplexDefault<>(writeBuffer));
@@ -243,8 +277,14 @@ public int getLengthInBits() {
// Simple field (identification)
lengthInBits += 16;
- // Const Field (flags)
- lengthInBits += 3;
+ // Reserved Field (reserved)
+ lengthInBits += 1;
+
+ // Simple field (dontFragment)
+ lengthInBits += 1;
+
+ // Simple field (moreFragments)
+ lengthInBits += 1;
// Const Field (fragmentOffset)
lengthInBits += 13;
@@ -273,6 +313,9 @@ public int getLengthInBits() {
// Implicit Field (packetLength)
lengthInBits += 16;
+ // Implicit Field (bodyChecksum)
+ lengthInBits += 16;
+
// Simple field (payload)
lengthInBits += payload.getLengthInBits();
@@ -312,8 +355,12 @@ public static Ethernet_FramePayloadBuilder staticParseEthernet_FramePayloadBuild
int identification = readSimpleField("identification", readUnsignedInt(readBuffer, 16));
- byte flags =
- readConstField("flags", readUnsignedByte(readBuffer, 3), Ethernet_FramePayload_IPv4.FLAGS);
+ Boolean reservedField0 =
+ readReservedField("reserved", readBoolean(readBuffer), (boolean) false);
+
+ boolean dontFragment = readSimpleField("dontFragment", readBoolean(readBuffer));
+
+ boolean moreFragments = readSimpleField("moreFragments", readBoolean(readBuffer));
int fragmentOffset =
readConstField(
@@ -345,6 +392,8 @@ public static Ethernet_FramePayloadBuilder staticParseEthernet_FramePayloadBuild
int packetLength = readImplicitField("packetLength", readUnsignedInt(readBuffer, 16));
+ int bodyChecksum = readImplicitField("bodyChecksum", readUnsignedInt(readBuffer, 16));
+
DceRpc_Packet payload =
readSimpleField(
"payload",
@@ -355,51 +404,66 @@ public static Ethernet_FramePayloadBuilder staticParseEthernet_FramePayloadBuild
// Create the instance
return new Ethernet_FramePayload_IPv4BuilderImpl(
identification,
+ dontFragment,
+ moreFragments,
timeToLive,
sourceAddress,
destinationAddress,
sourcePort,
destinationPort,
- payload);
+ payload,
+ reservedField0);
}
public static class Ethernet_FramePayload_IPv4BuilderImpl
implements Ethernet_FramePayload.Ethernet_FramePayloadBuilder {
private final int identification;
+ private final boolean dontFragment;
+ private final boolean moreFragments;
private final short timeToLive;
private final IpAddress sourceAddress;
private final IpAddress destinationAddress;
private final int sourcePort;
private final int destinationPort;
private final DceRpc_Packet payload;
+ private final Boolean reservedField0;
public Ethernet_FramePayload_IPv4BuilderImpl(
int identification,
+ boolean dontFragment,
+ boolean moreFragments,
short timeToLive,
IpAddress sourceAddress,
IpAddress destinationAddress,
int sourcePort,
int destinationPort,
- DceRpc_Packet payload) {
+ DceRpc_Packet payload,
+ Boolean reservedField0) {
this.identification = identification;
+ this.dontFragment = dontFragment;
+ this.moreFragments = moreFragments;
this.timeToLive = timeToLive;
this.sourceAddress = sourceAddress;
this.destinationAddress = destinationAddress;
this.sourcePort = sourcePort;
this.destinationPort = destinationPort;
this.payload = payload;
+ this.reservedField0 = reservedField0;
}
public Ethernet_FramePayload_IPv4 build() {
Ethernet_FramePayload_IPv4 ethernet_FramePayload_IPv4 =
new Ethernet_FramePayload_IPv4(
identification,
+ dontFragment,
+ moreFragments,
timeToLive,
sourceAddress,
destinationAddress,
sourcePort,
destinationPort,
payload);
+ ethernet_FramePayload_IPv4.reservedField0 = reservedField0;
return ethernet_FramePayload_IPv4;
}
}
@@ -414,6 +478,8 @@ public boolean equals(Object o) {
}
Ethernet_FramePayload_IPv4 that = (Ethernet_FramePayload_IPv4) o;
return (getIdentification() == that.getIdentification())
+ && (getDontFragment() == that.getDontFragment())
+ && (getMoreFragments() == that.getMoreFragments())
&& (getTimeToLive() == that.getTimeToLive())
&& (getSourceAddress() == that.getSourceAddress())
&& (getDestinationAddress() == that.getDestinationAddress())
@@ -429,6 +495,8 @@ public int hashCode() {
return Objects.hash(
super.hashCode(),
getIdentification(),
+ getDontFragment(),
+ getMoreFragments(),
getTimeToLive(),
getSourceAddress(),
getDestinationAddress(),
diff --git a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/Ethernet_FramePayload_LLDP.java b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/Ethernet_FramePayload_LLDP.java
new file mode 100644
index 00000000000..d51cdda0359
--- /dev/null
+++ b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/Ethernet_FramePayload_LLDP.java
@@ -0,0 +1,144 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.plc4x.java.profinet.readwrite;
+
+import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*;
+import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*;
+import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*;
+import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*;
+import static org.apache.plc4x.java.spi.generation.StaticHelper.*;
+
+import java.time.*;
+import java.util.*;
+import org.apache.plc4x.java.api.exceptions.*;
+import org.apache.plc4x.java.api.value.*;
+import org.apache.plc4x.java.spi.codegen.*;
+import org.apache.plc4x.java.spi.codegen.fields.*;
+import org.apache.plc4x.java.spi.codegen.io.*;
+import org.apache.plc4x.java.spi.generation.*;
+
+// Code generated by code-generation. DO NOT EDIT.
+
+public class Ethernet_FramePayload_LLDP extends Ethernet_FramePayload implements Message {
+
+ // Accessors for discriminator values.
+ public Integer getPacketType() {
+ return (int) 0x88cc;
+ }
+
+ // Properties.
+ protected final Lldp_Pdu pdu;
+
+ public Ethernet_FramePayload_LLDP(Lldp_Pdu pdu) {
+ super();
+ this.pdu = pdu;
+ }
+
+ public Lldp_Pdu getPdu() {
+ return pdu;
+ }
+
+ @Override
+ protected void serializeEthernet_FramePayloadChild(WriteBuffer writeBuffer)
+ throws SerializationException {
+ PositionAware positionAware = writeBuffer;
+ int startPos = positionAware.getPos();
+ writeBuffer.pushContext("Ethernet_FramePayload_LLDP");
+
+ // Simple Field (pdu)
+ writeSimpleField("pdu", pdu, new DataWriterComplexDefault<>(writeBuffer));
+
+ writeBuffer.popContext("Ethernet_FramePayload_LLDP");
+ }
+
+ @Override
+ public int getLengthInBytes() {
+ return (int) Math.ceil((float) getLengthInBits() / 8.0);
+ }
+
+ @Override
+ public int getLengthInBits() {
+ int lengthInBits = super.getLengthInBits();
+ Ethernet_FramePayload_LLDP _value = this;
+
+ // Simple field (pdu)
+ lengthInBits += pdu.getLengthInBits();
+
+ return lengthInBits;
+ }
+
+ public static Ethernet_FramePayloadBuilder staticParseEthernet_FramePayloadBuilder(
+ ReadBuffer readBuffer) throws ParseException {
+ readBuffer.pullContext("Ethernet_FramePayload_LLDP");
+ PositionAware positionAware = readBuffer;
+ int startPos = positionAware.getPos();
+ int curPos;
+
+ Lldp_Pdu pdu =
+ readSimpleField(
+ "pdu",
+ new DataReaderComplexDefault<>(() -> Lldp_Pdu.staticParse(readBuffer), readBuffer));
+
+ readBuffer.closeContext("Ethernet_FramePayload_LLDP");
+ // Create the instance
+ return new Ethernet_FramePayload_LLDPBuilderImpl(pdu);
+ }
+
+ public static class Ethernet_FramePayload_LLDPBuilderImpl
+ implements Ethernet_FramePayload.Ethernet_FramePayloadBuilder {
+ private final Lldp_Pdu pdu;
+
+ public Ethernet_FramePayload_LLDPBuilderImpl(Lldp_Pdu pdu) {
+ this.pdu = pdu;
+ }
+
+ public Ethernet_FramePayload_LLDP build() {
+ Ethernet_FramePayload_LLDP ethernet_FramePayload_LLDP = new Ethernet_FramePayload_LLDP(pdu);
+ return ethernet_FramePayload_LLDP;
+ }
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (!(o instanceof Ethernet_FramePayload_LLDP)) {
+ return false;
+ }
+ Ethernet_FramePayload_LLDP that = (Ethernet_FramePayload_LLDP) o;
+ return (getPdu() == that.getPdu()) && super.equals(that) && true;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(super.hashCode(), getPdu());
+ }
+
+ @Override
+ public String toString() {
+ WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true);
+ try {
+ writeBufferBoxBased.writeSerializable(this);
+ } catch (SerializationException e) {
+ throw new RuntimeException(e);
+ }
+ return "\n" + writeBufferBoxBased.getBox().toString() + "\n";
+ }
+}
diff --git a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/IODWriteRequestHeader.java b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/IODWriteRequestHeader.java
new file mode 100644
index 00000000000..f75b9ad230e
--- /dev/null
+++ b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/IODWriteRequestHeader.java
@@ -0,0 +1,506 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.plc4x.java.profinet.readwrite;
+
+import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*;
+import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*;
+import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*;
+import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*;
+import static org.apache.plc4x.java.spi.generation.StaticHelper.*;
+
+import java.time.*;
+import java.util.*;
+import org.apache.plc4x.java.api.exceptions.*;
+import org.apache.plc4x.java.api.value.*;
+import org.apache.plc4x.java.spi.codegen.*;
+import org.apache.plc4x.java.spi.codegen.fields.*;
+import org.apache.plc4x.java.spi.codegen.io.*;
+import org.apache.plc4x.java.spi.generation.*;
+
+// Code generated by code-generation. DO NOT EDIT.
+
+public class IODWriteRequestHeader extends PnIoCm_Block implements Message {
+
+ // Accessors for discriminator values.
+ public PnIoCm_BlockType getBlockType() {
+ return PnIoCm_BlockType.IOD_WRITE_REQUEST_HEADER;
+ }
+
+ // Constant values.
+ public static final Integer PADFIELD = 0x0000;
+
+ // Properties.
+ protected final short blockVersionHigh;
+ protected final short blockVersionLow;
+ protected final int sequenceNumber;
+ protected final Uuid arUuid;
+ protected final long api;
+ protected final int slotNumber;
+ protected final int subSlotNumber;
+ protected final int index;
+ protected final long recordDataLength;
+ protected final UserData userData;
+
+ public IODWriteRequestHeader(
+ short blockVersionHigh,
+ short blockVersionLow,
+ int sequenceNumber,
+ Uuid arUuid,
+ long api,
+ int slotNumber,
+ int subSlotNumber,
+ int index,
+ long recordDataLength,
+ UserData userData) {
+ super();
+ this.blockVersionHigh = blockVersionHigh;
+ this.blockVersionLow = blockVersionLow;
+ this.sequenceNumber = sequenceNumber;
+ this.arUuid = arUuid;
+ this.api = api;
+ this.slotNumber = slotNumber;
+ this.subSlotNumber = subSlotNumber;
+ this.index = index;
+ this.recordDataLength = recordDataLength;
+ this.userData = userData;
+ }
+
+ public short getBlockVersionHigh() {
+ return blockVersionHigh;
+ }
+
+ public short getBlockVersionLow() {
+ return blockVersionLow;
+ }
+
+ public int getSequenceNumber() {
+ return sequenceNumber;
+ }
+
+ public Uuid getArUuid() {
+ return arUuid;
+ }
+
+ public long getApi() {
+ return api;
+ }
+
+ public int getSlotNumber() {
+ return slotNumber;
+ }
+
+ public int getSubSlotNumber() {
+ return subSlotNumber;
+ }
+
+ public int getIndex() {
+ return index;
+ }
+
+ public long getRecordDataLength() {
+ return recordDataLength;
+ }
+
+ public UserData getUserData() {
+ return userData;
+ }
+
+ public int getPadField() {
+ return PADFIELD;
+ }
+
+ @Override
+ protected void serializePnIoCm_BlockChild(WriteBuffer writeBuffer) throws SerializationException {
+ PositionAware positionAware = writeBuffer;
+ int startPos = positionAware.getPos();
+ writeBuffer.pushContext("IODWriteRequestHeader");
+
+ // Implicit Field (blockLength) (Used for parsing, but its value is not stored as it's
+ // implicitly given by the objects content)
+ int blockLength =
+ (int)
+ ((((getIndex()) < (0x8000))
+ ? ((getLengthInBytes()) - (4)) - (getRecordDataLength())
+ : (getLengthInBytes()) - (4)));
+ writeImplicitField(
+ "blockLength",
+ blockLength,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Simple Field (blockVersionHigh)
+ writeSimpleField(
+ "blockVersionHigh",
+ blockVersionHigh,
+ writeUnsignedShort(writeBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Simple Field (blockVersionLow)
+ writeSimpleField(
+ "blockVersionLow",
+ blockVersionLow,
+ writeUnsignedShort(writeBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Simple Field (sequenceNumber)
+ writeSimpleField(
+ "sequenceNumber",
+ sequenceNumber,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Simple Field (arUuid)
+ writeSimpleField(
+ "arUuid",
+ arUuid,
+ new DataWriterComplexDefault<>(writeBuffer),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Simple Field (api)
+ writeSimpleField(
+ "api",
+ api,
+ writeUnsignedLong(writeBuffer, 32),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Simple Field (slotNumber)
+ writeSimpleField(
+ "slotNumber",
+ slotNumber,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Simple Field (subSlotNumber)
+ writeSimpleField(
+ "subSlotNumber",
+ subSlotNumber,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Const Field (padField)
+ writeConstField(
+ "padField",
+ PADFIELD,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Simple Field (index)
+ writeSimpleField(
+ "index",
+ index,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Simple Field (recordDataLength)
+ writeSimpleField(
+ "recordDataLength",
+ recordDataLength,
+ writeUnsignedLong(writeBuffer, 32),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Padding Field (padding)
+ writePaddingField(
+ "padding",
+ (int)
+ ((((index) < (0x8000))
+ ? (((((((((64) - (6)) - (2)) - (16)) - (4)) - (2)) - (2)) - (2)) - (2)) - (4)
+ : (((((((((64) - (6)) - (2)) - (16)) - (4)) - (2)) - (2)) - (2)) - (2)) - (4))),
+ (short) 0x00,
+ writeUnsignedShort(writeBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Optional Field (userData) (Can be skipped, if the value is null)
+ writeOptionalField(
+ "userData",
+ userData,
+ new DataWriterComplexDefault<>(writeBuffer),
+ (getIndex()) < (0x8000),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ writeBuffer.popContext("IODWriteRequestHeader");
+ }
+
+ @Override
+ public int getLengthInBytes() {
+ return (int) Math.ceil((float) getLengthInBits() / 8.0);
+ }
+
+ @Override
+ public int getLengthInBits() {
+ int lengthInBits = super.getLengthInBits();
+ IODWriteRequestHeader _value = this;
+
+ // Implicit Field (blockLength)
+ lengthInBits += 16;
+
+ // Simple field (blockVersionHigh)
+ lengthInBits += 8;
+
+ // Simple field (blockVersionLow)
+ lengthInBits += 8;
+
+ // Simple field (sequenceNumber)
+ lengthInBits += 16;
+
+ // Simple field (arUuid)
+ lengthInBits += arUuid.getLengthInBits();
+
+ // Simple field (api)
+ lengthInBits += 32;
+
+ // Simple field (slotNumber)
+ lengthInBits += 16;
+
+ // Simple field (subSlotNumber)
+ lengthInBits += 16;
+
+ // Const Field (padField)
+ lengthInBits += 16;
+
+ // Simple field (index)
+ lengthInBits += 16;
+
+ // Simple field (recordDataLength)
+ lengthInBits += 32;
+
+ // Padding Field (padding)
+ int _timesPadding =
+ (int)
+ ((((index) < (0x8000))
+ ? (((((((((64) - (6)) - (2)) - (16)) - (4)) - (2)) - (2)) - (2)) - (2)) - (4)
+ : (((((((((64) - (6)) - (2)) - (16)) - (4)) - (2)) - (2)) - (2)) - (2)) - (4)));
+ while (_timesPadding-- > 0) {
+ lengthInBits += 8;
+ }
+
+ // Optional Field (userData)
+ if (userData != null) {
+ lengthInBits += userData.getLengthInBits();
+ }
+
+ return lengthInBits;
+ }
+
+ public static PnIoCm_BlockBuilder staticParsePnIoCm_BlockBuilder(ReadBuffer readBuffer)
+ throws ParseException {
+ readBuffer.pullContext("IODWriteRequestHeader");
+ PositionAware positionAware = readBuffer;
+ int startPos = positionAware.getPos();
+ int curPos;
+
+ int blockLength =
+ readImplicitField(
+ "blockLength",
+ readUnsignedInt(readBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ short blockVersionHigh =
+ readSimpleField(
+ "blockVersionHigh",
+ readUnsignedShort(readBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ short blockVersionLow =
+ readSimpleField(
+ "blockVersionLow",
+ readUnsignedShort(readBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ int sequenceNumber =
+ readSimpleField(
+ "sequenceNumber",
+ readUnsignedInt(readBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ Uuid arUuid =
+ readSimpleField(
+ "arUuid",
+ new DataReaderComplexDefault<>(() -> Uuid.staticParse(readBuffer), readBuffer),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ long api =
+ readSimpleField(
+ "api",
+ readUnsignedLong(readBuffer, 32),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ int slotNumber =
+ readSimpleField(
+ "slotNumber",
+ readUnsignedInt(readBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ int subSlotNumber =
+ readSimpleField(
+ "subSlotNumber",
+ readUnsignedInt(readBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ int padField =
+ readConstField(
+ "padField",
+ readUnsignedInt(readBuffer, 16),
+ IODWriteRequestHeader.PADFIELD,
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ int index =
+ readSimpleField(
+ "index",
+ readUnsignedInt(readBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ long recordDataLength =
+ readSimpleField(
+ "recordDataLength",
+ readUnsignedLong(readBuffer, 32),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ readPaddingField(
+ readUnsignedShort(readBuffer, 8),
+ (int)
+ ((((index) < (0x8000))
+ ? (((((((((64) - (6)) - (2)) - (16)) - (4)) - (2)) - (2)) - (2)) - (2)) - (4)
+ : (((((((((64) - (6)) - (2)) - (16)) - (4)) - (2)) - (2)) - (2)) - (2)) - (4))),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ UserData userData =
+ readOptionalField(
+ "userData",
+ new DataReaderComplexDefault<>(
+ () -> UserData.staticParse(readBuffer, (long) (recordDataLength)), readBuffer),
+ (index) < (0x8000),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ readBuffer.closeContext("IODWriteRequestHeader");
+ // Create the instance
+ return new IODWriteRequestHeaderBuilderImpl(
+ blockVersionHigh,
+ blockVersionLow,
+ sequenceNumber,
+ arUuid,
+ api,
+ slotNumber,
+ subSlotNumber,
+ index,
+ recordDataLength,
+ userData);
+ }
+
+ public static class IODWriteRequestHeaderBuilderImpl implements PnIoCm_Block.PnIoCm_BlockBuilder {
+ private final short blockVersionHigh;
+ private final short blockVersionLow;
+ private final int sequenceNumber;
+ private final Uuid arUuid;
+ private final long api;
+ private final int slotNumber;
+ private final int subSlotNumber;
+ private final int index;
+ private final long recordDataLength;
+ private final UserData userData;
+
+ public IODWriteRequestHeaderBuilderImpl(
+ short blockVersionHigh,
+ short blockVersionLow,
+ int sequenceNumber,
+ Uuid arUuid,
+ long api,
+ int slotNumber,
+ int subSlotNumber,
+ int index,
+ long recordDataLength,
+ UserData userData) {
+ this.blockVersionHigh = blockVersionHigh;
+ this.blockVersionLow = blockVersionLow;
+ this.sequenceNumber = sequenceNumber;
+ this.arUuid = arUuid;
+ this.api = api;
+ this.slotNumber = slotNumber;
+ this.subSlotNumber = subSlotNumber;
+ this.index = index;
+ this.recordDataLength = recordDataLength;
+ this.userData = userData;
+ }
+
+ public IODWriteRequestHeader build() {
+ IODWriteRequestHeader iODWriteRequestHeader =
+ new IODWriteRequestHeader(
+ blockVersionHigh,
+ blockVersionLow,
+ sequenceNumber,
+ arUuid,
+ api,
+ slotNumber,
+ subSlotNumber,
+ index,
+ recordDataLength,
+ userData);
+ return iODWriteRequestHeader;
+ }
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (!(o instanceof IODWriteRequestHeader)) {
+ return false;
+ }
+ IODWriteRequestHeader that = (IODWriteRequestHeader) o;
+ return (getBlockVersionHigh() == that.getBlockVersionHigh())
+ && (getBlockVersionLow() == that.getBlockVersionLow())
+ && (getSequenceNumber() == that.getSequenceNumber())
+ && (getArUuid() == that.getArUuid())
+ && (getApi() == that.getApi())
+ && (getSlotNumber() == that.getSlotNumber())
+ && (getSubSlotNumber() == that.getSubSlotNumber())
+ && (getIndex() == that.getIndex())
+ && (getRecordDataLength() == that.getRecordDataLength())
+ && (getUserData() == that.getUserData())
+ && super.equals(that)
+ && true;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(
+ super.hashCode(),
+ getBlockVersionHigh(),
+ getBlockVersionLow(),
+ getSequenceNumber(),
+ getArUuid(),
+ getApi(),
+ getSlotNumber(),
+ getSubSlotNumber(),
+ getIndex(),
+ getRecordDataLength(),
+ getUserData());
+ }
+
+ @Override
+ public String toString() {
+ WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true);
+ try {
+ writeBufferBoxBased.writeSerializable(this);
+ } catch (SerializationException e) {
+ throw new RuntimeException(e);
+ }
+ return "\n" + writeBufferBoxBased.getBox().toString() + "\n";
+ }
+}
diff --git a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/IODWriteResponseHeader.java b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/IODWriteResponseHeader.java
new file mode 100644
index 00000000000..8cf39b5f00e
--- /dev/null
+++ b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/IODWriteResponseHeader.java
@@ -0,0 +1,459 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.plc4x.java.profinet.readwrite;
+
+import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*;
+import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*;
+import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*;
+import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*;
+import static org.apache.plc4x.java.spi.generation.StaticHelper.*;
+
+import java.time.*;
+import java.util.*;
+import org.apache.plc4x.java.api.exceptions.*;
+import org.apache.plc4x.java.api.value.*;
+import org.apache.plc4x.java.spi.codegen.*;
+import org.apache.plc4x.java.spi.codegen.fields.*;
+import org.apache.plc4x.java.spi.codegen.io.*;
+import org.apache.plc4x.java.spi.generation.*;
+
+// Code generated by code-generation. DO NOT EDIT.
+
+public class IODWriteResponseHeader extends PnIoCm_Block implements Message {
+
+ // Accessors for discriminator values.
+ public PnIoCm_BlockType getBlockType() {
+ return PnIoCm_BlockType.IOD_WRITE_RESPONSE_HEADER;
+ }
+
+ // Constant values.
+ public static final Integer PADFIELD = 0x0000;
+
+ // Properties.
+ protected final short blockVersionHigh;
+ protected final short blockVersionLow;
+ protected final int sequenceNumber;
+ protected final Uuid arUuid;
+ protected final long api;
+ protected final int slotNumber;
+ protected final int subSlotNumber;
+ protected final int index;
+ protected final long recordDataLength;
+
+ public IODWriteResponseHeader(
+ short blockVersionHigh,
+ short blockVersionLow,
+ int sequenceNumber,
+ Uuid arUuid,
+ long api,
+ int slotNumber,
+ int subSlotNumber,
+ int index,
+ long recordDataLength) {
+ super();
+ this.blockVersionHigh = blockVersionHigh;
+ this.blockVersionLow = blockVersionLow;
+ this.sequenceNumber = sequenceNumber;
+ this.arUuid = arUuid;
+ this.api = api;
+ this.slotNumber = slotNumber;
+ this.subSlotNumber = subSlotNumber;
+ this.index = index;
+ this.recordDataLength = recordDataLength;
+ }
+
+ public short getBlockVersionHigh() {
+ return blockVersionHigh;
+ }
+
+ public short getBlockVersionLow() {
+ return blockVersionLow;
+ }
+
+ public int getSequenceNumber() {
+ return sequenceNumber;
+ }
+
+ public Uuid getArUuid() {
+ return arUuid;
+ }
+
+ public long getApi() {
+ return api;
+ }
+
+ public int getSlotNumber() {
+ return slotNumber;
+ }
+
+ public int getSubSlotNumber() {
+ return subSlotNumber;
+ }
+
+ public int getIndex() {
+ return index;
+ }
+
+ public long getRecordDataLength() {
+ return recordDataLength;
+ }
+
+ public int getPadField() {
+ return PADFIELD;
+ }
+
+ @Override
+ protected void serializePnIoCm_BlockChild(WriteBuffer writeBuffer) throws SerializationException {
+ PositionAware positionAware = writeBuffer;
+ int startPos = positionAware.getPos();
+ writeBuffer.pushContext("IODWriteResponseHeader");
+
+ // Implicit Field (blockLength) (Used for parsing, but its value is not stored as it's
+ // implicitly given by the objects content)
+ int blockLength = (int) ((getLengthInBytes()) - (4));
+ writeImplicitField(
+ "blockLength",
+ blockLength,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Simple Field (blockVersionHigh)
+ writeSimpleField(
+ "blockVersionHigh",
+ blockVersionHigh,
+ writeUnsignedShort(writeBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Simple Field (blockVersionLow)
+ writeSimpleField(
+ "blockVersionLow",
+ blockVersionLow,
+ writeUnsignedShort(writeBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Simple Field (sequenceNumber)
+ writeSimpleField(
+ "sequenceNumber",
+ sequenceNumber,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Simple Field (arUuid)
+ writeSimpleField(
+ "arUuid",
+ arUuid,
+ new DataWriterComplexDefault<>(writeBuffer),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Simple Field (api)
+ writeSimpleField(
+ "api",
+ api,
+ writeUnsignedLong(writeBuffer, 32),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Simple Field (slotNumber)
+ writeSimpleField(
+ "slotNumber",
+ slotNumber,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Simple Field (subSlotNumber)
+ writeSimpleField(
+ "subSlotNumber",
+ subSlotNumber,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Const Field (padField)
+ writeConstField(
+ "padField",
+ PADFIELD,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Simple Field (index)
+ writeSimpleField(
+ "index",
+ index,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Simple Field (recordDataLength)
+ writeSimpleField(
+ "recordDataLength",
+ recordDataLength,
+ writeUnsignedLong(writeBuffer, 32),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Padding Field (padding)
+ writePaddingField(
+ "padding",
+ (int) ((((((((((64) - (6)) - (2)) - (16)) - (4)) - (2)) - (2)) - (2)) - (2)) - (4)),
+ (short) 0x00,
+ writeUnsignedShort(writeBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ writeBuffer.popContext("IODWriteResponseHeader");
+ }
+
+ @Override
+ public int getLengthInBytes() {
+ return (int) Math.ceil((float) getLengthInBits() / 8.0);
+ }
+
+ @Override
+ public int getLengthInBits() {
+ int lengthInBits = super.getLengthInBits();
+ IODWriteResponseHeader _value = this;
+
+ // Implicit Field (blockLength)
+ lengthInBits += 16;
+
+ // Simple field (blockVersionHigh)
+ lengthInBits += 8;
+
+ // Simple field (blockVersionLow)
+ lengthInBits += 8;
+
+ // Simple field (sequenceNumber)
+ lengthInBits += 16;
+
+ // Simple field (arUuid)
+ lengthInBits += arUuid.getLengthInBits();
+
+ // Simple field (api)
+ lengthInBits += 32;
+
+ // Simple field (slotNumber)
+ lengthInBits += 16;
+
+ // Simple field (subSlotNumber)
+ lengthInBits += 16;
+
+ // Const Field (padField)
+ lengthInBits += 16;
+
+ // Simple field (index)
+ lengthInBits += 16;
+
+ // Simple field (recordDataLength)
+ lengthInBits += 32;
+
+ // Padding Field (padding)
+ int _timesPadding =
+ (int) ((((((((((64) - (6)) - (2)) - (16)) - (4)) - (2)) - (2)) - (2)) - (2)) - (4));
+ while (_timesPadding-- > 0) {
+ lengthInBits += 8;
+ }
+
+ return lengthInBits;
+ }
+
+ public static PnIoCm_BlockBuilder staticParsePnIoCm_BlockBuilder(ReadBuffer readBuffer)
+ throws ParseException {
+ readBuffer.pullContext("IODWriteResponseHeader");
+ PositionAware positionAware = readBuffer;
+ int startPos = positionAware.getPos();
+ int curPos;
+
+ int blockLength =
+ readImplicitField(
+ "blockLength",
+ readUnsignedInt(readBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ short blockVersionHigh =
+ readSimpleField(
+ "blockVersionHigh",
+ readUnsignedShort(readBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ short blockVersionLow =
+ readSimpleField(
+ "blockVersionLow",
+ readUnsignedShort(readBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ int sequenceNumber =
+ readSimpleField(
+ "sequenceNumber",
+ readUnsignedInt(readBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ Uuid arUuid =
+ readSimpleField(
+ "arUuid",
+ new DataReaderComplexDefault<>(() -> Uuid.staticParse(readBuffer), readBuffer),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ long api =
+ readSimpleField(
+ "api",
+ readUnsignedLong(readBuffer, 32),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ int slotNumber =
+ readSimpleField(
+ "slotNumber",
+ readUnsignedInt(readBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ int subSlotNumber =
+ readSimpleField(
+ "subSlotNumber",
+ readUnsignedInt(readBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ int padField =
+ readConstField(
+ "padField",
+ readUnsignedInt(readBuffer, 16),
+ IODWriteResponseHeader.PADFIELD,
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ int index =
+ readSimpleField(
+ "index",
+ readUnsignedInt(readBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ long recordDataLength =
+ readSimpleField(
+ "recordDataLength",
+ readUnsignedLong(readBuffer, 32),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ readPaddingField(
+ readUnsignedShort(readBuffer, 8),
+ (int) ((((((((((64) - (6)) - (2)) - (16)) - (4)) - (2)) - (2)) - (2)) - (2)) - (4)),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ readBuffer.closeContext("IODWriteResponseHeader");
+ // Create the instance
+ return new IODWriteResponseHeaderBuilderImpl(
+ blockVersionHigh,
+ blockVersionLow,
+ sequenceNumber,
+ arUuid,
+ api,
+ slotNumber,
+ subSlotNumber,
+ index,
+ recordDataLength);
+ }
+
+ public static class IODWriteResponseHeaderBuilderImpl
+ implements PnIoCm_Block.PnIoCm_BlockBuilder {
+ private final short blockVersionHigh;
+ private final short blockVersionLow;
+ private final int sequenceNumber;
+ private final Uuid arUuid;
+ private final long api;
+ private final int slotNumber;
+ private final int subSlotNumber;
+ private final int index;
+ private final long recordDataLength;
+
+ public IODWriteResponseHeaderBuilderImpl(
+ short blockVersionHigh,
+ short blockVersionLow,
+ int sequenceNumber,
+ Uuid arUuid,
+ long api,
+ int slotNumber,
+ int subSlotNumber,
+ int index,
+ long recordDataLength) {
+ this.blockVersionHigh = blockVersionHigh;
+ this.blockVersionLow = blockVersionLow;
+ this.sequenceNumber = sequenceNumber;
+ this.arUuid = arUuid;
+ this.api = api;
+ this.slotNumber = slotNumber;
+ this.subSlotNumber = subSlotNumber;
+ this.index = index;
+ this.recordDataLength = recordDataLength;
+ }
+
+ public IODWriteResponseHeader build() {
+ IODWriteResponseHeader iODWriteResponseHeader =
+ new IODWriteResponseHeader(
+ blockVersionHigh,
+ blockVersionLow,
+ sequenceNumber,
+ arUuid,
+ api,
+ slotNumber,
+ subSlotNumber,
+ index,
+ recordDataLength);
+ return iODWriteResponseHeader;
+ }
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (!(o instanceof IODWriteResponseHeader)) {
+ return false;
+ }
+ IODWriteResponseHeader that = (IODWriteResponseHeader) o;
+ return (getBlockVersionHigh() == that.getBlockVersionHigh())
+ && (getBlockVersionLow() == that.getBlockVersionLow())
+ && (getSequenceNumber() == that.getSequenceNumber())
+ && (getArUuid() == that.getArUuid())
+ && (getApi() == that.getApi())
+ && (getSlotNumber() == that.getSlotNumber())
+ && (getSubSlotNumber() == that.getSubSlotNumber())
+ && (getIndex() == that.getIndex())
+ && (getRecordDataLength() == that.getRecordDataLength())
+ && super.equals(that)
+ && true;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(
+ super.hashCode(),
+ getBlockVersionHigh(),
+ getBlockVersionLow(),
+ getSequenceNumber(),
+ getArUuid(),
+ getApi(),
+ getSlotNumber(),
+ getSubSlotNumber(),
+ getIndex(),
+ getRecordDataLength());
+ }
+
+ @Override
+ public String toString() {
+ WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true);
+ try {
+ writeBufferBoxBased.writeSerializable(this);
+ } catch (SerializationException e) {
+ throw new RuntimeException(e);
+ }
+ return "\n" + writeBufferBoxBased.getBox().toString() + "\n";
+ }
+}
diff --git a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/LldpUnit.java b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/LldpUnit.java
new file mode 100644
index 00000000000..4c7574a9a93
--- /dev/null
+++ b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/LldpUnit.java
@@ -0,0 +1,176 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.plc4x.java.profinet.readwrite;
+
+import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*;
+import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*;
+import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*;
+import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*;
+import static org.apache.plc4x.java.spi.generation.StaticHelper.*;
+
+import java.time.*;
+import java.util.*;
+import org.apache.plc4x.java.api.exceptions.*;
+import org.apache.plc4x.java.api.value.*;
+import org.apache.plc4x.java.spi.codegen.*;
+import org.apache.plc4x.java.spi.codegen.fields.*;
+import org.apache.plc4x.java.spi.codegen.io.*;
+import org.apache.plc4x.java.spi.generation.*;
+
+// Code generated by code-generation. DO NOT EDIT.
+
+public abstract class LldpUnit implements Message {
+
+ // Abstract accessors for discriminator values.
+ public abstract TlvType getTlvId();
+
+ // Properties.
+ protected final int tlvIdLength;
+
+ public LldpUnit(int tlvIdLength) {
+ super();
+ this.tlvIdLength = tlvIdLength;
+ }
+
+ public int getTlvIdLength() {
+ return tlvIdLength;
+ }
+
+ protected abstract void serializeLldpUnitChild(WriteBuffer writeBuffer)
+ throws SerializationException;
+
+ public void serialize(WriteBuffer writeBuffer) throws SerializationException {
+ PositionAware positionAware = writeBuffer;
+ int startPos = positionAware.getPos();
+ writeBuffer.pushContext("LldpUnit");
+
+ // Discriminator Field (tlvId) (Used as input to a switch field)
+ writeDiscriminatorEnumField(
+ "tlvId",
+ "TlvType",
+ getTlvId(),
+ new DataWriterEnumDefault<>(
+ TlvType::getValue, TlvType::name, writeUnsignedShort(writeBuffer, 7)));
+
+ // Simple Field (tlvIdLength)
+ writeSimpleField("tlvIdLength", tlvIdLength, writeUnsignedInt(writeBuffer, 9));
+
+ // Switch field (Serialize the sub-type)
+ serializeLldpUnitChild(writeBuffer);
+
+ writeBuffer.popContext("LldpUnit");
+ }
+
+ @Override
+ public int getLengthInBytes() {
+ return (int) Math.ceil((float) getLengthInBits() / 8.0);
+ }
+
+ @Override
+ public int getLengthInBits() {
+ int lengthInBits = 0;
+ LldpUnit _value = this;
+
+ // Discriminator Field (tlvId)
+ lengthInBits += 7;
+
+ // Simple field (tlvIdLength)
+ lengthInBits += 9;
+
+ // Length of sub-type elements will be added by sub-type...
+
+ return lengthInBits;
+ }
+
+ public static LldpUnit staticParse(ReadBuffer readBuffer, Object... args) throws ParseException {
+ PositionAware positionAware = readBuffer;
+ return staticParse(readBuffer);
+ }
+
+ public static LldpUnit staticParse(ReadBuffer readBuffer) throws ParseException {
+ readBuffer.pullContext("LldpUnit");
+ PositionAware positionAware = readBuffer;
+ int startPos = positionAware.getPos();
+ int curPos;
+
+ TlvType tlvId =
+ readDiscriminatorField(
+ "tlvId",
+ new DataReaderEnumDefault<>(TlvType::enumForValue, readUnsignedShort(readBuffer, 7)));
+
+ int tlvIdLength = readSimpleField("tlvIdLength", readUnsignedInt(readBuffer, 9));
+
+ // Switch Field (Depending on the discriminator values, passes the instantiation to a sub-type)
+ LldpUnitBuilder builder = null;
+ if (EvaluationHelper.equals(tlvId, TlvType.END_OF_LLDP)) {
+ builder = EndOfLldp.staticParseLldpUnitBuilder(readBuffer);
+ } else if (EvaluationHelper.equals(tlvId, TlvType.CHASSIS_ID)) {
+ builder = TlvChassisId.staticParseLldpUnitBuilder(readBuffer, tlvIdLength);
+ } else if (EvaluationHelper.equals(tlvId, TlvType.PORT_ID)) {
+ builder = TlvPortId.staticParseLldpUnitBuilder(readBuffer, tlvIdLength);
+ } else if (EvaluationHelper.equals(tlvId, TlvType.TIME_TO_LIVE)) {
+ builder = TlvTimeToLive.staticParseLldpUnitBuilder(readBuffer);
+ } else if (EvaluationHelper.equals(tlvId, TlvType.MANAGEMENT_ADDRESS)) {
+ builder = TlvManagementAddress.staticParseLldpUnitBuilder(readBuffer);
+ } else if (EvaluationHelper.equals(tlvId, TlvType.ORGANIZATION_SPECIFIC)) {
+ builder = TlvOrganizationSpecific.staticParseLldpUnitBuilder(readBuffer);
+ }
+ if (builder == null) {
+ throw new ParseException(
+ "Unsupported case for discriminated type" + " parameters [" + "tlvId=" + tlvId + "]");
+ }
+
+ readBuffer.closeContext("LldpUnit");
+ // Create the instance
+ LldpUnit _lldpUnit = builder.build(tlvIdLength);
+ return _lldpUnit;
+ }
+
+ public interface LldpUnitBuilder {
+ LldpUnit build(int tlvIdLength);
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (!(o instanceof LldpUnit)) {
+ return false;
+ }
+ LldpUnit that = (LldpUnit) o;
+ return (getTlvIdLength() == that.getTlvIdLength()) && true;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(getTlvIdLength());
+ }
+
+ @Override
+ public String toString() {
+ WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true);
+ try {
+ writeBufferBoxBased.writeSerializable(this);
+ } catch (SerializationException e) {
+ throw new RuntimeException(e);
+ }
+ return "\n" + writeBufferBoxBased.getBox().toString() + "\n";
+ }
+}
diff --git a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/Lldp_Pdu.java b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/Lldp_Pdu.java
new file mode 100644
index 00000000000..a5b7cce63cd
--- /dev/null
+++ b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/Lldp_Pdu.java
@@ -0,0 +1,146 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.plc4x.java.profinet.readwrite;
+
+import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*;
+import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*;
+import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*;
+import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*;
+import static org.apache.plc4x.java.spi.generation.StaticHelper.*;
+
+import java.time.*;
+import java.util.*;
+import org.apache.plc4x.java.api.exceptions.*;
+import org.apache.plc4x.java.api.value.*;
+import org.apache.plc4x.java.spi.codegen.*;
+import org.apache.plc4x.java.spi.codegen.fields.*;
+import org.apache.plc4x.java.spi.codegen.io.*;
+import org.apache.plc4x.java.spi.generation.*;
+
+// Code generated by code-generation. DO NOT EDIT.
+
+public class Lldp_Pdu implements Message {
+
+ // Properties.
+ protected final List lldpParameters;
+
+ public Lldp_Pdu(List lldpParameters) {
+ super();
+ this.lldpParameters = lldpParameters;
+ }
+
+ public List getLldpParameters() {
+ return lldpParameters;
+ }
+
+ public void serialize(WriteBuffer writeBuffer) throws SerializationException {
+ PositionAware positionAware = writeBuffer;
+ int startPos = positionAware.getPos();
+ writeBuffer.pushContext("Lldp_Pdu");
+
+ // Manual Array Field (lldpParameters)
+ writeManualArrayField(
+ "lldpParameters",
+ lldpParameters,
+ (LldpUnit _value) ->
+ org.apache.plc4x.java.profinet.readwrite.utils.StaticHelper.serializeSysexString(
+ writeBuffer, _value),
+ writeBuffer);
+
+ writeBuffer.popContext("Lldp_Pdu");
+ }
+
+ @Override
+ public int getLengthInBytes() {
+ return (int) Math.ceil((float) getLengthInBits() / 8.0);
+ }
+
+ @Override
+ public int getLengthInBits() {
+ int lengthInBits = 0;
+ Lldp_Pdu _value = this;
+
+ // Manual Array Field (lldpParameters)
+ lengthInBits +=
+ org.apache.plc4x.java.profinet.readwrite.utils.StaticHelper.lengthSysexString(
+ lldpParameters)
+ * 8;
+
+ return lengthInBits;
+ }
+
+ public static Lldp_Pdu staticParse(ReadBuffer readBuffer, Object... args) throws ParseException {
+ PositionAware positionAware = readBuffer;
+ return staticParse(readBuffer);
+ }
+
+ public static Lldp_Pdu staticParse(ReadBuffer readBuffer) throws ParseException {
+ readBuffer.pullContext("Lldp_Pdu");
+ PositionAware positionAware = readBuffer;
+ int startPos = positionAware.getPos();
+ int curPos;
+
+ List lldpParameters =
+ readManualArrayField(
+ "lldpParameters",
+ readBuffer,
+ (List _values) ->
+ (boolean)
+ (org.apache.plc4x.java.profinet.readwrite.utils.StaticHelper.isSysexEnd(
+ readBuffer)),
+ () ->
+ (LldpUnit)
+ (org.apache.plc4x.java.profinet.readwrite.utils.StaticHelper.parseSysexString(
+ readBuffer)));
+
+ readBuffer.closeContext("Lldp_Pdu");
+ // Create the instance
+ Lldp_Pdu _lldp_Pdu;
+ _lldp_Pdu = new Lldp_Pdu(lldpParameters);
+ return _lldp_Pdu;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (!(o instanceof Lldp_Pdu)) {
+ return false;
+ }
+ Lldp_Pdu that = (Lldp_Pdu) o;
+ return (getLldpParameters() == that.getLldpParameters()) && true;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(getLldpParameters());
+ }
+
+ @Override
+ public String toString() {
+ WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true);
+ try {
+ writeBufferBoxBased.writeSerializable(this);
+ } catch (SerializationException e) {
+ throw new RuntimeException(e);
+ }
+ return "\n" + writeBufferBoxBased.getBox().toString() + "\n";
+ }
+}
diff --git a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/ManagementAddressSubType.java b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/ManagementAddressSubType.java
new file mode 100644
index 00000000000..f88fdd810cd
--- /dev/null
+++ b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/ManagementAddressSubType.java
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.plc4x.java.profinet.readwrite;
+
+import java.util.HashMap;
+import java.util.Map;
+
+// Code generated by code-generation. DO NOT EDIT.
+
+public enum ManagementAddressSubType {
+ UNKNOWN((short) 0x00),
+ IPV4((short) 0x01);
+ private static final Map map;
+
+ static {
+ map = new HashMap<>();
+ for (ManagementAddressSubType value : ManagementAddressSubType.values()) {
+ map.put((short) value.getValue(), value);
+ }
+ }
+
+ private short value;
+
+ ManagementAddressSubType(short value) {
+ this.value = value;
+ }
+
+ public short getValue() {
+ return value;
+ }
+
+ public static ManagementAddressSubType enumForValue(short value) {
+ return map.get(value);
+ }
+
+ public static Boolean isDefined(short value) {
+ return map.containsKey(value);
+ }
+}
diff --git a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/MultipleInterfaceModeNameOfDevice.java b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/MultipleInterfaceModeNameOfDevice.java
new file mode 100644
index 00000000000..22e2d775e47
--- /dev/null
+++ b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/MultipleInterfaceModeNameOfDevice.java
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.plc4x.java.profinet.readwrite;
+
+import java.util.HashMap;
+import java.util.Map;
+
+// Code generated by code-generation. DO NOT EDIT.
+
+public enum MultipleInterfaceModeNameOfDevice {
+ PORT_PROVIDED_BY_LLDP((boolean) false),
+ NAME_PROVIDED_BY_LLDP((boolean) true);
+ private static final Map map;
+
+ static {
+ map = new HashMap<>();
+ for (MultipleInterfaceModeNameOfDevice value : MultipleInterfaceModeNameOfDevice.values()) {
+ map.put((boolean) value.getValue(), value);
+ }
+ }
+
+ private boolean value;
+
+ MultipleInterfaceModeNameOfDevice(boolean value) {
+ this.value = value;
+ }
+
+ public boolean getValue() {
+ return value;
+ }
+
+ public static MultipleInterfaceModeNameOfDevice enumForValue(boolean value) {
+ return map.get(value);
+ }
+
+ public static Boolean isDefined(boolean value) {
+ return map.containsKey(value);
+ }
+}
diff --git a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PDInterfaceAdjust.java b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PDInterfaceAdjust.java
new file mode 100644
index 00000000000..4f402fcd865
--- /dev/null
+++ b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PDInterfaceAdjust.java
@@ -0,0 +1,304 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.plc4x.java.profinet.readwrite;
+
+import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*;
+import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*;
+import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*;
+import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*;
+import static org.apache.plc4x.java.spi.generation.StaticHelper.*;
+
+import java.time.*;
+import java.util.*;
+import org.apache.plc4x.java.api.exceptions.*;
+import org.apache.plc4x.java.api.value.*;
+import org.apache.plc4x.java.spi.codegen.*;
+import org.apache.plc4x.java.spi.codegen.fields.*;
+import org.apache.plc4x.java.spi.codegen.io.*;
+import org.apache.plc4x.java.spi.generation.*;
+
+// Code generated by code-generation. DO NOT EDIT.
+
+public class PDInterfaceAdjust extends PnIoCm_Block implements Message {
+
+ // Accessors for discriminator values.
+ public PnIoCm_BlockType getBlockType() {
+ return PnIoCm_BlockType.PD_INTERFACE_ADJUST;
+ }
+
+ // Constant values.
+ public static final Integer PADFIELD = 0x0000;
+ public static final Integer MULTIPLEINTERFACEMODERESERVED2 = 0x0000;
+ public static final Integer MULTIPLEINTERFACEMODERESERVED1 = 0x0000;
+
+ // Properties.
+ protected final short blockVersionHigh;
+ protected final short blockVersionLow;
+ protected final MultipleInterfaceModeNameOfDevice multipleInterfaceModeNameOfDevice;
+
+ public PDInterfaceAdjust(
+ short blockVersionHigh,
+ short blockVersionLow,
+ MultipleInterfaceModeNameOfDevice multipleInterfaceModeNameOfDevice) {
+ super();
+ this.blockVersionHigh = blockVersionHigh;
+ this.blockVersionLow = blockVersionLow;
+ this.multipleInterfaceModeNameOfDevice = multipleInterfaceModeNameOfDevice;
+ }
+
+ public short getBlockVersionHigh() {
+ return blockVersionHigh;
+ }
+
+ public short getBlockVersionLow() {
+ return blockVersionLow;
+ }
+
+ public MultipleInterfaceModeNameOfDevice getMultipleInterfaceModeNameOfDevice() {
+ return multipleInterfaceModeNameOfDevice;
+ }
+
+ public int getPadField() {
+ return PADFIELD;
+ }
+
+ public int getMultipleInterfaceModeReserved2() {
+ return MULTIPLEINTERFACEMODERESERVED2;
+ }
+
+ public int getMultipleInterfaceModeReserved1() {
+ return MULTIPLEINTERFACEMODERESERVED1;
+ }
+
+ @Override
+ protected void serializePnIoCm_BlockChild(WriteBuffer writeBuffer) throws SerializationException {
+ PositionAware positionAware = writeBuffer;
+ int startPos = positionAware.getPos();
+ writeBuffer.pushContext("PDInterfaceAdjust");
+
+ // Implicit Field (blockLength) (Used for parsing, but its value is not stored as it's
+ // implicitly given by the objects content)
+ int blockLength = (int) ((getLengthInBytes()) - (4));
+ writeImplicitField(
+ "blockLength",
+ blockLength,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Simple Field (blockVersionHigh)
+ writeSimpleField(
+ "blockVersionHigh",
+ blockVersionHigh,
+ writeUnsignedShort(writeBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Simple Field (blockVersionLow)
+ writeSimpleField(
+ "blockVersionLow",
+ blockVersionLow,
+ writeUnsignedShort(writeBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Const Field (padField)
+ writeConstField(
+ "padField",
+ PADFIELD,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Const Field (multipleInterfaceModeReserved2)
+ writeConstField(
+ "multipleInterfaceModeReserved2",
+ MULTIPLEINTERFACEMODERESERVED2,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Const Field (multipleInterfaceModeReserved1)
+ writeConstField(
+ "multipleInterfaceModeReserved1",
+ MULTIPLEINTERFACEMODERESERVED1,
+ writeUnsignedInt(writeBuffer, 15),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Simple Field (multipleInterfaceModeNameOfDevice)
+ writeSimpleEnumField(
+ "multipleInterfaceModeNameOfDevice",
+ "MultipleInterfaceModeNameOfDevice",
+ multipleInterfaceModeNameOfDevice,
+ new DataWriterEnumDefault<>(
+ MultipleInterfaceModeNameOfDevice::getValue,
+ MultipleInterfaceModeNameOfDevice::name,
+ writeBoolean(writeBuffer)),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ writeBuffer.popContext("PDInterfaceAdjust");
+ }
+
+ @Override
+ public int getLengthInBytes() {
+ return (int) Math.ceil((float) getLengthInBits() / 8.0);
+ }
+
+ @Override
+ public int getLengthInBits() {
+ int lengthInBits = super.getLengthInBits();
+ PDInterfaceAdjust _value = this;
+
+ // Implicit Field (blockLength)
+ lengthInBits += 16;
+
+ // Simple field (blockVersionHigh)
+ lengthInBits += 8;
+
+ // Simple field (blockVersionLow)
+ lengthInBits += 8;
+
+ // Const Field (padField)
+ lengthInBits += 16;
+
+ // Const Field (multipleInterfaceModeReserved2)
+ lengthInBits += 16;
+
+ // Const Field (multipleInterfaceModeReserved1)
+ lengthInBits += 15;
+
+ // Simple field (multipleInterfaceModeNameOfDevice)
+ lengthInBits += 1;
+
+ return lengthInBits;
+ }
+
+ public static PnIoCm_BlockBuilder staticParsePnIoCm_BlockBuilder(ReadBuffer readBuffer)
+ throws ParseException {
+ readBuffer.pullContext("PDInterfaceAdjust");
+ PositionAware positionAware = readBuffer;
+ int startPos = positionAware.getPos();
+ int curPos;
+
+ int blockLength =
+ readImplicitField(
+ "blockLength",
+ readUnsignedInt(readBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ short blockVersionHigh =
+ readSimpleField(
+ "blockVersionHigh",
+ readUnsignedShort(readBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ short blockVersionLow =
+ readSimpleField(
+ "blockVersionLow",
+ readUnsignedShort(readBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ int padField =
+ readConstField(
+ "padField",
+ readUnsignedInt(readBuffer, 16),
+ PDInterfaceAdjust.PADFIELD,
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ int multipleInterfaceModeReserved2 =
+ readConstField(
+ "multipleInterfaceModeReserved2",
+ readUnsignedInt(readBuffer, 16),
+ PDInterfaceAdjust.MULTIPLEINTERFACEMODERESERVED2,
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ int multipleInterfaceModeReserved1 =
+ readConstField(
+ "multipleInterfaceModeReserved1",
+ readUnsignedInt(readBuffer, 15),
+ PDInterfaceAdjust.MULTIPLEINTERFACEMODERESERVED1,
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ MultipleInterfaceModeNameOfDevice multipleInterfaceModeNameOfDevice =
+ readEnumField(
+ "multipleInterfaceModeNameOfDevice",
+ "MultipleInterfaceModeNameOfDevice",
+ new DataReaderEnumDefault<>(
+ MultipleInterfaceModeNameOfDevice::enumForValue, readBoolean(readBuffer)),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ readBuffer.closeContext("PDInterfaceAdjust");
+ // Create the instance
+ return new PDInterfaceAdjustBuilderImpl(
+ blockVersionHigh, blockVersionLow, multipleInterfaceModeNameOfDevice);
+ }
+
+ public static class PDInterfaceAdjustBuilderImpl implements PnIoCm_Block.PnIoCm_BlockBuilder {
+ private final short blockVersionHigh;
+ private final short blockVersionLow;
+ private final MultipleInterfaceModeNameOfDevice multipleInterfaceModeNameOfDevice;
+
+ public PDInterfaceAdjustBuilderImpl(
+ short blockVersionHigh,
+ short blockVersionLow,
+ MultipleInterfaceModeNameOfDevice multipleInterfaceModeNameOfDevice) {
+ this.blockVersionHigh = blockVersionHigh;
+ this.blockVersionLow = blockVersionLow;
+ this.multipleInterfaceModeNameOfDevice = multipleInterfaceModeNameOfDevice;
+ }
+
+ public PDInterfaceAdjust build() {
+ PDInterfaceAdjust pDInterfaceAdjust =
+ new PDInterfaceAdjust(
+ blockVersionHigh, blockVersionLow, multipleInterfaceModeNameOfDevice);
+ return pDInterfaceAdjust;
+ }
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (!(o instanceof PDInterfaceAdjust)) {
+ return false;
+ }
+ PDInterfaceAdjust that = (PDInterfaceAdjust) o;
+ return (getBlockVersionHigh() == that.getBlockVersionHigh())
+ && (getBlockVersionLow() == that.getBlockVersionLow())
+ && (getMultipleInterfaceModeNameOfDevice() == that.getMultipleInterfaceModeNameOfDevice())
+ && super.equals(that)
+ && true;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(
+ super.hashCode(),
+ getBlockVersionHigh(),
+ getBlockVersionLow(),
+ getMultipleInterfaceModeNameOfDevice());
+ }
+
+ @Override
+ public String toString() {
+ WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true);
+ try {
+ writeBufferBoxBased.writeSerializable(this);
+ } catch (SerializationException e) {
+ throw new RuntimeException(e);
+ }
+ return "\n" + writeBufferBoxBased.getBox().toString() + "\n";
+ }
+}
diff --git a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PDPortDataCheck.java b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PDPortDataCheck.java
new file mode 100644
index 00000000000..a3aaf00cd52
--- /dev/null
+++ b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PDPortDataCheck.java
@@ -0,0 +1,310 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.plc4x.java.profinet.readwrite;
+
+import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*;
+import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*;
+import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*;
+import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*;
+import static org.apache.plc4x.java.spi.generation.StaticHelper.*;
+
+import java.time.*;
+import java.util.*;
+import org.apache.plc4x.java.api.exceptions.*;
+import org.apache.plc4x.java.api.value.*;
+import org.apache.plc4x.java.spi.codegen.*;
+import org.apache.plc4x.java.spi.codegen.fields.*;
+import org.apache.plc4x.java.spi.codegen.io.*;
+import org.apache.plc4x.java.spi.generation.*;
+
+// Code generated by code-generation. DO NOT EDIT.
+
+public class PDPortDataCheck extends PnIoCm_Block implements Message {
+
+ // Accessors for discriminator values.
+ public PnIoCm_BlockType getBlockType() {
+ return PnIoCm_BlockType.PD_PORT_DATA_CHECK;
+ }
+
+ // Constant values.
+ public static final Integer PADFIELD = 0x0000;
+
+ // Properties.
+ protected final short blockVersionHigh;
+ protected final short blockVersionLow;
+ protected final int slotNumber;
+ protected final int subSlotNumber;
+ protected final PnIoCm_Block checkPeers;
+
+ public PDPortDataCheck(
+ short blockVersionHigh,
+ short blockVersionLow,
+ int slotNumber,
+ int subSlotNumber,
+ PnIoCm_Block checkPeers) {
+ super();
+ this.blockVersionHigh = blockVersionHigh;
+ this.blockVersionLow = blockVersionLow;
+ this.slotNumber = slotNumber;
+ this.subSlotNumber = subSlotNumber;
+ this.checkPeers = checkPeers;
+ }
+
+ public short getBlockVersionHigh() {
+ return blockVersionHigh;
+ }
+
+ public short getBlockVersionLow() {
+ return blockVersionLow;
+ }
+
+ public int getSlotNumber() {
+ return slotNumber;
+ }
+
+ public int getSubSlotNumber() {
+ return subSlotNumber;
+ }
+
+ public PnIoCm_Block getCheckPeers() {
+ return checkPeers;
+ }
+
+ public int getPadField() {
+ return PADFIELD;
+ }
+
+ @Override
+ protected void serializePnIoCm_BlockChild(WriteBuffer writeBuffer) throws SerializationException {
+ PositionAware positionAware = writeBuffer;
+ int startPos = positionAware.getPos();
+ writeBuffer.pushContext("PDPortDataCheck");
+
+ // Implicit Field (blockLength) (Used for parsing, but its value is not stored as it's
+ // implicitly given by the objects content)
+ int blockLength = (int) ((getLengthInBytes()) - (4));
+ writeImplicitField(
+ "blockLength",
+ blockLength,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Simple Field (blockVersionHigh)
+ writeSimpleField(
+ "blockVersionHigh",
+ blockVersionHigh,
+ writeUnsignedShort(writeBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Simple Field (blockVersionLow)
+ writeSimpleField(
+ "blockVersionLow",
+ blockVersionLow,
+ writeUnsignedShort(writeBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Const Field (padField)
+ writeConstField(
+ "padField",
+ PADFIELD,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Simple Field (slotNumber)
+ writeSimpleField(
+ "slotNumber",
+ slotNumber,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Simple Field (subSlotNumber)
+ writeSimpleField(
+ "subSlotNumber",
+ subSlotNumber,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Simple Field (checkPeers)
+ writeSimpleField(
+ "checkPeers",
+ checkPeers,
+ new DataWriterComplexDefault<>(writeBuffer),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ writeBuffer.popContext("PDPortDataCheck");
+ }
+
+ @Override
+ public int getLengthInBytes() {
+ return (int) Math.ceil((float) getLengthInBits() / 8.0);
+ }
+
+ @Override
+ public int getLengthInBits() {
+ int lengthInBits = super.getLengthInBits();
+ PDPortDataCheck _value = this;
+
+ // Implicit Field (blockLength)
+ lengthInBits += 16;
+
+ // Simple field (blockVersionHigh)
+ lengthInBits += 8;
+
+ // Simple field (blockVersionLow)
+ lengthInBits += 8;
+
+ // Const Field (padField)
+ lengthInBits += 16;
+
+ // Simple field (slotNumber)
+ lengthInBits += 16;
+
+ // Simple field (subSlotNumber)
+ lengthInBits += 16;
+
+ // Simple field (checkPeers)
+ lengthInBits += checkPeers.getLengthInBits();
+
+ return lengthInBits;
+ }
+
+ public static PnIoCm_BlockBuilder staticParsePnIoCm_BlockBuilder(ReadBuffer readBuffer)
+ throws ParseException {
+ readBuffer.pullContext("PDPortDataCheck");
+ PositionAware positionAware = readBuffer;
+ int startPos = positionAware.getPos();
+ int curPos;
+
+ int blockLength =
+ readImplicitField(
+ "blockLength",
+ readUnsignedInt(readBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ short blockVersionHigh =
+ readSimpleField(
+ "blockVersionHigh",
+ readUnsignedShort(readBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ short blockVersionLow =
+ readSimpleField(
+ "blockVersionLow",
+ readUnsignedShort(readBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ int padField =
+ readConstField(
+ "padField",
+ readUnsignedInt(readBuffer, 16),
+ PDPortDataCheck.PADFIELD,
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ int slotNumber =
+ readSimpleField(
+ "slotNumber",
+ readUnsignedInt(readBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ int subSlotNumber =
+ readSimpleField(
+ "subSlotNumber",
+ readUnsignedInt(readBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ PnIoCm_Block checkPeers =
+ readSimpleField(
+ "checkPeers",
+ new DataReaderComplexDefault<>(() -> PnIoCm_Block.staticParse(readBuffer), readBuffer),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ readBuffer.closeContext("PDPortDataCheck");
+ // Create the instance
+ return new PDPortDataCheckBuilderImpl(
+ blockVersionHigh, blockVersionLow, slotNumber, subSlotNumber, checkPeers);
+ }
+
+ public static class PDPortDataCheckBuilderImpl implements PnIoCm_Block.PnIoCm_BlockBuilder {
+ private final short blockVersionHigh;
+ private final short blockVersionLow;
+ private final int slotNumber;
+ private final int subSlotNumber;
+ private final PnIoCm_Block checkPeers;
+
+ public PDPortDataCheckBuilderImpl(
+ short blockVersionHigh,
+ short blockVersionLow,
+ int slotNumber,
+ int subSlotNumber,
+ PnIoCm_Block checkPeers) {
+ this.blockVersionHigh = blockVersionHigh;
+ this.blockVersionLow = blockVersionLow;
+ this.slotNumber = slotNumber;
+ this.subSlotNumber = subSlotNumber;
+ this.checkPeers = checkPeers;
+ }
+
+ public PDPortDataCheck build() {
+ PDPortDataCheck pDPortDataCheck =
+ new PDPortDataCheck(
+ blockVersionHigh, blockVersionLow, slotNumber, subSlotNumber, checkPeers);
+ return pDPortDataCheck;
+ }
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (!(o instanceof PDPortDataCheck)) {
+ return false;
+ }
+ PDPortDataCheck that = (PDPortDataCheck) o;
+ return (getBlockVersionHigh() == that.getBlockVersionHigh())
+ && (getBlockVersionLow() == that.getBlockVersionLow())
+ && (getSlotNumber() == that.getSlotNumber())
+ && (getSubSlotNumber() == that.getSubSlotNumber())
+ && (getCheckPeers() == that.getCheckPeers())
+ && super.equals(that)
+ && true;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(
+ super.hashCode(),
+ getBlockVersionHigh(),
+ getBlockVersionLow(),
+ getSlotNumber(),
+ getSubSlotNumber(),
+ getCheckPeers());
+ }
+
+ @Override
+ public String toString() {
+ WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true);
+ try {
+ writeBufferBoxBased.writeSerializable(this);
+ } catch (SerializationException e) {
+ throw new RuntimeException(e);
+ }
+ return "\n" + writeBufferBoxBased.getBox().toString() + "\n";
+ }
+}
diff --git a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PascalString.java b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PascalString.java
new file mode 100644
index 00000000000..754247568a1
--- /dev/null
+++ b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PascalString.java
@@ -0,0 +1,161 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.plc4x.java.profinet.readwrite;
+
+import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*;
+import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*;
+import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*;
+import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*;
+import static org.apache.plc4x.java.spi.generation.StaticHelper.*;
+
+import java.time.*;
+import java.util.*;
+import org.apache.plc4x.java.api.exceptions.*;
+import org.apache.plc4x.java.api.value.*;
+import org.apache.plc4x.java.spi.codegen.*;
+import org.apache.plc4x.java.spi.codegen.fields.*;
+import org.apache.plc4x.java.spi.codegen.io.*;
+import org.apache.plc4x.java.spi.generation.*;
+
+// Code generated by code-generation. DO NOT EDIT.
+
+public class PascalString implements Message {
+
+ // Properties.
+ protected final String stringValue;
+
+ public PascalString(String stringValue) {
+ super();
+ this.stringValue = stringValue;
+ }
+
+ public String getStringValue() {
+ return stringValue;
+ }
+
+ public byte getStringLength() {
+ return (byte) ((((getStringValue().length()) == (-(1))) ? 0 : getStringValue().length()));
+ }
+
+ public void serialize(WriteBuffer writeBuffer) throws SerializationException {
+ PositionAware positionAware = writeBuffer;
+ int startPos = positionAware.getPos();
+ writeBuffer.pushContext("PascalString");
+
+ // Implicit Field (sLength) (Used for parsing, but its value is not stored as it's implicitly
+ // given by the objects content)
+ byte sLength =
+ (byte) ((((getStringValue().length()) == (0)) ? -(1) : getStringValue().length()));
+ writeImplicitField("sLength", sLength, writeSignedByte(writeBuffer, 8));
+
+ // Simple Field (stringValue)
+ writeSimpleField(
+ "stringValue",
+ stringValue,
+ writeString(writeBuffer, (((sLength) == (-(1))) ? 0 : (sLength) * (8))));
+
+ // Virtual field (doesn't actually serialize anything, just makes the value available)
+ byte stringLength = getStringLength();
+ writeBuffer.writeVirtual("stringLength", stringLength);
+
+ writeBuffer.popContext("PascalString");
+ }
+
+ @Override
+ public int getLengthInBytes() {
+ return (int) Math.ceil((float) getLengthInBits() / 8.0);
+ }
+
+ @Override
+ public int getLengthInBits() {
+ int lengthInBits = 0;
+ PascalString _value = this;
+
+ // Implicit Field (sLength)
+ lengthInBits += 8;
+
+ // Simple field (stringValue)
+ lengthInBits +=
+ ((((((getStringValue().length()) == (0)) ? -(1) : getStringValue().length())) == (-(1)))
+ ? 0
+ : ((((getStringValue().length()) == (0)) ? -(1) : getStringValue().length())) * (8));
+
+ // A virtual field doesn't have any in- or output.
+
+ return lengthInBits;
+ }
+
+ public static PascalString staticParse(ReadBuffer readBuffer, Object... args)
+ throws ParseException {
+ PositionAware positionAware = readBuffer;
+ return staticParse(readBuffer);
+ }
+
+ public static PascalString staticParse(ReadBuffer readBuffer) throws ParseException {
+ readBuffer.pullContext("PascalString");
+ PositionAware positionAware = readBuffer;
+ int startPos = positionAware.getPos();
+ int curPos;
+
+ byte sLength = readImplicitField("sLength", readSignedByte(readBuffer, 8));
+
+ String stringValue =
+ readSimpleField(
+ "stringValue", readString(readBuffer, (((sLength) == (-(1))) ? 0 : (sLength) * (8))));
+ byte stringLength =
+ readVirtualField(
+ "stringLength",
+ byte.class,
+ (((stringValue.length()) == (-(1))) ? 0 : stringValue.length()));
+
+ readBuffer.closeContext("PascalString");
+ // Create the instance
+ PascalString _pascalString;
+ _pascalString = new PascalString(stringValue);
+ return _pascalString;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (!(o instanceof PascalString)) {
+ return false;
+ }
+ PascalString that = (PascalString) o;
+ return (getStringValue() == that.getStringValue()) && true;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(getStringValue());
+ }
+
+ @Override
+ public String toString() {
+ WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true);
+ try {
+ writeBufferBoxBased.writeSerializable(this);
+ } catch (SerializationException e) {
+ throw new RuntimeException(e);
+ }
+ return "\n" + writeBufferBoxBased.getBox().toString() + "\n";
+ }
+}
diff --git a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PcDcp_Pdu_DelayReq.java b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PcDcp_Pdu_DelayReq.java
index 6edbd6ae895..ad32c0f885e 100644
--- a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PcDcp_Pdu_DelayReq.java
+++ b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PcDcp_Pdu_DelayReq.java
@@ -50,6 +50,12 @@ public class PcDcp_Pdu_DelayReq extends PnDcp_Pdu implements Message {
protected final long delayInNs;
protected final MacAddress portMacAddress;
+ // Reserved Fields
+ private Long reservedField0;
+ private Long reservedField1;
+ private Long reservedField2;
+ private Integer reservedField3;
+
public PcDcp_Pdu_DelayReq(
int frameIdValue, int sequenceId, long delayInNs, MacAddress portMacAddress) {
super(frameIdValue);
@@ -93,19 +99,31 @@ protected void serializePnDcp_PduChild(WriteBuffer writeBuffer) throws Serializa
writeBuffer.pushContext("PcDcp_Pdu_DelayReq");
// Reserved Field (reserved)
- writeReservedField("reserved", (long) 0x00000000, writeUnsignedLong(writeBuffer, 32));
+ writeReservedField(
+ "reserved",
+ reservedField0 != null ? reservedField0 : (long) 0x00000000,
+ writeUnsignedLong(writeBuffer, 32));
// Reserved Field (reserved)
- writeReservedField("reserved", (long) 0x00000000, writeUnsignedLong(writeBuffer, 32));
+ writeReservedField(
+ "reserved",
+ reservedField1 != null ? reservedField1 : (long) 0x00000000,
+ writeUnsignedLong(writeBuffer, 32));
// Reserved Field (reserved)
- writeReservedField("reserved", (long) 0x00000000, writeUnsignedLong(writeBuffer, 32));
+ writeReservedField(
+ "reserved",
+ reservedField2 != null ? reservedField2 : (long) 0x00000000,
+ writeUnsignedLong(writeBuffer, 32));
// Simple Field (sequenceId)
writeSimpleField("sequenceId", sequenceId, writeUnsignedInt(writeBuffer, 16));
// Reserved Field (reserved)
- writeReservedField("reserved", (int) 0x0000, writeUnsignedInt(writeBuffer, 16));
+ writeReservedField(
+ "reserved",
+ reservedField3 != null ? reservedField3 : (int) 0x0000,
+ writeUnsignedInt(writeBuffer, 16));
// Simple Field (delayInNs)
writeSimpleField("delayInNs", delayInNs, writeUnsignedLong(writeBuffer, 32));
@@ -218,24 +236,49 @@ public static PnDcp_PduBuilder staticParsePnDcp_PduBuilder(ReadBuffer readBuffer
readBuffer.closeContext("PcDcp_Pdu_DelayReq");
// Create the instance
- return new PcDcp_Pdu_DelayReqBuilderImpl(sequenceId, delayInNs, portMacAddress);
+ return new PcDcp_Pdu_DelayReqBuilderImpl(
+ sequenceId,
+ delayInNs,
+ portMacAddress,
+ reservedField0,
+ reservedField1,
+ reservedField2,
+ reservedField3);
}
public static class PcDcp_Pdu_DelayReqBuilderImpl implements PnDcp_Pdu.PnDcp_PduBuilder {
private final int sequenceId;
private final long delayInNs;
private final MacAddress portMacAddress;
+ private final Long reservedField0;
+ private final Long reservedField1;
+ private final Long reservedField2;
+ private final Integer reservedField3;
public PcDcp_Pdu_DelayReqBuilderImpl(
- int sequenceId, long delayInNs, MacAddress portMacAddress) {
+ int sequenceId,
+ long delayInNs,
+ MacAddress portMacAddress,
+ Long reservedField0,
+ Long reservedField1,
+ Long reservedField2,
+ Integer reservedField3) {
this.sequenceId = sequenceId;
this.delayInNs = delayInNs;
this.portMacAddress = portMacAddress;
+ this.reservedField0 = reservedField0;
+ this.reservedField1 = reservedField1;
+ this.reservedField2 = reservedField2;
+ this.reservedField3 = reservedField3;
}
public PcDcp_Pdu_DelayReq build(int frameIdValue) {
PcDcp_Pdu_DelayReq pcDcp_Pdu_DelayReq =
new PcDcp_Pdu_DelayReq(frameIdValue, sequenceId, delayInNs, portMacAddress);
+ pcDcp_Pdu_DelayReq.reservedField0 = reservedField0;
+ pcDcp_Pdu_DelayReq.reservedField1 = reservedField1;
+ pcDcp_Pdu_DelayReq.reservedField2 = reservedField2;
+ pcDcp_Pdu_DelayReq.reservedField3 = reservedField3;
return pcDcp_Pdu_DelayReq;
}
}
diff --git a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnDcp_Block_DevicePropertiesAliasName.java b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnDcp_Block_DevicePropertiesAliasName.java
index 6a6f892b1ad..a6aad3b3386 100644
--- a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnDcp_Block_DevicePropertiesAliasName.java
+++ b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnDcp_Block_DevicePropertiesAliasName.java
@@ -49,9 +49,15 @@ public Short getSuboption() {
// Properties.
protected final byte[] aliasNameValue;
- public PnDcp_Block_DevicePropertiesAliasName(byte[] aliasNameValue) {
+ // Arguments.
+ protected final Integer blockLength;
+ // Reserved Fields
+ private Integer reservedField0;
+
+ public PnDcp_Block_DevicePropertiesAliasName(byte[] aliasNameValue, Integer blockLength) {
super();
this.aliasNameValue = aliasNameValue;
+ this.blockLength = blockLength;
}
public byte[] getAliasNameValue() {
@@ -65,7 +71,10 @@ protected void serializePnDcp_BlockChild(WriteBuffer writeBuffer) throws Seriali
writeBuffer.pushContext("PnDcp_Block_DevicePropertiesAliasName");
// Reserved Field (reserved)
- writeReservedField("reserved", (int) 0x0000, writeUnsignedInt(writeBuffer, 16));
+ writeReservedField(
+ "reserved",
+ reservedField0 != null ? reservedField0 : (int) 0x0000,
+ writeUnsignedInt(writeBuffer, 16));
// Array Field (aliasNameValue)
writeByteArrayField("aliasNameValue", aliasNameValue, writeByteArray(writeBuffer, 8));
@@ -136,20 +145,27 @@ public static PnDcp_BlockBuilder staticParsePnDcp_BlockBuilder(
readBuffer.closeContext("PnDcp_Block_DevicePropertiesAliasName");
// Create the instance
- return new PnDcp_Block_DevicePropertiesAliasNameBuilderImpl(aliasNameValue);
+ return new PnDcp_Block_DevicePropertiesAliasNameBuilderImpl(
+ aliasNameValue, blockLength, reservedField0);
}
public static class PnDcp_Block_DevicePropertiesAliasNameBuilderImpl
implements PnDcp_Block.PnDcp_BlockBuilder {
private final byte[] aliasNameValue;
+ private final Integer blockLength;
+ private final Integer reservedField0;
- public PnDcp_Block_DevicePropertiesAliasNameBuilderImpl(byte[] aliasNameValue) {
+ public PnDcp_Block_DevicePropertiesAliasNameBuilderImpl(
+ byte[] aliasNameValue, Integer blockLength, Integer reservedField0) {
this.aliasNameValue = aliasNameValue;
+ this.blockLength = blockLength;
+ this.reservedField0 = reservedField0;
}
public PnDcp_Block_DevicePropertiesAliasName build() {
PnDcp_Block_DevicePropertiesAliasName pnDcp_Block_DevicePropertiesAliasName =
- new PnDcp_Block_DevicePropertiesAliasName(aliasNameValue);
+ new PnDcp_Block_DevicePropertiesAliasName(aliasNameValue, blockLength);
+ pnDcp_Block_DevicePropertiesAliasName.reservedField0 = reservedField0;
return pnDcp_Block_DevicePropertiesAliasName;
}
}
diff --git a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnDcp_Block_DevicePropertiesDeviceId.java b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnDcp_Block_DevicePropertiesDeviceId.java
index c5678bd2435..f318219e05b 100644
--- a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnDcp_Block_DevicePropertiesDeviceId.java
+++ b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnDcp_Block_DevicePropertiesDeviceId.java
@@ -50,6 +50,9 @@ public Short getSuboption() {
protected final int vendorId;
protected final int deviceId;
+ // Reserved Fields
+ private Integer reservedField0;
+
public PnDcp_Block_DevicePropertiesDeviceId(int vendorId, int deviceId) {
super();
this.vendorId = vendorId;
@@ -71,7 +74,10 @@ protected void serializePnDcp_BlockChild(WriteBuffer writeBuffer) throws Seriali
writeBuffer.pushContext("PnDcp_Block_DevicePropertiesDeviceId");
// Reserved Field (reserved)
- writeReservedField("reserved", (int) 0x0000, writeUnsignedInt(writeBuffer, 16));
+ writeReservedField(
+ "reserved",
+ reservedField0 != null ? reservedField0 : (int) 0x0000,
+ writeUnsignedInt(writeBuffer, 16));
// Simple Field (vendorId)
writeSimpleField("vendorId", vendorId, writeUnsignedInt(writeBuffer, 16));
@@ -120,22 +126,26 @@ public static PnDcp_BlockBuilder staticParsePnDcp_BlockBuilder(ReadBuffer readBu
readBuffer.closeContext("PnDcp_Block_DevicePropertiesDeviceId");
// Create the instance
- return new PnDcp_Block_DevicePropertiesDeviceIdBuilderImpl(vendorId, deviceId);
+ return new PnDcp_Block_DevicePropertiesDeviceIdBuilderImpl(vendorId, deviceId, reservedField0);
}
public static class PnDcp_Block_DevicePropertiesDeviceIdBuilderImpl
implements PnDcp_Block.PnDcp_BlockBuilder {
private final int vendorId;
private final int deviceId;
+ private final Integer reservedField0;
- public PnDcp_Block_DevicePropertiesDeviceIdBuilderImpl(int vendorId, int deviceId) {
+ public PnDcp_Block_DevicePropertiesDeviceIdBuilderImpl(
+ int vendorId, int deviceId, Integer reservedField0) {
this.vendorId = vendorId;
this.deviceId = deviceId;
+ this.reservedField0 = reservedField0;
}
public PnDcp_Block_DevicePropertiesDeviceId build() {
PnDcp_Block_DevicePropertiesDeviceId pnDcp_Block_DevicePropertiesDeviceId =
new PnDcp_Block_DevicePropertiesDeviceId(vendorId, deviceId);
+ pnDcp_Block_DevicePropertiesDeviceId.reservedField0 = reservedField0;
return pnDcp_Block_DevicePropertiesDeviceId;
}
}
diff --git a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnDcp_Block_DevicePropertiesDeviceInstance.java b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnDcp_Block_DevicePropertiesDeviceInstance.java
index a94fe32d516..e15810cd4f5 100644
--- a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnDcp_Block_DevicePropertiesDeviceInstance.java
+++ b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnDcp_Block_DevicePropertiesDeviceInstance.java
@@ -50,6 +50,9 @@ public Short getSuboption() {
protected final short deviceInstanceHigh;
protected final short deviceInstanceLow;
+ // Reserved Fields
+ private Integer reservedField0;
+
public PnDcp_Block_DevicePropertiesDeviceInstance(
short deviceInstanceHigh, short deviceInstanceLow) {
super();
@@ -72,7 +75,10 @@ protected void serializePnDcp_BlockChild(WriteBuffer writeBuffer) throws Seriali
writeBuffer.pushContext("PnDcp_Block_DevicePropertiesDeviceInstance");
// Reserved Field (reserved)
- writeReservedField("reserved", (int) 0x0000, writeUnsignedInt(writeBuffer, 16));
+ writeReservedField(
+ "reserved",
+ reservedField0 != null ? reservedField0 : (int) 0x0000,
+ writeUnsignedInt(writeBuffer, 16));
// Simple Field (deviceInstanceHigh)
writeSimpleField("deviceInstanceHigh", deviceInstanceHigh, writeUnsignedShort(writeBuffer, 8));
@@ -124,23 +130,26 @@ public static PnDcp_BlockBuilder staticParsePnDcp_BlockBuilder(ReadBuffer readBu
readBuffer.closeContext("PnDcp_Block_DevicePropertiesDeviceInstance");
// Create the instance
return new PnDcp_Block_DevicePropertiesDeviceInstanceBuilderImpl(
- deviceInstanceHigh, deviceInstanceLow);
+ deviceInstanceHigh, deviceInstanceLow, reservedField0);
}
public static class PnDcp_Block_DevicePropertiesDeviceInstanceBuilderImpl
implements PnDcp_Block.PnDcp_BlockBuilder {
private final short deviceInstanceHigh;
private final short deviceInstanceLow;
+ private final Integer reservedField0;
public PnDcp_Block_DevicePropertiesDeviceInstanceBuilderImpl(
- short deviceInstanceHigh, short deviceInstanceLow) {
+ short deviceInstanceHigh, short deviceInstanceLow, Integer reservedField0) {
this.deviceInstanceHigh = deviceInstanceHigh;
this.deviceInstanceLow = deviceInstanceLow;
+ this.reservedField0 = reservedField0;
}
public PnDcp_Block_DevicePropertiesDeviceInstance build() {
PnDcp_Block_DevicePropertiesDeviceInstance pnDcp_Block_DevicePropertiesDeviceInstance =
new PnDcp_Block_DevicePropertiesDeviceInstance(deviceInstanceHigh, deviceInstanceLow);
+ pnDcp_Block_DevicePropertiesDeviceInstance.reservedField0 = reservedField0;
return pnDcp_Block_DevicePropertiesDeviceInstance;
}
}
diff --git a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnDcp_Block_DevicePropertiesDeviceOptions.java b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnDcp_Block_DevicePropertiesDeviceOptions.java
index 13d52de805c..d9f59b0e427 100644
--- a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnDcp_Block_DevicePropertiesDeviceOptions.java
+++ b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnDcp_Block_DevicePropertiesDeviceOptions.java
@@ -49,10 +49,16 @@ public Short getSuboption() {
// Properties.
protected final List supportedOptions;
+ // Arguments.
+ protected final Integer blockLength;
+ // Reserved Fields
+ private Integer reservedField0;
+
public PnDcp_Block_DevicePropertiesDeviceOptions(
- List supportedOptions) {
+ List supportedOptions, Integer blockLength) {
super();
this.supportedOptions = supportedOptions;
+ this.blockLength = blockLength;
}
public List getSupportedOptions() {
@@ -66,7 +72,10 @@ protected void serializePnDcp_BlockChild(WriteBuffer writeBuffer) throws Seriali
writeBuffer.pushContext("PnDcp_Block_DevicePropertiesDeviceOptions");
// Reserved Field (reserved)
- writeReservedField("reserved", (int) 0x0000, writeUnsignedInt(writeBuffer, 16));
+ writeReservedField(
+ "reserved",
+ reservedField0 != null ? reservedField0 : (int) 0x0000,
+ writeUnsignedInt(writeBuffer, 16));
// Array Field (supportedOptions)
writeComplexTypeArrayField("supportedOptions", supportedOptions, writeBuffer);
@@ -116,21 +125,29 @@ public static PnDcp_BlockBuilder staticParsePnDcp_BlockBuilder(
readBuffer.closeContext("PnDcp_Block_DevicePropertiesDeviceOptions");
// Create the instance
- return new PnDcp_Block_DevicePropertiesDeviceOptionsBuilderImpl(supportedOptions);
+ return new PnDcp_Block_DevicePropertiesDeviceOptionsBuilderImpl(
+ supportedOptions, blockLength, reservedField0);
}
public static class PnDcp_Block_DevicePropertiesDeviceOptionsBuilderImpl
implements PnDcp_Block.PnDcp_BlockBuilder {
private final List supportedOptions;
+ private final Integer blockLength;
+ private final Integer reservedField0;
public PnDcp_Block_DevicePropertiesDeviceOptionsBuilderImpl(
- List supportedOptions) {
+ List supportedOptions,
+ Integer blockLength,
+ Integer reservedField0) {
this.supportedOptions = supportedOptions;
+ this.blockLength = blockLength;
+ this.reservedField0 = reservedField0;
}
public PnDcp_Block_DevicePropertiesDeviceOptions build() {
PnDcp_Block_DevicePropertiesDeviceOptions pnDcp_Block_DevicePropertiesDeviceOptions =
- new PnDcp_Block_DevicePropertiesDeviceOptions(supportedOptions);
+ new PnDcp_Block_DevicePropertiesDeviceOptions(supportedOptions, blockLength);
+ pnDcp_Block_DevicePropertiesDeviceOptions.reservedField0 = reservedField0;
return pnDcp_Block_DevicePropertiesDeviceOptions;
}
}
diff --git a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnDcp_Block_DevicePropertiesDeviceRole.java b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnDcp_Block_DevicePropertiesDeviceRole.java
index c955af1260f..834e69db54c 100644
--- a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnDcp_Block_DevicePropertiesDeviceRole.java
+++ b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnDcp_Block_DevicePropertiesDeviceRole.java
@@ -52,6 +52,10 @@ public Short getSuboption() {
protected final boolean pnioController;
protected final boolean pnioDevice;
+ // Reserved Fields
+ private Long reservedField0;
+ private Short reservedField1;
+
public PnDcp_Block_DevicePropertiesDeviceRole(
boolean pnioSupervisor, boolean pnioMultidevive, boolean pnioController, boolean pnioDevice) {
super();
@@ -84,7 +88,10 @@ protected void serializePnDcp_BlockChild(WriteBuffer writeBuffer) throws Seriali
writeBuffer.pushContext("PnDcp_Block_DevicePropertiesDeviceRole");
// Reserved Field (reserved)
- writeReservedField("reserved", (long) 0x000000, writeUnsignedLong(writeBuffer, 20));
+ writeReservedField(
+ "reserved",
+ reservedField0 != null ? reservedField0 : (long) 0x000000,
+ writeUnsignedLong(writeBuffer, 20));
// Simple Field (pnioSupervisor)
writeSimpleField("pnioSupervisor", pnioSupervisor, writeBoolean(writeBuffer));
@@ -99,7 +106,10 @@ protected void serializePnDcp_BlockChild(WriteBuffer writeBuffer) throws Seriali
writeSimpleField("pnioDevice", pnioDevice, writeBoolean(writeBuffer));
// Reserved Field (reserved)
- writeReservedField("reserved", (short) 0x00, writeUnsignedShort(writeBuffer, 8));
+ writeReservedField(
+ "reserved",
+ reservedField1 != null ? reservedField1 : (short) 0x00,
+ writeUnsignedShort(writeBuffer, 8));
writeBuffer.popContext("PnDcp_Block_DevicePropertiesDeviceRole");
}
@@ -159,7 +169,12 @@ public static PnDcp_BlockBuilder staticParsePnDcp_BlockBuilder(ReadBuffer readBu
readBuffer.closeContext("PnDcp_Block_DevicePropertiesDeviceRole");
// Create the instance
return new PnDcp_Block_DevicePropertiesDeviceRoleBuilderImpl(
- pnioSupervisor, pnioMultidevive, pnioController, pnioDevice);
+ pnioSupervisor,
+ pnioMultidevive,
+ pnioController,
+ pnioDevice,
+ reservedField0,
+ reservedField1);
}
public static class PnDcp_Block_DevicePropertiesDeviceRoleBuilderImpl
@@ -168,22 +183,30 @@ public static class PnDcp_Block_DevicePropertiesDeviceRoleBuilderImpl
private final boolean pnioMultidevive;
private final boolean pnioController;
private final boolean pnioDevice;
+ private final Long reservedField0;
+ private final Short reservedField1;
public PnDcp_Block_DevicePropertiesDeviceRoleBuilderImpl(
boolean pnioSupervisor,
boolean pnioMultidevive,
boolean pnioController,
- boolean pnioDevice) {
+ boolean pnioDevice,
+ Long reservedField0,
+ Short reservedField1) {
this.pnioSupervisor = pnioSupervisor;
this.pnioMultidevive = pnioMultidevive;
this.pnioController = pnioController;
this.pnioDevice = pnioDevice;
+ this.reservedField0 = reservedField0;
+ this.reservedField1 = reservedField1;
}
public PnDcp_Block_DevicePropertiesDeviceRole build() {
PnDcp_Block_DevicePropertiesDeviceRole pnDcp_Block_DevicePropertiesDeviceRole =
new PnDcp_Block_DevicePropertiesDeviceRole(
pnioSupervisor, pnioMultidevive, pnioController, pnioDevice);
+ pnDcp_Block_DevicePropertiesDeviceRole.reservedField0 = reservedField0;
+ pnDcp_Block_DevicePropertiesDeviceRole.reservedField1 = reservedField1;
return pnDcp_Block_DevicePropertiesDeviceRole;
}
}
diff --git a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnDcp_Block_DevicePropertiesDeviceVendor.java b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnDcp_Block_DevicePropertiesDeviceVendor.java
index 98f8f44cada..f417e5a6870 100644
--- a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnDcp_Block_DevicePropertiesDeviceVendor.java
+++ b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnDcp_Block_DevicePropertiesDeviceVendor.java
@@ -49,9 +49,15 @@ public Short getSuboption() {
// Properties.
protected final byte[] deviceVendorValue;
- public PnDcp_Block_DevicePropertiesDeviceVendor(byte[] deviceVendorValue) {
+ // Arguments.
+ protected final Integer blockLength;
+ // Reserved Fields
+ private Integer reservedField0;
+
+ public PnDcp_Block_DevicePropertiesDeviceVendor(byte[] deviceVendorValue, Integer blockLength) {
super();
this.deviceVendorValue = deviceVendorValue;
+ this.blockLength = blockLength;
}
public byte[] getDeviceVendorValue() {
@@ -65,7 +71,10 @@ protected void serializePnDcp_BlockChild(WriteBuffer writeBuffer) throws Seriali
writeBuffer.pushContext("PnDcp_Block_DevicePropertiesDeviceVendor");
// Reserved Field (reserved)
- writeReservedField("reserved", (int) 0x0000, writeUnsignedInt(writeBuffer, 16));
+ writeReservedField(
+ "reserved",
+ reservedField0 != null ? reservedField0 : (int) 0x0000,
+ writeUnsignedInt(writeBuffer, 16));
// Array Field (deviceVendorValue)
writeByteArrayField("deviceVendorValue", deviceVendorValue, writeByteArray(writeBuffer, 8));
@@ -136,20 +145,27 @@ public static PnDcp_BlockBuilder staticParsePnDcp_BlockBuilder(
readBuffer.closeContext("PnDcp_Block_DevicePropertiesDeviceVendor");
// Create the instance
- return new PnDcp_Block_DevicePropertiesDeviceVendorBuilderImpl(deviceVendorValue);
+ return new PnDcp_Block_DevicePropertiesDeviceVendorBuilderImpl(
+ deviceVendorValue, blockLength, reservedField0);
}
public static class PnDcp_Block_DevicePropertiesDeviceVendorBuilderImpl
implements PnDcp_Block.PnDcp_BlockBuilder {
private final byte[] deviceVendorValue;
+ private final Integer blockLength;
+ private final Integer reservedField0;
- public PnDcp_Block_DevicePropertiesDeviceVendorBuilderImpl(byte[] deviceVendorValue) {
+ public PnDcp_Block_DevicePropertiesDeviceVendorBuilderImpl(
+ byte[] deviceVendorValue, Integer blockLength, Integer reservedField0) {
this.deviceVendorValue = deviceVendorValue;
+ this.blockLength = blockLength;
+ this.reservedField0 = reservedField0;
}
public PnDcp_Block_DevicePropertiesDeviceVendor build() {
PnDcp_Block_DevicePropertiesDeviceVendor pnDcp_Block_DevicePropertiesDeviceVendor =
- new PnDcp_Block_DevicePropertiesDeviceVendor(deviceVendorValue);
+ new PnDcp_Block_DevicePropertiesDeviceVendor(deviceVendorValue, blockLength);
+ pnDcp_Block_DevicePropertiesDeviceVendor.reservedField0 = reservedField0;
return pnDcp_Block_DevicePropertiesDeviceVendor;
}
}
diff --git a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnDcp_Block_DevicePropertiesNameOfStation.java b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnDcp_Block_DevicePropertiesNameOfStation.java
index c47738b218c..7a3226e372d 100644
--- a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnDcp_Block_DevicePropertiesNameOfStation.java
+++ b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnDcp_Block_DevicePropertiesNameOfStation.java
@@ -49,9 +49,13 @@ public Short getSuboption() {
// Properties.
protected final byte[] nameOfStation;
- public PnDcp_Block_DevicePropertiesNameOfStation(byte[] nameOfStation) {
+ // Arguments.
+ protected final Integer blockLength;
+
+ public PnDcp_Block_DevicePropertiesNameOfStation(byte[] nameOfStation, Integer blockLength) {
super();
this.nameOfStation = nameOfStation;
+ this.blockLength = blockLength;
}
public byte[] getNameOfStation() {
@@ -64,9 +68,6 @@ protected void serializePnDcp_BlockChild(WriteBuffer writeBuffer) throws Seriali
int startPos = positionAware.getPos();
writeBuffer.pushContext("PnDcp_Block_DevicePropertiesNameOfStation");
- // Reserved Field (reserved)
- writeReservedField("reserved", (int) 0x0000, writeUnsignedInt(writeBuffer, 16));
-
// Array Field (nameOfStation)
writeByteArrayField("nameOfStation", nameOfStation, writeByteArray(writeBuffer, 8));
@@ -93,9 +94,6 @@ public int getLengthInBits() {
int lengthInBits = super.getLengthInBits();
PnDcp_Block_DevicePropertiesNameOfStation _value = this;
- // Reserved Field (reserved)
- lengthInBits += 16;
-
// Array field
if (nameOfStation != null) {
lengthInBits += 8 * nameOfStation.length;
@@ -121,9 +119,6 @@ public static PnDcp_BlockBuilder staticParsePnDcp_BlockBuilder(
int startPos = positionAware.getPos();
int curPos;
- Integer reservedField0 =
- readReservedField("reserved", readUnsignedInt(readBuffer, 16), (int) 0x0000);
-
byte[] nameOfStation =
readBuffer.readByteArray("nameOfStation", Math.toIntExact((blockLength) - (2)));
@@ -136,20 +131,23 @@ public static PnDcp_BlockBuilder staticParsePnDcp_BlockBuilder(
readBuffer.closeContext("PnDcp_Block_DevicePropertiesNameOfStation");
// Create the instance
- return new PnDcp_Block_DevicePropertiesNameOfStationBuilderImpl(nameOfStation);
+ return new PnDcp_Block_DevicePropertiesNameOfStationBuilderImpl(nameOfStation, blockLength);
}
public static class PnDcp_Block_DevicePropertiesNameOfStationBuilderImpl
implements PnDcp_Block.PnDcp_BlockBuilder {
private final byte[] nameOfStation;
+ private final Integer blockLength;
- public PnDcp_Block_DevicePropertiesNameOfStationBuilderImpl(byte[] nameOfStation) {
+ public PnDcp_Block_DevicePropertiesNameOfStationBuilderImpl(
+ byte[] nameOfStation, Integer blockLength) {
this.nameOfStation = nameOfStation;
+ this.blockLength = blockLength;
}
public PnDcp_Block_DevicePropertiesNameOfStation build() {
PnDcp_Block_DevicePropertiesNameOfStation pnDcp_Block_DevicePropertiesNameOfStation =
- new PnDcp_Block_DevicePropertiesNameOfStation(nameOfStation);
+ new PnDcp_Block_DevicePropertiesNameOfStation(nameOfStation, blockLength);
return pnDcp_Block_DevicePropertiesNameOfStation;
}
}
diff --git a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnDcp_Block_IpMacAddress.java b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnDcp_Block_IpMacAddress.java
index e75462f6ad4..b068ba35361 100644
--- a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnDcp_Block_IpMacAddress.java
+++ b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnDcp_Block_IpMacAddress.java
@@ -49,6 +49,9 @@ public Short getSuboption() {
// Properties.
protected final MacAddress macAddress;
+ // Reserved Fields
+ private Integer reservedField0;
+
public PnDcp_Block_IpMacAddress(MacAddress macAddress) {
super();
this.macAddress = macAddress;
@@ -65,7 +68,10 @@ protected void serializePnDcp_BlockChild(WriteBuffer writeBuffer) throws Seriali
writeBuffer.pushContext("PnDcp_Block_IpMacAddress");
// Reserved Field (reserved)
- writeReservedField("reserved", (int) 0x0000, writeUnsignedInt(writeBuffer, 16));
+ writeReservedField(
+ "reserved",
+ reservedField0 != null ? reservedField0 : (int) 0x0000,
+ writeUnsignedInt(writeBuffer, 16));
// Simple Field (macAddress)
writeSimpleField("macAddress", macAddress, new DataWriterComplexDefault<>(writeBuffer));
@@ -109,19 +115,22 @@ public static PnDcp_BlockBuilder staticParsePnDcp_BlockBuilder(ReadBuffer readBu
readBuffer.closeContext("PnDcp_Block_IpMacAddress");
// Create the instance
- return new PnDcp_Block_IpMacAddressBuilderImpl(macAddress);
+ return new PnDcp_Block_IpMacAddressBuilderImpl(macAddress, reservedField0);
}
public static class PnDcp_Block_IpMacAddressBuilderImpl
implements PnDcp_Block.PnDcp_BlockBuilder {
private final MacAddress macAddress;
+ private final Integer reservedField0;
- public PnDcp_Block_IpMacAddressBuilderImpl(MacAddress macAddress) {
+ public PnDcp_Block_IpMacAddressBuilderImpl(MacAddress macAddress, Integer reservedField0) {
this.macAddress = macAddress;
+ this.reservedField0 = reservedField0;
}
public PnDcp_Block_IpMacAddress build() {
PnDcp_Block_IpMacAddress pnDcp_Block_IpMacAddress = new PnDcp_Block_IpMacAddress(macAddress);
+ pnDcp_Block_IpMacAddress.reservedField0 = reservedField0;
return pnDcp_Block_IpMacAddress;
}
}
diff --git a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnDcp_Block_IpParameter.java b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnDcp_Block_IpParameter.java
index 1b20d6ae94c..10512ae5800 100644
--- a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnDcp_Block_IpParameter.java
+++ b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnDcp_Block_IpParameter.java
@@ -54,6 +54,10 @@ public Short getSuboption() {
protected final byte[] subnetMask;
protected final byte[] standardGateway;
+ // Reserved Fields
+ private Short reservedField0;
+ private Short reservedField1;
+
public PnDcp_Block_IpParameter(
boolean ipConflictDetected,
boolean setViaDhcp,
@@ -101,13 +105,19 @@ protected void serializePnDcp_BlockChild(WriteBuffer writeBuffer) throws Seriali
writeBuffer.pushContext("PnDcp_Block_IpParameter");
// Reserved Field (reserved)
- writeReservedField("reserved", (short) 0x00, writeUnsignedShort(writeBuffer, 8));
+ writeReservedField(
+ "reserved",
+ reservedField0 != null ? reservedField0 : (short) 0x00,
+ writeUnsignedShort(writeBuffer, 8));
// Simple Field (ipConflictDetected)
writeSimpleField("ipConflictDetected", ipConflictDetected, writeBoolean(writeBuffer));
// Reserved Field (reserved)
- writeReservedField("reserved", (short) 0x00, writeUnsignedShort(writeBuffer, 5));
+ writeReservedField(
+ "reserved",
+ reservedField1 != null ? reservedField1 : (short) 0x00,
+ writeUnsignedShort(writeBuffer, 5));
// Simple Field (setViaDhcp)
writeSimpleField("setViaDhcp", setViaDhcp, writeBoolean(writeBuffer));
@@ -198,7 +208,14 @@ public static PnDcp_BlockBuilder staticParsePnDcp_BlockBuilder(ReadBuffer readBu
readBuffer.closeContext("PnDcp_Block_IpParameter");
// Create the instance
return new PnDcp_Block_IpParameterBuilderImpl(
- ipConflictDetected, setViaDhcp, setManually, ipAddress, subnetMask, standardGateway);
+ ipConflictDetected,
+ setViaDhcp,
+ setManually,
+ ipAddress,
+ subnetMask,
+ standardGateway,
+ reservedField0,
+ reservedField1);
}
public static class PnDcp_Block_IpParameterBuilderImpl implements PnDcp_Block.PnDcp_BlockBuilder {
@@ -208,6 +225,8 @@ public static class PnDcp_Block_IpParameterBuilderImpl implements PnDcp_Block.Pn
private final byte[] ipAddress;
private final byte[] subnetMask;
private final byte[] standardGateway;
+ private final Short reservedField0;
+ private final Short reservedField1;
public PnDcp_Block_IpParameterBuilderImpl(
boolean ipConflictDetected,
@@ -215,19 +234,25 @@ public PnDcp_Block_IpParameterBuilderImpl(
boolean setManually,
byte[] ipAddress,
byte[] subnetMask,
- byte[] standardGateway) {
+ byte[] standardGateway,
+ Short reservedField0,
+ Short reservedField1) {
this.ipConflictDetected = ipConflictDetected;
this.setViaDhcp = setViaDhcp;
this.setManually = setManually;
this.ipAddress = ipAddress;
this.subnetMask = subnetMask;
this.standardGateway = standardGateway;
+ this.reservedField0 = reservedField0;
+ this.reservedField1 = reservedField1;
}
public PnDcp_Block_IpParameter build() {
PnDcp_Block_IpParameter pnDcp_Block_IpParameter =
new PnDcp_Block_IpParameter(
ipConflictDetected, setViaDhcp, setManually, ipAddress, subnetMask, standardGateway);
+ pnDcp_Block_IpParameter.reservedField0 = reservedField0;
+ pnDcp_Block_IpParameter.reservedField1 = reservedField1;
return pnDcp_Block_IpParameter;
}
}
diff --git a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnDcp_Pdu.java b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnDcp_Pdu.java
index e8e50751023..4e0e665039f 100644
--- a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnDcp_Pdu.java
+++ b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnDcp_Pdu.java
@@ -121,6 +121,8 @@ public static PnDcp_Pdu staticParse(ReadBuffer readBuffer) throws ParseException
builder = PnDcp_Pdu_RealTimeCyclic.staticParsePnDcp_PduBuilder(readBuffer);
} else if (EvaluationHelper.equals(frameId, PnDcp_FrameId.PTCP_DelayReqPDU)) {
builder = PcDcp_Pdu_DelayReq.staticParsePnDcp_PduBuilder(readBuffer);
+ } else if (EvaluationHelper.equals(frameId, PnDcp_FrameId.Alarm_Low)) {
+ builder = PnDcp_Pdu_AlarmLow.staticParsePnDcp_PduBuilder(readBuffer);
} else if (EvaluationHelper.equals(frameId, PnDcp_FrameId.DCP_Identify_ReqPDU)) {
builder = PnDcp_Pdu_IdentifyReq.staticParsePnDcp_PduBuilder(readBuffer);
} else if (EvaluationHelper.equals(frameId, PnDcp_FrameId.DCP_Identify_ResPDU)) {
diff --git a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnDcp_Pdu_AlarmLow.java b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnDcp_Pdu_AlarmLow.java
new file mode 100644
index 00000000000..336f95fcd3e
--- /dev/null
+++ b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnDcp_Pdu_AlarmLow.java
@@ -0,0 +1,335 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.plc4x.java.profinet.readwrite;
+
+import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*;
+import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*;
+import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*;
+import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*;
+import static org.apache.plc4x.java.spi.generation.StaticHelper.*;
+
+import java.time.*;
+import java.util.*;
+import org.apache.plc4x.java.api.exceptions.*;
+import org.apache.plc4x.java.api.value.*;
+import org.apache.plc4x.java.spi.codegen.*;
+import org.apache.plc4x.java.spi.codegen.fields.*;
+import org.apache.plc4x.java.spi.codegen.io.*;
+import org.apache.plc4x.java.spi.generation.*;
+
+// Code generated by code-generation. DO NOT EDIT.
+
+public class PnDcp_Pdu_AlarmLow extends PnDcp_Pdu implements Message {
+
+ // Accessors for discriminator values.
+
+ // Properties.
+ protected final int alarmDstEndpoint;
+ protected final int alarmSrcEndpoint;
+ protected final byte version;
+ protected final byte errorType;
+ protected final byte tAck;
+ protected final byte windowSize;
+ protected final int senSeqNum;
+ protected final int ackSeqNum;
+ protected final byte[] varPart;
+
+ public PnDcp_Pdu_AlarmLow(
+ int frameIdValue,
+ int alarmDstEndpoint,
+ int alarmSrcEndpoint,
+ byte version,
+ byte errorType,
+ byte tAck,
+ byte windowSize,
+ int senSeqNum,
+ int ackSeqNum,
+ byte[] varPart) {
+ super(frameIdValue);
+ this.alarmDstEndpoint = alarmDstEndpoint;
+ this.alarmSrcEndpoint = alarmSrcEndpoint;
+ this.version = version;
+ this.errorType = errorType;
+ this.tAck = tAck;
+ this.windowSize = windowSize;
+ this.senSeqNum = senSeqNum;
+ this.ackSeqNum = ackSeqNum;
+ this.varPart = varPart;
+ }
+
+ public int getAlarmDstEndpoint() {
+ return alarmDstEndpoint;
+ }
+
+ public int getAlarmSrcEndpoint() {
+ return alarmSrcEndpoint;
+ }
+
+ public byte getVersion() {
+ return version;
+ }
+
+ public byte getErrorType() {
+ return errorType;
+ }
+
+ public byte getTAck() {
+ return tAck;
+ }
+
+ public byte getWindowSize() {
+ return windowSize;
+ }
+
+ public int getSenSeqNum() {
+ return senSeqNum;
+ }
+
+ public int getAckSeqNum() {
+ return ackSeqNum;
+ }
+
+ public byte[] getVarPart() {
+ return varPart;
+ }
+
+ @Override
+ protected void serializePnDcp_PduChild(WriteBuffer writeBuffer) throws SerializationException {
+ PositionAware positionAware = writeBuffer;
+ int startPos = positionAware.getPos();
+ writeBuffer.pushContext("PnDcp_Pdu_AlarmLow");
+
+ // Simple Field (alarmDstEndpoint)
+ writeSimpleField("alarmDstEndpoint", alarmDstEndpoint, writeUnsignedInt(writeBuffer, 16));
+
+ // Simple Field (alarmSrcEndpoint)
+ writeSimpleField("alarmSrcEndpoint", alarmSrcEndpoint, writeUnsignedInt(writeBuffer, 16));
+
+ // Simple Field (version)
+ writeSimpleField("version", version, writeUnsignedByte(writeBuffer, 4));
+
+ // Simple Field (errorType)
+ writeSimpleField("errorType", errorType, writeUnsignedByte(writeBuffer, 4));
+
+ // Simple Field (tAck)
+ writeSimpleField("tAck", tAck, writeUnsignedByte(writeBuffer, 4));
+
+ // Simple Field (windowSize)
+ writeSimpleField("windowSize", windowSize, writeUnsignedByte(writeBuffer, 4));
+
+ // Simple Field (senSeqNum)
+ writeSimpleField("senSeqNum", senSeqNum, writeUnsignedInt(writeBuffer, 16));
+
+ // Simple Field (ackSeqNum)
+ writeSimpleField("ackSeqNum", ackSeqNum, writeUnsignedInt(writeBuffer, 16));
+
+ // Implicit Field (varPartLen) (Used for parsing, but its value is not stored as it's implicitly
+ // given by the objects content)
+ int varPartLen = (int) (COUNT(getVarPart()));
+ writeImplicitField("varPartLen", varPartLen, writeUnsignedInt(writeBuffer, 16));
+
+ // Array Field (varPart)
+ writeByteArrayField("varPart", varPart, writeByteArray(writeBuffer, 8));
+
+ writeBuffer.popContext("PnDcp_Pdu_AlarmLow");
+ }
+
+ @Override
+ public int getLengthInBytes() {
+ return (int) Math.ceil((float) getLengthInBits() / 8.0);
+ }
+
+ @Override
+ public int getLengthInBits() {
+ int lengthInBits = super.getLengthInBits();
+ PnDcp_Pdu_AlarmLow _value = this;
+
+ // Simple field (alarmDstEndpoint)
+ lengthInBits += 16;
+
+ // Simple field (alarmSrcEndpoint)
+ lengthInBits += 16;
+
+ // Simple field (version)
+ lengthInBits += 4;
+
+ // Simple field (errorType)
+ lengthInBits += 4;
+
+ // Simple field (tAck)
+ lengthInBits += 4;
+
+ // Simple field (windowSize)
+ lengthInBits += 4;
+
+ // Simple field (senSeqNum)
+ lengthInBits += 16;
+
+ // Simple field (ackSeqNum)
+ lengthInBits += 16;
+
+ // Implicit Field (varPartLen)
+ lengthInBits += 16;
+
+ // Array field
+ if (varPart != null) {
+ lengthInBits += 8 * varPart.length;
+ }
+
+ return lengthInBits;
+ }
+
+ public static PnDcp_PduBuilder staticParsePnDcp_PduBuilder(ReadBuffer readBuffer)
+ throws ParseException {
+ readBuffer.pullContext("PnDcp_Pdu_AlarmLow");
+ PositionAware positionAware = readBuffer;
+ int startPos = positionAware.getPos();
+ int curPos;
+
+ int alarmDstEndpoint = readSimpleField("alarmDstEndpoint", readUnsignedInt(readBuffer, 16));
+
+ int alarmSrcEndpoint = readSimpleField("alarmSrcEndpoint", readUnsignedInt(readBuffer, 16));
+
+ byte version = readSimpleField("version", readUnsignedByte(readBuffer, 4));
+
+ byte errorType = readSimpleField("errorType", readUnsignedByte(readBuffer, 4));
+
+ byte tAck = readSimpleField("tAck", readUnsignedByte(readBuffer, 4));
+
+ byte windowSize = readSimpleField("windowSize", readUnsignedByte(readBuffer, 4));
+
+ int senSeqNum = readSimpleField("senSeqNum", readUnsignedInt(readBuffer, 16));
+
+ int ackSeqNum = readSimpleField("ackSeqNum", readUnsignedInt(readBuffer, 16));
+
+ int varPartLen = readImplicitField("varPartLen", readUnsignedInt(readBuffer, 16));
+
+ byte[] varPart = readBuffer.readByteArray("varPart", Math.toIntExact(varPartLen));
+
+ readBuffer.closeContext("PnDcp_Pdu_AlarmLow");
+ // Create the instance
+ return new PnDcp_Pdu_AlarmLowBuilderImpl(
+ alarmDstEndpoint,
+ alarmSrcEndpoint,
+ version,
+ errorType,
+ tAck,
+ windowSize,
+ senSeqNum,
+ ackSeqNum,
+ varPart);
+ }
+
+ public static class PnDcp_Pdu_AlarmLowBuilderImpl implements PnDcp_Pdu.PnDcp_PduBuilder {
+ private final int alarmDstEndpoint;
+ private final int alarmSrcEndpoint;
+ private final byte version;
+ private final byte errorType;
+ private final byte tAck;
+ private final byte windowSize;
+ private final int senSeqNum;
+ private final int ackSeqNum;
+ private final byte[] varPart;
+
+ public PnDcp_Pdu_AlarmLowBuilderImpl(
+ int alarmDstEndpoint,
+ int alarmSrcEndpoint,
+ byte version,
+ byte errorType,
+ byte tAck,
+ byte windowSize,
+ int senSeqNum,
+ int ackSeqNum,
+ byte[] varPart) {
+ this.alarmDstEndpoint = alarmDstEndpoint;
+ this.alarmSrcEndpoint = alarmSrcEndpoint;
+ this.version = version;
+ this.errorType = errorType;
+ this.tAck = tAck;
+ this.windowSize = windowSize;
+ this.senSeqNum = senSeqNum;
+ this.ackSeqNum = ackSeqNum;
+ this.varPart = varPart;
+ }
+
+ public PnDcp_Pdu_AlarmLow build(int frameIdValue) {
+ PnDcp_Pdu_AlarmLow pnDcp_Pdu_AlarmLow =
+ new PnDcp_Pdu_AlarmLow(
+ frameIdValue,
+ alarmDstEndpoint,
+ alarmSrcEndpoint,
+ version,
+ errorType,
+ tAck,
+ windowSize,
+ senSeqNum,
+ ackSeqNum,
+ varPart);
+ return pnDcp_Pdu_AlarmLow;
+ }
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (!(o instanceof PnDcp_Pdu_AlarmLow)) {
+ return false;
+ }
+ PnDcp_Pdu_AlarmLow that = (PnDcp_Pdu_AlarmLow) o;
+ return (getAlarmDstEndpoint() == that.getAlarmDstEndpoint())
+ && (getAlarmSrcEndpoint() == that.getAlarmSrcEndpoint())
+ && (getVersion() == that.getVersion())
+ && (getErrorType() == that.getErrorType())
+ && (getTAck() == that.getTAck())
+ && (getWindowSize() == that.getWindowSize())
+ && (getSenSeqNum() == that.getSenSeqNum())
+ && (getAckSeqNum() == that.getAckSeqNum())
+ && (getVarPart() == that.getVarPart())
+ && super.equals(that)
+ && true;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(
+ super.hashCode(),
+ getAlarmDstEndpoint(),
+ getAlarmSrcEndpoint(),
+ getVersion(),
+ getErrorType(),
+ getTAck(),
+ getWindowSize(),
+ getSenSeqNum(),
+ getAckSeqNum(),
+ getVarPart());
+ }
+
+ @Override
+ public String toString() {
+ WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true);
+ try {
+ writeBufferBoxBased.writeSerializable(this);
+ } catch (SerializationException e) {
+ throw new RuntimeException(e);
+ }
+ return "\n" + writeBufferBoxBased.getBox().toString() + "\n";
+ }
+}
diff --git a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnDcp_Pdu_IdentifyReq.java b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnDcp_Pdu_IdentifyReq.java
index e34bdefa61f..6a768433f9e 100644
--- a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnDcp_Pdu_IdentifyReq.java
+++ b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnDcp_Pdu_IdentifyReq.java
@@ -49,6 +49,10 @@ public class PnDcp_Pdu_IdentifyReq extends PnDcp_Pdu implements Message {
protected final int responseDelay;
protected final List blocks;
+ // Reserved Fields
+ private Short reservedField0;
+ private Byte reservedField1;
+
public PnDcp_Pdu_IdentifyReq(
int frameIdValue, long xid, int responseDelay, List blocks) {
super(frameIdValue);
@@ -91,13 +95,19 @@ protected void serializePnDcp_PduChild(WriteBuffer writeBuffer) throws Serializa
writeConstField("serviceId", SERVICEID, writeUnsignedShort(writeBuffer, 8));
// Reserved Field (reserved)
- writeReservedField("reserved", (short) 0x00, writeUnsignedShort(writeBuffer, 5));
+ writeReservedField(
+ "reserved",
+ reservedField0 != null ? reservedField0 : (short) 0x00,
+ writeUnsignedShort(writeBuffer, 5));
// Const Field (notSupported)
writeConstField("notSupported", NOTSUPPORTED, writeBoolean(writeBuffer));
// Reserved Field (reserved)
- writeReservedField("reserved", (byte) 0x00, writeUnsignedByte(writeBuffer, 1));
+ writeReservedField(
+ "reserved",
+ reservedField1 != null ? reservedField1 : (byte) 0x00,
+ writeUnsignedByte(writeBuffer, 1));
// Const Field (response)
writeConstField("response", RESPONSE, writeBoolean(writeBuffer));
@@ -200,23 +210,35 @@ public static PnDcp_PduBuilder staticParsePnDcp_PduBuilder(ReadBuffer readBuffer
readBuffer.closeContext("PnDcp_Pdu_IdentifyReq");
// Create the instance
- return new PnDcp_Pdu_IdentifyReqBuilderImpl(xid, responseDelay, blocks);
+ return new PnDcp_Pdu_IdentifyReqBuilderImpl(
+ xid, responseDelay, blocks, reservedField0, reservedField1);
}
public static class PnDcp_Pdu_IdentifyReqBuilderImpl implements PnDcp_Pdu.PnDcp_PduBuilder {
private final long xid;
private final int responseDelay;
private final List blocks;
-
- public PnDcp_Pdu_IdentifyReqBuilderImpl(long xid, int responseDelay, List blocks) {
+ private final Short reservedField0;
+ private final Byte reservedField1;
+
+ public PnDcp_Pdu_IdentifyReqBuilderImpl(
+ long xid,
+ int responseDelay,
+ List blocks,
+ Short reservedField0,
+ Byte reservedField1) {
this.xid = xid;
this.responseDelay = responseDelay;
this.blocks = blocks;
+ this.reservedField0 = reservedField0;
+ this.reservedField1 = reservedField1;
}
public PnDcp_Pdu_IdentifyReq build(int frameIdValue) {
PnDcp_Pdu_IdentifyReq pnDcp_Pdu_IdentifyReq =
new PnDcp_Pdu_IdentifyReq(frameIdValue, xid, responseDelay, blocks);
+ pnDcp_Pdu_IdentifyReq.reservedField0 = reservedField0;
+ pnDcp_Pdu_IdentifyReq.reservedField1 = reservedField1;
return pnDcp_Pdu_IdentifyReq;
}
}
diff --git a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnDcp_Pdu_IdentifyRes.java b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnDcp_Pdu_IdentifyRes.java
index 01403012984..9b9bb6d0920 100644
--- a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnDcp_Pdu_IdentifyRes.java
+++ b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnDcp_Pdu_IdentifyRes.java
@@ -48,6 +48,11 @@ public class PnDcp_Pdu_IdentifyRes extends PnDcp_Pdu implements Message {
protected final long xid;
protected final List blocks;
+ // Reserved Fields
+ private Short reservedField0;
+ private Byte reservedField1;
+ private Integer reservedField2;
+
public PnDcp_Pdu_IdentifyRes(
int frameIdValue, boolean notSupported, long xid, List blocks) {
super(frameIdValue);
@@ -86,13 +91,19 @@ protected void serializePnDcp_PduChild(WriteBuffer writeBuffer) throws Serializa
writeConstField("serviceId", SERVICEID, writeUnsignedShort(writeBuffer, 8));
// Reserved Field (reserved)
- writeReservedField("reserved", (short) 0x00, writeUnsignedShort(writeBuffer, 5));
+ writeReservedField(
+ "reserved",
+ reservedField0 != null ? reservedField0 : (short) 0x00,
+ writeUnsignedShort(writeBuffer, 5));
// Simple Field (notSupported)
writeSimpleField("notSupported", notSupported, writeBoolean(writeBuffer));
// Reserved Field (reserved)
- writeReservedField("reserved", (byte) 0x00, writeUnsignedByte(writeBuffer, 1));
+ writeReservedField(
+ "reserved",
+ reservedField1 != null ? reservedField1 : (byte) 0x00,
+ writeUnsignedByte(writeBuffer, 1));
// Const Field (response)
writeConstField("response", RESPONSE, writeBoolean(writeBuffer));
@@ -101,7 +112,10 @@ protected void serializePnDcp_PduChild(WriteBuffer writeBuffer) throws Serializa
writeSimpleField("xid", xid, writeUnsignedLong(writeBuffer, 32));
// Reserved Field (reserved)
- writeReservedField("reserved", (int) 0x0000, writeUnsignedInt(writeBuffer, 16));
+ writeReservedField(
+ "reserved",
+ reservedField2 != null ? reservedField2 : (int) 0x0000,
+ writeUnsignedInt(writeBuffer, 16));
// Implicit Field (dcpDataLength) (Used for parsing, but its value is not stored as it's
// implicitly given by the objects content)
@@ -195,24 +209,39 @@ public static PnDcp_PduBuilder staticParsePnDcp_PduBuilder(ReadBuffer readBuffer
readBuffer.closeContext("PnDcp_Pdu_IdentifyRes");
// Create the instance
- return new PnDcp_Pdu_IdentifyResBuilderImpl(notSupported, xid, blocks);
+ return new PnDcp_Pdu_IdentifyResBuilderImpl(
+ notSupported, xid, blocks, reservedField0, reservedField1, reservedField2);
}
public static class PnDcp_Pdu_IdentifyResBuilderImpl implements PnDcp_Pdu.PnDcp_PduBuilder {
private final boolean notSupported;
private final long xid;
private final List blocks;
+ private final Short reservedField0;
+ private final Byte reservedField1;
+ private final Integer reservedField2;
public PnDcp_Pdu_IdentifyResBuilderImpl(
- boolean notSupported, long xid, List blocks) {
+ boolean notSupported,
+ long xid,
+ List blocks,
+ Short reservedField0,
+ Byte reservedField1,
+ Integer reservedField2) {
this.notSupported = notSupported;
this.xid = xid;
this.blocks = blocks;
+ this.reservedField0 = reservedField0;
+ this.reservedField1 = reservedField1;
+ this.reservedField2 = reservedField2;
}
public PnDcp_Pdu_IdentifyRes build(int frameIdValue) {
PnDcp_Pdu_IdentifyRes pnDcp_Pdu_IdentifyRes =
new PnDcp_Pdu_IdentifyRes(frameIdValue, notSupported, xid, blocks);
+ pnDcp_Pdu_IdentifyRes.reservedField0 = reservedField0;
+ pnDcp_Pdu_IdentifyRes.reservedField1 = reservedField1;
+ pnDcp_Pdu_IdentifyRes.reservedField2 = reservedField2;
return pnDcp_Pdu_IdentifyRes;
}
}
diff --git a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnDcp_Pdu_RealTimeCyclic.java b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnDcp_Pdu_RealTimeCyclic.java
index 0ec5aab298f..1acea8a6386 100644
--- a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnDcp_Pdu_RealTimeCyclic.java
+++ b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnDcp_Pdu_RealTimeCyclic.java
@@ -40,6 +40,7 @@ public class PnDcp_Pdu_RealTimeCyclic extends PnDcp_Pdu implements Message {
// Accessors for discriminator values.
// Properties.
+ protected final PnIo_CyclicServiceDataUnit dataUnit;
protected final int cycleCounter;
protected final boolean ignore;
protected final boolean stationProblemIndicatorOk;
@@ -48,8 +49,14 @@ public class PnDcp_Pdu_RealTimeCyclic extends PnDcp_Pdu implements Message {
protected final boolean redundancy;
protected final boolean statePrimary;
+ // Reserved Fields
+ private Boolean reservedField0;
+ private Boolean reservedField1;
+ private Short reservedField2;
+
public PnDcp_Pdu_RealTimeCyclic(
int frameIdValue,
+ PnIo_CyclicServiceDataUnit dataUnit,
int cycleCounter,
boolean ignore,
boolean stationProblemIndicatorOk,
@@ -58,6 +65,7 @@ public PnDcp_Pdu_RealTimeCyclic(
boolean redundancy,
boolean statePrimary) {
super(frameIdValue);
+ this.dataUnit = dataUnit;
this.cycleCounter = cycleCounter;
this.ignore = ignore;
this.stationProblemIndicatorOk = stationProblemIndicatorOk;
@@ -67,6 +75,10 @@ public PnDcp_Pdu_RealTimeCyclic(
this.statePrimary = statePrimary;
}
+ public PnIo_CyclicServiceDataUnit getDataUnit() {
+ return dataUnit;
+ }
+
public int getCycleCounter() {
return cycleCounter;
}
@@ -101,6 +113,14 @@ protected void serializePnDcp_PduChild(WriteBuffer writeBuffer) throws Serializa
int startPos = positionAware.getPos();
writeBuffer.pushContext("PnDcp_Pdu_RealTimeCyclic");
+ // Manual Field (dataUnit)
+ writeManualField(
+ "dataUnit",
+ () ->
+ org.apache.plc4x.java.profinet.readwrite.utils.StaticHelper.writeDataUnit(
+ writeBuffer, dataUnit),
+ writeBuffer);
+
// Simple Field (cycleCounter)
writeSimpleField("cycleCounter", cycleCounter, writeUnsignedInt(writeBuffer, 16));
@@ -108,7 +128,10 @@ protected void serializePnDcp_PduChild(WriteBuffer writeBuffer) throws Serializa
writeSimpleField("ignore", ignore, writeBoolean(writeBuffer));
// Reserved Field (reserved)
- writeReservedField("reserved", (boolean) false, writeBoolean(writeBuffer));
+ writeReservedField(
+ "reserved",
+ reservedField0 != null ? reservedField0 : (boolean) false,
+ writeBoolean(writeBuffer));
// Simple Field (stationProblemIndicatorOk)
writeSimpleField(
@@ -118,7 +141,10 @@ protected void serializePnDcp_PduChild(WriteBuffer writeBuffer) throws Serializa
writeSimpleField("providerStateRun", providerStateRun, writeBoolean(writeBuffer));
// Reserved Field (reserved)
- writeReservedField("reserved", (boolean) false, writeBoolean(writeBuffer));
+ writeReservedField(
+ "reserved",
+ reservedField1 != null ? reservedField1 : (boolean) false,
+ writeBoolean(writeBuffer));
// Simple Field (dataValid)
writeSimpleField("dataValid", dataValid, writeBoolean(writeBuffer));
@@ -130,7 +156,10 @@ protected void serializePnDcp_PduChild(WriteBuffer writeBuffer) throws Serializa
writeSimpleField("statePrimary", statePrimary, writeBoolean(writeBuffer));
// Reserved Field (reserved)
- writeReservedField("reserved", (short) 0x00, writeUnsignedShort(writeBuffer, 8));
+ writeReservedField(
+ "reserved",
+ reservedField2 != null ? reservedField2 : (short) 0x00,
+ writeUnsignedShort(writeBuffer, 8));
writeBuffer.popContext("PnDcp_Pdu_RealTimeCyclic");
}
@@ -145,6 +174,9 @@ public int getLengthInBits() {
int lengthInBits = super.getLengthInBits();
PnDcp_Pdu_RealTimeCyclic _value = this;
+ // Manual Field (dataUnit)
+ lengthInBits += ((dataUnit.getLengthInBytes())) * (8);
+
// Simple field (cycleCounter)
lengthInBits += 16;
@@ -185,6 +217,15 @@ public static PnDcp_PduBuilder staticParsePnDcp_PduBuilder(ReadBuffer readBuffer
int startPos = positionAware.getPos();
int curPos;
+ PnIo_CyclicServiceDataUnit dataUnit =
+ readManualField(
+ "dataUnit",
+ readBuffer,
+ () ->
+ (PnIo_CyclicServiceDataUnit)
+ (org.apache.plc4x.java.profinet.readwrite.utils.StaticHelper.readDataUnit(
+ readBuffer)));
+
int cycleCounter = readSimpleField("cycleCounter", readUnsignedInt(readBuffer, 16));
boolean ignore = readSimpleField("ignore", readBoolean(readBuffer));
@@ -212,16 +253,21 @@ public static PnDcp_PduBuilder staticParsePnDcp_PduBuilder(ReadBuffer readBuffer
readBuffer.closeContext("PnDcp_Pdu_RealTimeCyclic");
// Create the instance
return new PnDcp_Pdu_RealTimeCyclicBuilderImpl(
+ dataUnit,
cycleCounter,
ignore,
stationProblemIndicatorOk,
providerStateRun,
dataValid,
redundancy,
- statePrimary);
+ statePrimary,
+ reservedField0,
+ reservedField1,
+ reservedField2);
}
public static class PnDcp_Pdu_RealTimeCyclicBuilderImpl implements PnDcp_Pdu.PnDcp_PduBuilder {
+ private final PnIo_CyclicServiceDataUnit dataUnit;
private final int cycleCounter;
private final boolean ignore;
private final boolean stationProblemIndicatorOk;
@@ -229,15 +275,23 @@ public static class PnDcp_Pdu_RealTimeCyclicBuilderImpl implements PnDcp_Pdu.PnD
private final boolean dataValid;
private final boolean redundancy;
private final boolean statePrimary;
+ private final Boolean reservedField0;
+ private final Boolean reservedField1;
+ private final Short reservedField2;
public PnDcp_Pdu_RealTimeCyclicBuilderImpl(
+ PnIo_CyclicServiceDataUnit dataUnit,
int cycleCounter,
boolean ignore,
boolean stationProblemIndicatorOk,
boolean providerStateRun,
boolean dataValid,
boolean redundancy,
- boolean statePrimary) {
+ boolean statePrimary,
+ Boolean reservedField0,
+ Boolean reservedField1,
+ Short reservedField2) {
+ this.dataUnit = dataUnit;
this.cycleCounter = cycleCounter;
this.ignore = ignore;
this.stationProblemIndicatorOk = stationProblemIndicatorOk;
@@ -245,12 +299,16 @@ public PnDcp_Pdu_RealTimeCyclicBuilderImpl(
this.dataValid = dataValid;
this.redundancy = redundancy;
this.statePrimary = statePrimary;
+ this.reservedField0 = reservedField0;
+ this.reservedField1 = reservedField1;
+ this.reservedField2 = reservedField2;
}
public PnDcp_Pdu_RealTimeCyclic build(int frameIdValue) {
PnDcp_Pdu_RealTimeCyclic pnDcp_Pdu_RealTimeCyclic =
new PnDcp_Pdu_RealTimeCyclic(
frameIdValue,
+ dataUnit,
cycleCounter,
ignore,
stationProblemIndicatorOk,
@@ -258,6 +316,9 @@ public PnDcp_Pdu_RealTimeCyclic build(int frameIdValue) {
dataValid,
redundancy,
statePrimary);
+ pnDcp_Pdu_RealTimeCyclic.reservedField0 = reservedField0;
+ pnDcp_Pdu_RealTimeCyclic.reservedField1 = reservedField1;
+ pnDcp_Pdu_RealTimeCyclic.reservedField2 = reservedField2;
return pnDcp_Pdu_RealTimeCyclic;
}
}
@@ -271,7 +332,8 @@ public boolean equals(Object o) {
return false;
}
PnDcp_Pdu_RealTimeCyclic that = (PnDcp_Pdu_RealTimeCyclic) o;
- return (getCycleCounter() == that.getCycleCounter())
+ return (getDataUnit() == that.getDataUnit())
+ && (getCycleCounter() == that.getCycleCounter())
&& (getIgnore() == that.getIgnore())
&& (getStationProblemIndicatorOk() == that.getStationProblemIndicatorOk())
&& (getProviderStateRun() == that.getProviderStateRun())
@@ -286,6 +348,7 @@ public boolean equals(Object o) {
public int hashCode() {
return Objects.hash(
super.hashCode(),
+ getDataUnit(),
getCycleCounter(),
getIgnore(),
getStationProblemIndicatorOk(),
diff --git a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnDcp_ServiceType.java b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnDcp_ServiceType.java
index 1e2ed0e04dd..407b36eb6af 100644
--- a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnDcp_ServiceType.java
+++ b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnDcp_ServiceType.java
@@ -41,6 +41,10 @@ public class PnDcp_ServiceType implements Message {
protected final boolean notSupported;
protected final boolean response;
+ // Reserved Fields
+ private Short reservedField0;
+ private Byte reservedField1;
+
public PnDcp_ServiceType(boolean notSupported, boolean response) {
super();
this.notSupported = notSupported;
@@ -61,13 +65,19 @@ public void serialize(WriteBuffer writeBuffer) throws SerializationException {
writeBuffer.pushContext("PnDcp_ServiceType");
// Reserved Field (reserved)
- writeReservedField("reserved", (short) 0x00, writeUnsignedShort(writeBuffer, 5));
+ writeReservedField(
+ "reserved",
+ reservedField0 != null ? reservedField0 : (short) 0x00,
+ writeUnsignedShort(writeBuffer, 5));
// Simple Field (notSupported)
writeSimpleField("notSupported", notSupported, writeBoolean(writeBuffer));
// Reserved Field (reserved)
- writeReservedField("reserved", (byte) 0x00, writeUnsignedByte(writeBuffer, 1));
+ writeReservedField(
+ "reserved",
+ reservedField1 != null ? reservedField1 : (byte) 0x00,
+ writeUnsignedByte(writeBuffer, 1));
// Simple Field (response)
writeSimpleField("response", response, writeBoolean(writeBuffer));
@@ -126,6 +136,8 @@ public static PnDcp_ServiceType staticParse(ReadBuffer readBuffer) throws ParseE
// Create the instance
PnDcp_ServiceType _pnDcp_ServiceType;
_pnDcp_ServiceType = new PnDcp_ServiceType(notSupported, response);
+ _pnDcp_ServiceType.reservedField0 = reservedField0;
+ _pnDcp_ServiceType.reservedField1 = reservedField1;
return _pnDcp_ServiceType;
}
diff --git a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCM_Block_Request.java b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCM_Block_Request.java
new file mode 100644
index 00000000000..692db0f4053
--- /dev/null
+++ b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCM_Block_Request.java
@@ -0,0 +1,372 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.plc4x.java.profinet.readwrite;
+
+import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*;
+import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*;
+import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*;
+import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*;
+import static org.apache.plc4x.java.spi.generation.StaticHelper.*;
+
+import java.time.*;
+import java.util.*;
+import org.apache.plc4x.java.api.exceptions.*;
+import org.apache.plc4x.java.api.value.*;
+import org.apache.plc4x.java.spi.codegen.*;
+import org.apache.plc4x.java.spi.codegen.fields.*;
+import org.apache.plc4x.java.spi.codegen.io.*;
+import org.apache.plc4x.java.spi.generation.*;
+
+// Code generated by code-generation. DO NOT EDIT.
+
+public class PnIoCM_Block_Request extends PnIoCm_Block implements Message {
+
+ // Accessors for discriminator values.
+ public PnIoCm_BlockType getBlockType() {
+ return PnIoCm_BlockType.IOX_BLOCK_REQ;
+ }
+
+ // Properties.
+ protected final short blockVersionHigh;
+ protected final short blockVersionLow;
+ protected final Uuid arUuid;
+ protected final int sessionKey;
+ protected final int controlCommand;
+ protected final int controlBlockProperties;
+
+ // Reserved Fields
+ private Integer reservedField0;
+ private Integer reservedField1;
+
+ public PnIoCM_Block_Request(
+ short blockVersionHigh,
+ short blockVersionLow,
+ Uuid arUuid,
+ int sessionKey,
+ int controlCommand,
+ int controlBlockProperties) {
+ super();
+ this.blockVersionHigh = blockVersionHigh;
+ this.blockVersionLow = blockVersionLow;
+ this.arUuid = arUuid;
+ this.sessionKey = sessionKey;
+ this.controlCommand = controlCommand;
+ this.controlBlockProperties = controlBlockProperties;
+ }
+
+ public short getBlockVersionHigh() {
+ return blockVersionHigh;
+ }
+
+ public short getBlockVersionLow() {
+ return blockVersionLow;
+ }
+
+ public Uuid getArUuid() {
+ return arUuid;
+ }
+
+ public int getSessionKey() {
+ return sessionKey;
+ }
+
+ public int getControlCommand() {
+ return controlCommand;
+ }
+
+ public int getControlBlockProperties() {
+ return controlBlockProperties;
+ }
+
+ @Override
+ protected void serializePnIoCm_BlockChild(WriteBuffer writeBuffer) throws SerializationException {
+ PositionAware positionAware = writeBuffer;
+ int startPos = positionAware.getPos();
+ writeBuffer.pushContext("PnIoCM_Block_Request");
+
+ // Implicit Field (blockLength) (Used for parsing, but its value is not stored as it's
+ // implicitly given by the objects content)
+ int blockLength = (int) ((getLengthInBytes()) - (4));
+ writeImplicitField(
+ "blockLength",
+ blockLength,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Simple Field (blockVersionHigh)
+ writeSimpleField(
+ "blockVersionHigh",
+ blockVersionHigh,
+ writeUnsignedShort(writeBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Simple Field (blockVersionLow)
+ writeSimpleField(
+ "blockVersionLow",
+ blockVersionLow,
+ writeUnsignedShort(writeBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Reserved Field (reserved)
+ writeReservedField(
+ "reserved",
+ reservedField0 != null ? reservedField0 : (int) 0x0000,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Simple Field (arUuid)
+ writeSimpleField(
+ "arUuid",
+ arUuid,
+ new DataWriterComplexDefault<>(writeBuffer),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Simple Field (sessionKey)
+ writeSimpleField(
+ "sessionKey",
+ sessionKey,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Reserved Field (reserved)
+ writeReservedField(
+ "reserved",
+ reservedField1 != null ? reservedField1 : (int) 0x0000,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Simple Field (controlCommand)
+ writeSimpleField(
+ "controlCommand",
+ controlCommand,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Simple Field (controlBlockProperties)
+ writeSimpleField(
+ "controlBlockProperties",
+ controlBlockProperties,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ writeBuffer.popContext("PnIoCM_Block_Request");
+ }
+
+ @Override
+ public int getLengthInBytes() {
+ return (int) Math.ceil((float) getLengthInBits() / 8.0);
+ }
+
+ @Override
+ public int getLengthInBits() {
+ int lengthInBits = super.getLengthInBits();
+ PnIoCM_Block_Request _value = this;
+
+ // Implicit Field (blockLength)
+ lengthInBits += 16;
+
+ // Simple field (blockVersionHigh)
+ lengthInBits += 8;
+
+ // Simple field (blockVersionLow)
+ lengthInBits += 8;
+
+ // Reserved Field (reserved)
+ lengthInBits += 16;
+
+ // Simple field (arUuid)
+ lengthInBits += arUuid.getLengthInBits();
+
+ // Simple field (sessionKey)
+ lengthInBits += 16;
+
+ // Reserved Field (reserved)
+ lengthInBits += 16;
+
+ // Simple field (controlCommand)
+ lengthInBits += 16;
+
+ // Simple field (controlBlockProperties)
+ lengthInBits += 16;
+
+ return lengthInBits;
+ }
+
+ public static PnIoCm_BlockBuilder staticParsePnIoCm_BlockBuilder(ReadBuffer readBuffer)
+ throws ParseException {
+ readBuffer.pullContext("PnIoCM_Block_Request");
+ PositionAware positionAware = readBuffer;
+ int startPos = positionAware.getPos();
+ int curPos;
+
+ int blockLength =
+ readImplicitField(
+ "blockLength",
+ readUnsignedInt(readBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ short blockVersionHigh =
+ readSimpleField(
+ "blockVersionHigh",
+ readUnsignedShort(readBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ short blockVersionLow =
+ readSimpleField(
+ "blockVersionLow",
+ readUnsignedShort(readBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ Integer reservedField0 =
+ readReservedField(
+ "reserved",
+ readUnsignedInt(readBuffer, 16),
+ (int) 0x0000,
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ Uuid arUuid =
+ readSimpleField(
+ "arUuid",
+ new DataReaderComplexDefault<>(() -> Uuid.staticParse(readBuffer), readBuffer),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ int sessionKey =
+ readSimpleField(
+ "sessionKey",
+ readUnsignedInt(readBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ Integer reservedField1 =
+ readReservedField(
+ "reserved",
+ readUnsignedInt(readBuffer, 16),
+ (int) 0x0000,
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ int controlCommand =
+ readSimpleField(
+ "controlCommand",
+ readUnsignedInt(readBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ int controlBlockProperties =
+ readSimpleField(
+ "controlBlockProperties",
+ readUnsignedInt(readBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ readBuffer.closeContext("PnIoCM_Block_Request");
+ // Create the instance
+ return new PnIoCM_Block_RequestBuilderImpl(
+ blockVersionHigh,
+ blockVersionLow,
+ arUuid,
+ sessionKey,
+ controlCommand,
+ controlBlockProperties,
+ reservedField0,
+ reservedField1);
+ }
+
+ public static class PnIoCM_Block_RequestBuilderImpl implements PnIoCm_Block.PnIoCm_BlockBuilder {
+ private final short blockVersionHigh;
+ private final short blockVersionLow;
+ private final Uuid arUuid;
+ private final int sessionKey;
+ private final int controlCommand;
+ private final int controlBlockProperties;
+ private final Integer reservedField0;
+ private final Integer reservedField1;
+
+ public PnIoCM_Block_RequestBuilderImpl(
+ short blockVersionHigh,
+ short blockVersionLow,
+ Uuid arUuid,
+ int sessionKey,
+ int controlCommand,
+ int controlBlockProperties,
+ Integer reservedField0,
+ Integer reservedField1) {
+ this.blockVersionHigh = blockVersionHigh;
+ this.blockVersionLow = blockVersionLow;
+ this.arUuid = arUuid;
+ this.sessionKey = sessionKey;
+ this.controlCommand = controlCommand;
+ this.controlBlockProperties = controlBlockProperties;
+ this.reservedField0 = reservedField0;
+ this.reservedField1 = reservedField1;
+ }
+
+ public PnIoCM_Block_Request build() {
+ PnIoCM_Block_Request pnIoCM_Block_Request =
+ new PnIoCM_Block_Request(
+ blockVersionHigh,
+ blockVersionLow,
+ arUuid,
+ sessionKey,
+ controlCommand,
+ controlBlockProperties);
+ pnIoCM_Block_Request.reservedField0 = reservedField0;
+ pnIoCM_Block_Request.reservedField1 = reservedField1;
+ return pnIoCM_Block_Request;
+ }
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (!(o instanceof PnIoCM_Block_Request)) {
+ return false;
+ }
+ PnIoCM_Block_Request that = (PnIoCM_Block_Request) o;
+ return (getBlockVersionHigh() == that.getBlockVersionHigh())
+ && (getBlockVersionLow() == that.getBlockVersionLow())
+ && (getArUuid() == that.getArUuid())
+ && (getSessionKey() == that.getSessionKey())
+ && (getControlCommand() == that.getControlCommand())
+ && (getControlBlockProperties() == that.getControlBlockProperties())
+ && super.equals(that)
+ && true;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(
+ super.hashCode(),
+ getBlockVersionHigh(),
+ getBlockVersionLow(),
+ getArUuid(),
+ getSessionKey(),
+ getControlCommand(),
+ getControlBlockProperties());
+ }
+
+ @Override
+ public String toString() {
+ WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true);
+ try {
+ writeBufferBoxBased.writeSerializable(this);
+ } catch (SerializationException e) {
+ throw new RuntimeException(e);
+ }
+ return "\n" + writeBufferBoxBased.getBox().toString() + "\n";
+ }
+}
diff --git a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCM_Block_Response.java b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCM_Block_Response.java
new file mode 100644
index 00000000000..0c9002526a0
--- /dev/null
+++ b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCM_Block_Response.java
@@ -0,0 +1,372 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.plc4x.java.profinet.readwrite;
+
+import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*;
+import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*;
+import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*;
+import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*;
+import static org.apache.plc4x.java.spi.generation.StaticHelper.*;
+
+import java.time.*;
+import java.util.*;
+import org.apache.plc4x.java.api.exceptions.*;
+import org.apache.plc4x.java.api.value.*;
+import org.apache.plc4x.java.spi.codegen.*;
+import org.apache.plc4x.java.spi.codegen.fields.*;
+import org.apache.plc4x.java.spi.codegen.io.*;
+import org.apache.plc4x.java.spi.generation.*;
+
+// Code generated by code-generation. DO NOT EDIT.
+
+public class PnIoCM_Block_Response extends PnIoCm_Block implements Message {
+
+ // Accessors for discriminator values.
+ public PnIoCm_BlockType getBlockType() {
+ return PnIoCm_BlockType.IOX_BLOCK_RES;
+ }
+
+ // Properties.
+ protected final short blockVersionHigh;
+ protected final short blockVersionLow;
+ protected final Uuid arUuid;
+ protected final int sessionKey;
+ protected final int controlCommand;
+ protected final int controlBlockProperties;
+
+ // Reserved Fields
+ private Integer reservedField0;
+ private Integer reservedField1;
+
+ public PnIoCM_Block_Response(
+ short blockVersionHigh,
+ short blockVersionLow,
+ Uuid arUuid,
+ int sessionKey,
+ int controlCommand,
+ int controlBlockProperties) {
+ super();
+ this.blockVersionHigh = blockVersionHigh;
+ this.blockVersionLow = blockVersionLow;
+ this.arUuid = arUuid;
+ this.sessionKey = sessionKey;
+ this.controlCommand = controlCommand;
+ this.controlBlockProperties = controlBlockProperties;
+ }
+
+ public short getBlockVersionHigh() {
+ return blockVersionHigh;
+ }
+
+ public short getBlockVersionLow() {
+ return blockVersionLow;
+ }
+
+ public Uuid getArUuid() {
+ return arUuid;
+ }
+
+ public int getSessionKey() {
+ return sessionKey;
+ }
+
+ public int getControlCommand() {
+ return controlCommand;
+ }
+
+ public int getControlBlockProperties() {
+ return controlBlockProperties;
+ }
+
+ @Override
+ protected void serializePnIoCm_BlockChild(WriteBuffer writeBuffer) throws SerializationException {
+ PositionAware positionAware = writeBuffer;
+ int startPos = positionAware.getPos();
+ writeBuffer.pushContext("PnIoCM_Block_Response");
+
+ // Implicit Field (blockLength) (Used for parsing, but its value is not stored as it's
+ // implicitly given by the objects content)
+ int blockLength = (int) ((getLengthInBytes()) - (4));
+ writeImplicitField(
+ "blockLength",
+ blockLength,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Simple Field (blockVersionHigh)
+ writeSimpleField(
+ "blockVersionHigh",
+ blockVersionHigh,
+ writeUnsignedShort(writeBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Simple Field (blockVersionLow)
+ writeSimpleField(
+ "blockVersionLow",
+ blockVersionLow,
+ writeUnsignedShort(writeBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Reserved Field (reserved)
+ writeReservedField(
+ "reserved",
+ reservedField0 != null ? reservedField0 : (int) 0x0000,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Simple Field (arUuid)
+ writeSimpleField(
+ "arUuid",
+ arUuid,
+ new DataWriterComplexDefault<>(writeBuffer),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Simple Field (sessionKey)
+ writeSimpleField(
+ "sessionKey",
+ sessionKey,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Reserved Field (reserved)
+ writeReservedField(
+ "reserved",
+ reservedField1 != null ? reservedField1 : (int) 0x0000,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Simple Field (controlCommand)
+ writeSimpleField(
+ "controlCommand",
+ controlCommand,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Simple Field (controlBlockProperties)
+ writeSimpleField(
+ "controlBlockProperties",
+ controlBlockProperties,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ writeBuffer.popContext("PnIoCM_Block_Response");
+ }
+
+ @Override
+ public int getLengthInBytes() {
+ return (int) Math.ceil((float) getLengthInBits() / 8.0);
+ }
+
+ @Override
+ public int getLengthInBits() {
+ int lengthInBits = super.getLengthInBits();
+ PnIoCM_Block_Response _value = this;
+
+ // Implicit Field (blockLength)
+ lengthInBits += 16;
+
+ // Simple field (blockVersionHigh)
+ lengthInBits += 8;
+
+ // Simple field (blockVersionLow)
+ lengthInBits += 8;
+
+ // Reserved Field (reserved)
+ lengthInBits += 16;
+
+ // Simple field (arUuid)
+ lengthInBits += arUuid.getLengthInBits();
+
+ // Simple field (sessionKey)
+ lengthInBits += 16;
+
+ // Reserved Field (reserved)
+ lengthInBits += 16;
+
+ // Simple field (controlCommand)
+ lengthInBits += 16;
+
+ // Simple field (controlBlockProperties)
+ lengthInBits += 16;
+
+ return lengthInBits;
+ }
+
+ public static PnIoCm_BlockBuilder staticParsePnIoCm_BlockBuilder(ReadBuffer readBuffer)
+ throws ParseException {
+ readBuffer.pullContext("PnIoCM_Block_Response");
+ PositionAware positionAware = readBuffer;
+ int startPos = positionAware.getPos();
+ int curPos;
+
+ int blockLength =
+ readImplicitField(
+ "blockLength",
+ readUnsignedInt(readBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ short blockVersionHigh =
+ readSimpleField(
+ "blockVersionHigh",
+ readUnsignedShort(readBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ short blockVersionLow =
+ readSimpleField(
+ "blockVersionLow",
+ readUnsignedShort(readBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ Integer reservedField0 =
+ readReservedField(
+ "reserved",
+ readUnsignedInt(readBuffer, 16),
+ (int) 0x0000,
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ Uuid arUuid =
+ readSimpleField(
+ "arUuid",
+ new DataReaderComplexDefault<>(() -> Uuid.staticParse(readBuffer), readBuffer),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ int sessionKey =
+ readSimpleField(
+ "sessionKey",
+ readUnsignedInt(readBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ Integer reservedField1 =
+ readReservedField(
+ "reserved",
+ readUnsignedInt(readBuffer, 16),
+ (int) 0x0000,
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ int controlCommand =
+ readSimpleField(
+ "controlCommand",
+ readUnsignedInt(readBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ int controlBlockProperties =
+ readSimpleField(
+ "controlBlockProperties",
+ readUnsignedInt(readBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ readBuffer.closeContext("PnIoCM_Block_Response");
+ // Create the instance
+ return new PnIoCM_Block_ResponseBuilderImpl(
+ blockVersionHigh,
+ blockVersionLow,
+ arUuid,
+ sessionKey,
+ controlCommand,
+ controlBlockProperties,
+ reservedField0,
+ reservedField1);
+ }
+
+ public static class PnIoCM_Block_ResponseBuilderImpl implements PnIoCm_Block.PnIoCm_BlockBuilder {
+ private final short blockVersionHigh;
+ private final short blockVersionLow;
+ private final Uuid arUuid;
+ private final int sessionKey;
+ private final int controlCommand;
+ private final int controlBlockProperties;
+ private final Integer reservedField0;
+ private final Integer reservedField1;
+
+ public PnIoCM_Block_ResponseBuilderImpl(
+ short blockVersionHigh,
+ short blockVersionLow,
+ Uuid arUuid,
+ int sessionKey,
+ int controlCommand,
+ int controlBlockProperties,
+ Integer reservedField0,
+ Integer reservedField1) {
+ this.blockVersionHigh = blockVersionHigh;
+ this.blockVersionLow = blockVersionLow;
+ this.arUuid = arUuid;
+ this.sessionKey = sessionKey;
+ this.controlCommand = controlCommand;
+ this.controlBlockProperties = controlBlockProperties;
+ this.reservedField0 = reservedField0;
+ this.reservedField1 = reservedField1;
+ }
+
+ public PnIoCM_Block_Response build() {
+ PnIoCM_Block_Response pnIoCM_Block_Response =
+ new PnIoCM_Block_Response(
+ blockVersionHigh,
+ blockVersionLow,
+ arUuid,
+ sessionKey,
+ controlCommand,
+ controlBlockProperties);
+ pnIoCM_Block_Response.reservedField0 = reservedField0;
+ pnIoCM_Block_Response.reservedField1 = reservedField1;
+ return pnIoCM_Block_Response;
+ }
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (!(o instanceof PnIoCM_Block_Response)) {
+ return false;
+ }
+ PnIoCM_Block_Response that = (PnIoCM_Block_Response) o;
+ return (getBlockVersionHigh() == that.getBlockVersionHigh())
+ && (getBlockVersionLow() == that.getBlockVersionLow())
+ && (getArUuid() == that.getArUuid())
+ && (getSessionKey() == that.getSessionKey())
+ && (getControlCommand() == that.getControlCommand())
+ && (getControlBlockProperties() == that.getControlBlockProperties())
+ && super.equals(that)
+ && true;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(
+ super.hashCode(),
+ getBlockVersionHigh(),
+ getBlockVersionLow(),
+ getArUuid(),
+ getSessionKey(),
+ getControlCommand(),
+ getControlBlockProperties());
+ }
+
+ @Override
+ public String toString() {
+ WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true);
+ try {
+ writeBufferBoxBased.writeSerializable(this);
+ } catch (SerializationException e) {
+ throw new RuntimeException(e);
+ }
+ return "\n" + writeBufferBoxBased.getBox().toString() + "\n";
+ }
+}
diff --git a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_Block.java b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_Block.java
index d7ce207b17f..5365b21c424 100644
--- a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_Block.java
+++ b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_Block.java
@@ -40,22 +40,8 @@ public abstract class PnIoCm_Block implements Message {
// Abstract accessors for discriminator values.
public abstract PnIoCm_BlockType getBlockType();
- // Properties.
- protected final short blockVersionHigh;
- protected final short blockVersionLow;
-
- public PnIoCm_Block(short blockVersionHigh, short blockVersionLow) {
+ public PnIoCm_Block() {
super();
- this.blockVersionHigh = blockVersionHigh;
- this.blockVersionLow = blockVersionLow;
- }
-
- public short getBlockVersionHigh() {
- return blockVersionHigh;
- }
-
- public short getBlockVersionLow() {
- return blockVersionLow;
}
protected abstract void serializePnIoCm_BlockChild(WriteBuffer writeBuffer)
@@ -75,29 +61,6 @@ public void serialize(WriteBuffer writeBuffer) throws SerializationException {
PnIoCm_BlockType::getValue, PnIoCm_BlockType::name, writeUnsignedInt(writeBuffer, 16)),
WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
- // Implicit Field (blockLength) (Used for parsing, but its value is not stored as it's
- // implicitly given by the objects content)
- int blockLength = (int) ((getLengthInBytes()) - (4));
- writeImplicitField(
- "blockLength",
- blockLength,
- writeUnsignedInt(writeBuffer, 16),
- WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
-
- // Simple Field (blockVersionHigh)
- writeSimpleField(
- "blockVersionHigh",
- blockVersionHigh,
- writeUnsignedShort(writeBuffer, 8),
- WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
-
- // Simple Field (blockVersionLow)
- writeSimpleField(
- "blockVersionLow",
- blockVersionLow,
- writeUnsignedShort(writeBuffer, 8),
- WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
-
// Switch field (Serialize the sub-type)
serializePnIoCm_BlockChild(writeBuffer);
@@ -117,15 +80,6 @@ public int getLengthInBits() {
// Discriminator Field (blockType)
lengthInBits += 16;
- // Implicit Field (blockLength)
- lengthInBits += 16;
-
- // Simple field (blockVersionHigh)
- lengthInBits += 8;
-
- // Simple field (blockVersionLow)
- lengthInBits += 8;
-
// Length of sub-type elements will be added by sub-type...
return lengthInBits;
@@ -150,30 +104,30 @@ public static PnIoCm_Block staticParse(ReadBuffer readBuffer) throws ParseExcept
PnIoCm_BlockType::enumForValue, readUnsignedInt(readBuffer, 16)),
WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
- int blockLength =
- readImplicitField(
- "blockLength",
- readUnsignedInt(readBuffer, 16),
- WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
-
- short blockVersionHigh =
- readSimpleField(
- "blockVersionHigh",
- readUnsignedShort(readBuffer, 8),
- WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
-
- short blockVersionLow =
- readSimpleField(
- "blockVersionLow",
- readUnsignedShort(readBuffer, 8),
- WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
-
// Switch Field (Depending on the discriminator values, passes the instantiation to a sub-type)
PnIoCm_BlockBuilder builder = null;
- if (EvaluationHelper.equals(blockType, PnIoCm_BlockType.AR_BLOCK_REQ)) {
+ if (EvaluationHelper.equals(blockType, PnIoCm_BlockType.IOD_WRITE_REQUEST_HEADER)) {
+ builder = IODWriteRequestHeader.staticParsePnIoCm_BlockBuilder(readBuffer);
+ } else if (EvaluationHelper.equals(blockType, PnIoCm_BlockType.IOD_WRITE_RESPONSE_HEADER)) {
+ builder = IODWriteResponseHeader.staticParsePnIoCm_BlockBuilder(readBuffer);
+ } else if (EvaluationHelper.equals(blockType, PnIoCm_BlockType.PD_INTERFACE_ADJUST)) {
+ builder = PDInterfaceAdjust.staticParsePnIoCm_BlockBuilder(readBuffer);
+ } else if (EvaluationHelper.equals(blockType, PnIoCm_BlockType.PD_PORT_DATA_CHECK)) {
+ builder = PDPortDataCheck.staticParsePnIoCm_BlockBuilder(readBuffer);
+ } else if (EvaluationHelper.equals(blockType, PnIoCm_BlockType.CHECK_PEERS)) {
+ builder = CheckPeers.staticParsePnIoCm_BlockBuilder(readBuffer);
+ } else if (EvaluationHelper.equals(blockType, PnIoCm_BlockType.AR_BLOCK_REQ)) {
builder = PnIoCm_Block_ArReq.staticParsePnIoCm_BlockBuilder(readBuffer);
} else if (EvaluationHelper.equals(blockType, PnIoCm_BlockType.AR_BLOCK_RES)) {
builder = PnIoCm_Block_ArRes.staticParsePnIoCm_BlockBuilder(readBuffer);
+ } else if (EvaluationHelper.equals(blockType, PnIoCm_BlockType.IOD_CONTROL_REQ)) {
+ builder = PnIoCm_Control_Request.staticParsePnIoCm_BlockBuilder(readBuffer);
+ } else if (EvaluationHelper.equals(blockType, PnIoCm_BlockType.IOX_BLOCK_REQ)) {
+ builder = PnIoCM_Block_Request.staticParsePnIoCm_BlockBuilder(readBuffer);
+ } else if (EvaluationHelper.equals(blockType, PnIoCm_BlockType.IOX_BLOCK_RES)) {
+ builder = PnIoCM_Block_Response.staticParsePnIoCm_BlockBuilder(readBuffer);
+ } else if (EvaluationHelper.equals(blockType, PnIoCm_BlockType.IOD_CONTROL_RES)) {
+ builder = PnIoCm_Control_Response.staticParsePnIoCm_BlockBuilder(readBuffer);
} else if (EvaluationHelper.equals(blockType, PnIoCm_BlockType.IO_CR_BLOCK_REQ)) {
builder = PnIoCm_Block_IoCrReq.staticParsePnIoCm_BlockBuilder(readBuffer);
} else if (EvaluationHelper.equals(blockType, PnIoCm_BlockType.IO_CR_BLOCK_RES)) {
@@ -200,12 +154,12 @@ public static PnIoCm_Block staticParse(ReadBuffer readBuffer) throws ParseExcept
readBuffer.closeContext("PnIoCm_Block");
// Create the instance
- PnIoCm_Block _pnIoCm_Block = builder.build(blockVersionHigh, blockVersionLow);
+ PnIoCm_Block _pnIoCm_Block = builder.build();
return _pnIoCm_Block;
}
public interface PnIoCm_BlockBuilder {
- PnIoCm_Block build(short blockVersionHigh, short blockVersionLow);
+ PnIoCm_Block build();
}
@Override
@@ -217,14 +171,12 @@ public boolean equals(Object o) {
return false;
}
PnIoCm_Block that = (PnIoCm_Block) o;
- return (getBlockVersionHigh() == that.getBlockVersionHigh())
- && (getBlockVersionLow() == that.getBlockVersionLow())
- && true;
+ return true;
}
@Override
public int hashCode() {
- return Objects.hash(getBlockVersionHigh(), getBlockVersionLow());
+ return Objects.hash();
}
@Override
diff --git a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_BlockType.java b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_BlockType.java
index b97c8aa8e82..3a212a1d04e 100644
--- a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_BlockType.java
+++ b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_BlockType.java
@@ -24,15 +24,24 @@
// Code generated by code-generation. DO NOT EDIT.
public enum PnIoCm_BlockType {
+ IOD_WRITE_REQUEST_HEADER((int) 0x0008),
AR_BLOCK_REQ((int) 0x0101),
- AR_BLOCK_RES((int) 0x8101),
IO_CR_BLOCK_REQ((int) 0x0102),
- IO_CR_BLOCK_RES((int) 0x8102),
ALARM_CR_BLOCK_REQ((int) 0x0103),
- ALARM_CR_BLOCK_RES((int) 0x8103),
EXPECTED_SUBMODULE_BLOCK_REQ((int) 0x0104),
+ IOD_CONTROL_REQ((int) 0x0110),
+ IOX_BLOCK_REQ((int) 0x0112),
+ PD_PORT_DATA_CHECK((int) 0x0200),
+ CHECK_PEERS((int) 0x020a),
+ PD_INTERFACE_ADJUST((int) 0x0250),
+ IOD_WRITE_RESPONSE_HEADER((int) 0x8008),
+ AR_BLOCK_RES((int) 0x8101),
+ IO_CR_BLOCK_RES((int) 0x8102),
+ ALARM_CR_BLOCK_RES((int) 0x8103),
MODULE_DIFF_BLOCK((int) 0x8104),
- AR_SERVER_BLOCK((int) 0x8106);
+ AR_SERVER_BLOCK((int) 0x8106),
+ IOD_CONTROL_RES((int) 0x8110),
+ IOX_BLOCK_RES((int) 0x8112);
private static final Map map;
static {
diff --git a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_Block_AlarmCrReq.java b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_Block_AlarmCrReq.java
index 8e51c786f2a..410da9f80ae 100644
--- a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_Block_AlarmCrReq.java
+++ b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_Block_AlarmCrReq.java
@@ -43,6 +43,8 @@ public PnIoCm_BlockType getBlockType() {
}
// Properties.
+ protected final short blockVersionHigh;
+ protected final short blockVersionLow;
protected final PnIoCm_AlarmCrType alarmType;
protected final int lt;
protected final boolean transport;
@@ -54,6 +56,9 @@ public PnIoCm_BlockType getBlockType() {
protected final int alarmCtrTagHeaderHigh;
protected final int alarmCtrTagHeaderLow;
+ // Reserved Fields
+ private Long reservedField0;
+
public PnIoCm_Block_AlarmCrReq(
short blockVersionHigh,
short blockVersionLow,
@@ -67,7 +72,9 @@ public PnIoCm_Block_AlarmCrReq(
int maxAlarmDataLength,
int alarmCtrTagHeaderHigh,
int alarmCtrTagHeaderLow) {
- super(blockVersionHigh, blockVersionLow);
+ super();
+ this.blockVersionHigh = blockVersionHigh;
+ this.blockVersionLow = blockVersionLow;
this.alarmType = alarmType;
this.lt = lt;
this.transport = transport;
@@ -80,6 +87,14 @@ public PnIoCm_Block_AlarmCrReq(
this.alarmCtrTagHeaderLow = alarmCtrTagHeaderLow;
}
+ public short getBlockVersionHigh() {
+ return blockVersionHigh;
+ }
+
+ public short getBlockVersionLow() {
+ return blockVersionLow;
+ }
+
public PnIoCm_AlarmCrType getAlarmType() {
return alarmType;
}
@@ -126,6 +141,29 @@ protected void serializePnIoCm_BlockChild(WriteBuffer writeBuffer) throws Serial
int startPos = positionAware.getPos();
writeBuffer.pushContext("PnIoCm_Block_AlarmCrReq");
+ // Implicit Field (blockLength) (Used for parsing, but its value is not stored as it's
+ // implicitly given by the objects content)
+ int blockLength = (int) ((getLengthInBytes()) - (4));
+ writeImplicitField(
+ "blockLength",
+ blockLength,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Simple Field (blockVersionHigh)
+ writeSimpleField(
+ "blockVersionHigh",
+ blockVersionHigh,
+ writeUnsignedShort(writeBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Simple Field (blockVersionLow)
+ writeSimpleField(
+ "blockVersionLow",
+ blockVersionLow,
+ writeUnsignedShort(writeBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
// Simple Field (alarmType)
writeSimpleEnumField(
"alarmType",
@@ -147,7 +185,7 @@ protected void serializePnIoCm_BlockChild(WriteBuffer writeBuffer) throws Serial
// Reserved Field (reserved)
writeReservedField(
"reserved",
- (long) 0x00000000,
+ reservedField0 != null ? reservedField0 : (long) 0x00000000,
writeUnsignedLong(writeBuffer, 30),
WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
@@ -220,6 +258,15 @@ public int getLengthInBits() {
int lengthInBits = super.getLengthInBits();
PnIoCm_Block_AlarmCrReq _value = this;
+ // Implicit Field (blockLength)
+ lengthInBits += 16;
+
+ // Simple field (blockVersionHigh)
+ lengthInBits += 8;
+
+ // Simple field (blockVersionLow)
+ lengthInBits += 8;
+
// Simple field (alarmType)
lengthInBits += 16;
@@ -263,6 +310,24 @@ public static PnIoCm_BlockBuilder staticParsePnIoCm_BlockBuilder(ReadBuffer read
int startPos = positionAware.getPos();
int curPos;
+ int blockLength =
+ readImplicitField(
+ "blockLength",
+ readUnsignedInt(readBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ short blockVersionHigh =
+ readSimpleField(
+ "blockVersionHigh",
+ readUnsignedShort(readBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ short blockVersionLow =
+ readSimpleField(
+ "blockVersionLow",
+ readUnsignedShort(readBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
PnIoCm_AlarmCrType alarmType =
readEnumField(
"alarmType",
@@ -329,6 +394,8 @@ public static PnIoCm_BlockBuilder staticParsePnIoCm_BlockBuilder(ReadBuffer read
readBuffer.closeContext("PnIoCm_Block_AlarmCrReq");
// Create the instance
return new PnIoCm_Block_AlarmCrReqBuilderImpl(
+ blockVersionHigh,
+ blockVersionLow,
alarmType,
lt,
transport,
@@ -338,11 +405,14 @@ public static PnIoCm_BlockBuilder staticParsePnIoCm_BlockBuilder(ReadBuffer read
localAlarmReference,
maxAlarmDataLength,
alarmCtrTagHeaderHigh,
- alarmCtrTagHeaderLow);
+ alarmCtrTagHeaderLow,
+ reservedField0);
}
public static class PnIoCm_Block_AlarmCrReqBuilderImpl
implements PnIoCm_Block.PnIoCm_BlockBuilder {
+ private final short blockVersionHigh;
+ private final short blockVersionLow;
private final PnIoCm_AlarmCrType alarmType;
private final int lt;
private final boolean transport;
@@ -353,8 +423,11 @@ public static class PnIoCm_Block_AlarmCrReqBuilderImpl
private final int maxAlarmDataLength;
private final int alarmCtrTagHeaderHigh;
private final int alarmCtrTagHeaderLow;
+ private final Long reservedField0;
public PnIoCm_Block_AlarmCrReqBuilderImpl(
+ short blockVersionHigh,
+ short blockVersionLow,
PnIoCm_AlarmCrType alarmType,
int lt,
boolean transport,
@@ -364,7 +437,10 @@ public PnIoCm_Block_AlarmCrReqBuilderImpl(
int localAlarmReference,
int maxAlarmDataLength,
int alarmCtrTagHeaderHigh,
- int alarmCtrTagHeaderLow) {
+ int alarmCtrTagHeaderLow,
+ Long reservedField0) {
+ this.blockVersionHigh = blockVersionHigh;
+ this.blockVersionLow = blockVersionLow;
this.alarmType = alarmType;
this.lt = lt;
this.transport = transport;
@@ -375,9 +451,10 @@ public PnIoCm_Block_AlarmCrReqBuilderImpl(
this.maxAlarmDataLength = maxAlarmDataLength;
this.alarmCtrTagHeaderHigh = alarmCtrTagHeaderHigh;
this.alarmCtrTagHeaderLow = alarmCtrTagHeaderLow;
+ this.reservedField0 = reservedField0;
}
- public PnIoCm_Block_AlarmCrReq build(short blockVersionHigh, short blockVersionLow) {
+ public PnIoCm_Block_AlarmCrReq build() {
PnIoCm_Block_AlarmCrReq pnIoCm_Block_AlarmCrReq =
new PnIoCm_Block_AlarmCrReq(
blockVersionHigh,
@@ -392,6 +469,7 @@ public PnIoCm_Block_AlarmCrReq build(short blockVersionHigh, short blockVersionL
maxAlarmDataLength,
alarmCtrTagHeaderHigh,
alarmCtrTagHeaderLow);
+ pnIoCm_Block_AlarmCrReq.reservedField0 = reservedField0;
return pnIoCm_Block_AlarmCrReq;
}
}
@@ -405,7 +483,9 @@ public boolean equals(Object o) {
return false;
}
PnIoCm_Block_AlarmCrReq that = (PnIoCm_Block_AlarmCrReq) o;
- return (getAlarmType() == that.getAlarmType())
+ return (getBlockVersionHigh() == that.getBlockVersionHigh())
+ && (getBlockVersionLow() == that.getBlockVersionLow())
+ && (getAlarmType() == that.getAlarmType())
&& (getLt() == that.getLt())
&& (getTransport() == that.getTransport())
&& (getPriority() == that.getPriority())
@@ -423,6 +503,8 @@ public boolean equals(Object o) {
public int hashCode() {
return Objects.hash(
super.hashCode(),
+ getBlockVersionHigh(),
+ getBlockVersionLow(),
getAlarmType(),
getLt(),
getTransport(),
diff --git a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_Block_AlarmCrRes.java b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_Block_AlarmCrRes.java
index 81fb40fae93..9cdf91aaebd 100644
--- a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_Block_AlarmCrRes.java
+++ b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_Block_AlarmCrRes.java
@@ -43,6 +43,8 @@ public PnIoCm_BlockType getBlockType() {
}
// Properties.
+ protected final short blockVersionHigh;
+ protected final short blockVersionLow;
protected final PnIoCm_AlarmCrType alarmType;
protected final int localAlarmReference;
protected final int maxAlarmDataLength;
@@ -53,12 +55,22 @@ public PnIoCm_Block_AlarmCrRes(
PnIoCm_AlarmCrType alarmType,
int localAlarmReference,
int maxAlarmDataLength) {
- super(blockVersionHigh, blockVersionLow);
+ super();
+ this.blockVersionHigh = blockVersionHigh;
+ this.blockVersionLow = blockVersionLow;
this.alarmType = alarmType;
this.localAlarmReference = localAlarmReference;
this.maxAlarmDataLength = maxAlarmDataLength;
}
+ public short getBlockVersionHigh() {
+ return blockVersionHigh;
+ }
+
+ public short getBlockVersionLow() {
+ return blockVersionLow;
+ }
+
public PnIoCm_AlarmCrType getAlarmType() {
return alarmType;
}
@@ -77,6 +89,29 @@ protected void serializePnIoCm_BlockChild(WriteBuffer writeBuffer) throws Serial
int startPos = positionAware.getPos();
writeBuffer.pushContext("PnIoCm_Block_AlarmCrRes");
+ // Implicit Field (blockLength) (Used for parsing, but its value is not stored as it's
+ // implicitly given by the objects content)
+ int blockLength = (int) ((getLengthInBytes()) - (4));
+ writeImplicitField(
+ "blockLength",
+ blockLength,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Simple Field (blockVersionHigh)
+ writeSimpleField(
+ "blockVersionHigh",
+ blockVersionHigh,
+ writeUnsignedShort(writeBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Simple Field (blockVersionLow)
+ writeSimpleField(
+ "blockVersionLow",
+ blockVersionLow,
+ writeUnsignedShort(writeBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
// Simple Field (alarmType)
writeSimpleEnumField(
"alarmType",
@@ -115,6 +150,15 @@ public int getLengthInBits() {
int lengthInBits = super.getLengthInBits();
PnIoCm_Block_AlarmCrRes _value = this;
+ // Implicit Field (blockLength)
+ lengthInBits += 16;
+
+ // Simple field (blockVersionHigh)
+ lengthInBits += 8;
+
+ // Simple field (blockVersionLow)
+ lengthInBits += 8;
+
// Simple field (alarmType)
lengthInBits += 16;
@@ -134,6 +178,24 @@ public static PnIoCm_BlockBuilder staticParsePnIoCm_BlockBuilder(ReadBuffer read
int startPos = positionAware.getPos();
int curPos;
+ int blockLength =
+ readImplicitField(
+ "blockLength",
+ readUnsignedInt(readBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ short blockVersionHigh =
+ readSimpleField(
+ "blockVersionHigh",
+ readUnsignedShort(readBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ short blockVersionLow =
+ readSimpleField(
+ "blockVersionLow",
+ readUnsignedShort(readBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
PnIoCm_AlarmCrType alarmType =
readEnumField(
"alarmType",
@@ -157,23 +219,31 @@ public static PnIoCm_BlockBuilder staticParsePnIoCm_BlockBuilder(ReadBuffer read
readBuffer.closeContext("PnIoCm_Block_AlarmCrRes");
// Create the instance
return new PnIoCm_Block_AlarmCrResBuilderImpl(
- alarmType, localAlarmReference, maxAlarmDataLength);
+ blockVersionHigh, blockVersionLow, alarmType, localAlarmReference, maxAlarmDataLength);
}
public static class PnIoCm_Block_AlarmCrResBuilderImpl
implements PnIoCm_Block.PnIoCm_BlockBuilder {
+ private final short blockVersionHigh;
+ private final short blockVersionLow;
private final PnIoCm_AlarmCrType alarmType;
private final int localAlarmReference;
private final int maxAlarmDataLength;
public PnIoCm_Block_AlarmCrResBuilderImpl(
- PnIoCm_AlarmCrType alarmType, int localAlarmReference, int maxAlarmDataLength) {
+ short blockVersionHigh,
+ short blockVersionLow,
+ PnIoCm_AlarmCrType alarmType,
+ int localAlarmReference,
+ int maxAlarmDataLength) {
+ this.blockVersionHigh = blockVersionHigh;
+ this.blockVersionLow = blockVersionLow;
this.alarmType = alarmType;
this.localAlarmReference = localAlarmReference;
this.maxAlarmDataLength = maxAlarmDataLength;
}
- public PnIoCm_Block_AlarmCrRes build(short blockVersionHigh, short blockVersionLow) {
+ public PnIoCm_Block_AlarmCrRes build() {
PnIoCm_Block_AlarmCrRes pnIoCm_Block_AlarmCrRes =
new PnIoCm_Block_AlarmCrRes(
blockVersionHigh,
@@ -194,7 +264,9 @@ public boolean equals(Object o) {
return false;
}
PnIoCm_Block_AlarmCrRes that = (PnIoCm_Block_AlarmCrRes) o;
- return (getAlarmType() == that.getAlarmType())
+ return (getBlockVersionHigh() == that.getBlockVersionHigh())
+ && (getBlockVersionLow() == that.getBlockVersionLow())
+ && (getAlarmType() == that.getAlarmType())
&& (getLocalAlarmReference() == that.getLocalAlarmReference())
&& (getMaxAlarmDataLength() == that.getMaxAlarmDataLength())
&& super.equals(that)
@@ -204,7 +276,12 @@ public boolean equals(Object o) {
@Override
public int hashCode() {
return Objects.hash(
- super.hashCode(), getAlarmType(), getLocalAlarmReference(), getMaxAlarmDataLength());
+ super.hashCode(),
+ getBlockVersionHigh(),
+ getBlockVersionLow(),
+ getAlarmType(),
+ getLocalAlarmReference(),
+ getMaxAlarmDataLength());
}
@Override
diff --git a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_Block_ArReq.java b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_Block_ArReq.java
index 6645ffc5bdd..c23cc115ba4 100644
--- a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_Block_ArReq.java
+++ b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_Block_ArReq.java
@@ -43,11 +43,13 @@ public PnIoCm_BlockType getBlockType() {
}
// Properties.
+ protected final short blockVersionHigh;
+ protected final short blockVersionLow;
protected final PnIoCm_ArType arType;
protected final Uuid arUuid;
protected final int sessionKey;
protected final MacAddress cmInitiatorMacAddr;
- protected final Uuid cmInitiatorObjectUuid;
+ protected final DceRpc_ObjectUuid cmInitiatorObjectUuid;
protected final boolean pullModuleAlarmAllowed;
protected final boolean nonLegacyStartupMode;
protected final boolean combinedObjectContainerUsed;
@@ -61,6 +63,10 @@ public PnIoCm_BlockType getBlockType() {
protected final int cmInitiatorUdpRtPort;
protected final String cmInitiatorStationName;
+ // Reserved Fields
+ private Long reservedField0;
+ private Byte reservedField1;
+
public PnIoCm_Block_ArReq(
short blockVersionHigh,
short blockVersionLow,
@@ -68,7 +74,7 @@ public PnIoCm_Block_ArReq(
Uuid arUuid,
int sessionKey,
MacAddress cmInitiatorMacAddr,
- Uuid cmInitiatorObjectUuid,
+ DceRpc_ObjectUuid cmInitiatorObjectUuid,
boolean pullModuleAlarmAllowed,
boolean nonLegacyStartupMode,
boolean combinedObjectContainerUsed,
@@ -81,7 +87,9 @@ public PnIoCm_Block_ArReq(
int cmInitiatorActivityTimeoutFactor,
int cmInitiatorUdpRtPort,
String cmInitiatorStationName) {
- super(blockVersionHigh, blockVersionLow);
+ super();
+ this.blockVersionHigh = blockVersionHigh;
+ this.blockVersionLow = blockVersionLow;
this.arType = arType;
this.arUuid = arUuid;
this.sessionKey = sessionKey;
@@ -101,6 +109,14 @@ public PnIoCm_Block_ArReq(
this.cmInitiatorStationName = cmInitiatorStationName;
}
+ public short getBlockVersionHigh() {
+ return blockVersionHigh;
+ }
+
+ public short getBlockVersionLow() {
+ return blockVersionLow;
+ }
+
public PnIoCm_ArType getArType() {
return arType;
}
@@ -117,7 +133,7 @@ public MacAddress getCmInitiatorMacAddr() {
return cmInitiatorMacAddr;
}
- public Uuid getCmInitiatorObjectUuid() {
+ public DceRpc_ObjectUuid getCmInitiatorObjectUuid() {
return cmInitiatorObjectUuid;
}
@@ -175,6 +191,29 @@ protected void serializePnIoCm_BlockChild(WriteBuffer writeBuffer) throws Serial
int startPos = positionAware.getPos();
writeBuffer.pushContext("PnIoCm_Block_ArReq");
+ // Implicit Field (blockLength) (Used for parsing, but its value is not stored as it's
+ // implicitly given by the objects content)
+ int blockLength = (int) ((getLengthInBytes()) - (4));
+ writeImplicitField(
+ "blockLength",
+ blockLength,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Simple Field (blockVersionHigh)
+ writeSimpleField(
+ "blockVersionHigh",
+ blockVersionHigh,
+ writeUnsignedShort(writeBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Simple Field (blockVersionLow)
+ writeSimpleField(
+ "blockVersionLow",
+ blockVersionLow,
+ writeUnsignedShort(writeBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
// Simple Field (arType)
writeSimpleEnumField(
"arType",
@@ -236,7 +275,7 @@ protected void serializePnIoCm_BlockChild(WriteBuffer writeBuffer) throws Serial
// Reserved Field (reserved)
writeReservedField(
"reserved",
- (long) 0x00000,
+ reservedField0 != null ? reservedField0 : (long) 0x00000,
writeUnsignedLong(writeBuffer, 17),
WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
@@ -268,7 +307,7 @@ protected void serializePnIoCm_BlockChild(WriteBuffer writeBuffer) throws Serial
// Reserved Field (reserved)
writeReservedField(
"reserved",
- (byte) 0x0,
+ reservedField1 != null ? reservedField1 : (byte) 0x0,
writeUnsignedByte(writeBuffer, 3),
WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
@@ -338,6 +377,15 @@ public int getLengthInBits() {
int lengthInBits = super.getLengthInBits();
PnIoCm_Block_ArReq _value = this;
+ // Implicit Field (blockLength)
+ lengthInBits += 16;
+
+ // Simple field (blockVersionHigh)
+ lengthInBits += 8;
+
+ // Simple field (blockVersionLow)
+ lengthInBits += 8;
+
// Simple field (arType)
lengthInBits += 16;
@@ -408,6 +456,24 @@ public static PnIoCm_BlockBuilder staticParsePnIoCm_BlockBuilder(ReadBuffer read
int startPos = positionAware.getPos();
int curPos;
+ int blockLength =
+ readImplicitField(
+ "blockLength",
+ readUnsignedInt(readBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ short blockVersionHigh =
+ readSimpleField(
+ "blockVersionHigh",
+ readUnsignedShort(readBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ short blockVersionLow =
+ readSimpleField(
+ "blockVersionLow",
+ readUnsignedShort(readBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
PnIoCm_ArType arType =
readEnumField(
"arType",
@@ -434,10 +500,11 @@ public static PnIoCm_BlockBuilder staticParsePnIoCm_BlockBuilder(ReadBuffer read
new DataReaderComplexDefault<>(() -> MacAddress.staticParse(readBuffer), readBuffer),
WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
- Uuid cmInitiatorObjectUuid =
+ DceRpc_ObjectUuid cmInitiatorObjectUuid =
readSimpleField(
"cmInitiatorObjectUuid",
- new DataReaderComplexDefault<>(() -> Uuid.staticParse(readBuffer), readBuffer),
+ new DataReaderComplexDefault<>(
+ () -> DceRpc_ObjectUuid.staticParse(readBuffer), readBuffer),
WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
boolean pullModuleAlarmAllowed =
@@ -537,6 +604,8 @@ public static PnIoCm_BlockBuilder staticParsePnIoCm_BlockBuilder(ReadBuffer read
readBuffer.closeContext("PnIoCm_Block_ArReq");
// Create the instance
return new PnIoCm_Block_ArReqBuilderImpl(
+ blockVersionHigh,
+ blockVersionLow,
arType,
arUuid,
sessionKey,
@@ -553,15 +622,19 @@ public static PnIoCm_BlockBuilder staticParsePnIoCm_BlockBuilder(ReadBuffer read
state,
cmInitiatorActivityTimeoutFactor,
cmInitiatorUdpRtPort,
- cmInitiatorStationName);
+ cmInitiatorStationName,
+ reservedField0,
+ reservedField1);
}
public static class PnIoCm_Block_ArReqBuilderImpl implements PnIoCm_Block.PnIoCm_BlockBuilder {
+ private final short blockVersionHigh;
+ private final short blockVersionLow;
private final PnIoCm_ArType arType;
private final Uuid arUuid;
private final int sessionKey;
private final MacAddress cmInitiatorMacAddr;
- private final Uuid cmInitiatorObjectUuid;
+ private final DceRpc_ObjectUuid cmInitiatorObjectUuid;
private final boolean pullModuleAlarmAllowed;
private final boolean nonLegacyStartupMode;
private final boolean combinedObjectContainerUsed;
@@ -574,13 +647,17 @@ public static class PnIoCm_Block_ArReqBuilderImpl implements PnIoCm_Block.PnIoCm
private final int cmInitiatorActivityTimeoutFactor;
private final int cmInitiatorUdpRtPort;
private final String cmInitiatorStationName;
+ private final Long reservedField0;
+ private final Byte reservedField1;
public PnIoCm_Block_ArReqBuilderImpl(
+ short blockVersionHigh,
+ short blockVersionLow,
PnIoCm_ArType arType,
Uuid arUuid,
int sessionKey,
MacAddress cmInitiatorMacAddr,
- Uuid cmInitiatorObjectUuid,
+ DceRpc_ObjectUuid cmInitiatorObjectUuid,
boolean pullModuleAlarmAllowed,
boolean nonLegacyStartupMode,
boolean combinedObjectContainerUsed,
@@ -592,7 +669,11 @@ public PnIoCm_Block_ArReqBuilderImpl(
PnIoCm_State state,
int cmInitiatorActivityTimeoutFactor,
int cmInitiatorUdpRtPort,
- String cmInitiatorStationName) {
+ String cmInitiatorStationName,
+ Long reservedField0,
+ Byte reservedField1) {
+ this.blockVersionHigh = blockVersionHigh;
+ this.blockVersionLow = blockVersionLow;
this.arType = arType;
this.arUuid = arUuid;
this.sessionKey = sessionKey;
@@ -610,9 +691,11 @@ public PnIoCm_Block_ArReqBuilderImpl(
this.cmInitiatorActivityTimeoutFactor = cmInitiatorActivityTimeoutFactor;
this.cmInitiatorUdpRtPort = cmInitiatorUdpRtPort;
this.cmInitiatorStationName = cmInitiatorStationName;
+ this.reservedField0 = reservedField0;
+ this.reservedField1 = reservedField1;
}
- public PnIoCm_Block_ArReq build(short blockVersionHigh, short blockVersionLow) {
+ public PnIoCm_Block_ArReq build() {
PnIoCm_Block_ArReq pnIoCm_Block_ArReq =
new PnIoCm_Block_ArReq(
blockVersionHigh,
@@ -634,6 +717,8 @@ public PnIoCm_Block_ArReq build(short blockVersionHigh, short blockVersionLow) {
cmInitiatorActivityTimeoutFactor,
cmInitiatorUdpRtPort,
cmInitiatorStationName);
+ pnIoCm_Block_ArReq.reservedField0 = reservedField0;
+ pnIoCm_Block_ArReq.reservedField1 = reservedField1;
return pnIoCm_Block_ArReq;
}
}
@@ -647,7 +732,9 @@ public boolean equals(Object o) {
return false;
}
PnIoCm_Block_ArReq that = (PnIoCm_Block_ArReq) o;
- return (getArType() == that.getArType())
+ return (getBlockVersionHigh() == that.getBlockVersionHigh())
+ && (getBlockVersionLow() == that.getBlockVersionLow())
+ && (getArType() == that.getArType())
&& (getArUuid() == that.getArUuid())
&& (getSessionKey() == that.getSessionKey())
&& (getCmInitiatorMacAddr() == that.getCmInitiatorMacAddr())
@@ -672,6 +759,8 @@ public boolean equals(Object o) {
public int hashCode() {
return Objects.hash(
super.hashCode(),
+ getBlockVersionHigh(),
+ getBlockVersionLow(),
getArType(),
getArUuid(),
getSessionKey(),
diff --git a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_Block_ArRes.java b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_Block_ArRes.java
index 91661b2bf5f..a2dd45cf1bc 100644
--- a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_Block_ArRes.java
+++ b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_Block_ArRes.java
@@ -43,6 +43,8 @@ public PnIoCm_BlockType getBlockType() {
}
// Properties.
+ protected final short blockVersionHigh;
+ protected final short blockVersionLow;
protected final PnIoCm_ArType arType;
protected final Uuid arUuid;
protected final int sessionKey;
@@ -57,7 +59,9 @@ public PnIoCm_Block_ArRes(
int sessionKey,
MacAddress cmResponderMacAddr,
int responderUDPRTPort) {
- super(blockVersionHigh, blockVersionLow);
+ super();
+ this.blockVersionHigh = blockVersionHigh;
+ this.blockVersionLow = blockVersionLow;
this.arType = arType;
this.arUuid = arUuid;
this.sessionKey = sessionKey;
@@ -65,6 +69,14 @@ public PnIoCm_Block_ArRes(
this.responderUDPRTPort = responderUDPRTPort;
}
+ public short getBlockVersionHigh() {
+ return blockVersionHigh;
+ }
+
+ public short getBlockVersionLow() {
+ return blockVersionLow;
+ }
+
public PnIoCm_ArType getArType() {
return arType;
}
@@ -91,6 +103,29 @@ protected void serializePnIoCm_BlockChild(WriteBuffer writeBuffer) throws Serial
int startPos = positionAware.getPos();
writeBuffer.pushContext("PnIoCm_Block_ArRes");
+ // Implicit Field (blockLength) (Used for parsing, but its value is not stored as it's
+ // implicitly given by the objects content)
+ int blockLength = (int) ((getLengthInBytes()) - (4));
+ writeImplicitField(
+ "blockLength",
+ blockLength,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Simple Field (blockVersionHigh)
+ writeSimpleField(
+ "blockVersionHigh",
+ blockVersionHigh,
+ writeUnsignedShort(writeBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Simple Field (blockVersionLow)
+ writeSimpleField(
+ "blockVersionLow",
+ blockVersionLow,
+ writeUnsignedShort(writeBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
// Simple Field (arType)
writeSimpleEnumField(
"arType",
@@ -141,6 +176,15 @@ public int getLengthInBits() {
int lengthInBits = super.getLengthInBits();
PnIoCm_Block_ArRes _value = this;
+ // Implicit Field (blockLength)
+ lengthInBits += 16;
+
+ // Simple field (blockVersionHigh)
+ lengthInBits += 8;
+
+ // Simple field (blockVersionLow)
+ lengthInBits += 8;
+
// Simple field (arType)
lengthInBits += 16;
@@ -166,6 +210,24 @@ public static PnIoCm_BlockBuilder staticParsePnIoCm_BlockBuilder(ReadBuffer read
int startPos = positionAware.getPos();
int curPos;
+ int blockLength =
+ readImplicitField(
+ "blockLength",
+ readUnsignedInt(readBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ short blockVersionHigh =
+ readSimpleField(
+ "blockVersionHigh",
+ readUnsignedShort(readBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ short blockVersionLow =
+ readSimpleField(
+ "blockVersionLow",
+ readUnsignedShort(readBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
PnIoCm_ArType arType =
readEnumField(
"arType",
@@ -201,10 +263,18 @@ public static PnIoCm_BlockBuilder staticParsePnIoCm_BlockBuilder(ReadBuffer read
readBuffer.closeContext("PnIoCm_Block_ArRes");
// Create the instance
return new PnIoCm_Block_ArResBuilderImpl(
- arType, arUuid, sessionKey, cmResponderMacAddr, responderUDPRTPort);
+ blockVersionHigh,
+ blockVersionLow,
+ arType,
+ arUuid,
+ sessionKey,
+ cmResponderMacAddr,
+ responderUDPRTPort);
}
public static class PnIoCm_Block_ArResBuilderImpl implements PnIoCm_Block.PnIoCm_BlockBuilder {
+ private final short blockVersionHigh;
+ private final short blockVersionLow;
private final PnIoCm_ArType arType;
private final Uuid arUuid;
private final int sessionKey;
@@ -212,11 +282,15 @@ public static class PnIoCm_Block_ArResBuilderImpl implements PnIoCm_Block.PnIoCm
private final int responderUDPRTPort;
public PnIoCm_Block_ArResBuilderImpl(
+ short blockVersionHigh,
+ short blockVersionLow,
PnIoCm_ArType arType,
Uuid arUuid,
int sessionKey,
MacAddress cmResponderMacAddr,
int responderUDPRTPort) {
+ this.blockVersionHigh = blockVersionHigh;
+ this.blockVersionLow = blockVersionLow;
this.arType = arType;
this.arUuid = arUuid;
this.sessionKey = sessionKey;
@@ -224,7 +298,7 @@ public PnIoCm_Block_ArResBuilderImpl(
this.responderUDPRTPort = responderUDPRTPort;
}
- public PnIoCm_Block_ArRes build(short blockVersionHigh, short blockVersionLow) {
+ public PnIoCm_Block_ArRes build() {
PnIoCm_Block_ArRes pnIoCm_Block_ArRes =
new PnIoCm_Block_ArRes(
blockVersionHigh,
@@ -247,7 +321,9 @@ public boolean equals(Object o) {
return false;
}
PnIoCm_Block_ArRes that = (PnIoCm_Block_ArRes) o;
- return (getArType() == that.getArType())
+ return (getBlockVersionHigh() == that.getBlockVersionHigh())
+ && (getBlockVersionLow() == that.getBlockVersionLow())
+ && (getArType() == that.getArType())
&& (getArUuid() == that.getArUuid())
&& (getSessionKey() == that.getSessionKey())
&& (getCmResponderMacAddr() == that.getCmResponderMacAddr())
@@ -260,6 +336,8 @@ public boolean equals(Object o) {
public int hashCode() {
return Objects.hash(
super.hashCode(),
+ getBlockVersionHigh(),
+ getBlockVersionLow(),
getArType(),
getArUuid(),
getSessionKey(),
diff --git a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_Block_ArServer.java b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_Block_ArServer.java
index 654d09487d2..060a4aa8897 100644
--- a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_Block_ArServer.java
+++ b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_Block_ArServer.java
@@ -42,8 +42,29 @@ public PnIoCm_BlockType getBlockType() {
return PnIoCm_BlockType.AR_SERVER_BLOCK;
}
- public PnIoCm_Block_ArServer(short blockVersionHigh, short blockVersionLow) {
- super(blockVersionHigh, blockVersionLow);
+ // Properties.
+ protected final short blockVersionHigh;
+ protected final short blockVersionLow;
+ protected final PascalString stationName;
+
+ public PnIoCm_Block_ArServer(
+ short blockVersionHigh, short blockVersionLow, PascalString stationName) {
+ super();
+ this.blockVersionHigh = blockVersionHigh;
+ this.blockVersionLow = blockVersionLow;
+ this.stationName = stationName;
+ }
+
+ public short getBlockVersionHigh() {
+ return blockVersionHigh;
+ }
+
+ public short getBlockVersionLow() {
+ return blockVersionLow;
+ }
+
+ public PascalString getStationName() {
+ return stationName;
}
@Override
@@ -52,6 +73,44 @@ protected void serializePnIoCm_BlockChild(WriteBuffer writeBuffer) throws Serial
int startPos = positionAware.getPos();
writeBuffer.pushContext("PnIoCm_Block_ArServer");
+ // Implicit Field (blockLength) (Used for parsing, but its value is not stored as it's
+ // implicitly given by the objects content)
+ int blockLength = (int) ((getLengthInBytes()) - (4));
+ writeImplicitField(
+ "blockLength",
+ blockLength,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Simple Field (blockVersionHigh)
+ writeSimpleField(
+ "blockVersionHigh",
+ blockVersionHigh,
+ writeUnsignedShort(writeBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Simple Field (blockVersionLow)
+ writeSimpleField(
+ "blockVersionLow",
+ blockVersionLow,
+ writeUnsignedShort(writeBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Simple Field (stationName)
+ writeSimpleField(
+ "stationName",
+ stationName,
+ new DataWriterComplexDefault<>(writeBuffer),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Padding Field (padding)
+ writePaddingField(
+ "padding",
+ (int) (((20) - (6)) - ((stationName.getStringLength()))),
+ (short) 0x00,
+ writeUnsignedShort(writeBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
writeBuffer.popContext("PnIoCm_Block_ArServer");
}
@@ -65,6 +124,24 @@ public int getLengthInBits() {
int lengthInBits = super.getLengthInBits();
PnIoCm_Block_ArServer _value = this;
+ // Implicit Field (blockLength)
+ lengthInBits += 16;
+
+ // Simple field (blockVersionHigh)
+ lengthInBits += 8;
+
+ // Simple field (blockVersionLow)
+ lengthInBits += 8;
+
+ // Simple field (stationName)
+ lengthInBits += stationName.getLengthInBits();
+
+ // Padding Field (padding)
+ int _timesPadding = (int) (((20) - (6)) - ((stationName.getStringLength())));
+ while (_timesPadding-- > 0) {
+ lengthInBits += 8;
+ }
+
return lengthInBits;
}
@@ -75,18 +152,55 @@ public static PnIoCm_BlockBuilder staticParsePnIoCm_BlockBuilder(ReadBuffer read
int startPos = positionAware.getPos();
int curPos;
+ int blockLength =
+ readImplicitField(
+ "blockLength",
+ readUnsignedInt(readBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ short blockVersionHigh =
+ readSimpleField(
+ "blockVersionHigh",
+ readUnsignedShort(readBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ short blockVersionLow =
+ readSimpleField(
+ "blockVersionLow",
+ readUnsignedShort(readBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ PascalString stationName =
+ readSimpleField(
+ "stationName",
+ new DataReaderComplexDefault<>(() -> PascalString.staticParse(readBuffer), readBuffer),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ readPaddingField(
+ readUnsignedShort(readBuffer, 8),
+ (int) (((20) - (6)) - ((stationName.getStringLength()))),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
readBuffer.closeContext("PnIoCm_Block_ArServer");
// Create the instance
- return new PnIoCm_Block_ArServerBuilderImpl();
+ return new PnIoCm_Block_ArServerBuilderImpl(blockVersionHigh, blockVersionLow, stationName);
}
public static class PnIoCm_Block_ArServerBuilderImpl implements PnIoCm_Block.PnIoCm_BlockBuilder {
+ private final short blockVersionHigh;
+ private final short blockVersionLow;
+ private final PascalString stationName;
+
+ public PnIoCm_Block_ArServerBuilderImpl(
+ short blockVersionHigh, short blockVersionLow, PascalString stationName) {
+ this.blockVersionHigh = blockVersionHigh;
+ this.blockVersionLow = blockVersionLow;
+ this.stationName = stationName;
+ }
- public PnIoCm_Block_ArServerBuilderImpl() {}
-
- public PnIoCm_Block_ArServer build(short blockVersionHigh, short blockVersionLow) {
+ public PnIoCm_Block_ArServer build() {
PnIoCm_Block_ArServer pnIoCm_Block_ArServer =
- new PnIoCm_Block_ArServer(blockVersionHigh, blockVersionLow);
+ new PnIoCm_Block_ArServer(blockVersionHigh, blockVersionLow, stationName);
return pnIoCm_Block_ArServer;
}
}
@@ -100,12 +214,17 @@ public boolean equals(Object o) {
return false;
}
PnIoCm_Block_ArServer that = (PnIoCm_Block_ArServer) o;
- return super.equals(that) && true;
+ return (getBlockVersionHigh() == that.getBlockVersionHigh())
+ && (getBlockVersionLow() == that.getBlockVersionLow())
+ && (getStationName() == that.getStationName())
+ && super.equals(that)
+ && true;
}
@Override
public int hashCode() {
- return Objects.hash(super.hashCode());
+ return Objects.hash(
+ super.hashCode(), getBlockVersionHigh(), getBlockVersionLow(), getStationName());
}
@Override
diff --git a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_Block_ExpectedSubmoduleReq.java b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_Block_ExpectedSubmoduleReq.java
index 50c6f6c6fd5..f60a061b8b6 100644
--- a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_Block_ExpectedSubmoduleReq.java
+++ b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_Block_ExpectedSubmoduleReq.java
@@ -43,16 +43,28 @@ public PnIoCm_BlockType getBlockType() {
}
// Properties.
+ protected final short blockVersionHigh;
+ protected final short blockVersionLow;
protected final List apis;
public PnIoCm_Block_ExpectedSubmoduleReq(
short blockVersionHigh,
short blockVersionLow,
List apis) {
- super(blockVersionHigh, blockVersionLow);
+ super();
+ this.blockVersionHigh = blockVersionHigh;
+ this.blockVersionLow = blockVersionLow;
this.apis = apis;
}
+ public short getBlockVersionHigh() {
+ return blockVersionHigh;
+ }
+
+ public short getBlockVersionLow() {
+ return blockVersionLow;
+ }
+
public List getApis() {
return apis;
}
@@ -63,6 +75,29 @@ protected void serializePnIoCm_BlockChild(WriteBuffer writeBuffer) throws Serial
int startPos = positionAware.getPos();
writeBuffer.pushContext("PnIoCm_Block_ExpectedSubmoduleReq");
+ // Implicit Field (blockLength) (Used for parsing, but its value is not stored as it's
+ // implicitly given by the objects content)
+ int blockLength = (int) ((getLengthInBytes()) - (4));
+ writeImplicitField(
+ "blockLength",
+ blockLength,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Simple Field (blockVersionHigh)
+ writeSimpleField(
+ "blockVersionHigh",
+ blockVersionHigh,
+ writeUnsignedShort(writeBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Simple Field (blockVersionLow)
+ writeSimpleField(
+ "blockVersionLow",
+ blockVersionLow,
+ writeUnsignedShort(writeBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
// Implicit Field (numberOfApis) (Used for parsing, but its value is not stored as it's
// implicitly given by the objects content)
int numberOfApis = (int) (COUNT(getApis()));
@@ -89,6 +124,15 @@ public int getLengthInBits() {
int lengthInBits = super.getLengthInBits();
PnIoCm_Block_ExpectedSubmoduleReq _value = this;
+ // Implicit Field (blockLength)
+ lengthInBits += 16;
+
+ // Simple field (blockVersionHigh)
+ lengthInBits += 8;
+
+ // Simple field (blockVersionLow)
+ lengthInBits += 8;
+
// Implicit Field (numberOfApis)
lengthInBits += 16;
@@ -111,6 +155,24 @@ public static PnIoCm_BlockBuilder staticParsePnIoCm_BlockBuilder(ReadBuffer read
int startPos = positionAware.getPos();
int curPos;
+ int blockLength =
+ readImplicitField(
+ "blockLength",
+ readUnsignedInt(readBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ short blockVersionHigh =
+ readSimpleField(
+ "blockVersionHigh",
+ readUnsignedShort(readBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ short blockVersionLow =
+ readSimpleField(
+ "blockVersionLow",
+ readUnsignedShort(readBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
int numberOfApis =
readImplicitField(
"numberOfApis",
@@ -127,19 +189,26 @@ public static PnIoCm_BlockBuilder staticParsePnIoCm_BlockBuilder(ReadBuffer read
readBuffer.closeContext("PnIoCm_Block_ExpectedSubmoduleReq");
// Create the instance
- return new PnIoCm_Block_ExpectedSubmoduleReqBuilderImpl(apis);
+ return new PnIoCm_Block_ExpectedSubmoduleReqBuilderImpl(
+ blockVersionHigh, blockVersionLow, apis);
}
public static class PnIoCm_Block_ExpectedSubmoduleReqBuilderImpl
implements PnIoCm_Block.PnIoCm_BlockBuilder {
+ private final short blockVersionHigh;
+ private final short blockVersionLow;
private final List apis;
public PnIoCm_Block_ExpectedSubmoduleReqBuilderImpl(
+ short blockVersionHigh,
+ short blockVersionLow,
List apis) {
+ this.blockVersionHigh = blockVersionHigh;
+ this.blockVersionLow = blockVersionLow;
this.apis = apis;
}
- public PnIoCm_Block_ExpectedSubmoduleReq build(short blockVersionHigh, short blockVersionLow) {
+ public PnIoCm_Block_ExpectedSubmoduleReq build() {
PnIoCm_Block_ExpectedSubmoduleReq pnIoCm_Block_ExpectedSubmoduleReq =
new PnIoCm_Block_ExpectedSubmoduleReq(blockVersionHigh, blockVersionLow, apis);
return pnIoCm_Block_ExpectedSubmoduleReq;
@@ -155,12 +224,16 @@ public boolean equals(Object o) {
return false;
}
PnIoCm_Block_ExpectedSubmoduleReq that = (PnIoCm_Block_ExpectedSubmoduleReq) o;
- return (getApis() == that.getApis()) && super.equals(that) && true;
+ return (getBlockVersionHigh() == that.getBlockVersionHigh())
+ && (getBlockVersionLow() == that.getBlockVersionLow())
+ && (getApis() == that.getApis())
+ && super.equals(that)
+ && true;
}
@Override
public int hashCode() {
- return Objects.hash(super.hashCode(), getApis());
+ return Objects.hash(super.hashCode(), getBlockVersionHigh(), getBlockVersionLow(), getApis());
}
@Override
diff --git a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_Block_IoCrReq.java b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_Block_IoCrReq.java
index e011498ff26..64a92096586 100644
--- a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_Block_IoCrReq.java
+++ b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_Block_IoCrReq.java
@@ -43,6 +43,8 @@ public PnIoCm_BlockType getBlockType() {
}
// Properties.
+ protected final short blockVersionHigh;
+ protected final short blockVersionLow;
protected final PnIoCm_IoCrType ioCrType;
protected final int ioCrReference;
protected final int lt;
@@ -64,6 +66,10 @@ public PnIoCm_BlockType getBlockType() {
protected final MacAddress ioCrMulticastMacAdr;
protected final List apis;
+ // Reserved Fields
+ private Long reservedField0;
+ private Short reservedField1;
+
public PnIoCm_Block_IoCrReq(
short blockVersionHigh,
short blockVersionLow,
@@ -87,7 +93,9 @@ public PnIoCm_Block_IoCrReq(
int ioCrTagHeader,
MacAddress ioCrMulticastMacAdr,
List apis) {
- super(blockVersionHigh, blockVersionLow);
+ super();
+ this.blockVersionHigh = blockVersionHigh;
+ this.blockVersionLow = blockVersionLow;
this.ioCrType = ioCrType;
this.ioCrReference = ioCrReference;
this.lt = lt;
@@ -110,6 +118,14 @@ public PnIoCm_Block_IoCrReq(
this.apis = apis;
}
+ public short getBlockVersionHigh() {
+ return blockVersionHigh;
+ }
+
+ public short getBlockVersionLow() {
+ return blockVersionLow;
+ }
+
public PnIoCm_IoCrType getIoCrType() {
return ioCrType;
}
@@ -196,6 +212,29 @@ protected void serializePnIoCm_BlockChild(WriteBuffer writeBuffer) throws Serial
int startPos = positionAware.getPos();
writeBuffer.pushContext("PnIoCm_Block_IoCrReq");
+ // Implicit Field (blockLength) (Used for parsing, but its value is not stored as it's
+ // implicitly given by the objects content)
+ int blockLength = (int) ((getLengthInBytes()) - (4));
+ writeImplicitField(
+ "blockLength",
+ blockLength,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Simple Field (blockVersionHigh)
+ writeSimpleField(
+ "blockVersionHigh",
+ blockVersionHigh,
+ writeUnsignedShort(writeBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Simple Field (blockVersionLow)
+ writeSimpleField(
+ "blockVersionLow",
+ blockVersionLow,
+ writeUnsignedShort(writeBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
// Simple Field (ioCrType)
writeSimpleEnumField(
"ioCrType",
@@ -243,7 +282,7 @@ protected void serializePnIoCm_BlockChild(WriteBuffer writeBuffer) throws Serial
// Reserved Field (reserved)
writeReservedField(
"reserved",
- (long) 0x0000,
+ reservedField0 != null ? reservedField0 : (long) 0x0000,
writeUnsignedLong(writeBuffer, 17),
WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
@@ -257,7 +296,7 @@ protected void serializePnIoCm_BlockChild(WriteBuffer writeBuffer) throws Serial
// Reserved Field (reserved)
writeReservedField(
"reserved",
- (short) 0x00,
+ reservedField1 != null ? reservedField1 : (short) 0x00,
writeUnsignedShort(writeBuffer, 7),
WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
@@ -373,6 +412,15 @@ public int getLengthInBits() {
int lengthInBits = super.getLengthInBits();
PnIoCm_Block_IoCrReq _value = this;
+ // Implicit Field (blockLength)
+ lengthInBits += 16;
+
+ // Simple field (blockVersionHigh)
+ lengthInBits += 8;
+
+ // Simple field (blockVersionLow)
+ lengthInBits += 8;
+
// Simple field (ioCrType)
lengthInBits += 16;
@@ -458,6 +506,24 @@ public static PnIoCm_BlockBuilder staticParsePnIoCm_BlockBuilder(ReadBuffer read
int startPos = positionAware.getPos();
int curPos;
+ int blockLength =
+ readImplicitField(
+ "blockLength",
+ readUnsignedInt(readBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ short blockVersionHigh =
+ readSimpleField(
+ "blockVersionHigh",
+ readUnsignedShort(readBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ short blockVersionLow =
+ readSimpleField(
+ "blockVersionLow",
+ readUnsignedShort(readBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
PnIoCm_IoCrType ioCrType =
readEnumField(
"ioCrType",
@@ -605,6 +671,8 @@ public static PnIoCm_BlockBuilder staticParsePnIoCm_BlockBuilder(ReadBuffer read
readBuffer.closeContext("PnIoCm_Block_IoCrReq");
// Create the instance
return new PnIoCm_Block_IoCrReqBuilderImpl(
+ blockVersionHigh,
+ blockVersionLow,
ioCrType,
ioCrReference,
lt,
@@ -624,10 +692,14 @@ public static PnIoCm_BlockBuilder staticParsePnIoCm_BlockBuilder(ReadBuffer read
dataHoldFactor,
ioCrTagHeader,
ioCrMulticastMacAdr,
- apis);
+ apis,
+ reservedField0,
+ reservedField1);
}
public static class PnIoCm_Block_IoCrReqBuilderImpl implements PnIoCm_Block.PnIoCm_BlockBuilder {
+ private final short blockVersionHigh;
+ private final short blockVersionLow;
private final PnIoCm_IoCrType ioCrType;
private final int ioCrReference;
private final int lt;
@@ -648,8 +720,12 @@ public static class PnIoCm_Block_IoCrReqBuilderImpl implements PnIoCm_Block.PnIo
private final int ioCrTagHeader;
private final MacAddress ioCrMulticastMacAdr;
private final List apis;
+ private final Long reservedField0;
+ private final Short reservedField1;
public PnIoCm_Block_IoCrReqBuilderImpl(
+ short blockVersionHigh,
+ short blockVersionLow,
PnIoCm_IoCrType ioCrType,
int ioCrReference,
int lt,
@@ -669,7 +745,11 @@ public PnIoCm_Block_IoCrReqBuilderImpl(
int dataHoldFactor,
int ioCrTagHeader,
MacAddress ioCrMulticastMacAdr,
- List apis) {
+ List apis,
+ Long reservedField0,
+ Short reservedField1) {
+ this.blockVersionHigh = blockVersionHigh;
+ this.blockVersionLow = blockVersionLow;
this.ioCrType = ioCrType;
this.ioCrReference = ioCrReference;
this.lt = lt;
@@ -690,9 +770,11 @@ public PnIoCm_Block_IoCrReqBuilderImpl(
this.ioCrTagHeader = ioCrTagHeader;
this.ioCrMulticastMacAdr = ioCrMulticastMacAdr;
this.apis = apis;
+ this.reservedField0 = reservedField0;
+ this.reservedField1 = reservedField1;
}
- public PnIoCm_Block_IoCrReq build(short blockVersionHigh, short blockVersionLow) {
+ public PnIoCm_Block_IoCrReq build() {
PnIoCm_Block_IoCrReq pnIoCm_Block_IoCrReq =
new PnIoCm_Block_IoCrReq(
blockVersionHigh,
@@ -717,6 +799,8 @@ public PnIoCm_Block_IoCrReq build(short blockVersionHigh, short blockVersionLow)
ioCrTagHeader,
ioCrMulticastMacAdr,
apis);
+ pnIoCm_Block_IoCrReq.reservedField0 = reservedField0;
+ pnIoCm_Block_IoCrReq.reservedField1 = reservedField1;
return pnIoCm_Block_IoCrReq;
}
}
@@ -730,7 +814,9 @@ public boolean equals(Object o) {
return false;
}
PnIoCm_Block_IoCrReq that = (PnIoCm_Block_IoCrReq) o;
- return (getIoCrType() == that.getIoCrType())
+ return (getBlockVersionHigh() == that.getBlockVersionHigh())
+ && (getBlockVersionLow() == that.getBlockVersionLow())
+ && (getIoCrType() == that.getIoCrType())
&& (getIoCrReference() == that.getIoCrReference())
&& (getLt() == that.getLt())
&& (getFullSubFrameStructure() == that.getFullSubFrameStructure())
@@ -758,6 +844,8 @@ public boolean equals(Object o) {
public int hashCode() {
return Objects.hash(
super.hashCode(),
+ getBlockVersionHigh(),
+ getBlockVersionLow(),
getIoCrType(),
getIoCrReference(),
getLt(),
diff --git a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_Block_IoCrRes.java b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_Block_IoCrRes.java
index 6586e96b687..49163527680 100644
--- a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_Block_IoCrRes.java
+++ b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_Block_IoCrRes.java
@@ -43,6 +43,8 @@ public PnIoCm_BlockType getBlockType() {
}
// Properties.
+ protected final short blockVersionHigh;
+ protected final short blockVersionLow;
protected final PnIoCm_IoCrType ioCrType;
protected final int ioCrReference;
protected final int frameId;
@@ -53,12 +55,22 @@ public PnIoCm_Block_IoCrRes(
PnIoCm_IoCrType ioCrType,
int ioCrReference,
int frameId) {
- super(blockVersionHigh, blockVersionLow);
+ super();
+ this.blockVersionHigh = blockVersionHigh;
+ this.blockVersionLow = blockVersionLow;
this.ioCrType = ioCrType;
this.ioCrReference = ioCrReference;
this.frameId = frameId;
}
+ public short getBlockVersionHigh() {
+ return blockVersionHigh;
+ }
+
+ public short getBlockVersionLow() {
+ return blockVersionLow;
+ }
+
public PnIoCm_IoCrType getIoCrType() {
return ioCrType;
}
@@ -77,6 +89,29 @@ protected void serializePnIoCm_BlockChild(WriteBuffer writeBuffer) throws Serial
int startPos = positionAware.getPos();
writeBuffer.pushContext("PnIoCm_Block_IoCrRes");
+ // Implicit Field (blockLength) (Used for parsing, but its value is not stored as it's
+ // implicitly given by the objects content)
+ int blockLength = (int) ((getLengthInBytes()) - (4));
+ writeImplicitField(
+ "blockLength",
+ blockLength,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Simple Field (blockVersionHigh)
+ writeSimpleField(
+ "blockVersionHigh",
+ blockVersionHigh,
+ writeUnsignedShort(writeBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Simple Field (blockVersionLow)
+ writeSimpleField(
+ "blockVersionLow",
+ blockVersionLow,
+ writeUnsignedShort(writeBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
// Simple Field (ioCrType)
writeSimpleEnumField(
"ioCrType",
@@ -113,6 +148,15 @@ public int getLengthInBits() {
int lengthInBits = super.getLengthInBits();
PnIoCm_Block_IoCrRes _value = this;
+ // Implicit Field (blockLength)
+ lengthInBits += 16;
+
+ // Simple field (blockVersionHigh)
+ lengthInBits += 8;
+
+ // Simple field (blockVersionLow)
+ lengthInBits += 8;
+
// Simple field (ioCrType)
lengthInBits += 16;
@@ -132,6 +176,24 @@ public static PnIoCm_BlockBuilder staticParsePnIoCm_BlockBuilder(ReadBuffer read
int startPos = positionAware.getPos();
int curPos;
+ int blockLength =
+ readImplicitField(
+ "blockLength",
+ readUnsignedInt(readBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ short blockVersionHigh =
+ readSimpleField(
+ "blockVersionHigh",
+ readUnsignedShort(readBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ short blockVersionLow =
+ readSimpleField(
+ "blockVersionLow",
+ readUnsignedShort(readBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
PnIoCm_IoCrType ioCrType =
readEnumField(
"ioCrType",
@@ -154,22 +216,31 @@ public static PnIoCm_BlockBuilder staticParsePnIoCm_BlockBuilder(ReadBuffer read
readBuffer.closeContext("PnIoCm_Block_IoCrRes");
// Create the instance
- return new PnIoCm_Block_IoCrResBuilderImpl(ioCrType, ioCrReference, frameId);
+ return new PnIoCm_Block_IoCrResBuilderImpl(
+ blockVersionHigh, blockVersionLow, ioCrType, ioCrReference, frameId);
}
public static class PnIoCm_Block_IoCrResBuilderImpl implements PnIoCm_Block.PnIoCm_BlockBuilder {
+ private final short blockVersionHigh;
+ private final short blockVersionLow;
private final PnIoCm_IoCrType ioCrType;
private final int ioCrReference;
private final int frameId;
public PnIoCm_Block_IoCrResBuilderImpl(
- PnIoCm_IoCrType ioCrType, int ioCrReference, int frameId) {
+ short blockVersionHigh,
+ short blockVersionLow,
+ PnIoCm_IoCrType ioCrType,
+ int ioCrReference,
+ int frameId) {
+ this.blockVersionHigh = blockVersionHigh;
+ this.blockVersionLow = blockVersionLow;
this.ioCrType = ioCrType;
this.ioCrReference = ioCrReference;
this.frameId = frameId;
}
- public PnIoCm_Block_IoCrRes build(short blockVersionHigh, short blockVersionLow) {
+ public PnIoCm_Block_IoCrRes build() {
PnIoCm_Block_IoCrRes pnIoCm_Block_IoCrRes =
new PnIoCm_Block_IoCrRes(
blockVersionHigh, blockVersionLow, ioCrType, ioCrReference, frameId);
@@ -186,7 +257,9 @@ public boolean equals(Object o) {
return false;
}
PnIoCm_Block_IoCrRes that = (PnIoCm_Block_IoCrRes) o;
- return (getIoCrType() == that.getIoCrType())
+ return (getBlockVersionHigh() == that.getBlockVersionHigh())
+ && (getBlockVersionLow() == that.getBlockVersionLow())
+ && (getIoCrType() == that.getIoCrType())
&& (getIoCrReference() == that.getIoCrReference())
&& (getFrameId() == that.getFrameId())
&& super.equals(that)
@@ -195,7 +268,13 @@ public boolean equals(Object o) {
@Override
public int hashCode() {
- return Objects.hash(super.hashCode(), getIoCrType(), getIoCrReference(), getFrameId());
+ return Objects.hash(
+ super.hashCode(),
+ getBlockVersionHigh(),
+ getBlockVersionLow(),
+ getIoCrType(),
+ getIoCrReference(),
+ getFrameId());
}
@Override
diff --git a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_Block_ModuleDiff.java b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_Block_ModuleDiff.java
index 55a99a06cd7..ab6f2fcc81e 100644
--- a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_Block_ModuleDiff.java
+++ b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_Block_ModuleDiff.java
@@ -43,14 +43,26 @@ public PnIoCm_BlockType getBlockType() {
}
// Properties.
+ protected final short blockVersionHigh;
+ protected final short blockVersionLow;
protected final List apis;
public PnIoCm_Block_ModuleDiff(
short blockVersionHigh, short blockVersionLow, List apis) {
- super(blockVersionHigh, blockVersionLow);
+ super();
+ this.blockVersionHigh = blockVersionHigh;
+ this.blockVersionLow = blockVersionLow;
this.apis = apis;
}
+ public short getBlockVersionHigh() {
+ return blockVersionHigh;
+ }
+
+ public short getBlockVersionLow() {
+ return blockVersionLow;
+ }
+
public List getApis() {
return apis;
}
@@ -61,6 +73,29 @@ protected void serializePnIoCm_BlockChild(WriteBuffer writeBuffer) throws Serial
int startPos = positionAware.getPos();
writeBuffer.pushContext("PnIoCm_Block_ModuleDiff");
+ // Implicit Field (blockLength) (Used for parsing, but its value is not stored as it's
+ // implicitly given by the objects content)
+ int blockLength = (int) ((getLengthInBytes()) - (4));
+ writeImplicitField(
+ "blockLength",
+ blockLength,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Simple Field (blockVersionHigh)
+ writeSimpleField(
+ "blockVersionHigh",
+ blockVersionHigh,
+ writeUnsignedShort(writeBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Simple Field (blockVersionLow)
+ writeSimpleField(
+ "blockVersionLow",
+ blockVersionLow,
+ writeUnsignedShort(writeBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
// Implicit Field (numberOfApis) (Used for parsing, but its value is not stored as it's
// implicitly given by the objects content)
int numberOfApis = (int) (COUNT(getApis()));
@@ -87,6 +122,15 @@ public int getLengthInBits() {
int lengthInBits = super.getLengthInBits();
PnIoCm_Block_ModuleDiff _value = this;
+ // Implicit Field (blockLength)
+ lengthInBits += 16;
+
+ // Simple field (blockVersionHigh)
+ lengthInBits += 8;
+
+ // Simple field (blockVersionLow)
+ lengthInBits += 8;
+
// Implicit Field (numberOfApis)
lengthInBits += 16;
@@ -109,6 +153,24 @@ public static PnIoCm_BlockBuilder staticParsePnIoCm_BlockBuilder(ReadBuffer read
int startPos = positionAware.getPos();
int curPos;
+ int blockLength =
+ readImplicitField(
+ "blockLength",
+ readUnsignedInt(readBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ short blockVersionHigh =
+ readSimpleField(
+ "blockVersionHigh",
+ readUnsignedShort(readBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ short blockVersionLow =
+ readSimpleField(
+ "blockVersionLow",
+ readUnsignedShort(readBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
int numberOfApis =
readImplicitField(
"numberOfApis",
@@ -125,18 +187,23 @@ public static PnIoCm_BlockBuilder staticParsePnIoCm_BlockBuilder(ReadBuffer read
readBuffer.closeContext("PnIoCm_Block_ModuleDiff");
// Create the instance
- return new PnIoCm_Block_ModuleDiffBuilderImpl(apis);
+ return new PnIoCm_Block_ModuleDiffBuilderImpl(blockVersionHigh, blockVersionLow, apis);
}
public static class PnIoCm_Block_ModuleDiffBuilderImpl
implements PnIoCm_Block.PnIoCm_BlockBuilder {
+ private final short blockVersionHigh;
+ private final short blockVersionLow;
private final List apis;
- public PnIoCm_Block_ModuleDiffBuilderImpl(List apis) {
+ public PnIoCm_Block_ModuleDiffBuilderImpl(
+ short blockVersionHigh, short blockVersionLow, List apis) {
+ this.blockVersionHigh = blockVersionHigh;
+ this.blockVersionLow = blockVersionLow;
this.apis = apis;
}
- public PnIoCm_Block_ModuleDiff build(short blockVersionHigh, short blockVersionLow) {
+ public PnIoCm_Block_ModuleDiff build() {
PnIoCm_Block_ModuleDiff pnIoCm_Block_ModuleDiff =
new PnIoCm_Block_ModuleDiff(blockVersionHigh, blockVersionLow, apis);
return pnIoCm_Block_ModuleDiff;
@@ -152,12 +219,16 @@ public boolean equals(Object o) {
return false;
}
PnIoCm_Block_ModuleDiff that = (PnIoCm_Block_ModuleDiff) o;
- return (getApis() == that.getApis()) && super.equals(that) && true;
+ return (getBlockVersionHigh() == that.getBlockVersionHigh())
+ && (getBlockVersionLow() == that.getBlockVersionLow())
+ && (getApis() == that.getApis())
+ && super.equals(that)
+ && true;
}
@Override
public int hashCode() {
- return Objects.hash(super.hashCode(), getApis());
+ return Objects.hash(super.hashCode(), getBlockVersionHigh(), getBlockVersionLow(), getApis());
}
@Override
diff --git a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_Control_Request.java b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_Control_Request.java
new file mode 100644
index 00000000000..b54ac870c17
--- /dev/null
+++ b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_Control_Request.java
@@ -0,0 +1,362 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.plc4x.java.profinet.readwrite;
+
+import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*;
+import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*;
+import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*;
+import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*;
+import static org.apache.plc4x.java.spi.generation.StaticHelper.*;
+
+import java.time.*;
+import java.util.*;
+import org.apache.plc4x.java.api.exceptions.*;
+import org.apache.plc4x.java.api.value.*;
+import org.apache.plc4x.java.spi.codegen.*;
+import org.apache.plc4x.java.spi.codegen.fields.*;
+import org.apache.plc4x.java.spi.codegen.io.*;
+import org.apache.plc4x.java.spi.generation.*;
+
+// Code generated by code-generation. DO NOT EDIT.
+
+public class PnIoCm_Control_Request extends PnIoCm_Block implements Message {
+
+ // Accessors for discriminator values.
+ public PnIoCm_BlockType getBlockType() {
+ return PnIoCm_BlockType.IOD_CONTROL_REQ;
+ }
+
+ // Properties.
+ protected final short blockVersionHigh;
+ protected final short blockVersionLow;
+ protected final Uuid arUuid;
+ protected final int sessionKey;
+ protected final int controlCommand;
+
+ // Reserved Fields
+ private Integer reservedField0;
+ private Integer reservedField1;
+ private Integer reservedField2;
+
+ public PnIoCm_Control_Request(
+ short blockVersionHigh,
+ short blockVersionLow,
+ Uuid arUuid,
+ int sessionKey,
+ int controlCommand) {
+ super();
+ this.blockVersionHigh = blockVersionHigh;
+ this.blockVersionLow = blockVersionLow;
+ this.arUuid = arUuid;
+ this.sessionKey = sessionKey;
+ this.controlCommand = controlCommand;
+ }
+
+ public short getBlockVersionHigh() {
+ return blockVersionHigh;
+ }
+
+ public short getBlockVersionLow() {
+ return blockVersionLow;
+ }
+
+ public Uuid getArUuid() {
+ return arUuid;
+ }
+
+ public int getSessionKey() {
+ return sessionKey;
+ }
+
+ public int getControlCommand() {
+ return controlCommand;
+ }
+
+ @Override
+ protected void serializePnIoCm_BlockChild(WriteBuffer writeBuffer) throws SerializationException {
+ PositionAware positionAware = writeBuffer;
+ int startPos = positionAware.getPos();
+ writeBuffer.pushContext("PnIoCm_Control_Request");
+
+ // Implicit Field (blockLength) (Used for parsing, but its value is not stored as it's
+ // implicitly given by the objects content)
+ int blockLength = (int) ((getLengthInBytes()) - (4));
+ writeImplicitField(
+ "blockLength",
+ blockLength,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Simple Field (blockVersionHigh)
+ writeSimpleField(
+ "blockVersionHigh",
+ blockVersionHigh,
+ writeUnsignedShort(writeBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Simple Field (blockVersionLow)
+ writeSimpleField(
+ "blockVersionLow",
+ blockVersionLow,
+ writeUnsignedShort(writeBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Reserved Field (reserved)
+ writeReservedField(
+ "reserved",
+ reservedField0 != null ? reservedField0 : (int) 0x0000,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Simple Field (arUuid)
+ writeSimpleField(
+ "arUuid",
+ arUuid,
+ new DataWriterComplexDefault<>(writeBuffer),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Simple Field (sessionKey)
+ writeSimpleField(
+ "sessionKey",
+ sessionKey,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Reserved Field (reserved)
+ writeReservedField(
+ "reserved",
+ reservedField1 != null ? reservedField1 : (int) 0x0000,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Simple Field (controlCommand)
+ writeSimpleField(
+ "controlCommand",
+ controlCommand,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Reserved Field (reserved)
+ writeReservedField(
+ "reserved",
+ reservedField2 != null ? reservedField2 : (int) 0x0000,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ writeBuffer.popContext("PnIoCm_Control_Request");
+ }
+
+ @Override
+ public int getLengthInBytes() {
+ return (int) Math.ceil((float) getLengthInBits() / 8.0);
+ }
+
+ @Override
+ public int getLengthInBits() {
+ int lengthInBits = super.getLengthInBits();
+ PnIoCm_Control_Request _value = this;
+
+ // Implicit Field (blockLength)
+ lengthInBits += 16;
+
+ // Simple field (blockVersionHigh)
+ lengthInBits += 8;
+
+ // Simple field (blockVersionLow)
+ lengthInBits += 8;
+
+ // Reserved Field (reserved)
+ lengthInBits += 16;
+
+ // Simple field (arUuid)
+ lengthInBits += arUuid.getLengthInBits();
+
+ // Simple field (sessionKey)
+ lengthInBits += 16;
+
+ // Reserved Field (reserved)
+ lengthInBits += 16;
+
+ // Simple field (controlCommand)
+ lengthInBits += 16;
+
+ // Reserved Field (reserved)
+ lengthInBits += 16;
+
+ return lengthInBits;
+ }
+
+ public static PnIoCm_BlockBuilder staticParsePnIoCm_BlockBuilder(ReadBuffer readBuffer)
+ throws ParseException {
+ readBuffer.pullContext("PnIoCm_Control_Request");
+ PositionAware positionAware = readBuffer;
+ int startPos = positionAware.getPos();
+ int curPos;
+
+ int blockLength =
+ readImplicitField(
+ "blockLength",
+ readUnsignedInt(readBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ short blockVersionHigh =
+ readSimpleField(
+ "blockVersionHigh",
+ readUnsignedShort(readBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ short blockVersionLow =
+ readSimpleField(
+ "blockVersionLow",
+ readUnsignedShort(readBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ Integer reservedField0 =
+ readReservedField(
+ "reserved",
+ readUnsignedInt(readBuffer, 16),
+ (int) 0x0000,
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ Uuid arUuid =
+ readSimpleField(
+ "arUuid",
+ new DataReaderComplexDefault<>(() -> Uuid.staticParse(readBuffer), readBuffer),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ int sessionKey =
+ readSimpleField(
+ "sessionKey",
+ readUnsignedInt(readBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ Integer reservedField1 =
+ readReservedField(
+ "reserved",
+ readUnsignedInt(readBuffer, 16),
+ (int) 0x0000,
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ int controlCommand =
+ readSimpleField(
+ "controlCommand",
+ readUnsignedInt(readBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ Integer reservedField2 =
+ readReservedField(
+ "reserved",
+ readUnsignedInt(readBuffer, 16),
+ (int) 0x0000,
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ readBuffer.closeContext("PnIoCm_Control_Request");
+ // Create the instance
+ return new PnIoCm_Control_RequestBuilderImpl(
+ blockVersionHigh,
+ blockVersionLow,
+ arUuid,
+ sessionKey,
+ controlCommand,
+ reservedField0,
+ reservedField1,
+ reservedField2);
+ }
+
+ public static class PnIoCm_Control_RequestBuilderImpl
+ implements PnIoCm_Block.PnIoCm_BlockBuilder {
+ private final short blockVersionHigh;
+ private final short blockVersionLow;
+ private final Uuid arUuid;
+ private final int sessionKey;
+ private final int controlCommand;
+ private final Integer reservedField0;
+ private final Integer reservedField1;
+ private final Integer reservedField2;
+
+ public PnIoCm_Control_RequestBuilderImpl(
+ short blockVersionHigh,
+ short blockVersionLow,
+ Uuid arUuid,
+ int sessionKey,
+ int controlCommand,
+ Integer reservedField0,
+ Integer reservedField1,
+ Integer reservedField2) {
+ this.blockVersionHigh = blockVersionHigh;
+ this.blockVersionLow = blockVersionLow;
+ this.arUuid = arUuid;
+ this.sessionKey = sessionKey;
+ this.controlCommand = controlCommand;
+ this.reservedField0 = reservedField0;
+ this.reservedField1 = reservedField1;
+ this.reservedField2 = reservedField2;
+ }
+
+ public PnIoCm_Control_Request build() {
+ PnIoCm_Control_Request pnIoCm_Control_Request =
+ new PnIoCm_Control_Request(
+ blockVersionHigh, blockVersionLow, arUuid, sessionKey, controlCommand);
+ pnIoCm_Control_Request.reservedField0 = reservedField0;
+ pnIoCm_Control_Request.reservedField1 = reservedField1;
+ pnIoCm_Control_Request.reservedField2 = reservedField2;
+ return pnIoCm_Control_Request;
+ }
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (!(o instanceof PnIoCm_Control_Request)) {
+ return false;
+ }
+ PnIoCm_Control_Request that = (PnIoCm_Control_Request) o;
+ return (getBlockVersionHigh() == that.getBlockVersionHigh())
+ && (getBlockVersionLow() == that.getBlockVersionLow())
+ && (getArUuid() == that.getArUuid())
+ && (getSessionKey() == that.getSessionKey())
+ && (getControlCommand() == that.getControlCommand())
+ && super.equals(that)
+ && true;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(
+ super.hashCode(),
+ getBlockVersionHigh(),
+ getBlockVersionLow(),
+ getArUuid(),
+ getSessionKey(),
+ getControlCommand());
+ }
+
+ @Override
+ public String toString() {
+ WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true);
+ try {
+ writeBufferBoxBased.writeSerializable(this);
+ } catch (SerializationException e) {
+ throw new RuntimeException(e);
+ }
+ return "\n" + writeBufferBoxBased.getBox().toString() + "\n";
+ }
+}
diff --git a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_Control_Response.java b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_Control_Response.java
new file mode 100644
index 00000000000..e3e3ac74c96
--- /dev/null
+++ b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_Control_Response.java
@@ -0,0 +1,362 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.plc4x.java.profinet.readwrite;
+
+import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*;
+import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*;
+import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*;
+import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*;
+import static org.apache.plc4x.java.spi.generation.StaticHelper.*;
+
+import java.time.*;
+import java.util.*;
+import org.apache.plc4x.java.api.exceptions.*;
+import org.apache.plc4x.java.api.value.*;
+import org.apache.plc4x.java.spi.codegen.*;
+import org.apache.plc4x.java.spi.codegen.fields.*;
+import org.apache.plc4x.java.spi.codegen.io.*;
+import org.apache.plc4x.java.spi.generation.*;
+
+// Code generated by code-generation. DO NOT EDIT.
+
+public class PnIoCm_Control_Response extends PnIoCm_Block implements Message {
+
+ // Accessors for discriminator values.
+ public PnIoCm_BlockType getBlockType() {
+ return PnIoCm_BlockType.IOD_CONTROL_RES;
+ }
+
+ // Properties.
+ protected final short blockVersionHigh;
+ protected final short blockVersionLow;
+ protected final Uuid arUuid;
+ protected final int sessionKey;
+ protected final int controlCommand;
+
+ // Reserved Fields
+ private Integer reservedField0;
+ private Integer reservedField1;
+ private Integer reservedField2;
+
+ public PnIoCm_Control_Response(
+ short blockVersionHigh,
+ short blockVersionLow,
+ Uuid arUuid,
+ int sessionKey,
+ int controlCommand) {
+ super();
+ this.blockVersionHigh = blockVersionHigh;
+ this.blockVersionLow = blockVersionLow;
+ this.arUuid = arUuid;
+ this.sessionKey = sessionKey;
+ this.controlCommand = controlCommand;
+ }
+
+ public short getBlockVersionHigh() {
+ return blockVersionHigh;
+ }
+
+ public short getBlockVersionLow() {
+ return blockVersionLow;
+ }
+
+ public Uuid getArUuid() {
+ return arUuid;
+ }
+
+ public int getSessionKey() {
+ return sessionKey;
+ }
+
+ public int getControlCommand() {
+ return controlCommand;
+ }
+
+ @Override
+ protected void serializePnIoCm_BlockChild(WriteBuffer writeBuffer) throws SerializationException {
+ PositionAware positionAware = writeBuffer;
+ int startPos = positionAware.getPos();
+ writeBuffer.pushContext("PnIoCm_Control_Response");
+
+ // Implicit Field (blockLength) (Used for parsing, but its value is not stored as it's
+ // implicitly given by the objects content)
+ int blockLength = (int) ((getLengthInBytes()) - (4));
+ writeImplicitField(
+ "blockLength",
+ blockLength,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Simple Field (blockVersionHigh)
+ writeSimpleField(
+ "blockVersionHigh",
+ blockVersionHigh,
+ writeUnsignedShort(writeBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Simple Field (blockVersionLow)
+ writeSimpleField(
+ "blockVersionLow",
+ blockVersionLow,
+ writeUnsignedShort(writeBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Reserved Field (reserved)
+ writeReservedField(
+ "reserved",
+ reservedField0 != null ? reservedField0 : (int) 0x0000,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Simple Field (arUuid)
+ writeSimpleField(
+ "arUuid",
+ arUuid,
+ new DataWriterComplexDefault<>(writeBuffer),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Simple Field (sessionKey)
+ writeSimpleField(
+ "sessionKey",
+ sessionKey,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Reserved Field (reserved)
+ writeReservedField(
+ "reserved",
+ reservedField1 != null ? reservedField1 : (int) 0x0000,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Simple Field (controlCommand)
+ writeSimpleField(
+ "controlCommand",
+ controlCommand,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ // Reserved Field (reserved)
+ writeReservedField(
+ "reserved",
+ reservedField2 != null ? reservedField2 : (int) 0x0000,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ writeBuffer.popContext("PnIoCm_Control_Response");
+ }
+
+ @Override
+ public int getLengthInBytes() {
+ return (int) Math.ceil((float) getLengthInBits() / 8.0);
+ }
+
+ @Override
+ public int getLengthInBits() {
+ int lengthInBits = super.getLengthInBits();
+ PnIoCm_Control_Response _value = this;
+
+ // Implicit Field (blockLength)
+ lengthInBits += 16;
+
+ // Simple field (blockVersionHigh)
+ lengthInBits += 8;
+
+ // Simple field (blockVersionLow)
+ lengthInBits += 8;
+
+ // Reserved Field (reserved)
+ lengthInBits += 16;
+
+ // Simple field (arUuid)
+ lengthInBits += arUuid.getLengthInBits();
+
+ // Simple field (sessionKey)
+ lengthInBits += 16;
+
+ // Reserved Field (reserved)
+ lengthInBits += 16;
+
+ // Simple field (controlCommand)
+ lengthInBits += 16;
+
+ // Reserved Field (reserved)
+ lengthInBits += 16;
+
+ return lengthInBits;
+ }
+
+ public static PnIoCm_BlockBuilder staticParsePnIoCm_BlockBuilder(ReadBuffer readBuffer)
+ throws ParseException {
+ readBuffer.pullContext("PnIoCm_Control_Response");
+ PositionAware positionAware = readBuffer;
+ int startPos = positionAware.getPos();
+ int curPos;
+
+ int blockLength =
+ readImplicitField(
+ "blockLength",
+ readUnsignedInt(readBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ short blockVersionHigh =
+ readSimpleField(
+ "blockVersionHigh",
+ readUnsignedShort(readBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ short blockVersionLow =
+ readSimpleField(
+ "blockVersionLow",
+ readUnsignedShort(readBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ Integer reservedField0 =
+ readReservedField(
+ "reserved",
+ readUnsignedInt(readBuffer, 16),
+ (int) 0x0000,
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ Uuid arUuid =
+ readSimpleField(
+ "arUuid",
+ new DataReaderComplexDefault<>(() -> Uuid.staticParse(readBuffer), readBuffer),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ int sessionKey =
+ readSimpleField(
+ "sessionKey",
+ readUnsignedInt(readBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ Integer reservedField1 =
+ readReservedField(
+ "reserved",
+ readUnsignedInt(readBuffer, 16),
+ (int) 0x0000,
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ int controlCommand =
+ readSimpleField(
+ "controlCommand",
+ readUnsignedInt(readBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ Integer reservedField2 =
+ readReservedField(
+ "reserved",
+ readUnsignedInt(readBuffer, 16),
+ (int) 0x0000,
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ readBuffer.closeContext("PnIoCm_Control_Response");
+ // Create the instance
+ return new PnIoCm_Control_ResponseBuilderImpl(
+ blockVersionHigh,
+ blockVersionLow,
+ arUuid,
+ sessionKey,
+ controlCommand,
+ reservedField0,
+ reservedField1,
+ reservedField2);
+ }
+
+ public static class PnIoCm_Control_ResponseBuilderImpl
+ implements PnIoCm_Block.PnIoCm_BlockBuilder {
+ private final short blockVersionHigh;
+ private final short blockVersionLow;
+ private final Uuid arUuid;
+ private final int sessionKey;
+ private final int controlCommand;
+ private final Integer reservedField0;
+ private final Integer reservedField1;
+ private final Integer reservedField2;
+
+ public PnIoCm_Control_ResponseBuilderImpl(
+ short blockVersionHigh,
+ short blockVersionLow,
+ Uuid arUuid,
+ int sessionKey,
+ int controlCommand,
+ Integer reservedField0,
+ Integer reservedField1,
+ Integer reservedField2) {
+ this.blockVersionHigh = blockVersionHigh;
+ this.blockVersionLow = blockVersionLow;
+ this.arUuid = arUuid;
+ this.sessionKey = sessionKey;
+ this.controlCommand = controlCommand;
+ this.reservedField0 = reservedField0;
+ this.reservedField1 = reservedField1;
+ this.reservedField2 = reservedField2;
+ }
+
+ public PnIoCm_Control_Response build() {
+ PnIoCm_Control_Response pnIoCm_Control_Response =
+ new PnIoCm_Control_Response(
+ blockVersionHigh, blockVersionLow, arUuid, sessionKey, controlCommand);
+ pnIoCm_Control_Response.reservedField0 = reservedField0;
+ pnIoCm_Control_Response.reservedField1 = reservedField1;
+ pnIoCm_Control_Response.reservedField2 = reservedField2;
+ return pnIoCm_Control_Response;
+ }
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (!(o instanceof PnIoCm_Control_Response)) {
+ return false;
+ }
+ PnIoCm_Control_Response that = (PnIoCm_Control_Response) o;
+ return (getBlockVersionHigh() == that.getBlockVersionHigh())
+ && (getBlockVersionLow() == that.getBlockVersionLow())
+ && (getArUuid() == that.getArUuid())
+ && (getSessionKey() == that.getSessionKey())
+ && (getControlCommand() == that.getControlCommand())
+ && super.equals(that)
+ && true;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(
+ super.hashCode(),
+ getBlockVersionHigh(),
+ getBlockVersionLow(),
+ getArUuid(),
+ getSessionKey(),
+ getControlCommand());
+ }
+
+ @Override
+ public String toString() {
+ WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true);
+ try {
+ writeBufferBoxBased.writeSerializable(this);
+ } catch (SerializationException e) {
+ throw new RuntimeException(e);
+ }
+ return "\n" + writeBufferBoxBased.getBox().toString() + "\n";
+ }
+}
diff --git a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_DataUnitDataObject.java b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_DataUnitDataObject.java
new file mode 100644
index 00000000000..b45aa14894e
--- /dev/null
+++ b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_DataUnitDataObject.java
@@ -0,0 +1,167 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.plc4x.java.profinet.readwrite;
+
+import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*;
+import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*;
+import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*;
+import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*;
+import static org.apache.plc4x.java.spi.generation.StaticHelper.*;
+
+import java.time.*;
+import java.util.*;
+import org.apache.plc4x.java.api.exceptions.*;
+import org.apache.plc4x.java.api.value.*;
+import org.apache.plc4x.java.spi.codegen.*;
+import org.apache.plc4x.java.spi.codegen.fields.*;
+import org.apache.plc4x.java.spi.codegen.io.*;
+import org.apache.plc4x.java.spi.generation.*;
+
+// Code generated by code-generation. DO NOT EDIT.
+
+public class PnIoCm_DataUnitDataObject implements Message {
+
+ // Properties.
+ protected final byte[] dataState;
+ protected final PnIoCm_DataUnitIoCs iops;
+
+ // Arguments.
+ protected final Integer dataObjectLength;
+
+ public PnIoCm_DataUnitDataObject(
+ byte[] dataState, PnIoCm_DataUnitIoCs iops, Integer dataObjectLength) {
+ super();
+ this.dataState = dataState;
+ this.iops = iops;
+ this.dataObjectLength = dataObjectLength;
+ }
+
+ public byte[] getDataState() {
+ return dataState;
+ }
+
+ public PnIoCm_DataUnitIoCs getIops() {
+ return iops;
+ }
+
+ public void serialize(WriteBuffer writeBuffer) throws SerializationException {
+ PositionAware positionAware = writeBuffer;
+ int startPos = positionAware.getPos();
+ writeBuffer.pushContext("PnIoCm_DataUnitDataObject");
+
+ // Array Field (dataState)
+ writeByteArrayField("dataState", dataState, writeByteArray(writeBuffer, 8));
+
+ // Simple Field (iops)
+ writeSimpleField("iops", iops, new DataWriterComplexDefault<>(writeBuffer));
+
+ writeBuffer.popContext("PnIoCm_DataUnitDataObject");
+ }
+
+ @Override
+ public int getLengthInBytes() {
+ return (int) Math.ceil((float) getLengthInBits() / 8.0);
+ }
+
+ @Override
+ public int getLengthInBits() {
+ int lengthInBits = 0;
+ PnIoCm_DataUnitDataObject _value = this;
+
+ // Array field
+ if (dataState != null) {
+ lengthInBits += 8 * dataState.length;
+ }
+
+ // Simple field (iops)
+ lengthInBits += iops.getLengthInBits();
+
+ return lengthInBits;
+ }
+
+ public static PnIoCm_DataUnitDataObject staticParse(ReadBuffer readBuffer, Object... args)
+ throws ParseException {
+ PositionAware positionAware = readBuffer;
+ if ((args == null) || (args.length != 1)) {
+ throw new PlcRuntimeException(
+ "Wrong number of arguments, expected 1, but got " + args.length);
+ }
+ Integer dataObjectLength;
+ if (args[0] instanceof Integer) {
+ dataObjectLength = (Integer) args[0];
+ } else if (args[0] instanceof String) {
+ dataObjectLength = Integer.valueOf((String) args[0]);
+ } else {
+ throw new PlcRuntimeException(
+ "Argument 0 expected to be of type Integer or a string which is parseable but was "
+ + args[0].getClass().getName());
+ }
+ return staticParse(readBuffer, dataObjectLength);
+ }
+
+ public static PnIoCm_DataUnitDataObject staticParse(
+ ReadBuffer readBuffer, Integer dataObjectLength) throws ParseException {
+ readBuffer.pullContext("PnIoCm_DataUnitDataObject");
+ PositionAware positionAware = readBuffer;
+ int startPos = positionAware.getPos();
+ int curPos;
+
+ byte[] dataState = readBuffer.readByteArray("dataState", Math.toIntExact(dataObjectLength));
+
+ PnIoCm_DataUnitIoCs iops =
+ readSimpleField(
+ "iops",
+ new DataReaderComplexDefault<>(
+ () -> PnIoCm_DataUnitIoCs.staticParse(readBuffer), readBuffer));
+
+ readBuffer.closeContext("PnIoCm_DataUnitDataObject");
+ // Create the instance
+ PnIoCm_DataUnitDataObject _pnIoCm_DataUnitDataObject;
+ _pnIoCm_DataUnitDataObject = new PnIoCm_DataUnitDataObject(dataState, iops, dataObjectLength);
+ return _pnIoCm_DataUnitDataObject;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (!(o instanceof PnIoCm_DataUnitDataObject)) {
+ return false;
+ }
+ PnIoCm_DataUnitDataObject that = (PnIoCm_DataUnitDataObject) o;
+ return (getDataState() == that.getDataState()) && (getIops() == that.getIops()) && true;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(getDataState(), getIops());
+ }
+
+ @Override
+ public String toString() {
+ WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true);
+ try {
+ writeBufferBoxBased.writeSerializable(this);
+ } catch (SerializationException e) {
+ throw new RuntimeException(e);
+ }
+ return "\n" + writeBufferBoxBased.getBox().toString() + "\n";
+ }
+}
diff --git a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_DataUnitIoCs.java b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_DataUnitIoCs.java
new file mode 100644
index 00000000000..03436b80014
--- /dev/null
+++ b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_DataUnitIoCs.java
@@ -0,0 +1,174 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.plc4x.java.profinet.readwrite;
+
+import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*;
+import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*;
+import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*;
+import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*;
+import static org.apache.plc4x.java.spi.generation.StaticHelper.*;
+
+import java.time.*;
+import java.util.*;
+import org.apache.plc4x.java.api.exceptions.*;
+import org.apache.plc4x.java.api.value.*;
+import org.apache.plc4x.java.spi.codegen.*;
+import org.apache.plc4x.java.spi.codegen.fields.*;
+import org.apache.plc4x.java.spi.codegen.io.*;
+import org.apache.plc4x.java.spi.generation.*;
+
+// Code generated by code-generation. DO NOT EDIT.
+
+public class PnIoCm_DataUnitIoCs implements Message {
+
+ // Properties.
+ protected final boolean dataState;
+ protected final byte instance;
+ protected final boolean extension;
+
+ // Reserved Fields
+ private Byte reservedField0;
+
+ public PnIoCm_DataUnitIoCs(boolean dataState, byte instance, boolean extension) {
+ super();
+ this.dataState = dataState;
+ this.instance = instance;
+ this.extension = extension;
+ }
+
+ public boolean getDataState() {
+ return dataState;
+ }
+
+ public byte getInstance() {
+ return instance;
+ }
+
+ public boolean getExtension() {
+ return extension;
+ }
+
+ public void serialize(WriteBuffer writeBuffer) throws SerializationException {
+ PositionAware positionAware = writeBuffer;
+ int startPos = positionAware.getPos();
+ writeBuffer.pushContext("PnIoCm_DataUnitIoCs");
+
+ // Simple Field (dataState)
+ writeSimpleField("dataState", dataState, writeBoolean(writeBuffer));
+
+ // Simple Field (instance)
+ writeSimpleField("instance", instance, writeUnsignedByte(writeBuffer, 2));
+
+ // Reserved Field (reserved)
+ writeReservedField(
+ "reserved",
+ reservedField0 != null ? reservedField0 : (byte) 0x00,
+ writeUnsignedByte(writeBuffer, 4));
+
+ // Simple Field (extension)
+ writeSimpleField("extension", extension, writeBoolean(writeBuffer));
+
+ writeBuffer.popContext("PnIoCm_DataUnitIoCs");
+ }
+
+ @Override
+ public int getLengthInBytes() {
+ return (int) Math.ceil((float) getLengthInBits() / 8.0);
+ }
+
+ @Override
+ public int getLengthInBits() {
+ int lengthInBits = 0;
+ PnIoCm_DataUnitIoCs _value = this;
+
+ // Simple field (dataState)
+ lengthInBits += 1;
+
+ // Simple field (instance)
+ lengthInBits += 2;
+
+ // Reserved Field (reserved)
+ lengthInBits += 4;
+
+ // Simple field (extension)
+ lengthInBits += 1;
+
+ return lengthInBits;
+ }
+
+ public static PnIoCm_DataUnitIoCs staticParse(ReadBuffer readBuffer, Object... args)
+ throws ParseException {
+ PositionAware positionAware = readBuffer;
+ return staticParse(readBuffer);
+ }
+
+ public static PnIoCm_DataUnitIoCs staticParse(ReadBuffer readBuffer) throws ParseException {
+ readBuffer.pullContext("PnIoCm_DataUnitIoCs");
+ PositionAware positionAware = readBuffer;
+ int startPos = positionAware.getPos();
+ int curPos;
+
+ boolean dataState = readSimpleField("dataState", readBoolean(readBuffer));
+
+ byte instance = readSimpleField("instance", readUnsignedByte(readBuffer, 2));
+
+ Byte reservedField0 =
+ readReservedField("reserved", readUnsignedByte(readBuffer, 4), (byte) 0x00);
+
+ boolean extension = readSimpleField("extension", readBoolean(readBuffer));
+
+ readBuffer.closeContext("PnIoCm_DataUnitIoCs");
+ // Create the instance
+ PnIoCm_DataUnitIoCs _pnIoCm_DataUnitIoCs;
+ _pnIoCm_DataUnitIoCs = new PnIoCm_DataUnitIoCs(dataState, instance, extension);
+ _pnIoCm_DataUnitIoCs.reservedField0 = reservedField0;
+ return _pnIoCm_DataUnitIoCs;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (!(o instanceof PnIoCm_DataUnitIoCs)) {
+ return false;
+ }
+ PnIoCm_DataUnitIoCs that = (PnIoCm_DataUnitIoCs) o;
+ return (getDataState() == that.getDataState())
+ && (getInstance() == that.getInstance())
+ && (getExtension() == that.getExtension())
+ && true;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(getDataState(), getInstance(), getExtension());
+ }
+
+ @Override
+ public String toString() {
+ WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true);
+ try {
+ writeBufferBoxBased.writeSerializable(this);
+ } catch (SerializationException e) {
+ throw new RuntimeException(e);
+ }
+ return "\n" + writeBufferBoxBased.getBox().toString() + "\n";
+ }
+}
diff --git a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_Packet_Req.java b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_Packet_Req.java
index 49ea9c89168..7b9da742bff 100644
--- a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_Packet_Req.java
+++ b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_Packet_Req.java
@@ -44,25 +44,16 @@ public DceRpc_PacketType getPacketType() {
// Properties.
protected final long argsMaximum;
- protected final long argsLength;
protected final long arrayMaximumCount;
protected final long arrayOffset;
- protected final long arrayActualCount;
protected final List blocks;
public PnIoCm_Packet_Req(
- long argsMaximum,
- long argsLength,
- long arrayMaximumCount,
- long arrayOffset,
- long arrayActualCount,
- List blocks) {
+ long argsMaximum, long arrayMaximumCount, long arrayOffset, List blocks) {
super();
this.argsMaximum = argsMaximum;
- this.argsLength = argsLength;
this.arrayMaximumCount = arrayMaximumCount;
this.arrayOffset = arrayOffset;
- this.arrayActualCount = arrayActualCount;
this.blocks = blocks;
}
@@ -70,10 +61,6 @@ public long getArgsMaximum() {
return argsMaximum;
}
- public long getArgsLength() {
- return argsLength;
- }
-
public long getArrayMaximumCount() {
return arrayMaximumCount;
}
@@ -82,10 +69,6 @@ public long getArrayOffset() {
return arrayOffset;
}
- public long getArrayActualCount() {
- return arrayActualCount;
- }
-
public List getBlocks() {
return blocks;
}
@@ -100,8 +83,10 @@ protected void serializePnIoCm_PacketChild(WriteBuffer writeBuffer)
// Simple Field (argsMaximum)
writeSimpleField("argsMaximum", argsMaximum, writeUnsignedLong(writeBuffer, 32));
- // Simple Field (argsLength)
- writeSimpleField("argsLength", argsLength, writeUnsignedLong(writeBuffer, 32));
+ // Implicit Field (argsLength) (Used for parsing, but its value is not stored as it's implicitly
+ // given by the objects content)
+ long argsLength = (long) ((getLengthInBytes()) - (20L));
+ writeImplicitField("argsLength", argsLength, writeUnsignedLong(writeBuffer, 32));
// Simple Field (arrayMaximumCount)
writeSimpleField("arrayMaximumCount", arrayMaximumCount, writeUnsignedLong(writeBuffer, 32));
@@ -109,8 +94,10 @@ protected void serializePnIoCm_PacketChild(WriteBuffer writeBuffer)
// Simple Field (arrayOffset)
writeSimpleField("arrayOffset", arrayOffset, writeUnsignedLong(writeBuffer, 32));
- // Simple Field (arrayActualCount)
- writeSimpleField("arrayActualCount", arrayActualCount, writeUnsignedLong(writeBuffer, 32));
+ // Implicit Field (arrayActualCount) (Used for parsing, but its value is not stored as it's
+ // implicitly given by the objects content)
+ long arrayActualCount = (long) ((getLengthInBytes()) - (20L));
+ writeImplicitField("arrayActualCount", arrayActualCount, writeUnsignedLong(writeBuffer, 32));
// Array Field (blocks)
writeComplexTypeArrayField("blocks", blocks, writeBuffer);
@@ -131,7 +118,7 @@ public int getLengthInBits() {
// Simple field (argsMaximum)
lengthInBits += 32;
- // Simple field (argsLength)
+ // Implicit Field (argsLength)
lengthInBits += 32;
// Simple field (arrayMaximumCount)
@@ -140,7 +127,7 @@ public int getLengthInBits() {
// Simple field (arrayOffset)
lengthInBits += 32;
- // Simple field (arrayActualCount)
+ // Implicit Field (arrayActualCount)
lengthInBits += 32;
// Array field
@@ -162,13 +149,13 @@ public static PnIoCm_PacketBuilder staticParsePnIoCm_PacketBuilder(
long argsMaximum = readSimpleField("argsMaximum", readUnsignedLong(readBuffer, 32));
- long argsLength = readSimpleField("argsLength", readUnsignedLong(readBuffer, 32));
+ long argsLength = readImplicitField("argsLength", readUnsignedLong(readBuffer, 32));
long arrayMaximumCount = readSimpleField("arrayMaximumCount", readUnsignedLong(readBuffer, 32));
long arrayOffset = readSimpleField("arrayOffset", readUnsignedLong(readBuffer, 32));
- long arrayActualCount = readSimpleField("arrayActualCount", readUnsignedLong(readBuffer, 32));
+ long arrayActualCount = readImplicitField("arrayActualCount", readUnsignedLong(readBuffer, 32));
List blocks =
readLengthArrayField(
@@ -178,37 +165,26 @@ public static PnIoCm_PacketBuilder staticParsePnIoCm_PacketBuilder(
readBuffer.closeContext("PnIoCm_Packet_Req");
// Create the instance
- return new PnIoCm_Packet_ReqBuilderImpl(
- argsMaximum, argsLength, arrayMaximumCount, arrayOffset, arrayActualCount, blocks);
+ return new PnIoCm_Packet_ReqBuilderImpl(argsMaximum, arrayMaximumCount, arrayOffset, blocks);
}
public static class PnIoCm_Packet_ReqBuilderImpl implements PnIoCm_Packet.PnIoCm_PacketBuilder {
private final long argsMaximum;
- private final long argsLength;
private final long arrayMaximumCount;
private final long arrayOffset;
- private final long arrayActualCount;
private final List blocks;
public PnIoCm_Packet_ReqBuilderImpl(
- long argsMaximum,
- long argsLength,
- long arrayMaximumCount,
- long arrayOffset,
- long arrayActualCount,
- List blocks) {
+ long argsMaximum, long arrayMaximumCount, long arrayOffset, List blocks) {
this.argsMaximum = argsMaximum;
- this.argsLength = argsLength;
this.arrayMaximumCount = arrayMaximumCount;
this.arrayOffset = arrayOffset;
- this.arrayActualCount = arrayActualCount;
this.blocks = blocks;
}
public PnIoCm_Packet_Req build() {
PnIoCm_Packet_Req pnIoCm_Packet_Req =
- new PnIoCm_Packet_Req(
- argsMaximum, argsLength, arrayMaximumCount, arrayOffset, arrayActualCount, blocks);
+ new PnIoCm_Packet_Req(argsMaximum, arrayMaximumCount, arrayOffset, blocks);
return pnIoCm_Packet_Req;
}
}
@@ -223,10 +199,8 @@ public boolean equals(Object o) {
}
PnIoCm_Packet_Req that = (PnIoCm_Packet_Req) o;
return (getArgsMaximum() == that.getArgsMaximum())
- && (getArgsLength() == that.getArgsLength())
&& (getArrayMaximumCount() == that.getArrayMaximumCount())
&& (getArrayOffset() == that.getArrayOffset())
- && (getArrayActualCount() == that.getArrayActualCount())
&& (getBlocks() == that.getBlocks())
&& super.equals(that)
&& true;
@@ -235,13 +209,7 @@ public boolean equals(Object o) {
@Override
public int hashCode() {
return Objects.hash(
- super.hashCode(),
- getArgsMaximum(),
- getArgsLength(),
- getArrayMaximumCount(),
- getArrayOffset(),
- getArrayActualCount(),
- getBlocks());
+ super.hashCode(), getArgsMaximum(), getArrayMaximumCount(), getArrayOffset(), getBlocks());
}
@Override
diff --git a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_Packet_Res.java b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_Packet_Res.java
index 01b041493bd..c9123f1cb38 100644
--- a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_Packet_Res.java
+++ b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_Packet_Res.java
@@ -47,10 +47,8 @@ public DceRpc_PacketType getPacketType() {
protected final short errorCode1;
protected final short errorDecode;
protected final short errorCode;
- protected final long argsLength;
protected final long arrayMaximumCount;
protected final long arrayOffset;
- protected final long arrayActualCount;
protected final List blocks;
public PnIoCm_Packet_Res(
@@ -58,20 +56,16 @@ public PnIoCm_Packet_Res(
short errorCode1,
short errorDecode,
short errorCode,
- long argsLength,
long arrayMaximumCount,
long arrayOffset,
- long arrayActualCount,
List blocks) {
super();
this.errorCode2 = errorCode2;
this.errorCode1 = errorCode1;
this.errorDecode = errorDecode;
this.errorCode = errorCode;
- this.argsLength = argsLength;
this.arrayMaximumCount = arrayMaximumCount;
this.arrayOffset = arrayOffset;
- this.arrayActualCount = arrayActualCount;
this.blocks = blocks;
}
@@ -91,10 +85,6 @@ public short getErrorCode() {
return errorCode;
}
- public long getArgsLength() {
- return argsLength;
- }
-
public long getArrayMaximumCount() {
return arrayMaximumCount;
}
@@ -103,10 +93,6 @@ public long getArrayOffset() {
return arrayOffset;
}
- public long getArrayActualCount() {
- return arrayActualCount;
- }
-
public List getBlocks() {
return blocks;
}
@@ -130,8 +116,13 @@ protected void serializePnIoCm_PacketChild(WriteBuffer writeBuffer)
// Simple Field (errorCode)
writeSimpleField("errorCode", errorCode, writeUnsignedShort(writeBuffer, 8));
- // Simple Field (argsLength)
- writeSimpleField("argsLength", argsLength, writeUnsignedLong(writeBuffer, 32));
+ // Implicit Field (argsLength) (Used for parsing, but its value is not stored as it's implicitly
+ // given by the objects content)
+ long argsLength =
+ (long)
+ (((((((((getLengthInBytes()) - (1L)) - (1L)) - (1L)) - (1L)) - (4L)) - (4L)) - (4L))
+ - (4L));
+ writeImplicitField("argsLength", argsLength, writeUnsignedLong(writeBuffer, 32));
// Simple Field (arrayMaximumCount)
writeSimpleField("arrayMaximumCount", arrayMaximumCount, writeUnsignedLong(writeBuffer, 32));
@@ -139,8 +130,13 @@ protected void serializePnIoCm_PacketChild(WriteBuffer writeBuffer)
// Simple Field (arrayOffset)
writeSimpleField("arrayOffset", arrayOffset, writeUnsignedLong(writeBuffer, 32));
- // Simple Field (arrayActualCount)
- writeSimpleField("arrayActualCount", arrayActualCount, writeUnsignedLong(writeBuffer, 32));
+ // Implicit Field (arrayActualCount) (Used for parsing, but its value is not stored as it's
+ // implicitly given by the objects content)
+ long arrayActualCount =
+ (long)
+ (((((((((getLengthInBytes()) - (1L)) - (1L)) - (1L)) - (1L)) - (4L)) - (4L)) - (4L))
+ - (4L));
+ writeImplicitField("arrayActualCount", arrayActualCount, writeUnsignedLong(writeBuffer, 32));
// Array Field (blocks)
writeComplexTypeArrayField("blocks", blocks, writeBuffer);
@@ -170,7 +166,7 @@ public int getLengthInBits() {
// Simple field (errorCode)
lengthInBits += 8;
- // Simple field (argsLength)
+ // Implicit Field (argsLength)
lengthInBits += 32;
// Simple field (arrayMaximumCount)
@@ -179,7 +175,7 @@ public int getLengthInBits() {
// Simple field (arrayOffset)
lengthInBits += 32;
- // Simple field (arrayActualCount)
+ // Implicit Field (arrayActualCount)
lengthInBits += 32;
// Array field
@@ -207,13 +203,13 @@ public static PnIoCm_PacketBuilder staticParsePnIoCm_PacketBuilder(
short errorCode = readSimpleField("errorCode", readUnsignedShort(readBuffer, 8));
- long argsLength = readSimpleField("argsLength", readUnsignedLong(readBuffer, 32));
+ long argsLength = readImplicitField("argsLength", readUnsignedLong(readBuffer, 32));
long arrayMaximumCount = readSimpleField("arrayMaximumCount", readUnsignedLong(readBuffer, 32));
long arrayOffset = readSimpleField("arrayOffset", readUnsignedLong(readBuffer, 32));
- long arrayActualCount = readSimpleField("arrayActualCount", readUnsignedLong(readBuffer, 32));
+ long arrayActualCount = readImplicitField("arrayActualCount", readUnsignedLong(readBuffer, 32));
List blocks =
readLengthArrayField(
@@ -224,15 +220,7 @@ public static PnIoCm_PacketBuilder staticParsePnIoCm_PacketBuilder(
readBuffer.closeContext("PnIoCm_Packet_Res");
// Create the instance
return new PnIoCm_Packet_ResBuilderImpl(
- errorCode2,
- errorCode1,
- errorDecode,
- errorCode,
- argsLength,
- arrayMaximumCount,
- arrayOffset,
- arrayActualCount,
- blocks);
+ errorCode2, errorCode1, errorDecode, errorCode, arrayMaximumCount, arrayOffset, blocks);
}
public static class PnIoCm_Packet_ResBuilderImpl implements PnIoCm_Packet.PnIoCm_PacketBuilder {
@@ -240,10 +228,8 @@ public static class PnIoCm_Packet_ResBuilderImpl implements PnIoCm_Packet.PnIoCm
private final short errorCode1;
private final short errorDecode;
private final short errorCode;
- private final long argsLength;
private final long arrayMaximumCount;
private final long arrayOffset;
- private final long arrayActualCount;
private final List blocks;
public PnIoCm_Packet_ResBuilderImpl(
@@ -251,19 +237,15 @@ public PnIoCm_Packet_ResBuilderImpl(
short errorCode1,
short errorDecode,
short errorCode,
- long argsLength,
long arrayMaximumCount,
long arrayOffset,
- long arrayActualCount,
List blocks) {
this.errorCode2 = errorCode2;
this.errorCode1 = errorCode1;
this.errorDecode = errorDecode;
this.errorCode = errorCode;
- this.argsLength = argsLength;
this.arrayMaximumCount = arrayMaximumCount;
this.arrayOffset = arrayOffset;
- this.arrayActualCount = arrayActualCount;
this.blocks = blocks;
}
@@ -274,10 +256,8 @@ public PnIoCm_Packet_Res build() {
errorCode1,
errorDecode,
errorCode,
- argsLength,
arrayMaximumCount,
arrayOffset,
- arrayActualCount,
blocks);
return pnIoCm_Packet_Res;
}
@@ -296,10 +276,8 @@ public boolean equals(Object o) {
&& (getErrorCode1() == that.getErrorCode1())
&& (getErrorDecode() == that.getErrorDecode())
&& (getErrorCode() == that.getErrorCode())
- && (getArgsLength() == that.getArgsLength())
&& (getArrayMaximumCount() == that.getArrayMaximumCount())
&& (getArrayOffset() == that.getArrayOffset())
- && (getArrayActualCount() == that.getArrayActualCount())
&& (getBlocks() == that.getBlocks())
&& super.equals(that)
&& true;
@@ -313,10 +291,8 @@ public int hashCode() {
getErrorCode1(),
getErrorDecode(),
getErrorCode(),
- getArgsLength(),
getArrayMaximumCount(),
getArrayOffset(),
- getArrayActualCount(),
getBlocks());
}
diff --git a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_Submodule.java b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_Submodule.java
index ab829f0748d..abe24ee71e7 100644
--- a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_Submodule.java
+++ b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_Submodule.java
@@ -48,6 +48,9 @@ public abstract class PnIoCm_Submodule implements Message {
protected final boolean reduceInputModuleDataLength;
protected final boolean sharedInput;
+ // Reserved Fields
+ private Integer reservedField0;
+
public PnIoCm_Submodule(
int slotNumber,
long submoduleIdentNumber,
@@ -104,7 +107,10 @@ public void serialize(WriteBuffer writeBuffer) throws SerializationException {
"submoduleIdentNumber", submoduleIdentNumber, writeUnsignedLong(writeBuffer, 32));
// Reserved Field (reserved)
- writeReservedField("reserved", (int) 0x000, writeUnsignedInt(writeBuffer, 10));
+ writeReservedField(
+ "reserved",
+ reservedField0 != null ? reservedField0 : (int) 0x000,
+ writeUnsignedInt(writeBuffer, 10));
// Simple Field (discardIoxs)
writeSimpleField("discardIoxs", discardIoxs, writeBoolean(writeBuffer));
@@ -215,6 +221,10 @@ public static PnIoCm_Submodule staticParse(ReadBuffer readBuffer) throws ParseEx
PnIoCm_SubmoduleBuilder builder = null;
if (EvaluationHelper.equals(submoduleType, PnIoCm_SubmoduleType.NO_INPUT_NO_OUTPUT_DATA)) {
builder = PnIoCm_Submodule_NoInputNoOutputData.staticParsePnIoCm_SubmoduleBuilder(readBuffer);
+ } else if (EvaluationHelper.equals(submoduleType, PnIoCm_SubmoduleType.INPUT_DATA)) {
+ builder = PnIoCm_Submodule_InputData.staticParsePnIoCm_SubmoduleBuilder(readBuffer);
+ } else if (EvaluationHelper.equals(submoduleType, PnIoCm_SubmoduleType.OUTPUT_DATA)) {
+ builder = PnIoCm_Submodule_OutputData.staticParsePnIoCm_SubmoduleBuilder(readBuffer);
} else if (EvaluationHelper.equals(submoduleType, PnIoCm_SubmoduleType.INPUT_AND_OUTPUT_DATA)) {
builder = PnIoCm_Submodule_InputAndOutputData.staticParsePnIoCm_SubmoduleBuilder(readBuffer);
}
@@ -237,6 +247,7 @@ public static PnIoCm_Submodule staticParse(ReadBuffer readBuffer) throws ParseEx
reduceOutputModuleDataLength,
reduceInputModuleDataLength,
sharedInput);
+ _pnIoCm_Submodule.reservedField0 = reservedField0;
return _pnIoCm_Submodule;
}
diff --git a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_SubmoduleType.java b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_SubmoduleType.java
index d213374192b..69fbd772297 100644
--- a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_SubmoduleType.java
+++ b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_SubmoduleType.java
@@ -25,6 +25,8 @@
public enum PnIoCm_SubmoduleType {
NO_INPUT_NO_OUTPUT_DATA((byte) 0x0),
+ INPUT_DATA((byte) 0x1),
+ OUTPUT_DATA((byte) 0x2),
INPUT_AND_OUTPUT_DATA((byte) 0x3);
private static final Map map;
diff --git a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_Submodule_InputData.java b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_Submodule_InputData.java
new file mode 100644
index 00000000000..30adeb1f87a
--- /dev/null
+++ b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_Submodule_InputData.java
@@ -0,0 +1,236 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.plc4x.java.profinet.readwrite;
+
+import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*;
+import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*;
+import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*;
+import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*;
+import static org.apache.plc4x.java.spi.generation.StaticHelper.*;
+
+import java.time.*;
+import java.util.*;
+import org.apache.plc4x.java.api.exceptions.*;
+import org.apache.plc4x.java.api.value.*;
+import org.apache.plc4x.java.spi.codegen.*;
+import org.apache.plc4x.java.spi.codegen.fields.*;
+import org.apache.plc4x.java.spi.codegen.io.*;
+import org.apache.plc4x.java.spi.generation.*;
+
+// Code generated by code-generation. DO NOT EDIT.
+
+public class PnIoCm_Submodule_InputData extends PnIoCm_Submodule implements Message {
+
+ // Accessors for discriminator values.
+ public PnIoCm_SubmoduleType getSubmoduleType() {
+ return PnIoCm_SubmoduleType.INPUT_DATA;
+ }
+
+ // Constant values.
+ public static final Integer INPUTDATADESCRIPTION = 0x0001;
+
+ // Properties.
+ protected final int inputSubmoduleDataLength;
+ protected final short inputLengthIoCs;
+ protected final short inputLengthIoPs;
+
+ public PnIoCm_Submodule_InputData(
+ int slotNumber,
+ long submoduleIdentNumber,
+ boolean discardIoxs,
+ boolean reduceOutputModuleDataLength,
+ boolean reduceInputModuleDataLength,
+ boolean sharedInput,
+ int inputSubmoduleDataLength,
+ short inputLengthIoCs,
+ short inputLengthIoPs) {
+ super(
+ slotNumber,
+ submoduleIdentNumber,
+ discardIoxs,
+ reduceOutputModuleDataLength,
+ reduceInputModuleDataLength,
+ sharedInput);
+ this.inputSubmoduleDataLength = inputSubmoduleDataLength;
+ this.inputLengthIoCs = inputLengthIoCs;
+ this.inputLengthIoPs = inputLengthIoPs;
+ }
+
+ public int getInputSubmoduleDataLength() {
+ return inputSubmoduleDataLength;
+ }
+
+ public short getInputLengthIoCs() {
+ return inputLengthIoCs;
+ }
+
+ public short getInputLengthIoPs() {
+ return inputLengthIoPs;
+ }
+
+ public int getInputDataDescription() {
+ return INPUTDATADESCRIPTION;
+ }
+
+ @Override
+ protected void serializePnIoCm_SubmoduleChild(WriteBuffer writeBuffer)
+ throws SerializationException {
+ PositionAware positionAware = writeBuffer;
+ int startPos = positionAware.getPos();
+ writeBuffer.pushContext("PnIoCm_Submodule_InputData");
+
+ // Const Field (inputDataDescription)
+ writeConstField(
+ "inputDataDescription", INPUTDATADESCRIPTION, writeUnsignedInt(writeBuffer, 16));
+
+ // Simple Field (inputSubmoduleDataLength)
+ writeSimpleField(
+ "inputSubmoduleDataLength", inputSubmoduleDataLength, writeUnsignedInt(writeBuffer, 16));
+
+ // Simple Field (inputLengthIoCs)
+ writeSimpleField("inputLengthIoCs", inputLengthIoCs, writeUnsignedShort(writeBuffer, 8));
+
+ // Simple Field (inputLengthIoPs)
+ writeSimpleField("inputLengthIoPs", inputLengthIoPs, writeUnsignedShort(writeBuffer, 8));
+
+ writeBuffer.popContext("PnIoCm_Submodule_InputData");
+ }
+
+ @Override
+ public int getLengthInBytes() {
+ return (int) Math.ceil((float) getLengthInBits() / 8.0);
+ }
+
+ @Override
+ public int getLengthInBits() {
+ int lengthInBits = super.getLengthInBits();
+ PnIoCm_Submodule_InputData _value = this;
+
+ // Const Field (inputDataDescription)
+ lengthInBits += 16;
+
+ // Simple field (inputSubmoduleDataLength)
+ lengthInBits += 16;
+
+ // Simple field (inputLengthIoCs)
+ lengthInBits += 8;
+
+ // Simple field (inputLengthIoPs)
+ lengthInBits += 8;
+
+ return lengthInBits;
+ }
+
+ public static PnIoCm_SubmoduleBuilder staticParsePnIoCm_SubmoduleBuilder(ReadBuffer readBuffer)
+ throws ParseException {
+ readBuffer.pullContext("PnIoCm_Submodule_InputData");
+ PositionAware positionAware = readBuffer;
+ int startPos = positionAware.getPos();
+ int curPos;
+
+ int inputDataDescription =
+ readConstField(
+ "inputDataDescription",
+ readUnsignedInt(readBuffer, 16),
+ PnIoCm_Submodule_InputData.INPUTDATADESCRIPTION);
+
+ int inputSubmoduleDataLength =
+ readSimpleField("inputSubmoduleDataLength", readUnsignedInt(readBuffer, 16));
+
+ short inputLengthIoCs = readSimpleField("inputLengthIoCs", readUnsignedShort(readBuffer, 8));
+
+ short inputLengthIoPs = readSimpleField("inputLengthIoPs", readUnsignedShort(readBuffer, 8));
+
+ readBuffer.closeContext("PnIoCm_Submodule_InputData");
+ // Create the instance
+ return new PnIoCm_Submodule_InputDataBuilderImpl(
+ inputSubmoduleDataLength, inputLengthIoCs, inputLengthIoPs);
+ }
+
+ public static class PnIoCm_Submodule_InputDataBuilderImpl
+ implements PnIoCm_Submodule.PnIoCm_SubmoduleBuilder {
+ private final int inputSubmoduleDataLength;
+ private final short inputLengthIoCs;
+ private final short inputLengthIoPs;
+
+ public PnIoCm_Submodule_InputDataBuilderImpl(
+ int inputSubmoduleDataLength, short inputLengthIoCs, short inputLengthIoPs) {
+ this.inputSubmoduleDataLength = inputSubmoduleDataLength;
+ this.inputLengthIoCs = inputLengthIoCs;
+ this.inputLengthIoPs = inputLengthIoPs;
+ }
+
+ public PnIoCm_Submodule_InputData build(
+ int slotNumber,
+ long submoduleIdentNumber,
+ boolean discardIoxs,
+ boolean reduceOutputModuleDataLength,
+ boolean reduceInputModuleDataLength,
+ boolean sharedInput) {
+ PnIoCm_Submodule_InputData pnIoCm_Submodule_InputData =
+ new PnIoCm_Submodule_InputData(
+ slotNumber,
+ submoduleIdentNumber,
+ discardIoxs,
+ reduceOutputModuleDataLength,
+ reduceInputModuleDataLength,
+ sharedInput,
+ inputSubmoduleDataLength,
+ inputLengthIoCs,
+ inputLengthIoPs);
+ return pnIoCm_Submodule_InputData;
+ }
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (!(o instanceof PnIoCm_Submodule_InputData)) {
+ return false;
+ }
+ PnIoCm_Submodule_InputData that = (PnIoCm_Submodule_InputData) o;
+ return (getInputSubmoduleDataLength() == that.getInputSubmoduleDataLength())
+ && (getInputLengthIoCs() == that.getInputLengthIoCs())
+ && (getInputLengthIoPs() == that.getInputLengthIoPs())
+ && super.equals(that)
+ && true;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(
+ super.hashCode(),
+ getInputSubmoduleDataLength(),
+ getInputLengthIoCs(),
+ getInputLengthIoPs());
+ }
+
+ @Override
+ public String toString() {
+ WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true);
+ try {
+ writeBufferBoxBased.writeSerializable(this);
+ } catch (SerializationException e) {
+ throw new RuntimeException(e);
+ }
+ return "\n" + writeBufferBoxBased.getBox().toString() + "\n";
+ }
+}
diff --git a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_Submodule_OutputData.java b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_Submodule_OutputData.java
new file mode 100644
index 00000000000..be143f12d56
--- /dev/null
+++ b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_Submodule_OutputData.java
@@ -0,0 +1,236 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.plc4x.java.profinet.readwrite;
+
+import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*;
+import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*;
+import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*;
+import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*;
+import static org.apache.plc4x.java.spi.generation.StaticHelper.*;
+
+import java.time.*;
+import java.util.*;
+import org.apache.plc4x.java.api.exceptions.*;
+import org.apache.plc4x.java.api.value.*;
+import org.apache.plc4x.java.spi.codegen.*;
+import org.apache.plc4x.java.spi.codegen.fields.*;
+import org.apache.plc4x.java.spi.codegen.io.*;
+import org.apache.plc4x.java.spi.generation.*;
+
+// Code generated by code-generation. DO NOT EDIT.
+
+public class PnIoCm_Submodule_OutputData extends PnIoCm_Submodule implements Message {
+
+ // Accessors for discriminator values.
+ public PnIoCm_SubmoduleType getSubmoduleType() {
+ return PnIoCm_SubmoduleType.OUTPUT_DATA;
+ }
+
+ // Constant values.
+ public static final Integer INPUTDATADESCRIPTION = 0x0002;
+
+ // Properties.
+ protected final int inputSubmoduleDataLength;
+ protected final short inputLengthIoCs;
+ protected final short inputLengthIoPs;
+
+ public PnIoCm_Submodule_OutputData(
+ int slotNumber,
+ long submoduleIdentNumber,
+ boolean discardIoxs,
+ boolean reduceOutputModuleDataLength,
+ boolean reduceInputModuleDataLength,
+ boolean sharedInput,
+ int inputSubmoduleDataLength,
+ short inputLengthIoCs,
+ short inputLengthIoPs) {
+ super(
+ slotNumber,
+ submoduleIdentNumber,
+ discardIoxs,
+ reduceOutputModuleDataLength,
+ reduceInputModuleDataLength,
+ sharedInput);
+ this.inputSubmoduleDataLength = inputSubmoduleDataLength;
+ this.inputLengthIoCs = inputLengthIoCs;
+ this.inputLengthIoPs = inputLengthIoPs;
+ }
+
+ public int getInputSubmoduleDataLength() {
+ return inputSubmoduleDataLength;
+ }
+
+ public short getInputLengthIoCs() {
+ return inputLengthIoCs;
+ }
+
+ public short getInputLengthIoPs() {
+ return inputLengthIoPs;
+ }
+
+ public int getInputDataDescription() {
+ return INPUTDATADESCRIPTION;
+ }
+
+ @Override
+ protected void serializePnIoCm_SubmoduleChild(WriteBuffer writeBuffer)
+ throws SerializationException {
+ PositionAware positionAware = writeBuffer;
+ int startPos = positionAware.getPos();
+ writeBuffer.pushContext("PnIoCm_Submodule_OutputData");
+
+ // Const Field (inputDataDescription)
+ writeConstField(
+ "inputDataDescription", INPUTDATADESCRIPTION, writeUnsignedInt(writeBuffer, 16));
+
+ // Simple Field (inputSubmoduleDataLength)
+ writeSimpleField(
+ "inputSubmoduleDataLength", inputSubmoduleDataLength, writeUnsignedInt(writeBuffer, 16));
+
+ // Simple Field (inputLengthIoCs)
+ writeSimpleField("inputLengthIoCs", inputLengthIoCs, writeUnsignedShort(writeBuffer, 8));
+
+ // Simple Field (inputLengthIoPs)
+ writeSimpleField("inputLengthIoPs", inputLengthIoPs, writeUnsignedShort(writeBuffer, 8));
+
+ writeBuffer.popContext("PnIoCm_Submodule_OutputData");
+ }
+
+ @Override
+ public int getLengthInBytes() {
+ return (int) Math.ceil((float) getLengthInBits() / 8.0);
+ }
+
+ @Override
+ public int getLengthInBits() {
+ int lengthInBits = super.getLengthInBits();
+ PnIoCm_Submodule_OutputData _value = this;
+
+ // Const Field (inputDataDescription)
+ lengthInBits += 16;
+
+ // Simple field (inputSubmoduleDataLength)
+ lengthInBits += 16;
+
+ // Simple field (inputLengthIoCs)
+ lengthInBits += 8;
+
+ // Simple field (inputLengthIoPs)
+ lengthInBits += 8;
+
+ return lengthInBits;
+ }
+
+ public static PnIoCm_SubmoduleBuilder staticParsePnIoCm_SubmoduleBuilder(ReadBuffer readBuffer)
+ throws ParseException {
+ readBuffer.pullContext("PnIoCm_Submodule_OutputData");
+ PositionAware positionAware = readBuffer;
+ int startPos = positionAware.getPos();
+ int curPos;
+
+ int inputDataDescription =
+ readConstField(
+ "inputDataDescription",
+ readUnsignedInt(readBuffer, 16),
+ PnIoCm_Submodule_OutputData.INPUTDATADESCRIPTION);
+
+ int inputSubmoduleDataLength =
+ readSimpleField("inputSubmoduleDataLength", readUnsignedInt(readBuffer, 16));
+
+ short inputLengthIoCs = readSimpleField("inputLengthIoCs", readUnsignedShort(readBuffer, 8));
+
+ short inputLengthIoPs = readSimpleField("inputLengthIoPs", readUnsignedShort(readBuffer, 8));
+
+ readBuffer.closeContext("PnIoCm_Submodule_OutputData");
+ // Create the instance
+ return new PnIoCm_Submodule_OutputDataBuilderImpl(
+ inputSubmoduleDataLength, inputLengthIoCs, inputLengthIoPs);
+ }
+
+ public static class PnIoCm_Submodule_OutputDataBuilderImpl
+ implements PnIoCm_Submodule.PnIoCm_SubmoduleBuilder {
+ private final int inputSubmoduleDataLength;
+ private final short inputLengthIoCs;
+ private final short inputLengthIoPs;
+
+ public PnIoCm_Submodule_OutputDataBuilderImpl(
+ int inputSubmoduleDataLength, short inputLengthIoCs, short inputLengthIoPs) {
+ this.inputSubmoduleDataLength = inputSubmoduleDataLength;
+ this.inputLengthIoCs = inputLengthIoCs;
+ this.inputLengthIoPs = inputLengthIoPs;
+ }
+
+ public PnIoCm_Submodule_OutputData build(
+ int slotNumber,
+ long submoduleIdentNumber,
+ boolean discardIoxs,
+ boolean reduceOutputModuleDataLength,
+ boolean reduceInputModuleDataLength,
+ boolean sharedInput) {
+ PnIoCm_Submodule_OutputData pnIoCm_Submodule_OutputData =
+ new PnIoCm_Submodule_OutputData(
+ slotNumber,
+ submoduleIdentNumber,
+ discardIoxs,
+ reduceOutputModuleDataLength,
+ reduceInputModuleDataLength,
+ sharedInput,
+ inputSubmoduleDataLength,
+ inputLengthIoCs,
+ inputLengthIoPs);
+ return pnIoCm_Submodule_OutputData;
+ }
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (!(o instanceof PnIoCm_Submodule_OutputData)) {
+ return false;
+ }
+ PnIoCm_Submodule_OutputData that = (PnIoCm_Submodule_OutputData) o;
+ return (getInputSubmoduleDataLength() == that.getInputSubmoduleDataLength())
+ && (getInputLengthIoCs() == that.getInputLengthIoCs())
+ && (getInputLengthIoPs() == that.getInputLengthIoPs())
+ && super.equals(that)
+ && true;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(
+ super.hashCode(),
+ getInputSubmoduleDataLength(),
+ getInputLengthIoCs(),
+ getInputLengthIoPs());
+ }
+
+ @Override
+ public String toString() {
+ WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true);
+ try {
+ writeBufferBoxBased.writeSerializable(this);
+ } catch (SerializationException e) {
+ throw new RuntimeException(e);
+ }
+ return "\n" + writeBufferBoxBased.getBox().toString() + "\n";
+ }
+}
diff --git a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIo_CyclicServiceDataUnit.java b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIo_CyclicServiceDataUnit.java
new file mode 100644
index 00000000000..a205e12212f
--- /dev/null
+++ b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIo_CyclicServiceDataUnit.java
@@ -0,0 +1,148 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.plc4x.java.profinet.readwrite;
+
+import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*;
+import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*;
+import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*;
+import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*;
+import static org.apache.plc4x.java.spi.generation.StaticHelper.*;
+
+import java.time.*;
+import java.util.*;
+import org.apache.plc4x.java.api.exceptions.*;
+import org.apache.plc4x.java.api.value.*;
+import org.apache.plc4x.java.spi.codegen.*;
+import org.apache.plc4x.java.spi.codegen.fields.*;
+import org.apache.plc4x.java.spi.codegen.io.*;
+import org.apache.plc4x.java.spi.generation.*;
+
+// Code generated by code-generation. DO NOT EDIT.
+
+public class PnIo_CyclicServiceDataUnit implements Message {
+
+ // Properties.
+ protected final byte[] data;
+
+ // Arguments.
+ protected final Short dataUnitLength;
+
+ public PnIo_CyclicServiceDataUnit(byte[] data, Short dataUnitLength) {
+ super();
+ this.data = data;
+ this.dataUnitLength = dataUnitLength;
+ }
+
+ public byte[] getData() {
+ return data;
+ }
+
+ public void serialize(WriteBuffer writeBuffer) throws SerializationException {
+ PositionAware positionAware = writeBuffer;
+ int startPos = positionAware.getPos();
+ writeBuffer.pushContext("PnIo_CyclicServiceDataUnit");
+
+ // Array Field (data)
+ writeByteArrayField("data", data, writeByteArray(writeBuffer, 8));
+
+ writeBuffer.popContext("PnIo_CyclicServiceDataUnit");
+ }
+
+ @Override
+ public int getLengthInBytes() {
+ return (int) Math.ceil((float) getLengthInBits() / 8.0);
+ }
+
+ @Override
+ public int getLengthInBits() {
+ int lengthInBits = 0;
+ PnIo_CyclicServiceDataUnit _value = this;
+
+ // Array field
+ if (data != null) {
+ lengthInBits += 8 * data.length;
+ }
+
+ return lengthInBits;
+ }
+
+ public static PnIo_CyclicServiceDataUnit staticParse(ReadBuffer readBuffer, Object... args)
+ throws ParseException {
+ PositionAware positionAware = readBuffer;
+ if ((args == null) || (args.length != 1)) {
+ throw new PlcRuntimeException(
+ "Wrong number of arguments, expected 1, but got " + args.length);
+ }
+ Short dataUnitLength;
+ if (args[0] instanceof Short) {
+ dataUnitLength = (Short) args[0];
+ } else if (args[0] instanceof String) {
+ dataUnitLength = Short.valueOf((String) args[0]);
+ } else {
+ throw new PlcRuntimeException(
+ "Argument 0 expected to be of type Short or a string which is parseable but was "
+ + args[0].getClass().getName());
+ }
+ return staticParse(readBuffer, dataUnitLength);
+ }
+
+ public static PnIo_CyclicServiceDataUnit staticParse(ReadBuffer readBuffer, Short dataUnitLength)
+ throws ParseException {
+ readBuffer.pullContext("PnIo_CyclicServiceDataUnit");
+ PositionAware positionAware = readBuffer;
+ int startPos = positionAware.getPos();
+ int curPos;
+
+ byte[] data = readBuffer.readByteArray("data", Math.toIntExact(dataUnitLength));
+
+ readBuffer.closeContext("PnIo_CyclicServiceDataUnit");
+ // Create the instance
+ PnIo_CyclicServiceDataUnit _pnIo_CyclicServiceDataUnit;
+ _pnIo_CyclicServiceDataUnit = new PnIo_CyclicServiceDataUnit(data, dataUnitLength);
+ return _pnIo_CyclicServiceDataUnit;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (!(o instanceof PnIo_CyclicServiceDataUnit)) {
+ return false;
+ }
+ PnIo_CyclicServiceDataUnit that = (PnIo_CyclicServiceDataUnit) o;
+ return (getData() == that.getData()) && true;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(getData());
+ }
+
+ @Override
+ public String toString() {
+ WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true);
+ try {
+ writeBufferBoxBased.writeSerializable(this);
+ } catch (SerializationException e) {
+ throw new RuntimeException(e);
+ }
+ return "\n" + writeBufferBoxBased.getBox().toString() + "\n";
+ }
+}
diff --git a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/ProfinetDataType.java b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/ProfinetDataType.java
new file mode 100644
index 00000000000..4b9fae34b1c
--- /dev/null
+++ b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/ProfinetDataType.java
@@ -0,0 +1,132 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.plc4x.java.profinet.readwrite;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+// Code generated by code-generation. DO NOT EDIT.
+
+public enum ProfinetDataType {
+ BOOL((short) 1, (short) 1, (String) "BOOLEAN"),
+ BYTE((short) 2, (short) 1, (String) "BYTE"),
+ WORD((short) 3, (short) 2, (String) "WORD"),
+ DWORD((short) 4, (short) 4, (String) "DWORD"),
+ LWORD((short) 5, (short) 8, (String) "LWORD"),
+ SINT((short) 6, (short) 1, (String) "SIGNED8"),
+ INT((short) 7, (short) 2, (String) "SIGNED16"),
+ DINT((short) 8, (short) 4, (String) "SIGNED32"),
+ LINT((short) 9, (short) 8, (String) "SIGNED64"),
+ USINT((short) 10, (short) 1, (String) "UNSIGNED8"),
+ UINT((short) 11, (short) 2, (String) "UNSIGNED16"),
+ UDINT((short) 12, (short) 4, (String) "UNSIGNED32"),
+ ULINT((short) 13, (short) 8, (String) "UNSIGNED64"),
+ REAL((short) 14, (short) 4, (String) "FLOAT32"),
+ LREAL((short) 15, (short) 8, (String) "FLOAT64"),
+ TIME((short) 16, (short) 8, (String) "TIME"),
+ LTIME((short) 17, (short) 8, (String) "LTIME"),
+ DATE((short) 18, (short) 8, (String) "DATE"),
+ LDATE((short) 19, (short) 8, (String) "LDATE"),
+ TIME_OF_DAY((short) 20, (short) 8, (String) "TIME_OF_DAY"),
+ LTIME_OF_DAY((short) 21, (short) 8, (String) "LTIME_OF_DAY"),
+ DATE_AND_TIME((short) 22, (short) 8, (String) "DATE_AND_TIME"),
+ LDATE_AND_TIME((short) 23, (short) 8, (String) "LDATE_AND_TIME"),
+ CHAR((short) 24, (short) 1, (String) "CHAR"),
+ WCHAR((short) 25, (short) 2, (String) "WCHAR"),
+ STRING((short) 26, (short) 1, (String) "STRING"),
+ WSTRING((short) 27, (short) 2, (String) "WSTRING");
+ private static final Map map;
+
+ static {
+ map = new HashMap<>();
+ for (ProfinetDataType value : ProfinetDataType.values()) {
+ map.put((short) value.getValue(), value);
+ }
+ }
+
+ private short value;
+ private short dataTypeSize;
+ private String conversion;
+
+ ProfinetDataType(short value, short dataTypeSize, String conversion) {
+ this.value = value;
+ this.dataTypeSize = dataTypeSize;
+ this.conversion = conversion;
+ }
+
+ public short getValue() {
+ return value;
+ }
+
+ public short getDataTypeSize() {
+ return dataTypeSize;
+ }
+
+ public static ProfinetDataType firstEnumForFieldDataTypeSize(short fieldValue) {
+ for (ProfinetDataType _val : ProfinetDataType.values()) {
+ if (_val.getDataTypeSize() == fieldValue) {
+ return _val;
+ }
+ }
+ return null;
+ }
+
+ public static List enumsForFieldDataTypeSize(short fieldValue) {
+ List _values = new ArrayList();
+ for (ProfinetDataType _val : ProfinetDataType.values()) {
+ if (_val.getDataTypeSize() == fieldValue) {
+ _values.add(_val);
+ }
+ }
+ return _values;
+ }
+
+ public String getConversion() {
+ return conversion;
+ }
+
+ public static ProfinetDataType firstEnumForFieldConversion(String fieldValue) {
+ for (ProfinetDataType _val : ProfinetDataType.values()) {
+ if (_val.getConversion().equals(fieldValue)) {
+ return _val;
+ }
+ }
+ return null;
+ }
+
+ public static List enumsForFieldConversion(String fieldValue) {
+ List _values = new ArrayList();
+ for (ProfinetDataType _val : ProfinetDataType.values()) {
+ if (_val.getConversion().equals(fieldValue)) {
+ _values.add(_val);
+ }
+ }
+ return _values;
+ }
+
+ public static ProfinetDataType enumForValue(short value) {
+ return map.get(value);
+ }
+
+ public static Boolean isDefined(short value) {
+ return map.containsKey(value);
+ }
+}
diff --git a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/ProfinetDeviceState.java b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/ProfinetDeviceState.java
new file mode 100644
index 00000000000..5e96b980067
--- /dev/null
+++ b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/ProfinetDeviceState.java
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.plc4x.java.profinet.readwrite;
+
+import java.util.HashMap;
+import java.util.Map;
+
+// Code generated by code-generation. DO NOT EDIT.
+
+public enum ProfinetDeviceState {
+ IDLE((short) 0x00),
+ STARTUP((short) 0x01),
+ PREMED((short) 0x02),
+ WAITAPPLRDY((short) 0x03),
+ APPLRDY((short) 0x04),
+ CYCLICDATA((short) 0x05),
+ ABORT((short) 0xFF);
+ private static final Map map;
+
+ static {
+ map = new HashMap<>();
+ for (ProfinetDeviceState value : ProfinetDeviceState.values()) {
+ map.put((short) value.getValue(), value);
+ }
+ }
+
+ private short value;
+
+ ProfinetDeviceState(short value) {
+ this.value = value;
+ }
+
+ public short getValue() {
+ return value;
+ }
+
+ public static ProfinetDeviceState enumForValue(short value) {
+ return map.get(value);
+ }
+
+ public static Boolean isDefined(short value) {
+ return map.containsKey(value);
+ }
+}
diff --git a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/TlvChassisId.java b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/TlvChassisId.java
new file mode 100644
index 00000000000..17a03808343
--- /dev/null
+++ b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/TlvChassisId.java
@@ -0,0 +1,160 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.plc4x.java.profinet.readwrite;
+
+import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*;
+import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*;
+import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*;
+import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*;
+import static org.apache.plc4x.java.spi.generation.StaticHelper.*;
+
+import java.time.*;
+import java.util.*;
+import org.apache.plc4x.java.api.exceptions.*;
+import org.apache.plc4x.java.api.value.*;
+import org.apache.plc4x.java.spi.codegen.*;
+import org.apache.plc4x.java.spi.codegen.fields.*;
+import org.apache.plc4x.java.spi.codegen.io.*;
+import org.apache.plc4x.java.spi.generation.*;
+
+// Code generated by code-generation. DO NOT EDIT.
+
+public class TlvChassisId extends LldpUnit implements Message {
+
+ // Accessors for discriminator values.
+ public TlvType getTlvId() {
+ return TlvType.CHASSIS_ID;
+ }
+
+ // Properties.
+ protected final short chassisIdSubType;
+ protected final String chassisId;
+
+ public TlvChassisId(int tlvIdLength, short chassisIdSubType, String chassisId) {
+ super(tlvIdLength);
+ this.chassisIdSubType = chassisIdSubType;
+ this.chassisId = chassisId;
+ }
+
+ public short getChassisIdSubType() {
+ return chassisIdSubType;
+ }
+
+ public String getChassisId() {
+ return chassisId;
+ }
+
+ @Override
+ protected void serializeLldpUnitChild(WriteBuffer writeBuffer) throws SerializationException {
+ PositionAware positionAware = writeBuffer;
+ int startPos = positionAware.getPos();
+ writeBuffer.pushContext("TlvChassisId");
+
+ // Simple Field (chassisIdSubType)
+ writeSimpleField("chassisIdSubType", chassisIdSubType, writeUnsignedShort(writeBuffer, 8));
+
+ // Simple Field (chassisId)
+ writeSimpleField(
+ "chassisId", chassisId, writeString(writeBuffer, (((tlvIdLength) - (1))) * (8)));
+
+ writeBuffer.popContext("TlvChassisId");
+ }
+
+ @Override
+ public int getLengthInBytes() {
+ return (int) Math.ceil((float) getLengthInBits() / 8.0);
+ }
+
+ @Override
+ public int getLengthInBits() {
+ int lengthInBits = super.getLengthInBits();
+ TlvChassisId _value = this;
+
+ // Simple field (chassisIdSubType)
+ lengthInBits += 8;
+
+ // Simple field (chassisId)
+ lengthInBits += (((tlvIdLength) - (1))) * (8);
+
+ return lengthInBits;
+ }
+
+ public static LldpUnitBuilder staticParseLldpUnitBuilder(
+ ReadBuffer readBuffer, Integer tlvIdLength) throws ParseException {
+ readBuffer.pullContext("TlvChassisId");
+ PositionAware positionAware = readBuffer;
+ int startPos = positionAware.getPos();
+ int curPos;
+
+ short chassisIdSubType = readSimpleField("chassisIdSubType", readUnsignedShort(readBuffer, 8));
+
+ String chassisId =
+ readSimpleField("chassisId", readString(readBuffer, (((tlvIdLength) - (1))) * (8)));
+
+ readBuffer.closeContext("TlvChassisId");
+ // Create the instance
+ return new TlvChassisIdBuilderImpl(chassisIdSubType, chassisId);
+ }
+
+ public static class TlvChassisIdBuilderImpl implements LldpUnit.LldpUnitBuilder {
+ private final short chassisIdSubType;
+ private final String chassisId;
+
+ public TlvChassisIdBuilderImpl(short chassisIdSubType, String chassisId) {
+ this.chassisIdSubType = chassisIdSubType;
+ this.chassisId = chassisId;
+ }
+
+ public TlvChassisId build(int tlvIdLength) {
+ TlvChassisId tlvChassisId = new TlvChassisId(tlvIdLength, chassisIdSubType, chassisId);
+ return tlvChassisId;
+ }
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (!(o instanceof TlvChassisId)) {
+ return false;
+ }
+ TlvChassisId that = (TlvChassisId) o;
+ return (getChassisIdSubType() == that.getChassisIdSubType())
+ && (getChassisId() == that.getChassisId())
+ && super.equals(that)
+ && true;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(super.hashCode(), getChassisIdSubType(), getChassisId());
+ }
+
+ @Override
+ public String toString() {
+ WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true);
+ try {
+ writeBufferBoxBased.writeSerializable(this);
+ } catch (SerializationException e) {
+ throw new RuntimeException(e);
+ }
+ return "\n" + writeBufferBoxBased.getBox().toString() + "\n";
+ }
+}
diff --git a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/TlvManagementAddress.java b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/TlvManagementAddress.java
new file mode 100644
index 00000000000..edbbb9f7ca5
--- /dev/null
+++ b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/TlvManagementAddress.java
@@ -0,0 +1,261 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.plc4x.java.profinet.readwrite;
+
+import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*;
+import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*;
+import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*;
+import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*;
+import static org.apache.plc4x.java.spi.generation.StaticHelper.*;
+
+import java.time.*;
+import java.util.*;
+import org.apache.plc4x.java.api.exceptions.*;
+import org.apache.plc4x.java.api.value.*;
+import org.apache.plc4x.java.spi.codegen.*;
+import org.apache.plc4x.java.spi.codegen.fields.*;
+import org.apache.plc4x.java.spi.codegen.io.*;
+import org.apache.plc4x.java.spi.generation.*;
+
+// Code generated by code-generation. DO NOT EDIT.
+
+public class TlvManagementAddress extends LldpUnit implements Message {
+
+ // Accessors for discriminator values.
+ public TlvType getTlvId() {
+ return TlvType.MANAGEMENT_ADDRESS;
+ }
+
+ // Properties.
+ protected final ManagementAddressSubType addressSubType;
+ protected final IpAddress ipAddress;
+ protected final short interfaceSubType;
+ protected final long interfaceNumber;
+ protected final short oidStringLength;
+
+ public TlvManagementAddress(
+ int tlvIdLength,
+ ManagementAddressSubType addressSubType,
+ IpAddress ipAddress,
+ short interfaceSubType,
+ long interfaceNumber,
+ short oidStringLength) {
+ super(tlvIdLength);
+ this.addressSubType = addressSubType;
+ this.ipAddress = ipAddress;
+ this.interfaceSubType = interfaceSubType;
+ this.interfaceNumber = interfaceNumber;
+ this.oidStringLength = oidStringLength;
+ }
+
+ public ManagementAddressSubType getAddressSubType() {
+ return addressSubType;
+ }
+
+ public IpAddress getIpAddress() {
+ return ipAddress;
+ }
+
+ public short getInterfaceSubType() {
+ return interfaceSubType;
+ }
+
+ public long getInterfaceNumber() {
+ return interfaceNumber;
+ }
+
+ public short getOidStringLength() {
+ return oidStringLength;
+ }
+
+ @Override
+ protected void serializeLldpUnitChild(WriteBuffer writeBuffer) throws SerializationException {
+ PositionAware positionAware = writeBuffer;
+ int startPos = positionAware.getPos();
+ writeBuffer.pushContext("TlvManagementAddress");
+
+ // Implicit Field (addressStringLength) (Used for parsing, but its value is not stored as it's
+ // implicitly given by the objects content)
+ short addressStringLength = (short) (5);
+ writeImplicitField(
+ "addressStringLength", addressStringLength, writeUnsignedShort(writeBuffer, 8));
+
+ // Simple Field (addressSubType)
+ writeSimpleEnumField(
+ "addressSubType",
+ "ManagementAddressSubType",
+ addressSubType,
+ new DataWriterEnumDefault<>(
+ ManagementAddressSubType::getValue,
+ ManagementAddressSubType::name,
+ writeUnsignedShort(writeBuffer, 8)));
+
+ // Simple Field (ipAddress)
+ writeSimpleField("ipAddress", ipAddress, new DataWriterComplexDefault<>(writeBuffer));
+
+ // Simple Field (interfaceSubType)
+ writeSimpleField("interfaceSubType", interfaceSubType, writeUnsignedShort(writeBuffer, 8));
+
+ // Simple Field (interfaceNumber)
+ writeSimpleField("interfaceNumber", interfaceNumber, writeUnsignedLong(writeBuffer, 32));
+
+ // Simple Field (oidStringLength)
+ writeSimpleField("oidStringLength", oidStringLength, writeUnsignedShort(writeBuffer, 8));
+
+ writeBuffer.popContext("TlvManagementAddress");
+ }
+
+ @Override
+ public int getLengthInBytes() {
+ return (int) Math.ceil((float) getLengthInBits() / 8.0);
+ }
+
+ @Override
+ public int getLengthInBits() {
+ int lengthInBits = super.getLengthInBits();
+ TlvManagementAddress _value = this;
+
+ // Implicit Field (addressStringLength)
+ lengthInBits += 8;
+
+ // Simple field (addressSubType)
+ lengthInBits += 8;
+
+ // Simple field (ipAddress)
+ lengthInBits += ipAddress.getLengthInBits();
+
+ // Simple field (interfaceSubType)
+ lengthInBits += 8;
+
+ // Simple field (interfaceNumber)
+ lengthInBits += 32;
+
+ // Simple field (oidStringLength)
+ lengthInBits += 8;
+
+ return lengthInBits;
+ }
+
+ public static LldpUnitBuilder staticParseLldpUnitBuilder(ReadBuffer readBuffer)
+ throws ParseException {
+ readBuffer.pullContext("TlvManagementAddress");
+ PositionAware positionAware = readBuffer;
+ int startPos = positionAware.getPos();
+ int curPos;
+
+ short addressStringLength =
+ readImplicitField("addressStringLength", readUnsignedShort(readBuffer, 8));
+
+ ManagementAddressSubType addressSubType =
+ readEnumField(
+ "addressSubType",
+ "ManagementAddressSubType",
+ new DataReaderEnumDefault<>(
+ ManagementAddressSubType::enumForValue, readUnsignedShort(readBuffer, 8)));
+
+ IpAddress ipAddress =
+ readSimpleField(
+ "ipAddress",
+ new DataReaderComplexDefault<>(() -> IpAddress.staticParse(readBuffer), readBuffer));
+
+ short interfaceSubType = readSimpleField("interfaceSubType", readUnsignedShort(readBuffer, 8));
+
+ long interfaceNumber = readSimpleField("interfaceNumber", readUnsignedLong(readBuffer, 32));
+
+ short oidStringLength = readSimpleField("oidStringLength", readUnsignedShort(readBuffer, 8));
+
+ readBuffer.closeContext("TlvManagementAddress");
+ // Create the instance
+ return new TlvManagementAddressBuilderImpl(
+ addressSubType, ipAddress, interfaceSubType, interfaceNumber, oidStringLength);
+ }
+
+ public static class TlvManagementAddressBuilderImpl implements LldpUnit.LldpUnitBuilder {
+ private final ManagementAddressSubType addressSubType;
+ private final IpAddress ipAddress;
+ private final short interfaceSubType;
+ private final long interfaceNumber;
+ private final short oidStringLength;
+
+ public TlvManagementAddressBuilderImpl(
+ ManagementAddressSubType addressSubType,
+ IpAddress ipAddress,
+ short interfaceSubType,
+ long interfaceNumber,
+ short oidStringLength) {
+ this.addressSubType = addressSubType;
+ this.ipAddress = ipAddress;
+ this.interfaceSubType = interfaceSubType;
+ this.interfaceNumber = interfaceNumber;
+ this.oidStringLength = oidStringLength;
+ }
+
+ public TlvManagementAddress build(int tlvIdLength) {
+ TlvManagementAddress tlvManagementAddress =
+ new TlvManagementAddress(
+ tlvIdLength,
+ addressSubType,
+ ipAddress,
+ interfaceSubType,
+ interfaceNumber,
+ oidStringLength);
+ return tlvManagementAddress;
+ }
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (!(o instanceof TlvManagementAddress)) {
+ return false;
+ }
+ TlvManagementAddress that = (TlvManagementAddress) o;
+ return (getAddressSubType() == that.getAddressSubType())
+ && (getIpAddress() == that.getIpAddress())
+ && (getInterfaceSubType() == that.getInterfaceSubType())
+ && (getInterfaceNumber() == that.getInterfaceNumber())
+ && (getOidStringLength() == that.getOidStringLength())
+ && super.equals(that)
+ && true;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(
+ super.hashCode(),
+ getAddressSubType(),
+ getIpAddress(),
+ getInterfaceSubType(),
+ getInterfaceNumber(),
+ getOidStringLength());
+ }
+
+ @Override
+ public String toString() {
+ WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true);
+ try {
+ writeBufferBoxBased.writeSerializable(this);
+ } catch (SerializationException e) {
+ throw new RuntimeException(e);
+ }
+ return "\n" + writeBufferBoxBased.getBox().toString() + "\n";
+ }
+}
diff --git a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/TlvOrgSpecificIeee8023.java b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/TlvOrgSpecificIeee8023.java
new file mode 100644
index 00000000000..bb6e4336b77
--- /dev/null
+++ b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/TlvOrgSpecificIeee8023.java
@@ -0,0 +1,210 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.plc4x.java.profinet.readwrite;
+
+import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*;
+import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*;
+import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*;
+import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*;
+import static org.apache.plc4x.java.spi.generation.StaticHelper.*;
+
+import java.time.*;
+import java.util.*;
+import org.apache.plc4x.java.api.exceptions.*;
+import org.apache.plc4x.java.api.value.*;
+import org.apache.plc4x.java.spi.codegen.*;
+import org.apache.plc4x.java.spi.codegen.fields.*;
+import org.apache.plc4x.java.spi.codegen.io.*;
+import org.apache.plc4x.java.spi.generation.*;
+
+// Code generated by code-generation. DO NOT EDIT.
+
+public class TlvOrgSpecificIeee8023 extends TlvOrganizationSpecificUnit implements Message {
+
+ // Accessors for discriminator values.
+ public Long getUniqueCode() {
+ return (long) 0x00120F;
+ }
+
+ // Properties.
+ protected final short subType;
+ protected final short negotiationSupport;
+ protected final int negotiationCapability;
+ protected final int operationalMauType;
+
+ public TlvOrgSpecificIeee8023(
+ short subType, short negotiationSupport, int negotiationCapability, int operationalMauType) {
+ super();
+ this.subType = subType;
+ this.negotiationSupport = negotiationSupport;
+ this.negotiationCapability = negotiationCapability;
+ this.operationalMauType = operationalMauType;
+ }
+
+ public short getSubType() {
+ return subType;
+ }
+
+ public short getNegotiationSupport() {
+ return negotiationSupport;
+ }
+
+ public int getNegotiationCapability() {
+ return negotiationCapability;
+ }
+
+ public int getOperationalMauType() {
+ return operationalMauType;
+ }
+
+ @Override
+ protected void serializeTlvOrganizationSpecificUnitChild(WriteBuffer writeBuffer)
+ throws SerializationException {
+ PositionAware positionAware = writeBuffer;
+ int startPos = positionAware.getPos();
+ writeBuffer.pushContext("TlvOrgSpecificIeee8023");
+
+ // Simple Field (subType)
+ writeSimpleField("subType", subType, writeUnsignedShort(writeBuffer, 8));
+
+ // Simple Field (negotiationSupport)
+ writeSimpleField("negotiationSupport", negotiationSupport, writeUnsignedShort(writeBuffer, 8));
+
+ // Simple Field (negotiationCapability)
+ writeSimpleField(
+ "negotiationCapability", negotiationCapability, writeUnsignedInt(writeBuffer, 16));
+
+ // Simple Field (operationalMauType)
+ writeSimpleField("operationalMauType", operationalMauType, writeUnsignedInt(writeBuffer, 16));
+
+ writeBuffer.popContext("TlvOrgSpecificIeee8023");
+ }
+
+ @Override
+ public int getLengthInBytes() {
+ return (int) Math.ceil((float) getLengthInBits() / 8.0);
+ }
+
+ @Override
+ public int getLengthInBits() {
+ int lengthInBits = super.getLengthInBits();
+ TlvOrgSpecificIeee8023 _value = this;
+
+ // Simple field (subType)
+ lengthInBits += 8;
+
+ // Simple field (negotiationSupport)
+ lengthInBits += 8;
+
+ // Simple field (negotiationCapability)
+ lengthInBits += 16;
+
+ // Simple field (operationalMauType)
+ lengthInBits += 16;
+
+ return lengthInBits;
+ }
+
+ public static TlvOrganizationSpecificUnitBuilder staticParseTlvOrganizationSpecificUnitBuilder(
+ ReadBuffer readBuffer) throws ParseException {
+ readBuffer.pullContext("TlvOrgSpecificIeee8023");
+ PositionAware positionAware = readBuffer;
+ int startPos = positionAware.getPos();
+ int curPos;
+
+ short subType = readSimpleField("subType", readUnsignedShort(readBuffer, 8));
+
+ short negotiationSupport =
+ readSimpleField("negotiationSupport", readUnsignedShort(readBuffer, 8));
+
+ int negotiationCapability =
+ readSimpleField("negotiationCapability", readUnsignedInt(readBuffer, 16));
+
+ int operationalMauType = readSimpleField("operationalMauType", readUnsignedInt(readBuffer, 16));
+
+ readBuffer.closeContext("TlvOrgSpecificIeee8023");
+ // Create the instance
+ return new TlvOrgSpecificIeee8023BuilderImpl(
+ subType, negotiationSupport, negotiationCapability, operationalMauType);
+ }
+
+ public static class TlvOrgSpecificIeee8023BuilderImpl
+ implements TlvOrganizationSpecificUnit.TlvOrganizationSpecificUnitBuilder {
+ private final short subType;
+ private final short negotiationSupport;
+ private final int negotiationCapability;
+ private final int operationalMauType;
+
+ public TlvOrgSpecificIeee8023BuilderImpl(
+ short subType,
+ short negotiationSupport,
+ int negotiationCapability,
+ int operationalMauType) {
+ this.subType = subType;
+ this.negotiationSupport = negotiationSupport;
+ this.negotiationCapability = negotiationCapability;
+ this.operationalMauType = operationalMauType;
+ }
+
+ public TlvOrgSpecificIeee8023 build() {
+ TlvOrgSpecificIeee8023 tlvOrgSpecificIeee8023 =
+ new TlvOrgSpecificIeee8023(
+ subType, negotiationSupport, negotiationCapability, operationalMauType);
+ return tlvOrgSpecificIeee8023;
+ }
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (!(o instanceof TlvOrgSpecificIeee8023)) {
+ return false;
+ }
+ TlvOrgSpecificIeee8023 that = (TlvOrgSpecificIeee8023) o;
+ return (getSubType() == that.getSubType())
+ && (getNegotiationSupport() == that.getNegotiationSupport())
+ && (getNegotiationCapability() == that.getNegotiationCapability())
+ && (getOperationalMauType() == that.getOperationalMauType())
+ && super.equals(that)
+ && true;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(
+ super.hashCode(),
+ getSubType(),
+ getNegotiationSupport(),
+ getNegotiationCapability(),
+ getOperationalMauType());
+ }
+
+ @Override
+ public String toString() {
+ WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true);
+ try {
+ writeBufferBoxBased.writeSerializable(this);
+ } catch (SerializationException e) {
+ throw new RuntimeException(e);
+ }
+ return "\n" + writeBufferBoxBased.getBox().toString() + "\n";
+ }
+}
diff --git a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/TlvOrgSpecificProfibus.java b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/TlvOrgSpecificProfibus.java
new file mode 100644
index 00000000000..daa2a9034fd
--- /dev/null
+++ b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/TlvOrgSpecificProfibus.java
@@ -0,0 +1,145 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.plc4x.java.profinet.readwrite;
+
+import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*;
+import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*;
+import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*;
+import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*;
+import static org.apache.plc4x.java.spi.generation.StaticHelper.*;
+
+import java.time.*;
+import java.util.*;
+import org.apache.plc4x.java.api.exceptions.*;
+import org.apache.plc4x.java.api.value.*;
+import org.apache.plc4x.java.spi.codegen.*;
+import org.apache.plc4x.java.spi.codegen.fields.*;
+import org.apache.plc4x.java.spi.codegen.io.*;
+import org.apache.plc4x.java.spi.generation.*;
+
+// Code generated by code-generation. DO NOT EDIT.
+
+public class TlvOrgSpecificProfibus extends TlvOrganizationSpecificUnit implements Message {
+
+ // Accessors for discriminator values.
+ public Long getUniqueCode() {
+ return (long) 0x000ECF;
+ }
+
+ // Properties.
+ protected final TlvOrgSpecificProfibusUnit specificUnit;
+
+ public TlvOrgSpecificProfibus(TlvOrgSpecificProfibusUnit specificUnit) {
+ super();
+ this.specificUnit = specificUnit;
+ }
+
+ public TlvOrgSpecificProfibusUnit getSpecificUnit() {
+ return specificUnit;
+ }
+
+ @Override
+ protected void serializeTlvOrganizationSpecificUnitChild(WriteBuffer writeBuffer)
+ throws SerializationException {
+ PositionAware positionAware = writeBuffer;
+ int startPos = positionAware.getPos();
+ writeBuffer.pushContext("TlvOrgSpecificProfibus");
+
+ // Simple Field (specificUnit)
+ writeSimpleField("specificUnit", specificUnit, new DataWriterComplexDefault<>(writeBuffer));
+
+ writeBuffer.popContext("TlvOrgSpecificProfibus");
+ }
+
+ @Override
+ public int getLengthInBytes() {
+ return (int) Math.ceil((float) getLengthInBits() / 8.0);
+ }
+
+ @Override
+ public int getLengthInBits() {
+ int lengthInBits = super.getLengthInBits();
+ TlvOrgSpecificProfibus _value = this;
+
+ // Simple field (specificUnit)
+ lengthInBits += specificUnit.getLengthInBits();
+
+ return lengthInBits;
+ }
+
+ public static TlvOrganizationSpecificUnitBuilder staticParseTlvOrganizationSpecificUnitBuilder(
+ ReadBuffer readBuffer) throws ParseException {
+ readBuffer.pullContext("TlvOrgSpecificProfibus");
+ PositionAware positionAware = readBuffer;
+ int startPos = positionAware.getPos();
+ int curPos;
+
+ TlvOrgSpecificProfibusUnit specificUnit =
+ readSimpleField(
+ "specificUnit",
+ new DataReaderComplexDefault<>(
+ () -> TlvOrgSpecificProfibusUnit.staticParse(readBuffer), readBuffer));
+
+ readBuffer.closeContext("TlvOrgSpecificProfibus");
+ // Create the instance
+ return new TlvOrgSpecificProfibusBuilderImpl(specificUnit);
+ }
+
+ public static class TlvOrgSpecificProfibusBuilderImpl
+ implements TlvOrganizationSpecificUnit.TlvOrganizationSpecificUnitBuilder {
+ private final TlvOrgSpecificProfibusUnit specificUnit;
+
+ public TlvOrgSpecificProfibusBuilderImpl(TlvOrgSpecificProfibusUnit specificUnit) {
+ this.specificUnit = specificUnit;
+ }
+
+ public TlvOrgSpecificProfibus build() {
+ TlvOrgSpecificProfibus tlvOrgSpecificProfibus = new TlvOrgSpecificProfibus(specificUnit);
+ return tlvOrgSpecificProfibus;
+ }
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (!(o instanceof TlvOrgSpecificProfibus)) {
+ return false;
+ }
+ TlvOrgSpecificProfibus that = (TlvOrgSpecificProfibus) o;
+ return (getSpecificUnit() == that.getSpecificUnit()) && super.equals(that) && true;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(super.hashCode(), getSpecificUnit());
+ }
+
+ @Override
+ public String toString() {
+ WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true);
+ try {
+ writeBufferBoxBased.writeSerializable(this);
+ } catch (SerializationException e) {
+ throw new RuntimeException(e);
+ }
+ return "\n" + writeBufferBoxBased.getBox().toString() + "\n";
+ }
+}
diff --git a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/TlvOrgSpecificProfibusUnit.java b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/TlvOrgSpecificProfibusUnit.java
new file mode 100644
index 00000000000..c0b137cbce8
--- /dev/null
+++ b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/TlvOrgSpecificProfibusUnit.java
@@ -0,0 +1,159 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.plc4x.java.profinet.readwrite;
+
+import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*;
+import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*;
+import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*;
+import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*;
+import static org.apache.plc4x.java.spi.generation.StaticHelper.*;
+
+import java.time.*;
+import java.util.*;
+import org.apache.plc4x.java.api.exceptions.*;
+import org.apache.plc4x.java.api.value.*;
+import org.apache.plc4x.java.spi.codegen.*;
+import org.apache.plc4x.java.spi.codegen.fields.*;
+import org.apache.plc4x.java.spi.codegen.io.*;
+import org.apache.plc4x.java.spi.generation.*;
+
+// Code generated by code-generation. DO NOT EDIT.
+
+public abstract class TlvOrgSpecificProfibusUnit implements Message {
+
+ // Abstract accessors for discriminator values.
+ public abstract TlvProfibusSubType getSubType();
+
+ public TlvOrgSpecificProfibusUnit() {
+ super();
+ }
+
+ protected abstract void serializeTlvOrgSpecificProfibusUnitChild(WriteBuffer writeBuffer)
+ throws SerializationException;
+
+ public void serialize(WriteBuffer writeBuffer) throws SerializationException {
+ PositionAware positionAware = writeBuffer;
+ int startPos = positionAware.getPos();
+ writeBuffer.pushContext("TlvOrgSpecificProfibusUnit");
+
+ // Discriminator Field (subType) (Used as input to a switch field)
+ writeDiscriminatorEnumField(
+ "subType",
+ "TlvProfibusSubType",
+ getSubType(),
+ new DataWriterEnumDefault<>(
+ TlvProfibusSubType::getValue,
+ TlvProfibusSubType::name,
+ writeUnsignedShort(writeBuffer, 8)));
+
+ // Switch field (Serialize the sub-type)
+ serializeTlvOrgSpecificProfibusUnitChild(writeBuffer);
+
+ writeBuffer.popContext("TlvOrgSpecificProfibusUnit");
+ }
+
+ @Override
+ public int getLengthInBytes() {
+ return (int) Math.ceil((float) getLengthInBits() / 8.0);
+ }
+
+ @Override
+ public int getLengthInBits() {
+ int lengthInBits = 0;
+ TlvOrgSpecificProfibusUnit _value = this;
+
+ // Discriminator Field (subType)
+ lengthInBits += 8;
+
+ // Length of sub-type elements will be added by sub-type...
+
+ return lengthInBits;
+ }
+
+ public static TlvOrgSpecificProfibusUnit staticParse(ReadBuffer readBuffer, Object... args)
+ throws ParseException {
+ PositionAware positionAware = readBuffer;
+ return staticParse(readBuffer);
+ }
+
+ public static TlvOrgSpecificProfibusUnit staticParse(ReadBuffer readBuffer)
+ throws ParseException {
+ readBuffer.pullContext("TlvOrgSpecificProfibusUnit");
+ PositionAware positionAware = readBuffer;
+ int startPos = positionAware.getPos();
+ int curPos;
+
+ TlvProfibusSubType subType =
+ readDiscriminatorField(
+ "subType",
+ new DataReaderEnumDefault<>(
+ TlvProfibusSubType::enumForValue, readUnsignedShort(readBuffer, 8)));
+
+ // Switch Field (Depending on the discriminator values, passes the instantiation to a sub-type)
+ TlvOrgSpecificProfibusUnitBuilder builder = null;
+ if (EvaluationHelper.equals(subType, TlvProfibusSubType.PORT_STATUS)) {
+ builder =
+ TlvProfibusSubTypePortStatus.staticParseTlvOrgSpecificProfibusUnitBuilder(readBuffer);
+ } else if (EvaluationHelper.equals(subType, TlvProfibusSubType.CHASSIS_MAC)) {
+ builder =
+ TlvProfibusSubTypeChassisMac.staticParseTlvOrgSpecificProfibusUnitBuilder(readBuffer);
+ }
+ if (builder == null) {
+ throw new ParseException(
+ "Unsupported case for discriminated type" + " parameters [" + "subType=" + subType + "]");
+ }
+
+ readBuffer.closeContext("TlvOrgSpecificProfibusUnit");
+ // Create the instance
+ TlvOrgSpecificProfibusUnit _tlvOrgSpecificProfibusUnit = builder.build();
+ return _tlvOrgSpecificProfibusUnit;
+ }
+
+ public interface TlvOrgSpecificProfibusUnitBuilder {
+ TlvOrgSpecificProfibusUnit build();
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (!(o instanceof TlvOrgSpecificProfibusUnit)) {
+ return false;
+ }
+ TlvOrgSpecificProfibusUnit that = (TlvOrgSpecificProfibusUnit) o;
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash();
+ }
+
+ @Override
+ public String toString() {
+ WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true);
+ try {
+ writeBufferBoxBased.writeSerializable(this);
+ } catch (SerializationException e) {
+ throw new RuntimeException(e);
+ }
+ return "\n" + writeBufferBoxBased.getBox().toString() + "\n";
+ }
+}
diff --git a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/TlvOrganizationSpecific.java b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/TlvOrganizationSpecific.java
new file mode 100644
index 00000000000..12357562db2
--- /dev/null
+++ b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/TlvOrganizationSpecific.java
@@ -0,0 +1,151 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.plc4x.java.profinet.readwrite;
+
+import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*;
+import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*;
+import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*;
+import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*;
+import static org.apache.plc4x.java.spi.generation.StaticHelper.*;
+
+import java.time.*;
+import java.util.*;
+import org.apache.plc4x.java.api.exceptions.*;
+import org.apache.plc4x.java.api.value.*;
+import org.apache.plc4x.java.spi.codegen.*;
+import org.apache.plc4x.java.spi.codegen.fields.*;
+import org.apache.plc4x.java.spi.codegen.io.*;
+import org.apache.plc4x.java.spi.generation.*;
+
+// Code generated by code-generation. DO NOT EDIT.
+
+public class TlvOrganizationSpecific extends LldpUnit implements Message {
+
+ // Accessors for discriminator values.
+ public TlvType getTlvId() {
+ return TlvType.ORGANIZATION_SPECIFIC;
+ }
+
+ // Properties.
+ protected final TlvOrganizationSpecificUnit organizationSpecificUnit;
+
+ public TlvOrganizationSpecific(
+ int tlvIdLength, TlvOrganizationSpecificUnit organizationSpecificUnit) {
+ super(tlvIdLength);
+ this.organizationSpecificUnit = organizationSpecificUnit;
+ }
+
+ public TlvOrganizationSpecificUnit getOrganizationSpecificUnit() {
+ return organizationSpecificUnit;
+ }
+
+ @Override
+ protected void serializeLldpUnitChild(WriteBuffer writeBuffer) throws SerializationException {
+ PositionAware positionAware = writeBuffer;
+ int startPos = positionAware.getPos();
+ writeBuffer.pushContext("TlvOrganizationSpecific");
+
+ // Simple Field (organizationSpecificUnit)
+ writeSimpleField(
+ "organizationSpecificUnit",
+ organizationSpecificUnit,
+ new DataWriterComplexDefault<>(writeBuffer));
+
+ writeBuffer.popContext("TlvOrganizationSpecific");
+ }
+
+ @Override
+ public int getLengthInBytes() {
+ return (int) Math.ceil((float) getLengthInBits() / 8.0);
+ }
+
+ @Override
+ public int getLengthInBits() {
+ int lengthInBits = super.getLengthInBits();
+ TlvOrganizationSpecific _value = this;
+
+ // Simple field (organizationSpecificUnit)
+ lengthInBits += organizationSpecificUnit.getLengthInBits();
+
+ return lengthInBits;
+ }
+
+ public static LldpUnitBuilder staticParseLldpUnitBuilder(ReadBuffer readBuffer)
+ throws ParseException {
+ readBuffer.pullContext("TlvOrganizationSpecific");
+ PositionAware positionAware = readBuffer;
+ int startPos = positionAware.getPos();
+ int curPos;
+
+ TlvOrganizationSpecificUnit organizationSpecificUnit =
+ readSimpleField(
+ "organizationSpecificUnit",
+ new DataReaderComplexDefault<>(
+ () -> TlvOrganizationSpecificUnit.staticParse(readBuffer), readBuffer));
+
+ readBuffer.closeContext("TlvOrganizationSpecific");
+ // Create the instance
+ return new TlvOrganizationSpecificBuilderImpl(organizationSpecificUnit);
+ }
+
+ public static class TlvOrganizationSpecificBuilderImpl implements LldpUnit.LldpUnitBuilder {
+ private final TlvOrganizationSpecificUnit organizationSpecificUnit;
+
+ public TlvOrganizationSpecificBuilderImpl(
+ TlvOrganizationSpecificUnit organizationSpecificUnit) {
+ this.organizationSpecificUnit = organizationSpecificUnit;
+ }
+
+ public TlvOrganizationSpecific build(int tlvIdLength) {
+ TlvOrganizationSpecific tlvOrganizationSpecific =
+ new TlvOrganizationSpecific(tlvIdLength, organizationSpecificUnit);
+ return tlvOrganizationSpecific;
+ }
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (!(o instanceof TlvOrganizationSpecific)) {
+ return false;
+ }
+ TlvOrganizationSpecific that = (TlvOrganizationSpecific) o;
+ return (getOrganizationSpecificUnit() == that.getOrganizationSpecificUnit())
+ && super.equals(that)
+ && true;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(super.hashCode(), getOrganizationSpecificUnit());
+ }
+
+ @Override
+ public String toString() {
+ WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true);
+ try {
+ writeBufferBoxBased.writeSerializable(this);
+ } catch (SerializationException e) {
+ throw new RuntimeException(e);
+ }
+ return "\n" + writeBufferBoxBased.getBox().toString() + "\n";
+ }
+}
diff --git a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/TlvOrganizationSpecificUnit.java b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/TlvOrganizationSpecificUnit.java
new file mode 100644
index 00000000000..f396141ab18
--- /dev/null
+++ b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/TlvOrganizationSpecificUnit.java
@@ -0,0 +1,150 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.plc4x.java.profinet.readwrite;
+
+import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*;
+import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*;
+import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*;
+import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*;
+import static org.apache.plc4x.java.spi.generation.StaticHelper.*;
+
+import java.time.*;
+import java.util.*;
+import org.apache.plc4x.java.api.exceptions.*;
+import org.apache.plc4x.java.api.value.*;
+import org.apache.plc4x.java.spi.codegen.*;
+import org.apache.plc4x.java.spi.codegen.fields.*;
+import org.apache.plc4x.java.spi.codegen.io.*;
+import org.apache.plc4x.java.spi.generation.*;
+
+// Code generated by code-generation. DO NOT EDIT.
+
+public abstract class TlvOrganizationSpecificUnit implements Message {
+
+ // Abstract accessors for discriminator values.
+ public abstract Long getUniqueCode();
+
+ public TlvOrganizationSpecificUnit() {
+ super();
+ }
+
+ protected abstract void serializeTlvOrganizationSpecificUnitChild(WriteBuffer writeBuffer)
+ throws SerializationException;
+
+ public void serialize(WriteBuffer writeBuffer) throws SerializationException {
+ PositionAware positionAware = writeBuffer;
+ int startPos = positionAware.getPos();
+ writeBuffer.pushContext("TlvOrganizationSpecificUnit");
+
+ // Discriminator Field (uniqueCode) (Used as input to a switch field)
+ writeDiscriminatorField("uniqueCode", getUniqueCode(), writeUnsignedLong(writeBuffer, 24));
+
+ // Switch field (Serialize the sub-type)
+ serializeTlvOrganizationSpecificUnitChild(writeBuffer);
+
+ writeBuffer.popContext("TlvOrganizationSpecificUnit");
+ }
+
+ @Override
+ public int getLengthInBytes() {
+ return (int) Math.ceil((float) getLengthInBits() / 8.0);
+ }
+
+ @Override
+ public int getLengthInBits() {
+ int lengthInBits = 0;
+ TlvOrganizationSpecificUnit _value = this;
+
+ // Discriminator Field (uniqueCode)
+ lengthInBits += 24;
+
+ // Length of sub-type elements will be added by sub-type...
+
+ return lengthInBits;
+ }
+
+ public static TlvOrganizationSpecificUnit staticParse(ReadBuffer readBuffer, Object... args)
+ throws ParseException {
+ PositionAware positionAware = readBuffer;
+ return staticParse(readBuffer);
+ }
+
+ public static TlvOrganizationSpecificUnit staticParse(ReadBuffer readBuffer)
+ throws ParseException {
+ readBuffer.pullContext("TlvOrganizationSpecificUnit");
+ PositionAware positionAware = readBuffer;
+ int startPos = positionAware.getPos();
+ int curPos;
+
+ long uniqueCode = readDiscriminatorField("uniqueCode", readUnsignedLong(readBuffer, 24));
+
+ // Switch Field (Depending on the discriminator values, passes the instantiation to a sub-type)
+ TlvOrganizationSpecificUnitBuilder builder = null;
+ if (EvaluationHelper.equals(uniqueCode, (long) 0x000ECF)) {
+ builder = TlvOrgSpecificProfibus.staticParseTlvOrganizationSpecificUnitBuilder(readBuffer);
+ } else if (EvaluationHelper.equals(uniqueCode, (long) 0x00120F)) {
+ builder = TlvOrgSpecificIeee8023.staticParseTlvOrganizationSpecificUnitBuilder(readBuffer);
+ }
+ if (builder == null) {
+ throw new ParseException(
+ "Unsupported case for discriminated type"
+ + " parameters ["
+ + "uniqueCode="
+ + uniqueCode
+ + "]");
+ }
+
+ readBuffer.closeContext("TlvOrganizationSpecificUnit");
+ // Create the instance
+ TlvOrganizationSpecificUnit _tlvOrganizationSpecificUnit = builder.build();
+ return _tlvOrganizationSpecificUnit;
+ }
+
+ public interface TlvOrganizationSpecificUnitBuilder {
+ TlvOrganizationSpecificUnit build();
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (!(o instanceof TlvOrganizationSpecificUnit)) {
+ return false;
+ }
+ TlvOrganizationSpecificUnit that = (TlvOrganizationSpecificUnit) o;
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash();
+ }
+
+ @Override
+ public String toString() {
+ WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true);
+ try {
+ writeBufferBoxBased.writeSerializable(this);
+ } catch (SerializationException e) {
+ throw new RuntimeException(e);
+ }
+ return "\n" + writeBufferBoxBased.getBox().toString() + "\n";
+ }
+}
diff --git a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/TlvPortId.java b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/TlvPortId.java
new file mode 100644
index 00000000000..6cb504968fb
--- /dev/null
+++ b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/TlvPortId.java
@@ -0,0 +1,159 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.plc4x.java.profinet.readwrite;
+
+import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*;
+import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*;
+import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*;
+import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*;
+import static org.apache.plc4x.java.spi.generation.StaticHelper.*;
+
+import java.time.*;
+import java.util.*;
+import org.apache.plc4x.java.api.exceptions.*;
+import org.apache.plc4x.java.api.value.*;
+import org.apache.plc4x.java.spi.codegen.*;
+import org.apache.plc4x.java.spi.codegen.fields.*;
+import org.apache.plc4x.java.spi.codegen.io.*;
+import org.apache.plc4x.java.spi.generation.*;
+
+// Code generated by code-generation. DO NOT EDIT.
+
+public class TlvPortId extends LldpUnit implements Message {
+
+ // Accessors for discriminator values.
+ public TlvType getTlvId() {
+ return TlvType.PORT_ID;
+ }
+
+ // Properties.
+ protected final short portIdSubType;
+ protected final String portId;
+
+ public TlvPortId(int tlvIdLength, short portIdSubType, String portId) {
+ super(tlvIdLength);
+ this.portIdSubType = portIdSubType;
+ this.portId = portId;
+ }
+
+ public short getPortIdSubType() {
+ return portIdSubType;
+ }
+
+ public String getPortId() {
+ return portId;
+ }
+
+ @Override
+ protected void serializeLldpUnitChild(WriteBuffer writeBuffer) throws SerializationException {
+ PositionAware positionAware = writeBuffer;
+ int startPos = positionAware.getPos();
+ writeBuffer.pushContext("TlvPortId");
+
+ // Simple Field (portIdSubType)
+ writeSimpleField("portIdSubType", portIdSubType, writeUnsignedShort(writeBuffer, 8));
+
+ // Simple Field (portId)
+ writeSimpleField("portId", portId, writeString(writeBuffer, (((tlvIdLength) - (1))) * (8)));
+
+ writeBuffer.popContext("TlvPortId");
+ }
+
+ @Override
+ public int getLengthInBytes() {
+ return (int) Math.ceil((float) getLengthInBits() / 8.0);
+ }
+
+ @Override
+ public int getLengthInBits() {
+ int lengthInBits = super.getLengthInBits();
+ TlvPortId _value = this;
+
+ // Simple field (portIdSubType)
+ lengthInBits += 8;
+
+ // Simple field (portId)
+ lengthInBits += (((tlvIdLength) - (1))) * (8);
+
+ return lengthInBits;
+ }
+
+ public static LldpUnitBuilder staticParseLldpUnitBuilder(
+ ReadBuffer readBuffer, Integer tlvIdLength) throws ParseException {
+ readBuffer.pullContext("TlvPortId");
+ PositionAware positionAware = readBuffer;
+ int startPos = positionAware.getPos();
+ int curPos;
+
+ short portIdSubType = readSimpleField("portIdSubType", readUnsignedShort(readBuffer, 8));
+
+ String portId =
+ readSimpleField("portId", readString(readBuffer, (((tlvIdLength) - (1))) * (8)));
+
+ readBuffer.closeContext("TlvPortId");
+ // Create the instance
+ return new TlvPortIdBuilderImpl(portIdSubType, portId);
+ }
+
+ public static class TlvPortIdBuilderImpl implements LldpUnit.LldpUnitBuilder {
+ private final short portIdSubType;
+ private final String portId;
+
+ public TlvPortIdBuilderImpl(short portIdSubType, String portId) {
+ this.portIdSubType = portIdSubType;
+ this.portId = portId;
+ }
+
+ public TlvPortId build(int tlvIdLength) {
+ TlvPortId tlvPortId = new TlvPortId(tlvIdLength, portIdSubType, portId);
+ return tlvPortId;
+ }
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (!(o instanceof TlvPortId)) {
+ return false;
+ }
+ TlvPortId that = (TlvPortId) o;
+ return (getPortIdSubType() == that.getPortIdSubType())
+ && (getPortId() == that.getPortId())
+ && super.equals(that)
+ && true;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(super.hashCode(), getPortIdSubType(), getPortId());
+ }
+
+ @Override
+ public String toString() {
+ WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true);
+ try {
+ writeBufferBoxBased.writeSerializable(this);
+ } catch (SerializationException e) {
+ throw new RuntimeException(e);
+ }
+ return "\n" + writeBufferBoxBased.getBox().toString() + "\n";
+ }
+}
diff --git a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/TlvProfibusSubType.java b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/TlvProfibusSubType.java
new file mode 100644
index 00000000000..6610c3a5ad5
--- /dev/null
+++ b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/TlvProfibusSubType.java
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.plc4x.java.profinet.readwrite;
+
+import java.util.HashMap;
+import java.util.Map;
+
+// Code generated by code-generation. DO NOT EDIT.
+
+public enum TlvProfibusSubType {
+ PORT_STATUS((short) 0x02),
+ CHASSIS_MAC((short) 0x05);
+ private static final Map map;
+
+ static {
+ map = new HashMap<>();
+ for (TlvProfibusSubType value : TlvProfibusSubType.values()) {
+ map.put((short) value.getValue(), value);
+ }
+ }
+
+ private short value;
+
+ TlvProfibusSubType(short value) {
+ this.value = value;
+ }
+
+ public short getValue() {
+ return value;
+ }
+
+ public static TlvProfibusSubType enumForValue(short value) {
+ return map.get(value);
+ }
+
+ public static Boolean isDefined(short value) {
+ return map.containsKey(value);
+ }
+}
diff --git a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/TlvProfibusSubTypeChassisMac.java b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/TlvProfibusSubTypeChassisMac.java
new file mode 100644
index 00000000000..f04d0b0e653
--- /dev/null
+++ b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/TlvProfibusSubTypeChassisMac.java
@@ -0,0 +1,145 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.plc4x.java.profinet.readwrite;
+
+import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*;
+import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*;
+import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*;
+import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*;
+import static org.apache.plc4x.java.spi.generation.StaticHelper.*;
+
+import java.time.*;
+import java.util.*;
+import org.apache.plc4x.java.api.exceptions.*;
+import org.apache.plc4x.java.api.value.*;
+import org.apache.plc4x.java.spi.codegen.*;
+import org.apache.plc4x.java.spi.codegen.fields.*;
+import org.apache.plc4x.java.spi.codegen.io.*;
+import org.apache.plc4x.java.spi.generation.*;
+
+// Code generated by code-generation. DO NOT EDIT.
+
+public class TlvProfibusSubTypeChassisMac extends TlvOrgSpecificProfibusUnit implements Message {
+
+ // Accessors for discriminator values.
+ public TlvProfibusSubType getSubType() {
+ return TlvProfibusSubType.CHASSIS_MAC;
+ }
+
+ // Properties.
+ protected final MacAddress macAddress;
+
+ public TlvProfibusSubTypeChassisMac(MacAddress macAddress) {
+ super();
+ this.macAddress = macAddress;
+ }
+
+ public MacAddress getMacAddress() {
+ return macAddress;
+ }
+
+ @Override
+ protected void serializeTlvOrgSpecificProfibusUnitChild(WriteBuffer writeBuffer)
+ throws SerializationException {
+ PositionAware positionAware = writeBuffer;
+ int startPos = positionAware.getPos();
+ writeBuffer.pushContext("TlvProfibusSubTypeChassisMac");
+
+ // Simple Field (macAddress)
+ writeSimpleField("macAddress", macAddress, new DataWriterComplexDefault<>(writeBuffer));
+
+ writeBuffer.popContext("TlvProfibusSubTypeChassisMac");
+ }
+
+ @Override
+ public int getLengthInBytes() {
+ return (int) Math.ceil((float) getLengthInBits() / 8.0);
+ }
+
+ @Override
+ public int getLengthInBits() {
+ int lengthInBits = super.getLengthInBits();
+ TlvProfibusSubTypeChassisMac _value = this;
+
+ // Simple field (macAddress)
+ lengthInBits += macAddress.getLengthInBits();
+
+ return lengthInBits;
+ }
+
+ public static TlvOrgSpecificProfibusUnitBuilder staticParseTlvOrgSpecificProfibusUnitBuilder(
+ ReadBuffer readBuffer) throws ParseException {
+ readBuffer.pullContext("TlvProfibusSubTypeChassisMac");
+ PositionAware positionAware = readBuffer;
+ int startPos = positionAware.getPos();
+ int curPos;
+
+ MacAddress macAddress =
+ readSimpleField(
+ "macAddress",
+ new DataReaderComplexDefault<>(() -> MacAddress.staticParse(readBuffer), readBuffer));
+
+ readBuffer.closeContext("TlvProfibusSubTypeChassisMac");
+ // Create the instance
+ return new TlvProfibusSubTypeChassisMacBuilderImpl(macAddress);
+ }
+
+ public static class TlvProfibusSubTypeChassisMacBuilderImpl
+ implements TlvOrgSpecificProfibusUnit.TlvOrgSpecificProfibusUnitBuilder {
+ private final MacAddress macAddress;
+
+ public TlvProfibusSubTypeChassisMacBuilderImpl(MacAddress macAddress) {
+ this.macAddress = macAddress;
+ }
+
+ public TlvProfibusSubTypeChassisMac build() {
+ TlvProfibusSubTypeChassisMac tlvProfibusSubTypeChassisMac =
+ new TlvProfibusSubTypeChassisMac(macAddress);
+ return tlvProfibusSubTypeChassisMac;
+ }
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (!(o instanceof TlvProfibusSubTypeChassisMac)) {
+ return false;
+ }
+ TlvProfibusSubTypeChassisMac that = (TlvProfibusSubTypeChassisMac) o;
+ return (getMacAddress() == that.getMacAddress()) && super.equals(that) && true;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(super.hashCode(), getMacAddress());
+ }
+
+ @Override
+ public String toString() {
+ WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true);
+ try {
+ writeBufferBoxBased.writeSerializable(this);
+ } catch (SerializationException e) {
+ throw new RuntimeException(e);
+ }
+ return "\n" + writeBufferBoxBased.getBox().toString() + "\n";
+ }
+}
diff --git a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/TlvProfibusSubTypePortStatus.java b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/TlvProfibusSubTypePortStatus.java
new file mode 100644
index 00000000000..3c926fac963
--- /dev/null
+++ b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/TlvProfibusSubTypePortStatus.java
@@ -0,0 +1,249 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.plc4x.java.profinet.readwrite;
+
+import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*;
+import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*;
+import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*;
+import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*;
+import static org.apache.plc4x.java.spi.generation.StaticHelper.*;
+
+import java.time.*;
+import java.util.*;
+import org.apache.plc4x.java.api.exceptions.*;
+import org.apache.plc4x.java.api.value.*;
+import org.apache.plc4x.java.spi.codegen.*;
+import org.apache.plc4x.java.spi.codegen.fields.*;
+import org.apache.plc4x.java.spi.codegen.io.*;
+import org.apache.plc4x.java.spi.generation.*;
+
+// Code generated by code-generation. DO NOT EDIT.
+
+public class TlvProfibusSubTypePortStatus extends TlvOrgSpecificProfibusUnit implements Message {
+
+ // Accessors for discriminator values.
+ public TlvProfibusSubType getSubType() {
+ return TlvProfibusSubType.PORT_STATUS;
+ }
+
+ // Properties.
+ protected final int rtClass2PortStatus;
+ protected final boolean preample;
+ protected final boolean fragmentation;
+ protected final byte rtClass3PortStatus;
+
+ // Reserved Fields
+ private Byte reservedField0;
+ private Integer reservedField1;
+
+ public TlvProfibusSubTypePortStatus(
+ int rtClass2PortStatus, boolean preample, boolean fragmentation, byte rtClass3PortStatus) {
+ super();
+ this.rtClass2PortStatus = rtClass2PortStatus;
+ this.preample = preample;
+ this.fragmentation = fragmentation;
+ this.rtClass3PortStatus = rtClass3PortStatus;
+ }
+
+ public int getRtClass2PortStatus() {
+ return rtClass2PortStatus;
+ }
+
+ public boolean getPreample() {
+ return preample;
+ }
+
+ public boolean getFragmentation() {
+ return fragmentation;
+ }
+
+ public byte getRtClass3PortStatus() {
+ return rtClass3PortStatus;
+ }
+
+ @Override
+ protected void serializeTlvOrgSpecificProfibusUnitChild(WriteBuffer writeBuffer)
+ throws SerializationException {
+ PositionAware positionAware = writeBuffer;
+ int startPos = positionAware.getPos();
+ writeBuffer.pushContext("TlvProfibusSubTypePortStatus");
+
+ // Simple Field (rtClass2PortStatus)
+ writeSimpleField("rtClass2PortStatus", rtClass2PortStatus, writeUnsignedInt(writeBuffer, 16));
+
+ // Reserved Field (reserved)
+ writeReservedField(
+ "reserved",
+ reservedField0 != null ? reservedField0 : (byte) 0x00,
+ writeUnsignedByte(writeBuffer, 2));
+
+ // Simple Field (preample)
+ writeSimpleField("preample", preample, writeBoolean(writeBuffer));
+
+ // Simple Field (fragmentation)
+ writeSimpleField("fragmentation", fragmentation, writeBoolean(writeBuffer));
+
+ // Reserved Field (reserved)
+ writeReservedField(
+ "reserved",
+ reservedField1 != null ? reservedField1 : (int) 0x00,
+ writeUnsignedInt(writeBuffer, 9));
+
+ // Simple Field (rtClass3PortStatus)
+ writeSimpleField("rtClass3PortStatus", rtClass3PortStatus, writeUnsignedByte(writeBuffer, 3));
+
+ writeBuffer.popContext("TlvProfibusSubTypePortStatus");
+ }
+
+ @Override
+ public int getLengthInBytes() {
+ return (int) Math.ceil((float) getLengthInBits() / 8.0);
+ }
+
+ @Override
+ public int getLengthInBits() {
+ int lengthInBits = super.getLengthInBits();
+ TlvProfibusSubTypePortStatus _value = this;
+
+ // Simple field (rtClass2PortStatus)
+ lengthInBits += 16;
+
+ // Reserved Field (reserved)
+ lengthInBits += 2;
+
+ // Simple field (preample)
+ lengthInBits += 1;
+
+ // Simple field (fragmentation)
+ lengthInBits += 1;
+
+ // Reserved Field (reserved)
+ lengthInBits += 9;
+
+ // Simple field (rtClass3PortStatus)
+ lengthInBits += 3;
+
+ return lengthInBits;
+ }
+
+ public static TlvOrgSpecificProfibusUnitBuilder staticParseTlvOrgSpecificProfibusUnitBuilder(
+ ReadBuffer readBuffer) throws ParseException {
+ readBuffer.pullContext("TlvProfibusSubTypePortStatus");
+ PositionAware positionAware = readBuffer;
+ int startPos = positionAware.getPos();
+ int curPos;
+
+ int rtClass2PortStatus = readSimpleField("rtClass2PortStatus", readUnsignedInt(readBuffer, 16));
+
+ Byte reservedField0 =
+ readReservedField("reserved", readUnsignedByte(readBuffer, 2), (byte) 0x00);
+
+ boolean preample = readSimpleField("preample", readBoolean(readBuffer));
+
+ boolean fragmentation = readSimpleField("fragmentation", readBoolean(readBuffer));
+
+ Integer reservedField1 =
+ readReservedField("reserved", readUnsignedInt(readBuffer, 9), (int) 0x00);
+
+ byte rtClass3PortStatus =
+ readSimpleField("rtClass3PortStatus", readUnsignedByte(readBuffer, 3));
+
+ readBuffer.closeContext("TlvProfibusSubTypePortStatus");
+ // Create the instance
+ return new TlvProfibusSubTypePortStatusBuilderImpl(
+ rtClass2PortStatus,
+ preample,
+ fragmentation,
+ rtClass3PortStatus,
+ reservedField0,
+ reservedField1);
+ }
+
+ public static class TlvProfibusSubTypePortStatusBuilderImpl
+ implements TlvOrgSpecificProfibusUnit.TlvOrgSpecificProfibusUnitBuilder {
+ private final int rtClass2PortStatus;
+ private final boolean preample;
+ private final boolean fragmentation;
+ private final byte rtClass3PortStatus;
+ private final Byte reservedField0;
+ private final Integer reservedField1;
+
+ public TlvProfibusSubTypePortStatusBuilderImpl(
+ int rtClass2PortStatus,
+ boolean preample,
+ boolean fragmentation,
+ byte rtClass3PortStatus,
+ Byte reservedField0,
+ Integer reservedField1) {
+ this.rtClass2PortStatus = rtClass2PortStatus;
+ this.preample = preample;
+ this.fragmentation = fragmentation;
+ this.rtClass3PortStatus = rtClass3PortStatus;
+ this.reservedField0 = reservedField0;
+ this.reservedField1 = reservedField1;
+ }
+
+ public TlvProfibusSubTypePortStatus build() {
+ TlvProfibusSubTypePortStatus tlvProfibusSubTypePortStatus =
+ new TlvProfibusSubTypePortStatus(
+ rtClass2PortStatus, preample, fragmentation, rtClass3PortStatus);
+ tlvProfibusSubTypePortStatus.reservedField0 = reservedField0;
+ tlvProfibusSubTypePortStatus.reservedField1 = reservedField1;
+ return tlvProfibusSubTypePortStatus;
+ }
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (!(o instanceof TlvProfibusSubTypePortStatus)) {
+ return false;
+ }
+ TlvProfibusSubTypePortStatus that = (TlvProfibusSubTypePortStatus) o;
+ return (getRtClass2PortStatus() == that.getRtClass2PortStatus())
+ && (getPreample() == that.getPreample())
+ && (getFragmentation() == that.getFragmentation())
+ && (getRtClass3PortStatus() == that.getRtClass3PortStatus())
+ && super.equals(that)
+ && true;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(
+ super.hashCode(),
+ getRtClass2PortStatus(),
+ getPreample(),
+ getFragmentation(),
+ getRtClass3PortStatus());
+ }
+
+ @Override
+ public String toString() {
+ WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true);
+ try {
+ writeBufferBoxBased.writeSerializable(this);
+ } catch (SerializationException e) {
+ throw new RuntimeException(e);
+ }
+ return "\n" + writeBufferBoxBased.getBox().toString() + "\n";
+ }
+}
diff --git a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/TlvTimeToLive.java b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/TlvTimeToLive.java
new file mode 100644
index 00000000000..c99b3e758fa
--- /dev/null
+++ b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/TlvTimeToLive.java
@@ -0,0 +1,139 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.plc4x.java.profinet.readwrite;
+
+import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*;
+import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*;
+import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*;
+import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*;
+import static org.apache.plc4x.java.spi.generation.StaticHelper.*;
+
+import java.time.*;
+import java.util.*;
+import org.apache.plc4x.java.api.exceptions.*;
+import org.apache.plc4x.java.api.value.*;
+import org.apache.plc4x.java.spi.codegen.*;
+import org.apache.plc4x.java.spi.codegen.fields.*;
+import org.apache.plc4x.java.spi.codegen.io.*;
+import org.apache.plc4x.java.spi.generation.*;
+
+// Code generated by code-generation. DO NOT EDIT.
+
+public class TlvTimeToLive extends LldpUnit implements Message {
+
+ // Accessors for discriminator values.
+ public TlvType getTlvId() {
+ return TlvType.TIME_TO_LIVE;
+ }
+
+ // Properties.
+ protected final int tlvTimeToLiveUnit;
+
+ public TlvTimeToLive(int tlvIdLength, int tlvTimeToLiveUnit) {
+ super(tlvIdLength);
+ this.tlvTimeToLiveUnit = tlvTimeToLiveUnit;
+ }
+
+ public int getTlvTimeToLiveUnit() {
+ return tlvTimeToLiveUnit;
+ }
+
+ @Override
+ protected void serializeLldpUnitChild(WriteBuffer writeBuffer) throws SerializationException {
+ PositionAware positionAware = writeBuffer;
+ int startPos = positionAware.getPos();
+ writeBuffer.pushContext("TlvTimeToLive");
+
+ // Simple Field (tlvTimeToLiveUnit)
+ writeSimpleField("tlvTimeToLiveUnit", tlvTimeToLiveUnit, writeUnsignedInt(writeBuffer, 16));
+
+ writeBuffer.popContext("TlvTimeToLive");
+ }
+
+ @Override
+ public int getLengthInBytes() {
+ return (int) Math.ceil((float) getLengthInBits() / 8.0);
+ }
+
+ @Override
+ public int getLengthInBits() {
+ int lengthInBits = super.getLengthInBits();
+ TlvTimeToLive _value = this;
+
+ // Simple field (tlvTimeToLiveUnit)
+ lengthInBits += 16;
+
+ return lengthInBits;
+ }
+
+ public static LldpUnitBuilder staticParseLldpUnitBuilder(ReadBuffer readBuffer)
+ throws ParseException {
+ readBuffer.pullContext("TlvTimeToLive");
+ PositionAware positionAware = readBuffer;
+ int startPos = positionAware.getPos();
+ int curPos;
+
+ int tlvTimeToLiveUnit = readSimpleField("tlvTimeToLiveUnit", readUnsignedInt(readBuffer, 16));
+
+ readBuffer.closeContext("TlvTimeToLive");
+ // Create the instance
+ return new TlvTimeToLiveBuilderImpl(tlvTimeToLiveUnit);
+ }
+
+ public static class TlvTimeToLiveBuilderImpl implements LldpUnit.LldpUnitBuilder {
+ private final int tlvTimeToLiveUnit;
+
+ public TlvTimeToLiveBuilderImpl(int tlvTimeToLiveUnit) {
+ this.tlvTimeToLiveUnit = tlvTimeToLiveUnit;
+ }
+
+ public TlvTimeToLive build(int tlvIdLength) {
+ TlvTimeToLive tlvTimeToLive = new TlvTimeToLive(tlvIdLength, tlvTimeToLiveUnit);
+ return tlvTimeToLive;
+ }
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (!(o instanceof TlvTimeToLive)) {
+ return false;
+ }
+ TlvTimeToLive that = (TlvTimeToLive) o;
+ return (getTlvTimeToLiveUnit() == that.getTlvTimeToLiveUnit()) && super.equals(that) && true;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(super.hashCode(), getTlvTimeToLiveUnit());
+ }
+
+ @Override
+ public String toString() {
+ WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true);
+ try {
+ writeBufferBoxBased.writeSerializable(this);
+ } catch (SerializationException e) {
+ throw new RuntimeException(e);
+ }
+ return "\n" + writeBufferBoxBased.getBox().toString() + "\n";
+ }
+}
diff --git a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/TlvType.java b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/TlvType.java
new file mode 100644
index 00000000000..96c94d79dc4
--- /dev/null
+++ b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/TlvType.java
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.plc4x.java.profinet.readwrite;
+
+import java.util.HashMap;
+import java.util.Map;
+
+// Code generated by code-generation. DO NOT EDIT.
+
+public enum TlvType {
+ END_OF_LLDP((short) 0x00),
+ CHASSIS_ID((short) 0x01),
+ PORT_ID((short) 0x02),
+ TIME_TO_LIVE((short) 0x03),
+ PORT_DESCRIPTION((short) 0x04),
+ SYSTEM_NAME((short) 0x05),
+ SYSTEM_DESCRIPTION((short) 0x06),
+ SYSTEM_CAPABILITIES((short) 0x07),
+ MANAGEMENT_ADDRESS((short) 0x08),
+ ORGANIZATION_SPECIFIC((short) 0x7F);
+ private static final Map map;
+
+ static {
+ map = new HashMap<>();
+ for (TlvType value : TlvType.values()) {
+ map.put((short) value.getValue(), value);
+ }
+ }
+
+ private short value;
+
+ TlvType(short value) {
+ this.value = value;
+ }
+
+ public short getValue() {
+ return value;
+ }
+
+ public static TlvType enumForValue(short value) {
+ return map.get(value);
+ }
+
+ public static Boolean isDefined(short value) {
+ return map.containsKey(value);
+ }
+}
diff --git a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/UserData.java b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/UserData.java
new file mode 100644
index 00000000000..f473813127a
--- /dev/null
+++ b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/UserData.java
@@ -0,0 +1,147 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.plc4x.java.profinet.readwrite;
+
+import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*;
+import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*;
+import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*;
+import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*;
+import static org.apache.plc4x.java.spi.generation.StaticHelper.*;
+
+import java.time.*;
+import java.util.*;
+import org.apache.plc4x.java.api.exceptions.*;
+import org.apache.plc4x.java.api.value.*;
+import org.apache.plc4x.java.spi.codegen.*;
+import org.apache.plc4x.java.spi.codegen.fields.*;
+import org.apache.plc4x.java.spi.codegen.io.*;
+import org.apache.plc4x.java.spi.generation.*;
+
+// Code generated by code-generation. DO NOT EDIT.
+
+public class UserData implements Message {
+
+ // Properties.
+ protected final byte[] data;
+
+ // Arguments.
+ protected final Long recordDataLength;
+
+ public UserData(byte[] data, Long recordDataLength) {
+ super();
+ this.data = data;
+ this.recordDataLength = recordDataLength;
+ }
+
+ public byte[] getData() {
+ return data;
+ }
+
+ public void serialize(WriteBuffer writeBuffer) throws SerializationException {
+ PositionAware positionAware = writeBuffer;
+ int startPos = positionAware.getPos();
+ writeBuffer.pushContext("UserData");
+
+ // Array Field (data)
+ writeByteArrayField("data", data, writeByteArray(writeBuffer, 8));
+
+ writeBuffer.popContext("UserData");
+ }
+
+ @Override
+ public int getLengthInBytes() {
+ return (int) Math.ceil((float) getLengthInBits() / 8.0);
+ }
+
+ @Override
+ public int getLengthInBits() {
+ int lengthInBits = 0;
+ UserData _value = this;
+
+ // Array field
+ if (data != null) {
+ lengthInBits += 8 * data.length;
+ }
+
+ return lengthInBits;
+ }
+
+ public static UserData staticParse(ReadBuffer readBuffer, Object... args) throws ParseException {
+ PositionAware positionAware = readBuffer;
+ if ((args == null) || (args.length != 1)) {
+ throw new PlcRuntimeException(
+ "Wrong number of arguments, expected 1, but got " + args.length);
+ }
+ Long recordDataLength;
+ if (args[0] instanceof Long) {
+ recordDataLength = (Long) args[0];
+ } else if (args[0] instanceof String) {
+ recordDataLength = Long.valueOf((String) args[0]);
+ } else {
+ throw new PlcRuntimeException(
+ "Argument 0 expected to be of type Long or a string which is parseable but was "
+ + args[0].getClass().getName());
+ }
+ return staticParse(readBuffer, recordDataLength);
+ }
+
+ public static UserData staticParse(ReadBuffer readBuffer, Long recordDataLength)
+ throws ParseException {
+ readBuffer.pullContext("UserData");
+ PositionAware positionAware = readBuffer;
+ int startPos = positionAware.getPos();
+ int curPos;
+
+ byte[] data = readBuffer.readByteArray("data", Math.toIntExact(recordDataLength));
+
+ readBuffer.closeContext("UserData");
+ // Create the instance
+ UserData _userData;
+ _userData = new UserData(data, recordDataLength);
+ return _userData;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (!(o instanceof UserData)) {
+ return false;
+ }
+ UserData that = (UserData) o;
+ return (getData() == that.getData()) && true;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(getData());
+ }
+
+ @Override
+ public String toString() {
+ WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true);
+ try {
+ writeBufferBoxBased.writeSerializable(this);
+ } catch (SerializationException e) {
+ throw new RuntimeException(e);
+ }
+ return "\n" + writeBufferBoxBased.getBox().toString() + "\n";
+ }
+}
diff --git a/plc4j/drivers/profinet/src/main/java/org/apache/plc4x/java/profinet/ProfinetDriver.java b/plc4j/drivers/profinet/src/main/java/org/apache/plc4x/java/profinet/ProfinetDriver.java
index f1ef4355f07..b772f8f917b 100644
--- a/plc4j/drivers/profinet/src/main/java/org/apache/plc4x/java/profinet/ProfinetDriver.java
+++ b/plc4j/drivers/profinet/src/main/java/org/apache/plc4x/java/profinet/ProfinetDriver.java
@@ -23,20 +23,25 @@
import org.apache.plc4x.java.api.metadata.PlcDriverMetadata;
import org.apache.plc4x.java.profinet.config.ProfinetConfiguration;
import org.apache.plc4x.java.profinet.context.ProfinetDriverContext;
+import org.apache.plc4x.java.profinet.device.ProfinetChannel;
+import org.apache.plc4x.java.profinet.device.ProfinetDevices;
import org.apache.plc4x.java.profinet.discovery.ProfinetPlcDiscoverer;
-import org.apache.plc4x.java.profinet.tag.ProfinetTag;
-import org.apache.plc4x.java.profinet.tag.ProfinetTagHandler;
import org.apache.plc4x.java.profinet.protocol.ProfinetProtocolLogic;
import org.apache.plc4x.java.profinet.readwrite.Ethernet_Frame;
+import org.apache.plc4x.java.profinet.tag.ProfinetTag;
+import org.apache.plc4x.java.profinet.tag.ProfinetTagHandler;
+import org.apache.plc4x.java.spi.configuration.Configuration;
import org.apache.plc4x.java.spi.connection.GeneratedDriverBase;
import org.apache.plc4x.java.spi.connection.ProtocolStackConfigurer;
import org.apache.plc4x.java.spi.messages.DefaultPlcDiscoveryRequest;
-import org.apache.plc4x.java.spi.values.PlcValueHandler;
-import org.apache.plc4x.java.spi.configuration.Configuration;
+import org.apache.plc4x.java.spi.optimizer.SingleTagOptimizer;
import org.apache.plc4x.java.spi.connection.SingleProtocolStackConfigurer;
import org.apache.plc4x.java.spi.optimizer.BaseOptimizer;
-import org.apache.plc4x.java.spi.optimizer.SingleTagOptimizer;
+import org.pcap4j.core.*;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import java.util.HashMap;
import java.util.function.ToIntFunction;
public class ProfinetDriver extends GeneratedDriverBase {
@@ -65,7 +70,14 @@ public boolean canDiscover() {
@Override
public PlcDiscoveryRequest.Builder discoveryRequestBuilder() {
- return new DefaultPlcDiscoveryRequest.Builder(new ProfinetPlcDiscoverer());
+ try {
+ ProfinetChannel channel = new ProfinetChannel(Pcaps.findAllDevs(), new ProfinetDevices(new HashMap<>()));
+ ProfinetPlcDiscoverer discoverer = new ProfinetPlcDiscoverer(channel);
+ channel.setDiscoverer(discoverer);
+ return new DefaultPlcDiscoveryRequest.Builder(discoverer);
+ } catch (PcapNativeException e) {
+ throw new RuntimeException(e);
+ }
}
@Override
@@ -78,17 +90,14 @@ protected String getDefaultTransport() {
return "raw";
}
- /**
- * Modbus doesn't have a login procedure, so there is no need to wait for a login to finish.
- * @return false
- */
@Override
protected boolean awaitSetupComplete() {
- return false;
+ return true;
}
/**
* This protocol doesn't have a disconnect procedure, so there is no need to wait for a login to finish.
+ *
* @return false
*/
@Override
@@ -98,11 +107,21 @@ protected boolean awaitDisconnectComplete() {
@Override
protected boolean canRead() {
- return true;
+ return false;
}
@Override
protected boolean canWrite() {
+ return false;
+ }
+
+ @Override
+ protected boolean canSubscribe() {
+ return true;
+ }
+
+ @Override
+ protected boolean canBrowse() {
return true;
}
@@ -117,8 +136,8 @@ protected ProfinetTagHandler getTagHandler() {
}
@Override
- protected org.apache.plc4x.java.api.value.PlcValueHandler getValueHandler() {
- return new PlcValueHandler();
+ protected org.apache.plc4x.java.api.value.PlcValueHandler getValueHandler() {
+ return new org.apache.plc4x.java.spi.values.PlcValueHandler();
}
@Override
@@ -131,7 +150,9 @@ protected ProtocolStackConfigurer getStackConfigurer() {
.build();
}
- /** Estimate the Length of a Packet */
+ /**
+ * Estimate the Length of a Packet
+ */
public static class ByteLengthEstimator implements ToIntFunction {
@Override
public int applyAsInt(ByteBuf byteBuf) {
@@ -140,11 +161,12 @@ public int applyAsInt(ByteBuf byteBuf) {
}
return -1;
}
+
}
@Override
- public ProfinetTag prepareTag(String tagAddress){
- return ProfinetTag.of(tagAddress);
+ public ProfinetTag prepareTag(String query) {
+ return ProfinetTag.of(query);
}
}
diff --git a/plc4j/drivers/profinet/src/main/java/org/apache/plc4x/java/profinet/protocol/ProfinetDiscoveryLogic.java b/plc4j/drivers/profinet/src/main/java/org/apache/plc4x/java/profinet/browse/ProfinetPlcQuery.java
similarity index 69%
rename from plc4j/drivers/profinet/src/main/java/org/apache/plc4x/java/profinet/protocol/ProfinetDiscoveryLogic.java
rename to plc4j/drivers/profinet/src/main/java/org/apache/plc4x/java/profinet/browse/ProfinetPlcQuery.java
index 7d3e790060c..4c53cfcaca4 100644
--- a/plc4j/drivers/profinet/src/main/java/org/apache/plc4x/java/profinet/protocol/ProfinetDiscoveryLogic.java
+++ b/plc4j/drivers/profinet/src/main/java/org/apache/plc4x/java/profinet/browse/ProfinetPlcQuery.java
@@ -16,17 +16,20 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.plc4x.java.profinet.protocol;
+package org.apache.plc4x.java.profinet.browse;
-import org.apache.plc4x.java.profinet.readwrite.Ethernet_Frame;
-import org.apache.plc4x.java.spi.ConversationContext;
-import org.apache.plc4x.java.spi.Plc4xProtocolBase;
+import org.apache.plc4x.java.api.model.PlcQuery;
-public class ProfinetDiscoveryLogic extends Plc4xProtocolBase {
+public class ProfinetPlcQuery implements PlcQuery {
- @Override
- public void close(ConversationContext context) {
+ private final String queryString;
+ public ProfinetPlcQuery(String queryString) {
+ this.queryString = queryString;
+ }
+ @Override
+ public String getQueryString() {
+ return queryString;
}
}
diff --git a/plc4j/drivers/profinet/src/main/java/org/apache/plc4x/java/profinet/config/ProfinetConfiguration.java b/plc4j/drivers/profinet/src/main/java/org/apache/plc4x/java/profinet/config/ProfinetConfiguration.java
index ee3c0c1c378..fd43fa100c1 100644
--- a/plc4j/drivers/profinet/src/main/java/org/apache/plc4x/java/profinet/config/ProfinetConfiguration.java
+++ b/plc4j/drivers/profinet/src/main/java/org/apache/plc4x/java/profinet/config/ProfinetConfiguration.java
@@ -18,10 +18,33 @@
*/
package org.apache.plc4x.java.profinet.config;
+import com.fasterxml.jackson.dataformat.xml.XmlMapper;
+import org.apache.plc4x.java.api.exceptions.PlcConnectionException;
+import org.apache.plc4x.java.profinet.context.ProfinetDriverContext;
+import org.apache.plc4x.java.profinet.device.GsdFileMap;
+import org.apache.plc4x.java.profinet.device.ProfinetDevice;
+import org.apache.plc4x.java.profinet.device.ProfinetDevices;
+import org.apache.plc4x.java.profinet.gsdml.ProfinetISO15745Profile;
import org.apache.plc4x.java.spi.configuration.Configuration;
+import org.apache.plc4x.java.spi.configuration.ConfigurationParameterConverter;
+import org.apache.plc4x.java.spi.configuration.annotations.ConfigurationParameter;
+import org.apache.plc4x.java.spi.configuration.annotations.ParameterConverter;
+import org.apache.plc4x.java.spi.configuration.annotations.Required;
+import org.apache.plc4x.java.spi.configuration.annotations.defaults.IntDefaultValue;
+import org.apache.plc4x.java.spi.configuration.annotations.defaults.StringDefaultValue;
import org.apache.plc4x.java.transport.rawsocket.RawSocketTransportConfiguration;
import org.apache.plc4x.java.utils.pcap.netty.handlers.PacketHandler;
+import java.io.IOException;
+import java.nio.file.DirectoryStream;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
public class ProfinetConfiguration implements Configuration, RawSocketTransportConfiguration {
@Override
@@ -44,6 +67,129 @@ public PacketHandler getPcapPacketHandler() {
return null;
}
+ @Required
+ @ConfigurationParameter
+ @ParameterConverter(ProfinetDeviceConvertor.class)
+ protected ProfinetDevices devices;
+
+ @Required
+ @ConfigurationParameter("gsddirectory")
+ @ParameterConverter(ProfinetGsdFileConvertor.class)
+ static protected GsdFileMap gsdFiles;
+
+ @ConfigurationParameter("sendclockfactor")
+ @IntDefaultValue(32)
+ private int sendClockFactor;
+
+ @ConfigurationParameter("reductionratio")
+ @IntDefaultValue(4)
+ private int reductionRatio;
+
+ @ConfigurationParameter("watchdogfactor")
+ @IntDefaultValue(50)
+ private int watchdogFactor;
+
+ @ConfigurationParameter("dataholdfactor")
+ @IntDefaultValue(50)
+ private int dataHoldFactor;
+
+ public static class ProfinetDeviceConvertor implements ConfigurationParameterConverter {
+
+ public static final Pattern DEVICE_NAME_ARRAY_PATTERN = Pattern.compile("^\\[(?:(\\[(?:[\\w-]*){1},(?:[\\w]*){1},\\((?:[\\w]*[, ]?)*\\){1}\\])[, ]?)+\\]");
+ public static final Pattern DEVICE_PARAMETERS = Pattern.compile("^(?[\\w-]*){1}[, ]+(?[\\w]*){1}[, ]+\\((?[\\w, ]*)\\)");
+
+ @Override
+ public Class getType() {
+ return ProfinetDevices.class;
+ }
+
+ @Override
+ public ProfinetDevices convert(String value) {
+
+ // Split up the connection string into its individual segments.
+ value = value.replaceAll(" ", "").toUpperCase();
+ Matcher matcher = DEVICE_NAME_ARRAY_PATTERN.matcher(value);
+
+ if (!matcher.matches()) {
+ throw new RuntimeException("Profinet Device Array is not in the correct format " + value + ".");
+ }
+
+ Map devices = new HashMap<>();
+ String[] deviceParameters = value.substring(1, value.length() - 1).replaceAll(" ", "").split("[\\[\\]]");
+ for (String deviceParameter : deviceParameters) {
+ if (deviceParameter.length() > 7) {
+ matcher = DEVICE_PARAMETERS.matcher(deviceParameter);
+ if (matcher.matches()) {
+ devices.put(matcher.group("devicename"),
+ new ProfinetDevice(matcher.group("devicename"),
+ matcher.group("deviceaccess"),
+ matcher.group("submodules"),
+ (vendorId, deviceId) -> gsdFiles.getGsdFiles().get("0x" + vendorId + "-0x" + deviceId)
+ )
+ );
+ }
+ }
+ }
+
+ return new ProfinetDevices(devices);
+ }
+ }
+
+ public static class ProfinetGsdFileConvertor implements ConfigurationParameterConverter {
+
+ @Override
+ public Class getType() {
+ return GsdFileMap.class;
+ }
+
+ @Override
+ public GsdFileMap convert(String value) {
+ HashMap gsdFiles = new HashMap<>();
+ try {
+ DirectoryStream stream = Files.newDirectoryStream(Paths.get(value));
+ XmlMapper xmlMapper = new XmlMapper();
+ for (Path file : stream) {
+ try {
+ ProfinetISO15745Profile gsdFile = xmlMapper.readValue(file.toFile(), ProfinetISO15745Profile.class);
+ if (gsdFile.getProfileHeader() != null && gsdFile.getProfileHeader().getProfileIdentification().equals("PROFINET Device Profile") && gsdFile.getProfileHeader().getProfileClassID().equals("Device")) {
+ String id = gsdFile.getProfileBody().getDeviceIdentity().getVendorId() + "-" + gsdFile.getProfileBody().getDeviceIdentity().getDeviceID();
+ gsdFiles.put(id, gsdFile);
+ }
+ } catch (IOException ignored) {
+ }
+ }
+ } catch (IOException e) {
+ throw new RuntimeException("GSDML File directory is un-readable");
+ }
+ return new GsdFileMap(gsdFiles);
+ }
+
+ }
+
+ public ProfinetDevices getDevices() {
+ return this.devices;
+ }
+
+ public int getSendClockFactor() {
+ return sendClockFactor;
+ }
+
+ public int getReductionRatio() {
+ return reductionRatio;
+ }
+
+ public int getWatchdogFactor() {
+ return watchdogFactor;
+ }
+
+ public int getDataHoldFactor() {
+ return dataHoldFactor;
+ }
+
+ public static GsdFileMap getGsdFiles() {
+ return gsdFiles;
+ }
+
@Override
public String toString() {
return "Configuration{" +
diff --git a/plc4j/drivers/profinet/src/main/java/org/apache/plc4x/java/profinet/context/ProfinetDeviceContext.java b/plc4j/drivers/profinet/src/main/java/org/apache/plc4x/java/profinet/context/ProfinetDeviceContext.java
new file mode 100644
index 00000000000..e0152ce053f
--- /dev/null
+++ b/plc4j/drivers/profinet/src/main/java/org/apache/plc4x/java/profinet/context/ProfinetDeviceContext.java
@@ -0,0 +1,529 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.plc4x.java.profinet.context;
+
+import org.apache.commons.codec.DecoderException;
+import org.apache.commons.codec.binary.Hex;
+import org.apache.plc4x.java.api.exceptions.PlcConnectionException;
+import org.apache.plc4x.java.profinet.config.ProfinetConfiguration;
+import org.apache.plc4x.java.profinet.device.*;
+import org.apache.plc4x.java.profinet.gsdml.*;
+import org.apache.plc4x.java.profinet.readwrite.*;
+import org.apache.plc4x.java.spi.ConversationContext;
+import org.apache.plc4x.java.spi.configuration.HasConfiguration;
+import org.apache.plc4x.java.spi.context.DriverContext;
+import org.apache.plc4x.java.spi.generation.*;
+
+import java.net.DatagramSocket;
+import java.net.InetAddress;
+import java.util.*;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+public class ProfinetDeviceContext implements DriverContext, HasConfiguration {
+
+ public static final int DEFAULT_UDP_PORT = 34964;
+ public static final int DEFAULT_ARGS_MAXIMUM = 16696;
+ public static final int DEFAULT_MAX_ARRAY_COUNT = 16696;
+ public static final int DEFAULT_ACTIVITY_TIMEOUT = 600;
+ public static final int UDP_RT_PORT = 0x8892;
+ public static final short BLOCK_VERSION_HIGH = 1;
+ public static final short BLOCK_VERSION_LOW = 0;
+ public static final MacAddress DEFAULT_EMPTY_MAC_ADDRESS;
+ public static final Pattern RANGE_PATTERN = Pattern.compile("(?\\d+)\\.\\.(?\\d+)");
+
+ static {
+ try {
+ DEFAULT_EMPTY_MAC_ADDRESS = new MacAddress(Hex.decodeHex("000000000000"));
+ } catch (DecoderException e) {
+ throw new RuntimeException(e);
+ }
+ }
+ public static final Uuid ARUUID;
+ static {
+ try {
+ ARUUID = new Uuid(Hex.decodeHex(UUID.randomUUID().toString().replace("-", "")));
+ } catch (DecoderException e) {
+ throw new RuntimeException(e);
+ }
+ }
+ public static final int DEFAULT_SEND_UDP_PORT = 50000;
+ public static final String DEFAULT_PLC4X_STATION_NAME = "plc4x";
+ public static final int DEFAULT_IO_DATA_SIZE = 40;
+
+ private MacAddress localMacAddress;
+ private final DceRpc_ActivityUuid uuid;
+ private ProfinetConfiguration configuration;
+ private InetAddress localIpAddress;
+ private DatagramSocket socket;
+ private ProfinetChannel channel;
+ private MacAddress macAddress;
+ private ConversationContext context;
+ private ProfinetDeviceState state = ProfinetDeviceState.IDLE;
+ private boolean lldpReceived = false;
+ private boolean dcpReceived = false;
+ private String ipAddress;
+ private String portId;
+ private PnIoCm_Block_IoCrReq inputReq = null;
+ private PnIoCm_Block_IoCrReq outputReq = null;
+ private String[] subModules;
+ private AtomicInteger sessionKeyGenerator = new AtomicInteger(1);
+ private AtomicInteger identificationGenerator = new AtomicInteger(1);
+ private String deviceTypeName;
+ private String deviceName;
+ private ProfinetISO15745Profile gsdFile;
+ private boolean nonLegacyStartupMode = false;
+ private int frameId = 0xBBF0;
+ private Map> queue = new HashMap<>();
+ private int sessionKey;
+ private int sourcePort = DEFAULT_SEND_UDP_PORT;
+ private int destinationPort = DEFAULT_UDP_PORT;
+ private Map subscriptionHandles = new HashMap<>();
+ private String deviceAccess;
+ private ProfinetDeviceAccessPointItem deviceAccessItem;
+ private ProfinetModule[] modules;
+ private long sequenceNumber;
+ private DceRpc_ActivityUuid activityUuid;
+
+ public ProfinetDeviceContext() {
+ // Generate a new Activity Id, which will be used throughout the connection.
+ this.uuid = generateActivityUuid();
+ }
+
+ protected static DceRpc_ActivityUuid generateActivityUuid() {
+ UUID number = UUID.randomUUID();
+ try {
+ WriteBufferByteBased wb = new WriteBufferByteBased(128);
+ wb.writeLong(64, number.getMostSignificantBits());
+ wb.writeLong(64, number.getLeastSignificantBits());
+
+ ReadBuffer rb = new ReadBufferByteBased(wb.getBytes());
+ return new DceRpc_ActivityUuid(rb.readLong(32), rb.readInt(16), rb.readInt(16), rb.readByteArray(8));
+ } catch (SerializationException | ParseException e) {
+ // Ignore ... this should actually never happen.
+ }
+ return null;
+ }
+
+ public int getAndIncrementIdentification() {
+ int id = identificationGenerator.getAndIncrement();
+ if (id == 0xFFFF) {
+ identificationGenerator.set(1);
+ }
+ return id;
+ }
+
+ public int getIncrementAndGetFrameId() {
+ frameId += 1;
+ return frameId;
+ }
+
+ public int getAndIncrementSessionKey() {
+ // Generate a new session key.
+ Integer sessionKey = sessionKeyGenerator.getAndIncrement();
+ // Reset the session key as soon as it reaches the max for a 16 bit uint
+ if (sessionKeyGenerator.get() == 0xFFFF) {
+ sessionKeyGenerator.set(1);
+ }
+ return sessionKey;
+ }
+
+ @Override
+ public void setConfiguration(ProfinetConfiguration configuration) {
+ this.configuration = configuration;
+ }
+
+ public MacAddress getLocalMacAddress() {
+ return localMacAddress;
+ }
+
+ public void setLocalMacAddress(MacAddress localMacAddress) {
+ this.localMacAddress = localMacAddress;
+ }
+
+ public DceRpc_ActivityUuid getUuid() {
+ return uuid;
+ }
+
+ public ProfinetConfiguration getConfiguration() {
+ return configuration;
+ }
+
+ public InetAddress getLocalIpAddress() {
+ return localIpAddress;
+ }
+
+ public void setLocalIpAddress(InetAddress localIpAddress) {
+ this.localIpAddress = localIpAddress;
+ }
+
+ public ProfinetChannel getChannel() {
+ return channel;
+ }
+
+ public void setChannel(ProfinetChannel channel) {
+ this.channel = channel;
+ }
+
+ public MacAddress getMacAddress() {
+ return macAddress;
+ }
+
+ public void setMacAddress(MacAddress macAddress) {
+ this.macAddress = macAddress;
+ }
+
+ public ConversationContext getContext() {
+ return context;
+ }
+
+ public void setContext(ConversationContext context) {
+ this.context = context;
+ }
+
+ public ProfinetDeviceState getState() {
+ return state;
+ }
+
+ public void setState(ProfinetDeviceState state) {
+ this.state = state;
+ }
+
+ public boolean isLldpReceived() {
+ return lldpReceived;
+ }
+
+ public void setLldpReceived(boolean lldpReceived) {
+ this.lldpReceived = lldpReceived;
+ }
+
+ public boolean isDcpReceived() {
+ return dcpReceived;
+ }
+
+ public void setDcpReceived(boolean dcpReceived) {
+ this.dcpReceived = dcpReceived;
+ }
+
+ public String getIpAddress() {
+ return ipAddress;
+ }
+
+ public void setIpAddress(String ipAddress) {
+ this.ipAddress = ipAddress;
+ }
+
+ public String getPortId() {
+ return portId;
+ }
+
+ public void setPortId(String portId) {
+ this.portId = portId;
+ }
+
+ public PnIoCm_Block_IoCrReq getInputReq() {
+ return inputReq;
+ }
+
+ public void setInputReq(PnIoCm_Block_IoCrReq inputReq) {
+ this.inputReq = inputReq;
+ }
+
+ public PnIoCm_Block_IoCrReq getOutputReq() {
+ return outputReq;
+ }
+
+ public void setOutputReq(PnIoCm_Block_IoCrReq outputReq) {
+ this.outputReq = outputReq;
+ }
+
+ public String[] getSubModules() {
+ return subModules;
+ }
+
+ public void setSubModules(String subModules) {
+ String[] splitModules = subModules.split(",");
+ ArrayList arrayList = new ArrayList<>();
+ for (String s : splitModules) {
+ String normalizedString = s.trim();
+ arrayList.add(normalizedString);
+ }
+ this.subModules = new String[arrayList.size()];
+ arrayList.toArray(this.subModules);
+ }
+
+ public List getInputIoPsApiBlocks() {
+ List inputIoPsApiBlocks = new ArrayList<>();
+ for (ProfinetModule module : modules) {
+ inputIoPsApiBlocks.addAll(module.getInputIoPsApiBlocks());
+ }
+ return inputIoPsApiBlocks;
+ }
+
+ public List getInputIoCsApiBlocks() {
+ List inputIoCsApiBlocks = new ArrayList<>();
+ for (ProfinetModule module : modules) {
+ inputIoCsApiBlocks.addAll(module.getInputIoCsApiBlocks());
+ }
+ return inputIoCsApiBlocks;
+ }
+
+ public List getOutputIoPsApiBlocks() {
+ List outputIoPsApiBlocks = new ArrayList<>();
+ for (ProfinetModule module : modules) {
+ outputIoPsApiBlocks.addAll(module.getOutputIoPsApiBlocks());
+ }
+ return outputIoPsApiBlocks;
+ }
+
+ public List getOutputIoCsApiBlocks() {
+ List outputIoCsApiBlocks = new ArrayList<>();
+ for (ProfinetModule module : modules) {
+ outputIoCsApiBlocks.addAll(module.getOutputIoCsApiBlocks());
+ }
+ return outputIoCsApiBlocks;
+ }
+
+ public List getExpectedSubModuleApiBlocks(ProfinetModule module) {
+ return module.getExpectedSubModuleApiBlocks();
+ }
+
+ public List getExpectedSubmoduleReq() {
+ List expectedSubmoduleReq = new ArrayList<>();
+ for (ProfinetModule module : modules) {
+ if (!(module instanceof ProfinetEmptyModule)) {
+ expectedSubmoduleReq.add(
+ new PnIoCm_Block_ExpectedSubmoduleReq((short) 1, (short) 0,
+ Collections.singletonList(
+ new PnIoCm_ExpectedSubmoduleBlockReqApi(module.getSlotNumber(),
+ module.getIdentNumber(),
+ 0x00000000,
+ getExpectedSubModuleApiBlocks(module)
+ )
+ )
+ )
+ );
+ }
+ }
+ return expectedSubmoduleReq;
+ }
+
+ public String getDeviceTypeName() {
+ return deviceTypeName;
+ }
+
+ public void setDeviceTypeName(String deviceTypeName) {
+ this.deviceTypeName = deviceTypeName;
+ }
+
+ public String getDeviceName() {
+ return deviceName;
+ }
+
+ public void setDeviceName(String deviceName) {
+ this.deviceName = deviceName;
+ }
+
+ public ProfinetISO15745Profile getGsdFile() {
+ return gsdFile;
+ }
+
+ public void setGsdFile(ProfinetISO15745Profile gsdFile) throws PlcConnectionException {
+ this.gsdFile = gsdFile;
+ extractGSDFileInfo(this.gsdFile);
+ }
+
+ private void extractGSDFileInfo(ProfinetISO15745Profile gsdFile) throws PlcConnectionException {
+
+ for (ProfinetDeviceAccessPointItem deviceAccessItem : gsdFile.getProfileBody().getApplicationProcess().getDeviceAccessPointList()) {
+ if (deviceAccess.equals(deviceAccessItem.getId())) {
+ this.deviceAccessItem = deviceAccessItem;
+ }
+ }
+ if (deviceAccessItem == null) {
+ throw new PlcConnectionException("Unable to find Device Access Item - " + this.deviceAccess);
+ }
+
+ Matcher matcher = RANGE_PATTERN.matcher(deviceAccessItem.getPhysicalSlots());
+ if (!matcher.matches()) {
+ throw new PlcConnectionException("Physical Slots Range is not in the correct format " + deviceAccessItem.getPhysicalSlots());
+ }
+ if (!matcher.group("from").equals("0")) {
+ throw new PlcConnectionException("Physical Slots don't start from 0, instead starts at " + deviceAccessItem.getPhysicalSlots());
+ }
+ int numberOfSlots = Integer.parseInt(matcher.group("to"));
+ this.modules = new ProfinetModule[numberOfSlots];
+ this.modules[deviceAccessItem.getFixedInSlots()] = new ProfinetModuleImpl(deviceAccessItem, 0, 0, deviceAccessItem.getFixedInSlots());
+
+ List usableSubModules = this.deviceAccessItem.getUseableModules();
+ int currentSlot = deviceAccessItem.getFixedInSlots() + 1;
+ int inputOffset = this.modules[deviceAccessItem.getFixedInSlots()].getInputIoPsSize();
+ int outputOffset = this.modules[deviceAccessItem.getFixedInSlots()].getOutputIoCsSize();
+ for (String subModule : this.subModules) {
+ if (subModule.equals("")) {
+ this.modules[currentSlot] = new ProfinetEmptyModule();
+ } else {
+ for (ProfinetModuleItemRef useableModule : usableSubModules) {
+ if (useableModule.getModuleItemTarget().equals(subModule)) {
+ matcher = RANGE_PATTERN.matcher(useableModule.getAllowedInSlots());
+ if (!matcher.matches()) {
+ throw new PlcConnectionException("Physical Slots Range is not in the correct format " + useableModule.getAllowedInSlots());
+ }
+ int from = Integer.parseInt(matcher.group("from"));
+ int to = Integer.parseInt(matcher.group("to"));
+ if (currentSlot < from || currentSlot > to) {
+ throw new PlcConnectionException("Current Submodule Slot " + currentSlot + " is not with the allowable slots" + useableModule.getAllowedInSlots());
+ }
+
+ ProfinetModuleItem foundReferencedModule = null;
+ for (ProfinetModuleItem module : gsdFile.getProfileBody().getApplicationProcess().getModuleList()) {
+ if (module.getId().equals(subModule)) {
+ foundReferencedModule = module;
+ break;
+ }
+ }
+
+ if (foundReferencedModule == null) {
+ throw new PlcConnectionException("Couldn't find reference module " + subModule + " in GSD file.");
+ }
+
+ this.modules[currentSlot] = new ProfinetModuleImpl(foundReferencedModule, inputOffset, outputOffset, currentSlot);
+
+ inputOffset += this.modules[currentSlot].getInputIoPsSize();
+ outputOffset += this.modules[currentSlot].getOutputIoCsSize();
+ break;
+ }
+ }
+ }
+ if (this.modules[currentSlot] == null) {
+ throw new PlcConnectionException("Sub Module not Found in allowed Modules");
+ }
+ currentSlot += 1;
+ }
+
+ while (currentSlot != numberOfSlots) {
+ this.modules[currentSlot] = new ProfinetEmptyModule();
+ currentSlot += 1;
+ }
+
+ for (ProfinetModule usableModule : this.modules) {
+ usableModule.populateOutputCR(inputOffset, outputOffset);
+ inputOffset += usableModule.getInputIoCsSize();
+ outputOffset += usableModule.getOutputIoPsSize();
+ }
+
+ List interfaceSubModules = deviceAccessItem.getSystemDefinedSubmoduleList().getInterfaceSubmodules();
+ if (interfaceSubModules != null && interfaceSubModules.size() > 0) {
+ if (interfaceSubModules.get(0).getApplicationRelations().getStartupMode() != null && interfaceSubModules.get(0).getApplicationRelations().getStartupMode().toLowerCase().contains("advanced")) {
+ this.nonLegacyStartupMode = true;
+ this.frameId = 0x8001;
+ }
+ }
+ }
+
+ public List getInterfaceSubModules() {
+ return deviceAccessItem.getSystemDefinedSubmoduleList().getInterfaceSubmodules();
+ }
+
+ public ProfinetModule[] getModules() {
+ return modules;
+ }
+
+ public boolean isNonLegacyStartupMode() {
+ return nonLegacyStartupMode;
+ }
+
+ public void setNonLegacyStartupMode(boolean nonLegacyStartupMode) {
+ this.nonLegacyStartupMode = nonLegacyStartupMode;
+ }
+
+ public void setFrameId(int frameId) {
+ this.frameId = frameId;
+ }
+
+ public Map> getQueue() {
+ return queue;
+ }
+
+ public void setQueue(Map> queue) {
+ this.queue = queue;
+ }
+
+ public int getSessionKey() {
+ return sessionKey;
+ }
+
+ public void setSessionKey(int sessionKey) {
+ this.sessionKey = sessionKey;
+ }
+
+ public int getSourcePort() {
+ return sourcePort;
+ }
+
+ public void setSourcePort(int port) {
+ this.sourcePort = port;
+ }
+
+ public int getDestinationPort() {
+ return destinationPort;
+ }
+
+ public void setDestinationPort(int port) {
+ this.destinationPort = port;
+ }
+
+ public String getDeviceAccess() {
+ return deviceAccess;
+ }
+
+ public void setDeviceAccess(String deviceAccess) {
+ this.deviceAccess = deviceAccess;
+ }
+
+ public long getSequenceNumber() {
+ return sequenceNumber;
+ }
+
+ public void setSequenceNumber(long sequenceNumber) {
+ this.sequenceNumber = sequenceNumber;
+ }
+
+ public DceRpc_ActivityUuid getActivityUuid() {
+ return activityUuid;
+ }
+
+ public void setActivityUuid(DceRpc_ActivityUuid activityUuid) {
+ this.activityUuid = activityUuid;
+ }
+
+ public void addSubscriptionHandle(String tag, ProfinetSubscriptionHandle handle) {
+ subscriptionHandles.put(tag, handle);
+ }
+
+ public ProfinetSubscriptionHandle getSubscriptionHandle(String tag) {
+ return subscriptionHandles.getOrDefault(tag, null);
+ }
+
+ public void removeSubscriptionHandle(String tag) {
+ subscriptionHandles.remove(tag);
+ }
+}
diff --git a/plc4j/drivers/profinet/src/main/java/org/apache/plc4x/java/profinet/context/ProfinetDriverContext.java b/plc4j/drivers/profinet/src/main/java/org/apache/plc4x/java/profinet/context/ProfinetDriverContext.java
index 090e3b06b07..33ebbe1326e 100644
--- a/plc4j/drivers/profinet/src/main/java/org/apache/plc4x/java/profinet/context/ProfinetDriverContext.java
+++ b/plc4j/drivers/profinet/src/main/java/org/apache/plc4x/java/profinet/context/ProfinetDriverContext.java
@@ -16,104 +16,54 @@
* specific language governing permissions and limitations
* under the License.
*/
+
package org.apache.plc4x.java.profinet.context;
import org.apache.plc4x.java.profinet.config.ProfinetConfiguration;
-import org.apache.plc4x.java.profinet.readwrite.DceRpc_ActivityUuid;
-import org.apache.plc4x.java.profinet.readwrite.IpAddress;
-import org.apache.plc4x.java.profinet.readwrite.MacAddress;
-import org.apache.plc4x.java.spi.configuration.HasConfiguration;
+import org.apache.plc4x.java.profinet.device.ProfinetChannel;
+import org.apache.plc4x.java.profinet.device.ProfinetDeviceMessageHandler;
import org.apache.plc4x.java.spi.context.DriverContext;
import java.net.DatagramSocket;
-public class ProfinetDriverContext implements DriverContext, HasConfiguration {
-
- private DceRpc_ActivityUuid dceRpc_activityUuid;
- private MacAddress localMacAddress;
- private IpAddress localIpAddress;
- private int localUdpPort;
- private MacAddress remoteMacAddress;
- private IpAddress remoteIpAddress;
- private int remoteUdpPort;
- private int sessionKey;
-
- private DatagramSocket udpSocket;
-
- @Override
- public void setConfiguration(ProfinetConfiguration configuration) {
-
- }
-
- public DceRpc_ActivityUuid getDceRpcActivityUuid() {
- return dceRpc_activityUuid;
- }
-
- public void setDceRpcActivityUuid(DceRpc_ActivityUuid dceRpc_activityUuid) {
- this.dceRpc_activityUuid = dceRpc_activityUuid;
- }
-
- public MacAddress getLocalMacAddress() {
- return localMacAddress;
- }
-
- public void setLocalMacAddress(MacAddress localMacAddress) {
- this.localMacAddress = localMacAddress;
- }
-
- public IpAddress getLocalIpAddress() {
- return localIpAddress;
- }
+public class ProfinetDriverContext implements DriverContext {
- public void setLocalIpAddress(IpAddress localIpAddress) {
- this.localIpAddress = localIpAddress;
- }
-
- public int getLocalUdpPort() {
- return localUdpPort;
- }
+ public static final int DEFAULT_UDP_PORT = 34964;
+ private ProfinetDeviceMessageHandler handler;
+ private ProfinetConfiguration configuration;
+ private DatagramSocket socket;
+ private ProfinetChannel channel;
- public void setLocalUdpPort(int localUdpPort) {
- this.localUdpPort = localUdpPort;
+ public ProfinetChannel getChannel() {
+ return channel;
}
- public MacAddress getRemoteMacAddress() {
- return remoteMacAddress;
+ public void setChannel(ProfinetChannel channel) {
+ this.channel = channel;
}
- public void setRemoteMacAddress(MacAddress remoteMacAddress) {
- this.remoteMacAddress = remoteMacAddress;
+ public ProfinetDeviceMessageHandler getHandler() {
+ return handler;
}
- public IpAddress getRemoteIpAddress() {
- return remoteIpAddress;
+ public void setHandler(ProfinetDeviceMessageHandler handler) {
+ this.handler = handler;
}
- public void setRemoteIpAddress(IpAddress remoteIpAddress) {
- this.remoteIpAddress = remoteIpAddress;
+ public ProfinetConfiguration getConfiguration() {
+ return configuration;
}
- public int getRemoteUdpPort() {
- return remoteUdpPort;
- }
-
- public void setRemoteUdpPort(int remoteUdpPort) {
- this.remoteUdpPort = remoteUdpPort;
- }
-
- public int getSessionKey() {
- return sessionKey;
+ public void setConfiguration(ProfinetConfiguration configuration) {
+ this.configuration = configuration;
}
- public void setSessionKey(int sessionKey) {
- this.sessionKey = sessionKey;
+ public DatagramSocket getSocket() {
+ return socket;
}
- public DatagramSocket getUdpSocket() {
- return udpSocket;
+ public void setSocket(DatagramSocket socket) {
+ this.socket = socket;
}
- public void setUdpSocket(DatagramSocket udpSocket) {
- this.udpSocket = udpSocket;
- }
}
diff --git a/plc4j/drivers/profinet/src/main/java/org/apache/plc4x/java/profinet/device/GsdFileMap.java b/plc4j/drivers/profinet/src/main/java/org/apache/plc4x/java/profinet/device/GsdFileMap.java
new file mode 100644
index 00000000000..8343dbdfc2b
--- /dev/null
+++ b/plc4j/drivers/profinet/src/main/java/org/apache/plc4x/java/profinet/device/GsdFileMap.java
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.plc4x.java.profinet.device;
+
+import org.apache.plc4x.java.profinet.gsdml.ProfinetISO15745Profile;
+
+import java.util.Map;
+
+public class GsdFileMap {
+
+ private final Map gsdFiles;
+
+ public GsdFileMap(Map gsdFiles) {
+ this.gsdFiles = gsdFiles;
+ }
+
+ public Map getGsdFiles() {
+ return this.gsdFiles;
+ }
+
+}
diff --git a/plc4j/drivers/profinet/src/main/java/org/apache/plc4x/java/profinet/device/ProfinetCallable.java b/plc4j/drivers/profinet/src/main/java/org/apache/plc4x/java/profinet/device/ProfinetCallable.java
new file mode 100644
index 00000000000..9798f9dfee7
--- /dev/null
+++ b/plc4j/drivers/profinet/src/main/java/org/apache/plc4x/java/profinet/device/ProfinetCallable.java
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.plc4x.java.profinet.device;
+
+import org.apache.plc4x.java.api.exceptions.PlcException;
+
+public interface ProfinetCallable {
+ void handle(T packet);
+
+ T create();
+
+ long getId();
+
+ void setId(long id);
+}
diff --git a/plc4j/drivers/profinet/src/main/java/org/apache/plc4x/java/profinet/device/ProfinetChannel.java b/plc4j/drivers/profinet/src/main/java/org/apache/plc4x/java/profinet/device/ProfinetChannel.java
new file mode 100644
index 00000000000..d3bcaf716b8
--- /dev/null
+++ b/plc4j/drivers/profinet/src/main/java/org/apache/plc4x/java/profinet/device/ProfinetChannel.java
@@ -0,0 +1,224 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.plc4x.java.profinet.device;
+
+import org.apache.commons.codec.binary.Hex;
+import org.apache.plc4x.java.profinet.config.ProfinetConfiguration;
+import org.apache.plc4x.java.profinet.discovery.ProfinetPlcDiscoverer;
+import org.apache.plc4x.java.profinet.readwrite.*;
+import org.apache.plc4x.java.spi.generation.*;
+import org.pcap4j.core.*;
+import org.pcap4j.packet.*;
+import org.pcap4j.packet.namednumber.EtherType;
+import org.pcap4j.util.LinkLayerAddress;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.*;
+import java.util.function.Function;
+
+public class ProfinetChannel {
+
+ private final Logger logger = LoggerFactory.getLogger(ProfinetChannel.class);
+ private static final EtherType PN_EtherType = EtherType.getInstance((short) 0x8892);
+ private static final EtherType LLDP_EtherType = EtherType.getInstance((short) 0x88cc);
+ private ProfinetPlcDiscoverer discoverer = null;
+ private Map openHandles;
+ private ProfinetDevices configuredDevices;
+
+ public ProfinetChannel(List devs, ProfinetDevices devices) {
+ this.configuredDevices = devices;
+ this.openHandles = getInterfaceHandles(devs);
+ startListener();
+ }
+
+ public void send(Ethernet_Frame ethFrame) {
+ for (Map.Entry entry : openHandles.entrySet()) {
+ PcapHandle handle = entry.getValue();
+ WriteBufferByteBased buffer = new WriteBufferByteBased(ethFrame.getLengthInBytes());
+ try {
+ ethFrame.serialize(buffer);
+ Packet packet = EthernetPacket.newPacket(buffer.getBytes(), 0, ethFrame.getLengthInBytes());
+ handle.sendPacket(packet);
+ } catch (PcapNativeException | NotOpenException | SerializationException | IllegalRawDataException e) {
+ throw new RuntimeException(e);
+ }
+ }
+ }
+
+ public void startListener() {
+ for (Map.Entry entry : openHandles.entrySet()) {
+ PcapHandle handle = entry.getValue();
+
+ Thread thread = new Thread(
+ new ProfinetRunnable(handle,
+ message -> {
+ PacketListener listener = createListener();
+ try {
+ handle.loop(-1, listener);
+ } catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
+ } catch (PcapNativeException | NotOpenException e) {
+ logger.error("Got error handling raw socket", e);
+ }
+ return null;
+ }));
+ thread.start();
+ }
+ }
+ public PacketListener createListener() {
+ PacketListener listener =
+ packet -> {
+ // EthernetPacket is the highest level of abstraction we can be expecting.
+ // Everything inside this we will have to decode ourselves.
+ if (packet instanceof EthernetPacket) {
+ EthernetPacket ethernetPacket = (EthernetPacket) packet;
+ boolean isPnPacket = false;
+ // I have observed sometimes the ethernet packets being wrapped inside a VLAN
+ // Packet, in this case we simply unpack the content.
+ if (ethernetPacket.getPayload() instanceof Dot1qVlanTagPacket) {
+ Dot1qVlanTagPacket vlanPacket = (Dot1qVlanTagPacket) ethernetPacket.getPayload();
+ if (PN_EtherType.equals(vlanPacket.getHeader().getType()) || LLDP_EtherType.equals(vlanPacket.getHeader().getType())) {
+ isPnPacket = true;
+ }
+ } else if (PN_EtherType.equals(ethernetPacket.getHeader().getType()) || LLDP_EtherType.equals(ethernetPacket.getHeader().getType())) {
+ isPnPacket = true;
+ } else if (ethernetPacket.getHeader().getType() == EtherType.IPV4 && ethernetPacket.getPayload().getPayload() instanceof UdpPacket) {
+ UdpPacket payload = (UdpPacket) ethernetPacket.getPayload().getPayload();
+ // Check if it's a PROFINET packet
+ if (payload.getHeader().getDstPort().value() == -30572 || payload.getHeader().getSrcPort().value() == -30572) {
+ isPnPacket = true;
+ }
+ }
+
+ if (isPnPacket) {
+ ReadBuffer reader = new ReadBufferByteBased(ethernetPacket.getRawData());
+ try {
+ Ethernet_Frame ethernetFrame = Ethernet_Frame.staticParse(reader);
+ Ethernet_FramePayload payload = ethernetFrame.getPayload();
+ if (payload instanceof Ethernet_FramePayload_VirtualLan) {
+ payload = ((Ethernet_FramePayload_VirtualLan) payload).getPayload();
+ }
+
+ if (payload instanceof Ethernet_FramePayload_PnDcp) {
+ PnDcp_Pdu pdu = ((Ethernet_FramePayload_PnDcp) payload).getPdu();
+ if (pdu.getFrameId() == PnDcp_FrameId.DCP_Identify_ResPDU) {
+ if (discoverer != null) {
+ discoverer.processPnDcp(pdu, ethernetPacket);
+ }
+ } else if (pdu.getFrameId() == PnDcp_FrameId.Alarm_Low) {
+ for (Map.Entry device : this.configuredDevices.getConfiguredDevices().entrySet()) {
+ if (Arrays.equals(device.getValue().getDeviceContext().getMacAddress().getAddress(), ethernetFrame.getSource().getAddress())) {
+ PnDcp_Pdu_AlarmLow alarmPdu = (PnDcp_Pdu_AlarmLow) pdu;
+ device.getValue().handleAlarmResponse(alarmPdu);
+ }
+ }
+ }
+ else if (pdu.getFrameId() == PnDcp_FrameId.RT_CLASS_1) {
+ for (Map.Entry device : this.configuredDevices.getConfiguredDevices().entrySet()) {
+ if (Arrays.equals(device.getValue().getDeviceContext().getMacAddress().getAddress(), ethernetFrame.getSource().getAddress())) {
+ PnDcp_Pdu_RealTimeCyclic cyclicPdu = (PnDcp_Pdu_RealTimeCyclic) pdu;
+ device.getValue().handleRealTimeResponse(cyclicPdu);
+ }
+ }
+ }
+
+ } else if (payload instanceof Ethernet_FramePayload_LLDP) {
+ Lldp_Pdu pdu = ((Ethernet_FramePayload_LLDP) payload).getPdu();
+ if (discoverer != null) {
+ discoverer.processLldp(pdu);
+ }
+ } else if (payload instanceof Ethernet_FramePayload_IPv4) {
+ for (Map.Entry device : this.configuredDevices.getConfiguredDevices().entrySet()) {
+ if (Arrays.equals(device.getValue().getDeviceContext().getMacAddress().getAddress(), ethernetFrame.getSource().getAddress())) {
+ device.getValue().handleResponse((Ethernet_FramePayload_IPv4) payload);
+ }
+ }
+ }
+ } catch (ParseException e) {
+ logger.error("Got error decoding packet", e);
+ }
+ }
+ }
+ };
+ return listener;
+ }
+
+ public Map getInterfaceHandles(List devs) {
+ Map openHandles = new HashMap<>();
+ try {
+ for (PcapNetworkInterface dev : devs) {
+ // It turned out on some MAC network devices without any ip addresses
+ // the compiling of the filter expression was causing errors. As
+ // currently there was no other way to detect this, this check seems
+ // to be sufficient.
+ if (dev.getAddresses().size() == 0) {
+ continue;
+ }
+ if (!dev.isLoopBack()) {
+ for (LinkLayerAddress linkLayerAddress : dev.getLinkLayerAddresses()) {
+ org.pcap4j.util.MacAddress macAddress = (org.pcap4j.util.MacAddress) linkLayerAddress;
+ PcapHandle handle = dev.openLive(65536, PcapNetworkInterface.PromiscuousMode.PROMISCUOUS, 10);
+ openHandles.put(toPlc4xMacAddress(macAddress), handle);
+
+ // Only react on PROFINET, UDP or LLDP packets targeted at our current MAC address.
+ handle.setFilter(
+ "(ether proto 0x0800) or (((ether proto 0x8100) or (ether proto 0x8892)) and (ether dst " + Pcaps.toBpfString(macAddress) + ")) or (ether proto 0x88cc)",
+ BpfProgram.BpfCompileMode.OPTIMIZE);
+ }
+ }
+ }
+ } catch (NotOpenException | PcapNativeException e) {
+ logger.error("Got an exception while processing raw socket data", e);
+ for (Map.Entry entry : openHandles.entrySet()) {
+ PcapHandle openHandle = entry.getValue();
+ try {
+ openHandle.breakLoop();
+ openHandle.close();
+ } catch (NotOpenException error) {
+ logger.info("Handle already closed.");
+ }
+ }
+ }
+ return openHandles;
+ }
+
+ public ProfinetPlcDiscoverer getDiscoverer() {
+ return discoverer;
+ }
+
+ public void setDiscoverer(ProfinetPlcDiscoverer discoverer) {
+ this.discoverer = discoverer;
+ }
+
+ public Map getOpenHandles() {
+ return openHandles;
+ }
+
+ public void setConfiguredDevices(ProfinetDevices configuredDevices) {
+ this.configuredDevices = configuredDevices;
+ }
+
+ private static MacAddress toPlc4xMacAddress(org.pcap4j.util.MacAddress pcap4jMacAddress) {
+ byte[] address = pcap4jMacAddress.getAddress();
+ return new MacAddress(new byte[]{address[0], address[1], address[2], address[3], address[4], address[5]});
+ }
+
+}
diff --git a/plc4j/drivers/profinet/src/main/java/org/apache/plc4x/java/profinet/device/ProfinetDevice.java b/plc4j/drivers/profinet/src/main/java/org/apache/plc4x/java/profinet/device/ProfinetDevice.java
new file mode 100644
index 00000000000..dc076a9094d
--- /dev/null
+++ b/plc4j/drivers/profinet/src/main/java/org/apache/plc4x/java/profinet/device/ProfinetDevice.java
@@ -0,0 +1,957 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.plc4x.java.profinet.device;
+
+import org.apache.commons.codec.DecoderException;
+import org.apache.commons.codec.binary.Hex;
+import org.apache.plc4x.java.api.exceptions.PlcException;
+import org.apache.plc4x.java.api.messages.*;
+import org.apache.plc4x.java.api.model.PlcConsumerRegistration;
+import org.apache.plc4x.java.api.model.PlcSubscriptionHandle;
+import org.apache.plc4x.java.api.types.PlcResponseCode;
+import org.apache.plc4x.java.api.types.PlcSubscriptionType;
+import org.apache.plc4x.java.api.value.PlcValue;
+import org.apache.plc4x.java.profinet.context.ProfinetDeviceContext;
+import org.apache.plc4x.java.profinet.gsdml.*;
+import org.apache.plc4x.java.profinet.readwrite.*;
+import org.apache.plc4x.java.profinet.tag.ProfinetTag;
+import org.apache.plc4x.java.spi.ConversationContext;
+import org.apache.plc4x.java.spi.generation.*;
+import org.apache.plc4x.java.spi.messages.DefaultPlcSubscriptionEvent;
+import org.apache.plc4x.java.spi.messages.DefaultPlcSubscriptionResponse;
+import org.apache.plc4x.java.spi.messages.PlcSubscriber;
+import org.apache.plc4x.java.spi.messages.utils.ResponseItem;
+import org.apache.plc4x.java.spi.model.DefaultPlcConsumerRegistration;
+import org.apache.plc4x.java.spi.model.DefaultPlcSubscriptionTag;
+import org.apache.plc4x.java.spi.values.PlcSTRING;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.net.*;
+import java.nio.ByteBuffer;
+import java.time.Instant;
+import java.util.*;
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
+import java.util.function.BiFunction;
+import java.util.function.Consumer;
+import java.util.function.Function;
+
+public class ProfinetDevice implements PlcSubscriber{
+
+ private final Logger logger = LoggerFactory.getLogger(ProfinetDevice.class);
+ private static final int DEFAULT_NUMBER_OF_PORTS_TO_SCAN = 100;
+ private static final int MIN_CYCLE_NANO_SEC = 31250;
+ private final BiFunction gsdHandler;
+ private final ProfinetDeviceContext deviceContext = new ProfinetDeviceContext();
+
+ // Each device should create a receiving socket, all the packets are then automatically transferred to the listener for the channel though.
+ private DatagramSocket socket = null;
+ private String vendorId;
+ private String deviceId;
+ private Thread eventLoop = null;
+ Map>> registrations = new HashMap<>();
+
+ public ProfinetDevice(String deviceName, String deviceAccess, String subModules, BiFunction gsdHandler) {
+ this.gsdHandler = gsdHandler;
+ deviceContext.setDeviceAccess(deviceAccess);
+ deviceContext.setSubModules(subModules);
+ deviceContext.setDeviceName(deviceName);
+ openDeviceUdpPort();
+ }
+
+ private void openDeviceUdpPort() {
+ // Open the receiving UDP port.
+ int count = 0;
+ int port = ProfinetDeviceContext.DEFAULT_SEND_UDP_PORT;
+ boolean portFound = false;
+ while (!portFound && count < DEFAULT_NUMBER_OF_PORTS_TO_SCAN) {
+ try {
+ socket = new DatagramSocket(port + count);
+ portFound = true;
+ } catch (SocketException e) {
+ count += 1;
+ port += 1;
+ }
+ }
+ if (!portFound) {
+ throw new RuntimeException("Unable to find free open port");
+ }
+ }
+
+ private long getObjectId() {
+ return deviceContext.getAndIncrementIdentification();
+ }
+
+ public String getVendorId() {
+ return vendorId;
+ }
+
+ public String getDeviceId() {
+ return deviceId;
+ }
+
+ public void setVendorDeviceId(String vendorId, String deviceId) {
+ try {
+ this.vendorId = vendorId;
+ this.deviceId = deviceId;
+ if (deviceContext.getGsdFile() == null) {
+ deviceContext.setGsdFile(gsdHandler.apply(vendorId, deviceId));
+ }
+ } catch (PlcException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ private void recordIdAndSend(ProfinetCallable callable) {
+ deviceContext.getQueue().put(callable.getId(), callable);
+ ProfinetMessageWrapper.sendUdpMessage(
+ callable,
+ deviceContext
+ );
+ }
+
+ @Override
+ public CompletableFuture subscribe(PlcSubscriptionRequest subscriptionRequest) {
+ return CompletableFuture.supplyAsync(() -> {
+ Map> values = new HashMap<>();
+
+ return new DefaultPlcSubscriptionResponse(subscriptionRequest, values);
+ });
+ }
+
+ @Override
+ public CompletableFuture unsubscribe(PlcUnsubscriptionRequest unsubscriptionRequest) {
+ return null;
+ }
+
+ @Override
+ public PlcConsumerRegistration register(Consumer consumer, Collection handles) {
+ // Register the current consumer for each of the given subscription handles
+ for (PlcSubscriptionHandle subscriptionHandle : handles) {
+ logger.debug("Registering Consumer");
+ ProfinetSubscriptionHandle profinetHandle = (ProfinetSubscriptionHandle) subscriptionHandle;
+ if (registrations.containsKey(profinetHandle.getAddressString())) {
+ registrations.get(profinetHandle.getAddressString()).add(consumer);
+ } else {
+ List> consumers = new ArrayList<>();
+ consumers.add(consumer);
+ registrations.put(profinetHandle.getAddressString(), consumers);
+ }
+ }
+ return new DefaultPlcConsumerRegistration(this, consumer, handles.toArray(new PlcSubscriptionHandle[0]));
+ }
+
+ @Override
+ public void unregister(PlcConsumerRegistration registration) {
+
+ }
+
+ public boolean onConnect() throws ExecutionException, InterruptedException, TimeoutException {
+ start();
+ return true;
+ }
+
+ /*
+ Starts the device main loop, sending data from controller to device.
+ */
+ public void start() {
+ final long timeout = (long) deviceContext.getConfiguration().getReductionRatio() * deviceContext.getConfiguration().getSendClockFactor() * deviceContext.getConfiguration().getWatchdogFactor() * MIN_CYCLE_NANO_SEC;
+ final int cycleTime = (int) (deviceContext.getConfiguration().getSendClockFactor() * deviceContext.getConfiguration().getReductionRatio() * (MIN_CYCLE_NANO_SEC/1000000.0));
+ Function