You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by cd...@apache.org on 2022/08/22 08:23:06 UTC
[plc4x] 02/02: chore(plc4j/ads): Refactored the ADS driver to require less input. - Also noticed the integration tests seem to be ignored in Java and tried fixing them
This is an automated email from the ASF dual-hosted git repository.
cdutz pushed a commit to branch feature/ads-symbol-discovery
in repository https://gitbox.apache.org/repos/asf/plc4x.git
commit 03f67fb47f2cca59b5e4c32dcca7ffa890045c1a
Author: Christofer Dutz <ch...@rivian.com>
AuthorDate: Mon Aug 22 10:20:23 2022 +0200
chore(plc4j/ads): Refactored the ADS driver to require less input.
- Also noticed the integration tests seem to be ignored in Java and tried fixing them
---
.../testing/protocols/ads/DriverTestsuite.xml | 392 ++++++++----------
.../protocols/ads/ParserSerializerTestsuite.xml | 326 ++++++---------
plc4go/protocols/ads/readwrite/ParserHelper.go | 9 -
plc4go/protocols/ads/readwrite/XmlParserHelper.go | 6 -
.../model/AdsAddDeviceNotificationRequest.go | 29 +-
.../model/AdsAddDeviceNotificationResponse.go | 29 +-
.../ads/readwrite/model/AdsDataTypeArrayInfo.go | 2 +-
.../readwrite/model/AdsDataTypeTableChildEntry.go | 2 +-
.../ads/readwrite/model/AdsDataTypeTableEntry.go | 2 +-
.../model/AdsDeleteDeviceNotificationRequest.go | 29 +-
.../model/AdsDeleteDeviceNotificationResponse.go | 33 +-
.../model/AdsDeviceNotificationRequest.go | 29 +-
.../model/AdsDeviceNotificationResponse.go | 29 +-
.../ads/readwrite/model/AdsInvalidRequest.go | 29 +-
.../ads/readwrite/model/AdsInvalidResponse.go | 29 +-
.../readwrite/model/AdsReadDeviceInfoRequest.go | 29 +-
.../readwrite/model/AdsReadDeviceInfoResponse.go | 29 +-
.../ads/readwrite/model/AdsReadRequest.go | 29 +-
.../ads/readwrite/model/AdsReadResponse.go | 37 +-
.../ads/readwrite/model/AdsReadStateRequest.go | 29 +-
.../ads/readwrite/model/AdsReadStateResponse.go | 29 +-
.../ads/readwrite/model/AdsReadWriteRequest.go | 29 +-
.../ads/readwrite/model/AdsReadWriteResponse.go | 37 +-
.../ads/readwrite/model/AdsSymbolTableEntry.go | 2 +-
.../protocols/ads/readwrite/model/AdsTableSizes.go | 2 +-
.../ads/readwrite/model/AdsWriteControlRequest.go | 29 +-
.../ads/readwrite/model/AdsWriteControlResponse.go | 33 +-
.../ads/readwrite/model/AdsWriteRequest.go | 29 +-
.../ads/readwrite/model/AdsWriteResponse.go | 33 +-
plc4go/protocols/ads/readwrite/model/AmsPacket.go | 442 ++++++++++++++++-----
plc4j/api/pom.xml | 34 +-
.../plc4x/java/api/types/PlcClientDatatype.java | 35 --
.../java/api/types/PlcClientDatatypeTest.java | 43 --
.../plc4x/java/ads/protocol/AdsProtocolLogic.java | 192 ++++-----
.../org/apache/plc4x/protocol/ads/AdsDriverIT.java | 2 +-
plc4j/pom.xml | 25 ++
.../knxnetip/readwrite/model/KnxManufacturer.cs | 19 +-
.../ads/src/main/resources/protocols/ads/ads.mspec | 128 +++---
.../resources/protocols/ads/DriverTestsuite.xml | 392 ++++++++----------
.../protocols/ads/ParserSerializerTestsuite.xml | 326 ++++++---------
.../plc4x/protocol/plc4x/v0/Plc4xProtocol.java | 13 +-
.../resources/protocols/plc4x/v0/plc4x-api.mspec | 110 +++++
.../main/resources/protocols/plc4x/v0/plc4x.mspec | 86 ----
43 files changed, 1632 insertions(+), 1566 deletions(-)
diff --git a/plc4go/assets/testing/protocols/ads/DriverTestsuite.xml b/plc4go/assets/testing/protocols/ads/DriverTestsuite.xml
index 70a6dd51a..47ef65a02 100644
--- a/plc4go/assets/testing/protocols/ads/DriverTestsuite.xml
+++ b/plc4go/assets/testing/protocols/ads/DriverTestsuite.xml
@@ -93,32 +93,24 @@
<commandId>
<CommandId dataType="uint" bitLength="16" stringRepresentation="ADS_READ">2</CommandId>
</commandId>
- <state>
- <State>
- <initCommand dataType="bit" bitLength="1">false</initCommand>
- <updCommand dataType="bit" bitLength="1">false</updCommand>
- <timestampAdded dataType="bit" bitLength="1">false</timestampAdded>
- <highPriorityCommand dataType="bit" bitLength="1">false</highPriorityCommand>
- <systemCommand dataType="bit" bitLength="1">false</systemCommand>
- <adsCommand dataType="bit" bitLength="1">true</adsCommand>
- <noReturn dataType="bit" bitLength="1">false</noReturn>
- <response dataType="bit" bitLength="1">false</response>
- <broadcast dataType="bit" bitLength="1">false</broadcast>
- <reserved dataType="int" bitLength="7">0</reserved>
- </State>
- </state>
+ <initCommand dataType="bit" bitLength="1">false</initCommand>
+ <updCommand dataType="bit" bitLength="1">false</updCommand>
+ <timestampAdded dataType="bit" bitLength="1">false</timestampAdded>
+ <highPriorityCommand dataType="bit" bitLength="1">false</highPriorityCommand>
+ <systemCommand dataType="bit" bitLength="1">false</systemCommand>
+ <adsCommand dataType="bit" bitLength="1">true</adsCommand>
+ <noReturn dataType="bit" bitLength="1">false</noReturn>
+ <response dataType="bit" bitLength="1">false</response>
+ <broadcast dataType="bit" bitLength="1">false</broadcast>
+ <reserved dataType="int" bitLength="7">0</reserved>
<length dataType="uint" bitLength="32">12</length>
<errorCode dataType="uint" bitLength="32">0</errorCode>
<invokeId dataType="uint" bitLength="32">1</invokeId>
- <data>
- <AdsData>
- <AdsReadRequest>
- <indexGroup dataType="uint" bitLength="32">61455</indexGroup>
- <indexOffset dataType="uint" bitLength="32">0</indexOffset>
- <length dataType="uint" bitLength="32">24</length>
- </AdsReadRequest>
- </AdsData>
- </data>
+ <AdsReadRequest>
+ <indexGroup dataType="uint" bitLength="32">61455</indexGroup>
+ <indexOffset dataType="uint" bitLength="32">0</indexOffset>
+ <length dataType="uint" bitLength="32">24</length>
+ </AdsReadRequest>
</AmsPacket>
</userdata>
</AmsTCPPacket>
@@ -154,20 +146,16 @@
<commandId>
<CommandId dataType="uint" bitLength="16" stringRepresentation="ADS_READ">2</CommandId>
</commandId>
- <state>
- <State>
- <initCommand dataType="bit" bitLength="1">false</initCommand>
- <updCommand dataType="bit" bitLength="1">false</updCommand>
- <timestampAdded dataType="bit" bitLength="1">false</timestampAdded>
- <highPriorityCommand dataType="bit" bitLength="1">false</highPriorityCommand>
- <systemCommand dataType="bit" bitLength="1">false</systemCommand>
- <adsCommand dataType="bit" bitLength="1">true</adsCommand>
- <noReturn dataType="bit" bitLength="1">false</noReturn>
- <response dataType="bit" bitLength="1">true</response>
- <broadcast dataType="bit" bitLength="1">false</broadcast>
- <reserved dataType="int" bitLength="7">0</reserved>
- </State>
- </state>
+ <initCommand dataType="bit" bitLength="1">false</initCommand>
+ <updCommand dataType="bit" bitLength="1">false</updCommand>
+ <timestampAdded dataType="bit" bitLength="1">false</timestampAdded>
+ <highPriorityCommand dataType="bit" bitLength="1">false</highPriorityCommand>
+ <systemCommand dataType="bit" bitLength="1">false</systemCommand>
+ <adsCommand dataType="bit" bitLength="1">true</adsCommand>
+ <noReturn dataType="bit" bitLength="1">false</noReturn>
+ <response dataType="bit" bitLength="1">true</response>
+ <broadcast dataType="bit" bitLength="1">false</broadcast>
+ <reserved dataType="int" bitLength="7">0</reserved>
<length dataType="uint" bitLength="32">9</length>
<errorCode dataType="uint" bitLength="32">0</errorCode>
<invokeId dataType="uint" bitLength="32">1</invokeId>
@@ -266,32 +254,24 @@
<commandId>
<CommandId dataType="uint" bitLength="16" stringRepresentation="ADS_READ">2</CommandId>
</commandId>
- <state>
- <State>
- <initCommand dataType="bit" bitLength="1">false</initCommand>
- <updCommand dataType="bit" bitLength="1">false</updCommand>
- <timestampAdded dataType="bit" bitLength="1">false</timestampAdded>
- <highPriorityCommand dataType="bit" bitLength="1">false</highPriorityCommand>
- <systemCommand dataType="bit" bitLength="1">false</systemCommand>
- <adsCommand dataType="bit" bitLength="1">true</adsCommand>
- <noReturn dataType="bit" bitLength="1">false</noReturn>
- <response dataType="bit" bitLength="1">false</response>
- <broadcast dataType="bit" bitLength="1">false</broadcast>
- <reserved dataType="int" bitLength="7">0</reserved>
- </State>
- </state>
+ <initCommand dataType="bit" bitLength="1">false</initCommand>
+ <updCommand dataType="bit" bitLength="1">false</updCommand>
+ <timestampAdded dataType="bit" bitLength="1">false</timestampAdded>
+ <highPriorityCommand dataType="bit" bitLength="1">false</highPriorityCommand>
+ <systemCommand dataType="bit" bitLength="1">false</systemCommand>
+ <adsCommand dataType="bit" bitLength="1">true</adsCommand>
+ <noReturn dataType="bit" bitLength="1">false</noReturn>
+ <response dataType="bit" bitLength="1">false</response>
+ <broadcast dataType="bit" bitLength="1">false</broadcast>
+ <reserved dataType="int" bitLength="7">0</reserved>
<length dataType="uint" bitLength="32">12</length>
<errorCode dataType="uint" bitLength="32">0</errorCode>
<invokeId dataType="uint" bitLength="32">1</invokeId>
- <data>
- <AdsData>
- <AdsReadRequest>
- <indexGroup dataType="uint" bitLength="32">61455</indexGroup>
- <indexOffset dataType="uint" bitLength="32">0</indexOffset>
- <length dataType="uint" bitLength="32">24</length>
- </AdsReadRequest>
- </AdsData>
- </data>
+ <AdsReadRequest>
+ <indexGroup dataType="uint" bitLength="32">61455</indexGroup>
+ <indexOffset dataType="uint" bitLength="32">0</indexOffset>
+ <length dataType="uint" bitLength="32">24</length>
+ </AdsReadRequest>
</AmsPacket>
</userdata>
</AmsTCPPacket>
@@ -328,20 +308,16 @@
<commandId>
<CommandId dataType="uint" bitLength="16" stringRepresentation="ADS_READ_WRITE">9</CommandId>
</commandId>
- <state>
- <State>
- <initCommand dataType="bit" bitLength="1">false</initCommand>
- <updCommand dataType="bit" bitLength="1">false</updCommand>
- <timestampAdded dataType="bit" bitLength="1">false</timestampAdded>
- <highPriorityCommand dataType="bit" bitLength="1">false</highPriorityCommand>
- <systemCommand dataType="bit" bitLength="1">false</systemCommand>
- <adsCommand dataType="bit" bitLength="1">true</adsCommand>
- <noReturn dataType="bit" bitLength="1">false</noReturn>
- <response dataType="bit" bitLength="1">true</response>
- <broadcast dataType="bit" bitLength="1">false</broadcast>
- <reserved dataType="int" bitLength="7">0</reserved>
- </State>
- </state>
+ <initCommand dataType="bit" bitLength="1">false</initCommand>
+ <updCommand dataType="bit" bitLength="1">false</updCommand>
+ <timestampAdded dataType="bit" bitLength="1">false</timestampAdded>
+ <highPriorityCommand dataType="bit" bitLength="1">false</highPriorityCommand>
+ <systemCommand dataType="bit" bitLength="1">false</systemCommand>
+ <adsCommand dataType="bit" bitLength="1">true</adsCommand>
+ <noReturn dataType="bit" bitLength="1">false</noReturn>
+ <response dataType="bit" bitLength="1">true</response>
+ <broadcast dataType="bit" bitLength="1">false</broadcast>
+ <reserved dataType="int" bitLength="7">0</reserved>
<length dataType="uint" bitLength="32">18</length>
<errorCode dataType="uint" bitLength="32">0</errorCode>
<invokeId dataType="uint" bitLength="32">1</invokeId>
@@ -451,32 +427,24 @@
<commandId>
<CommandId dataType="uint" bitLength="16" stringRepresentation="ADS_READ">2</CommandId>
</commandId>
- <state>
- <State>
- <initCommand dataType="bit" bitLength="1">false</initCommand>
- <updCommand dataType="bit" bitLength="1">false</updCommand>
- <timestampAdded dataType="bit" bitLength="1">false</timestampAdded>
- <highPriorityCommand dataType="bit" bitLength="1">false</highPriorityCommand>
- <systemCommand dataType="bit" bitLength="1">false</systemCommand>
- <adsCommand dataType="bit" bitLength="1">true</adsCommand>
- <noReturn dataType="bit" bitLength="1">false</noReturn>
- <response dataType="bit" bitLength="1">false</response>
- <broadcast dataType="bit" bitLength="1">false</broadcast>
- <reserved dataType="int" bitLength="7">0</reserved>
- </State>
- </state>
+ <initCommand dataType="bit" bitLength="1">false</initCommand>
+ <updCommand dataType="bit" bitLength="1">false</updCommand>
+ <timestampAdded dataType="bit" bitLength="1">false</timestampAdded>
+ <highPriorityCommand dataType="bit" bitLength="1">false</highPriorityCommand>
+ <systemCommand dataType="bit" bitLength="1">false</systemCommand>
+ <adsCommand dataType="bit" bitLength="1">true</adsCommand>
+ <noReturn dataType="bit" bitLength="1">false</noReturn>
+ <response dataType="bit" bitLength="1">false</response>
+ <broadcast dataType="bit" bitLength="1">false</broadcast>
+ <reserved dataType="int" bitLength="7">0</reserved>
<length dataType="uint" bitLength="32">12</length>
<errorCode dataType="uint" bitLength="32">0</errorCode>
<invokeId dataType="uint" bitLength="32">1</invokeId>
- <data>
- <AdsData>
- <AdsReadRequest>
- <indexGroup dataType="uint" bitLength="32">61455</indexGroup>
- <indexOffset dataType="uint" bitLength="32">0</indexOffset>
- <length dataType="uint" bitLength="32">24</length>
- </AdsReadRequest>
- </AdsData>
- </data>
+ <AdsReadRequest>
+ <indexGroup dataType="uint" bitLength="32">61455</indexGroup>
+ <indexOffset dataType="uint" bitLength="32">0</indexOffset>
+ <length dataType="uint" bitLength="32">24</length>
+ </AdsReadRequest>
</AmsPacket>
</userdata>
</AmsTCPPacket>
@@ -512,20 +480,16 @@
<commandId>
<CommandId dataType="uint" bitLength="16" stringRepresentation="ADS_READ_WRITE">9</CommandId>
</commandId>
- <state>
- <State>
- <initCommand dataType="bit" bitLength="1">false</initCommand>
- <updCommand dataType="bit" bitLength="1">false</updCommand>
- <timestampAdded dataType="bit" bitLength="1">false</timestampAdded>
- <highPriorityCommand dataType="bit" bitLength="1">false</highPriorityCommand>
- <systemCommand dataType="bit" bitLength="1">false</systemCommand>
- <adsCommand dataType="bit" bitLength="1">true</adsCommand>
- <noReturn dataType="bit" bitLength="1">false</noReturn>
- <response dataType="bit" bitLength="1">true</response>
- <broadcast dataType="bit" bitLength="1">false</broadcast>
- <reserved dataType="int" bitLength="7">0</reserved>
- </State>
- </state>
+ <initCommand dataType="bit" bitLength="1">false</initCommand>
+ <updCommand dataType="bit" bitLength="1">false</updCommand>
+ <timestampAdded dataType="bit" bitLength="1">false</timestampAdded>
+ <highPriorityCommand dataType="bit" bitLength="1">false</highPriorityCommand>
+ <systemCommand dataType="bit" bitLength="1">false</systemCommand>
+ <adsCommand dataType="bit" bitLength="1">true</adsCommand>
+ <noReturn dataType="bit" bitLength="1">false</noReturn>
+ <response dataType="bit" bitLength="1">true</response>
+ <broadcast dataType="bit" bitLength="1">false</broadcast>
+ <reserved dataType="int" bitLength="7">0</reserved>
<length dataType="uint" bitLength="32">12</length>
<errorCode dataType="uint" bitLength="32">0</errorCode>
<invokeId dataType="uint" bitLength="32">1</invokeId>
@@ -575,20 +539,16 @@
<commandId>
<CommandId dataType="uint" bitLength="16" stringRepresentation="ADS_READ">2</CommandId>
</commandId>
- <state>
- <State>
- <initCommand dataType="bit" bitLength="1">false</initCommand>
- <updCommand dataType="bit" bitLength="1">false</updCommand>
- <timestampAdded dataType="bit" bitLength="1">false</timestampAdded>
- <highPriorityCommand dataType="bit" bitLength="1">false</highPriorityCommand>
- <systemCommand dataType="bit" bitLength="1">false</systemCommand>
- <adsCommand dataType="bit" bitLength="1">true</adsCommand>
- <noReturn dataType="bit" bitLength="1">false</noReturn>
- <response dataType="bit" bitLength="1">false</response>
- <broadcast dataType="bit" bitLength="1">false</broadcast>
- <reserved dataType="int" bitLength="7">0</reserved>
- </State>
- </state>
+ <initCommand dataType="bit" bitLength="1">false</initCommand>
+ <updCommand dataType="bit" bitLength="1">false</updCommand>
+ <timestampAdded dataType="bit" bitLength="1">false</timestampAdded>
+ <highPriorityCommand dataType="bit" bitLength="1">false</highPriorityCommand>
+ <systemCommand dataType="bit" bitLength="1">false</systemCommand>
+ <adsCommand dataType="bit" bitLength="1">true</adsCommand>
+ <noReturn dataType="bit" bitLength="1">false</noReturn>
+ <response dataType="bit" bitLength="1">false</response>
+ <broadcast dataType="bit" bitLength="1">false</broadcast>
+ <reserved dataType="int" bitLength="7">0</reserved>
<length dataType="uint" bitLength="32">12</length>
<errorCode dataType="uint" bitLength="32">0</errorCode>
<invokeId dataType="uint" bitLength="32">2</invokeId>
@@ -636,20 +596,16 @@
<commandId>
<CommandId dataType="uint" bitLength="16" stringRepresentation="ADS_READ">2</CommandId>
</commandId>
- <state>
- <State>
- <initCommand dataType="bit" bitLength="1">false</initCommand>
- <updCommand dataType="bit" bitLength="1">false</updCommand>
- <timestampAdded dataType="bit" bitLength="1">false</timestampAdded>
- <highPriorityCommand dataType="bit" bitLength="1">false</highPriorityCommand>
- <systemCommand dataType="bit" bitLength="1">false</systemCommand>
- <adsCommand dataType="bit" bitLength="1">true</adsCommand>
- <noReturn dataType="bit" bitLength="1">false</noReturn>
- <response dataType="bit" bitLength="1">true</response>
- <broadcast dataType="bit" bitLength="1">false</broadcast>
- <reserved dataType="int" bitLength="7">0</reserved>
- </State>
- </state>
+ <initCommand dataType="bit" bitLength="1">false</initCommand>
+ <updCommand dataType="bit" bitLength="1">false</updCommand>
+ <timestampAdded dataType="bit" bitLength="1">false</timestampAdded>
+ <highPriorityCommand dataType="bit" bitLength="1">false</highPriorityCommand>
+ <systemCommand dataType="bit" bitLength="1">false</systemCommand>
+ <adsCommand dataType="bit" bitLength="1">true</adsCommand>
+ <noReturn dataType="bit" bitLength="1">false</noReturn>
+ <response dataType="bit" bitLength="1">true</response>
+ <broadcast dataType="bit" bitLength="1">false</broadcast>
+ <reserved dataType="int" bitLength="7">0</reserved>
<length dataType="uint" bitLength="32">18</length>
<errorCode dataType="uint" bitLength="32">0</errorCode>
<invokeId dataType="uint" bitLength="32">2</invokeId>
@@ -743,32 +699,24 @@
<commandId>
<CommandId dataType="uint" bitLength="16" stringRepresentation="ADS_READ">2</CommandId>
</commandId>
- <state>
- <State>
- <initCommand dataType="bit" bitLength="1">false</initCommand>
- <updCommand dataType="bit" bitLength="1">false</updCommand>
- <timestampAdded dataType="bit" bitLength="1">false</timestampAdded>
- <highPriorityCommand dataType="bit" bitLength="1">false</highPriorityCommand>
- <systemCommand dataType="bit" bitLength="1">false</systemCommand>
- <adsCommand dataType="bit" bitLength="1">true</adsCommand>
- <noReturn dataType="bit" bitLength="1">false</noReturn>
- <response dataType="bit" bitLength="1">false</response>
- <broadcast dataType="bit" bitLength="1">false</broadcast>
- <reserved dataType="int" bitLength="7">0</reserved>
- </State>
- </state>
+ <initCommand dataType="bit" bitLength="1">false</initCommand>
+ <updCommand dataType="bit" bitLength="1">false</updCommand>
+ <timestampAdded dataType="bit" bitLength="1">false</timestampAdded>
+ <highPriorityCommand dataType="bit" bitLength="1">false</highPriorityCommand>
+ <systemCommand dataType="bit" bitLength="1">false</systemCommand>
+ <adsCommand dataType="bit" bitLength="1">true</adsCommand>
+ <noReturn dataType="bit" bitLength="1">false</noReturn>
+ <response dataType="bit" bitLength="1">false</response>
+ <broadcast dataType="bit" bitLength="1">false</broadcast>
+ <reserved dataType="int" bitLength="7">0</reserved>
<length dataType="uint" bitLength="32">12</length>
<errorCode dataType="uint" bitLength="32">0</errorCode>
<invokeId dataType="uint" bitLength="32">1</invokeId>
- <data>
- <AdsData>
- <AdsReadRequest>
- <indexGroup dataType="uint" bitLength="32">61455</indexGroup>
- <indexOffset dataType="uint" bitLength="32">0</indexOffset>
- <length dataType="uint" bitLength="32">24</length>
- </AdsReadRequest>
- </AdsData>
- </data>
+ <AdsReadRequest>
+ <indexGroup dataType="uint" bitLength="32">61455</indexGroup>
+ <indexOffset dataType="uint" bitLength="32">0</indexOffset>
+ <length dataType="uint" bitLength="32">24</length>
+ </AdsReadRequest>
</AmsPacket>
</userdata>
</AmsTCPPacket>
@@ -804,20 +752,16 @@
<commandId>
<CommandId dataType="uint" bitLength="16" stringRepresentation="ADS_READ_WRITE">9</CommandId>
</commandId>
- <state>
- <State>
- <initCommand dataType="bit" bitLength="1">false</initCommand>
- <updCommand dataType="bit" bitLength="1">false</updCommand>
- <timestampAdded dataType="bit" bitLength="1">false</timestampAdded>
- <highPriorityCommand dataType="bit" bitLength="1">false</highPriorityCommand>
- <systemCommand dataType="bit" bitLength="1">false</systemCommand>
- <adsCommand dataType="bit" bitLength="1">true</adsCommand>
- <noReturn dataType="bit" bitLength="1">false</noReturn>
- <response dataType="bit" bitLength="1">true</response>
- <broadcast dataType="bit" bitLength="1">false</broadcast>
- <reserved dataType="int" bitLength="7">0</reserved>
- </State>
- </state>
+ <initCommand dataType="bit" bitLength="1">false</initCommand>
+ <updCommand dataType="bit" bitLength="1">false</updCommand>
+ <timestampAdded dataType="bit" bitLength="1">false</timestampAdded>
+ <highPriorityCommand dataType="bit" bitLength="1">false</highPriorityCommand>
+ <systemCommand dataType="bit" bitLength="1">false</systemCommand>
+ <adsCommand dataType="bit" bitLength="1">true</adsCommand>
+ <noReturn dataType="bit" bitLength="1">false</noReturn>
+ <response dataType="bit" bitLength="1">true</response>
+ <broadcast dataType="bit" bitLength="1">false</broadcast>
+ <reserved dataType="int" bitLength="7">0</reserved>
<length dataType="uint" bitLength="32">12</length>
<errorCode dataType="uint" bitLength="32">0</errorCode>
<invokeId dataType="uint" bitLength="32">1</invokeId>
@@ -867,20 +811,16 @@
<commandId>
<CommandId dataType="uint" bitLength="16" stringRepresentation="ADS_READ">2</CommandId>
</commandId>
- <state>
- <State>
- <initCommand dataType="bit" bitLength="1">false</initCommand>
- <updCommand dataType="bit" bitLength="1">false</updCommand>
- <timestampAdded dataType="bit" bitLength="1">false</timestampAdded>
- <highPriorityCommand dataType="bit" bitLength="1">false</highPriorityCommand>
- <systemCommand dataType="bit" bitLength="1">false</systemCommand>
- <adsCommand dataType="bit" bitLength="1">true</adsCommand>
- <noReturn dataType="bit" bitLength="1">false</noReturn>
- <response dataType="bit" bitLength="1">false</response>
- <broadcast dataType="bit" bitLength="1">false</broadcast>
- <reserved dataType="int" bitLength="7">0</reserved>
- </State>
- </state>
+ <initCommand dataType="bit" bitLength="1">false</initCommand>
+ <updCommand dataType="bit" bitLength="1">false</updCommand>
+ <timestampAdded dataType="bit" bitLength="1">false</timestampAdded>
+ <highPriorityCommand dataType="bit" bitLength="1">false</highPriorityCommand>
+ <systemCommand dataType="bit" bitLength="1">false</systemCommand>
+ <adsCommand dataType="bit" bitLength="1">true</adsCommand>
+ <noReturn dataType="bit" bitLength="1">false</noReturn>
+ <response dataType="bit" bitLength="1">false</response>
+ <broadcast dataType="bit" bitLength="1">false</broadcast>
+ <reserved dataType="int" bitLength="7">0</reserved>
<length dataType="uint" bitLength="32">12</length>
<errorCode dataType="uint" bitLength="32">0</errorCode>
<invokeId dataType="uint" bitLength="32">2</invokeId>
@@ -929,20 +869,16 @@
<commandId>
<CommandId dataType="uint" bitLength="16" stringRepresentation="ADS_READ">2</CommandId>
</commandId>
- <state>
- <State>
- <initCommand dataType="bit" bitLength="1">false</initCommand>
- <updCommand dataType="bit" bitLength="1">false</updCommand>
- <timestampAdded dataType="bit" bitLength="1">false</timestampAdded>
- <highPriorityCommand dataType="bit" bitLength="1">false</highPriorityCommand>
- <systemCommand dataType="bit" bitLength="1">false</systemCommand>
- <adsCommand dataType="bit" bitLength="1">true</adsCommand>
- <noReturn dataType="bit" bitLength="1">false</noReturn>
- <response dataType="bit" bitLength="1">true</response>
- <broadcast dataType="bit" bitLength="1">false</broadcast>
- <reserved dataType="int" bitLength="7">0</reserved>
- </State>
- </state>
+ <initCommand dataType="bit" bitLength="1">false</initCommand>
+ <updCommand dataType="bit" bitLength="1">false</updCommand>
+ <timestampAdded dataType="bit" bitLength="1">false</timestampAdded>
+ <highPriorityCommand dataType="bit" bitLength="1">false</highPriorityCommand>
+ <systemCommand dataType="bit" bitLength="1">false</systemCommand>
+ <adsCommand dataType="bit" bitLength="1">true</adsCommand>
+ <noReturn dataType="bit" bitLength="1">false</noReturn>
+ <response dataType="bit" bitLength="1">true</response>
+ <broadcast dataType="bit" bitLength="1">false</broadcast>
+ <reserved dataType="int" bitLength="7">0</reserved>
<length dataType="uint" bitLength="32">18</length>
<errorCode dataType="uint" bitLength="32">0</errorCode>
<invokeId dataType="uint" bitLength="32">2</invokeId>
@@ -1027,20 +963,16 @@
<commandId>
<CommandId dataType="uint" bitLength="16" stringRepresentation="ADS_READ">2</CommandId>
</commandId>
- <state>
- <State>
- <initCommand dataType="bit" bitLength="1">false</initCommand>
- <updCommand dataType="bit" bitLength="1">false</updCommand>
- <timestampAdded dataType="bit" bitLength="1">false</timestampAdded>
- <highPriorityCommand dataType="bit" bitLength="1">false</highPriorityCommand>
- <systemCommand dataType="bit" bitLength="1">false</systemCommand>
- <adsCommand dataType="bit" bitLength="1">true</adsCommand>
- <noReturn dataType="bit" bitLength="1">false</noReturn>
- <response dataType="bit" bitLength="1">false</response>
- <broadcast dataType="bit" bitLength="1">false</broadcast>
- <reserved dataType="int" bitLength="7">0</reserved>
- </State>
- </state>
+ <initCommand dataType="bit" bitLength="1">false</initCommand>
+ <updCommand dataType="bit" bitLength="1">false</updCommand>
+ <timestampAdded dataType="bit" bitLength="1">false</timestampAdded>
+ <highPriorityCommand dataType="bit" bitLength="1">false</highPriorityCommand>
+ <systemCommand dataType="bit" bitLength="1">false</systemCommand>
+ <adsCommand dataType="bit" bitLength="1">true</adsCommand>
+ <noReturn dataType="bit" bitLength="1">false</noReturn>
+ <response dataType="bit" bitLength="1">false</response>
+ <broadcast dataType="bit" bitLength="1">false</broadcast>
+ <reserved dataType="int" bitLength="7">0</reserved>
<length dataType="uint" bitLength="32">12</length>
<errorCode dataType="uint" bitLength="32">0</errorCode>
<invokeId dataType="uint" bitLength="32">3</invokeId>
@@ -1088,20 +1020,16 @@
<commandId>
<CommandId dataType="uint" bitLength="16" stringRepresentation="ADS_READ">2</CommandId>
</commandId>
- <state>
- <State>
- <initCommand dataType="bit" bitLength="1">false</initCommand>
- <updCommand dataType="bit" bitLength="1">false</updCommand>
- <timestampAdded dataType="bit" bitLength="1">false</timestampAdded>
- <highPriorityCommand dataType="bit" bitLength="1">false</highPriorityCommand>
- <systemCommand dataType="bit" bitLength="1">false</systemCommand>
- <adsCommand dataType="bit" bitLength="1">true</adsCommand>
- <noReturn dataType="bit" bitLength="1">false</noReturn>
- <response dataType="bit" bitLength="1">true</response>
- <broadcast dataType="bit" bitLength="1">false</broadcast>
- <reserved dataType="int" bitLength="7">0</reserved>
- </State>
- </state>
+ <initCommand dataType="bit" bitLength="1">false</initCommand>
+ <updCommand dataType="bit" bitLength="1">false</updCommand>
+ <timestampAdded dataType="bit" bitLength="1">false</timestampAdded>
+ <highPriorityCommand dataType="bit" bitLength="1">false</highPriorityCommand>
+ <systemCommand dataType="bit" bitLength="1">false</systemCommand>
+ <adsCommand dataType="bit" bitLength="1">true</adsCommand>
+ <noReturn dataType="bit" bitLength="1">false</noReturn>
+ <response dataType="bit" bitLength="1">true</response>
+ <broadcast dataType="bit" bitLength="1">false</broadcast>
+ <reserved dataType="int" bitLength="7">0</reserved>
<length dataType="uint" bitLength="32">18</length>
<errorCode dataType="uint" bitLength="32">0</errorCode>
<invokeId dataType="uint" bitLength="32">3</invokeId>
diff --git a/plc4go/assets/testing/protocols/ads/ParserSerializerTestsuite.xml b/plc4go/assets/testing/protocols/ads/ParserSerializerTestsuite.xml
index 509f784d0..932762395 100644
--- a/plc4go/assets/testing/protocols/ads/ParserSerializerTestsuite.xml
+++ b/plc4go/assets/testing/protocols/ads/ParserSerializerTestsuite.xml
@@ -60,32 +60,24 @@
<commandId>
<CommandId dataType="uint" bitLength="16" stringRepresentation="ADS_READ">2</CommandId>
</commandId>
- <state>
- <State>
- <initCommand dataType="bit" bitLength="1">false</initCommand>
- <updCommand dataType="bit" bitLength="1">false</updCommand>
- <timestampAdded dataType="bit" bitLength="1">false</timestampAdded>
- <highPriorityCommand dataType="bit" bitLength="1">false</highPriorityCommand>
- <systemCommand dataType="bit" bitLength="1">false</systemCommand>
- <adsCommand dataType="bit" bitLength="1">true</adsCommand>
- <noReturn dataType="bit" bitLength="1">false</noReturn>
- <response dataType="bit" bitLength="1">false</response>
- <broadcast dataType="bit" bitLength="1">false</broadcast>
- <reserved dataType="int" bitLength="7">0</reserved>
- </State>
- </state>
+ <initCommand dataType="bit" bitLength="1">false</initCommand>
+ <updCommand dataType="bit" bitLength="1">false</updCommand>
+ <timestampAdded dataType="bit" bitLength="1">false</timestampAdded>
+ <highPriorityCommand dataType="bit" bitLength="1">false</highPriorityCommand>
+ <systemCommand dataType="bit" bitLength="1">false</systemCommand>
+ <adsCommand dataType="bit" bitLength="1">true</adsCommand>
+ <noReturn dataType="bit" bitLength="1">false</noReturn>
+ <response dataType="bit" bitLength="1">false</response>
+ <broadcast dataType="bit" bitLength="1">false</broadcast>
+ <reserved dataType="int" bitLength="7">0</reserved>
<length dataType="uint" bitLength="32">12</length>
<errorCode dataType="uint" bitLength="32">0</errorCode>
<invokeId dataType="uint" bitLength="32">2</invokeId>
- <data>
- <AdsData>
- <AdsReadRequest>
- <indexGroup dataType="uint" bitLength="32">61445</indexGroup>
- <indexOffset dataType="uint" bitLength="32">444596224</indexOffset>
- <length dataType="uint" bitLength="32">1</length>
- </AdsReadRequest>
- </AdsData>
- </data>
+ <AdsReadRequest>
+ <indexGroup dataType="uint" bitLength="32">61445</indexGroup>
+ <indexOffset dataType="uint" bitLength="32">444596224</indexOffset>
+ <length dataType="uint" bitLength="32">1</length>
+ </AdsReadRequest>
</AmsPacket>
</userdata>
</AmsTCPPacket>
@@ -127,34 +119,26 @@
<commandId>
<CommandId dataType="uint" bitLength="16" stringRepresentation="ADS_READ">2</CommandId>
</commandId>
- <state>
- <State>
- <initCommand dataType="bit" bitLength="1">false</initCommand>
- <updCommand dataType="bit" bitLength="1">false</updCommand>
- <timestampAdded dataType="bit" bitLength="1">false</timestampAdded>
- <highPriorityCommand dataType="bit" bitLength="1">false</highPriorityCommand>
- <systemCommand dataType="bit" bitLength="1">false</systemCommand>
- <adsCommand dataType="bit" bitLength="1">true</adsCommand>
- <noReturn dataType="bit" bitLength="1">false</noReturn>
- <response dataType="bit" bitLength="1">true</response>
- <broadcast dataType="bit" bitLength="1">false</broadcast>
- <reserved dataType="int" bitLength="7">0</reserved>
- </State>
- </state>
+ <initCommand dataType="bit" bitLength="1">false</initCommand>
+ <updCommand dataType="bit" bitLength="1">false</updCommand>
+ <timestampAdded dataType="bit" bitLength="1">false</timestampAdded>
+ <highPriorityCommand dataType="bit" bitLength="1">false</highPriorityCommand>
+ <systemCommand dataType="bit" bitLength="1">false</systemCommand>
+ <adsCommand dataType="bit" bitLength="1">true</adsCommand>
+ <noReturn dataType="bit" bitLength="1">false</noReturn>
+ <response dataType="bit" bitLength="1">true</response>
+ <broadcast dataType="bit" bitLength="1">false</broadcast>
+ <reserved dataType="int" bitLength="7">0</reserved>
<length dataType="uint" bitLength="32">9</length>
<errorCode dataType="uint" bitLength="32">0</errorCode>
<invokeId dataType="uint" bitLength="32">2</invokeId>
- <data>
- <AdsData>
- <AdsReadResponse>
- <result>
- <ReturnCode dataType="uint" bitLength="32" stringRepresentation="OK">0</ReturnCode>
- </result>
- <length dataType="uint" bitLength="32">1</length>
- <data dataType="byte" bitLength="8">0x01</data>
- </AdsReadResponse>
- </AdsData>
- </data>
+ <AdsReadResponse>
+ <result>
+ <ReturnCode dataType="uint" bitLength="32" stringRepresentation="OK">0</ReturnCode>
+ </result>
+ <length dataType="uint" bitLength="32">1</length>
+ <data dataType="byte" bitLength="8">0x01</data>
+ </AdsReadResponse>
</AmsPacket>
</userdata>
</AmsTCPPacket>
@@ -196,36 +180,28 @@
<commandId>
<CommandId dataType="uint" bitLength="16" stringRepresentation="ADS_READ_WRITE">9</CommandId>
</commandId>
- <state>
- <State>
- <initCommand dataType="bit" bitLength="1">false</initCommand>
- <updCommand dataType="bit" bitLength="1">false</updCommand>
- <timestampAdded dataType="bit" bitLength="1">false</timestampAdded>
- <highPriorityCommand dataType="bit" bitLength="1">false</highPriorityCommand>
- <systemCommand dataType="bit" bitLength="1">false</systemCommand>
- <adsCommand dataType="bit" bitLength="1">true</adsCommand>
- <noReturn dataType="bit" bitLength="1">false</noReturn>
- <response dataType="bit" bitLength="1">false</response>
- <broadcast dataType="bit" bitLength="1">false</broadcast>
- <reserved dataType="int" bitLength="7">0</reserved>
- </State>
- </state>
+ <initCommand dataType="bit" bitLength="1">false</initCommand>
+ <updCommand dataType="bit" bitLength="1">false</updCommand>
+ <timestampAdded dataType="bit" bitLength="1">false</timestampAdded>
+ <highPriorityCommand dataType="bit" bitLength="1">false</highPriorityCommand>
+ <systemCommand dataType="bit" bitLength="1">false</systemCommand>
+ <adsCommand dataType="bit" bitLength="1">true</adsCommand>
+ <noReturn dataType="bit" bitLength="1">false</noReturn>
+ <response dataType="bit" bitLength="1">false</response>
+ <broadcast dataType="bit" bitLength="1">false</broadcast>
+ <reserved dataType="int" bitLength="7">0</reserved>
<length dataType="uint" bitLength="32">42</length>
<errorCode dataType="uint" bitLength="32">0</errorCode>
<invokeId dataType="uint" bitLength="32">1</invokeId>
- <data>
- <AdsData>
- <AdsReadWriteRequest>
- <indexGroup dataType="uint" bitLength="32">61443</indexGroup>
- <indexOffset dataType="uint" bitLength="32">0</indexOffset>
- <readLength dataType="uint" bitLength="32">4</readLength>
- <writeLength dataType="uint" bitLength="32">26</writeLength>
- <items isList="true">
- </items>
- <data dataType="byte" bitLength="208">0x6d61696e2e665f74726967446174656947656c6573656e2e4d00</data>
- </AdsReadWriteRequest>
- </AdsData>
- </data>
+ <AdsReadWriteRequest>
+ <indexGroup dataType="uint" bitLength="32">61443</indexGroup>
+ <indexOffset dataType="uint" bitLength="32">0</indexOffset>
+ <readLength dataType="uint" bitLength="32">4</readLength>
+ <writeLength dataType="uint" bitLength="32">26</writeLength>
+ <items isList="true">
+ </items>
+ <data dataType="byte" bitLength="208">0x6d61696e2e665f74726967446174656947656c6573656e2e4d00</data>
+ </AdsReadWriteRequest>
</AmsPacket>
</userdata>
</AmsTCPPacket>
@@ -267,34 +243,26 @@
<commandId>
<CommandId dataType="uint" bitLength="16" stringRepresentation="ADS_READ_WRITE">9</CommandId>
</commandId>
- <state>
- <State>
- <initCommand dataType="bit" bitLength="1">false</initCommand>
- <updCommand dataType="bit" bitLength="1">false</updCommand>
- <timestampAdded dataType="bit" bitLength="1">false</timestampAdded>
- <highPriorityCommand dataType="bit" bitLength="1">false</highPriorityCommand>
- <systemCommand dataType="bit" bitLength="1">false</systemCommand>
- <adsCommand dataType="bit" bitLength="1">true</adsCommand>
- <noReturn dataType="bit" bitLength="1">false</noReturn>
- <response dataType="bit" bitLength="1">true</response>
- <broadcast dataType="bit" bitLength="1">false</broadcast>
- <reserved dataType="int" bitLength="7">0</reserved>
- </State>
- </state>
+ <initCommand dataType="bit" bitLength="1">false</initCommand>
+ <updCommand dataType="bit" bitLength="1">false</updCommand>
+ <timestampAdded dataType="bit" bitLength="1">false</timestampAdded>
+ <highPriorityCommand dataType="bit" bitLength="1">false</highPriorityCommand>
+ <systemCommand dataType="bit" bitLength="1">false</systemCommand>
+ <adsCommand dataType="bit" bitLength="1">true</adsCommand>
+ <noReturn dataType="bit" bitLength="1">false</noReturn>
+ <response dataType="bit" bitLength="1">true</response>
+ <broadcast dataType="bit" bitLength="1">false</broadcast>
+ <reserved dataType="int" bitLength="7">0</reserved>
<length dataType="uint" bitLength="32">12</length>
<errorCode dataType="uint" bitLength="32">0</errorCode>
<invokeId dataType="uint" bitLength="32">1</invokeId>
- <data>
- <AdsData>
- <AdsReadWriteResponse>
- <result>
- <ReturnCode dataType="uint" bitLength="32" stringRepresentation="OK">0</ReturnCode>
- </result>
- <length dataType="uint" bitLength="32">4</length>
- <data dataType="byte" bitLength="32">0x0100801b</data>
- </AdsReadWriteResponse>
- </AdsData>
- </data>
+ <AdsReadWriteResponse>
+ <result>
+ <ReturnCode dataType="uint" bitLength="32" stringRepresentation="OK">0</ReturnCode>
+ </result>
+ <length dataType="uint" bitLength="32">4</length>
+ <data dataType="byte" bitLength="32">0x0100801b</data>
+ </AdsReadWriteResponse>
</AmsPacket>
</userdata>
</AmsTCPPacket>
@@ -336,32 +304,24 @@
<commandId>
<CommandId dataType="uint" bitLength="16" stringRepresentation="ADS_READ">2</CommandId>
</commandId>
- <state>
- <State>
- <initCommand dataType="bit" bitLength="1">false</initCommand>
- <updCommand dataType="bit" bitLength="1">false</updCommand>
- <timestampAdded dataType="bit" bitLength="1">false</timestampAdded>
- <highPriorityCommand dataType="bit" bitLength="1">false</highPriorityCommand>
- <systemCommand dataType="bit" bitLength="1">false</systemCommand>
- <adsCommand dataType="bit" bitLength="1">true</adsCommand>
- <noReturn dataType="bit" bitLength="1">false</noReturn>
- <response dataType="bit" bitLength="1">false</response>
- <broadcast dataType="bit" bitLength="1">false</broadcast>
- <reserved dataType="int" bitLength="7">0</reserved>
- </State>
- </state>
+ <initCommand dataType="bit" bitLength="1">false</initCommand>
+ <updCommand dataType="bit" bitLength="1">false</updCommand>
+ <timestampAdded dataType="bit" bitLength="1">false</timestampAdded>
+ <highPriorityCommand dataType="bit" bitLength="1">false</highPriorityCommand>
+ <systemCommand dataType="bit" bitLength="1">false</systemCommand>
+ <adsCommand dataType="bit" bitLength="1">true</adsCommand>
+ <noReturn dataType="bit" bitLength="1">false</noReturn>
+ <response dataType="bit" bitLength="1">false</response>
+ <broadcast dataType="bit" bitLength="1">false</broadcast>
+ <reserved dataType="int" bitLength="7">0</reserved>
<length dataType="uint" bitLength="32">12</length>
<errorCode dataType="uint" bitLength="32">0</errorCode>
<invokeId dataType="uint" bitLength="32">1</invokeId>
- <data>
- <AdsData>
- <AdsReadRequest>
- <indexGroup dataType="uint" bitLength="32">61445</indexGroup>
- <indexOffset dataType="uint" bitLength="32">461373441</indexOffset>
- <length dataType="uint" bitLength="32">4</length>
- </AdsReadRequest>
- </AdsData>
- </data>
+ <AdsReadRequest>
+ <indexGroup dataType="uint" bitLength="32">61445</indexGroup>
+ <indexOffset dataType="uint" bitLength="32">461373441</indexOffset>
+ <length dataType="uint" bitLength="32">4</length>
+ </AdsReadRequest>
</AmsPacket>
</userdata>
</AmsTCPPacket>
@@ -403,34 +363,26 @@
<commandId>
<CommandId dataType="uint" bitLength="16" stringRepresentation="ADS_READ">2</CommandId>
</commandId>
- <state>
- <State>
- <initCommand dataType="bit" bitLength="1">false</initCommand>
- <updCommand dataType="bit" bitLength="1">false</updCommand>
- <timestampAdded dataType="bit" bitLength="1">false</timestampAdded>
- <highPriorityCommand dataType="bit" bitLength="1">false</highPriorityCommand>
- <systemCommand dataType="bit" bitLength="1">false</systemCommand>
- <adsCommand dataType="bit" bitLength="1">true</adsCommand>
- <noReturn dataType="bit" bitLength="1">false</noReturn>
- <response dataType="bit" bitLength="1">true</response>
- <broadcast dataType="bit" bitLength="1">false</broadcast>
- <reserved dataType="int" bitLength="7">0</reserved>
- </State>
- </state>
+ <initCommand dataType="bit" bitLength="1">false</initCommand>
+ <updCommand dataType="bit" bitLength="1">false</updCommand>
+ <timestampAdded dataType="bit" bitLength="1">false</timestampAdded>
+ <highPriorityCommand dataType="bit" bitLength="1">false</highPriorityCommand>
+ <systemCommand dataType="bit" bitLength="1">false</systemCommand>
+ <adsCommand dataType="bit" bitLength="1">true</adsCommand>
+ <noReturn dataType="bit" bitLength="1">false</noReturn>
+ <response dataType="bit" bitLength="1">true</response>
+ <broadcast dataType="bit" bitLength="1">false</broadcast>
+ <reserved dataType="int" bitLength="7">0</reserved>
<length dataType="uint" bitLength="32">9</length>
<errorCode dataType="uint" bitLength="32">0</errorCode>
<invokeId dataType="uint" bitLength="32">1</invokeId>
- <data>
- <AdsData>
- <AdsReadResponse>
- <result>
- <ReturnCode dataType="uint" bitLength="32" stringRepresentation="OK">0</ReturnCode>
- </result>
- <length dataType="uint" bitLength="32">1</length>
- <data dataType="byte" bitLength="8">0x01</data>
- </AdsReadResponse>
- </AdsData>
- </data>
+ <AdsReadResponse>
+ <result>
+ <ReturnCode dataType="uint" bitLength="32" stringRepresentation="OK">0</ReturnCode>
+ </result>
+ <length dataType="uint" bitLength="32">1</length>
+ <data dataType="byte" bitLength="8">0x01</data>
+ </AdsReadResponse>
</AmsPacket>
</userdata>
</AmsTCPPacket>
@@ -472,33 +424,25 @@
<commandId>
<CommandId dataType="uint" bitLength="16" stringRepresentation="ADS_WRITE">3</CommandId>
</commandId>
- <state>
- <State>
- <initCommand dataType="bit" bitLength="1">false</initCommand>
- <updCommand dataType="bit" bitLength="1">false</updCommand>
- <timestampAdded dataType="bit" bitLength="1">false</timestampAdded>
- <highPriorityCommand dataType="bit" bitLength="1">false</highPriorityCommand>
- <systemCommand dataType="bit" bitLength="1">false</systemCommand>
- <adsCommand dataType="bit" bitLength="1">true</adsCommand>
- <noReturn dataType="bit" bitLength="1">false</noReturn>
- <response dataType="bit" bitLength="1">false</response>
- <broadcast dataType="bit" bitLength="1">false</broadcast>
- <reserved dataType="int" bitLength="7">0</reserved>
- </State>
- </state>
+ <initCommand dataType="bit" bitLength="1">false</initCommand>
+ <updCommand dataType="bit" bitLength="1">false</updCommand>
+ <timestampAdded dataType="bit" bitLength="1">false</timestampAdded>
+ <highPriorityCommand dataType="bit" bitLength="1">false</highPriorityCommand>
+ <systemCommand dataType="bit" bitLength="1">false</systemCommand>
+ <adsCommand dataType="bit" bitLength="1">true</adsCommand>
+ <noReturn dataType="bit" bitLength="1">false</noReturn>
+ <response dataType="bit" bitLength="1">false</response>
+ <broadcast dataType="bit" bitLength="1">false</broadcast>
+ <reserved dataType="int" bitLength="7">0</reserved>
<length dataType="uint" bitLength="32">16</length>
<errorCode dataType="uint" bitLength="32">0</errorCode>
<invokeId dataType="uint" bitLength="32">1</invokeId>
- <data>
- <AdsData>
- <AdsWriteRequest>
- <indexGroup dataType="uint" bitLength="32">61446</indexGroup>
- <indexOffset dataType="uint" bitLength="32">0</indexOffset>
- <length dataType="uint" bitLength="32">4</length>
- <data dataType="byte" bitLength="32">0x0100801b</data>
- </AdsWriteRequest>
- </AdsData>
- </data>
+ <AdsWriteRequest>
+ <indexGroup dataType="uint" bitLength="32">61446</indexGroup>
+ <indexOffset dataType="uint" bitLength="32">0</indexOffset>
+ <length dataType="uint" bitLength="32">4</length>
+ <data dataType="byte" bitLength="32">0x0100801b</data>
+ </AdsWriteRequest>
</AmsPacket>
</userdata>
</AmsTCPPacket>
@@ -540,32 +484,24 @@
<commandId>
<CommandId dataType="uint" bitLength="16" stringRepresentation="ADS_WRITE">3</CommandId>
</commandId>
- <state>
- <State>
- <initCommand dataType="bit" bitLength="1">false</initCommand>
- <updCommand dataType="bit" bitLength="1">false</updCommand>
- <timestampAdded dataType="bit" bitLength="1">false</timestampAdded>
- <highPriorityCommand dataType="bit" bitLength="1">false</highPriorityCommand>
- <systemCommand dataType="bit" bitLength="1">false</systemCommand>
- <adsCommand dataType="bit" bitLength="1">true</adsCommand>
- <noReturn dataType="bit" bitLength="1">false</noReturn>
- <response dataType="bit" bitLength="1">true</response>
- <broadcast dataType="bit" bitLength="1">false</broadcast>
- <reserved dataType="int" bitLength="7">0</reserved>
- </State>
- </state>
+ <initCommand dataType="bit" bitLength="1">false</initCommand>
+ <updCommand dataType="bit" bitLength="1">false</updCommand>
+ <timestampAdded dataType="bit" bitLength="1">false</timestampAdded>
+ <highPriorityCommand dataType="bit" bitLength="1">false</highPriorityCommand>
+ <systemCommand dataType="bit" bitLength="1">false</systemCommand>
+ <adsCommand dataType="bit" bitLength="1">true</adsCommand>
+ <noReturn dataType="bit" bitLength="1">false</noReturn>
+ <response dataType="bit" bitLength="1">true</response>
+ <broadcast dataType="bit" bitLength="1">false</broadcast>
+ <reserved dataType="int" bitLength="7">0</reserved>
<length dataType="uint" bitLength="32">4</length>
<errorCode dataType="uint" bitLength="32">0</errorCode>
<invokeId dataType="uint" bitLength="32">1</invokeId>
- <data>
- <AdsData>
- <AdsWriteResponse>
- <result>
- <ReturnCode dataType="uint" bitLength="32" stringRepresentation="OK">0</ReturnCode>
- </result>
- </AdsWriteResponse>
- </AdsData>
- </data>
+ <AdsWriteResponse>
+ <result>
+ <ReturnCode dataType="uint" bitLength="32" stringRepresentation="OK">0</ReturnCode>
+ </result>
+ </AdsWriteResponse>
</AmsPacket>
</userdata>
</AmsTCPPacket>
diff --git a/plc4go/protocols/ads/readwrite/ParserHelper.go b/plc4go/protocols/ads/readwrite/ParserHelper.go
index d56304775..886924168 100644
--- a/plc4go/protocols/ads/readwrite/ParserHelper.go
+++ b/plc4go/protocols/ads/readwrite/ParserHelper.go
@@ -56,13 +56,6 @@ func (m AdsParserHelper) Parse(typeName string, arguments []string, io utils.Rea
return model.AmsSerialAcknowledgeFrameParse(io)
case "AdsDataTypeArrayInfo":
return model.AdsDataTypeArrayInfoParse(io)
- case "AdsData":
- commandId, _ := model.CommandIdByName(arguments[0])
- response, err := utils.StrToBool(arguments[1])
- if err != nil {
- return nil, errors.Wrap(err, "Error parsing")
- }
- return model.AdsDataParse(io, commandId, response)
case "AdsDataTypeTableEntry":
return model.AdsDataTypeTableEntryParse(io)
case "AmsNetId":
@@ -81,8 +74,6 @@ func (m AdsParserHelper) Parse(typeName string, arguments []string, io utils.Rea
return model.AdsSymbolTableEntryParse(io)
case "AmsTCPPacket":
return model.AmsTCPPacketParse(io)
- case "State":
- return model.StateParse(io)
case "AmsPacket":
return model.AmsPacketParse(io)
}
diff --git a/plc4go/protocols/ads/readwrite/XmlParserHelper.go b/plc4go/protocols/ads/readwrite/XmlParserHelper.go
index 15cbe3bf4..39125b2e7 100644
--- a/plc4go/protocols/ads/readwrite/XmlParserHelper.go
+++ b/plc4go/protocols/ads/readwrite/XmlParserHelper.go
@@ -66,10 +66,6 @@ func (m AdsXmlParserHelper) Parse(typeName string, xmlString string, parserArgum
return model.AmsSerialAcknowledgeFrameParse(utils.NewXmlReadBuffer(strings.NewReader(xmlString)))
case "AdsDataTypeArrayInfo":
return model.AdsDataTypeArrayInfoParse(utils.NewXmlReadBuffer(strings.NewReader(xmlString)))
- case "AdsData":
- commandId, _ := model.CommandIdByName(parserArguments[0])
- response := parserArguments[1] == "true"
- return model.AdsDataParse(utils.NewXmlReadBuffer(strings.NewReader(xmlString)), commandId, response)
case "AdsDataTypeTableEntry":
return model.AdsDataTypeTableEntryParse(utils.NewXmlReadBuffer(strings.NewReader(xmlString)))
case "AmsNetId":
@@ -88,8 +84,6 @@ func (m AdsXmlParserHelper) Parse(typeName string, xmlString string, parserArgum
return model.AdsSymbolTableEntryParse(utils.NewXmlReadBuffer(strings.NewReader(xmlString)))
case "AmsTCPPacket":
return model.AmsTCPPacketParse(utils.NewXmlReadBuffer(strings.NewReader(xmlString)))
- case "State":
- return model.StateParse(utils.NewXmlReadBuffer(strings.NewReader(xmlString)))
case "AmsPacket":
return model.AmsPacketParse(utils.NewXmlReadBuffer(strings.NewReader(xmlString)))
}
diff --git a/plc4go/protocols/ads/readwrite/model/AdsAddDeviceNotificationRequest.go b/plc4go/protocols/ads/readwrite/model/AdsAddDeviceNotificationRequest.go
index 173be92f0..99d0cf9a0 100644
--- a/plc4go/protocols/ads/readwrite/model/AdsAddDeviceNotificationRequest.go
+++ b/plc4go/protocols/ads/readwrite/model/AdsAddDeviceNotificationRequest.go
@@ -31,7 +31,7 @@ import (
type AdsAddDeviceNotificationRequest interface {
utils.LengthAware
utils.Serializable
- AdsData
+ AmsPacket
// GetIndexGroup returns IndexGroup (property field)
GetIndexGroup() uint32
// GetIndexOffset returns IndexOffset (property field)
@@ -55,7 +55,7 @@ type AdsAddDeviceNotificationRequestExactly interface {
// _AdsAddDeviceNotificationRequest is the data-structure of this message
type _AdsAddDeviceNotificationRequest struct {
- *_AdsData
+ *_AmsPacket
IndexGroup uint32
IndexOffset uint32
Length uint32
@@ -85,10 +85,17 @@ func (m *_AdsAddDeviceNotificationRequest) GetResponse() bool {
///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
-func (m *_AdsAddDeviceNotificationRequest) InitializeParent(parent AdsData) {}
+func (m *_AdsAddDeviceNotificationRequest) InitializeParent(parent AmsPacket, targetAmsNetId AmsNetId, targetAmsPort uint16, sourceAmsNetId AmsNetId, sourceAmsPort uint16, errorCode uint32, invokeId uint32) {
+ m.TargetAmsNetId = targetAmsNetId
+ m.TargetAmsPort = targetAmsPort
+ m.SourceAmsNetId = sourceAmsNetId
+ m.SourceAmsPort = sourceAmsPort
+ m.ErrorCode = errorCode
+ m.InvokeId = invokeId
+}
-func (m *_AdsAddDeviceNotificationRequest) GetParent() AdsData {
- return m._AdsData
+func (m *_AdsAddDeviceNotificationRequest) GetParent() AmsPacket {
+ return m._AmsPacket
}
///////////////////////////////////////////////////////////
@@ -126,7 +133,7 @@ func (m *_AdsAddDeviceNotificationRequest) GetCycleTime() uint32 {
///////////////////////////////////////////////////////////
// NewAdsAddDeviceNotificationRequest factory function for _AdsAddDeviceNotificationRequest
-func NewAdsAddDeviceNotificationRequest(indexGroup uint32, indexOffset uint32, length uint32, transmissionMode uint32, maxDelay uint32, cycleTime uint32) *_AdsAddDeviceNotificationRequest {
+func NewAdsAddDeviceNotificationRequest(indexGroup uint32, indexOffset uint32, length uint32, transmissionMode uint32, maxDelay uint32, cycleTime uint32, targetAmsNetId AmsNetId, targetAmsPort uint16, sourceAmsNetId AmsNetId, sourceAmsPort uint16, errorCode uint32, invokeId uint32) *_AdsAddDeviceNotificationRequest {
_result := &_AdsAddDeviceNotificationRequest{
IndexGroup: indexGroup,
IndexOffset: indexOffset,
@@ -134,9 +141,9 @@ func NewAdsAddDeviceNotificationRequest(indexGroup uint32, indexOffset uint32, l
TransmissionMode: transmissionMode,
MaxDelay: maxDelay,
CycleTime: cycleTime,
- _AdsData: NewAdsData(),
+ _AmsPacket: NewAmsPacket(targetAmsNetId, targetAmsPort, sourceAmsNetId, sourceAmsPort, errorCode, invokeId),
}
- _result._AdsData._AdsDataChildRequirements = _result
+ _result._AmsPacket._AmsPacketChildRequirements = _result
return _result
}
@@ -193,7 +200,7 @@ func (m *_AdsAddDeviceNotificationRequest) GetLengthInBytes() uint16 {
return m.GetLengthInBits() / 8
}
-func AdsAddDeviceNotificationRequestParse(readBuffer utils.ReadBuffer, commandId CommandId, response bool) (AdsAddDeviceNotificationRequest, error) {
+func AdsAddDeviceNotificationRequestParse(readBuffer utils.ReadBuffer) (AdsAddDeviceNotificationRequest, error) {
positionAware := readBuffer
_ = positionAware
if pullErr := readBuffer.PullContext("AdsAddDeviceNotificationRequest"); pullErr != nil {
@@ -284,7 +291,7 @@ func AdsAddDeviceNotificationRequestParse(readBuffer utils.ReadBuffer, commandId
// Create a partially initialized instance
_child := &_AdsAddDeviceNotificationRequest{
- _AdsData: &_AdsData{},
+ _AmsPacket: &_AmsPacket{},
IndexGroup: indexGroup,
IndexOffset: indexOffset,
Length: length,
@@ -294,7 +301,7 @@ func AdsAddDeviceNotificationRequestParse(readBuffer utils.ReadBuffer, commandId
reservedField0: reservedField0,
reservedField1: reservedField1,
}
- _child._AdsData._AdsDataChildRequirements = _child
+ _child._AmsPacket._AmsPacketChildRequirements = _child
return _child, nil
}
diff --git a/plc4go/protocols/ads/readwrite/model/AdsAddDeviceNotificationResponse.go b/plc4go/protocols/ads/readwrite/model/AdsAddDeviceNotificationResponse.go
index 0e98a023e..90191ce29 100644
--- a/plc4go/protocols/ads/readwrite/model/AdsAddDeviceNotificationResponse.go
+++ b/plc4go/protocols/ads/readwrite/model/AdsAddDeviceNotificationResponse.go
@@ -30,7 +30,7 @@ import (
type AdsAddDeviceNotificationResponse interface {
utils.LengthAware
utils.Serializable
- AdsData
+ AmsPacket
// GetResult returns Result (property field)
GetResult() ReturnCode
// GetNotificationHandle returns NotificationHandle (property field)
@@ -46,7 +46,7 @@ type AdsAddDeviceNotificationResponseExactly interface {
// _AdsAddDeviceNotificationResponse is the data-structure of this message
type _AdsAddDeviceNotificationResponse struct {
- *_AdsData
+ *_AmsPacket
Result ReturnCode
NotificationHandle uint32
}
@@ -69,10 +69,17 @@ func (m *_AdsAddDeviceNotificationResponse) GetResponse() bool {
///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
-func (m *_AdsAddDeviceNotificationResponse) InitializeParent(parent AdsData) {}
+func (m *_AdsAddDeviceNotificationResponse) InitializeParent(parent AmsPacket, targetAmsNetId AmsNetId, targetAmsPort uint16, sourceAmsNetId AmsNetId, sourceAmsPort uint16, errorCode uint32, invokeId uint32) {
+ m.TargetAmsNetId = targetAmsNetId
+ m.TargetAmsPort = targetAmsPort
+ m.SourceAmsNetId = sourceAmsNetId
+ m.SourceAmsPort = sourceAmsPort
+ m.ErrorCode = errorCode
+ m.InvokeId = invokeId
+}
-func (m *_AdsAddDeviceNotificationResponse) GetParent() AdsData {
- return m._AdsData
+func (m *_AdsAddDeviceNotificationResponse) GetParent() AmsPacket {
+ return m._AmsPacket
}
///////////////////////////////////////////////////////////
@@ -94,13 +101,13 @@ func (m *_AdsAddDeviceNotificationResponse) GetNotificationHandle() uint32 {
///////////////////////////////////////////////////////////
// NewAdsAddDeviceNotificationResponse factory function for _AdsAddDeviceNotificationResponse
-func NewAdsAddDeviceNotificationResponse(result ReturnCode, notificationHandle uint32) *_AdsAddDeviceNotificationResponse {
+func NewAdsAddDeviceNotificationResponse(result ReturnCode, notificationHandle uint32, targetAmsNetId AmsNetId, targetAmsPort uint16, sourceAmsNetId AmsNetId, sourceAmsPort uint16, errorCode uint32, invokeId uint32) *_AdsAddDeviceNotificationResponse {
_result := &_AdsAddDeviceNotificationResponse{
Result: result,
NotificationHandle: notificationHandle,
- _AdsData: NewAdsData(),
+ _AmsPacket: NewAmsPacket(targetAmsNetId, targetAmsPort, sourceAmsNetId, sourceAmsPort, errorCode, invokeId),
}
- _result._AdsData._AdsDataChildRequirements = _result
+ _result._AmsPacket._AmsPacketChildRequirements = _result
return _result
}
@@ -139,7 +146,7 @@ func (m *_AdsAddDeviceNotificationResponse) GetLengthInBytes() uint16 {
return m.GetLengthInBits() / 8
}
-func AdsAddDeviceNotificationResponseParse(readBuffer utils.ReadBuffer, commandId CommandId, response bool) (AdsAddDeviceNotificationResponse, error) {
+func AdsAddDeviceNotificationResponseParse(readBuffer utils.ReadBuffer) (AdsAddDeviceNotificationResponse, error) {
positionAware := readBuffer
_ = positionAware
if pullErr := readBuffer.PullContext("AdsAddDeviceNotificationResponse"); pullErr != nil {
@@ -174,11 +181,11 @@ func AdsAddDeviceNotificationResponseParse(readBuffer utils.ReadBuffer, commandI
// Create a partially initialized instance
_child := &_AdsAddDeviceNotificationResponse{
- _AdsData: &_AdsData{},
+ _AmsPacket: &_AmsPacket{},
Result: result,
NotificationHandle: notificationHandle,
}
- _child._AdsData._AdsDataChildRequirements = _child
+ _child._AmsPacket._AmsPacketChildRequirements = _child
return _child, nil
}
diff --git a/plc4go/protocols/ads/readwrite/model/AdsDataTypeArrayInfo.go b/plc4go/protocols/ads/readwrite/model/AdsDataTypeArrayInfo.go
index 5750d636f..5c602dde4 100644
--- a/plc4go/protocols/ads/readwrite/model/AdsDataTypeArrayInfo.go
+++ b/plc4go/protocols/ads/readwrite/model/AdsDataTypeArrayInfo.go
@@ -202,7 +202,7 @@ func (m *_AdsDataTypeArrayInfo) String() string {
if m == nil {
return "<nil>"
}
- writeBuffer := utils.NewBoxedWriteBufferWithOptions(true, true)
+ writeBuffer := utils.NewWriteBufferBoxBasedWithOptions(true, true)
if err := writeBuffer.WriteSerializable(m); err != nil {
return err.Error()
}
diff --git a/plc4go/protocols/ads/readwrite/model/AdsDataTypeTableChildEntry.go b/plc4go/protocols/ads/readwrite/model/AdsDataTypeTableChildEntry.go
index d9aab4997..7027cfe57 100644
--- a/plc4go/protocols/ads/readwrite/model/AdsDataTypeTableChildEntry.go
+++ b/plc4go/protocols/ads/readwrite/model/AdsDataTypeTableChildEntry.go
@@ -716,7 +716,7 @@ func (m *_AdsDataTypeTableChildEntry) String() string {
if m == nil {
return "<nil>"
}
- writeBuffer := utils.NewBoxedWriteBufferWithOptions(true, true)
+ writeBuffer := utils.NewWriteBufferBoxBasedWithOptions(true, true)
if err := writeBuffer.WriteSerializable(m); err != nil {
return err.Error()
}
diff --git a/plc4go/protocols/ads/readwrite/model/AdsDataTypeTableEntry.go b/plc4go/protocols/ads/readwrite/model/AdsDataTypeTableEntry.go
index e4ef888a1..173141ed8 100644
--- a/plc4go/protocols/ads/readwrite/model/AdsDataTypeTableEntry.go
+++ b/plc4go/protocols/ads/readwrite/model/AdsDataTypeTableEntry.go
@@ -716,7 +716,7 @@ func (m *_AdsDataTypeTableEntry) String() string {
if m == nil {
return "<nil>"
}
- writeBuffer := utils.NewBoxedWriteBufferWithOptions(true, true)
+ writeBuffer := utils.NewWriteBufferBoxBasedWithOptions(true, true)
if err := writeBuffer.WriteSerializable(m); err != nil {
return err.Error()
}
diff --git a/plc4go/protocols/ads/readwrite/model/AdsDeleteDeviceNotificationRequest.go b/plc4go/protocols/ads/readwrite/model/AdsDeleteDeviceNotificationRequest.go
index 37f7eb089..924484d32 100644
--- a/plc4go/protocols/ads/readwrite/model/AdsDeleteDeviceNotificationRequest.go
+++ b/plc4go/protocols/ads/readwrite/model/AdsDeleteDeviceNotificationRequest.go
@@ -30,7 +30,7 @@ import (
type AdsDeleteDeviceNotificationRequest interface {
utils.LengthAware
utils.Serializable
- AdsData
+ AmsPacket
// GetNotificationHandle returns NotificationHandle (property field)
GetNotificationHandle() uint32
}
@@ -44,7 +44,7 @@ type AdsDeleteDeviceNotificationRequestExactly interface {
// _AdsDeleteDeviceNotificationRequest is the data-structure of this message
type _AdsDeleteDeviceNotificationRequest struct {
- *_AdsData
+ *_AmsPacket
NotificationHandle uint32
}
@@ -66,10 +66,17 @@ func (m *_AdsDeleteDeviceNotificationRequest) GetResponse() bool {
///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
-func (m *_AdsDeleteDeviceNotificationRequest) InitializeParent(parent AdsData) {}
+func (m *_AdsDeleteDeviceNotificationRequest) InitializeParent(parent AmsPacket, targetAmsNetId AmsNetId, targetAmsPort uint16, sourceAmsNetId AmsNetId, sourceAmsPort uint16, errorCode uint32, invokeId uint32) {
+ m.TargetAmsNetId = targetAmsNetId
+ m.TargetAmsPort = targetAmsPort
+ m.SourceAmsNetId = sourceAmsNetId
+ m.SourceAmsPort = sourceAmsPort
+ m.ErrorCode = errorCode
+ m.InvokeId = invokeId
+}
-func (m *_AdsDeleteDeviceNotificationRequest) GetParent() AdsData {
- return m._AdsData
+func (m *_AdsDeleteDeviceNotificationRequest) GetParent() AmsPacket {
+ return m._AmsPacket
}
///////////////////////////////////////////////////////////
@@ -87,12 +94,12 @@ func (m *_AdsDeleteDeviceNotificationRequest) GetNotificationHandle() uint32 {
///////////////////////////////////////////////////////////
// NewAdsDeleteDeviceNotificationRequest factory function for _AdsDeleteDeviceNotificationRequest
-func NewAdsDeleteDeviceNotificationRequest(notificationHandle uint32) *_AdsDeleteDeviceNotificationRequest {
+func NewAdsDeleteDeviceNotificationRequest(notificationHandle uint32, targetAmsNetId AmsNetId, targetAmsPort uint16, sourceAmsNetId AmsNetId, sourceAmsPort uint16, errorCode uint32, invokeId uint32) *_AdsDeleteDeviceNotificationRequest {
_result := &_AdsDeleteDeviceNotificationRequest{
NotificationHandle: notificationHandle,
- _AdsData: NewAdsData(),
+ _AmsPacket: NewAmsPacket(targetAmsNetId, targetAmsPort, sourceAmsNetId, sourceAmsPort, errorCode, invokeId),
}
- _result._AdsData._AdsDataChildRequirements = _result
+ _result._AmsPacket._AmsPacketChildRequirements = _result
return _result
}
@@ -128,7 +135,7 @@ func (m *_AdsDeleteDeviceNotificationRequest) GetLengthInBytes() uint16 {
return m.GetLengthInBits() / 8
}
-func AdsDeleteDeviceNotificationRequestParse(readBuffer utils.ReadBuffer, commandId CommandId, response bool) (AdsDeleteDeviceNotificationRequest, error) {
+func AdsDeleteDeviceNotificationRequestParse(readBuffer utils.ReadBuffer) (AdsDeleteDeviceNotificationRequest, error) {
positionAware := readBuffer
_ = positionAware
if pullErr := readBuffer.PullContext("AdsDeleteDeviceNotificationRequest"); pullErr != nil {
@@ -150,10 +157,10 @@ func AdsDeleteDeviceNotificationRequestParse(readBuffer utils.ReadBuffer, comman
// Create a partially initialized instance
_child := &_AdsDeleteDeviceNotificationRequest{
- _AdsData: &_AdsData{},
+ _AmsPacket: &_AmsPacket{},
NotificationHandle: notificationHandle,
}
- _child._AdsData._AdsDataChildRequirements = _child
+ _child._AmsPacket._AmsPacketChildRequirements = _child
return _child, nil
}
diff --git a/plc4go/protocols/ads/readwrite/model/AdsDeleteDeviceNotificationResponse.go b/plc4go/protocols/ads/readwrite/model/AdsDeleteDeviceNotificationResponse.go
index c6a491d1f..41fab08d5 100644
--- a/plc4go/protocols/ads/readwrite/model/AdsDeleteDeviceNotificationResponse.go
+++ b/plc4go/protocols/ads/readwrite/model/AdsDeleteDeviceNotificationResponse.go
@@ -30,7 +30,7 @@ import (
type AdsDeleteDeviceNotificationResponse interface {
utils.LengthAware
utils.Serializable
- AdsData
+ AmsPacket
// GetResult returns Result (property field)
GetResult() ReturnCode
}
@@ -44,7 +44,7 @@ type AdsDeleteDeviceNotificationResponseExactly interface {
// _AdsDeleteDeviceNotificationResponse is the data-structure of this message
type _AdsDeleteDeviceNotificationResponse struct {
- *_AdsData
+ *_AmsPacket
Result ReturnCode
}
@@ -66,10 +66,17 @@ func (m *_AdsDeleteDeviceNotificationResponse) GetResponse() bool {
///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
-func (m *_AdsDeleteDeviceNotificationResponse) InitializeParent(parent AdsData) {}
+func (m *_AdsDeleteDeviceNotificationResponse) InitializeParent(parent AmsPacket, targetAmsNetId AmsNetId, targetAmsPort uint16, sourceAmsNetId AmsNetId, sourceAmsPort uint16, errorCode uint32, invokeId uint32) {
+ m.TargetAmsNetId = targetAmsNetId
+ m.TargetAmsPort = targetAmsPort
+ m.SourceAmsNetId = sourceAmsNetId
+ m.SourceAmsPort = sourceAmsPort
+ m.ErrorCode = errorCode
+ m.InvokeId = invokeId
+}
-func (m *_AdsDeleteDeviceNotificationResponse) GetParent() AdsData {
- return m._AdsData
+func (m *_AdsDeleteDeviceNotificationResponse) GetParent() AmsPacket {
+ return m._AmsPacket
}
///////////////////////////////////////////////////////////
@@ -87,12 +94,12 @@ func (m *_AdsDeleteDeviceNotificationResponse) GetResult() ReturnCode {
///////////////////////////////////////////////////////////
// NewAdsDeleteDeviceNotificationResponse factory function for _AdsDeleteDeviceNotificationResponse
-func NewAdsDeleteDeviceNotificationResponse(result ReturnCode) *_AdsDeleteDeviceNotificationResponse {
+func NewAdsDeleteDeviceNotificationResponse(result ReturnCode, targetAmsNetId AmsNetId, targetAmsPort uint16, sourceAmsNetId AmsNetId, sourceAmsPort uint16, errorCode uint32, invokeId uint32) *_AdsDeleteDeviceNotificationResponse {
_result := &_AdsDeleteDeviceNotificationResponse{
- Result: result,
- _AdsData: NewAdsData(),
+ Result: result,
+ _AmsPacket: NewAmsPacket(targetAmsNetId, targetAmsPort, sourceAmsNetId, sourceAmsPort, errorCode, invokeId),
}
- _result._AdsData._AdsDataChildRequirements = _result
+ _result._AmsPacket._AmsPacketChildRequirements = _result
return _result
}
@@ -128,7 +135,7 @@ func (m *_AdsDeleteDeviceNotificationResponse) GetLengthInBytes() uint16 {
return m.GetLengthInBits() / 8
}
-func AdsDeleteDeviceNotificationResponseParse(readBuffer utils.ReadBuffer, commandId CommandId, response bool) (AdsDeleteDeviceNotificationResponse, error) {
+func AdsDeleteDeviceNotificationResponseParse(readBuffer utils.ReadBuffer) (AdsDeleteDeviceNotificationResponse, error) {
positionAware := readBuffer
_ = positionAware
if pullErr := readBuffer.PullContext("AdsDeleteDeviceNotificationResponse"); pullErr != nil {
@@ -156,10 +163,10 @@ func AdsDeleteDeviceNotificationResponseParse(readBuffer utils.ReadBuffer, comma
// Create a partially initialized instance
_child := &_AdsDeleteDeviceNotificationResponse{
- _AdsData: &_AdsData{},
- Result: result,
+ _AmsPacket: &_AmsPacket{},
+ Result: result,
}
- _child._AdsData._AdsDataChildRequirements = _child
+ _child._AmsPacket._AmsPacketChildRequirements = _child
return _child, nil
}
diff --git a/plc4go/protocols/ads/readwrite/model/AdsDeviceNotificationRequest.go b/plc4go/protocols/ads/readwrite/model/AdsDeviceNotificationRequest.go
index 2c17a2e74..be8119af4 100644
--- a/plc4go/protocols/ads/readwrite/model/AdsDeviceNotificationRequest.go
+++ b/plc4go/protocols/ads/readwrite/model/AdsDeviceNotificationRequest.go
@@ -30,7 +30,7 @@ import (
type AdsDeviceNotificationRequest interface {
utils.LengthAware
utils.Serializable
- AdsData
+ AmsPacket
// GetLength returns Length (property field)
GetLength() uint32
// GetStamps returns Stamps (property field)
@@ -48,7 +48,7 @@ type AdsDeviceNotificationRequestExactly interface {
// _AdsDeviceNotificationRequest is the data-structure of this message
type _AdsDeviceNotificationRequest struct {
- *_AdsData
+ *_AmsPacket
Length uint32
Stamps uint32
AdsStampHeaders []AdsStampHeader
@@ -72,10 +72,17 @@ func (m *_AdsDeviceNotificationRequest) GetResponse() bool {
///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
-func (m *_AdsDeviceNotificationRequest) InitializeParent(parent AdsData) {}
+func (m *_AdsDeviceNotificationRequest) InitializeParent(parent AmsPacket, targetAmsNetId AmsNetId, targetAmsPort uint16, sourceAmsNetId AmsNetId, sourceAmsPort uint16, errorCode uint32, invokeId uint32) {
+ m.TargetAmsNetId = targetAmsNetId
+ m.TargetAmsPort = targetAmsPort
+ m.SourceAmsNetId = sourceAmsNetId
+ m.SourceAmsPort = sourceAmsPort
+ m.ErrorCode = errorCode
+ m.InvokeId = invokeId
+}
-func (m *_AdsDeviceNotificationRequest) GetParent() AdsData {
- return m._AdsData
+func (m *_AdsDeviceNotificationRequest) GetParent() AmsPacket {
+ return m._AmsPacket
}
///////////////////////////////////////////////////////////
@@ -101,14 +108,14 @@ func (m *_AdsDeviceNotificationRequest) GetAdsStampHeaders() []AdsStampHeader {
///////////////////////////////////////////////////////////
// NewAdsDeviceNotificationRequest factory function for _AdsDeviceNotificationRequest
-func NewAdsDeviceNotificationRequest(length uint32, stamps uint32, adsStampHeaders []AdsStampHeader) *_AdsDeviceNotificationRequest {
+func NewAdsDeviceNotificationRequest(length uint32, stamps uint32, adsStampHeaders []AdsStampHeader, targetAmsNetId AmsNetId, targetAmsPort uint16, sourceAmsNetId AmsNetId, sourceAmsPort uint16, errorCode uint32, invokeId uint32) *_AdsDeviceNotificationRequest {
_result := &_AdsDeviceNotificationRequest{
Length: length,
Stamps: stamps,
AdsStampHeaders: adsStampHeaders,
- _AdsData: NewAdsData(),
+ _AmsPacket: NewAmsPacket(targetAmsNetId, targetAmsPort, sourceAmsNetId, sourceAmsPort, errorCode, invokeId),
}
- _result._AdsData._AdsDataChildRequirements = _result
+ _result._AmsPacket._AmsPacketChildRequirements = _result
return _result
}
@@ -155,7 +162,7 @@ func (m *_AdsDeviceNotificationRequest) GetLengthInBytes() uint16 {
return m.GetLengthInBits() / 8
}
-func AdsDeviceNotificationRequestParse(readBuffer utils.ReadBuffer, commandId CommandId, response bool) (AdsDeviceNotificationRequest, error) {
+func AdsDeviceNotificationRequestParse(readBuffer utils.ReadBuffer) (AdsDeviceNotificationRequest, error) {
positionAware := readBuffer
_ = positionAware
if pullErr := readBuffer.PullContext("AdsDeviceNotificationRequest"); pullErr != nil {
@@ -207,12 +214,12 @@ func AdsDeviceNotificationRequestParse(readBuffer utils.ReadBuffer, commandId Co
// Create a partially initialized instance
_child := &_AdsDeviceNotificationRequest{
- _AdsData: &_AdsData{},
+ _AmsPacket: &_AmsPacket{},
Length: length,
Stamps: stamps,
AdsStampHeaders: adsStampHeaders,
}
- _child._AdsData._AdsDataChildRequirements = _child
+ _child._AmsPacket._AmsPacketChildRequirements = _child
return _child, nil
}
diff --git a/plc4go/protocols/ads/readwrite/model/AdsDeviceNotificationResponse.go b/plc4go/protocols/ads/readwrite/model/AdsDeviceNotificationResponse.go
index 1c64443bd..f8fea545f 100644
--- a/plc4go/protocols/ads/readwrite/model/AdsDeviceNotificationResponse.go
+++ b/plc4go/protocols/ads/readwrite/model/AdsDeviceNotificationResponse.go
@@ -30,7 +30,7 @@ import (
type AdsDeviceNotificationResponse interface {
utils.LengthAware
utils.Serializable
- AdsData
+ AmsPacket
}
// AdsDeviceNotificationResponseExactly can be used when we want exactly this type and not a type which fulfills AdsDeviceNotificationResponse.
@@ -42,7 +42,7 @@ type AdsDeviceNotificationResponseExactly interface {
// _AdsDeviceNotificationResponse is the data-structure of this message
type _AdsDeviceNotificationResponse struct {
- *_AdsData
+ *_AmsPacket
}
///////////////////////////////////////////////////////////
@@ -63,18 +63,25 @@ func (m *_AdsDeviceNotificationResponse) GetResponse() bool {
///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
-func (m *_AdsDeviceNotificationResponse) InitializeParent(parent AdsData) {}
+func (m *_AdsDeviceNotificationResponse) InitializeParent(parent AmsPacket, targetAmsNetId AmsNetId, targetAmsPort uint16, sourceAmsNetId AmsNetId, sourceAmsPort uint16, errorCode uint32, invokeId uint32) {
+ m.TargetAmsNetId = targetAmsNetId
+ m.TargetAmsPort = targetAmsPort
+ m.SourceAmsNetId = sourceAmsNetId
+ m.SourceAmsPort = sourceAmsPort
+ m.ErrorCode = errorCode
+ m.InvokeId = invokeId
+}
-func (m *_AdsDeviceNotificationResponse) GetParent() AdsData {
- return m._AdsData
+func (m *_AdsDeviceNotificationResponse) GetParent() AmsPacket {
+ return m._AmsPacket
}
// NewAdsDeviceNotificationResponse factory function for _AdsDeviceNotificationResponse
-func NewAdsDeviceNotificationResponse() *_AdsDeviceNotificationResponse {
+func NewAdsDeviceNotificationResponse(targetAmsNetId AmsNetId, targetAmsPort uint16, sourceAmsNetId AmsNetId, sourceAmsPort uint16, errorCode uint32, invokeId uint32) *_AdsDeviceNotificationResponse {
_result := &_AdsDeviceNotificationResponse{
- _AdsData: NewAdsData(),
+ _AmsPacket: NewAmsPacket(targetAmsNetId, targetAmsPort, sourceAmsNetId, sourceAmsPort, errorCode, invokeId),
}
- _result._AdsData._AdsDataChildRequirements = _result
+ _result._AmsPacket._AmsPacketChildRequirements = _result
return _result
}
@@ -107,7 +114,7 @@ func (m *_AdsDeviceNotificationResponse) GetLengthInBytes() uint16 {
return m.GetLengthInBits() / 8
}
-func AdsDeviceNotificationResponseParse(readBuffer utils.ReadBuffer, commandId CommandId, response bool) (AdsDeviceNotificationResponse, error) {
+func AdsDeviceNotificationResponseParse(readBuffer utils.ReadBuffer) (AdsDeviceNotificationResponse, error) {
positionAware := readBuffer
_ = positionAware
if pullErr := readBuffer.PullContext("AdsDeviceNotificationResponse"); pullErr != nil {
@@ -122,9 +129,9 @@ func AdsDeviceNotificationResponseParse(readBuffer utils.ReadBuffer, commandId C
// Create a partially initialized instance
_child := &_AdsDeviceNotificationResponse{
- _AdsData: &_AdsData{},
+ _AmsPacket: &_AmsPacket{},
}
- _child._AdsData._AdsDataChildRequirements = _child
+ _child._AmsPacket._AmsPacketChildRequirements = _child
return _child, nil
}
diff --git a/plc4go/protocols/ads/readwrite/model/AdsInvalidRequest.go b/plc4go/protocols/ads/readwrite/model/AdsInvalidRequest.go
index 7b95b7356..d75f7f012 100644
--- a/plc4go/protocols/ads/readwrite/model/AdsInvalidRequest.go
+++ b/plc4go/protocols/ads/readwrite/model/AdsInvalidRequest.go
@@ -30,7 +30,7 @@ import (
type AdsInvalidRequest interface {
utils.LengthAware
utils.Serializable
- AdsData
+ AmsPacket
}
// AdsInvalidRequestExactly can be used when we want exactly this type and not a type which fulfills AdsInvalidRequest.
@@ -42,7 +42,7 @@ type AdsInvalidRequestExactly interface {
// _AdsInvalidRequest is the data-structure of this message
type _AdsInvalidRequest struct {
- *_AdsData
+ *_AmsPacket
}
///////////////////////////////////////////////////////////
@@ -63,18 +63,25 @@ func (m *_AdsInvalidRequest) GetResponse() bool {
///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
-func (m *_AdsInvalidRequest) InitializeParent(parent AdsData) {}
+func (m *_AdsInvalidRequest) InitializeParent(parent AmsPacket, targetAmsNetId AmsNetId, targetAmsPort uint16, sourceAmsNetId AmsNetId, sourceAmsPort uint16, errorCode uint32, invokeId uint32) {
+ m.TargetAmsNetId = targetAmsNetId
+ m.TargetAmsPort = targetAmsPort
+ m.SourceAmsNetId = sourceAmsNetId
+ m.SourceAmsPort = sourceAmsPort
+ m.ErrorCode = errorCode
+ m.InvokeId = invokeId
+}
-func (m *_AdsInvalidRequest) GetParent() AdsData {
- return m._AdsData
+func (m *_AdsInvalidRequest) GetParent() AmsPacket {
+ return m._AmsPacket
}
// NewAdsInvalidRequest factory function for _AdsInvalidRequest
-func NewAdsInvalidRequest() *_AdsInvalidRequest {
+func NewAdsInvalidRequest(targetAmsNetId AmsNetId, targetAmsPort uint16, sourceAmsNetId AmsNetId, sourceAmsPort uint16, errorCode uint32, invokeId uint32) *_AdsInvalidRequest {
_result := &_AdsInvalidRequest{
- _AdsData: NewAdsData(),
+ _AmsPacket: NewAmsPacket(targetAmsNetId, targetAmsPort, sourceAmsNetId, sourceAmsPort, errorCode, invokeId),
}
- _result._AdsData._AdsDataChildRequirements = _result
+ _result._AmsPacket._AmsPacketChildRequirements = _result
return _result
}
@@ -107,7 +114,7 @@ func (m *_AdsInvalidRequest) GetLengthInBytes() uint16 {
return m.GetLengthInBits() / 8
}
-func AdsInvalidRequestParse(readBuffer utils.ReadBuffer, commandId CommandId, response bool) (AdsInvalidRequest, error) {
+func AdsInvalidRequestParse(readBuffer utils.ReadBuffer) (AdsInvalidRequest, error) {
positionAware := readBuffer
_ = positionAware
if pullErr := readBuffer.PullContext("AdsInvalidRequest"); pullErr != nil {
@@ -122,9 +129,9 @@ func AdsInvalidRequestParse(readBuffer utils.ReadBuffer, commandId CommandId, re
// Create a partially initialized instance
_child := &_AdsInvalidRequest{
- _AdsData: &_AdsData{},
+ _AmsPacket: &_AmsPacket{},
}
- _child._AdsData._AdsDataChildRequirements = _child
+ _child._AmsPacket._AmsPacketChildRequirements = _child
return _child, nil
}
diff --git a/plc4go/protocols/ads/readwrite/model/AdsInvalidResponse.go b/plc4go/protocols/ads/readwrite/model/AdsInvalidResponse.go
index f24464383..5259e59c5 100644
--- a/plc4go/protocols/ads/readwrite/model/AdsInvalidResponse.go
+++ b/plc4go/protocols/ads/readwrite/model/AdsInvalidResponse.go
@@ -30,7 +30,7 @@ import (
type AdsInvalidResponse interface {
utils.LengthAware
utils.Serializable
- AdsData
+ AmsPacket
}
// AdsInvalidResponseExactly can be used when we want exactly this type and not a type which fulfills AdsInvalidResponse.
@@ -42,7 +42,7 @@ type AdsInvalidResponseExactly interface {
// _AdsInvalidResponse is the data-structure of this message
type _AdsInvalidResponse struct {
- *_AdsData
+ *_AmsPacket
}
///////////////////////////////////////////////////////////
@@ -63,18 +63,25 @@ func (m *_AdsInvalidResponse) GetResponse() bool {
///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
-func (m *_AdsInvalidResponse) InitializeParent(parent AdsData) {}
+func (m *_AdsInvalidResponse) InitializeParent(parent AmsPacket, targetAmsNetId AmsNetId, targetAmsPort uint16, sourceAmsNetId AmsNetId, sourceAmsPort uint16, errorCode uint32, invokeId uint32) {
+ m.TargetAmsNetId = targetAmsNetId
+ m.TargetAmsPort = targetAmsPort
+ m.SourceAmsNetId = sourceAmsNetId
+ m.SourceAmsPort = sourceAmsPort
+ m.ErrorCode = errorCode
+ m.InvokeId = invokeId
+}
-func (m *_AdsInvalidResponse) GetParent() AdsData {
- return m._AdsData
+func (m *_AdsInvalidResponse) GetParent() AmsPacket {
+ return m._AmsPacket
}
// NewAdsInvalidResponse factory function for _AdsInvalidResponse
-func NewAdsInvalidResponse() *_AdsInvalidResponse {
+func NewAdsInvalidResponse(targetAmsNetId AmsNetId, targetAmsPort uint16, sourceAmsNetId AmsNetId, sourceAmsPort uint16, errorCode uint32, invokeId uint32) *_AdsInvalidResponse {
_result := &_AdsInvalidResponse{
- _AdsData: NewAdsData(),
+ _AmsPacket: NewAmsPacket(targetAmsNetId, targetAmsPort, sourceAmsNetId, sourceAmsPort, errorCode, invokeId),
}
- _result._AdsData._AdsDataChildRequirements = _result
+ _result._AmsPacket._AmsPacketChildRequirements = _result
return _result
}
@@ -107,7 +114,7 @@ func (m *_AdsInvalidResponse) GetLengthInBytes() uint16 {
return m.GetLengthInBits() / 8
}
-func AdsInvalidResponseParse(readBuffer utils.ReadBuffer, commandId CommandId, response bool) (AdsInvalidResponse, error) {
+func AdsInvalidResponseParse(readBuffer utils.ReadBuffer) (AdsInvalidResponse, error) {
positionAware := readBuffer
_ = positionAware
if pullErr := readBuffer.PullContext("AdsInvalidResponse"); pullErr != nil {
@@ -122,9 +129,9 @@ func AdsInvalidResponseParse(readBuffer utils.ReadBuffer, commandId CommandId, r
// Create a partially initialized instance
_child := &_AdsInvalidResponse{
- _AdsData: &_AdsData{},
+ _AmsPacket: &_AmsPacket{},
}
- _child._AdsData._AdsDataChildRequirements = _child
+ _child._AmsPacket._AmsPacketChildRequirements = _child
return _child, nil
}
diff --git a/plc4go/protocols/ads/readwrite/model/AdsReadDeviceInfoRequest.go b/plc4go/protocols/ads/readwrite/model/AdsReadDeviceInfoRequest.go
index f291d4561..1b3c3c9b5 100644
--- a/plc4go/protocols/ads/readwrite/model/AdsReadDeviceInfoRequest.go
+++ b/plc4go/protocols/ads/readwrite/model/AdsReadDeviceInfoRequest.go
@@ -30,7 +30,7 @@ import (
type AdsReadDeviceInfoRequest interface {
utils.LengthAware
utils.Serializable
- AdsData
+ AmsPacket
}
// AdsReadDeviceInfoRequestExactly can be used when we want exactly this type and not a type which fulfills AdsReadDeviceInfoRequest.
@@ -42,7 +42,7 @@ type AdsReadDeviceInfoRequestExactly interface {
// _AdsReadDeviceInfoRequest is the data-structure of this message
type _AdsReadDeviceInfoRequest struct {
- *_AdsData
+ *_AmsPacket
}
///////////////////////////////////////////////////////////
@@ -63,18 +63,25 @@ func (m *_AdsReadDeviceInfoRequest) GetResponse() bool {
///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
-func (m *_AdsReadDeviceInfoRequest) InitializeParent(parent AdsData) {}
+func (m *_AdsReadDeviceInfoRequest) InitializeParent(parent AmsPacket, targetAmsNetId AmsNetId, targetAmsPort uint16, sourceAmsNetId AmsNetId, sourceAmsPort uint16, errorCode uint32, invokeId uint32) {
+ m.TargetAmsNetId = targetAmsNetId
+ m.TargetAmsPort = targetAmsPort
+ m.SourceAmsNetId = sourceAmsNetId
+ m.SourceAmsPort = sourceAmsPort
+ m.ErrorCode = errorCode
+ m.InvokeId = invokeId
+}
-func (m *_AdsReadDeviceInfoRequest) GetParent() AdsData {
- return m._AdsData
+func (m *_AdsReadDeviceInfoRequest) GetParent() AmsPacket {
+ return m._AmsPacket
}
// NewAdsReadDeviceInfoRequest factory function for _AdsReadDeviceInfoRequest
-func NewAdsReadDeviceInfoRequest() *_AdsReadDeviceInfoRequest {
+func NewAdsReadDeviceInfoRequest(targetAmsNetId AmsNetId, targetAmsPort uint16, sourceAmsNetId AmsNetId, sourceAmsPort uint16, errorCode uint32, invokeId uint32) *_AdsReadDeviceInfoRequest {
_result := &_AdsReadDeviceInfoRequest{
- _AdsData: NewAdsData(),
+ _AmsPacket: NewAmsPacket(targetAmsNetId, targetAmsPort, sourceAmsNetId, sourceAmsPort, errorCode, invokeId),
}
- _result._AdsData._AdsDataChildRequirements = _result
+ _result._AmsPacket._AmsPacketChildRequirements = _result
return _result
}
@@ -107,7 +114,7 @@ func (m *_AdsReadDeviceInfoRequest) GetLengthInBytes() uint16 {
return m.GetLengthInBits() / 8
}
-func AdsReadDeviceInfoRequestParse(readBuffer utils.ReadBuffer, commandId CommandId, response bool) (AdsReadDeviceInfoRequest, error) {
+func AdsReadDeviceInfoRequestParse(readBuffer utils.ReadBuffer) (AdsReadDeviceInfoRequest, error) {
positionAware := readBuffer
_ = positionAware
if pullErr := readBuffer.PullContext("AdsReadDeviceInfoRequest"); pullErr != nil {
@@ -122,9 +129,9 @@ func AdsReadDeviceInfoRequestParse(readBuffer utils.ReadBuffer, commandId Comman
// Create a partially initialized instance
_child := &_AdsReadDeviceInfoRequest{
- _AdsData: &_AdsData{},
+ _AmsPacket: &_AmsPacket{},
}
- _child._AdsData._AdsDataChildRequirements = _child
+ _child._AmsPacket._AmsPacketChildRequirements = _child
return _child, nil
}
diff --git a/plc4go/protocols/ads/readwrite/model/AdsReadDeviceInfoResponse.go b/plc4go/protocols/ads/readwrite/model/AdsReadDeviceInfoResponse.go
index 4292d88a2..0f1d91348 100644
--- a/plc4go/protocols/ads/readwrite/model/AdsReadDeviceInfoResponse.go
+++ b/plc4go/protocols/ads/readwrite/model/AdsReadDeviceInfoResponse.go
@@ -30,7 +30,7 @@ import (
type AdsReadDeviceInfoResponse interface {
utils.LengthAware
utils.Serializable
- AdsData
+ AmsPacket
// GetResult returns Result (property field)
GetResult() ReturnCode
// GetMajorVersion returns MajorVersion (property field)
@@ -52,7 +52,7 @@ type AdsReadDeviceInfoResponseExactly interface {
// _AdsReadDeviceInfoResponse is the data-structure of this message
type _AdsReadDeviceInfoResponse struct {
- *_AdsData
+ *_AmsPacket
Result ReturnCode
MajorVersion uint8
MinorVersion uint8
@@ -78,10 +78,17 @@ func (m *_AdsReadDeviceInfoResponse) GetResponse() bool {
///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
-func (m *_AdsReadDeviceInfoResponse) InitializeParent(parent AdsData) {}
+func (m *_AdsReadDeviceInfoResponse) InitializeParent(parent AmsPacket, targetAmsNetId AmsNetId, targetAmsPort uint16, sourceAmsNetId AmsNetId, sourceAmsPort uint16, errorCode uint32, invokeId uint32) {
+ m.TargetAmsNetId = targetAmsNetId
+ m.TargetAmsPort = targetAmsPort
+ m.SourceAmsNetId = sourceAmsNetId
+ m.SourceAmsPort = sourceAmsPort
+ m.ErrorCode = errorCode
+ m.InvokeId = invokeId
+}
-func (m *_AdsReadDeviceInfoResponse) GetParent() AdsData {
- return m._AdsData
+func (m *_AdsReadDeviceInfoResponse) GetParent() AmsPacket {
+ return m._AmsPacket
}
///////////////////////////////////////////////////////////
@@ -115,16 +122,16 @@ func (m *_AdsReadDeviceInfoResponse) GetDevice() []byte {
///////////////////////////////////////////////////////////
// NewAdsReadDeviceInfoResponse factory function for _AdsReadDeviceInfoResponse
-func NewAdsReadDeviceInfoResponse(result ReturnCode, majorVersion uint8, minorVersion uint8, version uint16, device []byte) *_AdsReadDeviceInfoResponse {
+func NewAdsReadDeviceInfoResponse(result ReturnCode, majorVersion uint8, minorVersion uint8, version uint16, device []byte, targetAmsNetId AmsNetId, targetAmsPort uint16, sourceAmsNetId AmsNetId, sourceAmsPort uint16, errorCode uint32, invokeId uint32) *_AdsReadDeviceInfoResponse {
_result := &_AdsReadDeviceInfoResponse{
Result: result,
MajorVersion: majorVersion,
MinorVersion: minorVersion,
Version: version,
Device: device,
- _AdsData: NewAdsData(),
+ _AmsPacket: NewAmsPacket(targetAmsNetId, targetAmsPort, sourceAmsNetId, sourceAmsPort, errorCode, invokeId),
}
- _result._AdsData._AdsDataChildRequirements = _result
+ _result._AmsPacket._AmsPacketChildRequirements = _result
return _result
}
@@ -174,7 +181,7 @@ func (m *_AdsReadDeviceInfoResponse) GetLengthInBytes() uint16 {
return m.GetLengthInBits() / 8
}
-func AdsReadDeviceInfoResponseParse(readBuffer utils.ReadBuffer, commandId CommandId, response bool) (AdsReadDeviceInfoResponse, error) {
+func AdsReadDeviceInfoResponseParse(readBuffer utils.ReadBuffer) (AdsReadDeviceInfoResponse, error) {
positionAware := readBuffer
_ = positionAware
if pullErr := readBuffer.PullContext("AdsReadDeviceInfoResponse"); pullErr != nil {
@@ -229,14 +236,14 @@ func AdsReadDeviceInfoResponseParse(readBuffer utils.ReadBuffer, commandId Comma
// Create a partially initialized instance
_child := &_AdsReadDeviceInfoResponse{
- _AdsData: &_AdsData{},
+ _AmsPacket: &_AmsPacket{},
Result: result,
MajorVersion: majorVersion,
MinorVersion: minorVersion,
Version: version,
Device: device,
}
- _child._AdsData._AdsDataChildRequirements = _child
+ _child._AmsPacket._AmsPacketChildRequirements = _child
return _child, nil
}
diff --git a/plc4go/protocols/ads/readwrite/model/AdsReadRequest.go b/plc4go/protocols/ads/readwrite/model/AdsReadRequest.go
index fefc86bbc..888b3cfd4 100644
--- a/plc4go/protocols/ads/readwrite/model/AdsReadRequest.go
+++ b/plc4go/protocols/ads/readwrite/model/AdsReadRequest.go
@@ -30,7 +30,7 @@ import (
type AdsReadRequest interface {
utils.LengthAware
utils.Serializable
- AdsData
+ AmsPacket
// GetIndexGroup returns IndexGroup (property field)
GetIndexGroup() uint32
// GetIndexOffset returns IndexOffset (property field)
@@ -48,7 +48,7 @@ type AdsReadRequestExactly interface {
// _AdsReadRequest is the data-structure of this message
type _AdsReadRequest struct {
- *_AdsData
+ *_AmsPacket
IndexGroup uint32
IndexOffset uint32
Length uint32
@@ -72,10 +72,17 @@ func (m *_AdsReadRequest) GetResponse() bool {
///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
-func (m *_AdsReadRequest) InitializeParent(parent AdsData) {}
+func (m *_AdsReadRequest) InitializeParent(parent AmsPacket, targetAmsNetId AmsNetId, targetAmsPort uint16, sourceAmsNetId AmsNetId, sourceAmsPort uint16, errorCode uint32, invokeId uint32) {
+ m.TargetAmsNetId = targetAmsNetId
+ m.TargetAmsPort = targetAmsPort
+ m.SourceAmsNetId = sourceAmsNetId
+ m.SourceAmsPort = sourceAmsPort
+ m.ErrorCode = errorCode
+ m.InvokeId = invokeId
+}
-func (m *_AdsReadRequest) GetParent() AdsData {
- return m._AdsData
+func (m *_AdsReadRequest) GetParent() AmsPacket {
+ return m._AmsPacket
}
///////////////////////////////////////////////////////////
@@ -101,14 +108,14 @@ func (m *_AdsReadRequest) GetLength() uint32 {
///////////////////////////////////////////////////////////
// NewAdsReadRequest factory function for _AdsReadRequest
-func NewAdsReadRequest(indexGroup uint32, indexOffset uint32, length uint32) *_AdsReadRequest {
+func NewAdsReadRequest(indexGroup uint32, indexOffset uint32, length uint32, targetAmsNetId AmsNetId, targetAmsPort uint16, sourceAmsNetId AmsNetId, sourceAmsPort uint16, errorCode uint32, invokeId uint32) *_AdsReadRequest {
_result := &_AdsReadRequest{
IndexGroup: indexGroup,
IndexOffset: indexOffset,
Length: length,
- _AdsData: NewAdsData(),
+ _AmsPacket: NewAmsPacket(targetAmsNetId, targetAmsPort, sourceAmsNetId, sourceAmsPort, errorCode, invokeId),
}
- _result._AdsData._AdsDataChildRequirements = _result
+ _result._AmsPacket._AmsPacketChildRequirements = _result
return _result
}
@@ -150,7 +157,7 @@ func (m *_AdsReadRequest) GetLengthInBytes() uint16 {
return m.GetLengthInBits() / 8
}
-func AdsReadRequestParse(readBuffer utils.ReadBuffer, commandId CommandId, response bool) (AdsReadRequest, error) {
+func AdsReadRequestParse(readBuffer utils.ReadBuffer) (AdsReadRequest, error) {
positionAware := readBuffer
_ = positionAware
if pullErr := readBuffer.PullContext("AdsReadRequest"); pullErr != nil {
@@ -186,12 +193,12 @@ func AdsReadRequestParse(readBuffer utils.ReadBuffer, commandId CommandId, respo
// Create a partially initialized instance
_child := &_AdsReadRequest{
- _AdsData: &_AdsData{},
+ _AmsPacket: &_AmsPacket{},
IndexGroup: indexGroup,
IndexOffset: indexOffset,
Length: length,
}
- _child._AdsData._AdsDataChildRequirements = _child
+ _child._AmsPacket._AmsPacketChildRequirements = _child
return _child, nil
}
diff --git a/plc4go/protocols/ads/readwrite/model/AdsReadResponse.go b/plc4go/protocols/ads/readwrite/model/AdsReadResponse.go
index c5e24e551..c59d88de7 100644
--- a/plc4go/protocols/ads/readwrite/model/AdsReadResponse.go
+++ b/plc4go/protocols/ads/readwrite/model/AdsReadResponse.go
@@ -30,7 +30,7 @@ import (
type AdsReadResponse interface {
utils.LengthAware
utils.Serializable
- AdsData
+ AmsPacket
// GetResult returns Result (property field)
GetResult() ReturnCode
// GetData returns Data (property field)
@@ -46,7 +46,7 @@ type AdsReadResponseExactly interface {
// _AdsReadResponse is the data-structure of this message
type _AdsReadResponse struct {
- *_AdsData
+ *_AmsPacket
Result ReturnCode
Data []byte
}
@@ -69,10 +69,17 @@ func (m *_AdsReadResponse) GetResponse() bool {
///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
-func (m *_AdsReadResponse) InitializeParent(parent AdsData) {}
+func (m *_AdsReadResponse) InitializeParent(parent AmsPacket, targetAmsNetId AmsNetId, targetAmsPort uint16, sourceAmsNetId AmsNetId, sourceAmsPort uint16, errorCode uint32, invokeId uint32) {
+ m.TargetAmsNetId = targetAmsNetId
+ m.TargetAmsPort = targetAmsPort
+ m.SourceAmsNetId = sourceAmsNetId
+ m.SourceAmsPort = sourceAmsPort
+ m.ErrorCode = errorCode
+ m.InvokeId = invokeId
+}
-func (m *_AdsReadResponse) GetParent() AdsData {
- return m._AdsData
+func (m *_AdsReadResponse) GetParent() AmsPacket {
+ return m._AmsPacket
}
///////////////////////////////////////////////////////////
@@ -94,13 +101,13 @@ func (m *_AdsReadResponse) GetData() []byte {
///////////////////////////////////////////////////////////
// NewAdsReadResponse factory function for _AdsReadResponse
-func NewAdsReadResponse(result ReturnCode, data []byte) *_AdsReadResponse {
+func NewAdsReadResponse(result ReturnCode, data []byte, targetAmsNetId AmsNetId, targetAmsPort uint16, sourceAmsNetId AmsNetId, sourceAmsPort uint16, errorCode uint32, invokeId uint32) *_AdsReadResponse {
_result := &_AdsReadResponse{
- Result: result,
- Data: data,
- _AdsData: NewAdsData(),
+ Result: result,
+ Data: data,
+ _AmsPacket: NewAmsPacket(targetAmsNetId, targetAmsPort, sourceAmsNetId, sourceAmsPort, errorCode, invokeId),
}
- _result._AdsData._AdsDataChildRequirements = _result
+ _result._AmsPacket._AmsPacketChildRequirements = _result
return _result
}
@@ -144,7 +151,7 @@ func (m *_AdsReadResponse) GetLengthInBytes() uint16 {
return m.GetLengthInBits() / 8
}
-func AdsReadResponseParse(readBuffer utils.ReadBuffer, commandId CommandId, response bool) (AdsReadResponse, error) {
+func AdsReadResponseParse(readBuffer utils.ReadBuffer) (AdsReadResponse, error) {
positionAware := readBuffer
_ = positionAware
if pullErr := readBuffer.PullContext("AdsReadResponse"); pullErr != nil {
@@ -185,11 +192,11 @@ func AdsReadResponseParse(readBuffer utils.ReadBuffer, commandId CommandId, resp
// Create a partially initialized instance
_child := &_AdsReadResponse{
- _AdsData: &_AdsData{},
- Result: result,
- Data: data,
+ _AmsPacket: &_AmsPacket{},
+ Result: result,
+ Data: data,
}
- _child._AdsData._AdsDataChildRequirements = _child
+ _child._AmsPacket._AmsPacketChildRequirements = _child
return _child, nil
}
diff --git a/plc4go/protocols/ads/readwrite/model/AdsReadStateRequest.go b/plc4go/protocols/ads/readwrite/model/AdsReadStateRequest.go
index cddfde4c5..6b1a6b986 100644
--- a/plc4go/protocols/ads/readwrite/model/AdsReadStateRequest.go
+++ b/plc4go/protocols/ads/readwrite/model/AdsReadStateRequest.go
@@ -30,7 +30,7 @@ import (
type AdsReadStateRequest interface {
utils.LengthAware
utils.Serializable
- AdsData
+ AmsPacket
}
// AdsReadStateRequestExactly can be used when we want exactly this type and not a type which fulfills AdsReadStateRequest.
@@ -42,7 +42,7 @@ type AdsReadStateRequestExactly interface {
// _AdsReadStateRequest is the data-structure of this message
type _AdsReadStateRequest struct {
- *_AdsData
+ *_AmsPacket
}
///////////////////////////////////////////////////////////
@@ -63,18 +63,25 @@ func (m *_AdsReadStateRequest) GetResponse() bool {
///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
-func (m *_AdsReadStateRequest) InitializeParent(parent AdsData) {}
+func (m *_AdsReadStateRequest) InitializeParent(parent AmsPacket, targetAmsNetId AmsNetId, targetAmsPort uint16, sourceAmsNetId AmsNetId, sourceAmsPort uint16, errorCode uint32, invokeId uint32) {
+ m.TargetAmsNetId = targetAmsNetId
+ m.TargetAmsPort = targetAmsPort
+ m.SourceAmsNetId = sourceAmsNetId
+ m.SourceAmsPort = sourceAmsPort
+ m.ErrorCode = errorCode
+ m.InvokeId = invokeId
+}
-func (m *_AdsReadStateRequest) GetParent() AdsData {
- return m._AdsData
+func (m *_AdsReadStateRequest) GetParent() AmsPacket {
+ return m._AmsPacket
}
// NewAdsReadStateRequest factory function for _AdsReadStateRequest
-func NewAdsReadStateRequest() *_AdsReadStateRequest {
+func NewAdsReadStateRequest(targetAmsNetId AmsNetId, targetAmsPort uint16, sourceAmsNetId AmsNetId, sourceAmsPort uint16, errorCode uint32, invokeId uint32) *_AdsReadStateRequest {
_result := &_AdsReadStateRequest{
- _AdsData: NewAdsData(),
+ _AmsPacket: NewAmsPacket(targetAmsNetId, targetAmsPort, sourceAmsNetId, sourceAmsPort, errorCode, invokeId),
}
- _result._AdsData._AdsDataChildRequirements = _result
+ _result._AmsPacket._AmsPacketChildRequirements = _result
return _result
}
@@ -107,7 +114,7 @@ func (m *_AdsReadStateRequest) GetLengthInBytes() uint16 {
return m.GetLengthInBits() / 8
}
-func AdsReadStateRequestParse(readBuffer utils.ReadBuffer, commandId CommandId, response bool) (AdsReadStateRequest, error) {
+func AdsReadStateRequestParse(readBuffer utils.ReadBuffer) (AdsReadStateRequest, error) {
positionAware := readBuffer
_ = positionAware
if pullErr := readBuffer.PullContext("AdsReadStateRequest"); pullErr != nil {
@@ -122,9 +129,9 @@ func AdsReadStateRequestParse(readBuffer utils.ReadBuffer, commandId CommandId,
// Create a partially initialized instance
_child := &_AdsReadStateRequest{
- _AdsData: &_AdsData{},
+ _AmsPacket: &_AmsPacket{},
}
- _child._AdsData._AdsDataChildRequirements = _child
+ _child._AmsPacket._AmsPacketChildRequirements = _child
return _child, nil
}
diff --git a/plc4go/protocols/ads/readwrite/model/AdsReadStateResponse.go b/plc4go/protocols/ads/readwrite/model/AdsReadStateResponse.go
index 40dd42d69..581086217 100644
--- a/plc4go/protocols/ads/readwrite/model/AdsReadStateResponse.go
+++ b/plc4go/protocols/ads/readwrite/model/AdsReadStateResponse.go
@@ -30,7 +30,7 @@ import (
type AdsReadStateResponse interface {
utils.LengthAware
utils.Serializable
- AdsData
+ AmsPacket
// GetResult returns Result (property field)
GetResult() ReturnCode
// GetAdsState returns AdsState (property field)
@@ -48,7 +48,7 @@ type AdsReadStateResponseExactly interface {
// _AdsReadStateResponse is the data-structure of this message
type _AdsReadStateResponse struct {
- *_AdsData
+ *_AmsPacket
Result ReturnCode
AdsState uint16
DeviceState uint16
@@ -72,10 +72,17 @@ func (m *_AdsReadStateResponse) GetResponse() bool {
///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
-func (m *_AdsReadStateResponse) InitializeParent(parent AdsData) {}
+func (m *_AdsReadStateResponse) InitializeParent(parent AmsPacket, targetAmsNetId AmsNetId, targetAmsPort uint16, sourceAmsNetId AmsNetId, sourceAmsPort uint16, errorCode uint32, invokeId uint32) {
+ m.TargetAmsNetId = targetAmsNetId
+ m.TargetAmsPort = targetAmsPort
+ m.SourceAmsNetId = sourceAmsNetId
+ m.SourceAmsPort = sourceAmsPort
+ m.ErrorCode = errorCode
+ m.InvokeId = invokeId
+}
-func (m *_AdsReadStateResponse) GetParent() AdsData {
- return m._AdsData
+func (m *_AdsReadStateResponse) GetParent() AmsPacket {
+ return m._AmsPacket
}
///////////////////////////////////////////////////////////
@@ -101,14 +108,14 @@ func (m *_AdsReadStateResponse) GetDeviceState() uint16 {
///////////////////////////////////////////////////////////
// NewAdsReadStateResponse factory function for _AdsReadStateResponse
-func NewAdsReadStateResponse(result ReturnCode, adsState uint16, deviceState uint16) *_AdsReadStateResponse {
+func NewAdsReadStateResponse(result ReturnCode, adsState uint16, deviceState uint16, targetAmsNetId AmsNetId, targetAmsPort uint16, sourceAmsNetId AmsNetId, sourceAmsPort uint16, errorCode uint32, invokeId uint32) *_AdsReadStateResponse {
_result := &_AdsReadStateResponse{
Result: result,
AdsState: adsState,
DeviceState: deviceState,
- _AdsData: NewAdsData(),
+ _AmsPacket: NewAmsPacket(targetAmsNetId, targetAmsPort, sourceAmsNetId, sourceAmsPort, errorCode, invokeId),
}
- _result._AdsData._AdsDataChildRequirements = _result
+ _result._AmsPacket._AmsPacketChildRequirements = _result
return _result
}
@@ -150,7 +157,7 @@ func (m *_AdsReadStateResponse) GetLengthInBytes() uint16 {
return m.GetLengthInBits() / 8
}
-func AdsReadStateResponseParse(readBuffer utils.ReadBuffer, commandId CommandId, response bool) (AdsReadStateResponse, error) {
+func AdsReadStateResponseParse(readBuffer utils.ReadBuffer) (AdsReadStateResponse, error) {
positionAware := readBuffer
_ = positionAware
if pullErr := readBuffer.PullContext("AdsReadStateResponse"); pullErr != nil {
@@ -192,12 +199,12 @@ func AdsReadStateResponseParse(readBuffer utils.ReadBuffer, commandId CommandId,
// Create a partially initialized instance
_child := &_AdsReadStateResponse{
- _AdsData: &_AdsData{},
+ _AmsPacket: &_AmsPacket{},
Result: result,
AdsState: adsState,
DeviceState: deviceState,
}
- _child._AdsData._AdsDataChildRequirements = _child
+ _child._AmsPacket._AmsPacketChildRequirements = _child
return _child, nil
}
diff --git a/plc4go/protocols/ads/readwrite/model/AdsReadWriteRequest.go b/plc4go/protocols/ads/readwrite/model/AdsReadWriteRequest.go
index 94472d582..d3de3c51b 100644
--- a/plc4go/protocols/ads/readwrite/model/AdsReadWriteRequest.go
+++ b/plc4go/protocols/ads/readwrite/model/AdsReadWriteRequest.go
@@ -30,7 +30,7 @@ import (
type AdsReadWriteRequest interface {
utils.LengthAware
utils.Serializable
- AdsData
+ AmsPacket
// GetIndexGroup returns IndexGroup (property field)
GetIndexGroup() uint32
// GetIndexOffset returns IndexOffset (property field)
@@ -52,7 +52,7 @@ type AdsReadWriteRequestExactly interface {
// _AdsReadWriteRequest is the data-structure of this message
type _AdsReadWriteRequest struct {
- *_AdsData
+ *_AmsPacket
IndexGroup uint32
IndexOffset uint32
ReadLength uint32
@@ -78,10 +78,17 @@ func (m *_AdsReadWriteRequest) GetResponse() bool {
///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
-func (m *_AdsReadWriteRequest) InitializeParent(parent AdsData) {}
+func (m *_AdsReadWriteRequest) InitializeParent(parent AmsPacket, targetAmsNetId AmsNetId, targetAmsPort uint16, sourceAmsNetId AmsNetId, sourceAmsPort uint16, errorCode uint32, invokeId uint32) {
+ m.TargetAmsNetId = targetAmsNetId
+ m.TargetAmsPort = targetAmsPort
+ m.SourceAmsNetId = sourceAmsNetId
+ m.SourceAmsPort = sourceAmsPort
+ m.ErrorCode = errorCode
+ m.InvokeId = invokeId
+}
-func (m *_AdsReadWriteRequest) GetParent() AdsData {
- return m._AdsData
+func (m *_AdsReadWriteRequest) GetParent() AmsPacket {
+ return m._AmsPacket
}
///////////////////////////////////////////////////////////
@@ -115,16 +122,16 @@ func (m *_AdsReadWriteRequest) GetData() []byte {
///////////////////////////////////////////////////////////
// NewAdsReadWriteRequest factory function for _AdsReadWriteRequest
-func NewAdsReadWriteRequest(indexGroup uint32, indexOffset uint32, readLength uint32, items []AdsMultiRequestItem, data []byte) *_AdsReadWriteRequest {
+func NewAdsReadWriteRequest(indexGroup uint32, indexOffset uint32, readLength uint32, items []AdsMultiRequestItem, data []byte, targetAmsNetId AmsNetId, targetAmsPort uint16, sourceAmsNetId AmsNetId, sourceAmsPort uint16, errorCode uint32, invokeId uint32) *_AdsReadWriteRequest {
_result := &_AdsReadWriteRequest{
IndexGroup: indexGroup,
IndexOffset: indexOffset,
ReadLength: readLength,
Items: items,
Data: data,
- _AdsData: NewAdsData(),
+ _AmsPacket: NewAmsPacket(targetAmsNetId, targetAmsPort, sourceAmsNetId, sourceAmsPort, errorCode, invokeId),
}
- _result._AdsData._AdsDataChildRequirements = _result
+ _result._AmsPacket._AmsPacketChildRequirements = _result
return _result
}
@@ -182,7 +189,7 @@ func (m *_AdsReadWriteRequest) GetLengthInBytes() uint16 {
return m.GetLengthInBits() / 8
}
-func AdsReadWriteRequestParse(readBuffer utils.ReadBuffer, commandId CommandId, response bool) (AdsReadWriteRequest, error) {
+func AdsReadWriteRequestParse(readBuffer utils.ReadBuffer) (AdsReadWriteRequest, error) {
positionAware := readBuffer
_ = positionAware
if pullErr := readBuffer.PullContext("AdsReadWriteRequest"); pullErr != nil {
@@ -254,14 +261,14 @@ func AdsReadWriteRequestParse(readBuffer utils.ReadBuffer, commandId CommandId,
// Create a partially initialized instance
_child := &_AdsReadWriteRequest{
- _AdsData: &_AdsData{},
+ _AmsPacket: &_AmsPacket{},
IndexGroup: indexGroup,
IndexOffset: indexOffset,
ReadLength: readLength,
Items: items,
Data: data,
}
- _child._AdsData._AdsDataChildRequirements = _child
+ _child._AmsPacket._AmsPacketChildRequirements = _child
return _child, nil
}
diff --git a/plc4go/protocols/ads/readwrite/model/AdsReadWriteResponse.go b/plc4go/protocols/ads/readwrite/model/AdsReadWriteResponse.go
index 3c6d1bf97..7097cf5b0 100644
--- a/plc4go/protocols/ads/readwrite/model/AdsReadWriteResponse.go
+++ b/plc4go/protocols/ads/readwrite/model/AdsReadWriteResponse.go
@@ -30,7 +30,7 @@ import (
type AdsReadWriteResponse interface {
utils.LengthAware
utils.Serializable
- AdsData
+ AmsPacket
// GetResult returns Result (property field)
GetResult() ReturnCode
// GetData returns Data (property field)
@@ -46,7 +46,7 @@ type AdsReadWriteResponseExactly interface {
// _AdsReadWriteResponse is the data-structure of this message
type _AdsReadWriteResponse struct {
- *_AdsData
+ *_AmsPacket
Result ReturnCode
Data []byte
}
@@ -69,10 +69,17 @@ func (m *_AdsReadWriteResponse) GetResponse() bool {
///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
-func (m *_AdsReadWriteResponse) InitializeParent(parent AdsData) {}
+func (m *_AdsReadWriteResponse) InitializeParent(parent AmsPacket, targetAmsNetId AmsNetId, targetAmsPort uint16, sourceAmsNetId AmsNetId, sourceAmsPort uint16, errorCode uint32, invokeId uint32) {
+ m.TargetAmsNetId = targetAmsNetId
+ m.TargetAmsPort = targetAmsPort
+ m.SourceAmsNetId = sourceAmsNetId
+ m.SourceAmsPort = sourceAmsPort
+ m.ErrorCode = errorCode
+ m.InvokeId = invokeId
+}
-func (m *_AdsReadWriteResponse) GetParent() AdsData {
- return m._AdsData
+func (m *_AdsReadWriteResponse) GetParent() AmsPacket {
+ return m._AmsPacket
}
///////////////////////////////////////////////////////////
@@ -94,13 +101,13 @@ func (m *_AdsReadWriteResponse) GetData() []byte {
///////////////////////////////////////////////////////////
// NewAdsReadWriteResponse factory function for _AdsReadWriteResponse
-func NewAdsReadWriteResponse(result ReturnCode, data []byte) *_AdsReadWriteResponse {
+func NewAdsReadWriteResponse(result ReturnCode, data []byte, targetAmsNetId AmsNetId, targetAmsPort uint16, sourceAmsNetId AmsNetId, sourceAmsPort uint16, errorCode uint32, invokeId uint32) *_AdsReadWriteResponse {
_result := &_AdsReadWriteResponse{
- Result: result,
- Data: data,
- _AdsData: NewAdsData(),
+ Result: result,
+ Data: data,
+ _AmsPacket: NewAmsPacket(targetAmsNetId, targetAmsPort, sourceAmsNetId, sourceAmsPort, errorCode, invokeId),
}
- _result._AdsData._AdsDataChildRequirements = _result
+ _result._AmsPacket._AmsPacketChildRequirements = _result
return _result
}
@@ -144,7 +151,7 @@ func (m *_AdsReadWriteResponse) GetLengthInBytes() uint16 {
return m.GetLengthInBits() / 8
}
-func AdsReadWriteResponseParse(readBuffer utils.ReadBuffer, commandId CommandId, response bool) (AdsReadWriteResponse, error) {
+func AdsReadWriteResponseParse(readBuffer utils.ReadBuffer) (AdsReadWriteResponse, error) {
positionAware := readBuffer
_ = positionAware
if pullErr := readBuffer.PullContext("AdsReadWriteResponse"); pullErr != nil {
@@ -185,11 +192,11 @@ func AdsReadWriteResponseParse(readBuffer utils.ReadBuffer, commandId CommandId,
// Create a partially initialized instance
_child := &_AdsReadWriteResponse{
- _AdsData: &_AdsData{},
- Result: result,
- Data: data,
+ _AmsPacket: &_AmsPacket{},
+ Result: result,
+ Data: data,
}
- _child._AdsData._AdsDataChildRequirements = _child
+ _child._AmsPacket._AmsPacketChildRequirements = _child
return _child, nil
}
diff --git a/plc4go/protocols/ads/readwrite/model/AdsSymbolTableEntry.go b/plc4go/protocols/ads/readwrite/model/AdsSymbolTableEntry.go
index fdc007bfd..3e283f1f1 100644
--- a/plc4go/protocols/ads/readwrite/model/AdsSymbolTableEntry.go
+++ b/plc4go/protocols/ads/readwrite/model/AdsSymbolTableEntry.go
@@ -888,7 +888,7 @@ func (m *_AdsSymbolTableEntry) String() string {
if m == nil {
return "<nil>"
}
- writeBuffer := utils.NewBoxedWriteBufferWithOptions(true, true)
+ writeBuffer := utils.NewWriteBufferBoxBasedWithOptions(true, true)
if err := writeBuffer.WriteSerializable(m); err != nil {
return err.Error()
}
diff --git a/plc4go/protocols/ads/readwrite/model/AdsTableSizes.go b/plc4go/protocols/ads/readwrite/model/AdsTableSizes.go
index f90f2100a..9f6df7454 100644
--- a/plc4go/protocols/ads/readwrite/model/AdsTableSizes.go
+++ b/plc4go/protocols/ads/readwrite/model/AdsTableSizes.go
@@ -276,7 +276,7 @@ func (m *_AdsTableSizes) String() string {
if m == nil {
return "<nil>"
}
- writeBuffer := utils.NewBoxedWriteBufferWithOptions(true, true)
+ writeBuffer := utils.NewWriteBufferBoxBasedWithOptions(true, true)
if err := writeBuffer.WriteSerializable(m); err != nil {
return err.Error()
}
diff --git a/plc4go/protocols/ads/readwrite/model/AdsWriteControlRequest.go b/plc4go/protocols/ads/readwrite/model/AdsWriteControlRequest.go
index e05708f81..4b1a47212 100644
--- a/plc4go/protocols/ads/readwrite/model/AdsWriteControlRequest.go
+++ b/plc4go/protocols/ads/readwrite/model/AdsWriteControlRequest.go
@@ -30,7 +30,7 @@ import (
type AdsWriteControlRequest interface {
utils.LengthAware
utils.Serializable
- AdsData
+ AmsPacket
// GetAdsState returns AdsState (property field)
GetAdsState() uint16
// GetDeviceState returns DeviceState (property field)
@@ -48,7 +48,7 @@ type AdsWriteControlRequestExactly interface {
// _AdsWriteControlRequest is the data-structure of this message
type _AdsWriteControlRequest struct {
- *_AdsData
+ *_AmsPacket
AdsState uint16
DeviceState uint16
Data []byte
@@ -72,10 +72,17 @@ func (m *_AdsWriteControlRequest) GetResponse() bool {
///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
-func (m *_AdsWriteControlRequest) InitializeParent(parent AdsData) {}
+func (m *_AdsWriteControlRequest) InitializeParent(parent AmsPacket, targetAmsNetId AmsNetId, targetAmsPort uint16, sourceAmsNetId AmsNetId, sourceAmsPort uint16, errorCode uint32, invokeId uint32) {
+ m.TargetAmsNetId = targetAmsNetId
+ m.TargetAmsPort = targetAmsPort
+ m.SourceAmsNetId = sourceAmsNetId
+ m.SourceAmsPort = sourceAmsPort
+ m.ErrorCode = errorCode
+ m.InvokeId = invokeId
+}
-func (m *_AdsWriteControlRequest) GetParent() AdsData {
- return m._AdsData
+func (m *_AdsWriteControlRequest) GetParent() AmsPacket {
+ return m._AmsPacket
}
///////////////////////////////////////////////////////////
@@ -101,14 +108,14 @@ func (m *_AdsWriteControlRequest) GetData() []byte {
///////////////////////////////////////////////////////////
// NewAdsWriteControlRequest factory function for _AdsWriteControlRequest
-func NewAdsWriteControlRequest(adsState uint16, deviceState uint16, data []byte) *_AdsWriteControlRequest {
+func NewAdsWriteControlRequest(adsState uint16, deviceState uint16, data []byte, targetAmsNetId AmsNetId, targetAmsPort uint16, sourceAmsNetId AmsNetId, sourceAmsPort uint16, errorCode uint32, invokeId uint32) *_AdsWriteControlRequest {
_result := &_AdsWriteControlRequest{
AdsState: adsState,
DeviceState: deviceState,
Data: data,
- _AdsData: NewAdsData(),
+ _AmsPacket: NewAmsPacket(targetAmsNetId, targetAmsPort, sourceAmsNetId, sourceAmsPort, errorCode, invokeId),
}
- _result._AdsData._AdsDataChildRequirements = _result
+ _result._AmsPacket._AmsPacketChildRequirements = _result
return _result
}
@@ -155,7 +162,7 @@ func (m *_AdsWriteControlRequest) GetLengthInBytes() uint16 {
return m.GetLengthInBits() / 8
}
-func AdsWriteControlRequestParse(readBuffer utils.ReadBuffer, commandId CommandId, response bool) (AdsWriteControlRequest, error) {
+func AdsWriteControlRequestParse(readBuffer utils.ReadBuffer) (AdsWriteControlRequest, error) {
positionAware := readBuffer
_ = positionAware
if pullErr := readBuffer.PullContext("AdsWriteControlRequest"); pullErr != nil {
@@ -197,12 +204,12 @@ func AdsWriteControlRequestParse(readBuffer utils.ReadBuffer, commandId CommandI
// Create a partially initialized instance
_child := &_AdsWriteControlRequest{
- _AdsData: &_AdsData{},
+ _AmsPacket: &_AmsPacket{},
AdsState: adsState,
DeviceState: deviceState,
Data: data,
}
- _child._AdsData._AdsDataChildRequirements = _child
+ _child._AmsPacket._AmsPacketChildRequirements = _child
return _child, nil
}
diff --git a/plc4go/protocols/ads/readwrite/model/AdsWriteControlResponse.go b/plc4go/protocols/ads/readwrite/model/AdsWriteControlResponse.go
index 95f055cf4..86a7295d2 100644
--- a/plc4go/protocols/ads/readwrite/model/AdsWriteControlResponse.go
+++ b/plc4go/protocols/ads/readwrite/model/AdsWriteControlResponse.go
@@ -30,7 +30,7 @@ import (
type AdsWriteControlResponse interface {
utils.LengthAware
utils.Serializable
- AdsData
+ AmsPacket
// GetResult returns Result (property field)
GetResult() ReturnCode
}
@@ -44,7 +44,7 @@ type AdsWriteControlResponseExactly interface {
// _AdsWriteControlResponse is the data-structure of this message
type _AdsWriteControlResponse struct {
- *_AdsData
+ *_AmsPacket
Result ReturnCode
}
@@ -66,10 +66,17 @@ func (m *_AdsWriteControlResponse) GetResponse() bool {
///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
-func (m *_AdsWriteControlResponse) InitializeParent(parent AdsData) {}
+func (m *_AdsWriteControlResponse) InitializeParent(parent AmsPacket, targetAmsNetId AmsNetId, targetAmsPort uint16, sourceAmsNetId AmsNetId, sourceAmsPort uint16, errorCode uint32, invokeId uint32) {
+ m.TargetAmsNetId = targetAmsNetId
+ m.TargetAmsPort = targetAmsPort
+ m.SourceAmsNetId = sourceAmsNetId
+ m.SourceAmsPort = sourceAmsPort
+ m.ErrorCode = errorCode
+ m.InvokeId = invokeId
+}
-func (m *_AdsWriteControlResponse) GetParent() AdsData {
- return m._AdsData
+func (m *_AdsWriteControlResponse) GetParent() AmsPacket {
+ return m._AmsPacket
}
///////////////////////////////////////////////////////////
@@ -87,12 +94,12 @@ func (m *_AdsWriteControlResponse) GetResult() ReturnCode {
///////////////////////////////////////////////////////////
// NewAdsWriteControlResponse factory function for _AdsWriteControlResponse
-func NewAdsWriteControlResponse(result ReturnCode) *_AdsWriteControlResponse {
+func NewAdsWriteControlResponse(result ReturnCode, targetAmsNetId AmsNetId, targetAmsPort uint16, sourceAmsNetId AmsNetId, sourceAmsPort uint16, errorCode uint32, invokeId uint32) *_AdsWriteControlResponse {
_result := &_AdsWriteControlResponse{
- Result: result,
- _AdsData: NewAdsData(),
+ Result: result,
+ _AmsPacket: NewAmsPacket(targetAmsNetId, targetAmsPort, sourceAmsNetId, sourceAmsPort, errorCode, invokeId),
}
- _result._AdsData._AdsDataChildRequirements = _result
+ _result._AmsPacket._AmsPacketChildRequirements = _result
return _result
}
@@ -128,7 +135,7 @@ func (m *_AdsWriteControlResponse) GetLengthInBytes() uint16 {
return m.GetLengthInBits() / 8
}
-func AdsWriteControlResponseParse(readBuffer utils.ReadBuffer, commandId CommandId, response bool) (AdsWriteControlResponse, error) {
+func AdsWriteControlResponseParse(readBuffer utils.ReadBuffer) (AdsWriteControlResponse, error) {
positionAware := readBuffer
_ = positionAware
if pullErr := readBuffer.PullContext("AdsWriteControlResponse"); pullErr != nil {
@@ -156,10 +163,10 @@ func AdsWriteControlResponseParse(readBuffer utils.ReadBuffer, commandId Command
// Create a partially initialized instance
_child := &_AdsWriteControlResponse{
- _AdsData: &_AdsData{},
- Result: result,
+ _AmsPacket: &_AmsPacket{},
+ Result: result,
}
- _child._AdsData._AdsDataChildRequirements = _child
+ _child._AmsPacket._AmsPacketChildRequirements = _child
return _child, nil
}
diff --git a/plc4go/protocols/ads/readwrite/model/AdsWriteRequest.go b/plc4go/protocols/ads/readwrite/model/AdsWriteRequest.go
index 4de5e2188..09d9946d6 100644
--- a/plc4go/protocols/ads/readwrite/model/AdsWriteRequest.go
+++ b/plc4go/protocols/ads/readwrite/model/AdsWriteRequest.go
@@ -30,7 +30,7 @@ import (
type AdsWriteRequest interface {
utils.LengthAware
utils.Serializable
- AdsData
+ AmsPacket
// GetIndexGroup returns IndexGroup (property field)
GetIndexGroup() uint32
// GetIndexOffset returns IndexOffset (property field)
@@ -48,7 +48,7 @@ type AdsWriteRequestExactly interface {
// _AdsWriteRequest is the data-structure of this message
type _AdsWriteRequest struct {
- *_AdsData
+ *_AmsPacket
IndexGroup uint32
IndexOffset uint32
Data []byte
@@ -72,10 +72,17 @@ func (m *_AdsWriteRequest) GetResponse() bool {
///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
-func (m *_AdsWriteRequest) InitializeParent(parent AdsData) {}
+func (m *_AdsWriteRequest) InitializeParent(parent AmsPacket, targetAmsNetId AmsNetId, targetAmsPort uint16, sourceAmsNetId AmsNetId, sourceAmsPort uint16, errorCode uint32, invokeId uint32) {
+ m.TargetAmsNetId = targetAmsNetId
+ m.TargetAmsPort = targetAmsPort
+ m.SourceAmsNetId = sourceAmsNetId
+ m.SourceAmsPort = sourceAmsPort
+ m.ErrorCode = errorCode
+ m.InvokeId = invokeId
+}
-func (m *_AdsWriteRequest) GetParent() AdsData {
- return m._AdsData
+func (m *_AdsWriteRequest) GetParent() AmsPacket {
+ return m._AmsPacket
}
///////////////////////////////////////////////////////////
@@ -101,14 +108,14 @@ func (m *_AdsWriteRequest) GetData() []byte {
///////////////////////////////////////////////////////////
// NewAdsWriteRequest factory function for _AdsWriteRequest
-func NewAdsWriteRequest(indexGroup uint32, indexOffset uint32, data []byte) *_AdsWriteRequest {
+func NewAdsWriteRequest(indexGroup uint32, indexOffset uint32, data []byte, targetAmsNetId AmsNetId, targetAmsPort uint16, sourceAmsNetId AmsNetId, sourceAmsPort uint16, errorCode uint32, invokeId uint32) *_AdsWriteRequest {
_result := &_AdsWriteRequest{
IndexGroup: indexGroup,
IndexOffset: indexOffset,
Data: data,
- _AdsData: NewAdsData(),
+ _AmsPacket: NewAmsPacket(targetAmsNetId, targetAmsPort, sourceAmsNetId, sourceAmsPort, errorCode, invokeId),
}
- _result._AdsData._AdsDataChildRequirements = _result
+ _result._AmsPacket._AmsPacketChildRequirements = _result
return _result
}
@@ -155,7 +162,7 @@ func (m *_AdsWriteRequest) GetLengthInBytes() uint16 {
return m.GetLengthInBits() / 8
}
-func AdsWriteRequestParse(readBuffer utils.ReadBuffer, commandId CommandId, response bool) (AdsWriteRequest, error) {
+func AdsWriteRequestParse(readBuffer utils.ReadBuffer) (AdsWriteRequest, error) {
positionAware := readBuffer
_ = positionAware
if pullErr := readBuffer.PullContext("AdsWriteRequest"); pullErr != nil {
@@ -197,12 +204,12 @@ func AdsWriteRequestParse(readBuffer utils.ReadBuffer, commandId CommandId, resp
// Create a partially initialized instance
_child := &_AdsWriteRequest{
- _AdsData: &_AdsData{},
+ _AmsPacket: &_AmsPacket{},
IndexGroup: indexGroup,
IndexOffset: indexOffset,
Data: data,
}
- _child._AdsData._AdsDataChildRequirements = _child
+ _child._AmsPacket._AmsPacketChildRequirements = _child
return _child, nil
}
diff --git a/plc4go/protocols/ads/readwrite/model/AdsWriteResponse.go b/plc4go/protocols/ads/readwrite/model/AdsWriteResponse.go
index 983faafcb..9d06ce1b8 100644
--- a/plc4go/protocols/ads/readwrite/model/AdsWriteResponse.go
+++ b/plc4go/protocols/ads/readwrite/model/AdsWriteResponse.go
@@ -30,7 +30,7 @@ import (
type AdsWriteResponse interface {
utils.LengthAware
utils.Serializable
- AdsData
+ AmsPacket
// GetResult returns Result (property field)
GetResult() ReturnCode
}
@@ -44,7 +44,7 @@ type AdsWriteResponseExactly interface {
// _AdsWriteResponse is the data-structure of this message
type _AdsWriteResponse struct {
- *_AdsData
+ *_AmsPacket
Result ReturnCode
}
@@ -66,10 +66,17 @@ func (m *_AdsWriteResponse) GetResponse() bool {
///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
-func (m *_AdsWriteResponse) InitializeParent(parent AdsData) {}
+func (m *_AdsWriteResponse) InitializeParent(parent AmsPacket, targetAmsNetId AmsNetId, targetAmsPort uint16, sourceAmsNetId AmsNetId, sourceAmsPort uint16, errorCode uint32, invokeId uint32) {
+ m.TargetAmsNetId = targetAmsNetId
+ m.TargetAmsPort = targetAmsPort
+ m.SourceAmsNetId = sourceAmsNetId
+ m.SourceAmsPort = sourceAmsPort
+ m.ErrorCode = errorCode
+ m.InvokeId = invokeId
+}
-func (m *_AdsWriteResponse) GetParent() AdsData {
- return m._AdsData
+func (m *_AdsWriteResponse) GetParent() AmsPacket {
+ return m._AmsPacket
}
///////////////////////////////////////////////////////////
@@ -87,12 +94,12 @@ func (m *_AdsWriteResponse) GetResult() ReturnCode {
///////////////////////////////////////////////////////////
// NewAdsWriteResponse factory function for _AdsWriteResponse
-func NewAdsWriteResponse(result ReturnCode) *_AdsWriteResponse {
+func NewAdsWriteResponse(result ReturnCode, targetAmsNetId AmsNetId, targetAmsPort uint16, sourceAmsNetId AmsNetId, sourceAmsPort uint16, errorCode uint32, invokeId uint32) *_AdsWriteResponse {
_result := &_AdsWriteResponse{
- Result: result,
- _AdsData: NewAdsData(),
+ Result: result,
+ _AmsPacket: NewAmsPacket(targetAmsNetId, targetAmsPort, sourceAmsNetId, sourceAmsPort, errorCode, invokeId),
}
- _result._AdsData._AdsDataChildRequirements = _result
+ _result._AmsPacket._AmsPacketChildRequirements = _result
return _result
}
@@ -128,7 +135,7 @@ func (m *_AdsWriteResponse) GetLengthInBytes() uint16 {
return m.GetLengthInBits() / 8
}
-func AdsWriteResponseParse(readBuffer utils.ReadBuffer, commandId CommandId, response bool) (AdsWriteResponse, error) {
+func AdsWriteResponseParse(readBuffer utils.ReadBuffer) (AdsWriteResponse, error) {
positionAware := readBuffer
_ = positionAware
if pullErr := readBuffer.PullContext("AdsWriteResponse"); pullErr != nil {
@@ -156,10 +163,10 @@ func AdsWriteResponseParse(readBuffer utils.ReadBuffer, commandId CommandId, res
// Create a partially initialized instance
_child := &_AdsWriteResponse{
- _AdsData: &_AdsData{},
- Result: result,
+ _AmsPacket: &_AmsPacket{},
+ Result: result,
}
- _child._AdsData._AdsDataChildRequirements = _child
+ _child._AmsPacket._AmsPacketChildRequirements = _child
return _child, nil
}
diff --git a/plc4go/protocols/ads/readwrite/model/AmsPacket.go b/plc4go/protocols/ads/readwrite/model/AmsPacket.go
index 7c8adbd0c..371900c3d 100644
--- a/plc4go/protocols/ads/readwrite/model/AmsPacket.go
+++ b/plc4go/protocols/ads/readwrite/model/AmsPacket.go
@@ -20,16 +20,32 @@
package model
import (
+ "fmt"
"github.com/apache/plc4x/plc4go/spi/utils"
"github.com/pkg/errors"
+ "github.com/rs/zerolog/log"
)
// Code generated by code-generation. DO NOT EDIT.
+// Constant values.
+const AmsPacket_INITCOMMAND bool = bool(false)
+const AmsPacket_UPDCOMMAND bool = bool(false)
+const AmsPacket_TIMESTAMPADDED bool = bool(false)
+const AmsPacket_HIGHPRIORITYCOMMAND bool = bool(false)
+const AmsPacket_SYSTEMCOMMAND bool = bool(false)
+const AmsPacket_ADSCOMMAND bool = bool(true)
+const AmsPacket_NORETURN bool = bool(false)
+const AmsPacket_BROADCAST bool = bool(false)
+
// AmsPacket is the corresponding interface of AmsPacket
type AmsPacket interface {
utils.LengthAware
utils.Serializable
+ // GetCommandId returns CommandId (discriminator field)
+ GetCommandId() CommandId
+ // GetResponse returns Response (discriminator field)
+ GetResponse() bool
// GetTargetAmsNetId returns TargetAmsNetId (property field)
GetTargetAmsNetId() AmsNetId
// GetTargetAmsPort returns TargetAmsPort (property field)
@@ -38,16 +54,10 @@ type AmsPacket interface {
GetSourceAmsNetId() AmsNetId
// GetSourceAmsPort returns SourceAmsPort (property field)
GetSourceAmsPort() uint16
- // GetCommandId returns CommandId (property field)
- GetCommandId() CommandId
- // GetState returns State (property field)
- GetState() State
// GetErrorCode returns ErrorCode (property field)
GetErrorCode() uint32
// GetInvokeId returns InvokeId (property field)
GetInvokeId() uint32
- // GetData returns Data (property field)
- GetData() AdsData
}
// AmsPacketExactly can be used when we want exactly this type and not a type which fulfills AmsPacket.
@@ -59,15 +69,37 @@ type AmsPacketExactly interface {
// _AmsPacket is the data-structure of this message
type _AmsPacket struct {
+ _AmsPacketChildRequirements
TargetAmsNetId AmsNetId
TargetAmsPort uint16
SourceAmsNetId AmsNetId
SourceAmsPort uint16
- CommandId CommandId
- State State
ErrorCode uint32
InvokeId uint32
- Data AdsData
+ // Reserved Fields
+ reservedField0 *int8
+}
+
+type _AmsPacketChildRequirements interface {
+ utils.Serializable
+ GetLengthInBits() uint16
+ GetLengthInBitsConditional(lastItem bool) uint16
+ GetCommandId() CommandId
+ GetResponse() bool
+}
+
+type AmsPacketParent interface {
+ SerializeParent(writeBuffer utils.WriteBuffer, child AmsPacket, serializeChildFunction func() error) error
+ GetTypeName() string
+}
+
+type AmsPacketChild interface {
+ utils.Serializable
+ InitializeParent(parent AmsPacket, targetAmsNetId AmsNetId, targetAmsPort uint16, sourceAmsNetId AmsNetId, sourceAmsPort uint16, errorCode uint32, invokeId uint32)
+ GetParent() *AmsPacket
+
+ GetTypeName() string
+ AmsPacket
}
///////////////////////////////////////////////////////////
@@ -91,14 +123,6 @@ func (m *_AmsPacket) GetSourceAmsPort() uint16 {
return m.SourceAmsPort
}
-func (m *_AmsPacket) GetCommandId() CommandId {
- return m.CommandId
-}
-
-func (m *_AmsPacket) GetState() State {
- return m.State
-}
-
func (m *_AmsPacket) GetErrorCode() uint32 {
return m.ErrorCode
}
@@ -107,8 +131,45 @@ func (m *_AmsPacket) GetInvokeId() uint32 {
return m.InvokeId
}
-func (m *_AmsPacket) GetData() AdsData {
- return m.Data
+///////////////////////
+///////////////////////
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+/////////////////////// Accessors for const fields.
+///////////////////////
+
+func (m *_AmsPacket) GetInitCommand() bool {
+ return AmsPacket_INITCOMMAND
+}
+
+func (m *_AmsPacket) GetUpdCommand() bool {
+ return AmsPacket_UPDCOMMAND
+}
+
+func (m *_AmsPacket) GetTimestampAdded() bool {
+ return AmsPacket_TIMESTAMPADDED
+}
+
+func (m *_AmsPacket) GetHighPriorityCommand() bool {
+ return AmsPacket_HIGHPRIORITYCOMMAND
+}
+
+func (m *_AmsPacket) GetSystemCommand() bool {
+ return AmsPacket_SYSTEMCOMMAND
+}
+
+func (m *_AmsPacket) GetAdsCommand() bool {
+ return AmsPacket_ADSCOMMAND
+}
+
+func (m *_AmsPacket) GetNoReturn() bool {
+ return AmsPacket_NORETURN
+}
+
+func (m *_AmsPacket) GetBroadcast() bool {
+ return AmsPacket_BROADCAST
}
///////////////////////
@@ -117,8 +178,8 @@ func (m *_AmsPacket) GetData() AdsData {
///////////////////////////////////////////////////////////
// NewAmsPacket factory function for _AmsPacket
-func NewAmsPacket(targetAmsNetId AmsNetId, targetAmsPort uint16, sourceAmsNetId AmsNetId, sourceAmsPort uint16, commandId CommandId, state State, errorCode uint32, invokeId uint32, data AdsData) *_AmsPacket {
- return &_AmsPacket{TargetAmsNetId: targetAmsNetId, TargetAmsPort: targetAmsPort, SourceAmsNetId: sourceAmsNetId, SourceAmsPort: sourceAmsPort, CommandId: commandId, State: state, ErrorCode: errorCode, InvokeId: invokeId, Data: data}
+func NewAmsPacket(targetAmsNetId AmsNetId, targetAmsPort uint16, sourceAmsNetId AmsNetId, sourceAmsPort uint16, errorCode uint32, invokeId uint32) *_AmsPacket {
+ return &_AmsPacket{TargetAmsNetId: targetAmsNetId, TargetAmsPort: targetAmsPort, SourceAmsNetId: sourceAmsNetId, SourceAmsPort: sourceAmsPort, ErrorCode: errorCode, InvokeId: invokeId}
}
// Deprecated: use the interface for direct cast
@@ -136,11 +197,7 @@ func (m *_AmsPacket) GetTypeName() string {
return "AmsPacket"
}
-func (m *_AmsPacket) GetLengthInBits() uint16 {
- return m.GetLengthInBitsConditional(false)
-}
-
-func (m *_AmsPacket) GetLengthInBitsConditional(lastItem bool) uint16 {
+func (m *_AmsPacket) GetParentLengthInBits() uint16 {
lengthInBits := uint16(0)
// Simple field (targetAmsNetId)
@@ -154,12 +211,37 @@ func (m *_AmsPacket) GetLengthInBitsConditional(lastItem bool) uint16 {
// Simple field (sourceAmsPort)
lengthInBits += 16
-
- // Simple field (commandId)
+ // Discriminator Field (commandId)
lengthInBits += 16
- // Simple field (state)
- lengthInBits += m.State.GetLengthInBits()
+ // Const Field (initCommand)
+ lengthInBits += 1
+
+ // Const Field (updCommand)
+ lengthInBits += 1
+
+ // Const Field (timestampAdded)
+ lengthInBits += 1
+
+ // Const Field (highPriorityCommand)
+ lengthInBits += 1
+
+ // Const Field (systemCommand)
+ lengthInBits += 1
+
+ // Const Field (adsCommand)
+ lengthInBits += 1
+
+ // Const Field (noReturn)
+ lengthInBits += 1
+ // Discriminator Field (response)
+ lengthInBits += 1
+
+ // Const Field (broadcast)
+ lengthInBits += 1
+
+ // Reserved Field (reserved)
+ lengthInBits += 7
// Implicit Field (length)
lengthInBits += 32
@@ -170,9 +252,6 @@ func (m *_AmsPacket) GetLengthInBitsConditional(lastItem bool) uint16 {
// Simple field (invokeId)
lengthInBits += 32
- // Simple field (data)
- lengthInBits += m.Data.GetLengthInBits()
-
return lengthInBits
}
@@ -229,30 +308,112 @@ func AmsPacketParse(readBuffer utils.ReadBuffer) (AmsPacket, error) {
}
sourceAmsPort := _sourceAmsPort
- // Simple Field (commandId)
+ // Discriminator Field (commandId) (Used as input to a switch field)
if pullErr := readBuffer.PullContext("commandId"); pullErr != nil {
return nil, errors.Wrap(pullErr, "Error pulling for commandId")
}
- _commandId, _commandIdErr := CommandIdParse(readBuffer)
+ commandId_temp, _commandIdErr := CommandIdParse(readBuffer)
+ var commandId CommandId = commandId_temp
+ if closeErr := readBuffer.CloseContext("commandId"); closeErr != nil {
+ return nil, errors.Wrap(closeErr, "Error closing for commandId")
+ }
if _commandIdErr != nil {
return nil, errors.Wrap(_commandIdErr, "Error parsing 'commandId' field of AmsPacket")
}
- commandId := _commandId
- if closeErr := readBuffer.CloseContext("commandId"); closeErr != nil {
- return nil, errors.Wrap(closeErr, "Error closing for commandId")
+
+ // Const Field (initCommand)
+ initCommand, _initCommandErr := readBuffer.ReadBit("initCommand")
+ if _initCommandErr != nil {
+ return nil, errors.Wrap(_initCommandErr, "Error parsing 'initCommand' field of AmsPacket")
+ }
+ if initCommand != AmsPacket_INITCOMMAND {
+ return nil, errors.New("Expected constant value " + fmt.Sprintf("%d", AmsPacket_INITCOMMAND) + " but got " + fmt.Sprintf("%d", initCommand))
+ }
+
+ // Const Field (updCommand)
+ updCommand, _updCommandErr := readBuffer.ReadBit("updCommand")
+ if _updCommandErr != nil {
+ return nil, errors.Wrap(_updCommandErr, "Error parsing 'updCommand' field of AmsPacket")
+ }
+ if updCommand != AmsPacket_UPDCOMMAND {
+ return nil, errors.New("Expected constant value " + fmt.Sprintf("%d", AmsPacket_UPDCOMMAND) + " but got " + fmt.Sprintf("%d", updCommand))
+ }
+
+ // Const Field (timestampAdded)
+ timestampAdded, _timestampAddedErr := readBuffer.ReadBit("timestampAdded")
+ if _timestampAddedErr != nil {
+ return nil, errors.Wrap(_timestampAddedErr, "Error parsing 'timestampAdded' field of AmsPacket")
+ }
+ if timestampAdded != AmsPacket_TIMESTAMPADDED {
+ return nil, errors.New("Expected constant value " + fmt.Sprintf("%d", AmsPacket_TIMESTAMPADDED) + " but got " + fmt.Sprintf("%d", timestampAdded))
}
- // Simple Field (state)
- if pullErr := readBuffer.PullContext("state"); pullErr != nil {
- return nil, errors.Wrap(pullErr, "Error pulling for state")
+ // Const Field (highPriorityCommand)
+ highPriorityCommand, _highPriorityCommandErr := readBuffer.ReadBit("highPriorityCommand")
+ if _highPriorityCommandErr != nil {
+ return nil, errors.Wrap(_highPriorityCommandErr, "Error parsing 'highPriorityCommand' field of AmsPacket")
}
- _state, _stateErr := StateParse(readBuffer)
- if _stateErr != nil {
- return nil, errors.Wrap(_stateErr, "Error parsing 'state' field of AmsPacket")
+ if highPriorityCommand != AmsPacket_HIGHPRIORITYCOMMAND {
+ return nil, errors.New("Expected constant value " + fmt.Sprintf("%d", AmsPacket_HIGHPRIORITYCOMMAND) + " but got " + fmt.Sprintf("%d", highPriorityCommand))
+ }
+
+ // Const Field (systemCommand)
+ systemCommand, _systemCommandErr := readBuffer.ReadBit("systemCommand")
+ if _systemCommandErr != nil {
+ return nil, errors.Wrap(_systemCommandErr, "Error parsing 'systemCommand' field of AmsPacket")
+ }
+ if systemCommand != AmsPacket_SYSTEMCOMMAND {
+ return nil, errors.New("Expected constant value " + fmt.Sprintf("%d", AmsPacket_SYSTEMCOMMAND) + " but got " + fmt.Sprintf("%d", systemCommand))
+ }
+
+ // Const Field (adsCommand)
+ adsCommand, _adsCommandErr := readBuffer.ReadBit("adsCommand")
+ if _adsCommandErr != nil {
+ return nil, errors.Wrap(_adsCommandErr, "Error parsing 'adsCommand' field of AmsPacket")
+ }
+ if adsCommand != AmsPacket_ADSCOMMAND {
+ return nil, errors.New("Expected constant value " + fmt.Sprintf("%d", AmsPacket_ADSCOMMAND) + " but got " + fmt.Sprintf("%d", adsCommand))
+ }
+
+ // Const Field (noReturn)
+ noReturn, _noReturnErr := readBuffer.ReadBit("noReturn")
+ if _noReturnErr != nil {
+ return nil, errors.Wrap(_noReturnErr, "Error parsing 'noReturn' field of AmsPacket")
+ }
+ if noReturn != AmsPacket_NORETURN {
+ return nil, errors.New("Expected constant value " + fmt.Sprintf("%d", AmsPacket_NORETURN) + " but got " + fmt.Sprintf("%d", noReturn))
+ }
+
+ // Discriminator Field (response) (Used as input to a switch field)
+ response, _responseErr := readBuffer.ReadBit("response")
+ if _responseErr != nil {
+ return nil, errors.Wrap(_responseErr, "Error parsing 'response' field of AmsPacket")
+ }
+
+ // Const Field (broadcast)
+ broadcast, _broadcastErr := readBuffer.ReadBit("broadcast")
+ if _broadcastErr != nil {
+ return nil, errors.Wrap(_broadcastErr, "Error parsing 'broadcast' field of AmsPacket")
}
- state := _state.(State)
- if closeErr := readBuffer.CloseContext("state"); closeErr != nil {
- return nil, errors.Wrap(closeErr, "Error closing for state")
+ if broadcast != AmsPacket_BROADCAST {
+ return nil, errors.New("Expected constant value " + fmt.Sprintf("%d", AmsPacket_BROADCAST) + " but got " + fmt.Sprintf("%d", broadcast))
+ }
+
+ var reservedField0 *int8
+ // Reserved Field (Compartmentalized so the "reserved" variable can't leak)
+ {
+ reserved, _err := readBuffer.ReadInt8("reserved", 7)
+ if _err != nil {
+ return nil, errors.Wrap(_err, "Error parsing 'reserved' field of AmsPacket")
+ }
+ if reserved != int8(0x0) {
+ log.Info().Fields(map[string]interface{}{
+ "expected value": int8(0x0),
+ "got value": reserved,
+ }).Msg("Got unexpected response for reserved field.")
+ // We save the value, so it can be re-serialized
+ reservedField0 = &reserved
+ }
}
// Implicit Field (length) (Used for parsing, but its value is not stored as it's implicitly given by the objects content)
@@ -276,38 +437,78 @@ func AmsPacketParse(readBuffer utils.ReadBuffer) (AmsPacket, error) {
}
invokeId := _invokeId
- // Simple Field (data)
- if pullErr := readBuffer.PullContext("data"); pullErr != nil {
- return nil, errors.Wrap(pullErr, "Error pulling for data")
- }
- _data, _dataErr := AdsDataParse(readBuffer, CommandId(commandId), bool(state.GetResponse()))
- if _dataErr != nil {
- return nil, errors.Wrap(_dataErr, "Error parsing 'data' field of AmsPacket")
- }
- data := _data.(AdsData)
- if closeErr := readBuffer.CloseContext("data"); closeErr != nil {
- return nil, errors.Wrap(closeErr, "Error closing for data")
- }
+ // Switch Field (Depending on the discriminator values, passes the instantiation to a sub-type)
+ type AmsPacketChildSerializeRequirement interface {
+ AmsPacket
+ InitializeParent(AmsPacket, AmsNetId, uint16, AmsNetId, uint16, uint32, uint32)
+ GetParent() AmsPacket
+ }
+ var _childTemp interface{}
+ var _child AmsPacketChildSerializeRequirement
+ var typeSwitchError error
+ switch {
+ case commandId == CommandId_INVALID && response == bool(false): // AdsInvalidRequest
+ _childTemp, typeSwitchError = AdsInvalidRequestParse(readBuffer)
+ case commandId == CommandId_INVALID && response == bool(true): // AdsInvalidResponse
+ _childTemp, typeSwitchError = AdsInvalidResponseParse(readBuffer)
+ case commandId == CommandId_ADS_READ_DEVICE_INFO && response == bool(false): // AdsReadDeviceInfoRequest
+ _childTemp, typeSwitchError = AdsReadDeviceInfoRequestParse(readBuffer)
+ case commandId == CommandId_ADS_READ_DEVICE_INFO && response == bool(true): // AdsReadDeviceInfoResponse
+ _childTemp, typeSwitchError = AdsReadDeviceInfoResponseParse(readBuffer)
+ case commandId == CommandId_ADS_READ && response == bool(false): // AdsReadRequest
+ _childTemp, typeSwitchError = AdsReadRequestParse(readBuffer)
+ case commandId == CommandId_ADS_READ && response == bool(true): // AdsReadResponse
+ _childTemp, typeSwitchError = AdsReadResponseParse(readBuffer)
+ case commandId == CommandId_ADS_WRITE && response == bool(false): // AdsWriteRequest
+ _childTemp, typeSwitchError = AdsWriteRequestParse(readBuffer)
+ case commandId == CommandId_ADS_WRITE && response == bool(true): // AdsWriteResponse
+ _childTemp, typeSwitchError = AdsWriteResponseParse(readBuffer)
+ case commandId == CommandId_ADS_READ_STATE && response == bool(false): // AdsReadStateRequest
+ _childTemp, typeSwitchError = AdsReadStateRequestParse(readBuffer)
+ case commandId == CommandId_ADS_READ_STATE && response == bool(true): // AdsReadStateResponse
+ _childTemp, typeSwitchError = AdsReadStateResponseParse(readBuffer)
+ case commandId == CommandId_ADS_WRITE_CONTROL && response == bool(false): // AdsWriteControlRequest
+ _childTemp, typeSwitchError = AdsWriteControlRequestParse(readBuffer)
+ case commandId == CommandId_ADS_WRITE_CONTROL && response == bool(true): // AdsWriteControlResponse
+ _childTemp, typeSwitchError = AdsWriteControlResponseParse(readBuffer)
+ case commandId == CommandId_ADS_ADD_DEVICE_NOTIFICATION && response == bool(false): // AdsAddDeviceNotificationRequest
+ _childTemp, typeSwitchError = AdsAddDeviceNotificationRequestParse(readBuffer)
+ case commandId == CommandId_ADS_ADD_DEVICE_NOTIFICATION && response == bool(true): // AdsAddDeviceNotificationResponse
+ _childTemp, typeSwitchError = AdsAddDeviceNotificationResponseParse(readBuffer)
+ case commandId == CommandId_ADS_DELETE_DEVICE_NOTIFICATION && response == bool(false): // AdsDeleteDeviceNotificationRequest
+ _childTemp, typeSwitchError = AdsDeleteDeviceNotificationRequestParse(readBuffer)
+ case commandId == CommandId_ADS_DELETE_DEVICE_NOTIFICATION && response == bool(true): // AdsDeleteDeviceNotificationResponse
+ _childTemp, typeSwitchError = AdsDeleteDeviceNotificationResponseParse(readBuffer)
+ case commandId == CommandId_ADS_DEVICE_NOTIFICATION && response == bool(false): // AdsDeviceNotificationRequest
+ _childTemp, typeSwitchError = AdsDeviceNotificationRequestParse(readBuffer)
+ case commandId == CommandId_ADS_DEVICE_NOTIFICATION && response == bool(true): // AdsDeviceNotificationResponse
+ _childTemp, typeSwitchError = AdsDeviceNotificationResponseParse(readBuffer)
+ case commandId == CommandId_ADS_READ_WRITE && response == bool(false): // AdsReadWriteRequest
+ _childTemp, typeSwitchError = AdsReadWriteRequestParse(readBuffer)
+ case commandId == CommandId_ADS_READ_WRITE && response == bool(true): // AdsReadWriteResponse
+ _childTemp, typeSwitchError = AdsReadWriteResponseParse(readBuffer)
+ default:
+ typeSwitchError = errors.Errorf("Unmapped type for parameters [commandId=%v, response=%v]", commandId, response)
+ }
+ if typeSwitchError != nil {
+ return nil, errors.Wrap(typeSwitchError, "Error parsing sub-type for type-switch of AmsPacket")
+ }
+ _child = _childTemp.(AmsPacketChildSerializeRequirement)
if closeErr := readBuffer.CloseContext("AmsPacket"); closeErr != nil {
return nil, errors.Wrap(closeErr, "Error closing for AmsPacket")
}
- // Create the instance
- return &_AmsPacket{
- TargetAmsNetId: targetAmsNetId,
- TargetAmsPort: targetAmsPort,
- SourceAmsNetId: sourceAmsNetId,
- SourceAmsPort: sourceAmsPort,
- CommandId: commandId,
- State: state,
- ErrorCode: errorCode,
- InvokeId: invokeId,
- Data: data,
- }, nil
+ // Finish initializing
+ _child.InitializeParent(_child, targetAmsNetId, targetAmsPort, sourceAmsNetId, sourceAmsPort, errorCode, invokeId)
+ _child.GetParent().(*_AmsPacket).reservedField0 = reservedField0
+ return _child, nil
}
-func (m *_AmsPacket) Serialize(writeBuffer utils.WriteBuffer) error {
+func (pm *_AmsPacket) SerializeParent(writeBuffer utils.WriteBuffer, child AmsPacket, serializeChildFunction func() error) error {
+ // We redirect all calls through client as some methods are only implemented there
+ m := child
+ _ = m
positionAware := writeBuffer
_ = positionAware
if pushErr := writeBuffer.PushContext("AmsPacket"); pushErr != nil {
@@ -352,32 +553,94 @@ func (m *_AmsPacket) Serialize(writeBuffer utils.WriteBuffer) error {
return errors.Wrap(_sourceAmsPortErr, "Error serializing 'sourceAmsPort' field")
}
- // Simple Field (commandId)
+ // Discriminator Field (commandId) (Used as input to a switch field)
+ commandId := CommandId(child.GetCommandId())
if pushErr := writeBuffer.PushContext("commandId"); pushErr != nil {
return errors.Wrap(pushErr, "Error pushing for commandId")
}
- _commandIdErr := writeBuffer.WriteSerializable(m.GetCommandId())
+ _commandIdErr := writeBuffer.WriteSerializable(commandId)
if popErr := writeBuffer.PopContext("commandId"); popErr != nil {
return errors.Wrap(popErr, "Error popping for commandId")
}
+
if _commandIdErr != nil {
return errors.Wrap(_commandIdErr, "Error serializing 'commandId' field")
}
- // Simple Field (state)
- if pushErr := writeBuffer.PushContext("state"); pushErr != nil {
- return errors.Wrap(pushErr, "Error pushing for state")
+ // Const Field (initCommand)
+ _initCommandErr := writeBuffer.WriteBit("initCommand", false)
+ if _initCommandErr != nil {
+ return errors.Wrap(_initCommandErr, "Error serializing 'initCommand' field")
}
- _stateErr := writeBuffer.WriteSerializable(m.GetState())
- if popErr := writeBuffer.PopContext("state"); popErr != nil {
- return errors.Wrap(popErr, "Error popping for state")
+
+ // Const Field (updCommand)
+ _updCommandErr := writeBuffer.WriteBit("updCommand", false)
+ if _updCommandErr != nil {
+ return errors.Wrap(_updCommandErr, "Error serializing 'updCommand' field")
}
- if _stateErr != nil {
- return errors.Wrap(_stateErr, "Error serializing 'state' field")
+
+ // Const Field (timestampAdded)
+ _timestampAddedErr := writeBuffer.WriteBit("timestampAdded", false)
+ if _timestampAddedErr != nil {
+ return errors.Wrap(_timestampAddedErr, "Error serializing 'timestampAdded' field")
+ }
+
+ // Const Field (highPriorityCommand)
+ _highPriorityCommandErr := writeBuffer.WriteBit("highPriorityCommand", false)
+ if _highPriorityCommandErr != nil {
+ return errors.Wrap(_highPriorityCommandErr, "Error serializing 'highPriorityCommand' field")
+ }
+
+ // Const Field (systemCommand)
+ _systemCommandErr := writeBuffer.WriteBit("systemCommand", false)
+ if _systemCommandErr != nil {
+ return errors.Wrap(_systemCommandErr, "Error serializing 'systemCommand' field")
+ }
+
+ // Const Field (adsCommand)
+ _adsCommandErr := writeBuffer.WriteBit("adsCommand", true)
+ if _adsCommandErr != nil {
+ return errors.Wrap(_adsCommandErr, "Error serializing 'adsCommand' field")
+ }
+
+ // Const Field (noReturn)
+ _noReturnErr := writeBuffer.WriteBit("noReturn", false)
+ if _noReturnErr != nil {
+ return errors.Wrap(_noReturnErr, "Error serializing 'noReturn' field")
+ }
+
+ // Discriminator Field (response) (Used as input to a switch field)
+ response := bool(child.GetResponse())
+ _responseErr := writeBuffer.WriteBit("response", (response))
+
+ if _responseErr != nil {
+ return errors.Wrap(_responseErr, "Error serializing 'response' field")
+ }
+
+ // Const Field (broadcast)
+ _broadcastErr := writeBuffer.WriteBit("broadcast", false)
+ if _broadcastErr != nil {
+ return errors.Wrap(_broadcastErr, "Error serializing 'broadcast' field")
+ }
+
+ // Reserved Field (reserved)
+ {
+ var reserved int8 = int8(0x0)
+ if pm.reservedField0 != nil {
+ log.Info().Fields(map[string]interface{}{
+ "expected value": int8(0x0),
+ "got value": reserved,
+ }).Msg("Overriding reserved field with unexpected value.")
+ reserved = *pm.reservedField0
+ }
+ _err := writeBuffer.WriteInt8("reserved", 7, reserved)
+ if _err != nil {
+ return errors.Wrap(_err, "Error serializing 'reserved' field")
+ }
}
// Implicit Field (length) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content)
- length := uint32(m.GetData().GetLengthInBytes())
+ length := uint32(uint32(uint32(m.GetLengthInBytes())) - uint32(uint32(32)))
_lengthErr := writeBuffer.WriteUint32("length", 32, (length))
if _lengthErr != nil {
return errors.Wrap(_lengthErr, "Error serializing 'length' field")
@@ -397,16 +660,9 @@ func (m *_AmsPacket) Serialize(writeBuffer utils.WriteBuffer) error {
return errors.Wrap(_invokeIdErr, "Error serializing 'invokeId' field")
}
- // Simple Field (data)
- if pushErr := writeBuffer.PushContext("data"); pushErr != nil {
- return errors.Wrap(pushErr, "Error pushing for data")
- }
- _dataErr := writeBuffer.WriteSerializable(m.GetData())
- if popErr := writeBuffer.PopContext("data"); popErr != nil {
- return errors.Wrap(popErr, "Error popping for data")
- }
- if _dataErr != nil {
- return errors.Wrap(_dataErr, "Error serializing 'data' field")
+ // Switch field (Depending on the discriminator values, passes the serialization to a sub-type)
+ if _typeSwitchErr := serializeChildFunction(); _typeSwitchErr != nil {
+ return errors.Wrap(_typeSwitchErr, "Error serializing sub-type field")
}
if popErr := writeBuffer.PopContext("AmsPacket"); popErr != nil {
diff --git a/plc4j/api/pom.xml b/plc4j/api/pom.xml
index 4709f8db1..62ee5d48b 100644
--- a/plc4j/api/pom.xml
+++ b/plc4j/api/pom.xml
@@ -31,22 +31,6 @@
<name>PLC4J: API</name>
<description>Central API Module.</description>
- <dependencies>
- <dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-lang3</artifactId>
- </dependency>
- <dependency>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-annotations</artifactId>
- </dependency>
- <dependency>
- <groupId>nl.jqno.equalsverifier</groupId>
- <artifactId>equalsverifier</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
<build>
<plugins>
<plugin>
@@ -64,4 +48,22 @@
</plugins>
</build>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-lang3</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-annotations</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>nl.jqno.equalsverifier</groupId>
+ <artifactId>equalsverifier</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+
+ </dependencies>
+
</project>
\ No newline at end of file
diff --git a/plc4j/api/src/main/java/org/apache/plc4x/java/api/types/PlcClientDatatype.java b/plc4j/api/src/main/java/org/apache/plc4x/java/api/types/PlcClientDatatype.java
deleted file mode 100644
index 4fa730531..000000000
--- a/plc4j/api/src/main/java/org/apache/plc4x/java/api/types/PlcClientDatatype.java
+++ /dev/null
@@ -1,35 +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.
- */
-package org.apache.plc4x.java.api.types;
-
-public enum PlcClientDatatype {
-
- BOOLEAN,
- BYTE,
- SHORT,
- INTEGER,
- LONG,
- FLOAT,
- DOUBLE,
- STRING,
- TIME,
- DATE,
- DATE_TIME
-
-}
diff --git a/plc4j/api/src/test/java/org/apache/plc4x/java/api/types/PlcClientDatatypeTest.java b/plc4j/api/src/test/java/org/apache/plc4x/java/api/types/PlcClientDatatypeTest.java
deleted file mode 100644
index bd4597a8b..000000000
--- a/plc4j/api/src/test/java/org/apache/plc4x/java/api/types/PlcClientDatatypeTest.java
+++ /dev/null
@@ -1,43 +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.
- */
-package org.apache.plc4x.java.api.types;
-
-import org.junit.jupiter.api.Test;
-
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.core.IsNull.notNullValue;
-
-class PlcClientDatatypeTest {
-
- @Test
- public void testConstants() {
- assertThat(PlcClientDatatype.BOOLEAN, notNullValue());
- assertThat(PlcClientDatatype.BYTE, notNullValue());
- assertThat(PlcClientDatatype.SHORT, notNullValue());
- assertThat(PlcClientDatatype.INTEGER, notNullValue());
- assertThat(PlcClientDatatype.LONG, notNullValue());
- assertThat(PlcClientDatatype.FLOAT, notNullValue());
- assertThat(PlcClientDatatype.DOUBLE, notNullValue());
- assertThat(PlcClientDatatype.STRING, notNullValue());
- assertThat(PlcClientDatatype.TIME, notNullValue());
- assertThat(PlcClientDatatype.DATE, notNullValue());
- assertThat(PlcClientDatatype.DATE_TIME, notNullValue());
- }
-
-}
\ No newline at end of file
diff --git a/plc4j/drivers/ads/src/main/java/org/apache/plc4x/java/ads/protocol/AdsProtocolLogic.java b/plc4j/drivers/ads/src/main/java/org/apache/plc4x/java/ads/protocol/AdsProtocolLogic.java
index a71bab324..36d8f3507 100644
--- a/plc4j/drivers/ads/src/main/java/org/apache/plc4x/java/ads/protocol/AdsProtocolLogic.java
+++ b/plc4j/drivers/ads/src/main/java/org/apache/plc4x/java/ads/protocol/AdsProtocolLogic.java
@@ -61,8 +61,6 @@ public class AdsProtocolLogic extends Plc4xProtocolBase<AmsTCPPacket> implements
private static final Logger LOGGER = LoggerFactory.getLogger(AdsProtocolLogic.class);
private AdsConfiguration configuration;
- public static final State DEFAULT_COMMAND_STATE = new State(
- false, false, false, false, false, true, false, false, false);
private final AtomicLong invokeIdGenerator = new AtomicLong(1);
private final RequestTransactionManager tm;
@@ -107,10 +105,9 @@ public class AdsProtocolLogic extends Plc4xProtocolBase<AmsTCPPacket> implements
List<AdsDataTypeTableEntry> dataTypes = new ArrayList<>();
List<AdsSymbolTableEntry> symbols = new ArrayList<>();
// Initialize the request.
- AdsData adsData = new AdsReadRequest(ReservedIndexGroups.ADSIGRP_SYMBOL_AND_DATA_TYPE_SIZES.getValue(), 0x00000000, 24);
- AmsPacket amsPacket = new AmsPacket(configuration.getTargetAmsNetId(), configuration.getTargetAmsPort(),
- configuration.getSourceAmsNetId(), configuration.getSourceAmsPort(),
- CommandId.ADS_READ, DEFAULT_COMMAND_STATE, 0, getInvokeId(), adsData);
+ AmsPacket amsPacket = new AdsReadRequest(configuration.getTargetAmsNetId(), configuration.getTargetAmsPort(),
+ configuration.getSourceAmsNetId(), configuration.getSourceAmsPort(), 0, getInvokeId(),
+ ReservedIndexGroups.ADSIGRP_SYMBOL_AND_DATA_TYPE_SIZES.getValue(), 0x00000000, 24);
AmsTCPPacket amsTCPPacket = new AmsTCPPacket(amsPacket);
// Start a new request-transaction (Is ended in the response-handler)
RequestTransactionManager.RequestTransaction transaction = tm.startRequest();
@@ -119,7 +116,7 @@ public class AdsProtocolLogic extends Plc4xProtocolBase<AmsTCPPacket> implements
.onTimeout(future::completeExceptionally)
.onError((p, e) -> future.completeExceptionally(e))
.check(responseAmsPacket -> responseAmsPacket.getUserdata().getInvokeId() == amsPacket.getInvokeId())
- .unwrap(response -> (AdsReadResponse) response.getUserdata().getData())
+ .unwrap(response -> (AdsReadResponse) response.getUserdata())
.handle(responseAdsData -> {
transaction.endRequest();
if (responseAdsData.getResult() == ReturnCode.OK) {
@@ -129,10 +126,9 @@ public class AdsProtocolLogic extends Plc4xProtocolBase<AmsTCPPacket> implements
LOGGER.debug("PLC contains {} symbols and {} data-types", adsTableSizes.getSymbolCount(), adsTableSizes.getDataTypeCount());
// Now we load the datatype definitions.
- AdsData adsReadTypeTableData = new AdsReadRequest(ReservedIndexGroups.ADSIGRP_DATA_TYPE_TABLE_UPLOAD.getValue(), 0x00000000, adsTableSizes.getDataTypeLength());
- AmsPacket amsReadTablePacket = new AmsPacket(configuration.getTargetAmsNetId(), configuration.getTargetAmsPort(),
- configuration.getSourceAmsNetId(), configuration.getSourceAmsPort(),
- CommandId.ADS_READ, DEFAULT_COMMAND_STATE, 0, getInvokeId(), adsReadTypeTableData);
+ AmsPacket amsReadTablePacket = new AdsReadRequest(configuration.getTargetAmsNetId(), configuration.getTargetAmsPort(),
+ configuration.getSourceAmsNetId(), configuration.getSourceAmsPort(), 0, getInvokeId(),
+ ReservedIndexGroups.ADSIGRP_DATA_TYPE_TABLE_UPLOAD.getValue(), 0x00000000, adsTableSizes.getDataTypeLength());
RequestTransactionManager.RequestTransaction transaction2 = tm.startRequest();
AmsTCPPacket amsReadTableTCPPacket = new AmsTCPPacket(amsReadTablePacket);
transaction2.submit(() -> context.sendRequest(amsReadTableTCPPacket)
@@ -140,7 +136,7 @@ public class AdsProtocolLogic extends Plc4xProtocolBase<AmsTCPPacket> implements
.onTimeout(future::completeExceptionally)
.onError((p, e) -> future.completeExceptionally(e))
.check(responseAmsPacket -> responseAmsPacket.getUserdata().getInvokeId() == amsReadTablePacket.getInvokeId())
- .unwrap(response -> (AdsReadResponse) response.getUserdata().getData())
+ .unwrap(response -> (AdsReadResponse) response.getUserdata())
.handle(responseAdsReadTableData -> {
transaction2.endRequest();
if (responseAdsData.getResult() == ReturnCode.OK) {
@@ -155,10 +151,9 @@ public class AdsProtocolLogic extends Plc4xProtocolBase<AmsTCPPacket> implements
}
}
- AdsData adsReadSymbolTableData = new AdsReadRequest(ReservedIndexGroups.ADSIGRP_SYM_UPLOAD.getValue(), 0x00000000, adsTableSizes.getSymbolLength());
- AmsPacket amsReadSymbolTablePacket = new AmsPacket(configuration.getTargetAmsNetId(), configuration.getTargetAmsPort(),
- configuration.getSourceAmsNetId(), configuration.getSourceAmsPort(),
- CommandId.ADS_READ, DEFAULT_COMMAND_STATE, 0, getInvokeId(), adsReadSymbolTableData);
+ AmsPacket amsReadSymbolTablePacket = new AdsReadRequest(configuration.getTargetAmsNetId(), configuration.getTargetAmsPort(),
+ configuration.getSourceAmsNetId(), configuration.getSourceAmsPort(), 0, getInvokeId(),
+ ReservedIndexGroups.ADSIGRP_SYM_UPLOAD.getValue(), 0x00000000, adsTableSizes.getSymbolLength());
RequestTransactionManager.RequestTransaction transaction3 = tm.startRequest();
AmsTCPPacket amsReadSymbolTableTCPPacket = new AmsTCPPacket(amsReadSymbolTablePacket);
transaction3.submit(() -> context.sendRequest(amsReadSymbolTableTCPPacket)
@@ -166,7 +161,7 @@ public class AdsProtocolLogic extends Plc4xProtocolBase<AmsTCPPacket> implements
.onTimeout(future::completeExceptionally)
.onError((p, e) -> future.completeExceptionally(e))
.check(responseAmsPacket -> responseAmsPacket.getUserdata().getInvokeId() == amsReadSymbolTablePacket.getInvokeId())
- .unwrap(response -> (AdsReadResponse) response.getUserdata().getData())
+ .unwrap(response -> (AdsReadResponse) response.getUserdata())
.handle(responseAdsReadSymbolTableData -> {
transaction3.endRequest();
if (responseAdsData.getResult() == ReturnCode.OK) {
@@ -326,11 +321,9 @@ public class AdsProtocolLogic extends Plc4xProtocolBase<AmsTCPPacket> implements
} else {
size = directAdsField.getAdsDataType().getNumBytes();
}
- AdsData adsData = new AdsReadRequest(directAdsField.getIndexGroup(), directAdsField.getIndexOffset(),
- size * directAdsField.getNumberOfElements());
- AmsPacket amsPacket = new AmsPacket(configuration.getTargetAmsNetId(), configuration.getTargetAmsPort(),
- configuration.getSourceAmsNetId(), configuration.getSourceAmsPort(),
- CommandId.ADS_READ, DEFAULT_COMMAND_STATE, 0, getInvokeId(), adsData);
+ AmsPacket amsPacket = new AdsReadRequest(configuration.getTargetAmsNetId(), configuration.getTargetAmsPort(),
+ configuration.getSourceAmsNetId(), configuration.getSourceAmsPort(), 0, getInvokeId(),
+ directAdsField.getIndexGroup(), directAdsField.getIndexOffset(),size * directAdsField.getNumberOfElements());
AmsTCPPacket amsTCPPacket = new AmsTCPPacket(amsPacket);
// Start a new request-transaction (Is ended in the response-handler)
@@ -340,15 +333,15 @@ public class AdsProtocolLogic extends Plc4xProtocolBase<AmsTCPPacket> implements
.onTimeout(future::completeExceptionally)
.onError((p, e) -> future.completeExceptionally(e))
.check(responseAmsPacket -> responseAmsPacket.getUserdata().getInvokeId() == amsPacket.getInvokeId())
- .unwrap(response -> (AdsReadResponse) response.getUserdata().getData())
- .handle(responseAdsData -> {
- if (responseAdsData.getResult() == ReturnCode.OK) {
- final PlcReadResponse plcReadResponse = convertToPlc4xReadResponse(readRequest, responseAdsData);
+ .unwrap(amsResponsePacket -> (AdsReadResponse) amsResponsePacket.getUserdata())
+ .handle(response -> {
+ if (response.getResult() == ReturnCode.OK) {
+ final PlcReadResponse plcReadResponse = convertToPlc4xReadResponse(readRequest, response);
// Convert the response from the PLC into a PLC4X Response ...
future.complete(plcReadResponse);
} else {
// TODO: Implement this correctly.
- future.completeExceptionally(new PlcException("Result is " + responseAdsData.getResult()));
+ future.completeExceptionally(new PlcException("Result is " + response.getResult()));
}
// Finish the request-transaction.
transaction.endRequest();
@@ -380,16 +373,13 @@ public class AdsProtocolLogic extends Plc4xProtocolBase<AmsTCPPacket> implements
}).sum();
// With multi-requests, the index-group is fixed and the index offset indicates the number of elements.
- AdsData adsData = new AdsReadWriteRequest(
- ReservedIndexGroups.ADSIGRP_MULTIPLE_READ.getValue(), directAdsFields.size(), expectedResponseDataSize,
+ AmsPacket amsPacket = new AdsReadWriteRequest(configuration.getTargetAmsNetId(), configuration.getTargetAmsPort(),
+ configuration.getSourceAmsNetId(), configuration.getSourceAmsPort(),
+ 0, getInvokeId(), ReservedIndexGroups.ADSIGRP_MULTIPLE_READ.getValue(), directAdsFields.size(), expectedResponseDataSize,
directAdsFields.stream().map(directAdsField -> new AdsMultiRequestItemRead(
directAdsField.getIndexGroup(), directAdsField.getIndexOffset(),
((long) directAdsField.getAdsDataType().getNumBytes() * directAdsField.getNumberOfElements())))
.collect(Collectors.toList()), null);
-
- AmsPacket amsPacket = new AmsPacket(configuration.getTargetAmsNetId(), configuration.getTargetAmsPort(),
- configuration.getSourceAmsNetId(), configuration.getSourceAmsPort(),
- CommandId.ADS_READ_WRITE, DEFAULT_COMMAND_STATE, 0, getInvokeId(), adsData);
AmsTCPPacket amsTCPPacket = new AmsTCPPacket(amsPacket);
// Start a new request-transaction (Is ended in the response-handler)
@@ -399,18 +389,18 @@ public class AdsProtocolLogic extends Plc4xProtocolBase<AmsTCPPacket> implements
.onTimeout(future::completeExceptionally)
.onError((p, e) -> future.completeExceptionally(e))
.check(responseAmsPacket -> responseAmsPacket.getUserdata().getInvokeId() == amsPacket.getInvokeId())
- .unwrap(response -> (AdsReadWriteResponse) response.getUserdata().getData())
- .handle(responseAdsData -> {
- if (responseAdsData.getResult() == ReturnCode.OK) {
- final PlcReadResponse plcReadResponse = convertToPlc4xReadResponse(readRequest, responseAdsData);
+ .unwrap(amsResponsePacket -> (AdsReadWriteResponse) amsResponsePacket.getUserdata())
+ .handle(response -> {
+ if (response.getResult() == ReturnCode.OK) {
+ final PlcReadResponse plcReadResponse = convertToPlc4xReadResponse(readRequest, response);
// Convert the response from the PLC into a PLC4X Response ...
future.complete(plcReadResponse);
} else {
- if (responseAdsData.getResult() == ReturnCode.ADSERR_DEVICE_INVALIDSIZE) {
+ if (response.getResult() == ReturnCode.ADSERR_DEVICE_INVALIDSIZE) {
future.completeExceptionally(
new PlcException("The parameter size was not correct (Internal error)"));
} else {
- future.completeExceptionally(new PlcException("Unexpected result " + responseAdsData.getResult()));
+ future.completeExceptionally(new PlcException("Unexpected result " + response.getResult()));
}
}
// Finish the request-transaction.
@@ -419,7 +409,7 @@ public class AdsProtocolLogic extends Plc4xProtocolBase<AmsTCPPacket> implements
return future;
}
- protected PlcReadResponse convertToPlc4xReadResponse(PlcReadRequest readRequest, AdsData adsData) {
+ protected PlcReadResponse convertToPlc4xReadResponse(PlcReadRequest readRequest, AmsPacket adsData) {
ReadBuffer readBuffer = null;
Map<String, PlcResponseCode> responseCodes = new HashMap<>();
if (adsData instanceof AdsReadResponse) {
@@ -576,11 +566,9 @@ public class AdsProtocolLogic extends Plc4xProtocolBase<AmsTCPPacket> implements
WriteBufferByteBased writeBuffer = new WriteBufferByteBased(DataItem.getLengthInBytes(plcValue,
plcField.getAdsDataType().getDataFormatName(), stringLength));
DataItem.staticSerialize(writeBuffer, plcValue, plcField.getAdsDataType().getDataFormatName(), stringLength, ByteOrder.LITTLE_ENDIAN);
- AdsData adsData = new AdsWriteRequest(
- directAdsField.getIndexGroup(), directAdsField.getIndexOffset(), writeBuffer.getData());
- AmsPacket amsPacket = new AmsPacket(configuration.getTargetAmsNetId(), configuration.getTargetAmsPort(),
+ AmsPacket amsPacket = new AdsWriteRequest(configuration.getTargetAmsNetId(), configuration.getTargetAmsPort(),
configuration.getSourceAmsNetId(), configuration.getSourceAmsPort(),
- CommandId.ADS_WRITE, DEFAULT_COMMAND_STATE, 0, getInvokeId(), adsData);
+ 0, getInvokeId(), directAdsField.getIndexGroup(), directAdsField.getIndexOffset(), writeBuffer.getData());
AmsTCPPacket amsTCPPacket = new AmsTCPPacket(amsPacket);
// Start a new request-transaction (Is ended in the response-handler)
@@ -590,15 +578,15 @@ public class AdsProtocolLogic extends Plc4xProtocolBase<AmsTCPPacket> implements
.onTimeout(future::completeExceptionally)
.onError((p, e) -> future.completeExceptionally(e))
.check(responseAmsPacket -> responseAmsPacket.getUserdata().getInvokeId() == amsPacket.getInvokeId())
- .unwrap(response -> (AdsWriteResponse) response.getUserdata().getData())
- .handle(responseAdsData -> {
- if (responseAdsData.getResult() == ReturnCode.OK) {
- final PlcWriteResponse plcWriteResponse = convertToPlc4xWriteResponse(writeRequest, responseAdsData);
+ .unwrap(amsResponsePacket -> (AdsWriteResponse) amsResponsePacket.getUserdata())
+ .handle(response -> {
+ if (response.getResult() == ReturnCode.OK) {
+ final PlcWriteResponse plcWriteResponse = convertToPlc4xWriteResponse(writeRequest, response);
// Convert the response from the PLC into a PLC4X Response ...
future.complete(plcWriteResponse);
} else {
// TODO: Implement this correctly.
- future.completeExceptionally(new PlcException("Unexpected return code " + responseAdsData.getResult()));
+ future.completeExceptionally(new PlcException("Unexpected return code " + response.getResult()));
}
// Finish the request-transaction.
transaction.endRequest();
@@ -645,16 +633,13 @@ public class AdsProtocolLogic extends Plc4xProtocolBase<AmsTCPPacket> implements
}
// With multi-requests, the index-group is fixed and the index offset indicates the number of elements.
- AdsData adsData = new AdsReadWriteRequest(
- ReservedIndexGroups.ADSIGRP_MULTIPLE_WRITE.getValue(), directAdsFields.size(), (long) directAdsFields.size() * 4,
+ AmsPacket amsPacket = new AdsReadWriteRequest(configuration.getTargetAmsNetId(), configuration.getTargetAmsPort(),
+ configuration.getSourceAmsNetId(), configuration.getSourceAmsPort(),
+ 0, getInvokeId(), ReservedIndexGroups.ADSIGRP_MULTIPLE_WRITE.getValue(), directAdsFields.size(), (long) directAdsFields.size() * 4,
directAdsFields.stream().map(directAdsField -> new AdsMultiRequestItemWrite(
directAdsField.getIndexGroup(), directAdsField.getIndexOffset(),
((long) directAdsField.getAdsDataType().getNumBytes() * directAdsField.getNumberOfElements())))
.collect(Collectors.toList()), writeBuffer);
-
- AmsPacket amsPacket = new AmsPacket(configuration.getTargetAmsNetId(), configuration.getTargetAmsPort(),
- configuration.getSourceAmsNetId(), configuration.getSourceAmsPort(),
- CommandId.ADS_READ_WRITE, DEFAULT_COMMAND_STATE, 0, getInvokeId(), adsData);
AmsTCPPacket amsTCPPacket = new AmsTCPPacket(amsPacket);
// Start a new request-transaction (Is ended in the response-handler)
@@ -664,10 +649,10 @@ public class AdsProtocolLogic extends Plc4xProtocolBase<AmsTCPPacket> implements
.onTimeout(future::completeExceptionally)
.onError((p, e) -> future.completeExceptionally(e))
.check(responseAmsPacket -> responseAmsPacket.getUserdata().getInvokeId() == amsPacket.getInvokeId())
- .unwrap(response -> (AdsReadWriteResponse) response.getUserdata().getData())
- .handle(responseAdsData -> {
- if (responseAdsData.getResult() == ReturnCode.OK) {
- final PlcWriteResponse plcWriteResponse = convertToPlc4xWriteResponse(writeRequest, responseAdsData);
+ .unwrap(responseAmsPacket -> (AdsReadWriteResponse) responseAmsPacket.getUserdata())
+ .handle(response -> {
+ if (response.getResult() == ReturnCode.OK) {
+ final PlcWriteResponse plcWriteResponse = convertToPlc4xWriteResponse(writeRequest, response);
// Convert the response from the PLC into a PLC4X Response ...
future.complete(plcWriteResponse);
} else {
@@ -680,7 +665,7 @@ public class AdsProtocolLogic extends Plc4xProtocolBase<AmsTCPPacket> implements
return future;
}
- protected PlcWriteResponse convertToPlc4xWriteResponse(PlcWriteRequest writeRequest, AdsData adsData) {
+ protected PlcWriteResponse convertToPlc4xWriteResponse(PlcWriteRequest writeRequest, AmsPacket adsData) {
Map<String, PlcResponseCode> responseCodes = new HashMap<>();
if (adsData instanceof AdsWriteResponse) {
AdsWriteResponse adsWriteResponse = (AdsWriteResponse) adsData;
@@ -757,23 +742,19 @@ public class AdsProtocolLogic extends Plc4xProtocolBase<AmsTCPPacket> implements
private CompletableFuture<PlcSubscriptionResponse> executeSubscribe(PlcSubscriptionRequest subscribeRequest) {
CompletableFuture<PlcSubscriptionResponse> future = new CompletableFuture<>();
- List<AdsData> adsData = subscribeRequest.getFields().stream()
+ List<AmsTCPPacket> amsTCPPackets = subscribeRequest.getFields().stream()
.map(field -> (DefaultPlcSubscriptionField) field)
- .map(field -> new AdsAddDeviceNotificationRequest(
+ .map(field -> new AmsTCPPacket(new AdsAddDeviceNotificationRequest(configuration.getTargetAmsNetId(), configuration.getTargetAmsPort(),
+ configuration.getSourceAmsNetId(), configuration.getSourceAmsPort(),
+ 0, getInvokeId(),
symbolicFieldMapping.get((SymbolicAdsField) field.getPlcField()).getIndexGroup(),
symbolicFieldMapping.get((SymbolicAdsField) field.getPlcField()).getIndexOffset(),
(long) ((AdsField) field.getPlcField()).getAdsDataType().getNumBytes() * field.getNumberOfElements(),
field.getPlcSubscriptionType() == PlcSubscriptionType.CYCLIC ? 3 : 4, // if it's not cyclic, it's on change or event
0, // there is no api for that yet
- field.getDuration().orElse(Duration.ZERO).toMillis()))
+ field.getDuration().orElse(Duration.ZERO).toMillis())))
.collect(Collectors.toList());
- List<AmsTCPPacket> amsTCPPackets = adsData.stream().map(data ->
- new AmsTCPPacket(new AmsPacket(
- configuration.getTargetAmsNetId(), configuration.getTargetAmsPort(),
- configuration.getSourceAmsNetId(), configuration.getSourceAmsPort(),
- CommandId.ADS_ADD_DEVICE_NOTIFICATION, DEFAULT_COMMAND_STATE, 0, getInvokeId(), data))).collect(Collectors.toList());
-
Map<String, ResponseItem<PlcSubscriptionHandle>> responses = new HashMap<>();
// Start the first request-transaction (it is ended in the response-handler).
@@ -802,16 +783,16 @@ public class AdsProtocolLogic extends Plc4xProtocolBase<AmsTCPPacket> implements
.onTimeout(future::completeExceptionally)
.onError((p, e) -> future.completeExceptionally(e))
.check(responseAmsPacket -> responseAmsPacket.getUserdata().getInvokeId() == packet.getUserdata().getInvokeId())
- .unwrap(response -> (AdsAddDeviceNotificationResponse) response.getUserdata().getData())
- .handle(responseAdsData -> {
- if (responseAdsData.getResult() == ReturnCode.OK) {
+ .unwrap(responseAmsPacket -> (AdsAddDeviceNotificationResponse) responseAmsPacket.getUserdata())
+ .handle(response -> {
+ if (response.getResult() == ReturnCode.OK) {
// Collect notification handle from individual response.
responses.put(fieldName, new ResponseItem<>(
- parsePlcResponseCode(responseAdsData.getResult()),
+ parsePlcResponseCode(response.getResult()),
new AdsSubscriptionHandle(this,
fieldName,
((AdsField) ((DefaultPlcSubscriptionField) subscriptionRequest.getField(fieldName)).getPlcField()).getAdsDataType(),
- responseAdsData.getNotificationHandle())));
+ response.getNotificationHandle())));
// After receiving the last ADD_DEVICE_NOTIFICATION response, complete the PLC4X response.
if (!hasMorePackets) {
@@ -819,11 +800,11 @@ public class AdsProtocolLogic extends Plc4xProtocolBase<AmsTCPPacket> implements
future.complete(plcSubscriptionResponse);
}
} else {
- if (responseAdsData.getResult() == ReturnCode.ADSERR_DEVICE_INVALIDSIZE) {
+ if (response.getResult() == ReturnCode.ADSERR_DEVICE_INVALIDSIZE) {
future.completeExceptionally(
new PlcException("The parameter size was not correct (Internal error)"));
} else {
- future.completeExceptionally(new PlcException("Unexpected result " + responseAdsData.getResult()));
+ future.completeExceptionally(new PlcException("Unexpected result " + response.getResult()));
}
}
// Finish the request-transaction.
@@ -856,14 +837,10 @@ public class AdsProtocolLogic extends Plc4xProtocolBase<AmsTCPPacket> implements
.forEach(DefaultPlcConsumerRegistration::unregister);
});
- List<AdsData> adsData = notificationHandles.stream()
- .map(AdsDeleteDeviceNotificationRequest::new)
- .collect(Collectors.toList());
-
- List<AmsTCPPacket> amsTCPPackets = adsData.stream().map(data -> new AmsTCPPacket(
- new AmsPacket(configuration.getTargetAmsNetId(), configuration.getTargetAmsPort(),
+ List<AmsTCPPacket> amsTCPPackets = notificationHandles.stream().map(data -> new AmsTCPPacket(
+ new AdsDeleteDeviceNotificationRequest(configuration.getTargetAmsNetId(), configuration.getTargetAmsPort(),
configuration.getSourceAmsNetId(), configuration.getSourceAmsPort(),
- CommandId.ADS_DELETE_DEVICE_NOTIFICATION, DEFAULT_COMMAND_STATE, 0, getInvokeId(), data))).collect(Collectors.toList());
+ 0, getInvokeId(), data))).collect(Collectors.toList());
// Start the first request-transaction (it is ended in the response-handler)
RequestTransactionManager.RequestTransaction transaction = tm.startRequest();
@@ -883,9 +860,9 @@ public class AdsProtocolLogic extends Plc4xProtocolBase<AmsTCPPacket> implements
.onTimeout(future::completeExceptionally)
.onError((p, e) -> future.completeExceptionally(e))
.check(responseAmsPacket -> responseAmsPacket.getUserdata().getInvokeId() == packet.getUserdata().getInvokeId())
- .unwrap(response -> (AdsDeleteDeviceNotificationResponse) response.getUserdata().getData())
- .handle(responseAdsData -> {
- if (responseAdsData.getResult() == ReturnCode.OK) {
+ .unwrap(responseAmsPacket -> (AdsDeleteDeviceNotificationResponse) responseAmsPacket.getUserdata())
+ .handle(response -> {
+ if (response.getResult() == ReturnCode.OK) {
// After receiving the last DELETE_DEVICE_NOTIFICATION response, complete the PLC4X response.
if (!hasMorePackets) {
final PlcUnsubscriptionResponse plcUnsubscriptionResponse = new DefaultPlcUnsubscriptionResponse(unsubscriptionRequest);
@@ -893,11 +870,11 @@ public class AdsProtocolLogic extends Plc4xProtocolBase<AmsTCPPacket> implements
}
} else {
// TODO: this is more guesswork than knowing it could actually occur
- if (responseAdsData.getResult() == ReturnCode.ADSERR_DEVICE_NOTIFYHNDINVALID) {
+ if (response.getResult() == ReturnCode.ADSERR_DEVICE_NOTIFYHNDINVALID) {
future.completeExceptionally(
new PlcException("The notification handle is invalid (Internal error)"));
} else {
- future.completeExceptionally(new PlcException("Unexpected result " + responseAdsData.getResult()));
+ future.completeExceptionally(new PlcException("Unexpected result " + response.getResult()));
}
}
// Finish the request-transaction.
@@ -914,8 +891,8 @@ public class AdsProtocolLogic extends Plc4xProtocolBase<AmsTCPPacket> implements
@Override
protected void decode(ConversationContext<AmsTCPPacket> context, AmsTCPPacket msg) throws Exception {
- if (msg.getUserdata().getData() instanceof AdsDeviceNotificationRequest) {
- AdsDeviceNotificationRequest notificationData = (AdsDeviceNotificationRequest) msg.getUserdata().getData();
+ if (msg.getUserdata() instanceof AdsDeviceNotificationRequest) {
+ AdsDeviceNotificationRequest notificationData = (AdsDeviceNotificationRequest) msg.getUserdata();
List<AdsStampHeader> stamps = notificationData.getAdsStampHeaders();
for (AdsStampHeader stamp : stamps) {
// convert Windows FILETIME format to unix epoch
@@ -1041,12 +1018,11 @@ public class AdsProtocolLogic extends Plc4xProtocolBase<AmsTCPPacket> implements
protected CompletableFuture<Void> resolveSingleSymbolicAddress(SymbolicAdsField symbolicAdsField) {
CompletableFuture<Void> future = new CompletableFuture<>();
- AdsData adsData = new AdsReadWriteRequest(ReservedIndexGroups.ADSIGRP_SYM_HNDBYNAME.getValue(), 0,
+ AmsPacket amsPacket = new AdsReadWriteRequest(configuration.getTargetAmsNetId(), configuration.getTargetAmsPort(),
+ configuration.getSourceAmsNetId(), configuration.getSourceAmsPort(),
+ 0, getInvokeId(), ReservedIndexGroups.ADSIGRP_SYM_HNDBYNAME.getValue(), 0,
4, null,
getNullByteTerminatedArray(symbolicAdsField.getSymbolicAddress()));
- AmsPacket amsPacket = new AmsPacket(configuration.getTargetAmsNetId(), configuration.getTargetAmsPort(),
- configuration.getSourceAmsNetId(), configuration.getSourceAmsPort(),
- CommandId.ADS_READ_WRITE, DEFAULT_COMMAND_STATE, 0, getInvokeId(), adsData);
AmsTCPPacket amsTCPPacket = new AmsTCPPacket(amsPacket);
// Start a new request-transaction (Is ended in the response-handler)
@@ -1056,15 +1032,15 @@ public class AdsProtocolLogic extends Plc4xProtocolBase<AmsTCPPacket> implements
.onTimeout(future::completeExceptionally)
.onError((p, e) -> future.completeExceptionally(e))
.check(responseAmsPacket -> responseAmsPacket.getUserdata().getInvokeId() == amsPacket.getInvokeId())
- .unwrap(response -> response.getUserdata().getData())
+ .unwrap(AmsTCPPacket::getUserdata)
.check(AdsReadWriteResponse.class::isInstance)
.unwrap(AdsReadWriteResponse.class::cast)
- .handle(responseAdsData -> {
- if (responseAdsData.getResult() != ReturnCode.OK) {
+ .handle(response -> {
+ if (response.getResult() != ReturnCode.OK) {
future.completeExceptionally(new PlcException("Couldn't retrieve handle for symbolic field " +
- symbolicAdsField.getSymbolicAddress() + " got return code " + responseAdsData.getResult().name()));
+ symbolicAdsField.getSymbolicAddress() + " got return code " + response.getResult().name()));
} else {
- ReadBuffer readBuffer = new ReadBufferByteBased(responseAdsData.getData(), ByteOrder.LITTLE_ENDIAN);
+ ReadBuffer readBuffer = new ReadBufferByteBased(response.getData(), ByteOrder.LITTLE_ENDIAN);
try {
// Read the handle.
long handle = readBuffer.readUnsignedLong(32);
@@ -1088,17 +1064,15 @@ public class AdsProtocolLogic extends Plc4xProtocolBase<AmsTCPPacket> implements
// The expected response for every symbolic address is 12 bytes (8 bytes header and 4 bytes for the handle)
long expectedResponseDataSize = (long) (symbolicAdsFields.size()) * 12;
- // Concatenate the string part of each symbolic address into one concattenated string and get the bytes.
+ // Concatenate the string part of each symbolic address into one concatenated string and get the bytes.
byte[] addressData = symbolicAdsFields.stream().map(
SymbolicAdsField::getSymbolicAddress).collect(Collectors.joining("")).getBytes();
- AdsData adsData = new AdsReadWriteRequest(ReservedIndexGroups.ADSIGRP_MULTIPLE_READ_WRITE.getValue(),
+ AmsPacket amsPacket = new AdsReadWriteRequest(configuration.getTargetAmsNetId(), configuration.getTargetAmsPort(),
+ configuration.getSourceAmsNetId(), configuration.getSourceAmsPort(),
+ 0, getInvokeId(), ReservedIndexGroups.ADSIGRP_MULTIPLE_READ_WRITE.getValue(),
symbolicAdsFields.size(), expectedResponseDataSize, symbolicAdsFields.stream().map(symbolicAdsField ->
new AdsMultiRequestItemReadWrite(ReservedIndexGroups.ADSIGRP_SYM_HNDBYNAME.getValue(), 0,
- 4, symbolicAdsField.getSymbolicAddress().length())
- ).collect(Collectors.toList()), addressData);
- AmsPacket amsPacket = new AmsPacket(configuration.getTargetAmsNetId(), configuration.getTargetAmsPort(),
- configuration.getSourceAmsNetId(), configuration.getSourceAmsPort(),
- CommandId.ADS_READ_WRITE, DEFAULT_COMMAND_STATE, 0, getInvokeId(), adsData);
+ 4, symbolicAdsField.getSymbolicAddress().length())).collect(Collectors.toList()), null);
AmsTCPPacket amsTCPPacket = new AmsTCPPacket(amsPacket);
// Start a new request-transaction (Is ended in the response-handler)
@@ -1108,11 +1082,11 @@ public class AdsProtocolLogic extends Plc4xProtocolBase<AmsTCPPacket> implements
.onTimeout(future::completeExceptionally)
.onError((p, e) -> future.completeExceptionally(e))
.check(responseAmsPacket -> responseAmsPacket.getUserdata().getInvokeId() == amsPacket.getInvokeId())
- .unwrap(response -> response.getUserdata().getData())
+ .unwrap(AmsTCPPacket::getUserdata)
.check(AdsReadWriteResponse.class::isInstance)
.unwrap(AdsReadWriteResponse.class::cast)
- .handle(responseAdsData -> {
- ReadBuffer readBuffer = new ReadBufferByteBased(responseAdsData.getData(), ByteOrder.LITTLE_ENDIAN);
+ .handle(response -> {
+ ReadBuffer readBuffer = new ReadBufferByteBased(response.getData(), ByteOrder.LITTLE_ENDIAN);
Map<SymbolicAdsField, Long> returnCodes = new HashMap<>();
// In the response first come the return codes and the data-lengths for each item.
symbolicAdsFields.forEach(symbolicAdsField -> {
diff --git a/plc4j/drivers/ads/src/test/java/org/apache/plc4x/protocol/ads/AdsDriverIT.java b/plc4j/drivers/ads/src/test/java/org/apache/plc4x/protocol/ads/AdsDriverIT.java
index 973231ce1..bfb057a80 100644
--- a/plc4j/drivers/ads/src/test/java/org/apache/plc4x/protocol/ads/AdsDriverIT.java
+++ b/plc4j/drivers/ads/src/test/java/org/apache/plc4x/protocol/ads/AdsDriverIT.java
@@ -25,7 +25,7 @@ import org.junit.jupiter.api.Disabled;
public class AdsDriverIT extends DriverTestsuiteRunner {
public AdsDriverIT() {
- super("/protocols/ads/DriverTestsuite.xml", true);
+ super("/protocols/ads/DriverTestsuite.xml");
}
}
diff --git a/plc4j/pom.xml b/plc4j/pom.xml
index f56b9b838..d3d1c2091 100644
--- a/plc4j/pom.xml
+++ b/plc4j/pom.xml
@@ -206,6 +206,31 @@
</configuration>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ <configuration>
+ <!--
+ The failsafe plugin would use the java jigsaw module path,
+ this would make loading the test XML files impossible.
+ So we simply disable this.
+ -->
+ <useModulePath>false</useModulePath>
+ <!--
+ We have to slightly increase the heap-size or some tests will fail.
+ Notice the @ instead of the $ as prefix? That's late evaluation.
+ -->
+ <argLine>-Xmx256m @{failsafeArgLine}</argLine>
+ <includes>
+ <include>**/*IT.java</include>
+ </includes>
+ <environmentVariables>
+ <!-- Pass in to the build, if all tests should be run -->
+ <ENABLE_ALL_TESTS>${enable-all-tests}</ENABLE_ALL_TESTS>
+ </environmentVariables>
+ </configuration>
+ </plugin>
+
<!--
Generate an OSGI compatible MANIFEST file.
-->
diff --git a/plc4net/drivers/knxnetip/src/drivers/knxnetip/readwrite/model/KnxManufacturer.cs b/plc4net/drivers/knxnetip/src/drivers/knxnetip/readwrite/model/KnxManufacturer.cs
index 0df9c2f6b..70474542d 100644
--- a/plc4net/drivers/knxnetip/src/drivers/knxnetip/readwrite/model/KnxManufacturer.cs
+++ b/plc4net/drivers/knxnetip/src/drivers/knxnetip/readwrite/model/KnxManufacturer.cs
@@ -620,8 +620,9 @@ namespace org.apache.plc4net.drivers.knxnetip.readwrite.model
M_SHANGHAI_LEWIN_INTELLIGENT_TECHNOLOGY_CO__LTD_ = 593,
M_KG_POWER = 594,
M_ZHEJIANG_MOORGEN_INTELLIGENT_TECHNOLOGY_CO___LTD = 595,
- M_ABB___RESERVED = 596,
- M_BUSCH_JAEGER_ELEKTRO___RESERVED = 597,
+ M_GUANGDONG_KANWAY = 596,
+ M_ABB___RESERVED = 597,
+ M_BUSCH_JAEGER_ELEKTRO___RESERVED = 598,
}
public static class KnxManufacturerInfo
@@ -2287,10 +2288,13 @@ namespace org.apache.plc4net.drivers.knxnetip.readwrite.model
case KnxManufacturer.M_ZHEJIANG_MOORGEN_INTELLIGENT_TECHNOLOGY_CO___LTD: { /* '595' */
return 653;
}
- case KnxManufacturer.M_ABB___RESERVED: { /* '596' */
+ case KnxManufacturer.M_GUANGDONG_KANWAY: { /* '596' */
+ return 654;
+ }
+ case KnxManufacturer.M_ABB___RESERVED: { /* '597' */
return 43954;
}
- case KnxManufacturer.M_BUSCH_JAEGER_ELEKTRO___RESERVED: { /* '597' */
+ case KnxManufacturer.M_BUSCH_JAEGER_ELEKTRO___RESERVED: { /* '598' */
return 43959;
}
case KnxManufacturer.M_BUSCH_JAEGER_ELEKTRO: { /* '6' */
@@ -4091,10 +4095,13 @@ namespace org.apache.plc4net.drivers.knxnetip.readwrite.model
case KnxManufacturer.M_ZHEJIANG_MOORGEN_INTELLIGENT_TECHNOLOGY_CO___LTD: { /* '595' */
return "Zhejiang Moorgen Intelligent Technology Co., Ltd";
}
- case KnxManufacturer.M_ABB___RESERVED: { /* '596' */
+ case KnxManufacturer.M_GUANGDONG_KANWAY: { /* '596' */
+ return "Guangdong Kanway";
+ }
+ case KnxManufacturer.M_ABB___RESERVED: { /* '597' */
return "ABB - reserved";
}
- case KnxManufacturer.M_BUSCH_JAEGER_ELEKTRO___RESERVED: { /* '597' */
+ case KnxManufacturer.M_BUSCH_JAEGER_ELEKTRO___RESERVED: { /* '598' */
return "Busch-Jaeger Elektro - reserved";
}
case KnxManufacturer.M_BUSCH_JAEGER_ELEKTRO: { /* '6' */
diff --git a/protocols/ads/src/main/resources/protocols/ads/ads.mspec b/protocols/ads/src/main/resources/protocols/ads/ads.mspec
index bc82fd672..9dedab5c3 100644
--- a/protocols/ads/src/main/resources/protocols/ads/ads.mspec
+++ b/protocols/ads/src/main/resources/protocols/ads/ads.mspec
@@ -115,86 +115,37 @@
// AMS Common
////////////////////////////////////////////////////////////////
-[type AmsPacket
+[discriminatedType AmsPacket
// AMS Header 32 bytes The AMS/TCP-Header contains the addresses of the transmitter and receiver. In addition the AMS error code , the ADS command Id and some other information.
// This is the AmsNetId of the station, for which the packet is intended. Remarks see below.
- [simple AmsNetId targetAmsNetId ]
+ [simple AmsNetId targetAmsNetId ]
// This is the AmsPort of the station, for which the packet is intended.
- [simple uint 16 targetAmsPort ]
+ [simple uint 16 targetAmsPort ]
// This contains the AmsNetId of the station, from which the packet was sent.
- [simple AmsNetId sourceAmsNetId ]
+ [simple AmsNetId sourceAmsNetId ]
// This contains the AmsPort of the station, from which the packet was sent.
- [simple uint 16 sourceAmsPort ]
+ [simple uint 16 sourceAmsPort ]
// 2 bytes.
- [simple CommandId commandId ]
+ [discriminator CommandId commandId ]
// 2 bytes.
- [simple State state ]
+ [const bit initCommand false ]
+ [const bit updCommand false ]
+ [const bit timestampAdded false ]
+ [const bit highPriorityCommand false ]
+ [const bit systemCommand false ]
+ [const bit adsCommand true ]
+ [const bit noReturn false ]
+ [discriminator bit response ]
+ [const bit broadcast false ]
+ [reserved int 7 '0x0' ]
// 4 bytes Size of the data range. The unit is byte.
- [implicit uint 32 length 'data.lengthInBytes' ]
+ [implicit uint 32 length 'lengthInBytes - 32' ]
// 4 bytes AMS error number. See ADS Return Codes.
- [simple uint 32 errorCode ]
+ [simple uint 32 errorCode ]
// free usable field of 4 bytes
// 4 bytes Free usable 32 bit array. Usually this array serves to send an Id. This Id makes is possible to assign a received response to a request, which was sent before.
- [simple uint 32 invokeId ]
+ [simple uint 32 invokeId ]
// The payload
- [simple AdsData('commandId', 'state.response') data ]
-]
-
-[enum uint 16 CommandId
- ['0x0000' INVALID ]
- ['0x0001' ADS_READ_DEVICE_INFO ]
- ['0x0002' ADS_READ ]
- ['0x0003' ADS_WRITE ]
- ['0x0004' ADS_READ_STATE ]
- ['0x0005' ADS_WRITE_CONTROL ]
- ['0x0006' ADS_ADD_DEVICE_NOTIFICATION ]
- ['0x0007' ADS_DELETE_DEVICE_NOTIFICATION]
- ['0x0008' ADS_DEVICE_NOTIFICATION ]
- ['0x0009' ADS_READ_WRITE ]
-]
-
-[type State
- [simple bit initCommand ]
- [simple bit updCommand ]
- [simple bit timestampAdded ]
- [simple bit highPriorityCommand ]
- [simple bit systemCommand ]
- [simple bit adsCommand ]
- [simple bit noReturn ]
- [simple bit response ]
- [simple bit broadcast ]
- [reserved int 7 '0x0' ]
-]
-
-// It is not only possible to exchange data between TwinCAT modules on one PC, it is even possible to do so by ADS
-// methods between multiple TwinCAT PC's on the network.
-// <p>
-// Every PC on the network can be uniquely identified by a TCP/IP address, such as "172.1.2.16". The AdsAmsNetId is an
-// extension of the TCP/IP address and identifies a TwinCAT message router, e.g. "172.1.2.16.1.1". TwinCAT message
-// routers exist on every TwinCAT PC, and on every Beckhoff BCxxxx bus controller (e.g. BC3100, BC8100, BC9000, ...).
-// <p>
-// The AmsNetId consists of 6 bytes and addresses the transmitter or receiver. One possible AmsNetId would be e.g.
-// "172.16.17.10.1.1". The storage arrangement in this example is as follows:
-// <p>
-// _____0 1 2 3 4 5
-// __+-----------------------------------+
-// 0 | 127 | 16 | 17 | 10 | 1 | 1 |
-// __+-----------------------------------+
-// <p>
-// The AmsNetId is purely logical and has usually no relation to the IP address. The AmsNetId is configured at the
-// target system. At the PC for this the TwinCAT System Control is used. If you use other hardware, see the considering
-// documentation for notes about settings of the AMS NetId.
-// @see <a href="https://infosys.beckhoff.com/content/1033/tcadscommon/html/tcadscommon_identadsdevice.htm?id=3991659524769593444">ADS device identification</a>
-[type AmsNetId
- [simple uint 8 octet1 ]
- [simple uint 8 octet2 ]
- [simple uint 8 octet3 ]
- [simple uint 8 octet4 ]
- [simple uint 8 octet5 ]
- [simple uint 8 octet6 ]
-]
-
-[discriminatedType AdsData(CommandId commandId, bit response)
[typeSwitch commandId, response
['INVALID', 'false' AdsInvalidRequest]
['INVALID', 'true' AdsInvalidResponse]
@@ -339,6 +290,47 @@
]
]
+[enum uint 16 CommandId
+ ['0x0000' INVALID ]
+ ['0x0001' ADS_READ_DEVICE_INFO ]
+ ['0x0002' ADS_READ ]
+ ['0x0003' ADS_WRITE ]
+ ['0x0004' ADS_READ_STATE ]
+ ['0x0005' ADS_WRITE_CONTROL ]
+ ['0x0006' ADS_ADD_DEVICE_NOTIFICATION ]
+ ['0x0007' ADS_DELETE_DEVICE_NOTIFICATION]
+ ['0x0008' ADS_DEVICE_NOTIFICATION ]
+ ['0x0009' ADS_READ_WRITE ]
+]
+
+// It is not only possible to exchange data between TwinCAT modules on one PC, it is even possible to do so by ADS
+// methods between multiple TwinCAT PC's on the network.
+// <p>
+// Every PC on the network can be uniquely identified by a TCP/IP address, such as "172.1.2.16". The AdsAmsNetId is an
+// extension of the TCP/IP address and identifies a TwinCAT message router, e.g. "172.1.2.16.1.1". TwinCAT message
+// routers exist on every TwinCAT PC, and on every Beckhoff BCxxxx bus controller (e.g. BC3100, BC8100, BC9000, ...).
+// <p>
+// The AmsNetId consists of 6 bytes and addresses the transmitter or receiver. One possible AmsNetId would be e.g.
+// "172.16.17.10.1.1". The storage arrangement in this example is as follows:
+// <p>
+// _____0 1 2 3 4 5
+// __+-----------------------------------+
+// 0 | 127 | 16 | 17 | 10 | 1 | 1 |
+// __+-----------------------------------+
+// <p>
+// The AmsNetId is purely logical and has usually no relation to the IP address. The AmsNetId is configured at the
+// target system. At the PC for this the TwinCAT System Control is used. If you use other hardware, see the considering
+// documentation for notes about settings of the AMS NetId.
+// @see <a href="https://infosys.beckhoff.com/content/1033/tcadscommon/html/tcadscommon_identadsdevice.htm?id=3991659524769593444">ADS device identification</a>
+[type AmsNetId
+ [simple uint 8 octet1 ]
+ [simple uint 8 octet2 ]
+ [simple uint 8 octet3 ]
+ [simple uint 8 octet4 ]
+ [simple uint 8 octet5 ]
+ [simple uint 8 octet6 ]
+]
+
[discriminatedType AdsMultiRequestItem(uint 32 indexGroup)
[typeSwitch indexGroup
// ReservedIndexGroups.ADSIGRP_MULTIPLE_READ
diff --git a/protocols/ads/src/test/resources/protocols/ads/DriverTestsuite.xml b/protocols/ads/src/test/resources/protocols/ads/DriverTestsuite.xml
index 70a6dd51a..47ef65a02 100644
--- a/protocols/ads/src/test/resources/protocols/ads/DriverTestsuite.xml
+++ b/protocols/ads/src/test/resources/protocols/ads/DriverTestsuite.xml
@@ -93,32 +93,24 @@
<commandId>
<CommandId dataType="uint" bitLength="16" stringRepresentation="ADS_READ">2</CommandId>
</commandId>
- <state>
- <State>
- <initCommand dataType="bit" bitLength="1">false</initCommand>
- <updCommand dataType="bit" bitLength="1">false</updCommand>
- <timestampAdded dataType="bit" bitLength="1">false</timestampAdded>
- <highPriorityCommand dataType="bit" bitLength="1">false</highPriorityCommand>
- <systemCommand dataType="bit" bitLength="1">false</systemCommand>
- <adsCommand dataType="bit" bitLength="1">true</adsCommand>
- <noReturn dataType="bit" bitLength="1">false</noReturn>
- <response dataType="bit" bitLength="1">false</response>
- <broadcast dataType="bit" bitLength="1">false</broadcast>
- <reserved dataType="int" bitLength="7">0</reserved>
- </State>
- </state>
+ <initCommand dataType="bit" bitLength="1">false</initCommand>
+ <updCommand dataType="bit" bitLength="1">false</updCommand>
+ <timestampAdded dataType="bit" bitLength="1">false</timestampAdded>
+ <highPriorityCommand dataType="bit" bitLength="1">false</highPriorityCommand>
+ <systemCommand dataType="bit" bitLength="1">false</systemCommand>
+ <adsCommand dataType="bit" bitLength="1">true</adsCommand>
+ <noReturn dataType="bit" bitLength="1">false</noReturn>
+ <response dataType="bit" bitLength="1">false</response>
+ <broadcast dataType="bit" bitLength="1">false</broadcast>
+ <reserved dataType="int" bitLength="7">0</reserved>
<length dataType="uint" bitLength="32">12</length>
<errorCode dataType="uint" bitLength="32">0</errorCode>
<invokeId dataType="uint" bitLength="32">1</invokeId>
- <data>
- <AdsData>
- <AdsReadRequest>
- <indexGroup dataType="uint" bitLength="32">61455</indexGroup>
- <indexOffset dataType="uint" bitLength="32">0</indexOffset>
- <length dataType="uint" bitLength="32">24</length>
- </AdsReadRequest>
- </AdsData>
- </data>
+ <AdsReadRequest>
+ <indexGroup dataType="uint" bitLength="32">61455</indexGroup>
+ <indexOffset dataType="uint" bitLength="32">0</indexOffset>
+ <length dataType="uint" bitLength="32">24</length>
+ </AdsReadRequest>
</AmsPacket>
</userdata>
</AmsTCPPacket>
@@ -154,20 +146,16 @@
<commandId>
<CommandId dataType="uint" bitLength="16" stringRepresentation="ADS_READ">2</CommandId>
</commandId>
- <state>
- <State>
- <initCommand dataType="bit" bitLength="1">false</initCommand>
- <updCommand dataType="bit" bitLength="1">false</updCommand>
- <timestampAdded dataType="bit" bitLength="1">false</timestampAdded>
- <highPriorityCommand dataType="bit" bitLength="1">false</highPriorityCommand>
- <systemCommand dataType="bit" bitLength="1">false</systemCommand>
- <adsCommand dataType="bit" bitLength="1">true</adsCommand>
- <noReturn dataType="bit" bitLength="1">false</noReturn>
- <response dataType="bit" bitLength="1">true</response>
- <broadcast dataType="bit" bitLength="1">false</broadcast>
- <reserved dataType="int" bitLength="7">0</reserved>
- </State>
- </state>
+ <initCommand dataType="bit" bitLength="1">false</initCommand>
+ <updCommand dataType="bit" bitLength="1">false</updCommand>
+ <timestampAdded dataType="bit" bitLength="1">false</timestampAdded>
+ <highPriorityCommand dataType="bit" bitLength="1">false</highPriorityCommand>
+ <systemCommand dataType="bit" bitLength="1">false</systemCommand>
+ <adsCommand dataType="bit" bitLength="1">true</adsCommand>
+ <noReturn dataType="bit" bitLength="1">false</noReturn>
+ <response dataType="bit" bitLength="1">true</response>
+ <broadcast dataType="bit" bitLength="1">false</broadcast>
+ <reserved dataType="int" bitLength="7">0</reserved>
<length dataType="uint" bitLength="32">9</length>
<errorCode dataType="uint" bitLength="32">0</errorCode>
<invokeId dataType="uint" bitLength="32">1</invokeId>
@@ -266,32 +254,24 @@
<commandId>
<CommandId dataType="uint" bitLength="16" stringRepresentation="ADS_READ">2</CommandId>
</commandId>
- <state>
- <State>
- <initCommand dataType="bit" bitLength="1">false</initCommand>
- <updCommand dataType="bit" bitLength="1">false</updCommand>
- <timestampAdded dataType="bit" bitLength="1">false</timestampAdded>
- <highPriorityCommand dataType="bit" bitLength="1">false</highPriorityCommand>
- <systemCommand dataType="bit" bitLength="1">false</systemCommand>
- <adsCommand dataType="bit" bitLength="1">true</adsCommand>
- <noReturn dataType="bit" bitLength="1">false</noReturn>
- <response dataType="bit" bitLength="1">false</response>
- <broadcast dataType="bit" bitLength="1">false</broadcast>
- <reserved dataType="int" bitLength="7">0</reserved>
- </State>
- </state>
+ <initCommand dataType="bit" bitLength="1">false</initCommand>
+ <updCommand dataType="bit" bitLength="1">false</updCommand>
+ <timestampAdded dataType="bit" bitLength="1">false</timestampAdded>
+ <highPriorityCommand dataType="bit" bitLength="1">false</highPriorityCommand>
+ <systemCommand dataType="bit" bitLength="1">false</systemCommand>
+ <adsCommand dataType="bit" bitLength="1">true</adsCommand>
+ <noReturn dataType="bit" bitLength="1">false</noReturn>
+ <response dataType="bit" bitLength="1">false</response>
+ <broadcast dataType="bit" bitLength="1">false</broadcast>
+ <reserved dataType="int" bitLength="7">0</reserved>
<length dataType="uint" bitLength="32">12</length>
<errorCode dataType="uint" bitLength="32">0</errorCode>
<invokeId dataType="uint" bitLength="32">1</invokeId>
- <data>
- <AdsData>
- <AdsReadRequest>
- <indexGroup dataType="uint" bitLength="32">61455</indexGroup>
- <indexOffset dataType="uint" bitLength="32">0</indexOffset>
- <length dataType="uint" bitLength="32">24</length>
- </AdsReadRequest>
- </AdsData>
- </data>
+ <AdsReadRequest>
+ <indexGroup dataType="uint" bitLength="32">61455</indexGroup>
+ <indexOffset dataType="uint" bitLength="32">0</indexOffset>
+ <length dataType="uint" bitLength="32">24</length>
+ </AdsReadRequest>
</AmsPacket>
</userdata>
</AmsTCPPacket>
@@ -328,20 +308,16 @@
<commandId>
<CommandId dataType="uint" bitLength="16" stringRepresentation="ADS_READ_WRITE">9</CommandId>
</commandId>
- <state>
- <State>
- <initCommand dataType="bit" bitLength="1">false</initCommand>
- <updCommand dataType="bit" bitLength="1">false</updCommand>
- <timestampAdded dataType="bit" bitLength="1">false</timestampAdded>
- <highPriorityCommand dataType="bit" bitLength="1">false</highPriorityCommand>
- <systemCommand dataType="bit" bitLength="1">false</systemCommand>
- <adsCommand dataType="bit" bitLength="1">true</adsCommand>
- <noReturn dataType="bit" bitLength="1">false</noReturn>
- <response dataType="bit" bitLength="1">true</response>
- <broadcast dataType="bit" bitLength="1">false</broadcast>
- <reserved dataType="int" bitLength="7">0</reserved>
- </State>
- </state>
+ <initCommand dataType="bit" bitLength="1">false</initCommand>
+ <updCommand dataType="bit" bitLength="1">false</updCommand>
+ <timestampAdded dataType="bit" bitLength="1">false</timestampAdded>
+ <highPriorityCommand dataType="bit" bitLength="1">false</highPriorityCommand>
+ <systemCommand dataType="bit" bitLength="1">false</systemCommand>
+ <adsCommand dataType="bit" bitLength="1">true</adsCommand>
+ <noReturn dataType="bit" bitLength="1">false</noReturn>
+ <response dataType="bit" bitLength="1">true</response>
+ <broadcast dataType="bit" bitLength="1">false</broadcast>
+ <reserved dataType="int" bitLength="7">0</reserved>
<length dataType="uint" bitLength="32">18</length>
<errorCode dataType="uint" bitLength="32">0</errorCode>
<invokeId dataType="uint" bitLength="32">1</invokeId>
@@ -451,32 +427,24 @@
<commandId>
<CommandId dataType="uint" bitLength="16" stringRepresentation="ADS_READ">2</CommandId>
</commandId>
- <state>
- <State>
- <initCommand dataType="bit" bitLength="1">false</initCommand>
- <updCommand dataType="bit" bitLength="1">false</updCommand>
- <timestampAdded dataType="bit" bitLength="1">false</timestampAdded>
- <highPriorityCommand dataType="bit" bitLength="1">false</highPriorityCommand>
- <systemCommand dataType="bit" bitLength="1">false</systemCommand>
- <adsCommand dataType="bit" bitLength="1">true</adsCommand>
- <noReturn dataType="bit" bitLength="1">false</noReturn>
- <response dataType="bit" bitLength="1">false</response>
- <broadcast dataType="bit" bitLength="1">false</broadcast>
- <reserved dataType="int" bitLength="7">0</reserved>
- </State>
- </state>
+ <initCommand dataType="bit" bitLength="1">false</initCommand>
+ <updCommand dataType="bit" bitLength="1">false</updCommand>
+ <timestampAdded dataType="bit" bitLength="1">false</timestampAdded>
+ <highPriorityCommand dataType="bit" bitLength="1">false</highPriorityCommand>
+ <systemCommand dataType="bit" bitLength="1">false</systemCommand>
+ <adsCommand dataType="bit" bitLength="1">true</adsCommand>
+ <noReturn dataType="bit" bitLength="1">false</noReturn>
+ <response dataType="bit" bitLength="1">false</response>
+ <broadcast dataType="bit" bitLength="1">false</broadcast>
+ <reserved dataType="int" bitLength="7">0</reserved>
<length dataType="uint" bitLength="32">12</length>
<errorCode dataType="uint" bitLength="32">0</errorCode>
<invokeId dataType="uint" bitLength="32">1</invokeId>
- <data>
- <AdsData>
- <AdsReadRequest>
- <indexGroup dataType="uint" bitLength="32">61455</indexGroup>
- <indexOffset dataType="uint" bitLength="32">0</indexOffset>
- <length dataType="uint" bitLength="32">24</length>
- </AdsReadRequest>
- </AdsData>
- </data>
+ <AdsReadRequest>
+ <indexGroup dataType="uint" bitLength="32">61455</indexGroup>
+ <indexOffset dataType="uint" bitLength="32">0</indexOffset>
+ <length dataType="uint" bitLength="32">24</length>
+ </AdsReadRequest>
</AmsPacket>
</userdata>
</AmsTCPPacket>
@@ -512,20 +480,16 @@
<commandId>
<CommandId dataType="uint" bitLength="16" stringRepresentation="ADS_READ_WRITE">9</CommandId>
</commandId>
- <state>
- <State>
- <initCommand dataType="bit" bitLength="1">false</initCommand>
- <updCommand dataType="bit" bitLength="1">false</updCommand>
- <timestampAdded dataType="bit" bitLength="1">false</timestampAdded>
- <highPriorityCommand dataType="bit" bitLength="1">false</highPriorityCommand>
- <systemCommand dataType="bit" bitLength="1">false</systemCommand>
- <adsCommand dataType="bit" bitLength="1">true</adsCommand>
- <noReturn dataType="bit" bitLength="1">false</noReturn>
- <response dataType="bit" bitLength="1">true</response>
- <broadcast dataType="bit" bitLength="1">false</broadcast>
- <reserved dataType="int" bitLength="7">0</reserved>
- </State>
- </state>
+ <initCommand dataType="bit" bitLength="1">false</initCommand>
+ <updCommand dataType="bit" bitLength="1">false</updCommand>
+ <timestampAdded dataType="bit" bitLength="1">false</timestampAdded>
+ <highPriorityCommand dataType="bit" bitLength="1">false</highPriorityCommand>
+ <systemCommand dataType="bit" bitLength="1">false</systemCommand>
+ <adsCommand dataType="bit" bitLength="1">true</adsCommand>
+ <noReturn dataType="bit" bitLength="1">false</noReturn>
+ <response dataType="bit" bitLength="1">true</response>
+ <broadcast dataType="bit" bitLength="1">false</broadcast>
+ <reserved dataType="int" bitLength="7">0</reserved>
<length dataType="uint" bitLength="32">12</length>
<errorCode dataType="uint" bitLength="32">0</errorCode>
<invokeId dataType="uint" bitLength="32">1</invokeId>
@@ -575,20 +539,16 @@
<commandId>
<CommandId dataType="uint" bitLength="16" stringRepresentation="ADS_READ">2</CommandId>
</commandId>
- <state>
- <State>
- <initCommand dataType="bit" bitLength="1">false</initCommand>
- <updCommand dataType="bit" bitLength="1">false</updCommand>
- <timestampAdded dataType="bit" bitLength="1">false</timestampAdded>
- <highPriorityCommand dataType="bit" bitLength="1">false</highPriorityCommand>
- <systemCommand dataType="bit" bitLength="1">false</systemCommand>
- <adsCommand dataType="bit" bitLength="1">true</adsCommand>
- <noReturn dataType="bit" bitLength="1">false</noReturn>
- <response dataType="bit" bitLength="1">false</response>
- <broadcast dataType="bit" bitLength="1">false</broadcast>
- <reserved dataType="int" bitLength="7">0</reserved>
- </State>
- </state>
+ <initCommand dataType="bit" bitLength="1">false</initCommand>
+ <updCommand dataType="bit" bitLength="1">false</updCommand>
+ <timestampAdded dataType="bit" bitLength="1">false</timestampAdded>
+ <highPriorityCommand dataType="bit" bitLength="1">false</highPriorityCommand>
+ <systemCommand dataType="bit" bitLength="1">false</systemCommand>
+ <adsCommand dataType="bit" bitLength="1">true</adsCommand>
+ <noReturn dataType="bit" bitLength="1">false</noReturn>
+ <response dataType="bit" bitLength="1">false</response>
+ <broadcast dataType="bit" bitLength="1">false</broadcast>
+ <reserved dataType="int" bitLength="7">0</reserved>
<length dataType="uint" bitLength="32">12</length>
<errorCode dataType="uint" bitLength="32">0</errorCode>
<invokeId dataType="uint" bitLength="32">2</invokeId>
@@ -636,20 +596,16 @@
<commandId>
<CommandId dataType="uint" bitLength="16" stringRepresentation="ADS_READ">2</CommandId>
</commandId>
- <state>
- <State>
- <initCommand dataType="bit" bitLength="1">false</initCommand>
- <updCommand dataType="bit" bitLength="1">false</updCommand>
- <timestampAdded dataType="bit" bitLength="1">false</timestampAdded>
- <highPriorityCommand dataType="bit" bitLength="1">false</highPriorityCommand>
- <systemCommand dataType="bit" bitLength="1">false</systemCommand>
- <adsCommand dataType="bit" bitLength="1">true</adsCommand>
- <noReturn dataType="bit" bitLength="1">false</noReturn>
- <response dataType="bit" bitLength="1">true</response>
- <broadcast dataType="bit" bitLength="1">false</broadcast>
- <reserved dataType="int" bitLength="7">0</reserved>
- </State>
- </state>
+ <initCommand dataType="bit" bitLength="1">false</initCommand>
+ <updCommand dataType="bit" bitLength="1">false</updCommand>
+ <timestampAdded dataType="bit" bitLength="1">false</timestampAdded>
+ <highPriorityCommand dataType="bit" bitLength="1">false</highPriorityCommand>
+ <systemCommand dataType="bit" bitLength="1">false</systemCommand>
+ <adsCommand dataType="bit" bitLength="1">true</adsCommand>
+ <noReturn dataType="bit" bitLength="1">false</noReturn>
+ <response dataType="bit" bitLength="1">true</response>
+ <broadcast dataType="bit" bitLength="1">false</broadcast>
+ <reserved dataType="int" bitLength="7">0</reserved>
<length dataType="uint" bitLength="32">18</length>
<errorCode dataType="uint" bitLength="32">0</errorCode>
<invokeId dataType="uint" bitLength="32">2</invokeId>
@@ -743,32 +699,24 @@
<commandId>
<CommandId dataType="uint" bitLength="16" stringRepresentation="ADS_READ">2</CommandId>
</commandId>
- <state>
- <State>
- <initCommand dataType="bit" bitLength="1">false</initCommand>
- <updCommand dataType="bit" bitLength="1">false</updCommand>
- <timestampAdded dataType="bit" bitLength="1">false</timestampAdded>
- <highPriorityCommand dataType="bit" bitLength="1">false</highPriorityCommand>
- <systemCommand dataType="bit" bitLength="1">false</systemCommand>
- <adsCommand dataType="bit" bitLength="1">true</adsCommand>
- <noReturn dataType="bit" bitLength="1">false</noReturn>
- <response dataType="bit" bitLength="1">false</response>
- <broadcast dataType="bit" bitLength="1">false</broadcast>
- <reserved dataType="int" bitLength="7">0</reserved>
- </State>
- </state>
+ <initCommand dataType="bit" bitLength="1">false</initCommand>
+ <updCommand dataType="bit" bitLength="1">false</updCommand>
+ <timestampAdded dataType="bit" bitLength="1">false</timestampAdded>
+ <highPriorityCommand dataType="bit" bitLength="1">false</highPriorityCommand>
+ <systemCommand dataType="bit" bitLength="1">false</systemCommand>
+ <adsCommand dataType="bit" bitLength="1">true</adsCommand>
+ <noReturn dataType="bit" bitLength="1">false</noReturn>
+ <response dataType="bit" bitLength="1">false</response>
+ <broadcast dataType="bit" bitLength="1">false</broadcast>
+ <reserved dataType="int" bitLength="7">0</reserved>
<length dataType="uint" bitLength="32">12</length>
<errorCode dataType="uint" bitLength="32">0</errorCode>
<invokeId dataType="uint" bitLength="32">1</invokeId>
- <data>
- <AdsData>
- <AdsReadRequest>
- <indexGroup dataType="uint" bitLength="32">61455</indexGroup>
- <indexOffset dataType="uint" bitLength="32">0</indexOffset>
- <length dataType="uint" bitLength="32">24</length>
- </AdsReadRequest>
- </AdsData>
- </data>
+ <AdsReadRequest>
+ <indexGroup dataType="uint" bitLength="32">61455</indexGroup>
+ <indexOffset dataType="uint" bitLength="32">0</indexOffset>
+ <length dataType="uint" bitLength="32">24</length>
+ </AdsReadRequest>
</AmsPacket>
</userdata>
</AmsTCPPacket>
@@ -804,20 +752,16 @@
<commandId>
<CommandId dataType="uint" bitLength="16" stringRepresentation="ADS_READ_WRITE">9</CommandId>
</commandId>
- <state>
- <State>
- <initCommand dataType="bit" bitLength="1">false</initCommand>
- <updCommand dataType="bit" bitLength="1">false</updCommand>
- <timestampAdded dataType="bit" bitLength="1">false</timestampAdded>
- <highPriorityCommand dataType="bit" bitLength="1">false</highPriorityCommand>
- <systemCommand dataType="bit" bitLength="1">false</systemCommand>
- <adsCommand dataType="bit" bitLength="1">true</adsCommand>
- <noReturn dataType="bit" bitLength="1">false</noReturn>
- <response dataType="bit" bitLength="1">true</response>
- <broadcast dataType="bit" bitLength="1">false</broadcast>
- <reserved dataType="int" bitLength="7">0</reserved>
- </State>
- </state>
+ <initCommand dataType="bit" bitLength="1">false</initCommand>
+ <updCommand dataType="bit" bitLength="1">false</updCommand>
+ <timestampAdded dataType="bit" bitLength="1">false</timestampAdded>
+ <highPriorityCommand dataType="bit" bitLength="1">false</highPriorityCommand>
+ <systemCommand dataType="bit" bitLength="1">false</systemCommand>
+ <adsCommand dataType="bit" bitLength="1">true</adsCommand>
+ <noReturn dataType="bit" bitLength="1">false</noReturn>
+ <response dataType="bit" bitLength="1">true</response>
+ <broadcast dataType="bit" bitLength="1">false</broadcast>
+ <reserved dataType="int" bitLength="7">0</reserved>
<length dataType="uint" bitLength="32">12</length>
<errorCode dataType="uint" bitLength="32">0</errorCode>
<invokeId dataType="uint" bitLength="32">1</invokeId>
@@ -867,20 +811,16 @@
<commandId>
<CommandId dataType="uint" bitLength="16" stringRepresentation="ADS_READ">2</CommandId>
</commandId>
- <state>
- <State>
- <initCommand dataType="bit" bitLength="1">false</initCommand>
- <updCommand dataType="bit" bitLength="1">false</updCommand>
- <timestampAdded dataType="bit" bitLength="1">false</timestampAdded>
- <highPriorityCommand dataType="bit" bitLength="1">false</highPriorityCommand>
- <systemCommand dataType="bit" bitLength="1">false</systemCommand>
- <adsCommand dataType="bit" bitLength="1">true</adsCommand>
- <noReturn dataType="bit" bitLength="1">false</noReturn>
- <response dataType="bit" bitLength="1">false</response>
- <broadcast dataType="bit" bitLength="1">false</broadcast>
- <reserved dataType="int" bitLength="7">0</reserved>
- </State>
- </state>
+ <initCommand dataType="bit" bitLength="1">false</initCommand>
+ <updCommand dataType="bit" bitLength="1">false</updCommand>
+ <timestampAdded dataType="bit" bitLength="1">false</timestampAdded>
+ <highPriorityCommand dataType="bit" bitLength="1">false</highPriorityCommand>
+ <systemCommand dataType="bit" bitLength="1">false</systemCommand>
+ <adsCommand dataType="bit" bitLength="1">true</adsCommand>
+ <noReturn dataType="bit" bitLength="1">false</noReturn>
+ <response dataType="bit" bitLength="1">false</response>
+ <broadcast dataType="bit" bitLength="1">false</broadcast>
+ <reserved dataType="int" bitLength="7">0</reserved>
<length dataType="uint" bitLength="32">12</length>
<errorCode dataType="uint" bitLength="32">0</errorCode>
<invokeId dataType="uint" bitLength="32">2</invokeId>
@@ -929,20 +869,16 @@
<commandId>
<CommandId dataType="uint" bitLength="16" stringRepresentation="ADS_READ">2</CommandId>
</commandId>
- <state>
- <State>
- <initCommand dataType="bit" bitLength="1">false</initCommand>
- <updCommand dataType="bit" bitLength="1">false</updCommand>
- <timestampAdded dataType="bit" bitLength="1">false</timestampAdded>
- <highPriorityCommand dataType="bit" bitLength="1">false</highPriorityCommand>
- <systemCommand dataType="bit" bitLength="1">false</systemCommand>
- <adsCommand dataType="bit" bitLength="1">true</adsCommand>
- <noReturn dataType="bit" bitLength="1">false</noReturn>
- <response dataType="bit" bitLength="1">true</response>
- <broadcast dataType="bit" bitLength="1">false</broadcast>
- <reserved dataType="int" bitLength="7">0</reserved>
- </State>
- </state>
+ <initCommand dataType="bit" bitLength="1">false</initCommand>
+ <updCommand dataType="bit" bitLength="1">false</updCommand>
+ <timestampAdded dataType="bit" bitLength="1">false</timestampAdded>
+ <highPriorityCommand dataType="bit" bitLength="1">false</highPriorityCommand>
+ <systemCommand dataType="bit" bitLength="1">false</systemCommand>
+ <adsCommand dataType="bit" bitLength="1">true</adsCommand>
+ <noReturn dataType="bit" bitLength="1">false</noReturn>
+ <response dataType="bit" bitLength="1">true</response>
+ <broadcast dataType="bit" bitLength="1">false</broadcast>
+ <reserved dataType="int" bitLength="7">0</reserved>
<length dataType="uint" bitLength="32">18</length>
<errorCode dataType="uint" bitLength="32">0</errorCode>
<invokeId dataType="uint" bitLength="32">2</invokeId>
@@ -1027,20 +963,16 @@
<commandId>
<CommandId dataType="uint" bitLength="16" stringRepresentation="ADS_READ">2</CommandId>
</commandId>
- <state>
- <State>
- <initCommand dataType="bit" bitLength="1">false</initCommand>
- <updCommand dataType="bit" bitLength="1">false</updCommand>
- <timestampAdded dataType="bit" bitLength="1">false</timestampAdded>
- <highPriorityCommand dataType="bit" bitLength="1">false</highPriorityCommand>
- <systemCommand dataType="bit" bitLength="1">false</systemCommand>
- <adsCommand dataType="bit" bitLength="1">true</adsCommand>
- <noReturn dataType="bit" bitLength="1">false</noReturn>
- <response dataType="bit" bitLength="1">false</response>
- <broadcast dataType="bit" bitLength="1">false</broadcast>
- <reserved dataType="int" bitLength="7">0</reserved>
- </State>
- </state>
+ <initCommand dataType="bit" bitLength="1">false</initCommand>
+ <updCommand dataType="bit" bitLength="1">false</updCommand>
+ <timestampAdded dataType="bit" bitLength="1">false</timestampAdded>
+ <highPriorityCommand dataType="bit" bitLength="1">false</highPriorityCommand>
+ <systemCommand dataType="bit" bitLength="1">false</systemCommand>
+ <adsCommand dataType="bit" bitLength="1">true</adsCommand>
+ <noReturn dataType="bit" bitLength="1">false</noReturn>
+ <response dataType="bit" bitLength="1">false</response>
+ <broadcast dataType="bit" bitLength="1">false</broadcast>
+ <reserved dataType="int" bitLength="7">0</reserved>
<length dataType="uint" bitLength="32">12</length>
<errorCode dataType="uint" bitLength="32">0</errorCode>
<invokeId dataType="uint" bitLength="32">3</invokeId>
@@ -1088,20 +1020,16 @@
<commandId>
<CommandId dataType="uint" bitLength="16" stringRepresentation="ADS_READ">2</CommandId>
</commandId>
- <state>
- <State>
- <initCommand dataType="bit" bitLength="1">false</initCommand>
- <updCommand dataType="bit" bitLength="1">false</updCommand>
- <timestampAdded dataType="bit" bitLength="1">false</timestampAdded>
- <highPriorityCommand dataType="bit" bitLength="1">false</highPriorityCommand>
- <systemCommand dataType="bit" bitLength="1">false</systemCommand>
- <adsCommand dataType="bit" bitLength="1">true</adsCommand>
- <noReturn dataType="bit" bitLength="1">false</noReturn>
- <response dataType="bit" bitLength="1">true</response>
- <broadcast dataType="bit" bitLength="1">false</broadcast>
- <reserved dataType="int" bitLength="7">0</reserved>
- </State>
- </state>
+ <initCommand dataType="bit" bitLength="1">false</initCommand>
+ <updCommand dataType="bit" bitLength="1">false</updCommand>
+ <timestampAdded dataType="bit" bitLength="1">false</timestampAdded>
+ <highPriorityCommand dataType="bit" bitLength="1">false</highPriorityCommand>
+ <systemCommand dataType="bit" bitLength="1">false</systemCommand>
+ <adsCommand dataType="bit" bitLength="1">true</adsCommand>
+ <noReturn dataType="bit" bitLength="1">false</noReturn>
+ <response dataType="bit" bitLength="1">true</response>
+ <broadcast dataType="bit" bitLength="1">false</broadcast>
+ <reserved dataType="int" bitLength="7">0</reserved>
<length dataType="uint" bitLength="32">18</length>
<errorCode dataType="uint" bitLength="32">0</errorCode>
<invokeId dataType="uint" bitLength="32">3</invokeId>
diff --git a/protocols/ads/src/test/resources/protocols/ads/ParserSerializerTestsuite.xml b/protocols/ads/src/test/resources/protocols/ads/ParserSerializerTestsuite.xml
index 509f784d0..932762395 100644
--- a/protocols/ads/src/test/resources/protocols/ads/ParserSerializerTestsuite.xml
+++ b/protocols/ads/src/test/resources/protocols/ads/ParserSerializerTestsuite.xml
@@ -60,32 +60,24 @@
<commandId>
<CommandId dataType="uint" bitLength="16" stringRepresentation="ADS_READ">2</CommandId>
</commandId>
- <state>
- <State>
- <initCommand dataType="bit" bitLength="1">false</initCommand>
- <updCommand dataType="bit" bitLength="1">false</updCommand>
- <timestampAdded dataType="bit" bitLength="1">false</timestampAdded>
- <highPriorityCommand dataType="bit" bitLength="1">false</highPriorityCommand>
- <systemCommand dataType="bit" bitLength="1">false</systemCommand>
- <adsCommand dataType="bit" bitLength="1">true</adsCommand>
- <noReturn dataType="bit" bitLength="1">false</noReturn>
- <response dataType="bit" bitLength="1">false</response>
- <broadcast dataType="bit" bitLength="1">false</broadcast>
- <reserved dataType="int" bitLength="7">0</reserved>
- </State>
- </state>
+ <initCommand dataType="bit" bitLength="1">false</initCommand>
+ <updCommand dataType="bit" bitLength="1">false</updCommand>
+ <timestampAdded dataType="bit" bitLength="1">false</timestampAdded>
+ <highPriorityCommand dataType="bit" bitLength="1">false</highPriorityCommand>
+ <systemCommand dataType="bit" bitLength="1">false</systemCommand>
+ <adsCommand dataType="bit" bitLength="1">true</adsCommand>
+ <noReturn dataType="bit" bitLength="1">false</noReturn>
+ <response dataType="bit" bitLength="1">false</response>
+ <broadcast dataType="bit" bitLength="1">false</broadcast>
+ <reserved dataType="int" bitLength="7">0</reserved>
<length dataType="uint" bitLength="32">12</length>
<errorCode dataType="uint" bitLength="32">0</errorCode>
<invokeId dataType="uint" bitLength="32">2</invokeId>
- <data>
- <AdsData>
- <AdsReadRequest>
- <indexGroup dataType="uint" bitLength="32">61445</indexGroup>
- <indexOffset dataType="uint" bitLength="32">444596224</indexOffset>
- <length dataType="uint" bitLength="32">1</length>
- </AdsReadRequest>
- </AdsData>
- </data>
+ <AdsReadRequest>
+ <indexGroup dataType="uint" bitLength="32">61445</indexGroup>
+ <indexOffset dataType="uint" bitLength="32">444596224</indexOffset>
+ <length dataType="uint" bitLength="32">1</length>
+ </AdsReadRequest>
</AmsPacket>
</userdata>
</AmsTCPPacket>
@@ -127,34 +119,26 @@
<commandId>
<CommandId dataType="uint" bitLength="16" stringRepresentation="ADS_READ">2</CommandId>
</commandId>
- <state>
- <State>
- <initCommand dataType="bit" bitLength="1">false</initCommand>
- <updCommand dataType="bit" bitLength="1">false</updCommand>
- <timestampAdded dataType="bit" bitLength="1">false</timestampAdded>
- <highPriorityCommand dataType="bit" bitLength="1">false</highPriorityCommand>
- <systemCommand dataType="bit" bitLength="1">false</systemCommand>
- <adsCommand dataType="bit" bitLength="1">true</adsCommand>
- <noReturn dataType="bit" bitLength="1">false</noReturn>
- <response dataType="bit" bitLength="1">true</response>
- <broadcast dataType="bit" bitLength="1">false</broadcast>
- <reserved dataType="int" bitLength="7">0</reserved>
- </State>
- </state>
+ <initCommand dataType="bit" bitLength="1">false</initCommand>
+ <updCommand dataType="bit" bitLength="1">false</updCommand>
+ <timestampAdded dataType="bit" bitLength="1">false</timestampAdded>
+ <highPriorityCommand dataType="bit" bitLength="1">false</highPriorityCommand>
+ <systemCommand dataType="bit" bitLength="1">false</systemCommand>
+ <adsCommand dataType="bit" bitLength="1">true</adsCommand>
+ <noReturn dataType="bit" bitLength="1">false</noReturn>
+ <response dataType="bit" bitLength="1">true</response>
+ <broadcast dataType="bit" bitLength="1">false</broadcast>
+ <reserved dataType="int" bitLength="7">0</reserved>
<length dataType="uint" bitLength="32">9</length>
<errorCode dataType="uint" bitLength="32">0</errorCode>
<invokeId dataType="uint" bitLength="32">2</invokeId>
- <data>
- <AdsData>
- <AdsReadResponse>
- <result>
- <ReturnCode dataType="uint" bitLength="32" stringRepresentation="OK">0</ReturnCode>
- </result>
- <length dataType="uint" bitLength="32">1</length>
- <data dataType="byte" bitLength="8">0x01</data>
- </AdsReadResponse>
- </AdsData>
- </data>
+ <AdsReadResponse>
+ <result>
+ <ReturnCode dataType="uint" bitLength="32" stringRepresentation="OK">0</ReturnCode>
+ </result>
+ <length dataType="uint" bitLength="32">1</length>
+ <data dataType="byte" bitLength="8">0x01</data>
+ </AdsReadResponse>
</AmsPacket>
</userdata>
</AmsTCPPacket>
@@ -196,36 +180,28 @@
<commandId>
<CommandId dataType="uint" bitLength="16" stringRepresentation="ADS_READ_WRITE">9</CommandId>
</commandId>
- <state>
- <State>
- <initCommand dataType="bit" bitLength="1">false</initCommand>
- <updCommand dataType="bit" bitLength="1">false</updCommand>
- <timestampAdded dataType="bit" bitLength="1">false</timestampAdded>
- <highPriorityCommand dataType="bit" bitLength="1">false</highPriorityCommand>
- <systemCommand dataType="bit" bitLength="1">false</systemCommand>
- <adsCommand dataType="bit" bitLength="1">true</adsCommand>
- <noReturn dataType="bit" bitLength="1">false</noReturn>
- <response dataType="bit" bitLength="1">false</response>
- <broadcast dataType="bit" bitLength="1">false</broadcast>
- <reserved dataType="int" bitLength="7">0</reserved>
- </State>
- </state>
+ <initCommand dataType="bit" bitLength="1">false</initCommand>
+ <updCommand dataType="bit" bitLength="1">false</updCommand>
+ <timestampAdded dataType="bit" bitLength="1">false</timestampAdded>
+ <highPriorityCommand dataType="bit" bitLength="1">false</highPriorityCommand>
+ <systemCommand dataType="bit" bitLength="1">false</systemCommand>
+ <adsCommand dataType="bit" bitLength="1">true</adsCommand>
+ <noReturn dataType="bit" bitLength="1">false</noReturn>
+ <response dataType="bit" bitLength="1">false</response>
+ <broadcast dataType="bit" bitLength="1">false</broadcast>
+ <reserved dataType="int" bitLength="7">0</reserved>
<length dataType="uint" bitLength="32">42</length>
<errorCode dataType="uint" bitLength="32">0</errorCode>
<invokeId dataType="uint" bitLength="32">1</invokeId>
- <data>
- <AdsData>
- <AdsReadWriteRequest>
- <indexGroup dataType="uint" bitLength="32">61443</indexGroup>
- <indexOffset dataType="uint" bitLength="32">0</indexOffset>
- <readLength dataType="uint" bitLength="32">4</readLength>
- <writeLength dataType="uint" bitLength="32">26</writeLength>
- <items isList="true">
- </items>
- <data dataType="byte" bitLength="208">0x6d61696e2e665f74726967446174656947656c6573656e2e4d00</data>
- </AdsReadWriteRequest>
- </AdsData>
- </data>
+ <AdsReadWriteRequest>
+ <indexGroup dataType="uint" bitLength="32">61443</indexGroup>
+ <indexOffset dataType="uint" bitLength="32">0</indexOffset>
+ <readLength dataType="uint" bitLength="32">4</readLength>
+ <writeLength dataType="uint" bitLength="32">26</writeLength>
+ <items isList="true">
+ </items>
+ <data dataType="byte" bitLength="208">0x6d61696e2e665f74726967446174656947656c6573656e2e4d00</data>
+ </AdsReadWriteRequest>
</AmsPacket>
</userdata>
</AmsTCPPacket>
@@ -267,34 +243,26 @@
<commandId>
<CommandId dataType="uint" bitLength="16" stringRepresentation="ADS_READ_WRITE">9</CommandId>
</commandId>
- <state>
- <State>
- <initCommand dataType="bit" bitLength="1">false</initCommand>
- <updCommand dataType="bit" bitLength="1">false</updCommand>
- <timestampAdded dataType="bit" bitLength="1">false</timestampAdded>
- <highPriorityCommand dataType="bit" bitLength="1">false</highPriorityCommand>
- <systemCommand dataType="bit" bitLength="1">false</systemCommand>
- <adsCommand dataType="bit" bitLength="1">true</adsCommand>
- <noReturn dataType="bit" bitLength="1">false</noReturn>
- <response dataType="bit" bitLength="1">true</response>
- <broadcast dataType="bit" bitLength="1">false</broadcast>
- <reserved dataType="int" bitLength="7">0</reserved>
- </State>
- </state>
+ <initCommand dataType="bit" bitLength="1">false</initCommand>
+ <updCommand dataType="bit" bitLength="1">false</updCommand>
+ <timestampAdded dataType="bit" bitLength="1">false</timestampAdded>
+ <highPriorityCommand dataType="bit" bitLength="1">false</highPriorityCommand>
+ <systemCommand dataType="bit" bitLength="1">false</systemCommand>
+ <adsCommand dataType="bit" bitLength="1">true</adsCommand>
+ <noReturn dataType="bit" bitLength="1">false</noReturn>
+ <response dataType="bit" bitLength="1">true</response>
+ <broadcast dataType="bit" bitLength="1">false</broadcast>
+ <reserved dataType="int" bitLength="7">0</reserved>
<length dataType="uint" bitLength="32">12</length>
<errorCode dataType="uint" bitLength="32">0</errorCode>
<invokeId dataType="uint" bitLength="32">1</invokeId>
- <data>
- <AdsData>
- <AdsReadWriteResponse>
- <result>
- <ReturnCode dataType="uint" bitLength="32" stringRepresentation="OK">0</ReturnCode>
- </result>
- <length dataType="uint" bitLength="32">4</length>
- <data dataType="byte" bitLength="32">0x0100801b</data>
- </AdsReadWriteResponse>
- </AdsData>
- </data>
+ <AdsReadWriteResponse>
+ <result>
+ <ReturnCode dataType="uint" bitLength="32" stringRepresentation="OK">0</ReturnCode>
+ </result>
+ <length dataType="uint" bitLength="32">4</length>
+ <data dataType="byte" bitLength="32">0x0100801b</data>
+ </AdsReadWriteResponse>
</AmsPacket>
</userdata>
</AmsTCPPacket>
@@ -336,32 +304,24 @@
<commandId>
<CommandId dataType="uint" bitLength="16" stringRepresentation="ADS_READ">2</CommandId>
</commandId>
- <state>
- <State>
- <initCommand dataType="bit" bitLength="1">false</initCommand>
- <updCommand dataType="bit" bitLength="1">false</updCommand>
- <timestampAdded dataType="bit" bitLength="1">false</timestampAdded>
- <highPriorityCommand dataType="bit" bitLength="1">false</highPriorityCommand>
- <systemCommand dataType="bit" bitLength="1">false</systemCommand>
- <adsCommand dataType="bit" bitLength="1">true</adsCommand>
- <noReturn dataType="bit" bitLength="1">false</noReturn>
- <response dataType="bit" bitLength="1">false</response>
- <broadcast dataType="bit" bitLength="1">false</broadcast>
- <reserved dataType="int" bitLength="7">0</reserved>
- </State>
- </state>
+ <initCommand dataType="bit" bitLength="1">false</initCommand>
+ <updCommand dataType="bit" bitLength="1">false</updCommand>
+ <timestampAdded dataType="bit" bitLength="1">false</timestampAdded>
+ <highPriorityCommand dataType="bit" bitLength="1">false</highPriorityCommand>
+ <systemCommand dataType="bit" bitLength="1">false</systemCommand>
+ <adsCommand dataType="bit" bitLength="1">true</adsCommand>
+ <noReturn dataType="bit" bitLength="1">false</noReturn>
+ <response dataType="bit" bitLength="1">false</response>
+ <broadcast dataType="bit" bitLength="1">false</broadcast>
+ <reserved dataType="int" bitLength="7">0</reserved>
<length dataType="uint" bitLength="32">12</length>
<errorCode dataType="uint" bitLength="32">0</errorCode>
<invokeId dataType="uint" bitLength="32">1</invokeId>
- <data>
- <AdsData>
- <AdsReadRequest>
- <indexGroup dataType="uint" bitLength="32">61445</indexGroup>
- <indexOffset dataType="uint" bitLength="32">461373441</indexOffset>
- <length dataType="uint" bitLength="32">4</length>
- </AdsReadRequest>
- </AdsData>
- </data>
+ <AdsReadRequest>
+ <indexGroup dataType="uint" bitLength="32">61445</indexGroup>
+ <indexOffset dataType="uint" bitLength="32">461373441</indexOffset>
+ <length dataType="uint" bitLength="32">4</length>
+ </AdsReadRequest>
</AmsPacket>
</userdata>
</AmsTCPPacket>
@@ -403,34 +363,26 @@
<commandId>
<CommandId dataType="uint" bitLength="16" stringRepresentation="ADS_READ">2</CommandId>
</commandId>
- <state>
- <State>
- <initCommand dataType="bit" bitLength="1">false</initCommand>
- <updCommand dataType="bit" bitLength="1">false</updCommand>
- <timestampAdded dataType="bit" bitLength="1">false</timestampAdded>
- <highPriorityCommand dataType="bit" bitLength="1">false</highPriorityCommand>
- <systemCommand dataType="bit" bitLength="1">false</systemCommand>
- <adsCommand dataType="bit" bitLength="1">true</adsCommand>
- <noReturn dataType="bit" bitLength="1">false</noReturn>
- <response dataType="bit" bitLength="1">true</response>
- <broadcast dataType="bit" bitLength="1">false</broadcast>
- <reserved dataType="int" bitLength="7">0</reserved>
- </State>
- </state>
+ <initCommand dataType="bit" bitLength="1">false</initCommand>
+ <updCommand dataType="bit" bitLength="1">false</updCommand>
+ <timestampAdded dataType="bit" bitLength="1">false</timestampAdded>
+ <highPriorityCommand dataType="bit" bitLength="1">false</highPriorityCommand>
+ <systemCommand dataType="bit" bitLength="1">false</systemCommand>
+ <adsCommand dataType="bit" bitLength="1">true</adsCommand>
+ <noReturn dataType="bit" bitLength="1">false</noReturn>
+ <response dataType="bit" bitLength="1">true</response>
+ <broadcast dataType="bit" bitLength="1">false</broadcast>
+ <reserved dataType="int" bitLength="7">0</reserved>
<length dataType="uint" bitLength="32">9</length>
<errorCode dataType="uint" bitLength="32">0</errorCode>
<invokeId dataType="uint" bitLength="32">1</invokeId>
- <data>
- <AdsData>
- <AdsReadResponse>
- <result>
- <ReturnCode dataType="uint" bitLength="32" stringRepresentation="OK">0</ReturnCode>
- </result>
- <length dataType="uint" bitLength="32">1</length>
- <data dataType="byte" bitLength="8">0x01</data>
- </AdsReadResponse>
- </AdsData>
- </data>
+ <AdsReadResponse>
+ <result>
+ <ReturnCode dataType="uint" bitLength="32" stringRepresentation="OK">0</ReturnCode>
+ </result>
+ <length dataType="uint" bitLength="32">1</length>
+ <data dataType="byte" bitLength="8">0x01</data>
+ </AdsReadResponse>
</AmsPacket>
</userdata>
</AmsTCPPacket>
@@ -472,33 +424,25 @@
<commandId>
<CommandId dataType="uint" bitLength="16" stringRepresentation="ADS_WRITE">3</CommandId>
</commandId>
- <state>
- <State>
- <initCommand dataType="bit" bitLength="1">false</initCommand>
- <updCommand dataType="bit" bitLength="1">false</updCommand>
- <timestampAdded dataType="bit" bitLength="1">false</timestampAdded>
- <highPriorityCommand dataType="bit" bitLength="1">false</highPriorityCommand>
- <systemCommand dataType="bit" bitLength="1">false</systemCommand>
- <adsCommand dataType="bit" bitLength="1">true</adsCommand>
- <noReturn dataType="bit" bitLength="1">false</noReturn>
- <response dataType="bit" bitLength="1">false</response>
- <broadcast dataType="bit" bitLength="1">false</broadcast>
- <reserved dataType="int" bitLength="7">0</reserved>
- </State>
- </state>
+ <initCommand dataType="bit" bitLength="1">false</initCommand>
+ <updCommand dataType="bit" bitLength="1">false</updCommand>
+ <timestampAdded dataType="bit" bitLength="1">false</timestampAdded>
+ <highPriorityCommand dataType="bit" bitLength="1">false</highPriorityCommand>
+ <systemCommand dataType="bit" bitLength="1">false</systemCommand>
+ <adsCommand dataType="bit" bitLength="1">true</adsCommand>
+ <noReturn dataType="bit" bitLength="1">false</noReturn>
+ <response dataType="bit" bitLength="1">false</response>
+ <broadcast dataType="bit" bitLength="1">false</broadcast>
+ <reserved dataType="int" bitLength="7">0</reserved>
<length dataType="uint" bitLength="32">16</length>
<errorCode dataType="uint" bitLength="32">0</errorCode>
<invokeId dataType="uint" bitLength="32">1</invokeId>
- <data>
- <AdsData>
- <AdsWriteRequest>
- <indexGroup dataType="uint" bitLength="32">61446</indexGroup>
- <indexOffset dataType="uint" bitLength="32">0</indexOffset>
- <length dataType="uint" bitLength="32">4</length>
- <data dataType="byte" bitLength="32">0x0100801b</data>
- </AdsWriteRequest>
- </AdsData>
- </data>
+ <AdsWriteRequest>
+ <indexGroup dataType="uint" bitLength="32">61446</indexGroup>
+ <indexOffset dataType="uint" bitLength="32">0</indexOffset>
+ <length dataType="uint" bitLength="32">4</length>
+ <data dataType="byte" bitLength="32">0x0100801b</data>
+ </AdsWriteRequest>
</AmsPacket>
</userdata>
</AmsTCPPacket>
@@ -540,32 +484,24 @@
<commandId>
<CommandId dataType="uint" bitLength="16" stringRepresentation="ADS_WRITE">3</CommandId>
</commandId>
- <state>
- <State>
- <initCommand dataType="bit" bitLength="1">false</initCommand>
- <updCommand dataType="bit" bitLength="1">false</updCommand>
- <timestampAdded dataType="bit" bitLength="1">false</timestampAdded>
- <highPriorityCommand dataType="bit" bitLength="1">false</highPriorityCommand>
- <systemCommand dataType="bit" bitLength="1">false</systemCommand>
- <adsCommand dataType="bit" bitLength="1">true</adsCommand>
- <noReturn dataType="bit" bitLength="1">false</noReturn>
- <response dataType="bit" bitLength="1">true</response>
- <broadcast dataType="bit" bitLength="1">false</broadcast>
- <reserved dataType="int" bitLength="7">0</reserved>
- </State>
- </state>
+ <initCommand dataType="bit" bitLength="1">false</initCommand>
+ <updCommand dataType="bit" bitLength="1">false</updCommand>
+ <timestampAdded dataType="bit" bitLength="1">false</timestampAdded>
+ <highPriorityCommand dataType="bit" bitLength="1">false</highPriorityCommand>
+ <systemCommand dataType="bit" bitLength="1">false</systemCommand>
+ <adsCommand dataType="bit" bitLength="1">true</adsCommand>
+ <noReturn dataType="bit" bitLength="1">false</noReturn>
+ <response dataType="bit" bitLength="1">true</response>
+ <broadcast dataType="bit" bitLength="1">false</broadcast>
+ <reserved dataType="int" bitLength="7">0</reserved>
<length dataType="uint" bitLength="32">4</length>
<errorCode dataType="uint" bitLength="32">0</errorCode>
<invokeId dataType="uint" bitLength="32">1</invokeId>
- <data>
- <AdsData>
- <AdsWriteResponse>
- <result>
- <ReturnCode dataType="uint" bitLength="32" stringRepresentation="OK">0</ReturnCode>
- </result>
- </AdsWriteResponse>
- </AdsData>
- </data>
+ <AdsWriteResponse>
+ <result>
+ <ReturnCode dataType="uint" bitLength="32" stringRepresentation="OK">0</ReturnCode>
+ </result>
+ </AdsWriteResponse>
</AmsPacket>
</userdata>
</AmsTCPPacket>
diff --git a/protocols/plc4x/src/main/java/org/apache/plc4x/protocol/plc4x/v0/Plc4xProtocol.java b/protocols/plc4x/src/main/java/org/apache/plc4x/protocol/plc4x/v0/Plc4xProtocol.java
index 06722dda5..ba05c6722 100644
--- a/protocols/plc4x/src/main/java/org/apache/plc4x/protocol/plc4x/v0/Plc4xProtocol.java
+++ b/protocols/plc4x/src/main/java/org/apache/plc4x/protocol/plc4x/v0/Plc4xProtocol.java
@@ -24,11 +24,15 @@ 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;
import java.util.Optional;
public class Plc4xProtocol implements Protocol, ProtocolHelpers {
+ private static final Logger LOGGER = LoggerFactory.getLogger(Plc4xProtocol.class);
+
@Override
public String getName() {
return "plc4x";
@@ -41,7 +45,14 @@ public class Plc4xProtocol implements Protocol, ProtocolHelpers {
@Override
public TypeContext getTypeContext() throws GenerationException {
- ValidatableTypeContext typeContext = new MessageFormatParser().parse(getMspecStream());
+ ValidatableTypeContext typeContext;
+
+ LOGGER.info("Parsing: plc4x.mspec");
+ typeContext = new MessageFormatParser().parse(getMspecStream());
+
+ LOGGER.info("Parsing: plc4x-api.mspec");
+ typeContext = new MessageFormatParser().parse(getMspecStream("plc4x-api"), typeContext);
+
typeContext.validate();
return typeContext;
}
diff --git a/protocols/plc4x/src/main/resources/protocols/plc4x/v0/plc4x-api.mspec b/protocols/plc4x/src/main/resources/protocols/plc4x/v0/plc4x-api.mspec
new file mode 100644
index 000000000..c8fa750c3
--- /dev/null
+++ b/protocols/plc4x/src/main/resources/protocols/plc4x/v0/plc4x-api.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.
+ */
+
+[enum uint 8 Plc4xRequestType
+ ['0x01' CONNECT_REQUEST ]
+ ['0x02' CONNECT_RESPONSE ]
+ ['0x03' DISCONNECT_REQUEST ]
+ ['0x04' DISCONNECT_RESPONSE ]
+ ['0x05' READ_REQUEST ]
+ ['0x06' READ_RESPONSE ]
+ ['0x07' WRITE_REQUEST ]
+ ['0x08' WRITE_RESPONSE ]
+ ['0x09' SUBSCRIPTION_REQUEST ]
+ ['0x0A' SUBSCRIPTION_RESPONSE ]
+ ['0x0B' UNSUBSCRIPTION_REQUEST ]
+ ['0x0C' UNSUBSCRIPTION_RESPONSE]
+]
+
+[enum uint 8 Plc4xReturnCode
+ ['0x01' OK ]
+ ['0x02' NOT_FOUND ]
+ ['0x03' ACCESS_DENIED ]
+ ['0x04' INVALID_ADDRESS ]
+ ['0x05' INVALID_DATATYPE]
+ ['0x06' INVALID_DATA ]
+ ['0x07' INTERNAL_ERROR ]
+ ['0x08' REMOTE_BUSY ]
+ ['0x09' REMOTE_ERROR ]
+ ['0x0A' UNSUPPORTED ]
+ ['0x0B' RESPONSE_PENDING]
+]
+
+[enum uint 8 Plc4xValueType
+ ['0x00' NULL ]
+
+ // Bit Strings
+ ['0x01' BOOL ]
+ ['0x02' BYTE ]
+ ['0x03' WORD ]
+ ['0x04' DWORD ]
+ ['0x05' LWORD ]
+
+ // Unsigned Integers
+ ['0x11' USINT ]
+ ['0x12' UINT ]
+ ['0x13' UDINT ]
+ ['0x14' ULINT ]
+
+ // Signed Integers
+ ['0x21' SINT ]
+ ['0x22' INT ]
+ ['0x23' DINT ]
+ ['0x24' LINT ]
+
+ // Floating Point Values
+ ['0x31' REAL ]
+ ['0x32' LREAL ]
+
+ // Chars and Strings
+ ['0x41' CHAR ]
+ ['0x42' WCHAR ]
+ ['0x43' STRING ]
+ ['0x44' WSTRING ]
+
+ // Times and Dates
+ ['0x51' TIME ]
+ ['0x52' TIME_OF_DAY ]
+ ['0x53' DATE ]
+ ['0x54' DATE_AND_TIME]
+
+ // Complex types
+ ['0x61' Struct ]
+ ['0x62' List ]
+]
+
+[enum uint 8 Plc4xResponseCode
+ ['0x01' OK ]
+ ['0x02' NOT_FOUND ]
+ ['0x03' ACCESS_DENIED ]
+ ['0x04' INVALID_ADDRESS ]
+ ['0x06' INVALID_DATATYPE]
+ ['0x07' INVALID_DATA ]
+ ['0x08' INTERNAL_ERROR ]
+ ['0x09' REMOTE_BUSY ]
+ ['0x0A' REMOTE_ERROR ]
+ ['0x0B' UNSUPPORTED ]
+ ['0x0C' RESPONSE_PENDING]
+]
+
+[enum uint 8 Plc4xSubscriptionType
+ ['0x01' CYCLIC ]
+ ['0x02' CHANGE_OF_STATE]
+ ['0x03' EVENT ]
+]
\ No newline at end of file
diff --git a/protocols/plc4x/src/main/resources/protocols/plc4x/v0/plc4x.mspec b/protocols/plc4x/src/main/resources/protocols/plc4x/v0/plc4x.mspec
index be728beb1..a6c52f778 100644
--- a/protocols/plc4x/src/main/resources/protocols/plc4x/v0/plc4x.mspec
+++ b/protocols/plc4x/src/main/resources/protocols/plc4x/v0/plc4x.mspec
@@ -194,90 +194,4 @@
['Struct' Struct ]
['List' List ]
]
-]
-
-[enum uint 8 Plc4xRequestType
- ['0x01' CONNECT_REQUEST ]
- ['0x02' CONNECT_RESPONSE ]
- ['0x03' DISCONNECT_REQUEST ]
- ['0x04' DISCONNECT_RESPONSE ]
- ['0x05' READ_REQUEST ]
- ['0x06' READ_RESPONSE ]
- ['0x07' WRITE_REQUEST ]
- ['0x08' WRITE_RESPONSE ]
- ['0x09' SUBSCRIPTION_REQUEST ]
- ['0x0A' SUBSCRIPTION_RESPONSE ]
- ['0x0B' UNSUBSCRIPTION_REQUEST ]
- ['0x0C' UNSUBSCRIPTION_RESPONSE]
-]
-
-[enum uint 8 Plc4xReturnCode
- ['0x01' OK ]
- ['0x02' NOT_FOUND ]
- ['0x03' ACCESS_DENIED ]
- ['0x04' INVALID_ADDRESS ]
- ['0x05' INVALID_DATATYPE]
- ['0x06' INVALID_DATA ]
- ['0x07' INTERNAL_ERROR ]
- ['0x08' REMOTE_BUSY ]
- ['0x09' REMOTE_ERROR ]
- ['0x0A' UNSUPPORTED ]
- ['0x0B' RESPONSE_PENDING]
-]
-
-[enum uint 8 Plc4xValueType
- ['0x00' NULL ]
-
- // Bit Strings
- ['0x01' BOOL ]
- ['0x02' BYTE ]
- ['0x03' WORD ]
- ['0x04' DWORD ]
- ['0x05' LWORD ]
-
- // Unsigned Integers
- ['0x11' USINT ]
- ['0x12' UINT ]
- ['0x13' UDINT ]
- ['0x14' ULINT ]
-
- // Signed Integers
- ['0x21' SINT ]
- ['0x22' INT ]
- ['0x23' DINT ]
- ['0x24' LINT ]
-
- // Floating Point Values
- ['0x31' REAL ]
- ['0x32' LREAL ]
-
- // Chars and Strings
- ['0x41' CHAR ]
- ['0x42' WCHAR ]
- ['0x43' STRING ]
- ['0x44' WSTRING ]
-
- // Times and Dates
- ['0x51' TIME ]
- ['0x52' TIME_OF_DAY ]
- ['0x53' DATE ]
- ['0x54' DATE_AND_TIME]
-
- // Complex types
- ['0x61' Struct ]
- ['0x62' List ]
-]
-
-[enum uint 8 Plc4xResponseCode
- ['0x01' OK ]
- ['0x02' NOT_FOUND ]
- ['0x03' ACCESS_DENIED ]
- ['0x04' INVALID_ADDRESS ]
- ['0x06' INVALID_DATATYPE]
- ['0x07' INVALID_DATA ]
- ['0x08' INTERNAL_ERROR ]
- ['0x09' REMOTE_BUSY ]
- ['0x0A' REMOTE_ERROR ]
- ['0x0B' UNSUPPORTED ]
- ['0x0C' RESPONSE_PENDING]
]
\ No newline at end of file