You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by hu...@apache.org on 2023/02/13 11:04:03 UTC
[plc4x] branch develop updated (3f13c0baf9 -> 40e6a66cd8)
This is an automated email from the ASF dual-hosted git repository.
hutcheb pushed a change to branch develop
in repository https://gitbox.apache.org/repos/asf/plc4x.git
from 3f13c0baf9 Fix code gen concurrent modification (#795)
new 635602db1c fix(plc4j/profinet): split profinet mspec and checked endianess of PNIO packets
new 40e6a66cd8 fix(plc4j/profinet): Implmented pop for the dcerpc response queue. Syncronized cyclic counter for pnio packets
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../profinet/readwrite/PcDcp_Pdu_DelayReq.java | 115 +-
.../plc4x/java/profinet/readwrite/PnDcp_Block.java | 32 +-
.../PnDcp_Block_DevicePropertiesAliasName.java | 26 +-
.../PnDcp_Block_DevicePropertiesDeviceId.java | 37 +-
...PnDcp_Block_DevicePropertiesDeviceInstance.java | 31 +-
.../PnDcp_Block_DevicePropertiesDeviceOptions.java | 18 +-
.../PnDcp_Block_DevicePropertiesDeviceRole.java | 72 +-
.../PnDcp_Block_DevicePropertiesDeviceVendor.java | 26 +-
.../PnDcp_Block_DevicePropertiesNameOfStation.java | 26 +-
.../readwrite/PnDcp_Block_IpMacAddress.java | 18 +-
.../readwrite/PnDcp_Block_IpParameter.java | 92 +-
.../plc4x/java/profinet/readwrite/PnDcp_Pdu.java | 15 +-
.../profinet/readwrite/PnDcp_Pdu_AlarmLow.java | 136 +-
.../profinet/readwrite/PnDcp_Pdu_IdentifyReq.java | 101 +-
.../profinet/readwrite/PnDcp_Pdu_IdentifyRes.java | 96 +-
.../readwrite/PnDcp_Pdu_IdentifyRes_Payload.java | 49 +-
.../readwrite/PnDcp_Pdu_RealTimeCyclic.java | 115 +-
.../java/profinet/readwrite/PnDcp_ServiceType.java | 44 +-
.../readwrite/PnDcp_SupportedDeviceOption.java | 20 +-
.../readwrite/PnIoCm_DataUnitDataObject.java | 21 +-
.../profinet/readwrite/PnIoCm_DataUnitIoCs.java | 43 +-
.../PnIoCm_ExpectedSubmoduleBlockReqApi.java | 73 +-
.../profinet/readwrite/PnIoCm_IoCrBlockReqApi.java | 52 +-
.../plc4x/java/profinet/readwrite/PnIoCm_IoCs.java | 40 +-
.../profinet/readwrite/PnIoCm_IoDataObject.java | 34 +-
.../java/profinet/readwrite/PnIoCm_Packet.java | 6 +
...Cm_Packet_Rej.java => PnIoCm_Packet_Fault.java} | 32 +-
.../profinet/readwrite/PnIoCm_Packet_NoCall.java} | 44 +-
.../profinet/readwrite/PnIoCm_Packet_Ping.java} | 43 +-
.../java/profinet/readwrite/PnIoCm_Submodule.java | 77 +-
.../PnIoCm_Submodule_InputAndOutputData.java | 88 +-
.../readwrite/PnIoCm_Submodule_InputData.java | 46 +-
.../PnIoCm_Submodule_NoInputNoOutputData.java | 36 +-
.../readwrite/PnIoCm_Submodule_OutputData.java | 46 +-
.../plc4x/java/profinet/readwrite/UserData.java | 12 +-
.../profinet/context/ProfinetDeviceContext.java | 14 +-
.../java/profinet/device/ProfinetChannel.java | 3 +-
.../plc4x/java/profinet/device/ProfinetDevice.java | 73 +-
.../plc4x/protocol/profinet/ProfinetProtocol.java | 25 +-
.../main/resources/protocols/profinet/dcerpc.mspec | 159 +++
.../resources/protocols/profinet/ethernet.mspec | 110 ++
.../main/resources/protocols/profinet/lldp.mspec | 166 +++
.../main/resources/protocols/profinet/pndcp.mspec | 407 ++++++
.../main/resources/protocols/profinet/pnio.mspec | 644 +++++++++
.../resources/protocols/profinet/profinet.mspec | 1431 --------------------
45 files changed, 2940 insertions(+), 1854 deletions(-)
copy plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/{PnIoCm_Packet_Rej.java => PnIoCm_Packet_Fault.java} (81%)
copy plc4j/drivers/{opcua/src/main/generated/org/apache/plc4x/java/opcua/readwrite/Frame.java => profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_Packet_NoCall.java} (71%)
copy plc4j/drivers/{opcua/src/main/generated/org/apache/plc4x/java/opcua/readwrite/NullExtension.java => profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_Packet_Ping.java} (72%)
create mode 100644 protocols/profinet/src/main/resources/protocols/profinet/dcerpc.mspec
create mode 100644 protocols/profinet/src/main/resources/protocols/profinet/ethernet.mspec
create mode 100644 protocols/profinet/src/main/resources/protocols/profinet/lldp.mspec
create mode 100644 protocols/profinet/src/main/resources/protocols/profinet/pndcp.mspec
create mode 100644 protocols/profinet/src/main/resources/protocols/profinet/pnio.mspec
delete mode 100644 protocols/profinet/src/main/resources/protocols/profinet/profinet.mspec
[plc4x] 02/02: fix(plc4j/profinet): Implmented pop for the dcerpc response queue. Syncronized cyclic counter for pnio packets
Posted by hu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hutcheb pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/plc4x.git
commit 40e6a66cd868e78d4890095dc2a0dd4874c3f18d
Author: Ben Hutcheson <be...@gmail.com>
AuthorDate: Sat Feb 11 12:48:51 2023 +0100
fix(plc4j/profinet): Implmented pop for the dcerpc response queue. Syncronized cyclic counter for pnio packets
---
.../profinet/context/ProfinetDeviceContext.java | 14 +++--
.../java/profinet/device/ProfinetChannel.java | 3 +-
.../plc4x/java/profinet/device/ProfinetDevice.java | 73 +++++++++++++++++++---
.../main/resources/protocols/profinet/pndcp.mspec | 22 +++----
4 files changed, 87 insertions(+), 25 deletions(-)
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
index e0152ce053..128f89fa98 100644
--- 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
@@ -459,12 +459,18 @@ public class ProfinetDeviceContext implements DriverContext, HasConfiguration<Pr
this.frameId = frameId;
}
- public Map<Long, ProfinetCallable<DceRpc_Packet>> getQueue() {
- return queue;
+ public ProfinetCallable<DceRpc_Packet> popFromQueue(long sequenceNumber) {
+ ProfinetCallable<DceRpc_Packet> r = queue.get(sequenceNumber);
+ queue.remove(sequenceNumber);
+ return r;
}
- public void setQueue(Map<Long, ProfinetCallable<DceRpc_Packet>> queue) {
- this.queue = queue;
+ public boolean hasSequenecNumberInQueue(long sequenceNumber) {
+ return queue.containsKey(sequenceNumber);
+ }
+
+ public void addToQueue(long sequenceNumber, ProfinetCallable<DceRpc_Packet> obj) {
+ queue.put(sequenceNumber, obj);
}
public int getSessionKey() {
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
index deb608c1e0..d1c1c4ffe8 100644
--- 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
@@ -103,7 +103,7 @@ public class ProfinetChannel {
} 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().getDstPort().value() == -15536) {
+ if (payload.getHeader().getDstPort().value() == -30572 || payload.getHeader().getDstPort().value() == -15536 || payload.getHeader().getDstPort().value() == -15535) {
isPnPacket = true;
}
}
@@ -139,7 +139,6 @@ public class ProfinetChannel {
}
}
}
-
} else if (payload instanceof Ethernet_FramePayload_LLDP) {
Lldp_Pdu pdu = ((Ethernet_FramePayload_LLDP) payload).getPdu();
if (discoverer != null) {
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
index e10de6e0b4..3e281301f5 100644
--- 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
@@ -70,6 +70,8 @@ public class ProfinetDevice implements PlcSubscriber{
private String deviceId;
private Thread eventLoop = null;
Map<String, List<Consumer<PlcSubscriptionEvent>>> registrations = new HashMap<>();
+ private int offset = 0;
+ private boolean firstMessage = true;
public ProfinetDevice(String deviceName, String deviceAccess, String subModules, BiFunction<String, String, ProfinetISO15745Profile> gsdHandler) {
this.gsdHandler = gsdHandler;
@@ -123,7 +125,7 @@ public class ProfinetDevice implements PlcSubscriber{
}
private void recordIdAndSend(ProfinetCallable<DceRpc_Packet> callable) {
- deviceContext.getQueue().put(callable.getId(), callable);
+ deviceContext.addToQueue(callable.getId(), callable);
ProfinetMessageWrapper.sendUdpMessage(
callable,
deviceContext
@@ -270,8 +272,8 @@ public class ProfinetDevice implements PlcSubscriber{
public void handleResponse(Ethernet_FramePayload_IPv4 packet) {
logger.debug("Received packet for {}", packet.getPayload().getObjectUuid());
long objectId = packet.getPayload().getSequenceNumber();
- if (deviceContext.getQueue().containsKey(objectId)) {
- deviceContext.getQueue().get(objectId).handle(packet.getPayload());
+ if (deviceContext.hasSequenecNumberInQueue(objectId)) {
+ deviceContext.popFromQueue(objectId).handle(packet.getPayload());
} else {
PnIoCm_Packet payloadPacket = packet.getPayload().getPayload();
deviceContext.setActivityUuid(packet.getPayload().getActivityUuid());
@@ -283,6 +285,12 @@ public class ProfinetDevice implements PlcSubscriber{
deviceContext.setState(ProfinetDeviceState.APPLRDY);
}
}
+ } else if (payloadPacket instanceof PnIoCm_Packet_Fault) {
+ DceRpcAck ack = new DceRpcAck(deviceContext.getActivityUuid(), deviceContext.getSequenceNumber());
+ recordIdAndSend(ack);
+ } else if (payloadPacket instanceof PnIoCm_Packet_Ping) {
+ DceRpcAck ack = new DceRpcAck(deviceContext.getActivityUuid(), deviceContext.getSequenceNumber());
+ recordIdAndSend(ack);
} else {
deviceContext.setState(ProfinetDeviceState.ABORT);
logger.error("Unable to match Response with Requested Profinet packet");
@@ -348,10 +356,12 @@ public class ProfinetDevice implements PlcSubscriber{
Map<String, ResponseItem<PlcValue>> tags = new HashMap<>();
ReadBuffer buffer = new ReadBufferByteBased(cyclicPdu.getDataUnit().getData());
+ if (firstMessage) {
+ offset = cyclicPdu.getCycleCounter();
+ firstMessage = false;
+ }
+
try {
- if (deviceContext.getModules() == null) {
- logger.error("HH");
- }
for (ProfinetModule module : deviceContext.getModules()) {
module.parseTags(tags, deviceContext.getDeviceName(), buffer);
}
@@ -865,6 +875,53 @@ public class ProfinetDevice implements PlcSubscriber{
}
}
+ public class DceRpcAck implements ProfinetCallable<DceRpc_Packet> {
+
+ private final DceRpc_ActivityUuid activityUuid;
+ private long id;
+
+ public DceRpcAck(DceRpc_ActivityUuid activityUuid, long seqNumber) {
+ this.activityUuid = activityUuid;
+ this.id = seqNumber;
+ }
+
+ public CompletableFuture<Boolean> getResponseHandled() {
+ return null;
+ }
+
+ public long getId() {
+ return id;
+ }
+
+ public void setId(long id) {
+ this.id = id;
+ }
+
+ public DceRpc_Packet create() {
+ return new DceRpc_Packet(
+ DceRpc_PacketType.NO_CALL,
+ false,
+ true,
+ true,
+ IntegerEncoding.BIG_ENDIAN,
+ CharacterEncoding.ASCII,
+ FloatingPointEncoding.IEEE,
+ new DceRpc_ObjectUuid((byte) 0x00, 0x0001, Integer.decode("0x" + deviceId), Integer.decode("0x" + vendorId)),
+ new DceRpc_InterfaceUuid_ControllerInterface(),
+ activityUuid,
+ 0,
+ id,
+ DceRpc_Operation.CONTROL,
+ new PnIoCm_Packet_NoCall()
+ );
+ }
+
+ @Override
+ public void handle(DceRpc_Packet packet) {
+ logger.debug("Received an unintented packet");
+ }
+ }
+
public class CyclicData implements ProfinetCallable<Ethernet_Frame> {
private final long startTime;
@@ -906,7 +963,7 @@ public class ProfinetDevice implements PlcSubscriber{
buffer.writeByte((byte) 0x00);
}
- int elapsedTime = (int) ((((System.nanoTime() - startTime)/(MIN_CYCLE_NANO_SEC))) % 65536);
+ int elapsedTime = (int) ((((System.nanoTime() - startTime)/(MIN_CYCLE_NANO_SEC)) + offset) % 65536);
Ethernet_Frame frame = new Ethernet_Frame(
deviceContext.getMacAddress(),
@@ -932,7 +989,7 @@ public class ProfinetDevice implements PlcSubscriber{
deviceContext.setState(ProfinetDeviceState.ABORT);
logger.error("Error serializing cyclic data for device {}", deviceContext.getDeviceName());
- int elapsedTime = (int) ((((System.nanoTime() - startTime)/(MIN_CYCLE_NANO_SEC))) % 65536);
+ int elapsedTime = (int) ((((System.nanoTime() - startTime)/(MIN_CYCLE_NANO_SEC)) + offset) % 65536);
Ethernet_Frame frame = new Ethernet_Frame(
deviceContext.getMacAddress(),
diff --git a/protocols/profinet/src/main/resources/protocols/profinet/pndcp.mspec b/protocols/profinet/src/main/resources/protocols/profinet/pndcp.mspec
index 42a1deb7e6..dbc515c62c 100644
--- a/protocols/profinet/src/main/resources/protocols/profinet/pndcp.mspec
+++ b/protocols/profinet/src/main/resources/protocols/profinet/pndcp.mspec
@@ -70,17 +70,17 @@
// Delay Parameter End
]
['Alarm_Low' PnDcp_Pdu_AlarmLow
- [simple uint 16 alarmDstEndpoint]
- [simple uint 16 alarmSrcEndpoint]
- [simple uint 4 version]
- [simple uint 4 errorType]
- [simple uint 4 tAck]
- [simple uint 4 windowSize]
- [simple uint 16 senSeqNum]
- [simple uint 16 ackSeqNum]
- [implicit uint 16 varPartLen 'COUNT(varPart)']
- [array byte varPart length 'varPartLen']
- ]
+ [simple uint 16 alarmDstEndpoint]
+ [simple uint 16 alarmSrcEndpoint]
+ [simple uint 4 version]
+ [simple uint 4 errorType]
+ [simple uint 4 tAck]
+ [simple uint 4 windowSize]
+ [simple uint 16 senSeqNum]
+ [simple uint 16 ackSeqNum]
+ [implicit uint 16 varPartLen 'COUNT(varPart)']
+ [array byte varPart length 'varPartLen']
+ ]
['DCP_Identify_ReqPDU' PnDcp_Pdu_IdentifyReq
[const uint 8 serviceId 0x05 ]
// ServiceType Start
[plc4x] 01/02: fix(plc4j/profinet): split profinet mspec and checked endianess of PNIO packets
Posted by hu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hutcheb pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/plc4x.git
commit 635602db1c74f2d5056d257a7c94274ea8c387c8
Author: Ben Hutcheson <be...@gmail.com>
AuthorDate: Sat Feb 11 10:05:29 2023 +0100
fix(plc4j/profinet): split profinet mspec and checked endianess of PNIO packets
---
.../profinet/readwrite/PcDcp_Pdu_DelayReq.java | 115 +-
.../plc4x/java/profinet/readwrite/PnDcp_Block.java | 32 +-
.../PnDcp_Block_DevicePropertiesAliasName.java | 26 +-
.../PnDcp_Block_DevicePropertiesDeviceId.java | 37 +-
...PnDcp_Block_DevicePropertiesDeviceInstance.java | 31 +-
.../PnDcp_Block_DevicePropertiesDeviceOptions.java | 18 +-
.../PnDcp_Block_DevicePropertiesDeviceRole.java | 72 +-
.../PnDcp_Block_DevicePropertiesDeviceVendor.java | 26 +-
.../PnDcp_Block_DevicePropertiesNameOfStation.java | 26 +-
.../readwrite/PnDcp_Block_IpMacAddress.java | 18 +-
.../readwrite/PnDcp_Block_IpParameter.java | 92 +-
.../plc4x/java/profinet/readwrite/PnDcp_Pdu.java | 15 +-
.../profinet/readwrite/PnDcp_Pdu_AlarmLow.java | 136 +-
.../profinet/readwrite/PnDcp_Pdu_IdentifyReq.java | 101 +-
.../profinet/readwrite/PnDcp_Pdu_IdentifyRes.java | 96 +-
.../readwrite/PnDcp_Pdu_IdentifyRes_Payload.java | 49 +-
.../readwrite/PnDcp_Pdu_RealTimeCyclic.java | 115 +-
.../java/profinet/readwrite/PnDcp_ServiceType.java | 44 +-
.../readwrite/PnDcp_SupportedDeviceOption.java | 20 +-
.../readwrite/PnIoCm_DataUnitDataObject.java | 21 +-
.../profinet/readwrite/PnIoCm_DataUnitIoCs.java | 43 +-
.../PnIoCm_ExpectedSubmoduleBlockReqApi.java | 73 +-
.../profinet/readwrite/PnIoCm_IoCrBlockReqApi.java | 52 +-
.../plc4x/java/profinet/readwrite/PnIoCm_IoCs.java | 40 +-
.../profinet/readwrite/PnIoCm_IoDataObject.java | 34 +-
.../java/profinet/readwrite/PnIoCm_Packet.java | 6 +
.../{UserData.java => PnIoCm_Packet_Fault.java} | 97 +-
.../{UserData.java => PnIoCm_Packet_NoCall.java} | 91 +-
.../{UserData.java => PnIoCm_Packet_Ping.java} | 90 +-
.../java/profinet/readwrite/PnIoCm_Submodule.java | 77 +-
.../PnIoCm_Submodule_InputAndOutputData.java | 88 +-
.../readwrite/PnIoCm_Submodule_InputData.java | 46 +-
.../PnIoCm_Submodule_NoInputNoOutputData.java | 36 +-
.../readwrite/PnIoCm_Submodule_OutputData.java | 46 +-
.../plc4x/java/profinet/readwrite/UserData.java | 12 +-
.../plc4x/protocol/profinet/ProfinetProtocol.java | 25 +-
.../main/resources/protocols/profinet/dcerpc.mspec | 159 +++
.../resources/protocols/profinet/ethernet.mspec | 110 ++
.../main/resources/protocols/profinet/lldp.mspec | 166 +++
.../main/resources/protocols/profinet/pndcp.mspec | 407 ++++++
.../main/resources/protocols/profinet/pnio.mspec | 644 +++++++++
.../resources/protocols/profinet/profinet.mspec | 1431 --------------------
42 files changed, 2915 insertions(+), 1948 deletions(-)
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 cd11e338df..d1d5946b72 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
@@ -103,46 +103,78 @@ public class PcDcp_Pdu_DelayReq extends PnDcp_Pdu implements Message {
writeReservedField(
"reserved",
reservedField0 != null ? reservedField0 : (long) 0x00000000,
- writeUnsignedLong(writeBuffer, 32));
+ writeUnsignedLong(writeBuffer, 32),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Reserved Field (reserved)
writeReservedField(
"reserved",
reservedField1 != null ? reservedField1 : (long) 0x00000000,
- writeUnsignedLong(writeBuffer, 32));
+ writeUnsignedLong(writeBuffer, 32),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Reserved Field (reserved)
writeReservedField(
"reserved",
reservedField2 != null ? reservedField2 : (long) 0x00000000,
- writeUnsignedLong(writeBuffer, 32));
+ writeUnsignedLong(writeBuffer, 32),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Simple Field (sequenceId)
- writeSimpleField("sequenceId", sequenceId, writeUnsignedInt(writeBuffer, 16));
+ writeSimpleField(
+ "sequenceId",
+ sequenceId,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Reserved Field (reserved)
writeReservedField(
"reserved",
reservedField3 != null ? reservedField3 : (int) 0x0000,
- writeUnsignedInt(writeBuffer, 16));
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Simple Field (delayInNs)
- writeSimpleField("delayInNs", delayInNs, writeUnsignedLong(writeBuffer, 32));
+ writeSimpleField(
+ "delayInNs",
+ delayInNs,
+ writeUnsignedLong(writeBuffer, 32),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Const Field (parameterType)
- writeConstField("parameterType", PARAMETERTYPE, writeUnsignedShort(writeBuffer, 7));
+ writeConstField(
+ "parameterType",
+ PARAMETERTYPE,
+ writeUnsignedShort(writeBuffer, 7),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Const Field (parameterLength)
- writeConstField("parameterLength", PARAMETERLENGTH, writeUnsignedInt(writeBuffer, 9));
+ writeConstField(
+ "parameterLength",
+ PARAMETERLENGTH,
+ writeUnsignedInt(writeBuffer, 9),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Simple Field (portMacAddress)
- writeSimpleField("portMacAddress", portMacAddress, new DataWriterComplexDefault<>(writeBuffer));
+ writeSimpleField(
+ "portMacAddress",
+ portMacAddress,
+ new DataWriterComplexDefault<>(writeBuffer),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Const Field (endType)
- writeConstField("endType", ENDTYPE, writeUnsignedShort(writeBuffer, 7));
+ writeConstField(
+ "endType",
+ ENDTYPE,
+ writeUnsignedShort(writeBuffer, 7),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Const Field (endLength)
- writeConstField("endLength", ENDLENGTH, writeUnsignedInt(writeBuffer, 9));
+ writeConstField(
+ "endLength",
+ ENDLENGTH,
+ writeUnsignedInt(writeBuffer, 9),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
writeBuffer.popContext("PcDcp_Pdu_DelayReq");
}
@@ -203,39 +235,78 @@ public class PcDcp_Pdu_DelayReq extends PnDcp_Pdu implements Message {
boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get();
Long reservedField0 =
- readReservedField("reserved", readUnsignedLong(readBuffer, 32), (long) 0x00000000);
+ readReservedField(
+ "reserved",
+ readUnsignedLong(readBuffer, 32),
+ (long) 0x00000000,
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
Long reservedField1 =
- readReservedField("reserved", readUnsignedLong(readBuffer, 32), (long) 0x00000000);
+ readReservedField(
+ "reserved",
+ readUnsignedLong(readBuffer, 32),
+ (long) 0x00000000,
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
Long reservedField2 =
- readReservedField("reserved", readUnsignedLong(readBuffer, 32), (long) 0x00000000);
+ readReservedField(
+ "reserved",
+ readUnsignedLong(readBuffer, 32),
+ (long) 0x00000000,
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
- int sequenceId = readSimpleField("sequenceId", readUnsignedInt(readBuffer, 16));
+ int sequenceId =
+ readSimpleField(
+ "sequenceId",
+ readUnsignedInt(readBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
Integer reservedField3 =
- readReservedField("reserved", readUnsignedInt(readBuffer, 16), (int) 0x0000);
+ readReservedField(
+ "reserved",
+ readUnsignedInt(readBuffer, 16),
+ (int) 0x0000,
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
- long delayInNs = readSimpleField("delayInNs", readUnsignedLong(readBuffer, 32));
+ long delayInNs =
+ readSimpleField(
+ "delayInNs",
+ readUnsignedLong(readBuffer, 32),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
short parameterType =
readConstField(
- "parameterType", readUnsignedShort(readBuffer, 7), PcDcp_Pdu_DelayReq.PARAMETERTYPE);
+ "parameterType",
+ readUnsignedShort(readBuffer, 7),
+ PcDcp_Pdu_DelayReq.PARAMETERTYPE,
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
int parameterLength =
readConstField(
- "parameterLength", readUnsignedInt(readBuffer, 9), PcDcp_Pdu_DelayReq.PARAMETERLENGTH);
+ "parameterLength",
+ readUnsignedInt(readBuffer, 9),
+ PcDcp_Pdu_DelayReq.PARAMETERLENGTH,
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
MacAddress portMacAddress =
readSimpleField(
"portMacAddress",
- new DataReaderComplexDefault<>(() -> MacAddress.staticParse(readBuffer), readBuffer));
+ new DataReaderComplexDefault<>(() -> MacAddress.staticParse(readBuffer), readBuffer),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
short endType =
- readConstField("endType", readUnsignedShort(readBuffer, 7), PcDcp_Pdu_DelayReq.ENDTYPE);
+ readConstField(
+ "endType",
+ readUnsignedShort(readBuffer, 7),
+ PcDcp_Pdu_DelayReq.ENDTYPE,
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
int endLength =
- readConstField("endLength", readUnsignedInt(readBuffer, 9), PcDcp_Pdu_DelayReq.ENDLENGTH);
+ readConstField(
+ "endLength",
+ readUnsignedInt(readBuffer, 9),
+ PcDcp_Pdu_DelayReq.ENDLENGTH,
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
readBuffer.closeContext("PcDcp_Pdu_DelayReq");
// Create the instance
diff --git a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnDcp_Block.java b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnDcp_Block.java
index 1d067e7ebb..9375dcff2b 100644
--- a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnDcp_Block.java
+++ b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnDcp_Block.java
@@ -63,15 +63,24 @@ public abstract class PnDcp_Block implements Message {
new DataWriterEnumDefault<>(
PnDcp_BlockOptions::getValue,
PnDcp_BlockOptions::name,
- writeUnsignedShort(writeBuffer, 8)));
+ writeUnsignedShort(writeBuffer, 8)),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Discriminator Field (suboption) (Used as input to a switch field)
- writeDiscriminatorField("suboption", getSuboption(), writeUnsignedShort(writeBuffer, 8));
+ writeDiscriminatorField(
+ "suboption",
+ getSuboption(),
+ writeUnsignedShort(writeBuffer, 8),
+ 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));
+ writeImplicitField(
+ "blockLength",
+ blockLength,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Switch field (Serialize the sub-type)
serializePnDcp_BlockChild(writeBuffer);
@@ -121,11 +130,20 @@ public abstract class PnDcp_Block implements Message {
readDiscriminatorField(
"option",
new DataReaderEnumDefault<>(
- PnDcp_BlockOptions::enumForValue, readUnsignedShort(readBuffer, 8)));
+ PnDcp_BlockOptions::enumForValue, readUnsignedShort(readBuffer, 8)),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
- short suboption = readDiscriminatorField("suboption", readUnsignedShort(readBuffer, 8));
-
- int blockLength = readImplicitField("blockLength", readUnsignedInt(readBuffer, 16));
+ short suboption =
+ readDiscriminatorField(
+ "suboption",
+ readUnsignedShort(readBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ int blockLength =
+ readImplicitField(
+ "blockLength",
+ readUnsignedInt(readBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Switch Field (Depending on the discriminator values, passes the instantiation to a sub-type)
PnDcp_BlockBuilder builder = null;
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 aed02e84ee..8c67332c28 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
@@ -75,10 +75,15 @@ public class PnDcp_Block_DevicePropertiesAliasName extends PnDcp_Block implement
writeReservedField(
"reserved",
reservedField0 != null ? reservedField0 : (int) 0x0000,
- writeUnsignedInt(writeBuffer, 16));
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Array Field (aliasNameValue)
- writeByteArrayField("aliasNameValue", aliasNameValue, writeByteArray(writeBuffer, 8));
+ writeByteArrayField(
+ "aliasNameValue",
+ aliasNameValue,
+ writeByteArray(writeBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Padding Field (padding)
writePaddingField(
@@ -88,7 +93,8 @@ public class PnDcp_Block_DevicePropertiesAliasName extends PnDcp_Block implement
aliasNameValue))
% (2)),
(short) 0x00,
- writeUnsignedShort(writeBuffer, 8));
+ writeUnsignedShort(writeBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
writeBuffer.popContext("PnDcp_Block_DevicePropertiesAliasName");
}
@@ -134,17 +140,25 @@ public class PnDcp_Block_DevicePropertiesAliasName extends PnDcp_Block implement
boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get();
Integer reservedField0 =
- readReservedField("reserved", readUnsignedInt(readBuffer, 16), (int) 0x0000);
+ readReservedField(
+ "reserved",
+ readUnsignedInt(readBuffer, 16),
+ (int) 0x0000,
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
byte[] aliasNameValue =
- readBuffer.readByteArray("aliasNameValue", Math.toIntExact((blockLength) - (2)));
+ readBuffer.readByteArray(
+ "aliasNameValue",
+ Math.toIntExact((blockLength) - (2)),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
readPaddingField(
readUnsignedShort(readBuffer, 8),
(int)
((org.apache.plc4x.java.profinet.readwrite.utils.StaticHelper.arrayLength(
aliasNameValue))
- % (2)));
+ % (2)),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
readBuffer.closeContext("PnDcp_Block_DevicePropertiesAliasName");
// Create the instance
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 00e4a8e8d8..eb1ee6d2f9 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
@@ -78,13 +78,22 @@ public class PnDcp_Block_DevicePropertiesDeviceId extends PnDcp_Block implements
writeReservedField(
"reserved",
reservedField0 != null ? reservedField0 : (int) 0x0000,
- writeUnsignedInt(writeBuffer, 16));
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Simple Field (vendorId)
- writeSimpleField("vendorId", vendorId, writeUnsignedInt(writeBuffer, 16));
+ writeSimpleField(
+ "vendorId",
+ vendorId,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Simple Field (deviceId)
- writeSimpleField("deviceId", deviceId, writeUnsignedInt(writeBuffer, 16));
+ writeSimpleField(
+ "deviceId",
+ deviceId,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
writeBuffer.popContext("PnDcp_Block_DevicePropertiesDeviceId");
}
@@ -121,11 +130,23 @@ public class PnDcp_Block_DevicePropertiesDeviceId extends PnDcp_Block implements
boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get();
Integer reservedField0 =
- readReservedField("reserved", readUnsignedInt(readBuffer, 16), (int) 0x0000);
-
- int vendorId = readSimpleField("vendorId", readUnsignedInt(readBuffer, 16));
-
- int deviceId = readSimpleField("deviceId", readUnsignedInt(readBuffer, 16));
+ readReservedField(
+ "reserved",
+ readUnsignedInt(readBuffer, 16),
+ (int) 0x0000,
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ int vendorId =
+ readSimpleField(
+ "vendorId",
+ readUnsignedInt(readBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ int deviceId =
+ readSimpleField(
+ "deviceId",
+ readUnsignedInt(readBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
readBuffer.closeContext("PnDcp_Block_DevicePropertiesDeviceId");
// Create the instance
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 16b54e4044..82257857da 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
@@ -79,13 +79,22 @@ public class PnDcp_Block_DevicePropertiesDeviceInstance extends PnDcp_Block impl
writeReservedField(
"reserved",
reservedField0 != null ? reservedField0 : (int) 0x0000,
- writeUnsignedInt(writeBuffer, 16));
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Simple Field (deviceInstanceHigh)
- writeSimpleField("deviceInstanceHigh", deviceInstanceHigh, writeUnsignedShort(writeBuffer, 8));
+ writeSimpleField(
+ "deviceInstanceHigh",
+ deviceInstanceHigh,
+ writeUnsignedShort(writeBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Simple Field (deviceInstanceLow)
- writeSimpleField("deviceInstanceLow", deviceInstanceLow, writeUnsignedShort(writeBuffer, 8));
+ writeSimpleField(
+ "deviceInstanceLow",
+ deviceInstanceLow,
+ writeUnsignedShort(writeBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
writeBuffer.popContext("PnDcp_Block_DevicePropertiesDeviceInstance");
}
@@ -122,13 +131,23 @@ public class PnDcp_Block_DevicePropertiesDeviceInstance extends PnDcp_Block impl
boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get();
Integer reservedField0 =
- readReservedField("reserved", readUnsignedInt(readBuffer, 16), (int) 0x0000);
+ readReservedField(
+ "reserved",
+ readUnsignedInt(readBuffer, 16),
+ (int) 0x0000,
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
short deviceInstanceHigh =
- readSimpleField("deviceInstanceHigh", readUnsignedShort(readBuffer, 8));
+ readSimpleField(
+ "deviceInstanceHigh",
+ readUnsignedShort(readBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
short deviceInstanceLow =
- readSimpleField("deviceInstanceLow", readUnsignedShort(readBuffer, 8));
+ readSimpleField(
+ "deviceInstanceLow",
+ readUnsignedShort(readBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
readBuffer.closeContext("PnDcp_Block_DevicePropertiesDeviceInstance");
// Create the instance
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 6fa9ff7c12..cad2ebdb24 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
@@ -76,10 +76,15 @@ public class PnDcp_Block_DevicePropertiesDeviceOptions extends PnDcp_Block imple
writeReservedField(
"reserved",
reservedField0 != null ? reservedField0 : (int) 0x0000,
- writeUnsignedInt(writeBuffer, 16));
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Array Field (supportedOptions)
- writeComplexTypeArrayField("supportedOptions", supportedOptions, writeBuffer);
+ writeComplexTypeArrayField(
+ "supportedOptions",
+ supportedOptions,
+ writeBuffer,
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
writeBuffer.popContext("PnDcp_Block_DevicePropertiesDeviceOptions");
}
@@ -117,14 +122,19 @@ public class PnDcp_Block_DevicePropertiesDeviceOptions extends PnDcp_Block imple
boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get();
Integer reservedField0 =
- readReservedField("reserved", readUnsignedInt(readBuffer, 16), (int) 0x0000);
+ readReservedField(
+ "reserved",
+ readUnsignedInt(readBuffer, 16),
+ (int) 0x0000,
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
List<PnDcp_SupportedDeviceOption> supportedOptions =
readLengthArrayField(
"supportedOptions",
new DataReaderComplexDefault<>(
() -> PnDcp_SupportedDeviceOption.staticParse(readBuffer), readBuffer),
- (blockLength) - (2));
+ (blockLength) - (2),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
readBuffer.closeContext("PnDcp_Block_DevicePropertiesDeviceOptions");
// Create the instance
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 8804e1b437..9a0bc9a186 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
@@ -92,25 +92,43 @@ public class PnDcp_Block_DevicePropertiesDeviceRole extends PnDcp_Block implemen
writeReservedField(
"reserved",
reservedField0 != null ? reservedField0 : (long) 0x000000,
- writeUnsignedLong(writeBuffer, 20));
+ writeUnsignedLong(writeBuffer, 20),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Simple Field (pnioSupervisor)
- writeSimpleField("pnioSupervisor", pnioSupervisor, writeBoolean(writeBuffer));
+ writeSimpleField(
+ "pnioSupervisor",
+ pnioSupervisor,
+ writeBoolean(writeBuffer),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Simple Field (pnioMultidevive)
- writeSimpleField("pnioMultidevive", pnioMultidevive, writeBoolean(writeBuffer));
+ writeSimpleField(
+ "pnioMultidevive",
+ pnioMultidevive,
+ writeBoolean(writeBuffer),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Simple Field (pnioController)
- writeSimpleField("pnioController", pnioController, writeBoolean(writeBuffer));
+ writeSimpleField(
+ "pnioController",
+ pnioController,
+ writeBoolean(writeBuffer),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Simple Field (pnioDevice)
- writeSimpleField("pnioDevice", pnioDevice, writeBoolean(writeBuffer));
+ writeSimpleField(
+ "pnioDevice",
+ pnioDevice,
+ writeBoolean(writeBuffer),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Reserved Field (reserved)
writeReservedField(
"reserved",
reservedField1 != null ? reservedField1 : (short) 0x00,
- writeUnsignedShort(writeBuffer, 8));
+ writeUnsignedShort(writeBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
writeBuffer.popContext("PnDcp_Block_DevicePropertiesDeviceRole");
}
@@ -156,18 +174,40 @@ public class PnDcp_Block_DevicePropertiesDeviceRole extends PnDcp_Block implemen
boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get();
Long reservedField0 =
- readReservedField("reserved", readUnsignedLong(readBuffer, 20), (long) 0x000000);
-
- boolean pnioSupervisor = readSimpleField("pnioSupervisor", readBoolean(readBuffer));
-
- boolean pnioMultidevive = readSimpleField("pnioMultidevive", readBoolean(readBuffer));
-
- boolean pnioController = readSimpleField("pnioController", readBoolean(readBuffer));
-
- boolean pnioDevice = readSimpleField("pnioDevice", readBoolean(readBuffer));
+ readReservedField(
+ "reserved",
+ readUnsignedLong(readBuffer, 20),
+ (long) 0x000000,
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ boolean pnioSupervisor =
+ readSimpleField(
+ "pnioSupervisor",
+ readBoolean(readBuffer),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ boolean pnioMultidevive =
+ readSimpleField(
+ "pnioMultidevive",
+ readBoolean(readBuffer),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ boolean pnioController =
+ readSimpleField(
+ "pnioController",
+ readBoolean(readBuffer),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ boolean pnioDevice =
+ readSimpleField(
+ "pnioDevice", readBoolean(readBuffer), WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
Short reservedField1 =
- readReservedField("reserved", readUnsignedShort(readBuffer, 8), (short) 0x00);
+ readReservedField(
+ "reserved",
+ readUnsignedShort(readBuffer, 8),
+ (short) 0x00,
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
readBuffer.closeContext("PnDcp_Block_DevicePropertiesDeviceRole");
// Create the instance
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 0394d6aed5..f02caa6c00 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
@@ -75,10 +75,15 @@ public class PnDcp_Block_DevicePropertiesDeviceVendor extends PnDcp_Block implem
writeReservedField(
"reserved",
reservedField0 != null ? reservedField0 : (int) 0x0000,
- writeUnsignedInt(writeBuffer, 16));
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Array Field (deviceVendorValue)
- writeByteArrayField("deviceVendorValue", deviceVendorValue, writeByteArray(writeBuffer, 8));
+ writeByteArrayField(
+ "deviceVendorValue",
+ deviceVendorValue,
+ writeByteArray(writeBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Padding Field (padding)
writePaddingField(
@@ -88,7 +93,8 @@ public class PnDcp_Block_DevicePropertiesDeviceVendor extends PnDcp_Block implem
deviceVendorValue))
% (2)),
(short) 0x00,
- writeUnsignedShort(writeBuffer, 8));
+ writeUnsignedShort(writeBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
writeBuffer.popContext("PnDcp_Block_DevicePropertiesDeviceVendor");
}
@@ -134,17 +140,25 @@ public class PnDcp_Block_DevicePropertiesDeviceVendor extends PnDcp_Block implem
boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get();
Integer reservedField0 =
- readReservedField("reserved", readUnsignedInt(readBuffer, 16), (int) 0x0000);
+ readReservedField(
+ "reserved",
+ readUnsignedInt(readBuffer, 16),
+ (int) 0x0000,
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
byte[] deviceVendorValue =
- readBuffer.readByteArray("deviceVendorValue", Math.toIntExact((blockLength) - (2)));
+ readBuffer.readByteArray(
+ "deviceVendorValue",
+ Math.toIntExact((blockLength) - (2)),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
readPaddingField(
readUnsignedShort(readBuffer, 8),
(int)
((org.apache.plc4x.java.profinet.readwrite.utils.StaticHelper.arrayLength(
deviceVendorValue))
- % (2)));
+ % (2)),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
readBuffer.closeContext("PnDcp_Block_DevicePropertiesDeviceVendor");
// Create the instance
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 cbd068d825..619a6fe35c 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
@@ -75,10 +75,15 @@ public class PnDcp_Block_DevicePropertiesNameOfStation extends PnDcp_Block imple
writeReservedField(
"reserved",
reservedField0 != null ? reservedField0 : (int) 0x0000,
- writeUnsignedInt(writeBuffer, 16));
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Array Field (nameOfStation)
- writeByteArrayField("nameOfStation", nameOfStation, writeByteArray(writeBuffer, 8));
+ writeByteArrayField(
+ "nameOfStation",
+ nameOfStation,
+ writeByteArray(writeBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Padding Field (padding)
writePaddingField(
@@ -88,7 +93,8 @@ public class PnDcp_Block_DevicePropertiesNameOfStation extends PnDcp_Block imple
nameOfStation))
% (2)),
(short) 0x00,
- writeUnsignedShort(writeBuffer, 8));
+ writeUnsignedShort(writeBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
writeBuffer.popContext("PnDcp_Block_DevicePropertiesNameOfStation");
}
@@ -134,17 +140,25 @@ public class PnDcp_Block_DevicePropertiesNameOfStation extends PnDcp_Block imple
boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get();
Integer reservedField0 =
- readReservedField("reserved", readUnsignedInt(readBuffer, 16), (int) 0x0000);
+ readReservedField(
+ "reserved",
+ readUnsignedInt(readBuffer, 16),
+ (int) 0x0000,
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
byte[] nameOfStation =
- readBuffer.readByteArray("nameOfStation", Math.toIntExact((blockLength) - (2)));
+ readBuffer.readByteArray(
+ "nameOfStation",
+ Math.toIntExact((blockLength) - (2)),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
readPaddingField(
readUnsignedShort(readBuffer, 8),
(int)
((org.apache.plc4x.java.profinet.readwrite.utils.StaticHelper.arrayLength(
nameOfStation))
- % (2)));
+ % (2)),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
readBuffer.closeContext("PnDcp_Block_DevicePropertiesNameOfStation");
// Create the instance
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 15df4feceb..c2dabd7a74 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
@@ -72,10 +72,15 @@ public class PnDcp_Block_IpMacAddress extends PnDcp_Block implements Message {
writeReservedField(
"reserved",
reservedField0 != null ? reservedField0 : (int) 0x0000,
- writeUnsignedInt(writeBuffer, 16));
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Simple Field (macAddress)
- writeSimpleField("macAddress", macAddress, new DataWriterComplexDefault<>(writeBuffer));
+ writeSimpleField(
+ "macAddress",
+ macAddress,
+ new DataWriterComplexDefault<>(writeBuffer),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
writeBuffer.popContext("PnDcp_Block_IpMacAddress");
}
@@ -109,12 +114,17 @@ public class PnDcp_Block_IpMacAddress extends PnDcp_Block implements Message {
boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get();
Integer reservedField0 =
- readReservedField("reserved", readUnsignedInt(readBuffer, 16), (int) 0x0000);
+ readReservedField(
+ "reserved",
+ readUnsignedInt(readBuffer, 16),
+ (int) 0x0000,
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
MacAddress macAddress =
readSimpleField(
"macAddress",
- new DataReaderComplexDefault<>(() -> MacAddress.staticParse(readBuffer), readBuffer));
+ new DataReaderComplexDefault<>(() -> MacAddress.staticParse(readBuffer), readBuffer),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
readBuffer.closeContext("PnDcp_Block_IpMacAddress");
// Create the instance
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 e3fcc1e170..affe678ab3 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
@@ -109,31 +109,57 @@ public class PnDcp_Block_IpParameter extends PnDcp_Block implements Message {
writeReservedField(
"reserved",
reservedField0 != null ? reservedField0 : (short) 0x00,
- writeUnsignedShort(writeBuffer, 8));
+ writeUnsignedShort(writeBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Simple Field (ipConflictDetected)
- writeSimpleField("ipConflictDetected", ipConflictDetected, writeBoolean(writeBuffer));
+ writeSimpleField(
+ "ipConflictDetected",
+ ipConflictDetected,
+ writeBoolean(writeBuffer),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Reserved Field (reserved)
writeReservedField(
"reserved",
reservedField1 != null ? reservedField1 : (short) 0x00,
- writeUnsignedShort(writeBuffer, 5));
+ writeUnsignedShort(writeBuffer, 5),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Simple Field (setViaDhcp)
- writeSimpleField("setViaDhcp", setViaDhcp, writeBoolean(writeBuffer));
+ writeSimpleField(
+ "setViaDhcp",
+ setViaDhcp,
+ writeBoolean(writeBuffer),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Simple Field (setManually)
- writeSimpleField("setManually", setManually, writeBoolean(writeBuffer));
+ writeSimpleField(
+ "setManually",
+ setManually,
+ writeBoolean(writeBuffer),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Array Field (ipAddress)
- writeByteArrayField("ipAddress", ipAddress, writeByteArray(writeBuffer, 8));
+ writeByteArrayField(
+ "ipAddress",
+ ipAddress,
+ writeByteArray(writeBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Array Field (subnetMask)
- writeByteArrayField("subnetMask", subnetMask, writeByteArray(writeBuffer, 8));
+ writeByteArrayField(
+ "subnetMask",
+ subnetMask,
+ writeByteArray(writeBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Array Field (standardGateway)
- writeByteArrayField("standardGateway", standardGateway, writeByteArray(writeBuffer, 8));
+ writeByteArrayField(
+ "standardGateway",
+ standardGateway,
+ writeByteArray(writeBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
writeBuffer.popContext("PnDcp_Block_IpParameter");
}
@@ -191,22 +217,44 @@ public class PnDcp_Block_IpParameter extends PnDcp_Block implements Message {
boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get();
Short reservedField0 =
- readReservedField("reserved", readUnsignedShort(readBuffer, 8), (short) 0x00);
-
- boolean ipConflictDetected = readSimpleField("ipConflictDetected", readBoolean(readBuffer));
+ readReservedField(
+ "reserved",
+ readUnsignedShort(readBuffer, 8),
+ (short) 0x00,
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ boolean ipConflictDetected =
+ readSimpleField(
+ "ipConflictDetected",
+ readBoolean(readBuffer),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
Short reservedField1 =
- readReservedField("reserved", readUnsignedShort(readBuffer, 5), (short) 0x00);
-
- boolean setViaDhcp = readSimpleField("setViaDhcp", readBoolean(readBuffer));
-
- boolean setManually = readSimpleField("setManually", readBoolean(readBuffer));
-
- byte[] ipAddress = readBuffer.readByteArray("ipAddress", Math.toIntExact(4));
-
- byte[] subnetMask = readBuffer.readByteArray("subnetMask", Math.toIntExact(4));
-
- byte[] standardGateway = readBuffer.readByteArray("standardGateway", Math.toIntExact(4));
+ readReservedField(
+ "reserved",
+ readUnsignedShort(readBuffer, 5),
+ (short) 0x00,
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ boolean setViaDhcp =
+ readSimpleField(
+ "setViaDhcp", readBoolean(readBuffer), WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ boolean setManually =
+ readSimpleField(
+ "setManually", readBoolean(readBuffer), WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ byte[] ipAddress =
+ readBuffer.readByteArray(
+ "ipAddress", Math.toIntExact(4), WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ byte[] subnetMask =
+ readBuffer.readByteArray(
+ "subnetMask", Math.toIntExact(4), WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ byte[] standardGateway =
+ readBuffer.readByteArray(
+ "standardGateway", Math.toIntExact(4), WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
readBuffer.closeContext("PnDcp_Block_IpParameter");
// Create the instance
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 3422cefe19..fecec26267 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
@@ -66,7 +66,11 @@ public abstract class PnDcp_Pdu implements Message {
writeBuffer.pushContext("PnDcp_Pdu");
// Simple Field (frameIdValue)
- writeSimpleField("frameIdValue", frameIdValue, writeUnsignedInt(writeBuffer, 16));
+ writeSimpleField(
+ "frameIdValue",
+ frameIdValue,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Virtual field (doesn't actually serialize anything, just makes the value available)
PnDcp_FrameId frameId = getFrameId();
@@ -111,12 +115,17 @@ public abstract class PnDcp_Pdu implements Message {
int curPos;
boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get();
- int frameIdValue = readSimpleField("frameIdValue", readUnsignedInt(readBuffer, 16));
+ int frameIdValue =
+ readSimpleField(
+ "frameIdValue",
+ readUnsignedInt(readBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
PnDcp_FrameId frameId =
readVirtualField(
"frameId",
PnDcp_FrameId.class,
- org.apache.plc4x.java.profinet.readwrite.utils.StaticHelper.getFrameId(frameIdValue));
+ org.apache.plc4x.java.profinet.readwrite.utils.StaticHelper.getFrameId(frameIdValue),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Switch Field (Depending on the discriminator values, passes the instantiation to a sub-type)
PnDcp_PduBuilder builder = null;
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
index b07d37ce1c..0bed18c4a9 100644
--- 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
@@ -117,36 +117,76 @@ public class PnDcp_Pdu_AlarmLow extends PnDcp_Pdu implements Message {
writeBuffer.pushContext("PnDcp_Pdu_AlarmLow");
// Simple Field (alarmDstEndpoint)
- writeSimpleField("alarmDstEndpoint", alarmDstEndpoint, writeUnsignedInt(writeBuffer, 16));
+ writeSimpleField(
+ "alarmDstEndpoint",
+ alarmDstEndpoint,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Simple Field (alarmSrcEndpoint)
- writeSimpleField("alarmSrcEndpoint", alarmSrcEndpoint, writeUnsignedInt(writeBuffer, 16));
+ writeSimpleField(
+ "alarmSrcEndpoint",
+ alarmSrcEndpoint,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Simple Field (version)
- writeSimpleField("version", version, writeUnsignedByte(writeBuffer, 4));
+ writeSimpleField(
+ "version",
+ version,
+ writeUnsignedByte(writeBuffer, 4),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Simple Field (errorType)
- writeSimpleField("errorType", errorType, writeUnsignedByte(writeBuffer, 4));
+ writeSimpleField(
+ "errorType",
+ errorType,
+ writeUnsignedByte(writeBuffer, 4),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Simple Field (tAck)
- writeSimpleField("tAck", tAck, writeUnsignedByte(writeBuffer, 4));
+ writeSimpleField(
+ "tAck",
+ tAck,
+ writeUnsignedByte(writeBuffer, 4),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Simple Field (windowSize)
- writeSimpleField("windowSize", windowSize, writeUnsignedByte(writeBuffer, 4));
+ writeSimpleField(
+ "windowSize",
+ windowSize,
+ writeUnsignedByte(writeBuffer, 4),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Simple Field (senSeqNum)
- writeSimpleField("senSeqNum", senSeqNum, writeUnsignedInt(writeBuffer, 16));
+ writeSimpleField(
+ "senSeqNum",
+ senSeqNum,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Simple Field (ackSeqNum)
- writeSimpleField("ackSeqNum", ackSeqNum, writeUnsignedInt(writeBuffer, 16));
+ writeSimpleField(
+ "ackSeqNum",
+ ackSeqNum,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// 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));
+ writeImplicitField(
+ "varPartLen",
+ varPartLen,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Array Field (varPart)
- writeByteArrayField("varPart", varPart, writeByteArray(writeBuffer, 8));
+ writeByteArrayField(
+ "varPart",
+ varPart,
+ writeByteArray(writeBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
writeBuffer.popContext("PnDcp_Pdu_AlarmLow");
}
@@ -205,25 +245,63 @@ public class PnDcp_Pdu_AlarmLow extends PnDcp_Pdu implements Message {
int curPos;
boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get();
- 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));
+ int alarmDstEndpoint =
+ readSimpleField(
+ "alarmDstEndpoint",
+ readUnsignedInt(readBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ int alarmSrcEndpoint =
+ readSimpleField(
+ "alarmSrcEndpoint",
+ readUnsignedInt(readBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ byte version =
+ readSimpleField(
+ "version",
+ readUnsignedByte(readBuffer, 4),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ byte errorType =
+ readSimpleField(
+ "errorType",
+ readUnsignedByte(readBuffer, 4),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ byte tAck =
+ readSimpleField(
+ "tAck",
+ readUnsignedByte(readBuffer, 4),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ byte windowSize =
+ readSimpleField(
+ "windowSize",
+ readUnsignedByte(readBuffer, 4),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ int senSeqNum =
+ readSimpleField(
+ "senSeqNum",
+ readUnsignedInt(readBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ int ackSeqNum =
+ readSimpleField(
+ "ackSeqNum",
+ readUnsignedInt(readBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ int varPartLen =
+ readImplicitField(
+ "varPartLen",
+ readUnsignedInt(readBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ byte[] varPart =
+ readBuffer.readByteArray(
+ "varPart", Math.toIntExact(varPartLen), WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
readBuffer.closeContext("PnDcp_Pdu_AlarmLow");
// Create the instance
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 d72f0e438a..6c685be839 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
@@ -93,39 +93,66 @@ public class PnDcp_Pdu_IdentifyReq extends PnDcp_Pdu implements Message {
writeBuffer.pushContext("PnDcp_Pdu_IdentifyReq");
// Const Field (serviceId)
- writeConstField("serviceId", SERVICEID, writeUnsignedShort(writeBuffer, 8));
+ writeConstField(
+ "serviceId",
+ SERVICEID,
+ writeUnsignedShort(writeBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Reserved Field (reserved)
writeReservedField(
"reserved",
reservedField0 != null ? reservedField0 : (short) 0x00,
- writeUnsignedShort(writeBuffer, 5));
+ writeUnsignedShort(writeBuffer, 5),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Const Field (notSupported)
- writeConstField("notSupported", NOTSUPPORTED, writeBoolean(writeBuffer));
+ writeConstField(
+ "notSupported",
+ NOTSUPPORTED,
+ writeBoolean(writeBuffer),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Reserved Field (reserved)
writeReservedField(
"reserved",
reservedField1 != null ? reservedField1 : (byte) 0x00,
- writeUnsignedByte(writeBuffer, 1));
+ writeUnsignedByte(writeBuffer, 1),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Const Field (response)
- writeConstField("response", RESPONSE, writeBoolean(writeBuffer));
+ writeConstField(
+ "response",
+ RESPONSE,
+ writeBoolean(writeBuffer),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Simple Field (xid)
- writeSimpleField("xid", xid, writeUnsignedLong(writeBuffer, 32));
+ writeSimpleField(
+ "xid",
+ xid,
+ writeUnsignedLong(writeBuffer, 32),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Simple Field (responseDelay)
- writeSimpleField("responseDelay", responseDelay, writeUnsignedInt(writeBuffer, 16));
+ writeSimpleField(
+ "responseDelay",
+ responseDelay,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Implicit Field (dcpDataLength) (Used for parsing, but its value is not stored as it's
// implicitly given by the objects content)
int dcpDataLength = (int) ((getLengthInBytes()) - (12));
- writeImplicitField("dcpDataLength", dcpDataLength, writeUnsignedInt(writeBuffer, 16));
+ writeImplicitField(
+ "dcpDataLength",
+ dcpDataLength,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Array Field (blocks)
- writeComplexTypeArrayField("blocks", blocks, writeBuffer);
+ writeComplexTypeArrayField(
+ "blocks", blocks, writeBuffer, WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
writeBuffer.popContext("PnDcp_Pdu_IdentifyReq");
}
@@ -185,31 +212,63 @@ public class PnDcp_Pdu_IdentifyReq extends PnDcp_Pdu implements Message {
short serviceId =
readConstField(
- "serviceId", readUnsignedShort(readBuffer, 8), PnDcp_Pdu_IdentifyReq.SERVICEID);
+ "serviceId",
+ readUnsignedShort(readBuffer, 8),
+ PnDcp_Pdu_IdentifyReq.SERVICEID,
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
Short reservedField0 =
- readReservedField("reserved", readUnsignedShort(readBuffer, 5), (short) 0x00);
+ readReservedField(
+ "reserved",
+ readUnsignedShort(readBuffer, 5),
+ (short) 0x00,
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
boolean notSupported =
- readConstField("notSupported", readBoolean(readBuffer), PnDcp_Pdu_IdentifyReq.NOTSUPPORTED);
+ readConstField(
+ "notSupported",
+ readBoolean(readBuffer),
+ PnDcp_Pdu_IdentifyReq.NOTSUPPORTED,
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
Byte reservedField1 =
- readReservedField("reserved", readUnsignedByte(readBuffer, 1), (byte) 0x00);
+ readReservedField(
+ "reserved",
+ readUnsignedByte(readBuffer, 1),
+ (byte) 0x00,
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
boolean response =
- readConstField("response", readBoolean(readBuffer), PnDcp_Pdu_IdentifyReq.RESPONSE);
-
- long xid = readSimpleField("xid", readUnsignedLong(readBuffer, 32));
-
- int responseDelay = readSimpleField("responseDelay", readUnsignedInt(readBuffer, 16));
-
- int dcpDataLength = readImplicitField("dcpDataLength", readUnsignedInt(readBuffer, 16));
+ readConstField(
+ "response",
+ readBoolean(readBuffer),
+ PnDcp_Pdu_IdentifyReq.RESPONSE,
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ long xid =
+ readSimpleField(
+ "xid",
+ readUnsignedLong(readBuffer, 32),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ int responseDelay =
+ readSimpleField(
+ "responseDelay",
+ readUnsignedInt(readBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ int dcpDataLength =
+ readImplicitField(
+ "dcpDataLength",
+ readUnsignedInt(readBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
List<PnDcp_Block> blocks =
readLengthArrayField(
"blocks",
new DataReaderComplexDefault<>(() -> PnDcp_Block.staticParse(readBuffer), readBuffer),
- dcpDataLength);
+ dcpDataLength,
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
readBuffer.closeContext("PnDcp_Pdu_IdentifyReq");
// Create the instance
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 cbb3379cd3..14217e1eb2 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
@@ -89,42 +89,66 @@ public class PnDcp_Pdu_IdentifyRes extends PnDcp_Pdu implements Message {
writeBuffer.pushContext("PnDcp_Pdu_IdentifyRes");
// Const Field (serviceId)
- writeConstField("serviceId", SERVICEID, writeUnsignedShort(writeBuffer, 8));
+ writeConstField(
+ "serviceId",
+ SERVICEID,
+ writeUnsignedShort(writeBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Reserved Field (reserved)
writeReservedField(
"reserved",
reservedField0 != null ? reservedField0 : (short) 0x00,
- writeUnsignedShort(writeBuffer, 5));
+ writeUnsignedShort(writeBuffer, 5),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Simple Field (notSupported)
- writeSimpleField("notSupported", notSupported, writeBoolean(writeBuffer));
+ writeSimpleField(
+ "notSupported",
+ notSupported,
+ writeBoolean(writeBuffer),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Reserved Field (reserved)
writeReservedField(
"reserved",
reservedField1 != null ? reservedField1 : (byte) 0x00,
- writeUnsignedByte(writeBuffer, 1));
+ writeUnsignedByte(writeBuffer, 1),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Const Field (response)
- writeConstField("response", RESPONSE, writeBoolean(writeBuffer));
+ writeConstField(
+ "response",
+ RESPONSE,
+ writeBoolean(writeBuffer),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Simple Field (xid)
- writeSimpleField("xid", xid, writeUnsignedLong(writeBuffer, 32));
+ writeSimpleField(
+ "xid",
+ xid,
+ writeUnsignedLong(writeBuffer, 32),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Reserved Field (reserved)
writeReservedField(
"reserved",
reservedField2 != null ? reservedField2 : (int) 0x0000,
- writeUnsignedInt(writeBuffer, 16));
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Implicit Field (dcpDataLength) (Used for parsing, but its value is not stored as it's
// implicitly given by the objects content)
int dcpDataLength = (int) ((getLengthInBytes()) - (12));
- writeImplicitField("dcpDataLength", dcpDataLength, writeUnsignedInt(writeBuffer, 16));
+ writeImplicitField(
+ "dcpDataLength",
+ dcpDataLength,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Array Field (blocks)
- writeComplexTypeArrayField("blocks", blocks, writeBuffer);
+ writeComplexTypeArrayField(
+ "blocks", blocks, writeBuffer, WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
writeBuffer.popContext("PnDcp_Pdu_IdentifyRes");
}
@@ -184,31 +208,63 @@ public class PnDcp_Pdu_IdentifyRes extends PnDcp_Pdu implements Message {
short serviceId =
readConstField(
- "serviceId", readUnsignedShort(readBuffer, 8), PnDcp_Pdu_IdentifyRes.SERVICEID);
+ "serviceId",
+ readUnsignedShort(readBuffer, 8),
+ PnDcp_Pdu_IdentifyRes.SERVICEID,
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
Short reservedField0 =
- readReservedField("reserved", readUnsignedShort(readBuffer, 5), (short) 0x00);
-
- boolean notSupported = readSimpleField("notSupported", readBoolean(readBuffer));
+ readReservedField(
+ "reserved",
+ readUnsignedShort(readBuffer, 5),
+ (short) 0x00,
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ boolean notSupported =
+ readSimpleField(
+ "notSupported",
+ readBoolean(readBuffer),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
Byte reservedField1 =
- readReservedField("reserved", readUnsignedByte(readBuffer, 1), (byte) 0x00);
+ readReservedField(
+ "reserved",
+ readUnsignedByte(readBuffer, 1),
+ (byte) 0x00,
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
boolean response =
- readConstField("response", readBoolean(readBuffer), PnDcp_Pdu_IdentifyRes.RESPONSE);
+ readConstField(
+ "response",
+ readBoolean(readBuffer),
+ PnDcp_Pdu_IdentifyRes.RESPONSE,
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
- long xid = readSimpleField("xid", readUnsignedLong(readBuffer, 32));
+ long xid =
+ readSimpleField(
+ "xid",
+ readUnsignedLong(readBuffer, 32),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
Integer reservedField2 =
- readReservedField("reserved", readUnsignedInt(readBuffer, 16), (int) 0x0000);
-
- int dcpDataLength = readImplicitField("dcpDataLength", readUnsignedInt(readBuffer, 16));
+ readReservedField(
+ "reserved",
+ readUnsignedInt(readBuffer, 16),
+ (int) 0x0000,
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ int dcpDataLength =
+ readImplicitField(
+ "dcpDataLength",
+ readUnsignedInt(readBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
List<PnDcp_Block> blocks =
readLengthArrayField(
"blocks",
new DataReaderComplexDefault<>(() -> PnDcp_Block.staticParse(readBuffer), readBuffer),
- dcpDataLength);
+ dcpDataLength,
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
readBuffer.closeContext("PnDcp_Pdu_IdentifyRes");
// Create the instance
diff --git a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnDcp_Pdu_IdentifyRes_Payload.java b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnDcp_Pdu_IdentifyRes_Payload.java
index ec2d0201c4..f06f094d99 100644
--- a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnDcp_Pdu_IdentifyRes_Payload.java
+++ b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnDcp_Pdu_IdentifyRes_Payload.java
@@ -82,24 +82,38 @@ public abstract class PnDcp_Pdu_IdentifyRes_Payload implements Message {
"PnDcp_ServiceId",
getServiceId(),
new DataWriterEnumDefault<>(
- PnDcp_ServiceId::getValue, PnDcp_ServiceId::name, writeUnsignedShort(writeBuffer, 8)));
+ PnDcp_ServiceId::getValue, PnDcp_ServiceId::name, writeUnsignedShort(writeBuffer, 8)),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Simple Field (serviceType)
- writeSimpleField("serviceType", serviceType, new DataWriterComplexDefault<>(writeBuffer));
+ writeSimpleField(
+ "serviceType",
+ serviceType,
+ new DataWriterComplexDefault<>(writeBuffer),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Simple Field (xid)
- writeSimpleField("xid", xid, writeUnsignedLong(writeBuffer, 32));
+ writeSimpleField(
+ "xid",
+ xid,
+ writeUnsignedLong(writeBuffer, 32),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Simple Field (responseDelayFactorOrPadding)
writeSimpleField(
"responseDelayFactorOrPadding",
responseDelayFactorOrPadding,
- writeUnsignedInt(writeBuffer, 16));
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Implicit Field (dcpDataLength) (Used for parsing, but its value is not stored as it's
// implicitly given by the objects content)
int dcpDataLength = (int) ((getLengthInBytes()) - (12));
- writeImplicitField("dcpDataLength", dcpDataLength, writeUnsignedInt(writeBuffer, 16));
+ writeImplicitField(
+ "dcpDataLength",
+ dcpDataLength,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Switch field (Serialize the sub-type)
serializePnDcp_Pdu_IdentifyRes_PayloadChild(writeBuffer);
@@ -156,20 +170,33 @@ public abstract class PnDcp_Pdu_IdentifyRes_Payload implements Message {
readDiscriminatorField(
"serviceId",
new DataReaderEnumDefault<>(
- PnDcp_ServiceId::enumForValue, readUnsignedShort(readBuffer, 8)));
+ PnDcp_ServiceId::enumForValue, readUnsignedShort(readBuffer, 8)),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
PnDcp_ServiceType serviceType =
readSimpleField(
"serviceType",
new DataReaderComplexDefault<>(
- () -> PnDcp_ServiceType.staticParse(readBuffer), readBuffer));
+ () -> PnDcp_ServiceType.staticParse(readBuffer), readBuffer),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
- long xid = readSimpleField("xid", readUnsignedLong(readBuffer, 32));
+ long xid =
+ readSimpleField(
+ "xid",
+ readUnsignedLong(readBuffer, 32),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
int responseDelayFactorOrPadding =
- readSimpleField("responseDelayFactorOrPadding", readUnsignedInt(readBuffer, 16));
-
- int dcpDataLength = readImplicitField("dcpDataLength", readUnsignedInt(readBuffer, 16));
+ readSimpleField(
+ "responseDelayFactorOrPadding",
+ readUnsignedInt(readBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ int dcpDataLength =
+ readImplicitField(
+ "dcpDataLength",
+ readUnsignedInt(readBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Switch Field (Depending on the discriminator values, passes the instantiation to a sub-type)
PnDcp_Pdu_IdentifyRes_PayloadBuilder builder = null;
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 9ed532a12d..898ffdf8f9 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
@@ -120,47 +120,78 @@ public class PnDcp_Pdu_RealTimeCyclic extends PnDcp_Pdu implements Message {
() ->
org.apache.plc4x.java.profinet.readwrite.utils.StaticHelper.writeDataUnit(
writeBuffer, dataUnit),
- writeBuffer);
+ writeBuffer,
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Simple Field (cycleCounter)
- writeSimpleField("cycleCounter", cycleCounter, writeUnsignedInt(writeBuffer, 16));
+ writeSimpleField(
+ "cycleCounter",
+ cycleCounter,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Simple Field (ignore)
- writeSimpleField("ignore", ignore, writeBoolean(writeBuffer));
+ writeSimpleField(
+ "ignore",
+ ignore,
+ writeBoolean(writeBuffer),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Reserved Field (reserved)
writeReservedField(
"reserved",
reservedField0 != null ? reservedField0 : (boolean) false,
- writeBoolean(writeBuffer));
+ writeBoolean(writeBuffer),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Simple Field (stationProblemIndicatorOk)
writeSimpleField(
- "stationProblemIndicatorOk", stationProblemIndicatorOk, writeBoolean(writeBuffer));
+ "stationProblemIndicatorOk",
+ stationProblemIndicatorOk,
+ writeBoolean(writeBuffer),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Simple Field (providerStateRun)
- writeSimpleField("providerStateRun", providerStateRun, writeBoolean(writeBuffer));
+ writeSimpleField(
+ "providerStateRun",
+ providerStateRun,
+ writeBoolean(writeBuffer),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Reserved Field (reserved)
writeReservedField(
"reserved",
reservedField1 != null ? reservedField1 : (boolean) false,
- writeBoolean(writeBuffer));
+ writeBoolean(writeBuffer),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Simple Field (dataValid)
- writeSimpleField("dataValid", dataValid, writeBoolean(writeBuffer));
+ writeSimpleField(
+ "dataValid",
+ dataValid,
+ writeBoolean(writeBuffer),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Simple Field (redundancy)
- writeSimpleField("redundancy", redundancy, writeBoolean(writeBuffer));
+ writeSimpleField(
+ "redundancy",
+ redundancy,
+ writeBoolean(writeBuffer),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Simple Field (statePrimary)
- writeSimpleField("statePrimary", statePrimary, writeBoolean(writeBuffer));
+ writeSimpleField(
+ "statePrimary",
+ statePrimary,
+ writeBoolean(writeBuffer),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Reserved Field (reserved)
writeReservedField(
"reserved",
reservedField2 != null ? reservedField2 : (short) 0x00,
- writeUnsignedShort(writeBuffer, 8));
+ writeUnsignedShort(writeBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
writeBuffer.popContext("PnDcp_Pdu_RealTimeCyclic");
}
@@ -227,31 +258,65 @@ public class PnDcp_Pdu_RealTimeCyclic extends PnDcp_Pdu implements Message {
() ->
(PnIo_CyclicServiceDataUnit)
(org.apache.plc4x.java.profinet.readwrite.utils.StaticHelper.readDataUnit(
- readBuffer)));
+ readBuffer)),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
- int cycleCounter = readSimpleField("cycleCounter", readUnsignedInt(readBuffer, 16));
+ int cycleCounter =
+ readSimpleField(
+ "cycleCounter",
+ readUnsignedInt(readBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
- boolean ignore = readSimpleField("ignore", readBoolean(readBuffer));
+ boolean ignore =
+ readSimpleField(
+ "ignore", readBoolean(readBuffer), WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
Boolean reservedField0 =
- readReservedField("reserved", readBoolean(readBuffer), (boolean) false);
+ readReservedField(
+ "reserved",
+ readBoolean(readBuffer),
+ (boolean) false,
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
boolean stationProblemIndicatorOk =
- readSimpleField("stationProblemIndicatorOk", readBoolean(readBuffer));
+ readSimpleField(
+ "stationProblemIndicatorOk",
+ readBoolean(readBuffer),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
- boolean providerStateRun = readSimpleField("providerStateRun", readBoolean(readBuffer));
+ boolean providerStateRun =
+ readSimpleField(
+ "providerStateRun",
+ readBoolean(readBuffer),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
Boolean reservedField1 =
- readReservedField("reserved", readBoolean(readBuffer), (boolean) false);
-
- boolean dataValid = readSimpleField("dataValid", readBoolean(readBuffer));
-
- boolean redundancy = readSimpleField("redundancy", readBoolean(readBuffer));
-
- boolean statePrimary = readSimpleField("statePrimary", readBoolean(readBuffer));
+ readReservedField(
+ "reserved",
+ readBoolean(readBuffer),
+ (boolean) false,
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ boolean dataValid =
+ readSimpleField(
+ "dataValid", readBoolean(readBuffer), WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ boolean redundancy =
+ readSimpleField(
+ "redundancy", readBoolean(readBuffer), WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ boolean statePrimary =
+ readSimpleField(
+ "statePrimary",
+ readBoolean(readBuffer),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
Short reservedField2 =
- readReservedField("reserved", readUnsignedShort(readBuffer, 8), (short) 0x00);
+ readReservedField(
+ "reserved",
+ readUnsignedShort(readBuffer, 8),
+ (short) 0x00,
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
readBuffer.closeContext("PnDcp_Pdu_RealTimeCyclic");
// Create the instance
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 e3d440cdb6..af0bc910a8 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
@@ -69,19 +69,29 @@ public class PnDcp_ServiceType implements Message {
writeReservedField(
"reserved",
reservedField0 != null ? reservedField0 : (short) 0x00,
- writeUnsignedShort(writeBuffer, 5));
+ writeUnsignedShort(writeBuffer, 5),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Simple Field (notSupported)
- writeSimpleField("notSupported", notSupported, writeBoolean(writeBuffer));
+ writeSimpleField(
+ "notSupported",
+ notSupported,
+ writeBoolean(writeBuffer),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Reserved Field (reserved)
writeReservedField(
"reserved",
reservedField1 != null ? reservedField1 : (byte) 0x00,
- writeUnsignedByte(writeBuffer, 1));
+ writeUnsignedByte(writeBuffer, 1),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Simple Field (response)
- writeSimpleField("response", response, writeBoolean(writeBuffer));
+ writeSimpleField(
+ "response",
+ response,
+ writeBoolean(writeBuffer),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
writeBuffer.popContext("PnDcp_ServiceType");
}
@@ -126,14 +136,28 @@ public class PnDcp_ServiceType implements Message {
boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get();
Short reservedField0 =
- readReservedField("reserved", readUnsignedShort(readBuffer, 5), (short) 0x00);
-
- boolean notSupported = readSimpleField("notSupported", readBoolean(readBuffer));
+ readReservedField(
+ "reserved",
+ readUnsignedShort(readBuffer, 5),
+ (short) 0x00,
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ boolean notSupported =
+ readSimpleField(
+ "notSupported",
+ readBoolean(readBuffer),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
Byte reservedField1 =
- readReservedField("reserved", readUnsignedByte(readBuffer, 1), (byte) 0x00);
-
- boolean response = readSimpleField("response", readBoolean(readBuffer));
+ readReservedField(
+ "reserved",
+ readUnsignedByte(readBuffer, 1),
+ (byte) 0x00,
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ boolean response =
+ readSimpleField(
+ "response", readBoolean(readBuffer), WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
readBuffer.closeContext("PnDcp_ServiceType");
// Create the instance
diff --git a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnDcp_SupportedDeviceOption.java b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnDcp_SupportedDeviceOption.java
index 71a62b8e46..6cc94a3b95 100644
--- a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnDcp_SupportedDeviceOption.java
+++ b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnDcp_SupportedDeviceOption.java
@@ -69,10 +69,15 @@ public class PnDcp_SupportedDeviceOption implements Message {
new DataWriterEnumDefault<>(
PnDcp_BlockOptions::getValue,
PnDcp_BlockOptions::name,
- writeUnsignedShort(writeBuffer, 8)));
+ writeUnsignedShort(writeBuffer, 8)),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Simple Field (suboption)
- writeSimpleField("suboption", suboption, writeUnsignedShort(writeBuffer, 8));
+ writeSimpleField(
+ "suboption",
+ suboption,
+ writeUnsignedShort(writeBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
writeBuffer.popContext("PnDcp_SupportedDeviceOption");
}
@@ -116,9 +121,14 @@ public class PnDcp_SupportedDeviceOption implements Message {
"option",
"PnDcp_BlockOptions",
new DataReaderEnumDefault<>(
- PnDcp_BlockOptions::enumForValue, readUnsignedShort(readBuffer, 8)));
-
- short suboption = readSimpleField("suboption", readUnsignedShort(readBuffer, 8));
+ PnDcp_BlockOptions::enumForValue, readUnsignedShort(readBuffer, 8)),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ short suboption =
+ readSimpleField(
+ "suboption",
+ readUnsignedShort(readBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
readBuffer.closeContext("PnDcp_SupportedDeviceOption");
// Create the instance
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
index 4fa3f3cf45..bad7d82aa7 100644
--- 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
@@ -67,10 +67,18 @@ public class PnIoCm_DataUnitDataObject implements Message {
writeBuffer.pushContext("PnIoCm_DataUnitDataObject");
// Array Field (dataState)
- writeByteArrayField("dataState", dataState, writeByteArray(writeBuffer, 8));
+ writeByteArrayField(
+ "dataState",
+ dataState,
+ writeByteArray(writeBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Simple Field (iops)
- writeSimpleField("iops", iops, new DataWriterComplexDefault<>(writeBuffer));
+ writeSimpleField(
+ "iops",
+ iops,
+ new DataWriterComplexDefault<>(writeBuffer),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
writeBuffer.popContext("PnIoCm_DataUnitDataObject");
}
@@ -125,13 +133,18 @@ public class PnIoCm_DataUnitDataObject implements Message {
int curPos;
boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get();
- byte[] dataState = readBuffer.readByteArray("dataState", Math.toIntExact(dataObjectLength));
+ byte[] dataState =
+ readBuffer.readByteArray(
+ "dataState",
+ Math.toIntExact(dataObjectLength),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
PnIoCm_DataUnitIoCs iops =
readSimpleField(
"iops",
new DataReaderComplexDefault<>(
- () -> PnIoCm_DataUnitIoCs.staticParse(readBuffer), readBuffer));
+ () -> PnIoCm_DataUnitIoCs.staticParse(readBuffer), readBuffer),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
readBuffer.closeContext("PnIoCm_DataUnitDataObject");
// Create the instance
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
index 12aab1c257..0e19b3e476 100644
--- 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
@@ -71,19 +71,32 @@ public class PnIoCm_DataUnitIoCs implements Message {
writeBuffer.pushContext("PnIoCm_DataUnitIoCs");
// Simple Field (dataState)
- writeSimpleField("dataState", dataState, writeBoolean(writeBuffer));
+ writeSimpleField(
+ "dataState",
+ dataState,
+ writeBoolean(writeBuffer),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Simple Field (instance)
- writeSimpleField("instance", instance, writeUnsignedByte(writeBuffer, 2));
+ writeSimpleField(
+ "instance",
+ instance,
+ writeUnsignedByte(writeBuffer, 2),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Reserved Field (reserved)
writeReservedField(
"reserved",
reservedField0 != null ? reservedField0 : (byte) 0x00,
- writeUnsignedByte(writeBuffer, 4));
+ writeUnsignedByte(writeBuffer, 4),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Simple Field (extension)
- writeSimpleField("extension", extension, writeBoolean(writeBuffer));
+ writeSimpleField(
+ "extension",
+ extension,
+ writeBoolean(writeBuffer),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
writeBuffer.popContext("PnIoCm_DataUnitIoCs");
}
@@ -127,14 +140,26 @@ public class PnIoCm_DataUnitIoCs implements Message {
int curPos;
boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get();
- boolean dataState = readSimpleField("dataState", readBoolean(readBuffer));
+ boolean dataState =
+ readSimpleField(
+ "dataState", readBoolean(readBuffer), WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
- byte instance = readSimpleField("instance", readUnsignedByte(readBuffer, 2));
+ byte instance =
+ readSimpleField(
+ "instance",
+ readUnsignedByte(readBuffer, 2),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
Byte reservedField0 =
- readReservedField("reserved", readUnsignedByte(readBuffer, 4), (byte) 0x00);
-
- boolean extension = readSimpleField("extension", readBoolean(readBuffer));
+ readReservedField(
+ "reserved",
+ readUnsignedByte(readBuffer, 4),
+ (byte) 0x00,
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ boolean extension =
+ readSimpleField(
+ "extension", readBoolean(readBuffer), WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
readBuffer.closeContext("PnIoCm_DataUnitIoCs");
// Create the instance
diff --git a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_ExpectedSubmoduleBlockReqApi.java b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_ExpectedSubmoduleBlockReqApi.java
index 64640e1538..24b850dfca 100644
--- a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_ExpectedSubmoduleBlockReqApi.java
+++ b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_ExpectedSubmoduleBlockReqApi.java
@@ -85,24 +85,45 @@ public class PnIoCm_ExpectedSubmoduleBlockReqApi implements Message {
writeBuffer.pushContext("PnIoCm_ExpectedSubmoduleBlockReqApi");
// Const Field (api)
- writeConstField("api", API, writeUnsignedLong(writeBuffer, 32));
+ writeConstField(
+ "api",
+ API,
+ writeUnsignedLong(writeBuffer, 32),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Simple Field (slotNumber)
- writeSimpleField("slotNumber", slotNumber, writeUnsignedInt(writeBuffer, 16));
+ writeSimpleField(
+ "slotNumber",
+ slotNumber,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Simple Field (moduleIdentNumber)
- writeSimpleField("moduleIdentNumber", moduleIdentNumber, writeUnsignedLong(writeBuffer, 32));
+ writeSimpleField(
+ "moduleIdentNumber",
+ moduleIdentNumber,
+ writeUnsignedLong(writeBuffer, 32),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Simple Field (moduleProperties)
- writeSimpleField("moduleProperties", moduleProperties, writeUnsignedInt(writeBuffer, 16));
+ writeSimpleField(
+ "moduleProperties",
+ moduleProperties,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Implicit Field (numSubmodules) (Used for parsing, but its value is not stored as it's
// implicitly given by the objects content)
int numSubmodules = (int) (COUNT(getSubmodules()));
- writeImplicitField("numSubmodules", numSubmodules, writeUnsignedInt(writeBuffer, 16));
+ writeImplicitField(
+ "numSubmodules",
+ numSubmodules,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Array Field (submodules)
- writeComplexTypeArrayField("submodules", submodules, writeBuffer);
+ writeComplexTypeArrayField(
+ "submodules", submodules, writeBuffer, WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
writeBuffer.popContext("PnIoCm_ExpectedSubmoduleBlockReqApi");
}
@@ -161,22 +182,42 @@ public class PnIoCm_ExpectedSubmoduleBlockReqApi implements Message {
long api =
readConstField(
- "api", readUnsignedLong(readBuffer, 32), PnIoCm_ExpectedSubmoduleBlockReqApi.API);
-
- int slotNumber = readSimpleField("slotNumber", readUnsignedInt(readBuffer, 16));
-
- long moduleIdentNumber = readSimpleField("moduleIdentNumber", readUnsignedLong(readBuffer, 32));
-
- int moduleProperties = readSimpleField("moduleProperties", readUnsignedInt(readBuffer, 16));
-
- int numSubmodules = readImplicitField("numSubmodules", readUnsignedInt(readBuffer, 16));
+ "api",
+ readUnsignedLong(readBuffer, 32),
+ PnIoCm_ExpectedSubmoduleBlockReqApi.API,
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ int slotNumber =
+ readSimpleField(
+ "slotNumber",
+ readUnsignedInt(readBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ long moduleIdentNumber =
+ readSimpleField(
+ "moduleIdentNumber",
+ readUnsignedLong(readBuffer, 32),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ int moduleProperties =
+ readSimpleField(
+ "moduleProperties",
+ readUnsignedInt(readBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ int numSubmodules =
+ readImplicitField(
+ "numSubmodules",
+ readUnsignedInt(readBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
List<PnIoCm_Submodule> submodules =
readCountArrayField(
"submodules",
new DataReaderComplexDefault<>(
() -> PnIoCm_Submodule.staticParse(readBuffer), readBuffer),
- numSubmodules);
+ numSubmodules,
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
readBuffer.closeContext("PnIoCm_ExpectedSubmoduleBlockReqApi");
// Create the instance
diff --git a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_IoCrBlockReqApi.java b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_IoCrBlockReqApi.java
index f4b764e708..7889fc3250 100644
--- a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_IoCrBlockReqApi.java
+++ b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_IoCrBlockReqApi.java
@@ -69,23 +69,40 @@ public class PnIoCm_IoCrBlockReqApi implements Message {
writeBuffer.pushContext("PnIoCm_IoCrBlockReqApi");
// Const Field (api)
- writeConstField("api", API, writeUnsignedLong(writeBuffer, 32));
+ writeConstField(
+ "api",
+ API,
+ writeUnsignedLong(writeBuffer, 32),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Implicit Field (numIoDataObjects) (Used for parsing, but its value is not stored as it's
// implicitly given by the objects content)
int numIoDataObjects = (int) (COUNT(getIoDataObjects()));
- writeImplicitField("numIoDataObjects", numIoDataObjects, writeUnsignedInt(writeBuffer, 16));
+ writeImplicitField(
+ "numIoDataObjects",
+ numIoDataObjects,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Array Field (ioDataObjects)
- writeComplexTypeArrayField("ioDataObjects", ioDataObjects, writeBuffer);
+ writeComplexTypeArrayField(
+ "ioDataObjects",
+ ioDataObjects,
+ writeBuffer,
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Implicit Field (numIoCss) (Used for parsing, but its value is not stored as it's implicitly
// given by the objects content)
int numIoCss = (int) (COUNT(getIoCss()));
- writeImplicitField("numIoCss", numIoCss, writeUnsignedInt(writeBuffer, 16));
+ writeImplicitField(
+ "numIoCss",
+ numIoCss,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Array Field (ioCss)
- writeComplexTypeArrayField("ioCss", ioCss, writeBuffer);
+ writeComplexTypeArrayField(
+ "ioCss", ioCss, writeBuffer, WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
writeBuffer.popContext("PnIoCm_IoCrBlockReqApi");
}
@@ -144,24 +161,39 @@ public class PnIoCm_IoCrBlockReqApi implements Message {
int curPos;
boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get();
- long api = readConstField("api", readUnsignedLong(readBuffer, 32), PnIoCm_IoCrBlockReqApi.API);
+ long api =
+ readConstField(
+ "api",
+ readUnsignedLong(readBuffer, 32),
+ PnIoCm_IoCrBlockReqApi.API,
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
- int numIoDataObjects = readImplicitField("numIoDataObjects", readUnsignedInt(readBuffer, 16));
+ int numIoDataObjects =
+ readImplicitField(
+ "numIoDataObjects",
+ readUnsignedInt(readBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
List<PnIoCm_IoDataObject> ioDataObjects =
readCountArrayField(
"ioDataObjects",
new DataReaderComplexDefault<>(
() -> PnIoCm_IoDataObject.staticParse(readBuffer), readBuffer),
- numIoDataObjects);
+ numIoDataObjects,
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
- int numIoCss = readImplicitField("numIoCss", readUnsignedInt(readBuffer, 16));
+ int numIoCss =
+ readImplicitField(
+ "numIoCss",
+ readUnsignedInt(readBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
List<PnIoCm_IoCs> ioCss =
readCountArrayField(
"ioCss",
new DataReaderComplexDefault<>(() -> PnIoCm_IoCs.staticParse(readBuffer), readBuffer),
- numIoCss);
+ numIoCss,
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
readBuffer.closeContext("PnIoCm_IoCrBlockReqApi");
// Create the instance
diff --git a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_IoCs.java b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_IoCs.java
index 04132b7ee1..c90dbf2746 100644
--- a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_IoCs.java
+++ b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_IoCs.java
@@ -68,13 +68,25 @@ public class PnIoCm_IoCs implements Message {
writeBuffer.pushContext("PnIoCm_IoCs");
// Simple Field (slotNumber)
- writeSimpleField("slotNumber", slotNumber, writeUnsignedInt(writeBuffer, 16));
+ writeSimpleField(
+ "slotNumber",
+ slotNumber,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Simple Field (subSlotNumber)
- writeSimpleField("subSlotNumber", subSlotNumber, writeUnsignedInt(writeBuffer, 16));
+ writeSimpleField(
+ "subSlotNumber",
+ subSlotNumber,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Simple Field (ioFrameOffset)
- writeSimpleField("ioFrameOffset", ioFrameOffset, writeUnsignedInt(writeBuffer, 16));
+ writeSimpleField(
+ "ioFrameOffset",
+ ioFrameOffset,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
writeBuffer.popContext("PnIoCm_IoCs");
}
@@ -115,11 +127,23 @@ public class PnIoCm_IoCs implements Message {
int curPos;
boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get();
- int slotNumber = readSimpleField("slotNumber", readUnsignedInt(readBuffer, 16));
-
- int subSlotNumber = readSimpleField("subSlotNumber", readUnsignedInt(readBuffer, 16));
-
- int ioFrameOffset = readSimpleField("ioFrameOffset", readUnsignedInt(readBuffer, 16));
+ 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 ioFrameOffset =
+ readSimpleField(
+ "ioFrameOffset",
+ readUnsignedInt(readBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
readBuffer.closeContext("PnIoCm_IoCs");
// Create the instance
diff --git a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_IoDataObject.java b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_IoDataObject.java
index 31b3819139..5c5850dc02 100644
--- a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_IoDataObject.java
+++ b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_IoDataObject.java
@@ -68,14 +68,25 @@ public class PnIoCm_IoDataObject implements Message {
writeBuffer.pushContext("PnIoCm_IoDataObject");
// Simple Field (slotNumber)
- writeSimpleField("slotNumber", slotNumber, writeUnsignedInt(writeBuffer, 16));
+ writeSimpleField(
+ "slotNumber",
+ slotNumber,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Simple Field (subSlotNumber)
- writeSimpleField("subSlotNumber", subSlotNumber, writeUnsignedInt(writeBuffer, 16));
+ writeSimpleField(
+ "subSlotNumber",
+ subSlotNumber,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Simple Field (ioDataObjectFrameOffset)
writeSimpleField(
- "ioDataObjectFrameOffset", ioDataObjectFrameOffset, writeUnsignedInt(writeBuffer, 16));
+ "ioDataObjectFrameOffset",
+ ioDataObjectFrameOffset,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
writeBuffer.popContext("PnIoCm_IoDataObject");
}
@@ -116,12 +127,23 @@ public class PnIoCm_IoDataObject implements Message {
int curPos;
boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get();
- int slotNumber = readSimpleField("slotNumber", readUnsignedInt(readBuffer, 16));
+ int slotNumber =
+ readSimpleField(
+ "slotNumber",
+ readUnsignedInt(readBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
- int subSlotNumber = readSimpleField("subSlotNumber", readUnsignedInt(readBuffer, 16));
+ int subSlotNumber =
+ readSimpleField(
+ "subSlotNumber",
+ readUnsignedInt(readBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
int ioDataObjectFrameOffset =
- readSimpleField("ioDataObjectFrameOffset", readUnsignedInt(readBuffer, 16));
+ readSimpleField(
+ "ioDataObjectFrameOffset",
+ readUnsignedInt(readBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
readBuffer.closeContext("PnIoCm_IoDataObject");
// Create the instance
diff --git a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_Packet.java b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_Packet.java
index 9701b52347..500b2b4811 100644
--- a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_Packet.java
+++ b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_Packet.java
@@ -108,8 +108,14 @@ public abstract class PnIoCm_Packet implements Message {
PnIoCm_PacketBuilder builder = null;
if (EvaluationHelper.equals(packetType, DceRpc_PacketType.REQUEST)) {
builder = PnIoCm_Packet_Req.staticParsePnIoCm_PacketBuilder(readBuffer, packetType);
+ } else if (EvaluationHelper.equals(packetType, DceRpc_PacketType.PING)) {
+ builder = PnIoCm_Packet_Ping.staticParsePnIoCm_PacketBuilder(readBuffer, packetType);
} else if (EvaluationHelper.equals(packetType, DceRpc_PacketType.RESPONSE)) {
builder = PnIoCm_Packet_Res.staticParsePnIoCm_PacketBuilder(readBuffer, packetType);
+ } else if (EvaluationHelper.equals(packetType, DceRpc_PacketType.FAULT)) {
+ builder = PnIoCm_Packet_Fault.staticParsePnIoCm_PacketBuilder(readBuffer, packetType);
+ } else if (EvaluationHelper.equals(packetType, DceRpc_PacketType.NO_CALL)) {
+ builder = PnIoCm_Packet_NoCall.staticParsePnIoCm_PacketBuilder(readBuffer, packetType);
} else if (EvaluationHelper.equals(packetType, DceRpc_PacketType.REJECT)) {
builder = PnIoCm_Packet_Rej.staticParsePnIoCm_PacketBuilder(readBuffer, packetType);
}
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/PnIoCm_Packet_Fault.java
similarity index 58%
copy from plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/UserData.java
copy to plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_Packet_Fault.java
index 1106118f3d..4a4bf7d24b 100644
--- 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/PnIoCm_Packet_Fault.java
@@ -35,34 +35,37 @@ import org.apache.plc4x.java.spi.generation.*;
// Code generated by code-generation. DO NOT EDIT.
-public class UserData implements Message {
+public class PnIoCm_Packet_Fault extends PnIoCm_Packet implements Message {
- // Properties.
- protected final byte[] data;
+ // Accessors for discriminator values.
+ public DceRpc_PacketType getPacketType() {
+ return DceRpc_PacketType.FAULT;
+ }
- // Arguments.
- protected final Long recordDataLength;
+ // Properties.
+ protected final long status;
- public UserData(byte[] data, Long recordDataLength) {
+ public PnIoCm_Packet_Fault(long status) {
super();
- this.data = data;
- this.recordDataLength = recordDataLength;
+ this.status = status;
}
- public byte[] getData() {
- return data;
+ public long getStatus() {
+ return status;
}
- public void serialize(WriteBuffer writeBuffer) throws SerializationException {
+ @Override
+ protected void serializePnIoCm_PacketChild(WriteBuffer writeBuffer)
+ throws SerializationException {
PositionAware positionAware = writeBuffer;
boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get();
int startPos = positionAware.getPos();
- writeBuffer.pushContext("UserData");
+ writeBuffer.pushContext("PnIoCm_Packet_Fault");
- // Array Field (data)
- writeByteArrayField("data", data, writeByteArray(writeBuffer, 8));
+ // Simple Field (status)
+ writeSimpleField("status", status, writeUnsignedLong(writeBuffer, 32));
- writeBuffer.popContext("UserData");
+ writeBuffer.popContext("PnIoCm_Packet_Fault");
}
@Override
@@ -72,52 +75,42 @@ public class UserData implements Message {
@Override
public int getLengthInBits() {
- int lengthInBits = 0;
- UserData _value = this;
+ int lengthInBits = super.getLengthInBits();
+ PnIoCm_Packet_Fault _value = this;
boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get();
- // Array field
- if (data != null) {
- lengthInBits += 8 * data.length;
- }
+ // Simple field (status)
+ lengthInBits += 32;
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");
+ public static PnIoCm_PacketBuilder staticParsePnIoCm_PacketBuilder(
+ ReadBuffer readBuffer, DceRpc_PacketType packetType) throws ParseException {
+ readBuffer.pullContext("PnIoCm_Packet_Fault");
PositionAware positionAware = readBuffer;
int startPos = positionAware.getPos();
int curPos;
boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get();
- byte[] data = readBuffer.readByteArray("data", Math.toIntExact(recordDataLength));
+ long status = readSimpleField("status", readUnsignedLong(readBuffer, 32));
- readBuffer.closeContext("UserData");
+ readBuffer.closeContext("PnIoCm_Packet_Fault");
// Create the instance
- UserData _userData;
- _userData = new UserData(data, recordDataLength);
- return _userData;
+ return new PnIoCm_Packet_FaultBuilderImpl(status);
+ }
+
+ public static class PnIoCm_Packet_FaultBuilderImpl implements PnIoCm_Packet.PnIoCm_PacketBuilder {
+ private final long status;
+
+ public PnIoCm_Packet_FaultBuilderImpl(long status) {
+ this.status = status;
+ }
+
+ public PnIoCm_Packet_Fault build() {
+ PnIoCm_Packet_Fault pnIoCm_Packet_Fault = new PnIoCm_Packet_Fault(status);
+ return pnIoCm_Packet_Fault;
+ }
}
@Override
@@ -125,16 +118,16 @@ public class UserData implements Message {
if (this == o) {
return true;
}
- if (!(o instanceof UserData)) {
+ if (!(o instanceof PnIoCm_Packet_Fault)) {
return false;
}
- UserData that = (UserData) o;
- return (getData() == that.getData()) && true;
+ PnIoCm_Packet_Fault that = (PnIoCm_Packet_Fault) o;
+ return (getStatus() == that.getStatus()) && super.equals(that) && true;
}
@Override
public int hashCode() {
- return Objects.hash(getData());
+ return Objects.hash(super.hashCode(), getStatus());
}
@Override
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/PnIoCm_Packet_NoCall.java
similarity index 57%
copy from plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/UserData.java
copy to plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_Packet_NoCall.java
index 1106118f3d..ed225cd0a3 100644
--- 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/PnIoCm_Packet_NoCall.java
@@ -35,34 +35,26 @@ import org.apache.plc4x.java.spi.generation.*;
// Code generated by code-generation. DO NOT EDIT.
-public class UserData implements Message {
+public class PnIoCm_Packet_NoCall extends PnIoCm_Packet 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;
+ // Accessors for discriminator values.
+ public DceRpc_PacketType getPacketType() {
+ return DceRpc_PacketType.NO_CALL;
}
- public byte[] getData() {
- return data;
+ public PnIoCm_Packet_NoCall() {
+ super();
}
- public void serialize(WriteBuffer writeBuffer) throws SerializationException {
+ @Override
+ protected void serializePnIoCm_PacketChild(WriteBuffer writeBuffer)
+ throws SerializationException {
PositionAware positionAware = writeBuffer;
boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get();
int startPos = positionAware.getPos();
- writeBuffer.pushContext("UserData");
+ writeBuffer.pushContext("PnIoCm_Packet_NoCall");
- // Array Field (data)
- writeByteArrayField("data", data, writeByteArray(writeBuffer, 8));
-
- writeBuffer.popContext("UserData");
+ writeBuffer.popContext("PnIoCm_Packet_NoCall");
}
@Override
@@ -72,52 +64,35 @@ public class UserData implements Message {
@Override
public int getLengthInBits() {
- int lengthInBits = 0;
- UserData _value = this;
+ int lengthInBits = super.getLengthInBits();
+ PnIoCm_Packet_NoCall _value = this;
boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get();
- // 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");
+ public static PnIoCm_PacketBuilder staticParsePnIoCm_PacketBuilder(
+ ReadBuffer readBuffer, DceRpc_PacketType packetType) throws ParseException {
+ readBuffer.pullContext("PnIoCm_Packet_NoCall");
PositionAware positionAware = readBuffer;
int startPos = positionAware.getPos();
int curPos;
boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get();
- byte[] data = readBuffer.readByteArray("data", Math.toIntExact(recordDataLength));
-
- readBuffer.closeContext("UserData");
+ readBuffer.closeContext("PnIoCm_Packet_NoCall");
// Create the instance
- UserData _userData;
- _userData = new UserData(data, recordDataLength);
- return _userData;
+ return new PnIoCm_Packet_NoCallBuilderImpl();
+ }
+
+ public static class PnIoCm_Packet_NoCallBuilderImpl
+ implements PnIoCm_Packet.PnIoCm_PacketBuilder {
+
+ public PnIoCm_Packet_NoCallBuilderImpl() {}
+
+ public PnIoCm_Packet_NoCall build() {
+ PnIoCm_Packet_NoCall pnIoCm_Packet_NoCall = new PnIoCm_Packet_NoCall();
+ return pnIoCm_Packet_NoCall;
+ }
}
@Override
@@ -125,16 +100,16 @@ public class UserData implements Message {
if (this == o) {
return true;
}
- if (!(o instanceof UserData)) {
+ if (!(o instanceof PnIoCm_Packet_NoCall)) {
return false;
}
- UserData that = (UserData) o;
- return (getData() == that.getData()) && true;
+ PnIoCm_Packet_NoCall that = (PnIoCm_Packet_NoCall) o;
+ return super.equals(that) && true;
}
@Override
public int hashCode() {
- return Objects.hash(getData());
+ return Objects.hash(super.hashCode());
}
@Override
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/PnIoCm_Packet_Ping.java
similarity index 57%
copy from plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/UserData.java
copy to plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_Packet_Ping.java
index 1106118f3d..4a20c6201c 100644
--- 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/PnIoCm_Packet_Ping.java
@@ -35,34 +35,26 @@ import org.apache.plc4x.java.spi.generation.*;
// Code generated by code-generation. DO NOT EDIT.
-public class UserData implements Message {
+public class PnIoCm_Packet_Ping extends PnIoCm_Packet 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;
+ // Accessors for discriminator values.
+ public DceRpc_PacketType getPacketType() {
+ return DceRpc_PacketType.PING;
}
- public byte[] getData() {
- return data;
+ public PnIoCm_Packet_Ping() {
+ super();
}
- public void serialize(WriteBuffer writeBuffer) throws SerializationException {
+ @Override
+ protected void serializePnIoCm_PacketChild(WriteBuffer writeBuffer)
+ throws SerializationException {
PositionAware positionAware = writeBuffer;
boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get();
int startPos = positionAware.getPos();
- writeBuffer.pushContext("UserData");
+ writeBuffer.pushContext("PnIoCm_Packet_Ping");
- // Array Field (data)
- writeByteArrayField("data", data, writeByteArray(writeBuffer, 8));
-
- writeBuffer.popContext("UserData");
+ writeBuffer.popContext("PnIoCm_Packet_Ping");
}
@Override
@@ -72,52 +64,34 @@ public class UserData implements Message {
@Override
public int getLengthInBits() {
- int lengthInBits = 0;
- UserData _value = this;
+ int lengthInBits = super.getLengthInBits();
+ PnIoCm_Packet_Ping _value = this;
boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get();
- // 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");
+ public static PnIoCm_PacketBuilder staticParsePnIoCm_PacketBuilder(
+ ReadBuffer readBuffer, DceRpc_PacketType packetType) throws ParseException {
+ readBuffer.pullContext("PnIoCm_Packet_Ping");
PositionAware positionAware = readBuffer;
int startPos = positionAware.getPos();
int curPos;
boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get();
- byte[] data = readBuffer.readByteArray("data", Math.toIntExact(recordDataLength));
-
- readBuffer.closeContext("UserData");
+ readBuffer.closeContext("PnIoCm_Packet_Ping");
// Create the instance
- UserData _userData;
- _userData = new UserData(data, recordDataLength);
- return _userData;
+ return new PnIoCm_Packet_PingBuilderImpl();
+ }
+
+ public static class PnIoCm_Packet_PingBuilderImpl implements PnIoCm_Packet.PnIoCm_PacketBuilder {
+
+ public PnIoCm_Packet_PingBuilderImpl() {}
+
+ public PnIoCm_Packet_Ping build() {
+ PnIoCm_Packet_Ping pnIoCm_Packet_Ping = new PnIoCm_Packet_Ping();
+ return pnIoCm_Packet_Ping;
+ }
}
@Override
@@ -125,16 +99,16 @@ public class UserData implements Message {
if (this == o) {
return true;
}
- if (!(o instanceof UserData)) {
+ if (!(o instanceof PnIoCm_Packet_Ping)) {
return false;
}
- UserData that = (UserData) o;
- return (getData() == that.getData()) && true;
+ PnIoCm_Packet_Ping that = (PnIoCm_Packet_Ping) o;
+ return super.equals(that) && true;
}
@Override
public int hashCode() {
- return Objects.hash(getData());
+ return Objects.hash(super.hashCode());
}
@Override
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 460229481a..6856dbc069 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
@@ -101,31 +101,53 @@ public abstract class PnIoCm_Submodule implements Message {
writeBuffer.pushContext("PnIoCm_Submodule");
// Simple Field (slotNumber)
- writeSimpleField("slotNumber", slotNumber, writeUnsignedInt(writeBuffer, 16));
+ writeSimpleField(
+ "slotNumber",
+ slotNumber,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Simple Field (submoduleIdentNumber)
writeSimpleField(
- "submoduleIdentNumber", submoduleIdentNumber, writeUnsignedLong(writeBuffer, 32));
+ "submoduleIdentNumber",
+ submoduleIdentNumber,
+ writeUnsignedLong(writeBuffer, 32),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Reserved Field (reserved)
writeReservedField(
"reserved",
reservedField0 != null ? reservedField0 : (int) 0x000,
- writeUnsignedInt(writeBuffer, 10));
+ writeUnsignedInt(writeBuffer, 10),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Simple Field (discardIoxs)
- writeSimpleField("discardIoxs", discardIoxs, writeBoolean(writeBuffer));
+ writeSimpleField(
+ "discardIoxs",
+ discardIoxs,
+ writeBoolean(writeBuffer),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Simple Field (reduceOutputModuleDataLength)
writeSimpleField(
- "reduceOutputModuleDataLength", reduceOutputModuleDataLength, writeBoolean(writeBuffer));
+ "reduceOutputModuleDataLength",
+ reduceOutputModuleDataLength,
+ writeBoolean(writeBuffer),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Simple Field (reduceInputModuleDataLength)
writeSimpleField(
- "reduceInputModuleDataLength", reduceInputModuleDataLength, writeBoolean(writeBuffer));
+ "reduceInputModuleDataLength",
+ reduceInputModuleDataLength,
+ writeBoolean(writeBuffer),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Simple Field (sharedInput)
- writeSimpleField("sharedInput", sharedInput, writeBoolean(writeBuffer));
+ writeSimpleField(
+ "sharedInput",
+ sharedInput,
+ writeBoolean(writeBuffer),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Discriminator Field (submoduleType) (Used as input to a switch field)
writeDiscriminatorEnumField(
@@ -135,7 +157,8 @@ public abstract class PnIoCm_Submodule implements Message {
new DataWriterEnumDefault<>(
PnIoCm_SubmoduleType::getValue,
PnIoCm_SubmoduleType::name,
- writeUnsignedByte(writeBuffer, 2)));
+ writeUnsignedByte(writeBuffer, 2)),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Switch field (Serialize the sub-type)
serializePnIoCm_SubmoduleChild(writeBuffer);
@@ -196,29 +219,51 @@ public abstract class PnIoCm_Submodule implements Message {
int curPos;
boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get();
- int slotNumber = readSimpleField("slotNumber", readUnsignedInt(readBuffer, 16));
+ int slotNumber =
+ readSimpleField(
+ "slotNumber",
+ readUnsignedInt(readBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
long submoduleIdentNumber =
- readSimpleField("submoduleIdentNumber", readUnsignedLong(readBuffer, 32));
+ readSimpleField(
+ "submoduleIdentNumber",
+ readUnsignedLong(readBuffer, 32),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
Integer reservedField0 =
- readReservedField("reserved", readUnsignedInt(readBuffer, 10), (int) 0x000);
+ readReservedField(
+ "reserved",
+ readUnsignedInt(readBuffer, 10),
+ (int) 0x000,
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
- boolean discardIoxs = readSimpleField("discardIoxs", readBoolean(readBuffer));
+ boolean discardIoxs =
+ readSimpleField(
+ "discardIoxs", readBoolean(readBuffer), WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
boolean reduceOutputModuleDataLength =
- readSimpleField("reduceOutputModuleDataLength", readBoolean(readBuffer));
+ readSimpleField(
+ "reduceOutputModuleDataLength",
+ readBoolean(readBuffer),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
boolean reduceInputModuleDataLength =
- readSimpleField("reduceInputModuleDataLength", readBoolean(readBuffer));
+ readSimpleField(
+ "reduceInputModuleDataLength",
+ readBoolean(readBuffer),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
- boolean sharedInput = readSimpleField("sharedInput", readBoolean(readBuffer));
+ boolean sharedInput =
+ readSimpleField(
+ "sharedInput", readBoolean(readBuffer), WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
PnIoCm_SubmoduleType submoduleType =
readDiscriminatorField(
"submoduleType",
new DataReaderEnumDefault<>(
- PnIoCm_SubmoduleType::enumForValue, readUnsignedByte(readBuffer, 2)));
+ PnIoCm_SubmoduleType::enumForValue, readUnsignedByte(readBuffer, 2)),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Switch Field (Depending on the discriminator values, passes the instantiation to a sub-type)
PnIoCm_SubmoduleBuilder builder = null;
diff --git a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_Submodule_InputAndOutputData.java b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_Submodule_InputAndOutputData.java
index 1f0965386e..aa9b2fa22d 100644
--- a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_Submodule_InputAndOutputData.java
+++ b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_Submodule_InputAndOutputData.java
@@ -124,31 +124,59 @@ public class PnIoCm_Submodule_InputAndOutputData extends PnIoCm_Submodule implem
// Const Field (inputDataDescription)
writeConstField(
- "inputDataDescription", INPUTDATADESCRIPTION, writeUnsignedInt(writeBuffer, 16));
+ "inputDataDescription",
+ INPUTDATADESCRIPTION,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Simple Field (inputSubmoduleDataLength)
writeSimpleField(
- "inputSubmoduleDataLength", inputSubmoduleDataLength, writeUnsignedInt(writeBuffer, 16));
+ "inputSubmoduleDataLength",
+ inputSubmoduleDataLength,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Simple Field (inputLengthIoCs)
- writeSimpleField("inputLengthIoCs", inputLengthIoCs, writeUnsignedShort(writeBuffer, 8));
+ writeSimpleField(
+ "inputLengthIoCs",
+ inputLengthIoCs,
+ writeUnsignedShort(writeBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Simple Field (inputLengthIoPs)
- writeSimpleField("inputLengthIoPs", inputLengthIoPs, writeUnsignedShort(writeBuffer, 8));
+ writeSimpleField(
+ "inputLengthIoPs",
+ inputLengthIoPs,
+ writeUnsignedShort(writeBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Const Field (outputDataDescription)
writeConstField(
- "outputDataDescription", OUTPUTDATADESCRIPTION, writeUnsignedInt(writeBuffer, 16));
+ "outputDataDescription",
+ OUTPUTDATADESCRIPTION,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Simple Field (outputSubmoduleDataLength)
writeSimpleField(
- "outputSubmoduleDataLength", outputSubmoduleDataLength, writeUnsignedInt(writeBuffer, 16));
+ "outputSubmoduleDataLength",
+ outputSubmoduleDataLength,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Simple Field (outputLengthIoCs)
- writeSimpleField("outputLengthIoCs", outputLengthIoCs, writeUnsignedShort(writeBuffer, 8));
+ writeSimpleField(
+ "outputLengthIoCs",
+ outputLengthIoCs,
+ writeUnsignedShort(writeBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Simple Field (outputLengthIoPs)
- writeSimpleField("outputLengthIoPs", outputLengthIoPs, writeUnsignedShort(writeBuffer, 8));
+ writeSimpleField(
+ "outputLengthIoPs",
+ outputLengthIoPs,
+ writeUnsignedShort(writeBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
writeBuffer.popContext("PnIoCm_Submodule_InputAndOutputData");
}
@@ -203,27 +231,51 @@ public class PnIoCm_Submodule_InputAndOutputData extends PnIoCm_Submodule implem
readConstField(
"inputDataDescription",
readUnsignedInt(readBuffer, 16),
- PnIoCm_Submodule_InputAndOutputData.INPUTDATADESCRIPTION);
+ PnIoCm_Submodule_InputAndOutputData.INPUTDATADESCRIPTION,
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
int inputSubmoduleDataLength =
- readSimpleField("inputSubmoduleDataLength", readUnsignedInt(readBuffer, 16));
+ readSimpleField(
+ "inputSubmoduleDataLength",
+ readUnsignedInt(readBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
- short inputLengthIoCs = readSimpleField("inputLengthIoCs", readUnsignedShort(readBuffer, 8));
+ short inputLengthIoCs =
+ readSimpleField(
+ "inputLengthIoCs",
+ readUnsignedShort(readBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
- short inputLengthIoPs = readSimpleField("inputLengthIoPs", readUnsignedShort(readBuffer, 8));
+ short inputLengthIoPs =
+ readSimpleField(
+ "inputLengthIoPs",
+ readUnsignedShort(readBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
int outputDataDescription =
readConstField(
"outputDataDescription",
readUnsignedInt(readBuffer, 16),
- PnIoCm_Submodule_InputAndOutputData.OUTPUTDATADESCRIPTION);
+ PnIoCm_Submodule_InputAndOutputData.OUTPUTDATADESCRIPTION,
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
int outputSubmoduleDataLength =
- readSimpleField("outputSubmoduleDataLength", readUnsignedInt(readBuffer, 16));
-
- short outputLengthIoCs = readSimpleField("outputLengthIoCs", readUnsignedShort(readBuffer, 8));
-
- short outputLengthIoPs = readSimpleField("outputLengthIoPs", readUnsignedShort(readBuffer, 8));
+ readSimpleField(
+ "outputSubmoduleDataLength",
+ readUnsignedInt(readBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ short outputLengthIoCs =
+ readSimpleField(
+ "outputLengthIoCs",
+ readUnsignedShort(readBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ short outputLengthIoPs =
+ readSimpleField(
+ "outputLengthIoPs",
+ readUnsignedShort(readBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
readBuffer.closeContext("PnIoCm_Submodule_InputAndOutputData");
// Create the instance
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
index 7c9df657e3..65db1b2b4a 100644
--- 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
@@ -98,17 +98,31 @@ public class PnIoCm_Submodule_InputData extends PnIoCm_Submodule implements Mess
// Const Field (inputDataDescription)
writeConstField(
- "inputDataDescription", INPUTDATADESCRIPTION, writeUnsignedInt(writeBuffer, 16));
+ "inputDataDescription",
+ INPUTDATADESCRIPTION,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Simple Field (inputSubmoduleDataLength)
writeSimpleField(
- "inputSubmoduleDataLength", inputSubmoduleDataLength, writeUnsignedInt(writeBuffer, 16));
+ "inputSubmoduleDataLength",
+ inputSubmoduleDataLength,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Simple Field (inputLengthIoCs)
- writeSimpleField("inputLengthIoCs", inputLengthIoCs, writeUnsignedShort(writeBuffer, 8));
+ writeSimpleField(
+ "inputLengthIoCs",
+ inputLengthIoCs,
+ writeUnsignedShort(writeBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Simple Field (inputLengthIoPs)
- writeSimpleField("inputLengthIoPs", inputLengthIoPs, writeUnsignedShort(writeBuffer, 8));
+ writeSimpleField(
+ "inputLengthIoPs",
+ inputLengthIoPs,
+ writeUnsignedShort(writeBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
writeBuffer.popContext("PnIoCm_Submodule_InputData");
}
@@ -151,14 +165,26 @@ public class PnIoCm_Submodule_InputData extends PnIoCm_Submodule implements Mess
readConstField(
"inputDataDescription",
readUnsignedInt(readBuffer, 16),
- PnIoCm_Submodule_InputData.INPUTDATADESCRIPTION);
+ PnIoCm_Submodule_InputData.INPUTDATADESCRIPTION,
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
int inputSubmoduleDataLength =
- readSimpleField("inputSubmoduleDataLength", readUnsignedInt(readBuffer, 16));
-
- short inputLengthIoCs = readSimpleField("inputLengthIoCs", readUnsignedShort(readBuffer, 8));
-
- short inputLengthIoPs = readSimpleField("inputLengthIoPs", readUnsignedShort(readBuffer, 8));
+ readSimpleField(
+ "inputSubmoduleDataLength",
+ readUnsignedInt(readBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ short inputLengthIoCs =
+ readSimpleField(
+ "inputLengthIoCs",
+ readUnsignedShort(readBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ short inputLengthIoPs =
+ readSimpleField(
+ "inputLengthIoPs",
+ readUnsignedShort(readBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
readBuffer.closeContext("PnIoCm_Submodule_InputData");
// Create the instance
diff --git a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_Submodule_NoInputNoOutputData.java b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_Submodule_NoInputNoOutputData.java
index 2b99da079d..8fbdddfa1d 100644
--- a/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_Submodule_NoInputNoOutputData.java
+++ b/plc4j/drivers/profinet/src/main/generated/org/apache/plc4x/java/profinet/readwrite/PnIoCm_Submodule_NoInputNoOutputData.java
@@ -89,16 +89,32 @@ public class PnIoCm_Submodule_NoInputNoOutputData extends PnIoCm_Submodule imple
writeBuffer.pushContext("PnIoCm_Submodule_NoInputNoOutputData");
// Const Field (dataDescription)
- writeConstField("dataDescription", DATADESCRIPTION, writeUnsignedInt(writeBuffer, 16));
+ writeConstField(
+ "dataDescription",
+ DATADESCRIPTION,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Const Field (submoduleDataLength)
- writeConstField("submoduleDataLength", SUBMODULEDATALENGTH, writeUnsignedInt(writeBuffer, 16));
+ writeConstField(
+ "submoduleDataLength",
+ SUBMODULEDATALENGTH,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Const Field (lengthIoCs)
- writeConstField("lengthIoCs", LENGTHIOCS, writeUnsignedShort(writeBuffer, 8));
+ writeConstField(
+ "lengthIoCs",
+ LENGTHIOCS,
+ writeUnsignedShort(writeBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Const Field (lengthIoPs)
- writeConstField("lengthIoPs", LENGTHIOPS, writeUnsignedShort(writeBuffer, 8));
+ writeConstField(
+ "lengthIoPs",
+ LENGTHIOPS,
+ writeUnsignedShort(writeBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
writeBuffer.popContext("PnIoCm_Submodule_NoInputNoOutputData");
}
@@ -141,25 +157,29 @@ public class PnIoCm_Submodule_NoInputNoOutputData extends PnIoCm_Submodule imple
readConstField(
"dataDescription",
readUnsignedInt(readBuffer, 16),
- PnIoCm_Submodule_NoInputNoOutputData.DATADESCRIPTION);
+ PnIoCm_Submodule_NoInputNoOutputData.DATADESCRIPTION,
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
int submoduleDataLength =
readConstField(
"submoduleDataLength",
readUnsignedInt(readBuffer, 16),
- PnIoCm_Submodule_NoInputNoOutputData.SUBMODULEDATALENGTH);
+ PnIoCm_Submodule_NoInputNoOutputData.SUBMODULEDATALENGTH,
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
short lengthIoCs =
readConstField(
"lengthIoCs",
readUnsignedShort(readBuffer, 8),
- PnIoCm_Submodule_NoInputNoOutputData.LENGTHIOCS);
+ PnIoCm_Submodule_NoInputNoOutputData.LENGTHIOCS,
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
short lengthIoPs =
readConstField(
"lengthIoPs",
readUnsignedShort(readBuffer, 8),
- PnIoCm_Submodule_NoInputNoOutputData.LENGTHIOPS);
+ PnIoCm_Submodule_NoInputNoOutputData.LENGTHIOPS,
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
readBuffer.closeContext("PnIoCm_Submodule_NoInputNoOutputData");
// Create the instance
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
index add5348121..15f5e762ec 100644
--- 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
@@ -98,17 +98,31 @@ public class PnIoCm_Submodule_OutputData extends PnIoCm_Submodule implements Mes
// Const Field (inputDataDescription)
writeConstField(
- "inputDataDescription", INPUTDATADESCRIPTION, writeUnsignedInt(writeBuffer, 16));
+ "inputDataDescription",
+ INPUTDATADESCRIPTION,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Simple Field (inputSubmoduleDataLength)
writeSimpleField(
- "inputSubmoduleDataLength", inputSubmoduleDataLength, writeUnsignedInt(writeBuffer, 16));
+ "inputSubmoduleDataLength",
+ inputSubmoduleDataLength,
+ writeUnsignedInt(writeBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Simple Field (inputLengthIoCs)
- writeSimpleField("inputLengthIoCs", inputLengthIoCs, writeUnsignedShort(writeBuffer, 8));
+ writeSimpleField(
+ "inputLengthIoCs",
+ inputLengthIoCs,
+ writeUnsignedShort(writeBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
// Simple Field (inputLengthIoPs)
- writeSimpleField("inputLengthIoPs", inputLengthIoPs, writeUnsignedShort(writeBuffer, 8));
+ writeSimpleField(
+ "inputLengthIoPs",
+ inputLengthIoPs,
+ writeUnsignedShort(writeBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
writeBuffer.popContext("PnIoCm_Submodule_OutputData");
}
@@ -151,14 +165,26 @@ public class PnIoCm_Submodule_OutputData extends PnIoCm_Submodule implements Mes
readConstField(
"inputDataDescription",
readUnsignedInt(readBuffer, 16),
- PnIoCm_Submodule_OutputData.INPUTDATADESCRIPTION);
+ PnIoCm_Submodule_OutputData.INPUTDATADESCRIPTION,
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
int inputSubmoduleDataLength =
- readSimpleField("inputSubmoduleDataLength", readUnsignedInt(readBuffer, 16));
-
- short inputLengthIoCs = readSimpleField("inputLengthIoCs", readUnsignedShort(readBuffer, 8));
-
- short inputLengthIoPs = readSimpleField("inputLengthIoPs", readUnsignedShort(readBuffer, 8));
+ readSimpleField(
+ "inputSubmoduleDataLength",
+ readUnsignedInt(readBuffer, 16),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ short inputLengthIoCs =
+ readSimpleField(
+ "inputLengthIoCs",
+ readUnsignedShort(readBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
+
+ short inputLengthIoPs =
+ readSimpleField(
+ "inputLengthIoPs",
+ readUnsignedShort(readBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
readBuffer.closeContext("PnIoCm_Submodule_OutputData");
// Create the instance
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
index 1106118f3d..b5504c883a 100644
--- 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
@@ -60,7 +60,11 @@ public class UserData implements Message {
writeBuffer.pushContext("UserData");
// Array Field (data)
- writeByteArrayField("data", data, writeByteArray(writeBuffer, 8));
+ writeByteArrayField(
+ "data",
+ data,
+ writeByteArray(writeBuffer, 8),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
writeBuffer.popContext("UserData");
}
@@ -111,7 +115,11 @@ public class UserData implements Message {
int curPos;
boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get();
- byte[] data = readBuffer.readByteArray("data", Math.toIntExact(recordDataLength));
+ byte[] data =
+ readBuffer.readByteArray(
+ "data",
+ Math.toIntExact(recordDataLength),
+ WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));
readBuffer.closeContext("UserData");
// Create the instance
diff --git a/protocols/profinet/src/main/java/org/apache/plc4x/protocol/profinet/ProfinetProtocol.java b/protocols/profinet/src/main/java/org/apache/plc4x/protocol/profinet/ProfinetProtocol.java
index 0f41c9b266..c65cfbd3f4 100644
--- a/protocols/profinet/src/main/java/org/apache/plc4x/protocol/profinet/ProfinetProtocol.java
+++ b/protocols/profinet/src/main/java/org/apache/plc4x/protocol/profinet/ProfinetProtocol.java
@@ -24,9 +24,13 @@ import org.apache.plc4x.plugins.codegenerator.language.mspec.protocol.Validatabl
import org.apache.plc4x.plugins.codegenerator.protocol.Protocol;
import org.apache.plc4x.plugins.codegenerator.protocol.TypeContext;
import org.apache.plc4x.plugins.codegenerator.types.exceptions.GenerationException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
public class ProfinetProtocol implements Protocol, ProtocolHelpers {
+ private static final Logger LOGGER = LoggerFactory.getLogger(ProfinetProtocol.class);
+
@Override
public String getName() {
return "profinet";
@@ -34,8 +38,27 @@ public class ProfinetProtocol implements Protocol, ProtocolHelpers {
@Override
public TypeContext getTypeContext() throws GenerationException {
- ValidatableTypeContext typeContext = new MessageFormatParser().parse(getMspecStream());
+ ValidatableTypeContext typeContext;
+
+
+ LOGGER.info("Parsing: pndcp.mspec");
+ typeContext = new MessageFormatParser().parse(getMspecStream("pndcp"));
+
+ LOGGER.info("Parsing: pnio.mspec");
+ typeContext = new MessageFormatParser().parse(getMspecStream("pnio"), typeContext);
+
+ LOGGER.info("Parsing: dcerpc.mspec");
+ typeContext = new MessageFormatParser().parse(getMspecStream("dcerpc"), typeContext);
+
+ LOGGER.info("Parsing:lldp.mspec");
+ typeContext = new MessageFormatParser().parse(getMspecStream("lldp"), typeContext);
+
+ LOGGER.info("Parsing: ethernet.mspec");
+ typeContext = new MessageFormatParser().parse(getMspecStream("ethernet"), typeContext);
+
+
typeContext.validate();
+
return typeContext;
}
diff --git a/protocols/profinet/src/main/resources/protocols/profinet/dcerpc.mspec b/protocols/profinet/src/main/resources/protocols/profinet/dcerpc.mspec
new file mode 100644
index 0000000000..bed0d5c9bb
--- /dev/null
+++ b/protocols/profinet/src/main/resources/protocols/profinet/dcerpc.mspec
@@ -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.
+ */
+
+[type DceRpc_Packet byteOrder='BIG_ENDIAN'
+// RPC Header {
+ // RPCVersion 4.10.3.2.1
+ [const uint 8 version 0x04 ]
+ // RPCPacketType 4.10.3.2.2 (8 bit)
+ [simple DceRpc_PacketType packetType ]
+ // PRCFlags 4.10.3.2.3
+ [reserved bit 'false' ]
+ [const bit broadcast false ]
+ [simple bit idempotent ]
+ [const bit maybe false ]
+ [simple bit noFragmentAcknowledgeRequested ]
+ [const bit fragment false ]
+ [simple bit lastFragment ]
+ [reserved bit 'false' ]
+ // PRCFlags2 4.10.3.2.4
+ [reserved uint 6 '0x00' ]
+ [const bit cancelWasPending false ]
+ [reserved bit 'false' ]
+ // RPCDRep 4.10.3.2.5 (4 bit & 4 bit)
+ [simple IntegerEncoding integerEncoding ]
+ [simple CharacterEncoding characterEncoding ]
+ // RPCDRep2 4.10.3.2.5 (8 bit)
+ [simple FloatingPointEncoding floatingPointEncoding ]
+ // RPCDRep3 (8 bit shall be 0)
+ [reserved uint 8 '0x00' ]
+ // RPCSerialHigh 4.10.3.2.6
+ [const uint 8 serialHigh 0x00 ]
+ [batchSet byteOrder='integerEncoding == IntegerEncoding.BIG_ENDIAN ? BIG_ENDIAN : LITTLE_ENDIAN'
+ // RPCObjectUUID 4.10.3.2.8
+ // RPCObjectUUID 4.10.3.2.8
+ [simple DceRpc_ObjectUuid objectUuid ]
+ // RPCInterfaceUUID 4.10.3.2.9
+ [simple DceRpc_InterfaceUuid interfaceUuid ]
+ // RPCActivityUUID 4.10.3.2.10
+ [simple DceRpc_ActivityUuid activityUuid ]
+ // RPCServerBootTime 4.10.3.2.11
+ [simple uint 32 serverBootTime ]
+ // RPCInterfaceVersion 4.10.3.2.12
+ [const uint 32 interfaceVer 0x00000001 ]
+ // RPCSequenceNmb 4.10.3.2.13
+ [simple uint 32 sequenceNumber ]
+ // RPCOperationNmb 4.10.3.2.14
+ [simple DceRpc_Operation operation ]
+ // RPCInterfaceHint 4.10.3.2.15
+ [const uint 16 interfaceHint 0xFFFF ]
+ // RPCActivityHint 4.10.3.2.16
+ [const uint 16 activityHint 0xFFFF ]
+ // RPCLengthOfBody 4.10.3.2.17
+ [implicit uint 16 lengthOfBody 'payload.lengthInBytes']
+ // RPCFragmentNmb 4.10.3.2.18 (Setting this to 0 as we will probably never have anything but 0 here
+ [const uint 16 fragmentNum 0x0000 ]
+ // RPCAuthenticationProtocol 4.10.3.2.19
+ [const uint 8 authProto 0x00 ]
+ ]
+ // RPCSerialLow 4.10.3.2.7
+ [const uint 8 serialLow 0x00 ]
+// RPC Header }
+// RPC Payload {
+ [simple PnIoCm_Packet('packetType') payload byteOrder='integerEncoding == IntegerEncoding.BIG_ENDIAN ? BIG_ENDIAN : LITTLE_ENDIAN' ]
+// RPC Payload }
+]
+
+// RPCObjectUUID 4.10.3.2.8
+[type DceRpc_ObjectUuid
+ [const uint 32 data1 0xDEA00000 ]
+ [const uint 16 data2 0x6C97 ]
+ [const uint 16 data3 0x11D1 ]
+ // This part is described as a byte array, so the byte order is always big-endian
+ [const uint 16 data4 0x8271 byteOrder='BIG_ENDIAN']
+ [simple uint 4 interfaceNumber byteOrder='BIG_ENDIAN']
+ [simple uint 12 nodeNumber byteOrder='BIG_ENDIAN']
+ [simple uint 16 deviceId byteOrder='BIG_ENDIAN']
+ [simple uint 16 vendorId byteOrder='BIG_ENDIAN']
+]
+
+// RPCInterfaceUUID 4.10.3.2.9
+// NOTE: If we would have been only using Big Endian encoding, we would have
+// implemented this via an enum. However as the first 8 bytes are
+// dynamically endianed and the last 8 bytes are set to Big Endian, we
+// had to do this trick.
+[discriminatedType DceRpc_InterfaceUuid
+ [discriminator uint 32 interfaceType ]
+ [const uint 16 data1 0x6C97 ]
+ [const uint 16 data2 0x11D1 ]
+ // This part is described as a byte array, so the byte order is always big-endian
+ [const uint 16 data3 0x8271 byteOrder='BIG_ENDIAN']
+ [const uint 16 data4 0x00A0 byteOrder='BIG_ENDIAN']
+ [const uint 16 data5 0x2442 byteOrder='BIG_ENDIAN']
+ [const uint 16 data6 0xDF7D byteOrder='BIG_ENDIAN']
+ [typeSwitch interfaceType
+ ['0xDEA00001' DceRpc_InterfaceUuid_DeviceInterface
+ ]
+ ['0xDEA00002' DceRpc_InterfaceUuid_ControllerInterface
+ ]
+ ['0xDEA00003' DceRpc_InterfaceUuid_SupervisorInterface
+ ]
+ ['0xDEA00004' DceRpc_InterfaceUuid_ParameterInterface
+ ]
+ ]
+]
+
+// RPCActivityUUID 4.10.3.2.10
+// NOTE: This value is generally randomly generated by the initiator
+// and used throughout the entire communication. Unfortunately,
+// the first parts are effected by endianess, and the last 8
+// bytes are fixed big-endian. Therefore the complicated notation.
+[type DceRpc_ActivityUuid
+ [simple uint 32 data1 ]
+ [simple uint 16 data2 ]
+ [simple uint 16 data3 ]
+ // This part is described as a byte array, so the byte order is always big-endian
+ [array byte data4 count '8']
+]
+
+// 4.10.3.2.2
+[enum uint 8 DceRpc_PacketType
+ ['0x00' REQUEST ]
+ ['0x01' PING ]
+ ['0x02' RESPONSE ]
+ ['0x03' FAULT ]
+ ['0x04' WORKING ]
+ // Response to PING
+ ['0x05' NO_CALL ]
+ ['0x06' REJECT ]
+ ['0x07' ACKNOWLEDGE ]
+ ['0x08' CONNECTIONLESS_CANCEL]
+ ['0x09' FRAGMENT_ACKNOWLEDGE ]
+ ['0x0A' CANCEL_ACKNOWLEDGE ]
+]
+
+// 4.10.3.2.14
+[enum uint 16 DceRpc_Operation
+ ['0x0000' CONNECT ]
+ ['0x0001' RELEASE ]
+ ['0x0002' READ ]
+ ['0x0003' WRITE ]
+ ['0x0004' CONTROL ]
+ ['0x0005' READ_IMPLICIT]
+]
diff --git a/protocols/profinet/src/main/resources/protocols/profinet/ethernet.mspec b/protocols/profinet/src/main/resources/protocols/profinet/ethernet.mspec
new file mode 100644
index 0000000000..9e69be6dd4
--- /dev/null
+++ b/protocols/profinet/src/main/resources/protocols/profinet/ethernet.mspec
@@ -0,0 +1,110 @@
+/*
+ * 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.
+ */
+
+[type Ethernet_Frame byteOrder='BIG_ENDIAN'
+ // When sending to the mac address prefix of 01:0e:cf are multicast packets
+ [simple MacAddress destination]
+ [simple MacAddress source ]
+ [simple Ethernet_FramePayload payload ]
+]
+
+[discriminatedType Ethernet_FramePayload
+ [discriminator uint 16 packetType]
+ [typeSwitch packetType
+ ['0x0800' Ethernet_FramePayload_IPv4
+ [const uint 4 version 0x4 ]
+ // 5 = 5 x 32bit = 5 x 4byte = 20byte
+ [const uint 4 headerLength 0x5 ]
+ [const uint 6 differentiatedServicesCodepoint 0x00 ]
+ [const uint 2 explicitCongestionNotification 0x0 ]
+ // Length of the header + payload
+ [implicit uint 16 totalLength '28 + payload.lengthInBytes']
+ [simple uint 16 identification ]
+ [reserved bit 'false' ]
+ [simple bit dontFragment ]
+ [simple bit moreFragments ]
+ [const uint 13 fragmentOffset 0x00 ]
+ [simple uint 8 timeToLive ]
+ // Protocol: UDP
+ [const uint 8 protocol 0x11 ]
+ // It seems that modern NICs mess this up as they take care of the validation in dedicated hardware.
+ // This results in the wrong values being read. Using a 'checksum' field would fail most incoming packets.
+ [implicit uint 16 headerChecksum 'STATIC_CALL("calculateIPv4Checksum", totalLength, identification, timeToLive, sourceAddress, destinationAddress)']
+ [simple IpAddress sourceAddress ]
+ [simple IpAddress destinationAddress ]
+ // Begin of the UDP packet part
+ [simple uint 16 sourcePort ]
+ [simple uint 16 destinationPort ]
+ [implicit uint 16 packetLength '8 + payload.lengthInBytes' ]
+ [implicit uint 16 bodyChecksum 'STATIC_CALL("calculateUdpChecksum", sourceAddress, destinationAddress, sourcePort, destinationPort, packetLength, payload)']
+ [simple DceRpc_Packet payload ]
+ ]
+ ['0x8100' Ethernet_FramePayload_VirtualLan
+ [simple VirtualLanPriority priority ]
+ [simple bit ineligible ]
+ [simple uint 12 id ]
+ [simple Ethernet_FramePayload payload ]
+ ]
+ ['0x8892' Ethernet_FramePayload_PnDcp
+ [simple PnDcp_Pdu pdu ]
+ ]
+ ['0x88cc' Ethernet_FramePayload_LLDP
+ [simple Lldp_Pdu pdu ]
+ ]
+ ]
+]
+
+// There are some special MAC addresses reserved:
+// 01-0E-CF-00-00-00: As destination for DCP-Identify-ReqPDU (The FrameID is then required to be set to 0xFEFE)
+// 01-0E-CF-00-00-01: As destination for DCP-Helo-ReqPDU (The FrameID is then required to be set to 0xFEFC)
+// 01-0E-CF-00-00-02: Reserved
+// 01-0E-CF-00-01-00: Reserved for further multicast addresses within the Type 10 context
+// 01-0E-CF-00-01-01: As multicast destination for RT_CLASS_3
+// 01-0E-CF-00-01-02: As invalid frame multicast destination for RT_CLASS_3
+// 01-0E-CF-00-01-03 - FF: Reserved for further multicast addresses within the Type 10 context
+[type MacAddress
+ [array byte address count '6']
+]
+
+[type IpAddress
+ [array byte data count '4']
+]
+
+
+// https://de.wikipedia.org/wiki/IEEE_802.1p
+[enum uint 3 VirtualLanPriority (string 16 acronym)
+ ['0x0' BEST_EFFORT ['BE' ]]
+ ['0x1' BACKGROUND ['BK' ]]
+ ['0x2' EXCELLENT_EFFORT ['EE' ]]
+ ['0x3' CRITICAL_APPLICATIONS ['CA' ]]
+ ['0x4' VIDEO ['VI' ]]
+ ['0x5' VOICE ['VO' ]]
+ ['0x6' INTERNETWORK_CONTROL ['IC' ]]
+ ['0x7' NETWORK_CONTROL ['NC' ]]
+]
+
+[type PascalString
+ [implicit int 8 sLength 'stringValue.length == 0 ? -1 : stringValue.length']
+ [simple vstring 'sLength == -1 ? 0 : sLength * 8' stringValue]
+ [virtual int 8 stringLength 'stringValue.length == -1 ? 0 : stringValue.length']
+]
+
+[type Uuid
+ [array byte data count '16']
+]
diff --git a/protocols/profinet/src/main/resources/protocols/profinet/lldp.mspec b/protocols/profinet/src/main/resources/protocols/profinet/lldp.mspec
new file mode 100644
index 0000000000..f0bf82087d
--- /dev/null
+++ b/protocols/profinet/src/main/resources/protocols/profinet/lldp.mspec
@@ -0,0 +1,166 @@
+/*
+ * 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.
+ */
+
+[type Lldp_Pdu
+ [manualArray LldpUnit lldpParameters terminated 'STATIC_CALL("isSysexEnd", readBuffer)' 'STATIC_CALL("parseSysexString", readBuffer)' 'STATIC_CALL("serializeSysexString", writeBuffer, _value)' 'STATIC_CALL("lengthSysexString", lldpParameters)']
+]
+
+[discriminatedType LldpUnit
+ [discriminator TlvType tlvId ]
+ [simple uint 9 tlvIdLength ]
+ [typeSwitch tlvId
+ ['END_OF_LLDP' EndOfLldp
+ ]
+ ['CHASSIS_ID' TlvChassisId(uint 9 tlvIdLength)
+ [simple uint 8 chassisIdSubType ]
+ [simple vstring '(tlvIdLength - 1) * 8' chassisId ]
+ ]
+ ['PORT_ID' TlvPortId(uint 9 tlvIdLength)
+ [simple uint 8 portIdSubType ]
+ [simple vstring '(tlvIdLength - 1) * 8' portId ]
+ ]
+ ['TIME_TO_LIVE' TlvTimeToLive
+ [simple uint 16 tlvTimeToLiveUnit ]
+ ]
+ ['PORT_DESCRIPTION' TlvPortDescription(uint 9 tlvIdLength)
+ [simple vstring '(tlvIdLength) * 8' chassisId ]
+ ]
+ ['SYSTEM_NAME' TlvSystemName(uint 9 tlvIdLength)
+ [simple vstring '(tlvIdLength) * 8' chassisId ]
+ ]
+ ['SYSTEM_DESCRIPTION' TlvSystemDescription(uint 9 tlvIdLength)
+ [simple vstring '(tlvIdLength) * 8' chassisId ]
+ ]
+ ['SYSTEM_CAPABILITIES' TlvSystemCapabilities
+ [reserved uint 8 '0x00' ]
+ [simple bit stationOnlyCapable ]
+ [simple bit docsisCableDeviceCapable ]
+ [simple bit telephoneCapable ]
+ [simple bit routerCapable ]
+ [simple bit wlanAccessPointCapable ]
+ [simple bit bridgeCapable ]
+ [simple bit repeaterCapable ]
+ [simple bit otherCapable ]
+ [reserved uint 8 '0x00' ]
+ [simple bit stationOnlyEnabled ]
+ [simple bit docsisCableDeviceEnabled ]
+ [simple bit telephoneEnabled ]
+ [simple bit routerEnabled ]
+ [simple bit wlanAccessPointEnabled ]
+ [simple bit bridgeEnabled ]
+ [simple bit repeaterEnabled ]
+ [simple bit otherEnabled ]
+ ]
+ ['MANAGEMENT_ADDRESS' TlvManagementAddress
+ [implicit uint 8 addressStringLength '5' ]
+ [simple ManagementAddressSubType addressSubType ]
+ [simple IpAddress ipAddress ]
+ [simple uint 8 interfaceSubType ]
+ [simple uint 32 interfaceNumber ]
+ [simple uint 8 oidStringLength ]
+ ]
+ ['ORGANIZATION_SPECIFIC' TlvOrganizationSpecific
+ [simple TlvOrganizationSpecificUnit organizationSpecificUnit ]
+ ]
+ ]
+]
+
+[discriminatedType TlvOrganizationSpecificUnit
+ [discriminator uint 24 uniqueCode]
+ [typeSwitch uniqueCode
+ ['0x000ECF' TlvOrgSpecificProfibus
+ [simple TlvOrgSpecificProfibusUnit specificUnit ]
+ ]
+ ['0x00120F' TlvOrgSpecificIeee8023
+ [simple TlvOrgSpecificIeee8023Unit specificUnit ]
+ ]
+ ]
+]
+
+[discriminatedType TlvOrgSpecificIeee8023Unit
+ [discriminator TlvIEEESubType subType]
+ [typeSwitch subType
+ ['MAC_PHY_CONFIG_STATUS' TlvIeee8023MacPhyConfigStatus
+ [simple uint 8 negotiationSupport ]
+ [simple uint 16 negotiationCapability ]
+ [simple uint 16 operationalMauType ]
+ ]
+ ['MAX_FRAME_SIZE' TlvIeee8023MaxFrameSize
+ [simple uint 16 maxSize ]
+ ]
+ ]
+]
+
+[discriminatedType TlvOrgSpecificProfibusUnit
+ [discriminator TlvProfibusSubType subType]
+ [typeSwitch subType
+ ['MEASURED_DELAY' TlvProfibusSubTypeMeasuredDelay
+ [simple uint 32 localPortRxDelay]
+ [simple uint 32 remotePortRxDelay]
+ [simple uint 32 localPortTxDelay]
+ [simple uint 32 remotePortTxDelay]
+ ]
+ ['PORT_STATUS' TlvProfibusSubTypePortStatus
+ [simple uint 16 rtClass2PortStatus]
+ [reserved uint 2 '0x00' ]
+ [simple bit preample ]
+ [simple bit fragmentation ]
+ [reserved uint 9 '0x00' ]
+ [simple uint 3 rtClass3PortStatus]
+ ]
+ ['MRP_PORT_STATUS' TlvProfibusSubTypeMrpPortStatus
+ [simple Uuid macAddress]
+ [simple uint 16 Status]
+ ]
+ ['CHASSIS_MAC' TlvProfibusSubTypeChassisMac
+ [simple MacAddress macAddress]
+ ]
+ ]
+]
+
+[enum uint 8 TlvIEEESubType
+ ['0x01' MAC_PHY_CONFIG_STATUS]
+ ['0x04' MAX_FRAME_SIZE]
+]
+
+[enum uint 8 TlvProfibusSubType
+ ['0x01' MEASURED_DELAY]
+ ['0x02' PORT_STATUS]
+ ['0x04' MRP_PORT_STATUS]
+ ['0x05' CHASSIS_MAC]
+]
+
+//LLDP Specific
+[enum uint 7 TlvType
+ ['0x00' END_OF_LLDP ]
+ ['0x01' CHASSIS_ID ]
+ ['0x02' PORT_ID ]
+ ['0x03' TIME_TO_LIVE ]
+ ['0x04' PORT_DESCRIPTION ]
+ ['0x05' SYSTEM_NAME ]
+ ['0x06' SYSTEM_DESCRIPTION ]
+ ['0x07' SYSTEM_CAPABILITIES ]
+ ['0x08' MANAGEMENT_ADDRESS ]
+ ['0x7F' ORGANIZATION_SPECIFIC]
+]
+
+[enum uint 8 ManagementAddressSubType
+ ['0x00' UNKNOWN ]
+ ['0x01' IPV4 ]
+]
diff --git a/protocols/profinet/src/main/resources/protocols/profinet/pndcp.mspec b/protocols/profinet/src/main/resources/protocols/profinet/pndcp.mspec
new file mode 100644
index 0000000000..42a1deb7e6
--- /dev/null
+++ b/protocols/profinet/src/main/resources/protocols/profinet/pndcp.mspec
@@ -0,0 +1,407 @@
+/*
+ * 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.
+ */
+
+/////////////////////////////////////////////////////////////////////////////////////////
+//
+// PROFINET DCP
+//
+// Discovery and basic configuration
+//
+/////////////////////////////////////////////////////////////////////////////////////////
+
+// Page 90
+[discriminatedType PnDcp_Pdu byteOrder='BIG_ENDIAN'
+ [simple uint 16 frameIdValue ]
+ [virtual PnDcp_FrameId frameId 'STATIC_CALL("getFrameId", frameIdValue)']
+ [typeSwitch frameId
+ ['RT_CLASS_1' PnDcp_Pdu_RealTimeCyclic
+ [manual PnIo_CyclicServiceDataUnit
+ dataUnit
+ 'STATIC_CALL("readDataUnit", readBuffer)'
+ 'STATIC_CALL("writeDataUnit", writeBuffer, dataUnit)'
+ '(dataUnit.lengthInBytes)*8' ]
+ [simple uint 16 cycleCounter ]
+ // Data Status Start (4.7.2.1.3)
+ [simple bit ignore ]
+ [reserved bit 'false' ]
+ [simple bit stationProblemIndicatorOk]
+ [simple bit providerStateRun ]
+ [reserved bit 'false' ]
+ [simple bit dataValid ]
+ [simple bit redundancy ]
+ [simple bit statePrimary ]
+ // Data Status End
+ // "Transfer-Status" (Set to 0x00 for all RT-Classes except RT-CLASS-3,
+ // which PLC4X will never be able to support
+ [reserved uint 8 '0x00' ] // transferStatus
+ ]
+ ['PTCP_DelayReqPDU' PcDcp_Pdu_DelayReq
+ // Header Start
+ [reserved uint 32 '0x00000000']
+ [reserved uint 32 '0x00000000']
+ [reserved uint 32 '0x00000000']
+ [simple uint 16 sequenceId ]
+ [reserved uint 16 '0x0000' ]
+ // Header End
+ [simple uint 32 delayInNs ]
+ // Delay Parameter Start
+ // TODO: This seems to usually be an array of parameters terminated by an End-Parameter which is indicated by type and length being 0
+ [const uint 7 parameterType 6]
+ [const uint 9 parameterLength 6]
+ [simple MacAddress portMacAddress ]
+ [const uint 7 endType 0]
+ [const uint 9 endLength 0]
+ // Delay Parameter End
+ ]
+ ['Alarm_Low' PnDcp_Pdu_AlarmLow
+ [simple uint 16 alarmDstEndpoint]
+ [simple uint 16 alarmSrcEndpoint]
+ [simple uint 4 version]
+ [simple uint 4 errorType]
+ [simple uint 4 tAck]
+ [simple uint 4 windowSize]
+ [simple uint 16 senSeqNum]
+ [simple uint 16 ackSeqNum]
+ [implicit uint 16 varPartLen 'COUNT(varPart)']
+ [array byte varPart length 'varPartLen']
+ ]
+ ['DCP_Identify_ReqPDU' PnDcp_Pdu_IdentifyReq
+ [const uint 8 serviceId 0x05 ]
+ // ServiceType Start
+ [reserved uint 5 '0x00' ]
+ [const bit notSupported false ]
+ [reserved uint 1 '0x00' ]
+ [const bit response false ]
+ // ServiceType End
+ // 4.3.1.3.3 (Page 95)
+ [simple uint 32 xid ]
+ // 4.3.1.3.5 (Page 95ff)
+ [simple uint 16 responseDelay ]
+ // 4.3.1.3.4 (Page 95)
+ [implicit uint 16 dcpDataLength 'lengthInBytes - 12' ]
+ [array PnDcp_Block blocks length 'dcpDataLength']
+ ]
+ ////////////////////////////////////////////////////////////////////////////
+ // Multicast (Well theoretically)
+ ////////////////////////////////////////////////////////////////////////////
+ // The Identify request is valid in two options:
+ // 1) One containing only an AllSelectorBlock
+ // 2) One containing optionally either NameOfStationBlock or AliasNameBlock and another optional IdentifyReqBlock
+ // (I assume, that if in case 2 both optionally aren't used, this might not be valid and option 1 should be sent instead)
+ ['DCP_Identify_ResPDU' PnDcp_Pdu_IdentifyRes
+ [const uint 8 serviceId 0x05 ]
+ // ServiceType Start
+ [reserved uint 5 '0x00' ]
+ [simple bit notSupported ]
+ [reserved uint 1 '0x00' ]
+ [const bit response true ]
+ // ServiceType End
+ // 4.3.1.3.3 (Page 95)
+ [simple uint 32 xid ]
+ // 4.3.1.3.5 (Page 95ff)
+ [reserved uint 16 '0x0000' ]
+ // 4.3.1.3.4 (Page 95)
+ [implicit uint 16 dcpDataLength 'lengthInBytes - 12' ]
+ [array PnDcp_Block blocks length 'dcpDataLength']
+ ]
+ ]
+]
+
+[discriminatedType PnDcp_Pdu_IdentifyRes_Payload byteOrder='BIG_ENDIAN'
+ [discriminator PnDcp_ServiceId serviceId ]
+ [simple PnDcp_ServiceType serviceType ]
+ // 4.3.1.3.3 (Page 95)
+ [simple uint 32 xid ]
+ // 4.3.1.3.5 (Page 95ff)
+ [simple uint 16 responseDelayFactorOrPadding ]
+ // 4.3.1.3.4 (Page 95)
+ [implicit uint 16 dcpDataLength 'lengthInBytes - 12']
+ [typeSwitch serviceId,serviceType.response
+
+ // Packet a Profinet station might emit once it is turned on
+// ['DCP_Hello_ReqPDU','HELLO','false' PnDcp_Pdu_HelloReq
+// [simple NameOfStationBlockRes nameOfStationBlockRes ]
+// [simple IPParameterBlockRes iPParameterBlockRes ]
+// [simple DeviceIdBlockRes deviceIdBlockRes ]
+// [simple DeviceVendorBlockRes deviceVendorBlockRes ]
+// [simple DeviceOptionsBlockRes deviceOptionsBlockRes ]
+// [simple DeviceRoleBlockRes deviceRoleBlockRes ]
+// [simple DeviceInitiativeBlockRes deviceInitiativeBlockRes]
+// ]
+
+ ////////////////////////////////////////////////////////////////////////////
+ // Unicast
+ ////////////////////////////////////////////////////////////////////////////
+
+// ['DCP_GetSet_PDU','GET','false' PnDcp_Pdu_GetReq
+// [simple GetReqBlock getReqBlock ]
+// ]
+// ['DCP_GetSet_PDU','GET','true' PnDcp_Pdu_GetRes
+// [simple GetResBlock getResBlock ]
+// [simple GetNegResBlock getNegResBlock ]
+// ]
+
+// ['DCP_GetSet_PDU','SET','false' PnDcp_Pdu_SetReq
+// [simple StartTransactionBlock startTransactionBlock ]
+// [simple BlockQualifier blockQualifier ]
+// [simple SetResetReqBlock setResetReqBlock ]
+// [simple SetReqBlock setReqBlock ]
+// [simple StopTransactionBlock stopTransactionBlock ]
+// [simple BlockQualifier blockQualifier ]
+// ]
+// ['DCP_GetSet_PDU','SET','true' PnDcp_Pdu_SetRes
+// [simple SetResBlock setResBlock ]
+// [simple SetNegResBlock setNegResBlock ]
+// ]
+ ]
+]
+
+[discriminatedType PnDcp_Block byteOrder='BIG_ENDIAN'
+ [discriminator PnDcp_BlockOptions option ]
+ [discriminator uint 8 suboption ]
+ [implicit uint 16 blockLength 'lengthInBytes - 4']
+ [typeSwitch option,suboption
+
+ ////////////////////////////////////////////////////////////////////////////
+ // IP_OPTION
+ ////////////////////////////////////////////////////////////////////////////
+
+ // 4.3.1.4.1 (Page 97)
+ ['IP_OPTION','1' PnDcp_Block_IpMacAddress
+ [reserved uint 16 '0x0000' ]
+ [simple MacAddress macAddress ]
+ ]
+ ['IP_OPTION','2' PnDcp_Block_IpParameter
+ // 4.3.1.4.12 (Page 105ff)
+ [reserved uint 8 '0x00' ]
+ [simple bit ipConflictDetected ]
+ [reserved uint 5 '0x00' ]
+ [simple bit setViaDhcp ]
+ [simple bit setManually ]
+ [array byte ipAddress count '4' ]
+ [array byte subnetMask count '4' ]
+ [array byte standardGateway count '4' ]
+ ]
+ ['IP_OPTION','3' PnDcp_Block_FullIpSuite
+ // TODO: Implement this ...
+ ]
+
+ ////////////////////////////////////////////////////////////////////////////
+ // DEVICE_PROPERTIES_OPTION
+ ////////////////////////////////////////////////////////////////////////////
+
+ ['DEVICE_PROPERTIES_OPTION','1' PnDcp_Block_DevicePropertiesDeviceVendor(uint 16 blockLength)
+ [reserved uint 16 '0x0000' ]
+ [array byte deviceVendorValue count 'blockLength-2' ]
+ [padding uint 8 pad '0x00' 'STATIC_CALL("arrayLength", deviceVendorValue) % 2']
+ ]
+ ['DEVICE_PROPERTIES_OPTION','2' PnDcp_Block_DevicePropertiesNameOfStation(uint 16 blockLength)
+ [reserved uint 16 '0x0000' ]
+ [array byte nameOfStation count 'blockLength-2' ]
+ [padding uint 8 pad '0x00' 'STATIC_CALL("arrayLength", nameOfStation) % 2']
+ ]
+ ['DEVICE_PROPERTIES_OPTION','3' PnDcp_Block_DevicePropertiesDeviceId
+ [reserved uint 16 '0x0000' ]
+ [simple uint 16 vendorId ]
+ [simple uint 16 deviceId ]
+ ]
+ ['DEVICE_PROPERTIES_OPTION','4' PnDcp_Block_DevicePropertiesDeviceRole
+ [reserved uint 20 '0x000000' ]
+ [simple bit pnioSupervisor ]
+ [simple bit pnioMultidevive ]
+ [simple bit pnioController ]
+ [simple bit pnioDevice ]
+ [reserved uint 8 '0x00' ]
+ ]
+ // Contains a list of option combinations the device supports.
+ ['DEVICE_PROPERTIES_OPTION','5' PnDcp_Block_DevicePropertiesDeviceOptions(uint 16 blockLength)
+ [reserved uint 16 '0x0000' ]
+ [array PnDcp_SupportedDeviceOption supportedOptions length 'blockLength - 2' ]
+ ]
+ ['DEVICE_PROPERTIES_OPTION','6' PnDcp_Block_DevicePropertiesAliasName(uint 16 blockLength)
+ [reserved uint 16 '0x0000' ]
+ [array byte aliasNameValue count 'blockLength-2' ]
+ [padding uint 8 pad '0x00' 'STATIC_CALL("arrayLength", aliasNameValue) % 2']
+ ]
+ ['DEVICE_PROPERTIES_OPTION','7' PnDcp_Block_DevicePropertiesDeviceInstance
+ [reserved uint 16 '0x0000' ]
+ [simple uint 8 deviceInstanceHigh ]
+ [simple uint 8 deviceInstanceLow ]
+ ]
+ ['DEVICE_PROPERTIES_OPTION','8' PnDcp_Block_DevicePropertiesOemDeviceId
+ // TODO: Implement this ...
+ ]
+ ['DEVICE_PROPERTIES_OPTION','9' PnDcp_Block_DevicePropertiesStandardGateway
+ // TODO: Implement this ...
+ ]
+
+ ////////////////////////////////////////////////////////////////////////////
+ // DHCP_OPTION
+ ////////////////////////////////////////////////////////////////////////////
+ // 4.3.1.4.1 (Page 98 & 100)
+
+ // TODO: Check if these are really all DCP_OPTION
+ ['DCP_OPTION','12' PnDcp_Block_DhcpOptionHostName
+ // TODO: Implement this ...
+ ]
+ ['DCP_OPTION','43' PnDcp_Block_DhcpOptionVendorSpecificInformation
+ // TODO: Implement this ...
+ ]
+ ['DCP_OPTION','54' PnDcp_Block_DhcpOptionServerIdentifier
+ // TODO: Implement this ...
+ ]
+ ['DCP_OPTION','55' PnDcp_Block_DhcpOptionParameterRequestList
+ // TODO: Implement this ...
+ ]
+ ['DCP_OPTION','60' PnDcp_Block_DhcpOptionClassIdentifier
+ // TODO: Implement this ...
+ ]
+ ['DCP_OPTION','61' PnDcp_Block_DhcpOptionDhcpClientIdentifier
+ // TODO: Implement this ...
+ ]
+ ['DCP_OPTION','81' PnDcp_Block_DhcpOptionFullyQualifiedDomainName
+ // TODO: Implement this ...
+ ]
+ ['DCP_OPTION','97' PnDcp_Block_DhcpOptionUuidBasedClient
+ // TODO: Implement this ...
+ ]
+
+ ////////////////////////////////////////////////////////////////////////////
+ // CONTROL_OPTION
+ ////////////////////////////////////////////////////////////////////////////
+ // 4.3.1.4.1 (Page 98)
+
+ ['CONTROL_OPTION','1' PnDcp_Block_ControlOptionStart
+ // TODO: Implement this ...
+ ]
+ ['CONTROL_OPTION','2' PnDcp_Block_ControlOptionStop
+ // TODO: Implement this ...
+ ]
+ ['CONTROL_OPTION','3' PnDcp_Block_ControlOptionSignal
+ // TODO: Implement this ...
+ ]
+ ['CONTROL_OPTION','4' PnDcp_Block_ControlOptionResponse
+ // TODO: Implement this ...
+ ]
+ ['CONTROL_OPTION','5' PnDcp_Block_ControlOptionFactoryReset
+ // TODO: Implement this ...
+ ]
+ ['CONTROL_OPTION','6' PnDcp_Block_ControlOptionResetToFactory
+ // TODO: Implement this ...
+ ]
+
+ ////////////////////////////////////////////////////////////////////////////
+ // DEVICE_INITIATIVE_OPTION
+ ////////////////////////////////////////////////////////////////////////////
+ // 4.3.1.4.1 (Page 98)
+
+ ['DEVICE_INITIATIVE_OPTION','1' PnDcp_Block_DeviceInitiativeOption
+ // TODO: Implement this ...
+ ]
+
+ ////////////////////////////////////////////////////////////////////////////
+ // ALL_SELECTOR_OPTION
+ ////////////////////////////////////////////////////////////////////////////
+ // 4.3.1.4.1 (Page 99)
+
+ ['ALL_SELECTOR_OPTION','0xFF' PnDcp_Block_ALLSelector
+ // This type of block is empty
+ ]
+
+ ////////////////////////////////////////////////////////////////////////////
+ // Device manufacturer specific options 0x00-0xFF
+ ////////////////////////////////////////////////////////////////////////////
+ ]
+]
+
+[type PnDcp_SupportedDeviceOption byteOrder='BIG_ENDIAN'
+ [simple PnDcp_BlockOptions option]
+ [simple uint 8 suboption ]
+]
+
+// 4.3.1.3.2 (Page 94ff)
+// 4.3.1.3.2 (Page 94ff)
+// The spec lists meanings for request and response separately, but
+// they are actually mergeable, which we did in this construct.
+[type PnDcp_ServiceType byteOrder='BIG_ENDIAN'
+ [reserved uint 5 '0x00' ]
+ [simple bit notSupported]
+ [reserved uint 1 '0x00' ]
+ [simple bit response ]
+]
+
+// Page 86ff: Coding of the field FrameID
+[enum uint 16 PnDcp_FrameId
+ ['0x0000' RESERVED ]
+ // Range 1
+ ['0x0020' PTCP_RTSyncPDUWithFollowUp ]
+ // Range 2
+ ['0x0080' PTCP_RTSyncPDU ]
+ // Range 3
+ // 0x0100-0x0FFF RT_CLASS_3
+ ['0x0100' RT_CLASS_3 ]
+ // Range 4
+ // (Not used)
+ // Range 5
+ // (Not used)
+ // Range 6
+ // 0x8000-BFFF RT_CLASS_1
+ ['0x8000' RT_CLASS_1 ]
+ // Range 7
+ // 0XC000-FBFF RT_CLASS_UDP
+ ['0xC000' RT_CLASS_UDP ]
+ // Range 8
+ ['0xFC01' Alarm_High ]
+ ['0xFE01' Alarm_Low ]
+ ['0xFEFC' DCP_Hello_ReqPDU ]
+ ['0xFEFD' DCP_GetSet_PDU ]
+ ['0xFEFE' DCP_Identify_ReqPDU ]
+ ['0xFEFF' DCP_Identify_ResPDU ]
+ // Range 9
+ ['0xFF00' PTCP_AnnouncePDU ]
+ ['0xFF20' PTCP_FollowUpPDU ]
+ ['0xFF40' PTCP_DelayReqPDU ]
+ ['0xFF41' PTCP_DelayResPDUWithFollowUp ]
+ ['0xFF42' PTCP_DelayFuResPDUWithFollowUp ]
+ ['0xFF43' PTCP_DelayResPDUWithoutFollowUp]
+ // Range 12
+ // 0xFF80 - 0xFF8F FragmentationFrameId
+ ['0xFF80' FragmentationFrameId ]
+]
+
+// Page 94
+// All other values are "Reserved"
+[enum uint 8 PnDcp_ServiceId
+ ['0x03' GET ]
+ ['0x04' SET ]
+ ['0x05' IDENTIFY]
+ ['0x06' HELLO ]
+ //[RESERVED]
+]
+
+// 4.3.1.4.1 (Page 97)
+// All other values are "Reserved"
+[enum uint 8 PnDcp_BlockOptions
+ ['0x01' IP_OPTION ]
+ ['0x02' DEVICE_PROPERTIES_OPTION]
+ ['0x03' DCP_OPTION ]
+ ['0x05' CONTROL_OPTION ]
+ ['0x06' DEVICE_INITIATIVE_OPTION]
+ ['0xFF' ALL_SELECTOR_OPTION ]
+]
diff --git a/protocols/profinet/src/main/resources/protocols/profinet/pnio.mspec b/protocols/profinet/src/main/resources/protocols/profinet/pnio.mspec
new file mode 100644
index 0000000000..991c297130
--- /dev/null
+++ b/protocols/profinet/src/main/resources/protocols/profinet/pnio.mspec
@@ -0,0 +1,644 @@
+/*
+ * 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.
+ */
+
+/////////////////////////////////////////////////////////////////////////////////////////
+//
+// PROFINET IO
+//
+// CM: Context Manager
+//
+/////////////////////////////////////////////////////////////////////////////////////////
+
+// TODO: Check if it's really Little Endian
+// 5.1.2
+// 5.5.2.2
+[discriminatedType PnIoCm_Packet(DceRpc_PacketType packetType)
+ [typeSwitch packetType
+ ['REQUEST' PnIoCm_Packet_Req
+ [simple uint 32 argsMaximum ]
+ [implicit uint 32 argsLength 'lengthInBytes - 20']
+ [simple uint 32 arrayMaximumCount ]
+ [simple uint 32 arrayOffset ]
+ [implicit uint 32 arrayActualCount 'lengthInBytes - 20']
+ [array PnIoCm_Block blocks length 'argsLength']
+ ]
+ ['PING' PnIoCm_Packet_Ping
+ ]
+ ['RESPONSE' PnIoCm_Packet_Res
+ [simple uint 8 errorCode2 ]
+ [simple uint 8 errorCode1 ]
+ [simple uint 8 errorDecode ]
+ [simple uint 8 errorCode ]
+ [implicit uint 32 argsLength 'lengthInBytes - 1 - 1 - 1 - 1 - 4 - 4 - 4 - 4']
+ [simple uint 32 arrayMaximumCount ]
+ [simple uint 32 arrayOffset ]
+ [implicit uint 32 arrayActualCount 'lengthInBytes - 1 - 1 - 1 - 1 - 4 - 4 - 4 - 4' ]
+ [array PnIoCm_Block blocks length 'argsLength']
+ ]
+ ['FAULT' PnIoCm_Packet_Fault
+ [simple uint 32 status ]
+ ]
+ ['NO_CALL' PnIoCm_Packet_NoCall
+ ]
+ ['REJECT' PnIoCm_Packet_Rej
+ [simple uint 32 status ]
+ ]
+ ]
+]
+
+[type UserData(uint 32 recordDataLength) byteOrder='BIG_ENDIAN'
+ [array byte data count 'recordDataLength' ]
+]
+
+[type PnIo_CyclicServiceDataUnit(int 16 dataUnitLength)
+ [array byte data count 'dataUnitLength' ]
+]
+
+// Big Endian
+[discriminatedType PnIoCm_Block byteOrder='BIG_ENDIAN'
+ [discriminator PnIoCm_BlockType blockType ]
+ [typeSwitch blockType
+ ['IOD_WRITE_REQUEST_HEADER' IODWriteRequestHeader
+ [implicit uint 16 blockLength 'index < 0x8000 ? lengthInBytes - 4 - recordDataLength : lengthInBytes - 4']
+ [simple uint 8 blockVersionHigh ]
+ [simple uint 8 blockVersionLow ]
+ [simple uint 16 sequenceNumber ]
+ [simple Uuid arUuid ]
+ [simple uint 32 api ]
+ [simple uint 16 slotNumber ]
+ [simple uint 16 subSlotNumber ]
+ [const uint 16 padField 0x0000 ]
+ [simple uint 16 index ]
+ [simple uint 32 recordDataLength ]
+ [padding uint 8 pad '0x00' 'index < 0x8000 ? 64 - 6 - 2 - 16 - 4 - 2 - 2 - 2 - 2 - 4 : 64 - 6 - 2 - 16 - 4 - 2 - 2 - 2 - 2 - 4']
+ [optional UserData('recordDataLength') userData 'index < 0x8000' ]
+ ]
+ ['IOD_WRITE_RESPONSE_HEADER' IODWriteResponseHeader
+ [implicit uint 16 blockLength 'lengthInBytes - 4']
+ [simple uint 8 blockVersionHigh ]
+ [simple uint 8 blockVersionLow ]
+ [simple uint 16 sequenceNumber ]
+ [simple Uuid arUuid ]
+ [simple uint 32 api ]
+ [simple uint 16 slotNumber ]
+ [simple uint 16 subSlotNumber ]
+ [const uint 16 padField 0x0000 ]
+ [simple uint 16 index ]
+ [simple uint 32 recordDataLength ]
+ [padding uint 8 pad '0x00' '64 - 6 - 2 - 16 - 4 - 2 - 2 - 2 - 2 - 4']
+ ]
+ ['PD_INTERFACE_ADJUST' PDInterfaceAdjust
+ [implicit uint 16 blockLength 'lengthInBytes - 4']
+ [simple uint 8 blockVersionHigh ]
+ [simple uint 8 blockVersionLow ]
+ [const uint 16 padField 0x0000 ]
+ [const uint 16 multipleInterfaceModeReserved2 0x0000 ]
+ [const uint 15 multipleInterfaceModeReserved1 0x0000 ]
+ [simple MultipleInterfaceModeNameOfDevice multipleInterfaceModeNameOfDevice ]
+ ]
+ ['PD_PORT_DATA_CHECK' PDPortDataCheck
+ [implicit uint 16 blockLength 'lengthInBytes - 4']
+ [simple uint 8 blockVersionHigh ]
+ [simple uint 8 blockVersionLow ]
+ [const uint 16 padField 0x0000 ]
+ [simple uint 16 slotNumber ]
+ [simple uint 16 subSlotNumber ]
+ [simple PnIoCm_Block checkPeers ]
+ ]
+ ['CHECK_PEERS' CheckPeers
+ [implicit uint 16 blockLength 'lengthInBytes - 4']
+ [simple uint 8 blockVersionHigh ]
+ [simple uint 8 blockVersionLow ]
+ [const uint 8 noOfPeers 0x01 ]
+ [simple PascalString peerPortId ]
+ [simple PascalString peerChassisId ]
+ ]
+ ['AR_BLOCK_REQ' PnIoCm_Block_ArReq
+ [implicit uint 16 blockLength 'lengthInBytes - 4']
+ [simple uint 8 blockVersionHigh ]
+ [simple uint 8 blockVersionLow ]
+ [simple PnIoCm_ArType arType ]
+ [simple Uuid arUuid ]
+ [simple uint 16 sessionKey ]
+ [simple MacAddress cmInitiatorMacAddr ]
+ [simple DceRpc_ObjectUuid cmInitiatorObjectUuid ]
+ // Begin ARProperties
+ [simple bit pullModuleAlarmAllowed ]
+ [simple bit nonLegacyStartupMode ]
+ [simple bit combinedObjectContainerUsed ]
+ [reserved uint 17 '0x00000' ]
+ [simple bit acknowledgeCompanionAr ]
+ [simple PnIoCm_CompanionArType companionArType ]
+ [simple bit deviceAccess ]
+ [reserved uint 3 '0x0' ]
+ [simple bit cmInitiator ]
+ [simple bit supervisorTakeoverAllowed ]
+ [simple PnIoCm_State state ]
+ // End ARProperties
+ [simple uint 16 cmInitiatorActivityTimeoutFactor ]
+ [simple uint 16 cmInitiatorUdpRtPort ]
+ [implicit uint 16 stationNameLength 'STR_LEN(cmInitiatorStationName)']
+ [simple vstring 'stationNameLength * 8' cmInitiatorStationName ]
+ ]
+ ['AR_BLOCK_RES' PnIoCm_Block_ArRes
+ [implicit uint 16 blockLength 'lengthInBytes - 4']
+ [simple uint 8 blockVersionHigh ]
+ [simple uint 8 blockVersionLow ]
+ [simple PnIoCm_ArType arType ]
+ [simple Uuid arUuid ]
+ [simple uint 16 sessionKey ]
+ [simple MacAddress cmResponderMacAddr ]
+ [simple uint 16 responderUDPRTPort ]
+ ]
+ ['IOD_CONTROL_REQ' PnIoCm_Control_Request
+ [implicit uint 16 blockLength 'lengthInBytes - 4']
+ [simple uint 8 blockVersionHigh ]
+ [simple uint 8 blockVersionLow ]
+ [reserved uint 16 '0x0000' ]
+ [simple Uuid arUuid ]
+ [simple uint 16 sessionKey ]
+ [reserved uint 16 '0x0000' ]
+ [simple uint 16 controlCommand ]
+ [reserved uint 16 '0x0000' ]
+ ]
+ ['IOX_BLOCK_REQ' PnIoCM_Block_Request
+ [implicit uint 16 blockLength 'lengthInBytes - 4']
+ [simple uint 8 blockVersionHigh ]
+ [simple uint 8 blockVersionLow ]
+ [reserved uint 16 '0x0000' ]
+ [simple Uuid arUuid ]
+ [simple uint 16 sessionKey ]
+ [reserved uint 16 '0x0000' ]
+ [simple uint 16 controlCommand ]
+ [simple uint 16 controlBlockProperties ]
+ ]
+ ['IOX_BLOCK_RES' PnIoCM_Block_Response
+ [implicit uint 16 blockLength 'lengthInBytes - 4']
+ [simple uint 8 blockVersionHigh ]
+ [simple uint 8 blockVersionLow ]
+ [reserved uint 16 '0x0000' ]
+ [simple Uuid arUuid ]
+ [simple uint 16 sessionKey ]
+ [reserved uint 16 '0x0000' ]
+ [simple uint 16 controlCommand ]
+ [simple uint 16 controlBlockProperties ]
+ ]
+ ['IOD_CONTROL_RES' PnIoCm_Control_Response
+ [implicit uint 16 blockLength 'lengthInBytes - 4']
+ [simple uint 8 blockVersionHigh ]
+ [simple uint 8 blockVersionLow ]
+ [reserved uint 16 '0x0000' ]
+ [simple Uuid arUuid ]
+ [simple uint 16 sessionKey ]
+ [reserved uint 16 '0x0000' ]
+ [simple uint 16 controlCommand ]
+ [reserved uint 16 '0x0000' ]
+ ]
+ ['IO_CR_BLOCK_REQ' PnIoCm_Block_IoCrReq
+ [implicit uint 16 blockLength 'lengthInBytes - 4']
+ [simple uint 8 blockVersionHigh ]
+ [simple uint 8 blockVersionLow ]
+ [simple PnIoCm_IoCrType ioCrType ]
+ [simple uint 16 ioCrReference ]
+ [simple uint 16 lt ]
+ // Begin IOCRProperties
+ [simple bit fullSubFrameStructure ]
+ [simple bit distributedSubFrameWatchDog ]
+ [simple bit fastForwardingMacAdr ]
+ [reserved uint 17 '0x0000' ]
+ [simple bit mediaRedundancy ]
+ [reserved uint 7 '0x00' ]
+ [simple PnIoCm_RtClass rtClass ]
+ // End IOCRProperties
+ [simple uint 16 dataLength ]
+ [simple uint 16 frameId ]
+ [simple uint 16 sendClockFactor ]
+ [simple uint 16 reductionRatio ]
+ [simple uint 16 phase ]
+ [simple uint 16 sequence ]
+ [simple uint 32 frameSendOffset ]
+ [simple uint 16 watchDogFactor ]
+ [simple uint 16 dataHoldFactor ]
+ [simple uint 16 ioCrTagHeader ]
+ [simple MacAddress ioCrMulticastMacAdr ]
+ [implicit uint 16 numberOfApis 'COUNT(apis)' ]
+ [array PnIoCm_IoCrBlockReqApi apis count 'numberOfApis' ]
+ ]
+ ['IO_CR_BLOCK_RES' PnIoCm_Block_IoCrRes
+ [implicit uint 16 blockLength 'lengthInBytes - 4']
+ [simple uint 8 blockVersionHigh ]
+ [simple uint 8 blockVersionLow ]
+ [simple PnIoCm_IoCrType ioCrType ]
+ [simple uint 16 ioCrReference ]
+ [simple uint 16 frameId ]
+ ]
+ ['ALARM_CR_BLOCK_REQ' PnIoCm_Block_AlarmCrReq
+ [implicit uint 16 blockLength 'lengthInBytes - 4']
+ [simple uint 8 blockVersionHigh ]
+ [simple uint 8 blockVersionLow ]
+ [simple PnIoCm_AlarmCrType alarmType ]
+ [simple uint 16 lt ]
+ // Begin AlarmCrProperties
+ [reserved uint 30 '0x00000000' ]
+ [simple bit transport ]
+ [simple bit priority ]
+ // End AlarmCrProperties
+ [simple uint 16 rtaTimeoutFactor ]
+ [simple uint 16 rtaRetries ]
+ [simple uint 16 localAlarmReference ]
+ [simple uint 16 maxAlarmDataLength ]
+ [simple uint 16 alarmCtrTagHeaderHigh ]
+ [simple uint 16 alarmCtrTagHeaderLow ]
+ ]
+ ['ALARM_CR_BLOCK_RES' PnIoCm_Block_AlarmCrRes
+ [implicit uint 16 blockLength 'lengthInBytes - 4']
+ [simple uint 8 blockVersionHigh ]
+ [simple uint 8 blockVersionLow ]
+ [simple PnIoCm_AlarmCrType alarmType ]
+ [simple uint 16 localAlarmReference ]
+ [simple uint 16 maxAlarmDataLength ]
+ ]
+ ['EXPECTED_SUBMODULE_BLOCK_REQ' PnIoCm_Block_ExpectedSubmoduleReq
+ [implicit uint 16 blockLength 'lengthInBytes - 4']
+ [simple uint 8 blockVersionHigh ]
+ [simple uint 8 blockVersionLow ]
+ [implicit uint 16 numberOfApis 'COUNT(apis)' ]
+ [array PnIoCm_ExpectedSubmoduleBlockReqApi apis count 'numberOfApis' ]
+ ]
+ ['MODULE_DIFF_BLOCK' PnIoCm_Block_ModuleDiff
+ [implicit uint 16 blockLength 'lengthInBytes - 4']
+ [simple uint 8 blockVersionHigh ]
+ [simple uint 8 blockVersionLow ]
+ [implicit uint 16 numberOfApis 'COUNT(apis)' ]
+ [array PnIoCm_ModuleDiffBlockApi apis count 'numberOfApis' ]
+ ]
+ ['AR_SERVER_BLOCK' PnIoCm_Block_ArServer
+ [implicit uint 16 blockLength 'lengthInBytes - 4']
+ [simple uint 8 blockVersionHigh ]
+ [simple uint 8 blockVersionLow ]
+ [simple PascalString stationName ]
+ [padding uint 8 pad '0x00' '20 - 6 - (stationName.stringLength)' ]
+ ]
+ ]
+]
+
+[type PnIoCm_IoCrBlockReqApi byteOrder='BIG_ENDIAN'
+ [const uint 32 api 0x00000000 ]
+ [implicit uint 16 numIoDataObjects 'COUNT(ioDataObjects)' ]
+ [array PnIoCm_IoDataObject ioDataObjects count 'numIoDataObjects' ]
+ [implicit uint 16 numIoCss 'COUNT(ioCss)' ]
+ [array PnIoCm_IoCs ioCss count 'numIoCss' ]
+]
+
+[type PnIoCm_IoDataObject byteOrder='BIG_ENDIAN'
+ [simple uint 16 slotNumber ]
+ [simple uint 16 subSlotNumber ]
+ [simple uint 16 ioDataObjectFrameOffset]
+]
+
+[type PnIoCm_IoCs byteOrder='BIG_ENDIAN'
+ [simple uint 16 slotNumber ]
+ [simple uint 16 subSlotNumber]
+ [simple uint 16 ioFrameOffset]
+]
+
+[type PnIoCm_DataUnitIoCs byteOrder='BIG_ENDIAN'
+ [simple bit dataState]
+ [simple uint 2 instance ]
+ [reserved uint 4 '0x00' ]
+ [simple bit extension]
+]
+
+[type PnIoCm_DataUnitDataObject(uint 16 dataObjectLength) byteOrder='BIG_ENDIAN'
+ [array byte dataState count 'dataObjectLength']
+ [simple PnIoCm_DataUnitIoCs iops ]
+]
+
+[type PnIoCm_ExpectedSubmoduleBlockReqApi byteOrder='BIG_ENDIAN'
+ [const uint 32 api 0x00000000 ]
+ [simple uint 16 slotNumber ]
+ [simple uint 32 moduleIdentNumber ]
+ [simple uint 16 moduleProperties ]
+ [implicit uint 16 numSubmodules 'COUNT(submodules)' ]
+ [array PnIoCm_Submodule submodules count 'numSubmodules']
+]
+
+[type PnIoCm_ModuleDiffBlockApi byteOrder='BIG_ENDIAN'
+ [const uint 32 api 0x00000000 ]
+ [implicit uint 16 numModules 'COUNT(modules)' ]
+ [array PnIoCm_ModuleDiffBlockApi_Module modules count 'numModules']
+]
+
+[type PnIoCm_ModuleDiffBlockApi_Module byteOrder='BIG_ENDIAN'
+ [simple uint 16 slotNumber ]
+ [simple uint 32 moduleIdentNumber ]
+ [simple PnIoCm_ModuleState moduleState ]
+ [implicit uint 16 numSubmodules 'COUNT(submodules)' ]
+ [array PnIoCm_ModuleDiffBlockApi_Submodule submodules count 'numSubmodules']
+]
+
+[type PnIoCm_ModuleDiffBlockApi_Submodule byteOrder='BIG_ENDIAN'
+ [simple uint 16 subslotNumber ]
+ [simple uint 32 submoduleIdentNumber]
+ [simple bit codingUsesIdentInfo ]
+ [simple PnIoCm_IdentInfo identInfo ]
+ [simple PnIoCm_ArInfo arInfo ]
+ [simple bit diagInfoAvailable ]
+ [simple bit maintenanceDemanded ]
+ [simple bit maintenanceRequired ]
+ [simple bit qualifiedInfo ]
+ [simple PnIoCm_AddInfo addInfo ]
+]
+
+[discriminatedType PnIoCm_Submodule byteOrder='BIG_ENDIAN'
+ [simple uint 16 slotNumber ]
+ [simple uint 32 submoduleIdentNumber ]
+ // Begin SubmoduleProperties
+ [reserved uint 10 '0x000' ]
+ [simple bit discardIoxs ]
+ [simple bit reduceOutputModuleDataLength ]
+ [simple bit reduceInputModuleDataLength ]
+ [simple bit sharedInput ]
+ [discriminator PnIoCm_SubmoduleType submoduleType ]
+ // End SubmoduleProperties
+ [typeSwitch submoduleType
+ ['NO_INPUT_NO_OUTPUT_DATA' PnIoCm_Submodule_NoInputNoOutputData
+ [const uint 16 dataDescription 0x0001]
+ [const uint 16 submoduleDataLength 0x0000]
+ [const uint 8 lengthIoCs 0x01 ]
+ [const uint 8 lengthIoPs 0x01 ]
+ ]
+ ['INPUT_DATA' PnIoCm_Submodule_InputData
+ [const uint 16 inputDataDescription 0x0001]
+ [simple uint 16 inputSubmoduleDataLength ]
+ [simple uint 8 inputLengthIoCs ]
+ [simple uint 8 inputLengthIoPs ]
+ ]
+ ['OUTPUT_DATA' PnIoCm_Submodule_OutputData
+ [const uint 16 inputDataDescription 0x0002]
+ [simple uint 16 inputSubmoduleDataLength ]
+ [simple uint 8 inputLengthIoCs ]
+ [simple uint 8 inputLengthIoPs ]
+ ]
+ ['INPUT_AND_OUTPUT_DATA' PnIoCm_Submodule_InputAndOutputData
+ [const uint 16 inputDataDescription 0x0001]
+ [simple uint 16 inputSubmoduleDataLength ]
+ [simple uint 8 inputLengthIoCs ]
+ [simple uint 8 inputLengthIoPs ]
+ [const uint 16 outputDataDescription 0x0002]
+ [simple uint 16 outputSubmoduleDataLength ]
+ [simple uint 8 outputLengthIoCs ]
+ [simple uint 8 outputLengthIoPs ]
+ ]
+ ]
+]
+
+[enum uint 16 PnIoCm_BlockType
+ ['0x0008' IOD_WRITE_REQUEST_HEADER ]
+ ['0x0101' AR_BLOCK_REQ ]
+ ['0x0102' IO_CR_BLOCK_REQ ]
+ ['0x0103' ALARM_CR_BLOCK_REQ ]
+ ['0x0104' EXPECTED_SUBMODULE_BLOCK_REQ]
+ ['0x0110' IOD_CONTROL_REQ ]
+ ['0x0112' IOX_BLOCK_REQ ]
+ ['0x0200' PD_PORT_DATA_CHECK ]
+ ['0x020a' CHECK_PEERS ]
+ ['0x0250' PD_INTERFACE_ADJUST ]
+ ['0x8008' IOD_WRITE_RESPONSE_HEADER ]
+ ['0x8101' AR_BLOCK_RES ]
+ ['0x8102' IO_CR_BLOCK_RES ]
+ ['0x8103' ALARM_CR_BLOCK_RES ]
+ ['0x8104' MODULE_DIFF_BLOCK ]
+ ['0x8106' AR_SERVER_BLOCK ]
+ ['0x8110' IOD_CONTROL_RES ]
+ ['0x8112' IOX_BLOCK_RES ]
+]
+
+[enum uint 8 ProfinetDeviceState
+ ['0x00' IDLE]
+ ['0x01' STARTUP]
+ ['0x02' PREMED]
+ ['0x03' WAITAPPLRDY]
+ ['0x04' APPLRDY]
+ ['0x05' CYCLICDATA]
+ ['0xFF' ABORT]
+]
+
+[enum uint 16 PnIoCm_ArType
+ ['0x0001' IO_CONTROLLER]
+]
+
+[enum uint 2 PnIoCm_CompanionArType
+ ['0x0' SINGLE_AR]
+]
+
+[enum uint 3 PnIoCm_State
+ ['0x1' ACTIVE]
+]
+
+[enum uint 16 PnIoCm_IoCrType
+ ['0x0001' INPUT_CR]
+ ['0x0002' OUTPUT_CR]
+]
+
+[enum uint 4 PnIoCm_RtClass
+ ['0x2' RT_CLASS_2]
+]
+
+[enum uint 16 PnIoCm_AlarmCrType
+ ['0x0001' ALARM_CR]
+]
+
+[enum uint 16 PnIoCm_ModuleState
+ ['0x0002' PROPER_MODULE]
+]
+
+[enum uint 2 PnIoCm_SubmoduleType
+ ['0x0' NO_INPUT_NO_OUTPUT_DATA]
+ ['0x1' INPUT_DATA]
+ ['0x2' OUTPUT_DATA]
+ ['0x3' INPUT_AND_OUTPUT_DATA]
+]
+
+[enum bit MultipleInterfaceModeNameOfDevice
+ ['false' PORT_PROVIDED_BY_LLDP]
+ ['true' NAME_PROVIDED_BY_LLDP]
+]
+
+[enum uint 16 PnIoCm_DescriptionType
+ ['0x0001' INPUT]
+]
+
+[enum uint 4 PnIoCm_IdentInfo
+ ['0x0' OK]
+]
+
+[enum uint 4 PnIoCm_ArInfo
+ ['0x0' OWN]
+]
+
+[enum uint 3 PnIoCm_AddInfo
+ ['0x0' NONE]
+]
+
+[enum uint 4 IntegerEncoding
+ ['0x0' BIG_ENDIAN]
+ ['0x1' LITTLE_ENDIAN]
+]
+
+[enum uint 4 CharacterEncoding
+ ['0x0' ASCII]
+ ['0x1' EBCDIC]
+]
+
+[enum uint 8 FloatingPointEncoding
+ ['0x00' IEEE]
+ ['0x01' VAX ]
+ ['0x02' CRAY]
+ ['0x03' IBM ]
+]
+
+
+[dataIo DataItem(ProfinetDataType dataType, uint 16 numberOfValues)
+ [typeSwitch dataType,numberOfValues
+ ['BOOL','1' BOOL
+ [simple bit value ]
+ ]
+ ['BOOL' List
+ [array bit value count 'numberOfValues' ]
+ ]
+ ['BYTE','1' BYTE
+ [simple uint 8 value]
+ ]
+ ['BYTE' List
+ [array bit value count 'numberOfValues * 8' ]
+ ]
+ ['WORD' WORD
+ [simple uint 16 value]
+ ]
+ ['DWORD' DWORD
+ [simple uint 32 value]
+ ]
+ ['LWORD' LWORD
+ [simple uint 64 value]
+ ]
+ ['SINT','1' SINT
+ [simple int 8 value ]
+ ]
+ ['SINT' List
+ [array int 8 value count 'numberOfValues']
+ ]
+ ['INT','1' INT
+ [simple int 16 value]
+ ]
+ ['INT' List
+ [array int 16 value count 'numberOfValues']
+ ]
+ ['DINT','1' DINT
+ [simple int 32 value]
+ ]
+ ['DINT' List
+ [array int 32 value count 'numberOfValues']
+ ]
+ ['LINT','1' LINT
+ [simple int 64 value]
+ ]
+ ['LINT' List
+ [array int 64 value count 'numberOfValues']
+ ]
+ ['USINT','1' USINT
+ [simple uint 8 value ]
+ ]
+ ['USINT' List
+ [array uint 8 value count 'numberOfValues']
+ ]
+ ['UINT','1' UINT
+ [simple uint 16 value]
+ ]
+ ['UINT' List
+ [array uint 16 value count 'numberOfValues']
+ ]
+ ['UDINT','1' UDINT
+ [simple uint 32 value]
+ ]
+ ['UDINT' List
+ [array uint 32 value count 'numberOfValues']
+ ]
+ ['ULINT','1' ULINT
+ [simple uint 64 value]
+ ]
+ ['ULINT' List
+ [array uint 64 value count 'numberOfValues']
+ ]
+ ['REAL','1' REAL
+ [simple float 32 value]
+ ]
+ ['REAL' List
+ [array float 32 value count 'numberOfValues']
+ ]
+ ['LREAL','1' LREAL
+ [simple float 64 value]
+ ]
+ ['LREAL' List
+ [array float 64 value count 'numberOfValues']
+ ]
+ ['CHAR','1' CHAR
+ [simple string 8 value encoding='"UTF-8"']
+ ]
+ ['CHAR' List
+ [array string 8 value count 'numberOfValues' encoding='"UTF-8"']
+ ]
+ ['WCHAR','1' WCHAR
+ [simple string 16 value encoding='"UTF-16"']
+ ]
+ ['WCHAR' List
+ [array string 16 value count 'numberOfValues' encoding='"UTF-16"']
+ ]
+ ]
+]
+
+[enum uint 8 ProfinetDataType(uint 8 dataTypeSize, string 16 conversion)
+ ['1' BOOL ['1','BOOLEAN']]
+ ['2' BYTE ['1','BYTE']]
+ ['3' WORD ['2','WORD']]
+ ['4' DWORD ['4','DWORD']]
+ ['5' LWORD ['8','LWORD']]
+ ['6' SINT ['1','SIGNED8']]
+ ['7' INT ['2','SIGNED16']]
+ ['8' DINT ['4','SIGNED32']]
+ ['9' LINT ['8','SIGNED64']]
+ ['10' USINT ['1','UNSIGNED8']]
+ ['11' UINT ['2','UNSIGNED16']]
+ ['12' UDINT ['4','UNSIGNED32']]
+ ['13' ULINT ['8','UNSIGNED64']]
+ ['14' REAL ['4','FLOAT32']]
+ ['15' LREAL ['8','FLOAT64']]
+ ['16' TIME ['8','TIME']]
+ ['17' LTIME ['8','LTIME']]
+ ['18' DATE ['8','DATE']]
+ ['19' LDATE ['8','LDATE']]
+ ['20' TIME_OF_DAY ['8','TIME_OF_DAY']]
+ ['21' LTIME_OF_DAY ['8','LTIME_OF_DAY']]
+ ['22' DATE_AND_TIME ['8','DATE_AND_TIME']]
+ ['23' LDATE_AND_TIME ['8','LDATE_AND_TIME']]
+ ['24' CHAR ['1','CHAR']]
+ ['25' WCHAR ['2','WCHAR']]
+ ['26' STRING ['1','STRING']]
+ ['27' WSTRING ['2','WSTRING']]
+]
diff --git a/protocols/profinet/src/main/resources/protocols/profinet/profinet.mspec b/protocols/profinet/src/main/resources/protocols/profinet/profinet.mspec
deleted file mode 100644
index a2775061ed..0000000000
--- a/protocols/profinet/src/main/resources/protocols/profinet/profinet.mspec
+++ /dev/null
@@ -1,1431 +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.
- */
-
- /*
- Overview of the Protocols involved in this driver:
-
- Ethernet
- Udp (Based on Ethernet)
- DceRpc (Based on Udp and Ethernet)
-
- ARP Address Resolution Protocol (Based on Ethernet)
- LLDP Link Layer Discovery Protocol (Based on Ethernet)
-
- PnDcp PROFINET Discovery and Configuration Protocol (Based on Ethernet)
- PnIoCm PROFINET IO Context Manager (Based on DCP/RPC, UDP and Ethernet)
- PnIo PROFINET IO (Based on Ethernet)
- PnIoPs PROFIsafe protocol (Based on Ethernet)
- PnIoAl PROFINET Alarm Events (Based on Ethernet)
-
- // Not really handled in this driver (Just listed for the sake of completeness)
- PnPtcp PROFINET Precision Transparent Clock Protocol
-*/
-
-[type Ethernet_Frame byteOrder='BIG_ENDIAN'
- // When sending to the mac address prefix of 01:0e:cf are multicast packets
- [simple MacAddress destination]
- [simple MacAddress source ]
- [simple Ethernet_FramePayload payload ]
-]
-
-[discriminatedType Ethernet_FramePayload
- [discriminator uint 16 packetType]
- [typeSwitch packetType
- ['0x0800' Ethernet_FramePayload_IPv4
- [const uint 4 version 0x4 ]
- // 5 = 5 x 32bit = 5 x 4byte = 20byte
- [const uint 4 headerLength 0x5 ]
- [const uint 6 differentiatedServicesCodepoint 0x00 ]
- [const uint 2 explicitCongestionNotification 0x0 ]
- // Length of the header + payload
- [implicit uint 16 totalLength '28 + payload.lengthInBytes']
- [simple uint 16 identification ]
- [reserved bit 'false' ]
- [simple bit dontFragment ]
- [simple bit moreFragments ]
- [const uint 13 fragmentOffset 0x00 ]
- [simple uint 8 timeToLive ]
- // Protocol: UDP
- [const uint 8 protocol 0x11 ]
- // It seems that modern NICs mess this up as they take care of the validation in dedicated hardware.
- // This results in the wrong values being read. Using a 'checksum' field would fail most incoming packets.
- [implicit uint 16 headerChecksum 'STATIC_CALL("calculateIPv4Checksum", totalLength, identification, timeToLive, sourceAddress, destinationAddress)']
- [simple IpAddress sourceAddress ]
- [simple IpAddress destinationAddress ]
- // Begin of the UDP packet part
- [simple uint 16 sourcePort ]
- [simple uint 16 destinationPort ]
- [implicit uint 16 packetLength '8 + payload.lengthInBytes' ]
- [implicit uint 16 bodyChecksum 'STATIC_CALL("calculateUdpChecksum", sourceAddress, destinationAddress, sourcePort, destinationPort, packetLength, payload)']
- [simple DceRpc_Packet payload ]
- ]
- ['0x8100' Ethernet_FramePayload_VirtualLan
- [simple VirtualLanPriority priority ]
- [simple bit ineligible ]
- [simple uint 12 id ]
- [simple Ethernet_FramePayload payload ]
- ]
- ['0x8892' Ethernet_FramePayload_PnDcp
- [simple PnDcp_Pdu pdu ]
- ]
- ['0x88cc' Ethernet_FramePayload_LLDP
- [simple Lldp_Pdu pdu ]
- ]
- ]
-]
-
-[type Lldp_Pdu
- [manualArray LldpUnit lldpParameters terminated 'STATIC_CALL("isSysexEnd", readBuffer)' 'STATIC_CALL("parseSysexString", readBuffer)' 'STATIC_CALL("serializeSysexString", writeBuffer, _value)' 'STATIC_CALL("lengthSysexString", lldpParameters)']
-]
-
-[discriminatedType LldpUnit
- [discriminator TlvType tlvId ]
- [simple uint 9 tlvIdLength ]
- [typeSwitch tlvId
- ['END_OF_LLDP' EndOfLldp
- ]
- ['CHASSIS_ID' TlvChassisId(uint 9 tlvIdLength)
- [simple uint 8 chassisIdSubType ]
- [simple vstring '(tlvIdLength - 1) * 8' chassisId ]
- ]
- ['PORT_ID' TlvPortId(uint 9 tlvIdLength)
- [simple uint 8 portIdSubType ]
- [simple vstring '(tlvIdLength - 1) * 8' portId ]
- ]
- ['TIME_TO_LIVE' TlvTimeToLive
- [simple uint 16 tlvTimeToLiveUnit ]
- ]
- ['PORT_DESCRIPTION' TlvPortDescription(uint 9 tlvIdLength)
- [simple vstring '(tlvIdLength) * 8' chassisId ]
- ]
- ['SYSTEM_NAME' TlvSystemName(uint 9 tlvIdLength)
- [simple vstring '(tlvIdLength) * 8' chassisId ]
- ]
- ['SYSTEM_DESCRIPTION' TlvSystemDescription(uint 9 tlvIdLength)
- [simple vstring '(tlvIdLength) * 8' chassisId ]
- ]
- ['SYSTEM_CAPABILITIES' TlvSystemCapabilities
- [reserved uint 8 '0x00' ]
- [simple bit stationOnlyCapable ]
- [simple bit docsisCableDeviceCapable ]
- [simple bit telephoneCapable ]
- [simple bit routerCapable ]
- [simple bit wlanAccessPointCapable ]
- [simple bit bridgeCapable ]
- [simple bit repeaterCapable ]
- [simple bit otherCapable ]
- [reserved uint 8 '0x00' ]
- [simple bit stationOnlyEnabled ]
- [simple bit docsisCableDeviceEnabled ]
- [simple bit telephoneEnabled ]
- [simple bit routerEnabled ]
- [simple bit wlanAccessPointEnabled ]
- [simple bit bridgeEnabled ]
- [simple bit repeaterEnabled ]
- [simple bit otherEnabled ]
- ]
- ['MANAGEMENT_ADDRESS' TlvManagementAddress
- [implicit uint 8 addressStringLength '5' ]
- [simple ManagementAddressSubType addressSubType ]
- [simple IpAddress ipAddress ]
- [simple uint 8 interfaceSubType ]
- [simple uint 32 interfaceNumber ]
- [simple uint 8 oidStringLength ]
- ]
- ['ORGANIZATION_SPECIFIC' TlvOrganizationSpecific
- [simple TlvOrganizationSpecificUnit organizationSpecificUnit ]
- ]
- ]
-]
-
-[discriminatedType TlvOrganizationSpecificUnit
- [discriminator uint 24 uniqueCode]
- [typeSwitch uniqueCode
- ['0x000ECF' TlvOrgSpecificProfibus
- [simple TlvOrgSpecificProfibusUnit specificUnit ]
- ]
- ['0x00120F' TlvOrgSpecificIeee8023
- [simple TlvOrgSpecificIeee8023Unit specificUnit ]
- ]
- ]
-]
-
-[discriminatedType TlvOrgSpecificIeee8023Unit
- [discriminator TlvIEEESubType subType]
- [typeSwitch subType
- ['MAC_PHY_CONFIG_STATUS' TlvIeee8023MacPhyConfigStatus
- [simple uint 8 negotiationSupport ]
- [simple uint 16 negotiationCapability ]
- [simple uint 16 operationalMauType ]
- ]
- ['MAX_FRAME_SIZE' TlvIeee8023MaxFrameSize
- [simple uint 16 maxSize ]
- ]
- ]
-]
-
-[discriminatedType TlvOrgSpecificProfibusUnit
- [discriminator TlvProfibusSubType subType]
- [typeSwitch subType
- ['MEASURED_DELAY' TlvProfibusSubTypeMeasuredDelay
- [simple uint 32 localPortRxDelay]
- [simple uint 32 remotePortRxDelay]
- [simple uint 32 localPortTxDelay]
- [simple uint 32 remotePortTxDelay]
- ]
- ['PORT_STATUS' TlvProfibusSubTypePortStatus
- [simple uint 16 rtClass2PortStatus]
- [reserved uint 2 '0x00' ]
- [simple bit preample ]
- [simple bit fragmentation ]
- [reserved uint 9 '0x00' ]
- [simple uint 3 rtClass3PortStatus]
- ]
- ['MRP_PORT_STATUS' TlvProfibusSubTypeMrpPortStatus
- [simple Uuid macAddress]
- [simple uint 16 Status]
- ]
- ['CHASSIS_MAC' TlvProfibusSubTypeChassisMac
- [simple MacAddress macAddress]
- ]
- ]
-]
-
-[enum uint 8 TlvIEEESubType
- ['0x01' MAC_PHY_CONFIG_STATUS]
- ['0x04' MAX_FRAME_SIZE]
-]
-
-[enum uint 8 TlvProfibusSubType
- ['0x01' MEASURED_DELAY]
- ['0x02' PORT_STATUS]
- ['0x04' MRP_PORT_STATUS]
- ['0x05' CHASSIS_MAC]
-]
-
-// 4.10.3.2
-// A lot of the fields are set to constant values, which would
-// usually be dynamic. However are we trying to limit the number of
-// arguments needed to construct the messages and Profinet only seems
-// be using a very limited subset of all possible DCE/RPC packets.
-[type DceRpc_Packet byteOrder='BIG_ENDIAN'
-// RPC Header {
- // RPCVersion 4.10.3.2.1
- [const uint 8 version 0x04 ]
- // RPCPacketType 4.10.3.2.2 (8 bit)
- [simple DceRpc_PacketType packetType ]
- // PRCFlags 4.10.3.2.3
- [reserved bit 'false' ]
- [const bit broadcast false ]
- [simple bit idempotent ]
- [const bit maybe false ]
- [simple bit noFragmentAcknowledgeRequested ]
- [const bit fragment false ]
- [simple bit lastFragment ]
- [reserved bit 'false' ]
- // PRCFlags2 4.10.3.2.4
- [reserved uint 6 '0x00' ]
- [const bit cancelWasPending false ]
- [reserved bit 'false' ]
- // RPCDRep 4.10.3.2.5 (4 bit & 4 bit)
- [simple IntegerEncoding integerEncoding ]
- [simple CharacterEncoding characterEncoding ]
- // RPCDRep2 4.10.3.2.5 (8 bit)
- [simple FloatingPointEncoding floatingPointEncoding ]
- // RPCDRep3 (8 bit shall be 0)
- [reserved uint 8 '0x00' ]
- // RPCSerialHigh 4.10.3.2.6
- [const uint 8 serialHigh 0x00 ]
- [batchSet byteOrder='integerEncoding == IntegerEncoding.BIG_ENDIAN ? BIG_ENDIAN : LITTLE_ENDIAN'
- // RPCObjectUUID 4.10.3.2.8
- // RPCObjectUUID 4.10.3.2.8
- [simple DceRpc_ObjectUuid objectUuid ]
- // RPCInterfaceUUID 4.10.3.2.9
- [simple DceRpc_InterfaceUuid interfaceUuid ]
- // RPCActivityUUID 4.10.3.2.10
- [simple DceRpc_ActivityUuid activityUuid ]
- // RPCServerBootTime 4.10.3.2.11
- [simple uint 32 serverBootTime ]
- // RPCInterfaceVersion 4.10.3.2.12
- [const uint 32 interfaceVer 0x00000001 ]
- // RPCSequenceNmb 4.10.3.2.13
- [simple uint 32 sequenceNumber ]
- // RPCOperationNmb 4.10.3.2.14
- [simple DceRpc_Operation operation ]
- // RPCInterfaceHint 4.10.3.2.15
- [const uint 16 interfaceHint 0xFFFF ]
- // RPCActivityHint 4.10.3.2.16
- [const uint 16 activityHint 0xFFFF ]
- // RPCLengthOfBody 4.10.3.2.17
- [implicit uint 16 lengthOfBody 'payload.lengthInBytes']
- // RPCFragmentNmb 4.10.3.2.18 (Setting this to 0 as we will probably never have anything but 0 here
- [const uint 16 fragmentNum 0x0000 ]
- // RPCAuthenticationProtocol 4.10.3.2.19
- [const uint 8 authProto 0x00 ]
- ]
- // RPCSerialLow 4.10.3.2.7
- [const uint 8 serialLow 0x00 ]
-// RPC Header }
-// RPC Payload {
- [simple PnIoCm_Packet('packetType') payload byteOrder='integerEncoding == IntegerEncoding.BIG_ENDIAN ? BIG_ENDIAN : LITTLE_ENDIAN' ]
-// RPC Payload }
-]
-
-// RPCObjectUUID 4.10.3.2.8
-[type DceRpc_ObjectUuid
- [const uint 32 data1 0xDEA00000 ]
- [const uint 16 data2 0x6C97 ]
- [const uint 16 data3 0x11D1 ]
- // This part is described as a byte array, so the byte order is always big-endian
- [const uint 16 data4 0x8271 byteOrder='BIG_ENDIAN']
- [simple uint 4 interfaceNumber byteOrder='BIG_ENDIAN']
- [simple uint 12 nodeNumber byteOrder='BIG_ENDIAN']
- [simple uint 16 deviceId byteOrder='BIG_ENDIAN']
- [simple uint 16 vendorId byteOrder='BIG_ENDIAN']
-]
-
-// RPCInterfaceUUID 4.10.3.2.9
-// NOTE: If we would have been only using Big Endian encoding, we would have
-// implemented this via an enum. However as the first 8 bytes are
-// dynamically endianed and the last 8 bytes are set to Big Endian, we
-// had to do this trick.
-[discriminatedType DceRpc_InterfaceUuid
- [discriminator uint 32 interfaceType ]
- [const uint 16 data1 0x6C97 ]
- [const uint 16 data2 0x11D1 ]
- // This part is described as a byte array, so the byte order is always big-endian
- [const uint 16 data3 0x8271 byteOrder='BIG_ENDIAN']
- [const uint 16 data4 0x00A0 byteOrder='BIG_ENDIAN']
- [const uint 16 data5 0x2442 byteOrder='BIG_ENDIAN']
- [const uint 16 data6 0xDF7D byteOrder='BIG_ENDIAN']
- [typeSwitch interfaceType
- ['0xDEA00001' DceRpc_InterfaceUuid_DeviceInterface
- ]
- ['0xDEA00002' DceRpc_InterfaceUuid_ControllerInterface
- ]
- ['0xDEA00003' DceRpc_InterfaceUuid_SupervisorInterface
- ]
- ['0xDEA00004' DceRpc_InterfaceUuid_ParameterInterface
- ]
- ]
-]
-
-// RPCActivityUUID 4.10.3.2.10
-// NOTE: This value is generally randomly generated by the initiator
-// and used throughout the entire communication. Unfortunately,
-// the first parts are effected by endianess, and the last 8
-// bytes are fixed big-endian. Therefore the complicated notation.
-[type DceRpc_ActivityUuid
- [simple uint 32 data1 ]
- [simple uint 16 data2 ]
- [simple uint 16 data3 ]
- // This part is described as a byte array, so the byte order is always big-endian
- [array byte data4 count '8']
-]
-
-// There are some special MAC addresses reserved:
-// 01-0E-CF-00-00-00: As destination for DCP-Identify-ReqPDU (The FrameID is then required to be set to 0xFEFE)
-// 01-0E-CF-00-00-01: As destination for DCP-Helo-ReqPDU (The FrameID is then required to be set to 0xFEFC)
-// 01-0E-CF-00-00-02: Reserved
-// 01-0E-CF-00-01-00: Reserved for further multicast addresses within the Type 10 context
-// 01-0E-CF-00-01-01: As multicast destination for RT_CLASS_3
-// 01-0E-CF-00-01-02: As invalid frame multicast destination for RT_CLASS_3
-// 01-0E-CF-00-01-03 - FF: Reserved for further multicast addresses within the Type 10 context
-[type MacAddress
- [array byte address count '6']
-]
-
-[type IpAddress
- [array byte data count '4']
-]
-
-// 4.10.3.2.2
-[enum uint 8 DceRpc_PacketType
- ['0x00' REQUEST ]
- ['0x01' PING ]
- ['0x02' RESPONSE ]
- ['0x03' FAULT ]
- ['0x04' WORKING ]
- // Response to PING
- ['0x05' NO_CALL ]
- ['0x06' REJECT ]
- ['0x07' ACKNOWLEDGE ]
- ['0x08' CONNECTIONLESS_CANCEL]
- ['0x09' FRAGMENT_ACKNOWLEDGE ]
- ['0x0A' CANCEL_ACKNOWLEDGE ]
-]
-
-//LLDP Specific
-[enum uint 7 TlvType
- ['0x00' END_OF_LLDP ]
- ['0x01' CHASSIS_ID ]
- ['0x02' PORT_ID ]
- ['0x03' TIME_TO_LIVE ]
- ['0x04' PORT_DESCRIPTION ]
- ['0x05' SYSTEM_NAME ]
- ['0x06' SYSTEM_DESCRIPTION ]
- ['0x07' SYSTEM_CAPABILITIES ]
- ['0x08' MANAGEMENT_ADDRESS ]
- ['0x7F' ORGANIZATION_SPECIFIC]
-]
-
-[enum uint 8 ManagementAddressSubType
- ['0x00' UNKNOWN ]
- ['0x01' IPV4 ]
-]
-
-// 4.10.3.2.14
-[enum uint 16 DceRpc_Operation
- ['0x0000' CONNECT ]
- ['0x0001' RELEASE ]
- ['0x0002' READ ]
- ['0x0003' WRITE ]
- ['0x0004' CONTROL ]
- ['0x0005' READ_IMPLICIT]
-]
-
-// https://de.wikipedia.org/wiki/IEEE_802.1p
-[enum uint 3 VirtualLanPriority (string 16 acronym)
- ['0x0' BEST_EFFORT ['BE' ]]
- ['0x1' BACKGROUND ['BK' ]]
- ['0x2' EXCELLENT_EFFORT ['EE' ]]
- ['0x3' CRITICAL_APPLICATIONS ['CA' ]]
- ['0x4' VIDEO ['VI' ]]
- ['0x5' VOICE ['VO' ]]
- ['0x6' INTERNETWORK_CONTROL ['IC' ]]
- ['0x7' NETWORK_CONTROL ['NC' ]]
-]
-
-/////////////////////////////////////////////////////////////////////////////////////////
-//
-// PROFINET DCP
-//
-// Discovery and basic configuration
-//
-/////////////////////////////////////////////////////////////////////////////////////////
-
-// Page 90
-[discriminatedType PnDcp_Pdu
- [simple uint 16 frameIdValue ]
- [virtual PnDcp_FrameId frameId 'STATIC_CALL("getFrameId", frameIdValue)']
- [typeSwitch frameId
- ['RT_CLASS_1' PnDcp_Pdu_RealTimeCyclic
- [manual PnIo_CyclicServiceDataUnit
- dataUnit
- 'STATIC_CALL("readDataUnit", readBuffer)'
- 'STATIC_CALL("writeDataUnit", writeBuffer, dataUnit)'
- '(dataUnit.lengthInBytes)*8' ]
- [simple uint 16 cycleCounter ]
- // Data Status Start (4.7.2.1.3)
- [simple bit ignore ]
- [reserved bit 'false' ]
- [simple bit stationProblemIndicatorOk]
- [simple bit providerStateRun ]
- [reserved bit 'false' ]
- [simple bit dataValid ]
- [simple bit redundancy ]
- [simple bit statePrimary ]
- // Data Status End
- // "Transfer-Status" (Set to 0x00 for all RT-Classes except RT-CLASS-3,
- // which PLC4X will never be able to support
- [reserved uint 8 '0x00' ] // transferStatus
- ]
- ['PTCP_DelayReqPDU' PcDcp_Pdu_DelayReq
- // Header Start
- [reserved uint 32 '0x00000000']
- [reserved uint 32 '0x00000000']
- [reserved uint 32 '0x00000000']
- [simple uint 16 sequenceId ]
- [reserved uint 16 '0x0000' ]
- // Header End
- [simple uint 32 delayInNs ]
- // Delay Parameter Start
- // TODO: This seems to usually be an array of parameters terminated by an End-Parameter which is indicated by type and length being 0
- [const uint 7 parameterType 6]
- [const uint 9 parameterLength 6]
- [simple MacAddress portMacAddress ]
- [const uint 7 endType 0]
- [const uint 9 endLength 0]
- // Delay Parameter End
- ]
- ['Alarm_Low' PnDcp_Pdu_AlarmLow
- [simple uint 16 alarmDstEndpoint]
- [simple uint 16 alarmSrcEndpoint]
- [simple uint 4 version]
- [simple uint 4 errorType]
- [simple uint 4 tAck]
- [simple uint 4 windowSize]
- [simple uint 16 senSeqNum]
- [simple uint 16 ackSeqNum]
- [implicit uint 16 varPartLen 'COUNT(varPart)']
- [array byte varPart length 'varPartLen']
- ]
- ['DCP_Identify_ReqPDU' PnDcp_Pdu_IdentifyReq
- [const uint 8 serviceId 0x05 ]
- // ServiceType Start
- [reserved uint 5 '0x00' ]
- [const bit notSupported false ]
- [reserved uint 1 '0x00' ]
- [const bit response false ]
- // ServiceType End
- // 4.3.1.3.3 (Page 95)
- [simple uint 32 xid ]
- // 4.3.1.3.5 (Page 95ff)
- [simple uint 16 responseDelay ]
- // 4.3.1.3.4 (Page 95)
- [implicit uint 16 dcpDataLength 'lengthInBytes - 12' ]
- [array PnDcp_Block blocks length 'dcpDataLength']
- ]
- ////////////////////////////////////////////////////////////////////////////
- // Multicast (Well theoretically)
- ////////////////////////////////////////////////////////////////////////////
- // The Identify request is valid in two options:
- // 1) One containing only an AllSelectorBlock
- // 2) One containing optionally either NameOfStationBlock or AliasNameBlock and another optional IdentifyReqBlock
- // (I assume, that if in case 2 both optionally aren't used, this might not be valid and option 1 should be sent instead)
- ['DCP_Identify_ResPDU' PnDcp_Pdu_IdentifyRes
- [const uint 8 serviceId 0x05 ]
- // ServiceType Start
- [reserved uint 5 '0x00' ]
- [simple bit notSupported ]
- [reserved uint 1 '0x00' ]
- [const bit response true ]
- // ServiceType End
- // 4.3.1.3.3 (Page 95)
- [simple uint 32 xid ]
- // 4.3.1.3.5 (Page 95ff)
- [reserved uint 16 '0x0000' ]
- // 4.3.1.3.4 (Page 95)
- [implicit uint 16 dcpDataLength 'lengthInBytes - 12' ]
- [array PnDcp_Block blocks length 'dcpDataLength']
- ]
- ]
-]
-
-[discriminatedType PnDcp_Pdu_IdentifyRes_Payload
- [discriminator PnDcp_ServiceId serviceId ]
- [simple PnDcp_ServiceType serviceType ]
- // 4.3.1.3.3 (Page 95)
- [simple uint 32 xid ]
- // 4.3.1.3.5 (Page 95ff)
- [simple uint 16 responseDelayFactorOrPadding ]
- // 4.3.1.3.4 (Page 95)
- [implicit uint 16 dcpDataLength 'lengthInBytes - 12']
- [typeSwitch serviceId,serviceType.response
-
- // Packet a Profinet station might emit once it is turned on
-// ['DCP_Hello_ReqPDU','HELLO','false' PnDcp_Pdu_HelloReq
-// [simple NameOfStationBlockRes nameOfStationBlockRes ]
-// [simple IPParameterBlockRes iPParameterBlockRes ]
-// [simple DeviceIdBlockRes deviceIdBlockRes ]
-// [simple DeviceVendorBlockRes deviceVendorBlockRes ]
-// [simple DeviceOptionsBlockRes deviceOptionsBlockRes ]
-// [simple DeviceRoleBlockRes deviceRoleBlockRes ]
-// [simple DeviceInitiativeBlockRes deviceInitiativeBlockRes]
-// ]
-
- ////////////////////////////////////////////////////////////////////////////
- // Unicast
- ////////////////////////////////////////////////////////////////////////////
-
-// ['DCP_GetSet_PDU','GET','false' PnDcp_Pdu_GetReq
-// [simple GetReqBlock getReqBlock ]
-// ]
-// ['DCP_GetSet_PDU','GET','true' PnDcp_Pdu_GetRes
-// [simple GetResBlock getResBlock ]
-// [simple GetNegResBlock getNegResBlock ]
-// ]
-
-// ['DCP_GetSet_PDU','SET','false' PnDcp_Pdu_SetReq
-// [simple StartTransactionBlock startTransactionBlock ]
-// [simple BlockQualifier blockQualifier ]
-// [simple SetResetReqBlock setResetReqBlock ]
-// [simple SetReqBlock setReqBlock ]
-// [simple StopTransactionBlock stopTransactionBlock ]
-// [simple BlockQualifier blockQualifier ]
-// ]
-// ['DCP_GetSet_PDU','SET','true' PnDcp_Pdu_SetRes
-// [simple SetResBlock setResBlock ]
-// [simple SetNegResBlock setNegResBlock ]
-// ]
- ]
-]
-
-[type PnIo_CyclicServiceDataUnit(int 16 dataUnitLength)
- [array byte data count 'dataUnitLength' ]
-]
-
-[discriminatedType PnDcp_Block
- [discriminator PnDcp_BlockOptions option ]
- [discriminator uint 8 suboption ]
- [implicit uint 16 blockLength 'lengthInBytes - 4']
- [typeSwitch option,suboption
-
- ////////////////////////////////////////////////////////////////////////////
- // IP_OPTION
- ////////////////////////////////////////////////////////////////////////////
-
- // 4.3.1.4.1 (Page 97)
- ['IP_OPTION','1' PnDcp_Block_IpMacAddress
- [reserved uint 16 '0x0000' ]
- [simple MacAddress macAddress ]
- ]
- ['IP_OPTION','2' PnDcp_Block_IpParameter
- // 4.3.1.4.12 (Page 105ff)
- [reserved uint 8 '0x00' ]
- [simple bit ipConflictDetected ]
- [reserved uint 5 '0x00' ]
- [simple bit setViaDhcp ]
- [simple bit setManually ]
- [array byte ipAddress count '4' ]
- [array byte subnetMask count '4' ]
- [array byte standardGateway count '4' ]
- ]
- ['IP_OPTION','3' PnDcp_Block_FullIpSuite
- // TODO: Implement this ...
- ]
-
- ////////////////////////////////////////////////////////////////////////////
- // DEVICE_PROPERTIES_OPTION
- ////////////////////////////////////////////////////////////////////////////
-
- ['DEVICE_PROPERTIES_OPTION','1' PnDcp_Block_DevicePropertiesDeviceVendor(uint 16 blockLength)
- [reserved uint 16 '0x0000' ]
- [array byte deviceVendorValue count 'blockLength-2' ]
- [padding uint 8 pad '0x00' 'STATIC_CALL("arrayLength", deviceVendorValue) % 2']
- ]
- ['DEVICE_PROPERTIES_OPTION','2' PnDcp_Block_DevicePropertiesNameOfStation(uint 16 blockLength)
- [reserved uint 16 '0x0000' ]
- [array byte nameOfStation count 'blockLength-2' ]
- [padding uint 8 pad '0x00' 'STATIC_CALL("arrayLength", nameOfStation) % 2']
- ]
- ['DEVICE_PROPERTIES_OPTION','3' PnDcp_Block_DevicePropertiesDeviceId
- [reserved uint 16 '0x0000' ]
- [simple uint 16 vendorId ]
- [simple uint 16 deviceId ]
- ]
- ['DEVICE_PROPERTIES_OPTION','4' PnDcp_Block_DevicePropertiesDeviceRole
- [reserved uint 20 '0x000000' ]
- [simple bit pnioSupervisor ]
- [simple bit pnioMultidevive ]
- [simple bit pnioController ]
- [simple bit pnioDevice ]
- [reserved uint 8 '0x00' ]
- ]
- // Contains a list of option combinations the device supports.
- ['DEVICE_PROPERTIES_OPTION','5' PnDcp_Block_DevicePropertiesDeviceOptions(uint 16 blockLength)
- [reserved uint 16 '0x0000' ]
- [array PnDcp_SupportedDeviceOption supportedOptions length 'blockLength - 2' ]
- ]
- ['DEVICE_PROPERTIES_OPTION','6' PnDcp_Block_DevicePropertiesAliasName(uint 16 blockLength)
- [reserved uint 16 '0x0000' ]
- [array byte aliasNameValue count 'blockLength-2' ]
- [padding uint 8 pad '0x00' 'STATIC_CALL("arrayLength", aliasNameValue) % 2']
- ]
- ['DEVICE_PROPERTIES_OPTION','7' PnDcp_Block_DevicePropertiesDeviceInstance
- [reserved uint 16 '0x0000' ]
- [simple uint 8 deviceInstanceHigh ]
- [simple uint 8 deviceInstanceLow ]
- ]
- ['DEVICE_PROPERTIES_OPTION','8' PnDcp_Block_DevicePropertiesOemDeviceId
- // TODO: Implement this ...
- ]
- ['DEVICE_PROPERTIES_OPTION','9' PnDcp_Block_DevicePropertiesStandardGateway
- // TODO: Implement this ...
- ]
-
- ////////////////////////////////////////////////////////////////////////////
- // DHCP_OPTION
- ////////////////////////////////////////////////////////////////////////////
- // 4.3.1.4.1 (Page 98 & 100)
-
- // TODO: Check if these are really all DCP_OPTION
- ['DCP_OPTION','12' PnDcp_Block_DhcpOptionHostName
- // TODO: Implement this ...
- ]
- ['DCP_OPTION','43' PnDcp_Block_DhcpOptionVendorSpecificInformation
- // TODO: Implement this ...
- ]
- ['DCP_OPTION','54' PnDcp_Block_DhcpOptionServerIdentifier
- // TODO: Implement this ...
- ]
- ['DCP_OPTION','55' PnDcp_Block_DhcpOptionParameterRequestList
- // TODO: Implement this ...
- ]
- ['DCP_OPTION','60' PnDcp_Block_DhcpOptionClassIdentifier
- // TODO: Implement this ...
- ]
- ['DCP_OPTION','61' PnDcp_Block_DhcpOptionDhcpClientIdentifier
- // TODO: Implement this ...
- ]
- ['DCP_OPTION','81' PnDcp_Block_DhcpOptionFullyQualifiedDomainName
- // TODO: Implement this ...
- ]
- ['DCP_OPTION','97' PnDcp_Block_DhcpOptionUuidBasedClient
- // TODO: Implement this ...
- ]
-
- ////////////////////////////////////////////////////////////////////////////
- // CONTROL_OPTION
- ////////////////////////////////////////////////////////////////////////////
- // 4.3.1.4.1 (Page 98)
-
- ['CONTROL_OPTION','1' PnDcp_Block_ControlOptionStart
- // TODO: Implement this ...
- ]
- ['CONTROL_OPTION','2' PnDcp_Block_ControlOptionStop
- // TODO: Implement this ...
- ]
- ['CONTROL_OPTION','3' PnDcp_Block_ControlOptionSignal
- // TODO: Implement this ...
- ]
- ['CONTROL_OPTION','4' PnDcp_Block_ControlOptionResponse
- // TODO: Implement this ...
- ]
- ['CONTROL_OPTION','5' PnDcp_Block_ControlOptionFactoryReset
- // TODO: Implement this ...
- ]
- ['CONTROL_OPTION','6' PnDcp_Block_ControlOptionResetToFactory
- // TODO: Implement this ...
- ]
-
- ////////////////////////////////////////////////////////////////////////////
- // DEVICE_INITIATIVE_OPTION
- ////////////////////////////////////////////////////////////////////////////
- // 4.3.1.4.1 (Page 98)
-
- ['DEVICE_INITIATIVE_OPTION','1' PnDcp_Block_DeviceInitiativeOption
- // TODO: Implement this ...
- ]
-
- ////////////////////////////////////////////////////////////////////////////
- // ALL_SELECTOR_OPTION
- ////////////////////////////////////////////////////////////////////////////
- // 4.3.1.4.1 (Page 99)
-
- ['ALL_SELECTOR_OPTION','0xFF' PnDcp_Block_ALLSelector
- // This type of block is empty
- ]
-
- ////////////////////////////////////////////////////////////////////////////
- // Device manufacturer specific options 0x00-0xFF
- ////////////////////////////////////////////////////////////////////////////
- ]
-]
-
-[type PnDcp_SupportedDeviceOption
- [simple PnDcp_BlockOptions option]
- [simple uint 8 suboption ]
-]
-
-// 4.3.1.3.2 (Page 94ff)
-// 4.3.1.3.2 (Page 94ff)
-// The spec lists meanings for request and response separately, but
-// they are actually mergeable, which we did in this construct.
-[type PnDcp_ServiceType
- [reserved uint 5 '0x00' ]
- [simple bit notSupported]
- [reserved uint 1 '0x00' ]
- [simple bit response ]
-]
-
-// Page 86ff: Coding of the field FrameID
-[enum uint 16 PnDcp_FrameId
- ['0x0000' RESERVED ]
- // Range 1
- ['0x0020' PTCP_RTSyncPDUWithFollowUp ]
- // Range 2
- ['0x0080' PTCP_RTSyncPDU ]
- // Range 3
- // 0x0100-0x0FFF RT_CLASS_3
- ['0x0100' RT_CLASS_3 ]
- // Range 4
- // (Not used)
- // Range 5
- // (Not used)
- // Range 6
- // 0x8000-BFFF RT_CLASS_1
- ['0x8000' RT_CLASS_1 ]
- // Range 7
- // 0XC000-FBFF RT_CLASS_UDP
- ['0xC000' RT_CLASS_UDP ]
- // Range 8
- ['0xFC01' Alarm_High ]
- ['0xFE01' Alarm_Low ]
- ['0xFEFC' DCP_Hello_ReqPDU ]
- ['0xFEFD' DCP_GetSet_PDU ]
- ['0xFEFE' DCP_Identify_ReqPDU ]
- ['0xFEFF' DCP_Identify_ResPDU ]
- // Range 9
- ['0xFF00' PTCP_AnnouncePDU ]
- ['0xFF20' PTCP_FollowUpPDU ]
- ['0xFF40' PTCP_DelayReqPDU ]
- ['0xFF41' PTCP_DelayResPDUWithFollowUp ]
- ['0xFF42' PTCP_DelayFuResPDUWithFollowUp ]
- ['0xFF43' PTCP_DelayResPDUWithoutFollowUp]
- // Range 12
- // 0xFF80 - 0xFF8F FragmentationFrameId
- ['0xFF80' FragmentationFrameId ]
-]
-
-// Page 94
-// All other values are "Reserved"
-[enum uint 8 PnDcp_ServiceId
- ['0x03' GET ]
- ['0x04' SET ]
- ['0x05' IDENTIFY]
- ['0x06' HELLO ]
- //[RESERVED]
-]
-
-// 4.3.1.4.1 (Page 97)
-// All other values are "Reserved"
-[enum uint 8 PnDcp_BlockOptions
- ['0x01' IP_OPTION ]
- ['0x02' DEVICE_PROPERTIES_OPTION]
- ['0x03' DCP_OPTION ]
- ['0x05' CONTROL_OPTION ]
- ['0x06' DEVICE_INITIATIVE_OPTION]
- ['0xFF' ALL_SELECTOR_OPTION ]
-]
-
-/////////////////////////////////////////////////////////////////////////////////////////
-//
-// PROFINET IO
-//
-// CM: Context Manager
-//
-/////////////////////////////////////////////////////////////////////////////////////////
-
-// TODO: Check if it's really Little Endian
-// 5.1.2
-// 5.5.2.2
-[discriminatedType PnIoCm_Packet(DceRpc_PacketType packetType)
- [typeSwitch packetType
- ['REQUEST' PnIoCm_Packet_Req
- [simple uint 32 argsMaximum ]
- [implicit uint 32 argsLength 'lengthInBytes - 20']
- [simple uint 32 arrayMaximumCount ]
- [simple uint 32 arrayOffset ]
- [implicit uint 32 arrayActualCount 'lengthInBytes - 20']
- [array PnIoCm_Block blocks length 'argsLength']
- ]
- ['RESPONSE' PnIoCm_Packet_Res
- [simple uint 8 errorCode2 ]
- [simple uint 8 errorCode1 ]
- [simple uint 8 errorDecode ]
- [simple uint 8 errorCode ]
- [implicit uint 32 argsLength 'lengthInBytes - 1 - 1 - 1 - 1 - 4 - 4 - 4 - 4']
- [simple uint 32 arrayMaximumCount ]
- [simple uint 32 arrayOffset ]
- [implicit uint 32 arrayActualCount 'lengthInBytes - 1 - 1 - 1 - 1 - 4 - 4 - 4 - 4' ]
- [array PnIoCm_Block blocks length 'argsLength']
- ]
- ['REJECT' PnIoCm_Packet_Rej
- [simple uint 32 status ]
- ]
- ]
-]
-
-[type UserData(uint 32 recordDataLength)
- [array byte data count 'recordDataLength' ]
-]
-
-// Big Endian
-[discriminatedType PnIoCm_Block byteOrder='BIG_ENDIAN'
- [discriminator PnIoCm_BlockType blockType ]
- [typeSwitch blockType
- ['IOD_WRITE_REQUEST_HEADER' IODWriteRequestHeader
- [implicit uint 16 blockLength 'index < 0x8000 ? lengthInBytes - 4 - recordDataLength : lengthInBytes - 4']
- [simple uint 8 blockVersionHigh ]
- [simple uint 8 blockVersionLow ]
- [simple uint 16 sequenceNumber ]
- [simple Uuid arUuid ]
- [simple uint 32 api ]
- [simple uint 16 slotNumber ]
- [simple uint 16 subSlotNumber ]
- [const uint 16 padField 0x0000 ]
- [simple uint 16 index ]
- [simple uint 32 recordDataLength ]
- [padding uint 8 pad '0x00' 'index < 0x8000 ? 64 - 6 - 2 - 16 - 4 - 2 - 2 - 2 - 2 - 4 : 64 - 6 - 2 - 16 - 4 - 2 - 2 - 2 - 2 - 4']
- [optional UserData('recordDataLength') userData 'index < 0x8000' ]
- ]
- ['IOD_WRITE_RESPONSE_HEADER' IODWriteResponseHeader
- [implicit uint 16 blockLength 'lengthInBytes - 4']
- [simple uint 8 blockVersionHigh ]
- [simple uint 8 blockVersionLow ]
- [simple uint 16 sequenceNumber ]
- [simple Uuid arUuid ]
- [simple uint 32 api ]
- [simple uint 16 slotNumber ]
- [simple uint 16 subSlotNumber ]
- [const uint 16 padField 0x0000 ]
- [simple uint 16 index ]
- [simple uint 32 recordDataLength ]
- [padding uint 8 pad '0x00' '64 - 6 - 2 - 16 - 4 - 2 - 2 - 2 - 2 - 4']
- ]
- ['PD_INTERFACE_ADJUST' PDInterfaceAdjust
- [implicit uint 16 blockLength 'lengthInBytes - 4']
- [simple uint 8 blockVersionHigh ]
- [simple uint 8 blockVersionLow ]
- [const uint 16 padField 0x0000 ]
- [const uint 16 multipleInterfaceModeReserved2 0x0000 ]
- [const uint 15 multipleInterfaceModeReserved1 0x0000 ]
- [simple MultipleInterfaceModeNameOfDevice multipleInterfaceModeNameOfDevice ]
- ]
- ['PD_PORT_DATA_CHECK' PDPortDataCheck
- [implicit uint 16 blockLength 'lengthInBytes - 4']
- [simple uint 8 blockVersionHigh ]
- [simple uint 8 blockVersionLow ]
- [const uint 16 padField 0x0000 ]
- [simple uint 16 slotNumber ]
- [simple uint 16 subSlotNumber ]
- [simple PnIoCm_Block checkPeers ]
- ]
- ['CHECK_PEERS' CheckPeers
- [implicit uint 16 blockLength 'lengthInBytes - 4']
- [simple uint 8 blockVersionHigh ]
- [simple uint 8 blockVersionLow ]
- [const uint 8 noOfPeers 0x01 ]
- [simple PascalString peerPortId ]
- [simple PascalString peerChassisId ]
- ]
- ['AR_BLOCK_REQ' PnIoCm_Block_ArReq
- [implicit uint 16 blockLength 'lengthInBytes - 4']
- [simple uint 8 blockVersionHigh ]
- [simple uint 8 blockVersionLow ]
- [simple PnIoCm_ArType arType ]
- [simple Uuid arUuid ]
- [simple uint 16 sessionKey ]
- [simple MacAddress cmInitiatorMacAddr ]
- [simple DceRpc_ObjectUuid cmInitiatorObjectUuid ]
- // Begin ARProperties
- [simple bit pullModuleAlarmAllowed ]
- [simple bit nonLegacyStartupMode ]
- [simple bit combinedObjectContainerUsed ]
- [reserved uint 17 '0x00000' ]
- [simple bit acknowledgeCompanionAr ]
- [simple PnIoCm_CompanionArType companionArType ]
- [simple bit deviceAccess ]
- [reserved uint 3 '0x0' ]
- [simple bit cmInitiator ]
- [simple bit supervisorTakeoverAllowed ]
- [simple PnIoCm_State state ]
- // End ARProperties
- [simple uint 16 cmInitiatorActivityTimeoutFactor ]
- [simple uint 16 cmInitiatorUdpRtPort ]
- [implicit uint 16 stationNameLength 'STR_LEN(cmInitiatorStationName)']
- [simple vstring 'stationNameLength * 8' cmInitiatorStationName ]
- ]
- ['AR_BLOCK_RES' PnIoCm_Block_ArRes
- [implicit uint 16 blockLength 'lengthInBytes - 4']
- [simple uint 8 blockVersionHigh ]
- [simple uint 8 blockVersionLow ]
- [simple PnIoCm_ArType arType ]
- [simple Uuid arUuid ]
- [simple uint 16 sessionKey ]
- [simple MacAddress cmResponderMacAddr ]
- [simple uint 16 responderUDPRTPort ]
- ]
- ['IOD_CONTROL_REQ' PnIoCm_Control_Request
- [implicit uint 16 blockLength 'lengthInBytes - 4']
- [simple uint 8 blockVersionHigh ]
- [simple uint 8 blockVersionLow ]
- [reserved uint 16 '0x0000' ]
- [simple Uuid arUuid ]
- [simple uint 16 sessionKey ]
- [reserved uint 16 '0x0000' ]
- [simple uint 16 controlCommand ]
- [reserved uint 16 '0x0000' ]
- ]
- ['IOX_BLOCK_REQ' PnIoCM_Block_Request
- [implicit uint 16 blockLength 'lengthInBytes - 4']
- [simple uint 8 blockVersionHigh ]
- [simple uint 8 blockVersionLow ]
- [reserved uint 16 '0x0000' ]
- [simple Uuid arUuid ]
- [simple uint 16 sessionKey ]
- [reserved uint 16 '0x0000' ]
- [simple uint 16 controlCommand ]
- [simple uint 16 controlBlockProperties ]
- ]
- ['IOX_BLOCK_RES' PnIoCM_Block_Response
- [implicit uint 16 blockLength 'lengthInBytes - 4']
- [simple uint 8 blockVersionHigh ]
- [simple uint 8 blockVersionLow ]
- [reserved uint 16 '0x0000' ]
- [simple Uuid arUuid ]
- [simple uint 16 sessionKey ]
- [reserved uint 16 '0x0000' ]
- [simple uint 16 controlCommand ]
- [simple uint 16 controlBlockProperties ]
- ]
- ['IOD_CONTROL_RES' PnIoCm_Control_Response
- [implicit uint 16 blockLength 'lengthInBytes - 4']
- [simple uint 8 blockVersionHigh ]
- [simple uint 8 blockVersionLow ]
- [reserved uint 16 '0x0000' ]
- [simple Uuid arUuid ]
- [simple uint 16 sessionKey ]
- [reserved uint 16 '0x0000' ]
- [simple uint 16 controlCommand ]
- [reserved uint 16 '0x0000' ]
- ]
- ['IO_CR_BLOCK_REQ' PnIoCm_Block_IoCrReq
- [implicit uint 16 blockLength 'lengthInBytes - 4']
- [simple uint 8 blockVersionHigh ]
- [simple uint 8 blockVersionLow ]
- [simple PnIoCm_IoCrType ioCrType ]
- [simple uint 16 ioCrReference ]
- [simple uint 16 lt ]
- // Begin IOCRProperties
- [simple bit fullSubFrameStructure ]
- [simple bit distributedSubFrameWatchDog ]
- [simple bit fastForwardingMacAdr ]
- [reserved uint 17 '0x0000' ]
- [simple bit mediaRedundancy ]
- [reserved uint 7 '0x00' ]
- [simple PnIoCm_RtClass rtClass ]
- // End IOCRProperties
- [simple uint 16 dataLength ]
- [simple uint 16 frameId ]
- [simple uint 16 sendClockFactor ]
- [simple uint 16 reductionRatio ]
- [simple uint 16 phase ]
- [simple uint 16 sequence ]
- [simple uint 32 frameSendOffset ]
- [simple uint 16 watchDogFactor ]
- [simple uint 16 dataHoldFactor ]
- [simple uint 16 ioCrTagHeader ]
- [simple MacAddress ioCrMulticastMacAdr ]
- [implicit uint 16 numberOfApis 'COUNT(apis)' ]
- [array PnIoCm_IoCrBlockReqApi apis count 'numberOfApis' ]
- ]
- ['IO_CR_BLOCK_RES' PnIoCm_Block_IoCrRes
- [implicit uint 16 blockLength 'lengthInBytes - 4']
- [simple uint 8 blockVersionHigh ]
- [simple uint 8 blockVersionLow ]
- [simple PnIoCm_IoCrType ioCrType ]
- [simple uint 16 ioCrReference ]
- [simple uint 16 frameId ]
- ]
- ['ALARM_CR_BLOCK_REQ' PnIoCm_Block_AlarmCrReq
- [implicit uint 16 blockLength 'lengthInBytes - 4']
- [simple uint 8 blockVersionHigh ]
- [simple uint 8 blockVersionLow ]
- [simple PnIoCm_AlarmCrType alarmType ]
- [simple uint 16 lt ]
- // Begin AlarmCrProperties
- [reserved uint 30 '0x00000000' ]
- [simple bit transport ]
- [simple bit priority ]
- // End AlarmCrProperties
- [simple uint 16 rtaTimeoutFactor ]
- [simple uint 16 rtaRetries ]
- [simple uint 16 localAlarmReference ]
- [simple uint 16 maxAlarmDataLength ]
- [simple uint 16 alarmCtrTagHeaderHigh ]
- [simple uint 16 alarmCtrTagHeaderLow ]
- ]
- ['ALARM_CR_BLOCK_RES' PnIoCm_Block_AlarmCrRes
- [implicit uint 16 blockLength 'lengthInBytes - 4']
- [simple uint 8 blockVersionHigh ]
- [simple uint 8 blockVersionLow ]
- [simple PnIoCm_AlarmCrType alarmType ]
- [simple uint 16 localAlarmReference ]
- [simple uint 16 maxAlarmDataLength ]
- ]
- ['EXPECTED_SUBMODULE_BLOCK_REQ' PnIoCm_Block_ExpectedSubmoduleReq
- [implicit uint 16 blockLength 'lengthInBytes - 4']
- [simple uint 8 blockVersionHigh ]
- [simple uint 8 blockVersionLow ]
- [implicit uint 16 numberOfApis 'COUNT(apis)' ]
- [array PnIoCm_ExpectedSubmoduleBlockReqApi apis count 'numberOfApis' ]
- ]
- ['MODULE_DIFF_BLOCK' PnIoCm_Block_ModuleDiff
- [implicit uint 16 blockLength 'lengthInBytes - 4']
- [simple uint 8 blockVersionHigh ]
- [simple uint 8 blockVersionLow ]
- [implicit uint 16 numberOfApis 'COUNT(apis)' ]
- [array PnIoCm_ModuleDiffBlockApi apis count 'numberOfApis' ]
- ]
- ['AR_SERVER_BLOCK' PnIoCm_Block_ArServer
- [implicit uint 16 blockLength 'lengthInBytes - 4']
- [simple uint 8 blockVersionHigh ]
- [simple uint 8 blockVersionLow ]
- [simple PascalString stationName ]
- [padding uint 8 pad '0x00' '20 - 6 - (stationName.stringLength)' ]
- ]
- ]
-]
-
-[type PascalString
- [implicit int 8 sLength 'stringValue.length == 0 ? -1 : stringValue.length']
- [simple vstring 'sLength == -1 ? 0 : sLength * 8' stringValue]
- [virtual int 8 stringLength 'stringValue.length == -1 ? 0 : stringValue.length']
-]
-
-[type PnIoCm_IoCrBlockReqApi
- [const uint 32 api 0x00000000 ]
- [implicit uint 16 numIoDataObjects 'COUNT(ioDataObjects)' ]
- [array PnIoCm_IoDataObject ioDataObjects count 'numIoDataObjects' ]
- [implicit uint 16 numIoCss 'COUNT(ioCss)' ]
- [array PnIoCm_IoCs ioCss count 'numIoCss' ]
-]
-
-[type PnIoCm_IoDataObject
- [simple uint 16 slotNumber ]
- [simple uint 16 subSlotNumber ]
- [simple uint 16 ioDataObjectFrameOffset]
-]
-
-[type PnIoCm_IoCs
- [simple uint 16 slotNumber ]
- [simple uint 16 subSlotNumber]
- [simple uint 16 ioFrameOffset]
-]
-
-[type PnIoCm_DataUnitIoCs
- [simple bit dataState]
- [simple uint 2 instance ]
- [reserved uint 4 '0x00' ]
- [simple bit extension]
-]
-
-[type PnIoCm_DataUnitDataObject(uint 16 dataObjectLength)
- [array byte dataState count 'dataObjectLength']
- [simple PnIoCm_DataUnitIoCs iops ]
-]
-
-[type PnIoCm_ExpectedSubmoduleBlockReqApi
- [const uint 32 api 0x00000000 ]
- [simple uint 16 slotNumber ]
- [simple uint 32 moduleIdentNumber ]
- [simple uint 16 moduleProperties ]
- [implicit uint 16 numSubmodules 'COUNT(submodules)' ]
- [array PnIoCm_Submodule submodules count 'numSubmodules']
-]
-
-[type PnIoCm_ModuleDiffBlockApi byteOrder='BIG_ENDIAN'
- [const uint 32 api 0x00000000 ]
- [implicit uint 16 numModules 'COUNT(modules)' ]
- [array PnIoCm_ModuleDiffBlockApi_Module modules count 'numModules']
-]
-
-[type PnIoCm_ModuleDiffBlockApi_Module byteOrder='BIG_ENDIAN'
- [simple uint 16 slotNumber ]
- [simple uint 32 moduleIdentNumber ]
- [simple PnIoCm_ModuleState moduleState ]
- [implicit uint 16 numSubmodules 'COUNT(submodules)' ]
- [array PnIoCm_ModuleDiffBlockApi_Submodule submodules count 'numSubmodules']
-]
-
-[type PnIoCm_ModuleDiffBlockApi_Submodule byteOrder='BIG_ENDIAN'
- [simple uint 16 subslotNumber ]
- [simple uint 32 submoduleIdentNumber]
- [simple bit codingUsesIdentInfo ]
- [simple PnIoCm_IdentInfo identInfo ]
- [simple PnIoCm_ArInfo arInfo ]
- [simple bit diagInfoAvailable ]
- [simple bit maintenanceDemanded ]
- [simple bit maintenanceRequired ]
- [simple bit qualifiedInfo ]
- [simple PnIoCm_AddInfo addInfo ]
-]
-
-[discriminatedType PnIoCm_Submodule
- [simple uint 16 slotNumber ]
- [simple uint 32 submoduleIdentNumber ]
- // Begin SubmoduleProperties
- [reserved uint 10 '0x000' ]
- [simple bit discardIoxs ]
- [simple bit reduceOutputModuleDataLength ]
- [simple bit reduceInputModuleDataLength ]
- [simple bit sharedInput ]
- [discriminator PnIoCm_SubmoduleType submoduleType ]
- // End SubmoduleProperties
- [typeSwitch submoduleType
- ['NO_INPUT_NO_OUTPUT_DATA' PnIoCm_Submodule_NoInputNoOutputData
- [const uint 16 dataDescription 0x0001]
- [const uint 16 submoduleDataLength 0x0000]
- [const uint 8 lengthIoCs 0x01 ]
- [const uint 8 lengthIoPs 0x01 ]
- ]
- ['INPUT_DATA' PnIoCm_Submodule_InputData
- [const uint 16 inputDataDescription 0x0001]
- [simple uint 16 inputSubmoduleDataLength ]
- [simple uint 8 inputLengthIoCs ]
- [simple uint 8 inputLengthIoPs ]
- ]
- ['OUTPUT_DATA' PnIoCm_Submodule_OutputData
- [const uint 16 inputDataDescription 0x0002]
- [simple uint 16 inputSubmoduleDataLength ]
- [simple uint 8 inputLengthIoCs ]
- [simple uint 8 inputLengthIoPs ]
- ]
- ['INPUT_AND_OUTPUT_DATA' PnIoCm_Submodule_InputAndOutputData
- [const uint 16 inputDataDescription 0x0001]
- [simple uint 16 inputSubmoduleDataLength ]
- [simple uint 8 inputLengthIoCs ]
- [simple uint 8 inputLengthIoPs ]
- [const uint 16 outputDataDescription 0x0002]
- [simple uint 16 outputSubmoduleDataLength ]
- [simple uint 8 outputLengthIoCs ]
- [simple uint 8 outputLengthIoPs ]
- ]
- ]
-]
-
-[type Uuid
- [array byte data count '16']
-]
-
-[enum uint 16 PnIoCm_BlockType
- ['0x0008' IOD_WRITE_REQUEST_HEADER ]
- ['0x0101' AR_BLOCK_REQ ]
- ['0x0102' IO_CR_BLOCK_REQ ]
- ['0x0103' ALARM_CR_BLOCK_REQ ]
- ['0x0104' EXPECTED_SUBMODULE_BLOCK_REQ]
- ['0x0110' IOD_CONTROL_REQ ]
- ['0x0112' IOX_BLOCK_REQ ]
- ['0x0200' PD_PORT_DATA_CHECK ]
- ['0x020a' CHECK_PEERS ]
- ['0x0250' PD_INTERFACE_ADJUST ]
- ['0x8008' IOD_WRITE_RESPONSE_HEADER ]
- ['0x8101' AR_BLOCK_RES ]
- ['0x8102' IO_CR_BLOCK_RES ]
- ['0x8103' ALARM_CR_BLOCK_RES ]
- ['0x8104' MODULE_DIFF_BLOCK ]
- ['0x8106' AR_SERVER_BLOCK ]
- ['0x8110' IOD_CONTROL_RES ]
- ['0x8112' IOX_BLOCK_RES ]
-]
-
-[enum uint 8 ProfinetDeviceState
- ['0x00' IDLE]
- ['0x01' STARTUP]
- ['0x02' PREMED]
- ['0x03' WAITAPPLRDY]
- ['0x04' APPLRDY]
- ['0x05' CYCLICDATA]
- ['0xFF' ABORT]
-]
-
-[enum uint 16 PnIoCm_ArType
- ['0x0001' IO_CONTROLLER]
-]
-
-[enum uint 2 PnIoCm_CompanionArType
- ['0x0' SINGLE_AR]
-]
-
-[enum uint 3 PnIoCm_State
- ['0x1' ACTIVE]
-]
-
-[enum uint 16 PnIoCm_IoCrType
- ['0x0001' INPUT_CR]
- ['0x0002' OUTPUT_CR]
-]
-
-[enum uint 4 PnIoCm_RtClass
- ['0x2' RT_CLASS_2]
-]
-
-[enum uint 16 PnIoCm_AlarmCrType
- ['0x0001' ALARM_CR]
-]
-
-[enum uint 16 PnIoCm_ModuleState
- ['0x0002' PROPER_MODULE]
-]
-
-[enum uint 2 PnIoCm_SubmoduleType
- ['0x0' NO_INPUT_NO_OUTPUT_DATA]
- ['0x1' INPUT_DATA]
- ['0x2' OUTPUT_DATA]
- ['0x3' INPUT_AND_OUTPUT_DATA]
-]
-
-[enum bit MultipleInterfaceModeNameOfDevice
- ['false' PORT_PROVIDED_BY_LLDP]
- ['true' NAME_PROVIDED_BY_LLDP]
-]
-
-[enum uint 16 PnIoCm_DescriptionType
- ['0x0001' INPUT]
-]
-
-[enum uint 4 PnIoCm_IdentInfo
- ['0x0' OK]
-]
-
-[enum uint 4 PnIoCm_ArInfo
- ['0x0' OWN]
-]
-
-[enum uint 3 PnIoCm_AddInfo
- ['0x0' NONE]
-]
-
-[enum uint 4 IntegerEncoding
- ['0x0' BIG_ENDIAN]
- ['0x1' LITTLE_ENDIAN]
-]
-
-[enum uint 4 CharacterEncoding
- ['0x0' ASCII]
- ['0x1' EBCDIC]
-]
-
-[enum uint 8 FloatingPointEncoding
- ['0x00' IEEE]
- ['0x01' VAX ]
- ['0x02' CRAY]
- ['0x03' IBM ]
-]
-
-
-[dataIo DataItem(ProfinetDataType dataType, uint 16 numberOfValues)
- [typeSwitch dataType,numberOfValues
- ['BOOL','1' BOOL
- [simple bit value ]
- ]
- ['BOOL' List
- [array bit value count 'numberOfValues' ]
- ]
- ['BYTE','1' BYTE
- [simple uint 8 value]
- ]
- ['BYTE' List
- [array bit value count 'numberOfValues * 8' ]
- ]
- ['WORD' WORD
- [simple uint 16 value]
- ]
- ['DWORD' DWORD
- [simple uint 32 value]
- ]
- ['LWORD' LWORD
- [simple uint 64 value]
- ]
- ['SINT','1' SINT
- [simple int 8 value ]
- ]
- ['SINT' List
- [array int 8 value count 'numberOfValues']
- ]
- ['INT','1' INT
- [simple int 16 value]
- ]
- ['INT' List
- [array int 16 value count 'numberOfValues']
- ]
- ['DINT','1' DINT
- [simple int 32 value]
- ]
- ['DINT' List
- [array int 32 value count 'numberOfValues']
- ]
- ['LINT','1' LINT
- [simple int 64 value]
- ]
- ['LINT' List
- [array int 64 value count 'numberOfValues']
- ]
- ['USINT','1' USINT
- [simple uint 8 value ]
- ]
- ['USINT' List
- [array uint 8 value count 'numberOfValues']
- ]
- ['UINT','1' UINT
- [simple uint 16 value]
- ]
- ['UINT' List
- [array uint 16 value count 'numberOfValues']
- ]
- ['UDINT','1' UDINT
- [simple uint 32 value]
- ]
- ['UDINT' List
- [array uint 32 value count 'numberOfValues']
- ]
- ['ULINT','1' ULINT
- [simple uint 64 value]
- ]
- ['ULINT' List
- [array uint 64 value count 'numberOfValues']
- ]
- ['REAL','1' REAL
- [simple float 32 value]
- ]
- ['REAL' List
- [array float 32 value count 'numberOfValues']
- ]
- ['LREAL','1' LREAL
- [simple float 64 value]
- ]
- ['LREAL' List
- [array float 64 value count 'numberOfValues']
- ]
- ['CHAR','1' CHAR
- [simple string 8 value encoding='"UTF-8"']
- ]
- ['CHAR' List
- [array string 8 value count 'numberOfValues' encoding='"UTF-8"']
- ]
- ['WCHAR','1' WCHAR
- [simple string 16 value encoding='"UTF-16"']
- ]
- ['WCHAR' List
- [array string 16 value count 'numberOfValues' encoding='"UTF-16"']
- ]
- ]
-]
-
-[enum uint 8 ProfinetDataType(uint 8 dataTypeSize, string 16 conversion)
- ['1' BOOL ['1','BOOLEAN']]
- ['2' BYTE ['1','BYTE']]
- ['3' WORD ['2','WORD']]
- ['4' DWORD ['4','DWORD']]
- ['5' LWORD ['8','LWORD']]
- ['6' SINT ['1','SIGNED8']]
- ['7' INT ['2','SIGNED16']]
- ['8' DINT ['4','SIGNED32']]
- ['9' LINT ['8','SIGNED64']]
- ['10' USINT ['1','UNSIGNED8']]
- ['11' UINT ['2','UNSIGNED16']]
- ['12' UDINT ['4','UNSIGNED32']]
- ['13' ULINT ['8','UNSIGNED64']]
- ['14' REAL ['4','FLOAT32']]
- ['15' LREAL ['8','FLOAT64']]
- ['16' TIME ['8','TIME']]
- ['17' LTIME ['8','LTIME']]
- ['18' DATE ['8','DATE']]
- ['19' LDATE ['8','LDATE']]
- ['20' TIME_OF_DAY ['8','TIME_OF_DAY']]
- ['21' LTIME_OF_DAY ['8','LTIME_OF_DAY']]
- ['22' DATE_AND_TIME ['8','DATE_AND_TIME']]
- ['23' LDATE_AND_TIME ['8','LDATE_AND_TIME']]
- ['24' CHAR ['1','CHAR']]
- ['25' WCHAR ['2','WCHAR']]
- ['26' STRING ['1','STRING']]
- ['27' WSTRING ['2','WSTRING']]
-]
\ No newline at end of file