From 8ff711c79c5e2a5081c00ff90fcbb85c8cb15c00 Mon Sep 17 00:00:00 2001 From: Christofer Dutz Date: Wed, 25 Oct 2023 10:52:30 +0200 Subject: [PATCH] fix: Moved the declaration of the dependencies needed by the code generation into the code-generation profile. --- plc4c/pom.xml | 65 ++- plc4go/pom.xml | 191 ++++--- plc4j/drivers/ab-eth/pom.xml | 33 +- plc4j/drivers/ads/pom.xml | 32 +- plc4j/drivers/bacnet/pom.xml | 33 +- plc4j/drivers/c-bus/pom.xml | 41 +- plc4j/drivers/can/pom.xml | 29 +- plc4j/drivers/canopen/pom.xml | 32 +- plc4j/drivers/eip/pom.xml | 33 +- plc4j/drivers/firmata/pom.xml | 32 +- plc4j/drivers/iec-60870/pom.xml | 33 +- plc4j/drivers/knxnetip/pom.xml | 33 +- plc4j/drivers/modbus/pom.xml | 33 +- plc4j/drivers/opcua/pom.xml | 34 +- plc4j/drivers/open-protocol/pom.xml | 33 +- plc4j/drivers/plc4x/pom.xml | 33 +- plc4j/drivers/profinet-ng/pom.xml | 33 +- plc4j/drivers/profinet/pom.xml | 33 +- plc4j/drivers/s7/pom.xml | 83 ++-- plc4j/drivers/simulated/pom.xml | 46 +- plc4j/tools/plc4x-server/pom.xml | 46 -- .../plc4x/readwrite/Plc4xConnectRequest.java | 166 ------- .../plc4x/readwrite/Plc4xConnectResponse.java | 181 ------- .../java/plc4x/readwrite/Plc4xConstants.java | 130 ----- .../java/plc4x/readwrite/Plc4xMessage.java | 234 --------- .../plc4x/readwrite/Plc4xReadRequest.java | 197 -------- .../plc4x/readwrite/Plc4xReadResponse.java | 234 --------- .../plc4x/readwrite/Plc4xRequestType.java | 65 --- .../plc4x/readwrite/Plc4xResponseCode.java | 64 --- .../readwrite/Plc4xSubscriptionType.java | 56 --- .../plc4x/java/plc4x/readwrite/Plc4xTag.java | 160 ------ .../java/plc4x/readwrite/Plc4xTagRequest.java | 130 ----- .../plc4x/readwrite/Plc4xTagResponse.java | 156 ------ .../plc4x/readwrite/Plc4xTagValueRequest.java | 183 ------- .../readwrite/Plc4xTagValueResponse.java | 211 -------- .../java/plc4x/readwrite/Plc4xValue.java | 467 ------------------ .../java/plc4x/readwrite/Plc4xValueType.java | 84 ---- .../plc4x/readwrite/Plc4xWriteRequest.java | 197 -------- .../plc4x/readwrite/Plc4xWriteResponse.java | 234 --------- plc4j/transports/socketcan/pom.xml | 29 +- plc4net/pom.xml | 36 +- pom.xml | 12 + sandbox/plc4py/pom.xml | 53 +- sandbox/test-java-df1-driver/pom.xml | 77 ++- 44 files changed, 587 insertions(+), 3730 deletions(-) delete mode 100644 plc4j/tools/plc4x-server/src/main/generated/org/apache/plc4x/java/plc4x/readwrite/Plc4xConnectRequest.java delete mode 100644 plc4j/tools/plc4x-server/src/main/generated/org/apache/plc4x/java/plc4x/readwrite/Plc4xConnectResponse.java delete mode 100644 plc4j/tools/plc4x-server/src/main/generated/org/apache/plc4x/java/plc4x/readwrite/Plc4xConstants.java delete mode 100644 plc4j/tools/plc4x-server/src/main/generated/org/apache/plc4x/java/plc4x/readwrite/Plc4xMessage.java delete mode 100644 plc4j/tools/plc4x-server/src/main/generated/org/apache/plc4x/java/plc4x/readwrite/Plc4xReadRequest.java delete mode 100644 plc4j/tools/plc4x-server/src/main/generated/org/apache/plc4x/java/plc4x/readwrite/Plc4xReadResponse.java delete mode 100644 plc4j/tools/plc4x-server/src/main/generated/org/apache/plc4x/java/plc4x/readwrite/Plc4xRequestType.java delete mode 100644 plc4j/tools/plc4x-server/src/main/generated/org/apache/plc4x/java/plc4x/readwrite/Plc4xResponseCode.java delete mode 100644 plc4j/tools/plc4x-server/src/main/generated/org/apache/plc4x/java/plc4x/readwrite/Plc4xSubscriptionType.java delete mode 100644 plc4j/tools/plc4x-server/src/main/generated/org/apache/plc4x/java/plc4x/readwrite/Plc4xTag.java delete mode 100644 plc4j/tools/plc4x-server/src/main/generated/org/apache/plc4x/java/plc4x/readwrite/Plc4xTagRequest.java delete mode 100644 plc4j/tools/plc4x-server/src/main/generated/org/apache/plc4x/java/plc4x/readwrite/Plc4xTagResponse.java delete mode 100644 plc4j/tools/plc4x-server/src/main/generated/org/apache/plc4x/java/plc4x/readwrite/Plc4xTagValueRequest.java delete mode 100644 plc4j/tools/plc4x-server/src/main/generated/org/apache/plc4x/java/plc4x/readwrite/Plc4xTagValueResponse.java delete mode 100644 plc4j/tools/plc4x-server/src/main/generated/org/apache/plc4x/java/plc4x/readwrite/Plc4xValue.java delete mode 100644 plc4j/tools/plc4x-server/src/main/generated/org/apache/plc4x/java/plc4x/readwrite/Plc4xValueType.java delete mode 100644 plc4j/tools/plc4x-server/src/main/generated/org/apache/plc4x/java/plc4x/readwrite/Plc4xWriteRequest.java delete mode 100644 plc4j/tools/plc4x-server/src/main/generated/org/apache/plc4x/java/plc4x/readwrite/Plc4xWriteResponse.java diff --git a/plc4c/pom.xml b/plc4c/pom.xml index cb725c77ff7..63472c81e9e 100644 --- a/plc4c/pom.xml +++ b/plc4c/pom.xml @@ -270,39 +270,6 @@ - - - - org.apache.plc4x - plc4x-code-generation-language-c - 0.12.0-SNAPSHOT - - provided - - - - org.apache.plc4x - plc4x-protocols-modbus - 0.12.0-SNAPSHOT - - provided - - - org.apache.plc4x - plc4x-protocols-plc4x - 0.12.0-SNAPSHOT - - provided - - - org.apache.plc4x - plc4x-protocols-s7 - 0.12.0-SNAPSHOT - - provided - - - update-generated-code @@ -416,6 +383,38 @@ + + + + org.apache.plc4x + plc4x-code-generation-language-c + 0.12.0-SNAPSHOT + + provided + + + + org.apache.plc4x + plc4x-protocols-modbus + 0.12.0-SNAPSHOT + + provided + + + org.apache.plc4x + plc4x-protocols-plc4x + 0.12.0-SNAPSHOT + + provided + + + org.apache.plc4x + plc4x-protocols-s7 + 0.12.0-SNAPSHOT + + provided + + diff --git a/plc4go/pom.xml b/plc4go/pom.xml index 3ca00ae4fb6..63605020ffa 100644 --- a/plc4go/pom.xml +++ b/plc4go/pom.xml @@ -439,102 +439,6 @@ - - - - org.apache.plc4x - plc4x-code-generation-language-go - 0.12.0-SNAPSHOT - - provided - - - - org.apache.plc4x - plc4x-protocols-ab-eth - 0.12.0-SNAPSHOT - - provided - - - org.apache.plc4x - plc4x-protocols-ads - 0.12.0-SNAPSHOT - - provided - - - org.apache.plc4x - plc4x-protocols-bacnetip - 0.12.0-SNAPSHOT - - provided - - - org.apache.plc4x - plc4x-protocols-c-bus - 0.12.0-SNAPSHOT - - provided - - - org.apache.plc4x - plc4x-protocols-df1 - 0.12.0-SNAPSHOT - - provided - - - org.apache.plc4x - plc4x-protocols-eip - 0.12.0-SNAPSHOT - - provided - - - org.apache.plc4x - plc4x-protocols-firmata - 0.12.0-SNAPSHOT - - provided - - - org.apache.plc4x - plc4x-protocols-knxnetip - 0.12.0-SNAPSHOT - - provided - - - org.apache.plc4x - plc4x-protocols-modbus - 0.12.0-SNAPSHOT - - provided - - - org.apache.plc4x - plc4x-protocols-opcua - 0.12.0-SNAPSHOT - - provided - - - org.apache.plc4x - plc4x-protocols-s7 - 0.12.0-SNAPSHOT - - provided - - - org.apache.plc4x - plc4x-protocols-simulated - 0.12.0-SNAPSHOT - - provided - - - os-windows @@ -736,6 +640,101 @@ + + + + org.apache.plc4x + plc4x-code-generation-language-go + 0.12.0-SNAPSHOT + + provided + + + + org.apache.plc4x + plc4x-protocols-ab-eth + 0.12.0-SNAPSHOT + + provided + + + org.apache.plc4x + plc4x-protocols-ads + 0.12.0-SNAPSHOT + + provided + + + org.apache.plc4x + plc4x-protocols-bacnetip + 0.12.0-SNAPSHOT + + provided + + + org.apache.plc4x + plc4x-protocols-c-bus + 0.12.0-SNAPSHOT + + provided + + + org.apache.plc4x + plc4x-protocols-df1 + 0.12.0-SNAPSHOT + + provided + + + org.apache.plc4x + plc4x-protocols-eip + 0.12.0-SNAPSHOT + + provided + + + org.apache.plc4x + plc4x-protocols-firmata + 0.12.0-SNAPSHOT + + provided + + + org.apache.plc4x + plc4x-protocols-knxnetip + 0.12.0-SNAPSHOT + + provided + + + org.apache.plc4x + plc4x-protocols-modbus + 0.12.0-SNAPSHOT + + provided + + + org.apache.plc4x + plc4x-protocols-opcua + 0.12.0-SNAPSHOT + + provided + + + org.apache.plc4x + plc4x-protocols-s7 + 0.12.0-SNAPSHOT + + provided + + + org.apache.plc4x + plc4x-protocols-simulated + 0.12.0-SNAPSHOT + + provided + + diff --git a/plc4j/drivers/ab-eth/pom.xml b/plc4j/drivers/ab-eth/pom.xml index 1b97773cfae..b93ea18aa0a 100644 --- a/plc4j/drivers/ab-eth/pom.xml +++ b/plc4j/drivers/ab-eth/pom.xml @@ -125,21 +125,6 @@ test - - org.apache.plc4x - plc4x-code-generation-language-java - 0.12.0-SNAPSHOT - - provided - - - - org.apache.plc4x - plc4x-protocols-ab-eth - 0.12.0-SNAPSHOT - - provided - org.apache.plc4x plc4x-protocols-ab-eth @@ -176,6 +161,24 @@ + + + + org.apache.plc4x + plc4x-code-generation-language-java + 0.12.0-SNAPSHOT + + provided + + + + org.apache.plc4x + plc4x-protocols-ab-eth + 0.12.0-SNAPSHOT + + provided + + diff --git a/plc4j/drivers/ads/pom.xml b/plc4j/drivers/ads/pom.xml index 3a7f74cee50..c7aa4bc086b 100644 --- a/plc4j/drivers/ads/pom.xml +++ b/plc4j/drivers/ads/pom.xml @@ -149,20 +149,6 @@ test - - org.apache.plc4x - plc4x-protocols-ads - 0.12.0-SNAPSHOT - - provided - - - org.apache.plc4x - plc4x-code-generation-language-java - 0.12.0-SNAPSHOT - - provided - org.apache.plc4x plc4x-protocols-ads @@ -212,6 +198,24 @@ + + + + org.apache.plc4x + plc4x-protocols-ads + 0.12.0-SNAPSHOT + + provided + + + + org.apache.plc4x + plc4x-code-generation-language-java + 0.12.0-SNAPSHOT + + provided + + diff --git a/plc4j/drivers/bacnet/pom.xml b/plc4j/drivers/bacnet/pom.xml index 7b679a4b588..409418cca6d 100644 --- a/plc4j/drivers/bacnet/pom.xml +++ b/plc4j/drivers/bacnet/pom.xml @@ -119,21 +119,6 @@ test - - org.apache.plc4x - plc4x-code-generation-language-java - 0.12.0-SNAPSHOT - - provided - - - - org.apache.plc4x - plc4x-protocols-bacnetip - 0.12.0-SNAPSHOT - - provided - org.apache.plc4x plc4x-protocols-bacnetip @@ -190,6 +175,24 @@ + + + + org.apache.plc4x + plc4x-code-generation-language-java + 0.12.0-SNAPSHOT + + provided + + + + org.apache.plc4x + plc4x-protocols-bacnetip + 0.12.0-SNAPSHOT + + provided + + diff --git a/plc4j/drivers/c-bus/pom.xml b/plc4j/drivers/c-bus/pom.xml index e3440aa105d..d9bb8d52831 100644 --- a/plc4j/drivers/c-bus/pom.xml +++ b/plc4j/drivers/c-bus/pom.xml @@ -119,29 +119,18 @@ commons-codec commons-codec - - org.apache.plc4x - plc4j-utils-test-utils - 0.12.0-SNAPSHOT - test + org.apache.commons + commons-text org.apache.plc4x - plc4x-code-generation-language-java + plc4j-utils-test-utils 0.12.0-SNAPSHOT - - provided + test - - org.apache.plc4x - plc4x-protocols-c-bus - 0.12.0-SNAPSHOT - - provided - org.apache.plc4x plc4x-protocols-c-bus @@ -150,10 +139,6 @@ test-jar test - - org.apache.commons - commons-text - @@ -187,6 +172,24 @@ + + + + org.apache.plc4x + plc4x-code-generation-language-java + 0.12.0-SNAPSHOT + + provided + + + + org.apache.plc4x + plc4x-protocols-c-bus + 0.12.0-SNAPSHOT + + provided + + diff --git a/plc4j/drivers/can/pom.xml b/plc4j/drivers/can/pom.xml index 61d8e598245..adbb2f62185 100644 --- a/plc4j/drivers/can/pom.xml +++ b/plc4j/drivers/can/pom.xml @@ -140,19 +140,6 @@ commons-codec test - - - org.apache.plc4x - plc4x-protocols-genericcan - 0.12.0-SNAPSHOT - provided - - - org.apache.plc4x - plc4x-code-generation-language-java - 0.12.0-SNAPSHOT - provided - @@ -181,6 +168,22 @@ + + + + org.apache.plc4x + plc4x-protocols-genericcan + 0.12.0-SNAPSHOT + provided + + + + org.apache.plc4x + plc4x-code-generation-language-java + 0.12.0-SNAPSHOT + provided + + diff --git a/plc4j/drivers/canopen/pom.xml b/plc4j/drivers/canopen/pom.xml index 2ce989666ed..9cd810fcb4c 100644 --- a/plc4j/drivers/canopen/pom.xml +++ b/plc4j/drivers/canopen/pom.xml @@ -154,20 +154,6 @@ test - - org.apache.plc4x - plc4x-protocols-canopen - 0.12.0-SNAPSHOT - - provided - - - org.apache.plc4x - plc4x-code-generation-language-java - 0.12.0-SNAPSHOT - - provided - org.apache.plc4x plc4x-protocols-canopen @@ -204,6 +190,24 @@ + + + + org.apache.plc4x + plc4x-protocols-canopen + 0.12.0-SNAPSHOT + + provided + + + + org.apache.plc4x + plc4x-code-generation-language-java + 0.12.0-SNAPSHOT + + provided + + diff --git a/plc4j/drivers/eip/pom.xml b/plc4j/drivers/eip/pom.xml index f8049ab1f01..6d4d325f188 100644 --- a/plc4j/drivers/eip/pom.xml +++ b/plc4j/drivers/eip/pom.xml @@ -138,21 +138,6 @@ test - - org.apache.plc4x - plc4x-code-generation-language-java - 0.12.0-SNAPSHOT - - provided - - - - org.apache.plc4x - plc4x-protocols-eip - 0.12.0-SNAPSHOT - - provided - org.apache.plc4x plc4x-protocols-eip @@ -192,6 +177,24 @@ + + + + org.apache.plc4x + plc4x-code-generation-language-java + 0.12.0-SNAPSHOT + + provided + + + + org.apache.plc4x + plc4x-protocols-eip + 0.12.0-SNAPSHOT + + provided + + diff --git a/plc4j/drivers/firmata/pom.xml b/plc4j/drivers/firmata/pom.xml index 11bda29deab..486f7b7b937 100644 --- a/plc4j/drivers/firmata/pom.xml +++ b/plc4j/drivers/firmata/pom.xml @@ -131,20 +131,6 @@ test - - org.apache.plc4x - plc4x-code-generation-language-java - 0.12.0-SNAPSHOT - - provided - - - org.apache.plc4x - plc4x-protocols-firmata - 0.12.0-SNAPSHOT - - provided - org.apache.plc4x plc4x-protocols-firmata @@ -181,6 +167,24 @@ + + + + org.apache.plc4x + plc4x-code-generation-language-java + 0.12.0-SNAPSHOT + + provided + + + + org.apache.plc4x + plc4x-protocols-firmata + 0.12.0-SNAPSHOT + + provided + + diff --git a/plc4j/drivers/iec-60870/pom.xml b/plc4j/drivers/iec-60870/pom.xml index 813f12e1588..fe8d6328d98 100644 --- a/plc4j/drivers/iec-60870/pom.xml +++ b/plc4j/drivers/iec-60870/pom.xml @@ -134,21 +134,6 @@ test - - org.apache.plc4x - plc4x-code-generation-language-java - 0.12.0-SNAPSHOT - - provided - - - - org.apache.plc4x - plc4x-protocols-iec-60870 - 0.12.0-SNAPSHOT - - provided - org.apache.plc4x plc4x-protocols-iec-60870 @@ -185,6 +170,24 @@ + + + + org.apache.plc4x + plc4x-code-generation-language-java + 0.12.0-SNAPSHOT + + provided + + + + org.apache.plc4x + plc4x-protocols-iec-60870 + 0.12.0-SNAPSHOT + + provided + + diff --git a/plc4j/drivers/knxnetip/pom.xml b/plc4j/drivers/knxnetip/pom.xml index 54f7e70214e..bb5fb957c1d 100644 --- a/plc4j/drivers/knxnetip/pom.xml +++ b/plc4j/drivers/knxnetip/pom.xml @@ -161,21 +161,6 @@ test - - org.apache.plc4x - plc4x-code-generation-language-java - 0.12.0-SNAPSHOT - - provided - - - - org.apache.plc4x - plc4x-protocols-knxnetip - 0.12.0-SNAPSHOT - - provided - org.apache.plc4x plc4x-protocols-knxnetip @@ -212,6 +197,24 @@ + + + + org.apache.plc4x + plc4x-code-generation-language-java + 0.12.0-SNAPSHOT + + provided + + + + org.apache.plc4x + plc4x-protocols-knxnetip + 0.12.0-SNAPSHOT + + provided + + diff --git a/plc4j/drivers/modbus/pom.xml b/plc4j/drivers/modbus/pom.xml index 77154e2022d..997f171d694 100644 --- a/plc4j/drivers/modbus/pom.xml +++ b/plc4j/drivers/modbus/pom.xml @@ -150,21 +150,6 @@ test - - org.apache.plc4x - plc4x-code-generation-language-java - 0.12.0-SNAPSHOT - - provided - - - - org.apache.plc4x - plc4x-protocols-modbus - 0.12.0-SNAPSHOT - - provided - org.apache.plc4x plc4x-protocols-modbus @@ -201,6 +186,24 @@ + + + + org.apache.plc4x + plc4x-code-generation-language-java + 0.12.0-SNAPSHOT + + provided + + + + org.apache.plc4x + plc4x-protocols-modbus + 0.12.0-SNAPSHOT + + provided + + diff --git a/plc4j/drivers/opcua/pom.xml b/plc4j/drivers/opcua/pom.xml index 52a25087d15..9486ab8e835 100644 --- a/plc4j/drivers/opcua/pom.xml +++ b/plc4j/drivers/opcua/pom.xml @@ -180,22 +180,6 @@ test - - org.apache.plc4x - plc4x-code-generation-language-java - 0.12.0-SNAPSHOT - - provided - - - - org.apache.plc4x - plc4x-protocols-opcua - 0.12.0-SNAPSHOT - - provided - - org.apache.plc4x plc4x-protocols-opcua @@ -257,6 +241,24 @@ + + + + org.apache.plc4x + plc4x-code-generation-language-java + 0.12.0-SNAPSHOT + + provided + + + + org.apache.plc4x + plc4x-protocols-opcua + 0.12.0-SNAPSHOT + + provided + + diff --git a/plc4j/drivers/open-protocol/pom.xml b/plc4j/drivers/open-protocol/pom.xml index 411314372bb..2d6de4f3c12 100644 --- a/plc4j/drivers/open-protocol/pom.xml +++ b/plc4j/drivers/open-protocol/pom.xml @@ -127,21 +127,6 @@ test - - org.apache.plc4x - plc4x-code-generation-language-java - 0.12.0-SNAPSHOT - - provided - - - - org.apache.plc4x - plc4x-protocols-open-protocol - 0.12.0-SNAPSHOT - - provided - org.apache.plc4x plc4x-protocols-open-protocol @@ -178,6 +163,24 @@ + + + + org.apache.plc4x + plc4x-code-generation-language-java + 0.12.0-SNAPSHOT + + provided + + + + org.apache.plc4x + plc4x-protocols-open-protocol + 0.12.0-SNAPSHOT + + provided + + diff --git a/plc4j/drivers/plc4x/pom.xml b/plc4j/drivers/plc4x/pom.xml index ea86536de9e..278c83dcaa3 100644 --- a/plc4j/drivers/plc4x/pom.xml +++ b/plc4j/drivers/plc4x/pom.xml @@ -144,21 +144,6 @@ test - - org.apache.plc4x - plc4x-code-generation-language-java - 0.12.0-SNAPSHOT - - provided - - - - org.apache.plc4x - plc4x-protocols-plc4x - 0.12.0-SNAPSHOT - - provided - org.apache.plc4x plc4x-protocols-plc4x @@ -196,6 +181,24 @@ + + + + org.apache.plc4x + plc4x-code-generation-language-java + 0.12.0-SNAPSHOT + + provided + + + + org.apache.plc4x + plc4x-protocols-plc4x + 0.12.0-SNAPSHOT + + provided + + diff --git a/plc4j/drivers/profinet-ng/pom.xml b/plc4j/drivers/profinet-ng/pom.xml index c0ed06830e3..40c4bd449cd 100644 --- a/plc4j/drivers/profinet-ng/pom.xml +++ b/plc4j/drivers/profinet-ng/pom.xml @@ -168,21 +168,6 @@ logback-classic - - org.apache.plc4x - plc4x-code-generation-language-java - 0.12.0-SNAPSHOT - - provided - - - - org.apache.plc4x - plc4x-protocols-profinet - 0.12.0-SNAPSHOT - - provided - org.apache.plc4x plc4x-protocols-profinet @@ -224,6 +209,24 @@ + + + + org.apache.plc4x + plc4x-code-generation-language-java + 0.12.0-SNAPSHOT + + provided + + + + org.apache.plc4x + plc4x-protocols-profinet + 0.12.0-SNAPSHOT + + provided + + diff --git a/plc4j/drivers/profinet/pom.xml b/plc4j/drivers/profinet/pom.xml index eb38e4cb424..76b207c7b87 100644 --- a/plc4j/drivers/profinet/pom.xml +++ b/plc4j/drivers/profinet/pom.xml @@ -168,21 +168,6 @@ logback-classic - - org.apache.plc4x - plc4x-code-generation-language-java - 0.12.0-SNAPSHOT - - provided - - - - org.apache.plc4x - plc4x-protocols-profinet - 0.12.0-SNAPSHOT - - provided - org.apache.plc4x plc4x-protocols-profinet @@ -224,6 +209,24 @@ + + + + org.apache.plc4x + plc4x-code-generation-language-java + 0.12.0-SNAPSHOT + + provided + + + + org.apache.plc4x + plc4x-protocols-profinet + 0.12.0-SNAPSHOT + + provided + + diff --git a/plc4j/drivers/s7/pom.xml b/plc4j/drivers/s7/pom.xml index b45a5e4c4df..7e89512a585 100644 --- a/plc4j/drivers/s7/pom.xml +++ b/plc4j/drivers/s7/pom.xml @@ -128,10 +128,26 @@ io.netty netty-transport + + io.netty + netty-handler + + + io.netty + netty-codec + + + io.netty + netty-common + io.vavr vavr + + org.json + json + org.apache.plc4x @@ -139,34 +155,19 @@ 0.12.0-SNAPSHOT test + org.skyscreamer jsonassert - 1.5.1 test - - - com.vaadin.external.google - android-json - - - org.apache.plc4x - plc4x-code-generation-language-java - 0.12.0-SNAPSHOT - - provided + com.fasterxml.jackson.core + jackson-annotations + test - - org.apache.plc4x - plc4x-protocols-s7 - 0.12.0-SNAPSHOT - - provided - org.apache.plc4x plc4x-protocols-s7 @@ -175,32 +176,6 @@ test-jar test - - io.netty - netty-handler - ${netty.version} - - - io.netty - netty-codec - ${netty.version} - - - io.netty - netty-common - ${netty.version} - - - org.json - json - 20231013 - jar - - - com.fasterxml.jackson.core - jackson-annotations - test - @@ -229,6 +204,24 @@ + + + + org.apache.plc4x + plc4x-code-generation-language-java + 0.12.0-SNAPSHOT + + provided + + + + org.apache.plc4x + plc4x-protocols-s7 + 0.12.0-SNAPSHOT + + provided + + diff --git a/plc4j/drivers/simulated/pom.xml b/plc4j/drivers/simulated/pom.xml index 97095f0d23f..18eb0abf405 100644 --- a/plc4j/drivers/simulated/pom.xml +++ b/plc4j/drivers/simulated/pom.xml @@ -97,39 +97,21 @@ plc4j-api 0.12.0-SNAPSHOT - - - org.apache.commons - commons-lang3 - - - - nl.jqno.equalsverifier - equalsverifier - test - - org.apache.plc4x plc4j-spi 0.12.0-SNAPSHOT - compile - org.apache.plc4x - plc4x-code-generation-language-java - 0.12.0-SNAPSHOT - - provided + org.apache.commons + commons-lang3 - org.apache.plc4x - plc4x-protocols-simulated - 0.12.0-SNAPSHOT - - provided + nl.jqno.equalsverifier + equalsverifier + test @@ -159,6 +141,24 @@ + + + + org.apache.plc4x + plc4x-code-generation-language-java + 0.12.0-SNAPSHOT + + provided + + + + org.apache.plc4x + plc4x-protocols-simulated + 0.12.0-SNAPSHOT + + provided + + diff --git a/plc4j/tools/plc4x-server/pom.xml b/plc4j/tools/plc4x-server/pom.xml index d6810b78bf1..79337de82c4 100644 --- a/plc4j/tools/plc4x-server/pom.xml +++ b/plc4j/tools/plc4x-server/pom.xml @@ -152,52 +152,6 @@ logback-core runtime - - - org.apache.plc4x - plc4x-code-generation-language-java - 0.12.0-SNAPSHOT - - provided - - - - org.apache.plc4x - plc4x-protocols-plc4x - 0.12.0-SNAPSHOT - - provided - - - - update-generated-code - - - - org.apache.plc4x.plugins - plc4x-maven-plugin - - - generate-driver - generate-sources - - generate-driver - - - plc4x - 0 - java - read-write - src/main/generated - - - - - - - - - \ No newline at end of file diff --git a/plc4j/tools/plc4x-server/src/main/generated/org/apache/plc4x/java/plc4x/readwrite/Plc4xConnectRequest.java b/plc4j/tools/plc4x-server/src/main/generated/org/apache/plc4x/java/plc4x/readwrite/Plc4xConnectRequest.java deleted file mode 100644 index b1146e15775..00000000000 --- a/plc4j/tools/plc4x-server/src/main/generated/org/apache/plc4x/java/plc4x/readwrite/Plc4xConnectRequest.java +++ /dev/null @@ -1,166 +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.plc4x.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class Plc4xConnectRequest extends Plc4xMessage implements Message { - - // Accessors for discriminator values. - public Plc4xRequestType getRequestType() { - return Plc4xRequestType.CONNECT_REQUEST; - } - - // Properties. - protected final String connectionString; - - public Plc4xConnectRequest(int requestId, String connectionString) { - super(requestId); - this.connectionString = connectionString; - } - - public String getConnectionString() { - return connectionString; - } - - @Override - protected void serializePlc4xMessageChild(WriteBuffer writeBuffer) throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("Plc4xConnectRequest"); - - // Implicit Field (connectionStringLen) (Used for parsing, but its value is not stored as it's - // implicitly given by the objects content) - short connectionStringLen = (short) (STR_LEN(getConnectionString())); - writeImplicitField( - "connectionStringLen", - connectionStringLen, - writeUnsignedShort(writeBuffer, 8), - WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN)); - - // Simple Field (connectionString) - writeSimpleField( - "connectionString", - connectionString, - writeString(writeBuffer, (connectionStringLen) * (8)), - WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN)); - - writeBuffer.popContext("Plc4xConnectRequest"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = super.getLengthInBits(); - Plc4xConnectRequest _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Implicit Field (connectionStringLen) - lengthInBits += 8; - - // Simple field (connectionString) - lengthInBits += (STR_LEN(getConnectionString())) * (8); - - return lengthInBits; - } - - public static Plc4xMessageBuilder staticParsePlc4xMessageBuilder(ReadBuffer readBuffer) - throws ParseException { - readBuffer.pullContext("Plc4xConnectRequest"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - short connectionStringLen = - readImplicitField( - "connectionStringLen", - readUnsignedShort(readBuffer, 8), - WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN)); - - String connectionString = - readSimpleField( - "connectionString", - readString(readBuffer, (connectionStringLen) * (8)), - WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN)); - - readBuffer.closeContext("Plc4xConnectRequest"); - // Create the instance - return new Plc4xConnectRequestBuilderImpl(connectionString); - } - - public static class Plc4xConnectRequestBuilderImpl implements Plc4xMessage.Plc4xMessageBuilder { - private final String connectionString; - - public Plc4xConnectRequestBuilderImpl(String connectionString) { - this.connectionString = connectionString; - } - - public Plc4xConnectRequest build(int requestId) { - Plc4xConnectRequest plc4xConnectRequest = - new Plc4xConnectRequest(requestId, connectionString); - return plc4xConnectRequest; - } - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof Plc4xConnectRequest)) { - return false; - } - Plc4xConnectRequest that = (Plc4xConnectRequest) o; - return (getConnectionString() == that.getConnectionString()) && super.equals(that) && true; - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode(), getConnectionString()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/tools/plc4x-server/src/main/generated/org/apache/plc4x/java/plc4x/readwrite/Plc4xConnectResponse.java b/plc4j/tools/plc4x-server/src/main/generated/org/apache/plc4x/java/plc4x/readwrite/Plc4xConnectResponse.java deleted file mode 100644 index c3f74bc29fa..00000000000 --- a/plc4j/tools/plc4x-server/src/main/generated/org/apache/plc4x/java/plc4x/readwrite/Plc4xConnectResponse.java +++ /dev/null @@ -1,181 +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.plc4x.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class Plc4xConnectResponse extends Plc4xMessage implements Message { - - // Accessors for discriminator values. - public Plc4xRequestType getRequestType() { - return Plc4xRequestType.CONNECT_RESPONSE; - } - - // Properties. - protected final int connectionId; - protected final Plc4xResponseCode responseCode; - - public Plc4xConnectResponse(int requestId, int connectionId, Plc4xResponseCode responseCode) { - super(requestId); - this.connectionId = connectionId; - this.responseCode = responseCode; - } - - public int getConnectionId() { - return connectionId; - } - - public Plc4xResponseCode getResponseCode() { - return responseCode; - } - - @Override - protected void serializePlc4xMessageChild(WriteBuffer writeBuffer) throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("Plc4xConnectResponse"); - - // Simple Field (connectionId) - writeSimpleField( - "connectionId", - connectionId, - writeUnsignedInt(writeBuffer, 16), - WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN)); - - // Simple Field (responseCode) - writeSimpleEnumField( - "responseCode", - "Plc4xResponseCode", - responseCode, - new DataWriterEnumDefault<>( - Plc4xResponseCode::getValue, - Plc4xResponseCode::name, - writeUnsignedShort(writeBuffer, 8)), - WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN)); - - writeBuffer.popContext("Plc4xConnectResponse"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = super.getLengthInBits(); - Plc4xConnectResponse _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Simple field (connectionId) - lengthInBits += 16; - - // Simple field (responseCode) - lengthInBits += 8; - - return lengthInBits; - } - - public static Plc4xMessageBuilder staticParsePlc4xMessageBuilder(ReadBuffer readBuffer) - throws ParseException { - readBuffer.pullContext("Plc4xConnectResponse"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - int connectionId = - readSimpleField( - "connectionId", - readUnsignedInt(readBuffer, 16), - WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN)); - - Plc4xResponseCode responseCode = - readEnumField( - "responseCode", - "Plc4xResponseCode", - new DataReaderEnumDefault<>( - Plc4xResponseCode::enumForValue, readUnsignedShort(readBuffer, 8)), - WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN)); - - readBuffer.closeContext("Plc4xConnectResponse"); - // Create the instance - return new Plc4xConnectResponseBuilderImpl(connectionId, responseCode); - } - - public static class Plc4xConnectResponseBuilderImpl implements Plc4xMessage.Plc4xMessageBuilder { - private final int connectionId; - private final Plc4xResponseCode responseCode; - - public Plc4xConnectResponseBuilderImpl(int connectionId, Plc4xResponseCode responseCode) { - this.connectionId = connectionId; - this.responseCode = responseCode; - } - - public Plc4xConnectResponse build(int requestId) { - Plc4xConnectResponse plc4xConnectResponse = - new Plc4xConnectResponse(requestId, connectionId, responseCode); - return plc4xConnectResponse; - } - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof Plc4xConnectResponse)) { - return false; - } - Plc4xConnectResponse that = (Plc4xConnectResponse) o; - return (getConnectionId() == that.getConnectionId()) - && (getResponseCode() == that.getResponseCode()) - && super.equals(that) - && true; - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode(), getConnectionId(), getResponseCode()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/tools/plc4x-server/src/main/generated/org/apache/plc4x/java/plc4x/readwrite/Plc4xConstants.java b/plc4j/tools/plc4x-server/src/main/generated/org/apache/plc4x/java/plc4x/readwrite/Plc4xConstants.java deleted file mode 100644 index 686c63b4b13..00000000000 --- a/plc4j/tools/plc4x-server/src/main/generated/org/apache/plc4x/java/plc4x/readwrite/Plc4xConstants.java +++ /dev/null @@ -1,130 +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.plc4x.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class Plc4xConstants implements Message { - - // Constant values. - public static final Integer PLC4XTCPDEFAULTPORT = 59837; - - public Plc4xConstants() { - super(); - } - - public int getPlc4xTcpDefaultPort() { - return PLC4XTCPDEFAULTPORT; - } - - public void serialize(WriteBuffer writeBuffer) throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("Plc4xConstants"); - - // Const Field (plc4xTcpDefaultPort) - writeConstField("plc4xTcpDefaultPort", PLC4XTCPDEFAULTPORT, writeUnsignedInt(writeBuffer, 16)); - - writeBuffer.popContext("Plc4xConstants"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = 0; - Plc4xConstants _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Const Field (plc4xTcpDefaultPort) - lengthInBits += 16; - - return lengthInBits; - } - - public static Plc4xConstants staticParse(ReadBuffer readBuffer, Object... args) - throws ParseException { - PositionAware positionAware = readBuffer; - return staticParse(readBuffer); - } - - public static Plc4xConstants staticParse(ReadBuffer readBuffer) throws ParseException { - readBuffer.pullContext("Plc4xConstants"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - int plc4xTcpDefaultPort = - readConstField( - "plc4xTcpDefaultPort", - readUnsignedInt(readBuffer, 16), - Plc4xConstants.PLC4XTCPDEFAULTPORT); - - readBuffer.closeContext("Plc4xConstants"); - // Create the instance - Plc4xConstants _plc4xConstants; - _plc4xConstants = new Plc4xConstants(); - return _plc4xConstants; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof Plc4xConstants)) { - return false; - } - Plc4xConstants that = (Plc4xConstants) o; - return true; - } - - @Override - public int hashCode() { - return Objects.hash(); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/tools/plc4x-server/src/main/generated/org/apache/plc4x/java/plc4x/readwrite/Plc4xMessage.java b/plc4j/tools/plc4x-server/src/main/generated/org/apache/plc4x/java/plc4x/readwrite/Plc4xMessage.java deleted file mode 100644 index dfb051e649c..00000000000 --- a/plc4j/tools/plc4x-server/src/main/generated/org/apache/plc4x/java/plc4x/readwrite/Plc4xMessage.java +++ /dev/null @@ -1,234 +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.plc4x.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public abstract class Plc4xMessage implements Message { - - // Abstract accessors for discriminator values. - public abstract Plc4xRequestType getRequestType(); - - // Constant values. - public static final Short VERSION = 0x01; - - // Properties. - protected final int requestId; - - public Plc4xMessage(int requestId) { - super(); - this.requestId = requestId; - } - - public int getRequestId() { - return requestId; - } - - public short getVersion() { - return VERSION; - } - - protected abstract void serializePlc4xMessageChild(WriteBuffer writeBuffer) - throws SerializationException; - - public void serialize(WriteBuffer writeBuffer) throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("Plc4xMessage"); - - // Const Field (version) - writeConstField( - "version", - VERSION, - writeUnsignedShort(writeBuffer, 8), - WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN)); - - // Implicit Field (packetLength) (Used for parsing, but its value is not stored as it's - // implicitly given by the objects content) - int packetLength = (int) (getLengthInBytes()); - writeImplicitField( - "packetLength", - packetLength, - writeUnsignedInt(writeBuffer, 16), - WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN)); - - // Simple Field (requestId) - writeSimpleField( - "requestId", - requestId, - writeUnsignedInt(writeBuffer, 16), - WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN)); - - // Discriminator Field (requestType) (Used as input to a switch field) - writeDiscriminatorEnumField( - "requestType", - "Plc4xRequestType", - getRequestType(), - new DataWriterEnumDefault<>( - Plc4xRequestType::getValue, Plc4xRequestType::name, writeUnsignedShort(writeBuffer, 8)), - WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN)); - - // Switch field (Serialize the sub-type) - serializePlc4xMessageChild(writeBuffer); - - writeBuffer.popContext("Plc4xMessage"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = 0; - Plc4xMessage _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Const Field (version) - lengthInBits += 8; - - // Implicit Field (packetLength) - lengthInBits += 16; - - // Simple field (requestId) - lengthInBits += 16; - - // Discriminator Field (requestType) - lengthInBits += 8; - - // Length of sub-type elements will be added by sub-type... - - return lengthInBits; - } - - public static Plc4xMessage staticParse(ReadBuffer readBuffer, Object... args) - throws ParseException { - PositionAware positionAware = readBuffer; - return staticParse(readBuffer); - } - - public static Plc4xMessage staticParse(ReadBuffer readBuffer) throws ParseException { - readBuffer.pullContext("Plc4xMessage"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - short version = - readConstField( - "version", - readUnsignedShort(readBuffer, 8), - Plc4xMessage.VERSION, - WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN)); - - int packetLength = - readImplicitField( - "packetLength", - readUnsignedInt(readBuffer, 16), - WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN)); - - int requestId = - readSimpleField( - "requestId", - readUnsignedInt(readBuffer, 16), - WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN)); - - Plc4xRequestType requestType = - readDiscriminatorField( - "requestType", - new DataReaderEnumDefault<>( - Plc4xRequestType::enumForValue, readUnsignedShort(readBuffer, 8)), - WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN)); - - // Switch Field (Depending on the discriminator values, passes the instantiation to a sub-type) - Plc4xMessageBuilder builder = null; - if (EvaluationHelper.equals(requestType, Plc4xRequestType.CONNECT_REQUEST)) { - builder = Plc4xConnectRequest.staticParsePlc4xMessageBuilder(readBuffer); - } else if (EvaluationHelper.equals(requestType, Plc4xRequestType.CONNECT_RESPONSE)) { - builder = Plc4xConnectResponse.staticParsePlc4xMessageBuilder(readBuffer); - } else if (EvaluationHelper.equals(requestType, Plc4xRequestType.READ_REQUEST)) { - builder = Plc4xReadRequest.staticParsePlc4xMessageBuilder(readBuffer); - } else if (EvaluationHelper.equals(requestType, Plc4xRequestType.READ_RESPONSE)) { - builder = Plc4xReadResponse.staticParsePlc4xMessageBuilder(readBuffer); - } else if (EvaluationHelper.equals(requestType, Plc4xRequestType.WRITE_REQUEST)) { - builder = Plc4xWriteRequest.staticParsePlc4xMessageBuilder(readBuffer); - } else if (EvaluationHelper.equals(requestType, Plc4xRequestType.WRITE_RESPONSE)) { - builder = Plc4xWriteResponse.staticParsePlc4xMessageBuilder(readBuffer); - } - if (builder == null) { - throw new ParseException( - "Unsupported case for discriminated type" - + " parameters [" - + "requestType=" - + requestType - + "]"); - } - - readBuffer.closeContext("Plc4xMessage"); - // Create the instance - Plc4xMessage _plc4xMessage = builder.build(requestId); - return _plc4xMessage; - } - - public interface Plc4xMessageBuilder { - Plc4xMessage build(int requestId); - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof Plc4xMessage)) { - return false; - } - Plc4xMessage that = (Plc4xMessage) o; - return (getRequestId() == that.getRequestId()) && true; - } - - @Override - public int hashCode() { - return Objects.hash(getRequestId()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/tools/plc4x-server/src/main/generated/org/apache/plc4x/java/plc4x/readwrite/Plc4xReadRequest.java b/plc4j/tools/plc4x-server/src/main/generated/org/apache/plc4x/java/plc4x/readwrite/Plc4xReadRequest.java deleted file mode 100644 index 5d24a78136f..00000000000 --- a/plc4j/tools/plc4x-server/src/main/generated/org/apache/plc4x/java/plc4x/readwrite/Plc4xReadRequest.java +++ /dev/null @@ -1,197 +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.plc4x.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class Plc4xReadRequest extends Plc4xMessage implements Message { - - // Accessors for discriminator values. - public Plc4xRequestType getRequestType() { - return Plc4xRequestType.READ_REQUEST; - } - - // Properties. - protected final int connectionId; - protected final List tags; - - public Plc4xReadRequest(int requestId, int connectionId, List tags) { - super(requestId); - this.connectionId = connectionId; - this.tags = tags; - } - - public int getConnectionId() { - return connectionId; - } - - public List getTags() { - return tags; - } - - @Override - protected void serializePlc4xMessageChild(WriteBuffer writeBuffer) throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("Plc4xReadRequest"); - - // Simple Field (connectionId) - writeSimpleField( - "connectionId", - connectionId, - writeUnsignedInt(writeBuffer, 16), - WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN)); - - // Implicit Field (numTags) (Used for parsing, but its value is not stored as it's implicitly - // given by the objects content) - short numTags = (short) (COUNT(getTags())); - writeImplicitField( - "numTags", - numTags, - writeUnsignedShort(writeBuffer, 8), - WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN)); - - // Array Field (tags) - writeComplexTypeArrayField( - "tags", tags, writeBuffer, WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN)); - - writeBuffer.popContext("Plc4xReadRequest"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = super.getLengthInBits(); - Plc4xReadRequest _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Simple field (connectionId) - lengthInBits += 16; - - // Implicit Field (numTags) - lengthInBits += 8; - - // Array field - if (tags != null) { - int i = 0; - for (Plc4xTagRequest element : tags) { - ThreadLocalHelper.lastItemThreadLocal.set(++i >= tags.size()); - lengthInBits += element.getLengthInBits(); - } - } - - return lengthInBits; - } - - public static Plc4xMessageBuilder staticParsePlc4xMessageBuilder(ReadBuffer readBuffer) - throws ParseException { - readBuffer.pullContext("Plc4xReadRequest"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - int connectionId = - readSimpleField( - "connectionId", - readUnsignedInt(readBuffer, 16), - WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN)); - - short numTags = - readImplicitField( - "numTags", - readUnsignedShort(readBuffer, 8), - WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN)); - - List tags = - readCountArrayField( - "tags", - new DataReaderComplexDefault<>( - () -> Plc4xTagRequest.staticParse(readBuffer), readBuffer), - numTags, - WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN)); - - readBuffer.closeContext("Plc4xReadRequest"); - // Create the instance - return new Plc4xReadRequestBuilderImpl(connectionId, tags); - } - - public static class Plc4xReadRequestBuilderImpl implements Plc4xMessage.Plc4xMessageBuilder { - private final int connectionId; - private final List tags; - - public Plc4xReadRequestBuilderImpl(int connectionId, List tags) { - this.connectionId = connectionId; - this.tags = tags; - } - - public Plc4xReadRequest build(int requestId) { - Plc4xReadRequest plc4xReadRequest = new Plc4xReadRequest(requestId, connectionId, tags); - return plc4xReadRequest; - } - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof Plc4xReadRequest)) { - return false; - } - Plc4xReadRequest that = (Plc4xReadRequest) o; - return (getConnectionId() == that.getConnectionId()) - && (getTags() == that.getTags()) - && super.equals(that) - && true; - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode(), getConnectionId(), getTags()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/tools/plc4x-server/src/main/generated/org/apache/plc4x/java/plc4x/readwrite/Plc4xReadResponse.java b/plc4j/tools/plc4x-server/src/main/generated/org/apache/plc4x/java/plc4x/readwrite/Plc4xReadResponse.java deleted file mode 100644 index e57738d1f8c..00000000000 --- a/plc4j/tools/plc4x-server/src/main/generated/org/apache/plc4x/java/plc4x/readwrite/Plc4xReadResponse.java +++ /dev/null @@ -1,234 +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.plc4x.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class Plc4xReadResponse extends Plc4xMessage implements Message { - - // Accessors for discriminator values. - public Plc4xRequestType getRequestType() { - return Plc4xRequestType.READ_RESPONSE; - } - - // Properties. - protected final int connectionId; - protected final Plc4xResponseCode responseCode; - protected final List tags; - - public Plc4xReadResponse( - int requestId, - int connectionId, - Plc4xResponseCode responseCode, - List tags) { - super(requestId); - this.connectionId = connectionId; - this.responseCode = responseCode; - this.tags = tags; - } - - public int getConnectionId() { - return connectionId; - } - - public Plc4xResponseCode getResponseCode() { - return responseCode; - } - - public List getTags() { - return tags; - } - - @Override - protected void serializePlc4xMessageChild(WriteBuffer writeBuffer) throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("Plc4xReadResponse"); - - // Simple Field (connectionId) - writeSimpleField( - "connectionId", - connectionId, - writeUnsignedInt(writeBuffer, 16), - WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN)); - - // Simple Field (responseCode) - writeSimpleEnumField( - "responseCode", - "Plc4xResponseCode", - responseCode, - new DataWriterEnumDefault<>( - Plc4xResponseCode::getValue, - Plc4xResponseCode::name, - writeUnsignedShort(writeBuffer, 8)), - WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN)); - - // Implicit Field (numTags) (Used for parsing, but its value is not stored as it's implicitly - // given by the objects content) - short numTags = (short) (COUNT(getTags())); - writeImplicitField( - "numTags", - numTags, - writeUnsignedShort(writeBuffer, 8), - WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN)); - - // Array Field (tags) - writeComplexTypeArrayField( - "tags", tags, writeBuffer, WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN)); - - writeBuffer.popContext("Plc4xReadResponse"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = super.getLengthInBits(); - Plc4xReadResponse _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Simple field (connectionId) - lengthInBits += 16; - - // Simple field (responseCode) - lengthInBits += 8; - - // Implicit Field (numTags) - lengthInBits += 8; - - // Array field - if (tags != null) { - int i = 0; - for (Plc4xTagValueResponse element : tags) { - ThreadLocalHelper.lastItemThreadLocal.set(++i >= tags.size()); - lengthInBits += element.getLengthInBits(); - } - } - - return lengthInBits; - } - - public static Plc4xMessageBuilder staticParsePlc4xMessageBuilder(ReadBuffer readBuffer) - throws ParseException { - readBuffer.pullContext("Plc4xReadResponse"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - int connectionId = - readSimpleField( - "connectionId", - readUnsignedInt(readBuffer, 16), - WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN)); - - Plc4xResponseCode responseCode = - readEnumField( - "responseCode", - "Plc4xResponseCode", - new DataReaderEnumDefault<>( - Plc4xResponseCode::enumForValue, readUnsignedShort(readBuffer, 8)), - WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN)); - - short numTags = - readImplicitField( - "numTags", - readUnsignedShort(readBuffer, 8), - WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN)); - - List tags = - readCountArrayField( - "tags", - new DataReaderComplexDefault<>( - () -> Plc4xTagValueResponse.staticParse(readBuffer), readBuffer), - numTags, - WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN)); - - readBuffer.closeContext("Plc4xReadResponse"); - // Create the instance - return new Plc4xReadResponseBuilderImpl(connectionId, responseCode, tags); - } - - public static class Plc4xReadResponseBuilderImpl implements Plc4xMessage.Plc4xMessageBuilder { - private final int connectionId; - private final Plc4xResponseCode responseCode; - private final List tags; - - public Plc4xReadResponseBuilderImpl( - int connectionId, Plc4xResponseCode responseCode, List tags) { - this.connectionId = connectionId; - this.responseCode = responseCode; - this.tags = tags; - } - - public Plc4xReadResponse build(int requestId) { - Plc4xReadResponse plc4xReadResponse = - new Plc4xReadResponse(requestId, connectionId, responseCode, tags); - return plc4xReadResponse; - } - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof Plc4xReadResponse)) { - return false; - } - Plc4xReadResponse that = (Plc4xReadResponse) o; - return (getConnectionId() == that.getConnectionId()) - && (getResponseCode() == that.getResponseCode()) - && (getTags() == that.getTags()) - && super.equals(that) - && true; - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode(), getConnectionId(), getResponseCode(), getTags()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/tools/plc4x-server/src/main/generated/org/apache/plc4x/java/plc4x/readwrite/Plc4xRequestType.java b/plc4j/tools/plc4x-server/src/main/generated/org/apache/plc4x/java/plc4x/readwrite/Plc4xRequestType.java deleted file mode 100644 index 712be6fdf5e..00000000000 --- a/plc4j/tools/plc4x-server/src/main/generated/org/apache/plc4x/java/plc4x/readwrite/Plc4xRequestType.java +++ /dev/null @@ -1,65 +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.plc4x.readwrite; - -import java.util.HashMap; -import java.util.Map; - -// Code generated by code-generation. DO NOT EDIT. - -public enum Plc4xRequestType { - CONNECT_REQUEST((short) 0x01), - CONNECT_RESPONSE((short) 0x02), - DISCONNECT_REQUEST((short) 0x03), - DISCONNECT_RESPONSE((short) 0x04), - READ_REQUEST((short) 0x05), - READ_RESPONSE((short) 0x06), - WRITE_REQUEST((short) 0x07), - WRITE_RESPONSE((short) 0x08), - SUBSCRIPTION_REQUEST((short) 0x09), - SUBSCRIPTION_RESPONSE((short) 0x0A), - UNSUBSCRIPTION_REQUEST((short) 0x0B), - UNSUBSCRIPTION_RESPONSE((short) 0x0C); - private static final Map map; - - static { - map = new HashMap<>(); - for (Plc4xRequestType value : Plc4xRequestType.values()) { - map.put((short) value.getValue(), value); - } - } - - private final short value; - - Plc4xRequestType(short value) { - this.value = value; - } - - public short getValue() { - return value; - } - - public static Plc4xRequestType enumForValue(short value) { - return map.get(value); - } - - public static Boolean isDefined(short value) { - return map.containsKey(value); - } -} diff --git a/plc4j/tools/plc4x-server/src/main/generated/org/apache/plc4x/java/plc4x/readwrite/Plc4xResponseCode.java b/plc4j/tools/plc4x-server/src/main/generated/org/apache/plc4x/java/plc4x/readwrite/Plc4xResponseCode.java deleted file mode 100644 index 03cef96a869..00000000000 --- a/plc4j/tools/plc4x-server/src/main/generated/org/apache/plc4x/java/plc4x/readwrite/Plc4xResponseCode.java +++ /dev/null @@ -1,64 +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.plc4x.readwrite; - -import java.util.HashMap; -import java.util.Map; - -// Code generated by code-generation. DO NOT EDIT. - -public enum Plc4xResponseCode { - OK((short) 0x01), - NOT_FOUND((short) 0x02), - ACCESS_DENIED((short) 0x03), - INVALID_ADDRESS((short) 0x04), - INVALID_DATATYPE((short) 0x06), - INVALID_DATA((short) 0x07), - INTERNAL_ERROR((short) 0x08), - REMOTE_BUSY((short) 0x09), - REMOTE_ERROR((short) 0x0A), - UNSUPPORTED((short) 0x0B), - RESPONSE_PENDING((short) 0x0C); - private static final Map map; - - static { - map = new HashMap<>(); - for (Plc4xResponseCode value : Plc4xResponseCode.values()) { - map.put((short) value.getValue(), value); - } - } - - private final short value; - - Plc4xResponseCode(short value) { - this.value = value; - } - - public short getValue() { - return value; - } - - public static Plc4xResponseCode enumForValue(short value) { - return map.get(value); - } - - public static Boolean isDefined(short value) { - return map.containsKey(value); - } -} diff --git a/plc4j/tools/plc4x-server/src/main/generated/org/apache/plc4x/java/plc4x/readwrite/Plc4xSubscriptionType.java b/plc4j/tools/plc4x-server/src/main/generated/org/apache/plc4x/java/plc4x/readwrite/Plc4xSubscriptionType.java deleted file mode 100644 index 60f730b3991..00000000000 --- a/plc4j/tools/plc4x-server/src/main/generated/org/apache/plc4x/java/plc4x/readwrite/Plc4xSubscriptionType.java +++ /dev/null @@ -1,56 +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.plc4x.readwrite; - -import java.util.HashMap; -import java.util.Map; - -// Code generated by code-generation. DO NOT EDIT. - -public enum Plc4xSubscriptionType { - CYCLIC((short) 0x01), - CHANGE_OF_STATE((short) 0x02), - EVENT((short) 0x03); - private static final Map map; - - static { - map = new HashMap<>(); - for (Plc4xSubscriptionType value : Plc4xSubscriptionType.values()) { - map.put((short) value.getValue(), value); - } - } - - private final short value; - - Plc4xSubscriptionType(short value) { - this.value = value; - } - - public short getValue() { - return value; - } - - public static Plc4xSubscriptionType enumForValue(short value) { - return map.get(value); - } - - public static Boolean isDefined(short value) { - return map.containsKey(value); - } -} diff --git a/plc4j/tools/plc4x-server/src/main/generated/org/apache/plc4x/java/plc4x/readwrite/Plc4xTag.java b/plc4j/tools/plc4x-server/src/main/generated/org/apache/plc4x/java/plc4x/readwrite/Plc4xTag.java deleted file mode 100644 index c5a9b366bcd..00000000000 --- a/plc4j/tools/plc4x-server/src/main/generated/org/apache/plc4x/java/plc4x/readwrite/Plc4xTag.java +++ /dev/null @@ -1,160 +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.plc4x.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class Plc4xTag implements Message { - - // Properties. - protected final String name; - protected final String tagQuery; - - public Plc4xTag(String name, String tagQuery) { - super(); - this.name = name; - this.tagQuery = tagQuery; - } - - public String getName() { - return name; - } - - public String getTagQuery() { - return tagQuery; - } - - public void serialize(WriteBuffer writeBuffer) throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("Plc4xTag"); - - // Implicit Field (nameLen) (Used for parsing, but its value is not stored as it's implicitly - // given by the objects content) - short nameLen = (short) (STR_LEN(getName())); - writeImplicitField("nameLen", nameLen, writeUnsignedShort(writeBuffer, 8)); - - // Simple Field (name) - writeSimpleField("name", name, writeString(writeBuffer, (nameLen) * (8))); - - // Implicit Field (tagQueryLen) (Used for parsing, but its value is not stored as it's - // implicitly given by the objects content) - short tagQueryLen = (short) (STR_LEN(getTagQuery())); - writeImplicitField("tagQueryLen", tagQueryLen, writeUnsignedShort(writeBuffer, 8)); - - // Simple Field (tagQuery) - writeSimpleField("tagQuery", tagQuery, writeString(writeBuffer, (tagQueryLen) * (8))); - - writeBuffer.popContext("Plc4xTag"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = 0; - Plc4xTag _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Implicit Field (nameLen) - lengthInBits += 8; - - // Simple field (name) - lengthInBits += (STR_LEN(getName())) * (8); - - // Implicit Field (tagQueryLen) - lengthInBits += 8; - - // Simple field (tagQuery) - lengthInBits += (STR_LEN(getTagQuery())) * (8); - - return lengthInBits; - } - - public static Plc4xTag staticParse(ReadBuffer readBuffer, Object... args) throws ParseException { - PositionAware positionAware = readBuffer; - return staticParse(readBuffer); - } - - public static Plc4xTag staticParse(ReadBuffer readBuffer) throws ParseException { - readBuffer.pullContext("Plc4xTag"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - short nameLen = readImplicitField("nameLen", readUnsignedShort(readBuffer, 8)); - - String name = readSimpleField("name", readString(readBuffer, (nameLen) * (8))); - - short tagQueryLen = readImplicitField("tagQueryLen", readUnsignedShort(readBuffer, 8)); - - String tagQuery = readSimpleField("tagQuery", readString(readBuffer, (tagQueryLen) * (8))); - - readBuffer.closeContext("Plc4xTag"); - // Create the instance - Plc4xTag _plc4xTag; - _plc4xTag = new Plc4xTag(name, tagQuery); - return _plc4xTag; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof Plc4xTag)) { - return false; - } - Plc4xTag that = (Plc4xTag) o; - return (getName() == that.getName()) && (getTagQuery() == that.getTagQuery()) && true; - } - - @Override - public int hashCode() { - return Objects.hash(getName(), getTagQuery()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/tools/plc4x-server/src/main/generated/org/apache/plc4x/java/plc4x/readwrite/Plc4xTagRequest.java b/plc4j/tools/plc4x-server/src/main/generated/org/apache/plc4x/java/plc4x/readwrite/Plc4xTagRequest.java deleted file mode 100644 index 6eec2a4b7a7..00000000000 --- a/plc4j/tools/plc4x-server/src/main/generated/org/apache/plc4x/java/plc4x/readwrite/Plc4xTagRequest.java +++ /dev/null @@ -1,130 +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.plc4x.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class Plc4xTagRequest implements Message { - - // Properties. - protected final Plc4xTag tag; - - public Plc4xTagRequest(Plc4xTag tag) { - super(); - this.tag = tag; - } - - public Plc4xTag getTag() { - return tag; - } - - public void serialize(WriteBuffer writeBuffer) throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("Plc4xTagRequest"); - - // Simple Field (tag) - writeSimpleField("tag", tag, new DataWriterComplexDefault<>(writeBuffer)); - - writeBuffer.popContext("Plc4xTagRequest"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = 0; - Plc4xTagRequest _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Simple field (tag) - lengthInBits += tag.getLengthInBits(); - - return lengthInBits; - } - - public static Plc4xTagRequest staticParse(ReadBuffer readBuffer, Object... args) - throws ParseException { - PositionAware positionAware = readBuffer; - return staticParse(readBuffer); - } - - public static Plc4xTagRequest staticParse(ReadBuffer readBuffer) throws ParseException { - readBuffer.pullContext("Plc4xTagRequest"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - Plc4xTag tag = - readSimpleField( - "tag", - new DataReaderComplexDefault<>(() -> Plc4xTag.staticParse(readBuffer), readBuffer)); - - readBuffer.closeContext("Plc4xTagRequest"); - // Create the instance - Plc4xTagRequest _plc4xTagRequest; - _plc4xTagRequest = new Plc4xTagRequest(tag); - return _plc4xTagRequest; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof Plc4xTagRequest)) { - return false; - } - Plc4xTagRequest that = (Plc4xTagRequest) o; - return (getTag() == that.getTag()) && true; - } - - @Override - public int hashCode() { - return Objects.hash(getTag()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/tools/plc4x-server/src/main/generated/org/apache/plc4x/java/plc4x/readwrite/Plc4xTagResponse.java b/plc4j/tools/plc4x-server/src/main/generated/org/apache/plc4x/java/plc4x/readwrite/Plc4xTagResponse.java deleted file mode 100644 index 03db129e010..00000000000 --- a/plc4j/tools/plc4x-server/src/main/generated/org/apache/plc4x/java/plc4x/readwrite/Plc4xTagResponse.java +++ /dev/null @@ -1,156 +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.plc4x.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class Plc4xTagResponse implements Message { - - // Properties. - protected final Plc4xTag tag; - protected final Plc4xResponseCode responseCode; - - public Plc4xTagResponse(Plc4xTag tag, Plc4xResponseCode responseCode) { - super(); - this.tag = tag; - this.responseCode = responseCode; - } - - public Plc4xTag getTag() { - return tag; - } - - public Plc4xResponseCode getResponseCode() { - return responseCode; - } - - public void serialize(WriteBuffer writeBuffer) throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("Plc4xTagResponse"); - - // Simple Field (tag) - writeSimpleField("tag", tag, new DataWriterComplexDefault<>(writeBuffer)); - - // Simple Field (responseCode) - writeSimpleEnumField( - "responseCode", - "Plc4xResponseCode", - responseCode, - new DataWriterEnumDefault<>( - Plc4xResponseCode::getValue, - Plc4xResponseCode::name, - writeUnsignedShort(writeBuffer, 8))); - - writeBuffer.popContext("Plc4xTagResponse"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = 0; - Plc4xTagResponse _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Simple field (tag) - lengthInBits += tag.getLengthInBits(); - - // Simple field (responseCode) - lengthInBits += 8; - - return lengthInBits; - } - - public static Plc4xTagResponse staticParse(ReadBuffer readBuffer, Object... args) - throws ParseException { - PositionAware positionAware = readBuffer; - return staticParse(readBuffer); - } - - public static Plc4xTagResponse staticParse(ReadBuffer readBuffer) throws ParseException { - readBuffer.pullContext("Plc4xTagResponse"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - Plc4xTag tag = - readSimpleField( - "tag", - new DataReaderComplexDefault<>(() -> Plc4xTag.staticParse(readBuffer), readBuffer)); - - Plc4xResponseCode responseCode = - readEnumField( - "responseCode", - "Plc4xResponseCode", - new DataReaderEnumDefault<>( - Plc4xResponseCode::enumForValue, readUnsignedShort(readBuffer, 8))); - - readBuffer.closeContext("Plc4xTagResponse"); - // Create the instance - Plc4xTagResponse _plc4xTagResponse; - _plc4xTagResponse = new Plc4xTagResponse(tag, responseCode); - return _plc4xTagResponse; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof Plc4xTagResponse)) { - return false; - } - Plc4xTagResponse that = (Plc4xTagResponse) o; - return (getTag() == that.getTag()) && (getResponseCode() == that.getResponseCode()) && true; - } - - @Override - public int hashCode() { - return Objects.hash(getTag(), getResponseCode()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/tools/plc4x-server/src/main/generated/org/apache/plc4x/java/plc4x/readwrite/Plc4xTagValueRequest.java b/plc4j/tools/plc4x-server/src/main/generated/org/apache/plc4x/java/plc4x/readwrite/Plc4xTagValueRequest.java deleted file mode 100644 index 7b5f5dc1d86..00000000000 --- a/plc4j/tools/plc4x-server/src/main/generated/org/apache/plc4x/java/plc4x/readwrite/Plc4xTagValueRequest.java +++ /dev/null @@ -1,183 +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.plc4x.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class Plc4xTagValueRequest implements Message { - - // Properties. - protected final Plc4xTag tag; - protected final Plc4xValueType valueType; - protected final PlcValue value; - - public Plc4xTagValueRequest(Plc4xTag tag, Plc4xValueType valueType, PlcValue value) { - super(); - this.tag = tag; - this.valueType = valueType; - this.value = value; - } - - public Plc4xTag getTag() { - return tag; - } - - public Plc4xValueType getValueType() { - return valueType; - } - - public PlcValue getValue() { - return value; - } - - public void serialize(WriteBuffer writeBuffer) throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("Plc4xTagValueRequest"); - - // Simple Field (tag) - writeSimpleField("tag", tag, new DataWriterComplexDefault<>(writeBuffer)); - - // Simple Field (valueType) - writeSimpleEnumField( - "valueType", - "Plc4xValueType", - valueType, - new DataWriterEnumDefault<>( - Plc4xValueType::getValue, Plc4xValueType::name, writeUnsignedShort(writeBuffer, 8))); - - // Optional Field (value) (Can be skipped, if the value is null) - writeOptionalField( - "value", - value, - new DataWriterDataIoDefault( - writeBuffer, (wb, val) -> Plc4xValue.staticSerialize(wb, val, valueType)), - (getValueType()) != (Plc4xValueType.NULL)); - - writeBuffer.popContext("Plc4xTagValueRequest"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = 0; - Plc4xTagValueRequest _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Simple field (tag) - lengthInBits += tag.getLengthInBits(); - - // Simple field (valueType) - lengthInBits += 8; - - // Optional Field (value) - if (value != null) { - lengthInBits += Plc4xValue.getLengthInBits(value, valueType); - } - - return lengthInBits; - } - - public static Plc4xTagValueRequest staticParse(ReadBuffer readBuffer, Object... args) - throws ParseException { - PositionAware positionAware = readBuffer; - return staticParse(readBuffer); - } - - public static Plc4xTagValueRequest staticParse(ReadBuffer readBuffer) throws ParseException { - readBuffer.pullContext("Plc4xTagValueRequest"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - Plc4xTag tag = - readSimpleField( - "tag", - new DataReaderComplexDefault<>(() -> Plc4xTag.staticParse(readBuffer), readBuffer)); - - Plc4xValueType valueType = - readEnumField( - "valueType", - "Plc4xValueType", - new DataReaderEnumDefault<>( - Plc4xValueType::enumForValue, readUnsignedShort(readBuffer, 8))); - - PlcValue value = - readOptionalField( - "value", - new DataReaderComplexDefault<>( - () -> Plc4xValue.staticParse(readBuffer, (Plc4xValueType) (valueType)), readBuffer), - (valueType) != (Plc4xValueType.NULL)); - - readBuffer.closeContext("Plc4xTagValueRequest"); - // Create the instance - Plc4xTagValueRequest _plc4xTagValueRequest; - _plc4xTagValueRequest = new Plc4xTagValueRequest(tag, valueType, value); - return _plc4xTagValueRequest; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof Plc4xTagValueRequest)) { - return false; - } - Plc4xTagValueRequest that = (Plc4xTagValueRequest) o; - return (getTag() == that.getTag()) - && (getValueType() == that.getValueType()) - && (getValue() == that.getValue()) - && true; - } - - @Override - public int hashCode() { - return Objects.hash(getTag(), getValueType(), getValue()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/tools/plc4x-server/src/main/generated/org/apache/plc4x/java/plc4x/readwrite/Plc4xTagValueResponse.java b/plc4j/tools/plc4x-server/src/main/generated/org/apache/plc4x/java/plc4x/readwrite/Plc4xTagValueResponse.java deleted file mode 100644 index ebfc6c35e51..00000000000 --- a/plc4j/tools/plc4x-server/src/main/generated/org/apache/plc4x/java/plc4x/readwrite/Plc4xTagValueResponse.java +++ /dev/null @@ -1,211 +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.plc4x.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class Plc4xTagValueResponse implements Message { - - // Properties. - protected final Plc4xTag tag; - protected final Plc4xResponseCode responseCode; - protected final Plc4xValueType valueType; - protected final PlcValue value; - - public Plc4xTagValueResponse( - Plc4xTag tag, Plc4xResponseCode responseCode, Plc4xValueType valueType, PlcValue value) { - super(); - this.tag = tag; - this.responseCode = responseCode; - this.valueType = valueType; - this.value = value; - } - - public Plc4xTag getTag() { - return tag; - } - - public Plc4xResponseCode getResponseCode() { - return responseCode; - } - - public Plc4xValueType getValueType() { - return valueType; - } - - public PlcValue getValue() { - return value; - } - - public void serialize(WriteBuffer writeBuffer) throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("Plc4xTagValueResponse"); - - // Simple Field (tag) - writeSimpleField("tag", tag, new DataWriterComplexDefault<>(writeBuffer)); - - // Simple Field (responseCode) - writeSimpleEnumField( - "responseCode", - "Plc4xResponseCode", - responseCode, - new DataWriterEnumDefault<>( - Plc4xResponseCode::getValue, - Plc4xResponseCode::name, - writeUnsignedShort(writeBuffer, 8))); - - // Simple Field (valueType) - writeSimpleEnumField( - "valueType", - "Plc4xValueType", - valueType, - new DataWriterEnumDefault<>( - Plc4xValueType::getValue, Plc4xValueType::name, writeUnsignedShort(writeBuffer, 8))); - - // Optional Field (value) (Can be skipped, if the value is null) - writeOptionalField( - "value", - value, - new DataWriterDataIoDefault( - writeBuffer, (wb, val) -> Plc4xValue.staticSerialize(wb, val, valueType)), - (getValueType()) != (Plc4xValueType.NULL)); - - writeBuffer.popContext("Plc4xTagValueResponse"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = 0; - Plc4xTagValueResponse _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Simple field (tag) - lengthInBits += tag.getLengthInBits(); - - // Simple field (responseCode) - lengthInBits += 8; - - // Simple field (valueType) - lengthInBits += 8; - - // Optional Field (value) - if (value != null) { - lengthInBits += Plc4xValue.getLengthInBits(value, valueType); - } - - return lengthInBits; - } - - public static Plc4xTagValueResponse staticParse(ReadBuffer readBuffer, Object... args) - throws ParseException { - PositionAware positionAware = readBuffer; - return staticParse(readBuffer); - } - - public static Plc4xTagValueResponse staticParse(ReadBuffer readBuffer) throws ParseException { - readBuffer.pullContext("Plc4xTagValueResponse"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - Plc4xTag tag = - readSimpleField( - "tag", - new DataReaderComplexDefault<>(() -> Plc4xTag.staticParse(readBuffer), readBuffer)); - - Plc4xResponseCode responseCode = - readEnumField( - "responseCode", - "Plc4xResponseCode", - new DataReaderEnumDefault<>( - Plc4xResponseCode::enumForValue, readUnsignedShort(readBuffer, 8))); - - Plc4xValueType valueType = - readEnumField( - "valueType", - "Plc4xValueType", - new DataReaderEnumDefault<>( - Plc4xValueType::enumForValue, readUnsignedShort(readBuffer, 8))); - - PlcValue value = - readOptionalField( - "value", - new DataReaderComplexDefault<>( - () -> Plc4xValue.staticParse(readBuffer, (Plc4xValueType) (valueType)), readBuffer), - (valueType) != (Plc4xValueType.NULL)); - - readBuffer.closeContext("Plc4xTagValueResponse"); - // Create the instance - Plc4xTagValueResponse _plc4xTagValueResponse; - _plc4xTagValueResponse = new Plc4xTagValueResponse(tag, responseCode, valueType, value); - return _plc4xTagValueResponse; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof Plc4xTagValueResponse)) { - return false; - } - Plc4xTagValueResponse that = (Plc4xTagValueResponse) o; - return (getTag() == that.getTag()) - && (getResponseCode() == that.getResponseCode()) - && (getValueType() == that.getValueType()) - && (getValue() == that.getValue()) - && true; - } - - @Override - public int hashCode() { - return Objects.hash(getTag(), getResponseCode(), getValueType(), getValue()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/tools/plc4x-server/src/main/generated/org/apache/plc4x/java/plc4x/readwrite/Plc4xValue.java b/plc4j/tools/plc4x-server/src/main/generated/org/apache/plc4x/java/plc4x/readwrite/Plc4xValue.java deleted file mode 100644 index df01b18ac31..00000000000 --- a/plc4j/tools/plc4x-server/src/main/generated/org/apache/plc4x/java/plc4x/readwrite/Plc4xValue.java +++ /dev/null @@ -1,467 +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.plc4x.readwrite; - -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.math.BigInteger; -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.WithOption; -import org.apache.plc4x.java.spi.generation.ByteOrder; -import org.apache.plc4x.java.spi.generation.EvaluationHelper; -import org.apache.plc4x.java.spi.generation.ParseException; -import org.apache.plc4x.java.spi.generation.ReadBuffer; -import org.apache.plc4x.java.spi.generation.SerializationException; -import org.apache.plc4x.java.spi.generation.WriteBuffer; -import org.apache.plc4x.java.spi.values.*; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -// Code generated by code-generation. DO NOT EDIT. - -public class Plc4xValue { - - private static final Logger LOGGER = LoggerFactory.getLogger(Plc4xValue.class); - - public static PlcValue staticParse(ReadBuffer readBuffer, Plc4xValueType valueType) - throws ParseException { - if (EvaluationHelper.equals(valueType, Plc4xValueType.BOOL)) { // BOOL - - // Reserved Field (Compartmentalized so the "reserved" variable can't leak) - { - byte reserved = /*TODO: migrate me*/ /*TODO: migrate me*/ - readBuffer.readUnsignedByte("", 7); - if (reserved != (byte) 0x00) { - LOGGER.info( - "Expected constant value " + 0x00 + " but got " + reserved + " for reserved field."); - } - } - - // Simple Field (value) - Boolean value = /*TODO: migrate me*/ /*TODO: migrate me*/ readBuffer.readBit(""); - - return new PlcBOOL(value); - } else if (EvaluationHelper.equals(valueType, Plc4xValueType.BYTE)) { // BYTE - - // Simple Field (value) - Short value = /*TODO: migrate me*/ /*TODO: migrate me*/ readBuffer.readUnsignedShort("", 8); - - return new PlcBYTE(value); - } else if (EvaluationHelper.equals(valueType, Plc4xValueType.WORD)) { // WORD - - // Simple Field (value) - Integer value = /*TODO: migrate me*/ /*TODO: migrate me*/ readBuffer.readUnsignedInt("", 16); - - return new PlcWORD(value); - } else if (EvaluationHelper.equals(valueType, Plc4xValueType.DWORD)) { // DWORD - - // Simple Field (value) - Long value = /*TODO: migrate me*/ /*TODO: migrate me*/ readBuffer.readUnsignedLong("", 32); - - return new PlcDWORD(value); - } else if (EvaluationHelper.equals(valueType, Plc4xValueType.LWORD)) { // LWORD - - // Simple Field (value) - BigInteger value = /*TODO: migrate me*/ /*TODO: migrate me*/ - readBuffer.readUnsignedBigInteger("", 64); - - return new PlcLWORD(value); - } else if (EvaluationHelper.equals(valueType, Plc4xValueType.USINT)) { // USINT - - // Simple Field (value) - Short value = /*TODO: migrate me*/ /*TODO: migrate me*/ readBuffer.readUnsignedShort("", 8); - - return new PlcUSINT(value); - } else if (EvaluationHelper.equals(valueType, Plc4xValueType.UINT)) { // UINT - - // Simple Field (value) - Integer value = /*TODO: migrate me*/ /*TODO: migrate me*/ readBuffer.readUnsignedInt("", 16); - - return new PlcUINT(value); - } else if (EvaluationHelper.equals(valueType, Plc4xValueType.UDINT)) { // UDINT - - // Simple Field (value) - Long value = /*TODO: migrate me*/ /*TODO: migrate me*/ readBuffer.readUnsignedLong("", 32); - - return new PlcUDINT(value); - } else if (EvaluationHelper.equals(valueType, Plc4xValueType.ULINT)) { // ULINT - - // Simple Field (value) - BigInteger value = /*TODO: migrate me*/ /*TODO: migrate me*/ - readBuffer.readUnsignedBigInteger("", 64); - - return new PlcULINT(value); - } else if (EvaluationHelper.equals(valueType, Plc4xValueType.SINT)) { // SINT - - // Simple Field (value) - Byte value = /*TODO: migrate me*/ /*TODO: migrate me*/ readBuffer.readSignedByte("", 8); - - return new PlcSINT(value); - } else if (EvaluationHelper.equals(valueType, Plc4xValueType.INT)) { // INT - - // Simple Field (value) - Short value = /*TODO: migrate me*/ /*TODO: migrate me*/ readBuffer.readShort("", 16); - - return new PlcINT(value); - } else if (EvaluationHelper.equals(valueType, Plc4xValueType.DINT)) { // DINT - - // Simple Field (value) - Integer value = /*TODO: migrate me*/ /*TODO: migrate me*/ readBuffer.readInt("", 32); - - return new PlcDINT(value); - } else if (EvaluationHelper.equals(valueType, Plc4xValueType.LINT)) { // LINT - - // Simple Field (value) - Long value = /*TODO: migrate me*/ /*TODO: migrate me*/ readBuffer.readLong("", 64); - - return new PlcLINT(value); - } else if (EvaluationHelper.equals(valueType, Plc4xValueType.REAL)) { // REAL - - // Simple Field (value) - Float value = /*TODO: migrate me*/ /*TODO: migrate me*/ readBuffer.readFloat("", 32); - - return new PlcREAL(value); - } else if (EvaluationHelper.equals(valueType, Plc4xValueType.LREAL)) { // LREAL - - // Simple Field (value) - Double value = /*TODO: migrate me*/ /*TODO: migrate me*/ readBuffer.readDouble("", 64); - - return new PlcLREAL(value); - } else if (EvaluationHelper.equals(valueType, Plc4xValueType.CHAR)) { // STRING - - // Simple Field (value) - String value = /*TODO: migrate me*/ /*TODO: migrate me*/ - readBuffer.readString("", 8, WithOption.WithEncoding("UTF-8")); - - return new PlcSTRING(value); - } else if (EvaluationHelper.equals(valueType, Plc4xValueType.WCHAR)) { // STRING - - // Simple Field (value) - String value = /*TODO: migrate me*/ /*TODO: migrate me*/ - readBuffer.readString("", 16, WithOption.WithEncoding("UTF-16")); - - return new PlcSTRING(value); - } else if (EvaluationHelper.equals(valueType, Plc4xValueType.TIME)) { // TIME - - // Simple Field (milliseconds) - Long milliseconds = /*TODO: migrate me*/ /*TODO: migrate me*/ - readBuffer.readUnsignedLong("", 32); - - return PlcTIME.ofMilliseconds(milliseconds); - } else if (EvaluationHelper.equals(valueType, Plc4xValueType.LTIME)) { // LTIME - - // Simple Field (nanoseconds) - BigInteger nanoseconds = /*TODO: migrate me*/ /*TODO: migrate me*/ - readBuffer.readUnsignedBigInteger("", 64); - - return PlcLTIME.ofNanoseconds(nanoseconds); - } else if (EvaluationHelper.equals(valueType, Plc4xValueType.DATE)) { // DATE - - // Simple Field (secondsSinceEpoch) - Long secondsSinceEpoch = /*TODO: migrate me*/ /*TODO: migrate me*/ - readBuffer.readUnsignedLong("", 32); - - return PlcDATE.ofSecondsSinceEpoch(secondsSinceEpoch); - } else if (EvaluationHelper.equals(valueType, Plc4xValueType.LDATE)) { // LDATE - - // Simple Field (nanosecondsSinceEpoch) - BigInteger nanosecondsSinceEpoch = /*TODO: migrate me*/ /*TODO: migrate me*/ - readBuffer.readUnsignedBigInteger("", 64); - - return PlcLDATE.ofNanosecondsSinceEpoch(nanosecondsSinceEpoch); - } else if (EvaluationHelper.equals(valueType, Plc4xValueType.TIME_OF_DAY)) { // TIME_OF_DAY - - // Simple Field (millisecondsSinceMidnight) - Long millisecondsSinceMidnight = /*TODO: migrate me*/ /*TODO: migrate me*/ - readBuffer.readUnsignedLong("", 32); - - return PlcTIME_OF_DAY.ofMillisecondsSinceMidnight(millisecondsSinceMidnight); - } else if (EvaluationHelper.equals(valueType, Plc4xValueType.LTIME_OF_DAY)) { // LTIME_OF_DAY - - // Simple Field (nanosecondsSinceMidnight) - BigInteger nanosecondsSinceMidnight = /*TODO: migrate me*/ /*TODO: migrate me*/ - readBuffer.readUnsignedBigInteger("", 64); - - return PlcLTIME_OF_DAY.ofNanosecondsSinceMidnight(nanosecondsSinceMidnight); - } else if (EvaluationHelper.equals(valueType, Plc4xValueType.DATE_AND_TIME)) { // DATE_AND_TIME - - // Simple Field (secondsSinceEpoch) - Long secondsSinceEpoch = /*TODO: migrate me*/ /*TODO: migrate me*/ - readBuffer.readUnsignedLong("", 32); - - return PlcDATE_AND_TIME.ofSecondsSinceEpoch(secondsSinceEpoch); - } else if (EvaluationHelper.equals( - valueType, Plc4xValueType.LDATE_AND_TIME)) { // LDATE_AND_TIME - - // Simple Field (nanosecondsSinceEpoch) - BigInteger nanosecondsSinceEpoch = /*TODO: migrate me*/ /*TODO: migrate me*/ - readBuffer.readUnsignedBigInteger("", 64); - - return PlcLDATE_AND_TIME.ofNanosecondsSinceEpoch(nanosecondsSinceEpoch); - } else if (EvaluationHelper.equals(valueType, Plc4xValueType.Struct)) { // Struct - - Map _map = new HashMap<>(); - - return new PlcStruct(_map); - } - return null; - } - - public static void staticSerialize( - WriteBuffer writeBuffer, PlcValue _value, Plc4xValueType valueType) - throws SerializationException { - staticSerialize(writeBuffer, _value, valueType, ByteOrder.BIG_ENDIAN); - } - - public static void staticSerialize( - WriteBuffer writeBuffer, PlcValue _value, Plc4xValueType valueType, ByteOrder byteOrder) - throws SerializationException { - if (EvaluationHelper.equals(valueType, Plc4xValueType.BOOL)) { // BOOL - // Reserved Field - /*TODO: migrate me*/ - /*TODO: migrate me*/ writeBuffer.writeUnsignedByte("", 7, ((Number) (byte) 0x00).byteValue()); - // Simple Field (value) - boolean value = (boolean) _value.getBoolean(); - /*TODO: migrate me*/ - /*TODO: migrate me*/ writeBuffer.writeBit("", (boolean) (value)); - } else if (EvaluationHelper.equals(valueType, Plc4xValueType.BYTE)) { // BYTE - // Simple Field (value) - short value = (short) _value.getShort(); - /*TODO: migrate me*/ - /*TODO: migrate me*/ writeBuffer.writeUnsignedShort("", 8, ((Number) (value)).shortValue()); - } else if (EvaluationHelper.equals(valueType, Plc4xValueType.WORD)) { // WORD - // Simple Field (value) - int value = (int) _value.getInt(); - /*TODO: migrate me*/ - /*TODO: migrate me*/ writeBuffer.writeUnsignedInt("", 16, ((Number) (value)).intValue()); - } else if (EvaluationHelper.equals(valueType, Plc4xValueType.DWORD)) { // DWORD - // Simple Field (value) - long value = (long) _value.getLong(); - /*TODO: migrate me*/ - /*TODO: migrate me*/ writeBuffer.writeUnsignedLong("", 32, ((Number) (value)).longValue()); - } else if (EvaluationHelper.equals(valueType, Plc4xValueType.LWORD)) { // LWORD - // Simple Field (value) - BigInteger value = (BigInteger) _value.getBigInteger(); - /*TODO: migrate me*/ - /*TODO: migrate me*/ writeBuffer.writeUnsignedBigInteger("", 64, (BigInteger) (value)); - } else if (EvaluationHelper.equals(valueType, Plc4xValueType.USINT)) { // USINT - // Simple Field (value) - short value = (short) _value.getShort(); - /*TODO: migrate me*/ - /*TODO: migrate me*/ writeBuffer.writeUnsignedShort("", 8, ((Number) (value)).shortValue()); - } else if (EvaluationHelper.equals(valueType, Plc4xValueType.UINT)) { // UINT - // Simple Field (value) - int value = (int) _value.getInt(); - /*TODO: migrate me*/ - /*TODO: migrate me*/ writeBuffer.writeUnsignedInt("", 16, ((Number) (value)).intValue()); - } else if (EvaluationHelper.equals(valueType, Plc4xValueType.UDINT)) { // UDINT - // Simple Field (value) - long value = (long) _value.getLong(); - /*TODO: migrate me*/ - /*TODO: migrate me*/ writeBuffer.writeUnsignedLong("", 32, ((Number) (value)).longValue()); - } else if (EvaluationHelper.equals(valueType, Plc4xValueType.ULINT)) { // ULINT - // Simple Field (value) - BigInteger value = (BigInteger) _value.getBigInteger(); - /*TODO: migrate me*/ - /*TODO: migrate me*/ writeBuffer.writeUnsignedBigInteger("", 64, (BigInteger) (value)); - } else if (EvaluationHelper.equals(valueType, Plc4xValueType.SINT)) { // SINT - // Simple Field (value) - byte value = (byte) _value.getByte(); - /*TODO: migrate me*/ - /*TODO: migrate me*/ writeBuffer.writeSignedByte("", 8, ((Number) (value)).byteValue()); - } else if (EvaluationHelper.equals(valueType, Plc4xValueType.INT)) { // INT - // Simple Field (value) - short value = (short) _value.getShort(); - /*TODO: migrate me*/ - /*TODO: migrate me*/ writeBuffer.writeShort("", 16, ((Number) (value)).shortValue()); - } else if (EvaluationHelper.equals(valueType, Plc4xValueType.DINT)) { // DINT - // Simple Field (value) - int value = (int) _value.getInt(); - /*TODO: migrate me*/ - /*TODO: migrate me*/ writeBuffer.writeInt("", 32, ((Number) (value)).intValue()); - } else if (EvaluationHelper.equals(valueType, Plc4xValueType.LINT)) { // LINT - // Simple Field (value) - long value = (long) _value.getLong(); - /*TODO: migrate me*/ - /*TODO: migrate me*/ writeBuffer.writeLong("", 64, ((Number) (value)).longValue()); - } else if (EvaluationHelper.equals(valueType, Plc4xValueType.REAL)) { // REAL - // Simple Field (value) - float value = (float) _value.getFloat(); - /*TODO: migrate me*/ - /*TODO: migrate me*/ writeBuffer.writeFloat("", 32, (value)); - } else if (EvaluationHelper.equals(valueType, Plc4xValueType.LREAL)) { // LREAL - // Simple Field (value) - double value = (double) _value.getDouble(); - /*TODO: migrate me*/ - /*TODO: migrate me*/ writeBuffer.writeDouble("", 64, (value)); - } else if (EvaluationHelper.equals(valueType, Plc4xValueType.CHAR)) { // STRING - // Simple Field (value) - String value = (String) _value.getString(); - /*TODO: migrate me*/ - /*TODO: migrate me*/ writeBuffer.writeString( - "", 8, (String) (value), WithOption.WithEncoding("UTF-8")); - } else if (EvaluationHelper.equals(valueType, Plc4xValueType.WCHAR)) { // STRING - // Simple Field (value) - String value = (String) _value.getString(); - /*TODO: migrate me*/ - /*TODO: migrate me*/ writeBuffer.writeString( - "", 16, (String) (value), WithOption.WithEncoding("UTF-16")); - } else if (EvaluationHelper.equals(valueType, Plc4xValueType.TIME)) { // TIME - // Simple Field (milliseconds) - long milliseconds = (long) _value.getLong(); - /*TODO: migrate me*/ - /*TODO: migrate me*/ writeBuffer.writeUnsignedLong( - "", 32, ((Number) (milliseconds)).longValue()); - } else if (EvaluationHelper.equals(valueType, Plc4xValueType.LTIME)) { // LTIME - // Simple Field (nanoseconds) - BigInteger nanoseconds = (BigInteger) _value.getBigInteger(); - /*TODO: migrate me*/ - /*TODO: migrate me*/ writeBuffer.writeUnsignedBigInteger("", 64, (BigInteger) (nanoseconds)); - } else if (EvaluationHelper.equals(valueType, Plc4xValueType.DATE)) { // DATE - // Simple Field (secondsSinceEpoch) - long secondsSinceEpoch = (long) _value.getLong(); - /*TODO: migrate me*/ - /*TODO: migrate me*/ writeBuffer.writeUnsignedLong( - "", 32, ((Number) (secondsSinceEpoch)).longValue()); - } else if (EvaluationHelper.equals(valueType, Plc4xValueType.LDATE)) { // LDATE - // Simple Field (nanosecondsSinceEpoch) - BigInteger nanosecondsSinceEpoch = (BigInteger) _value.getBigInteger(); - /*TODO: migrate me*/ - /*TODO: migrate me*/ writeBuffer.writeUnsignedBigInteger( - "", 64, (BigInteger) (nanosecondsSinceEpoch)); - } else if (EvaluationHelper.equals(valueType, Plc4xValueType.TIME_OF_DAY)) { // TIME_OF_DAY - // Simple Field (millisecondsSinceMidnight) - long millisecondsSinceMidnight = (long) _value.getLong(); - /*TODO: migrate me*/ - /*TODO: migrate me*/ writeBuffer.writeUnsignedLong( - "", 32, ((Number) (millisecondsSinceMidnight)).longValue()); - } else if (EvaluationHelper.equals(valueType, Plc4xValueType.LTIME_OF_DAY)) { // LTIME_OF_DAY - // Simple Field (nanosecondsSinceMidnight) - BigInteger nanosecondsSinceMidnight = (BigInteger) _value.getBigInteger(); - /*TODO: migrate me*/ - /*TODO: migrate me*/ writeBuffer.writeUnsignedBigInteger( - "", 64, (BigInteger) (nanosecondsSinceMidnight)); - } else if (EvaluationHelper.equals(valueType, Plc4xValueType.DATE_AND_TIME)) { // DATE_AND_TIME - // Simple Field (secondsSinceEpoch) - long secondsSinceEpoch = (long) _value.getLong(); - /*TODO: migrate me*/ - /*TODO: migrate me*/ writeBuffer.writeUnsignedLong( - "", 32, ((Number) (secondsSinceEpoch)).longValue()); - } else if (EvaluationHelper.equals( - valueType, Plc4xValueType.LDATE_AND_TIME)) { // LDATE_AND_TIME - // Simple Field (nanosecondsSinceEpoch) - BigInteger nanosecondsSinceEpoch = (BigInteger) _value.getBigInteger(); - /*TODO: migrate me*/ - /*TODO: migrate me*/ writeBuffer.writeUnsignedBigInteger( - "", 64, (BigInteger) (nanosecondsSinceEpoch)); - } else if (EvaluationHelper.equals(valueType, Plc4xValueType.Struct)) { // Struct - } - } - - public static int getLengthInBytes(PlcValue _value, Plc4xValueType valueType) { - return (int) Math.ceil((float) getLengthInBits(_value, valueType) / 8.0); - } - - public static int getLengthInBits(PlcValue _value, Plc4xValueType valueType) { - int sizeInBits = 0; - if (EvaluationHelper.equals(valueType, Plc4xValueType.BOOL)) { // BOOL - // Reserved Field - sizeInBits += 7; - // Simple Field (value) - sizeInBits += 1; - } else if (EvaluationHelper.equals(valueType, Plc4xValueType.BYTE)) { // BYTE - // Simple Field (value) - sizeInBits += 8; - } else if (EvaluationHelper.equals(valueType, Plc4xValueType.WORD)) { // WORD - // Simple Field (value) - sizeInBits += 16; - } else if (EvaluationHelper.equals(valueType, Plc4xValueType.DWORD)) { // DWORD - // Simple Field (value) - sizeInBits += 32; - } else if (EvaluationHelper.equals(valueType, Plc4xValueType.LWORD)) { // LWORD - // Simple Field (value) - sizeInBits += 64; - } else if (EvaluationHelper.equals(valueType, Plc4xValueType.USINT)) { // USINT - // Simple Field (value) - sizeInBits += 8; - } else if (EvaluationHelper.equals(valueType, Plc4xValueType.UINT)) { // UINT - // Simple Field (value) - sizeInBits += 16; - } else if (EvaluationHelper.equals(valueType, Plc4xValueType.UDINT)) { // UDINT - // Simple Field (value) - sizeInBits += 32; - } else if (EvaluationHelper.equals(valueType, Plc4xValueType.ULINT)) { // ULINT - // Simple Field (value) - sizeInBits += 64; - } else if (EvaluationHelper.equals(valueType, Plc4xValueType.SINT)) { // SINT - // Simple Field (value) - sizeInBits += 8; - } else if (EvaluationHelper.equals(valueType, Plc4xValueType.INT)) { // INT - // Simple Field (value) - sizeInBits += 16; - } else if (EvaluationHelper.equals(valueType, Plc4xValueType.DINT)) { // DINT - // Simple Field (value) - sizeInBits += 32; - } else if (EvaluationHelper.equals(valueType, Plc4xValueType.LINT)) { // LINT - // Simple Field (value) - sizeInBits += 64; - } else if (EvaluationHelper.equals(valueType, Plc4xValueType.REAL)) { // REAL - // Simple Field (value) - sizeInBits += 32; - } else if (EvaluationHelper.equals(valueType, Plc4xValueType.LREAL)) { // LREAL - // Simple Field (value) - sizeInBits += 64; - } else if (EvaluationHelper.equals(valueType, Plc4xValueType.CHAR)) { // STRING - // Simple Field (value) - sizeInBits += 8; - } else if (EvaluationHelper.equals(valueType, Plc4xValueType.WCHAR)) { // STRING - // Simple Field (value) - sizeInBits += 16; - } else if (EvaluationHelper.equals(valueType, Plc4xValueType.TIME)) { // TIME - // Simple Field (milliseconds) - sizeInBits += 32; - } else if (EvaluationHelper.equals(valueType, Plc4xValueType.LTIME)) { // LTIME - // Simple Field (nanoseconds) - sizeInBits += 64; - } else if (EvaluationHelper.equals(valueType, Plc4xValueType.DATE)) { // DATE - // Simple Field (secondsSinceEpoch) - sizeInBits += 32; - } else if (EvaluationHelper.equals(valueType, Plc4xValueType.LDATE)) { // LDATE - // Simple Field (nanosecondsSinceEpoch) - sizeInBits += 64; - } else if (EvaluationHelper.equals(valueType, Plc4xValueType.TIME_OF_DAY)) { // TIME_OF_DAY - // Simple Field (millisecondsSinceMidnight) - sizeInBits += 32; - } else if (EvaluationHelper.equals(valueType, Plc4xValueType.LTIME_OF_DAY)) { // LTIME_OF_DAY - // Simple Field (nanosecondsSinceMidnight) - sizeInBits += 64; - } else if (EvaluationHelper.equals(valueType, Plc4xValueType.DATE_AND_TIME)) { // DATE_AND_TIME - // Simple Field (secondsSinceEpoch) - sizeInBits += 32; - } else if (EvaluationHelper.equals( - valueType, Plc4xValueType.LDATE_AND_TIME)) { // LDATE_AND_TIME - // Simple Field (nanosecondsSinceEpoch) - sizeInBits += 64; - } else if (EvaluationHelper.equals(valueType, Plc4xValueType.Struct)) { // Struct - } - return sizeInBits; - } -} diff --git a/plc4j/tools/plc4x-server/src/main/generated/org/apache/plc4x/java/plc4x/readwrite/Plc4xValueType.java b/plc4j/tools/plc4x-server/src/main/generated/org/apache/plc4x/java/plc4x/readwrite/Plc4xValueType.java deleted file mode 100644 index 58e6216e8dc..00000000000 --- a/plc4j/tools/plc4x-server/src/main/generated/org/apache/plc4x/java/plc4x/readwrite/Plc4xValueType.java +++ /dev/null @@ -1,84 +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.plc4x.readwrite; - -import java.util.HashMap; -import java.util.Map; - -// Code generated by code-generation. DO NOT EDIT. - -public enum Plc4xValueType { - NULL((short) 0x00), - BOOL((short) 0x01), - BYTE((short) 0x02), - WORD((short) 0x03), - DWORD((short) 0x04), - LWORD((short) 0x05), - USINT((short) 0x11), - UINT((short) 0x12), - UDINT((short) 0x13), - ULINT((short) 0x14), - SINT((short) 0x21), - INT((short) 0x22), - DINT((short) 0x23), - LINT((short) 0x24), - REAL((short) 0x31), - LREAL((short) 0x32), - CHAR((short) 0x41), - WCHAR((short) 0x42), - STRING((short) 0x43), - WSTRING((short) 0x44), - TIME((short) 0x51), - LTIME((short) 0x52), - DATE((short) 0x53), - LDATE((short) 0x54), - TIME_OF_DAY((short) 0x55), - LTIME_OF_DAY((short) 0x56), - DATE_AND_TIME((short) 0x57), - LDATE_AND_TIME((short) 0x58), - Struct((short) 0x61), - List((short) 0x62), - RAW_BYTE_ARRAY((short) 0x71); - private static final Map map; - - static { - map = new HashMap<>(); - for (Plc4xValueType value : Plc4xValueType.values()) { - map.put((short) value.getValue(), value); - } - } - - private final short value; - - Plc4xValueType(short value) { - this.value = value; - } - - public short getValue() { - return value; - } - - public static Plc4xValueType enumForValue(short value) { - return map.get(value); - } - - public static Boolean isDefined(short value) { - return map.containsKey(value); - } -} diff --git a/plc4j/tools/plc4x-server/src/main/generated/org/apache/plc4x/java/plc4x/readwrite/Plc4xWriteRequest.java b/plc4j/tools/plc4x-server/src/main/generated/org/apache/plc4x/java/plc4x/readwrite/Plc4xWriteRequest.java deleted file mode 100644 index 8020ba0d7ca..00000000000 --- a/plc4j/tools/plc4x-server/src/main/generated/org/apache/plc4x/java/plc4x/readwrite/Plc4xWriteRequest.java +++ /dev/null @@ -1,197 +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.plc4x.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class Plc4xWriteRequest extends Plc4xMessage implements Message { - - // Accessors for discriminator values. - public Plc4xRequestType getRequestType() { - return Plc4xRequestType.WRITE_REQUEST; - } - - // Properties. - protected final int connectionId; - protected final List tags; - - public Plc4xWriteRequest(int requestId, int connectionId, List tags) { - super(requestId); - this.connectionId = connectionId; - this.tags = tags; - } - - public int getConnectionId() { - return connectionId; - } - - public List getTags() { - return tags; - } - - @Override - protected void serializePlc4xMessageChild(WriteBuffer writeBuffer) throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("Plc4xWriteRequest"); - - // Simple Field (connectionId) - writeSimpleField( - "connectionId", - connectionId, - writeUnsignedInt(writeBuffer, 16), - WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN)); - - // Implicit Field (numTags) (Used for parsing, but its value is not stored as it's implicitly - // given by the objects content) - short numTags = (short) (COUNT(getTags())); - writeImplicitField( - "numTags", - numTags, - writeUnsignedShort(writeBuffer, 8), - WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN)); - - // Array Field (tags) - writeComplexTypeArrayField( - "tags", tags, writeBuffer, WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN)); - - writeBuffer.popContext("Plc4xWriteRequest"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = super.getLengthInBits(); - Plc4xWriteRequest _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Simple field (connectionId) - lengthInBits += 16; - - // Implicit Field (numTags) - lengthInBits += 8; - - // Array field - if (tags != null) { - int i = 0; - for (Plc4xTagValueRequest element : tags) { - ThreadLocalHelper.lastItemThreadLocal.set(++i >= tags.size()); - lengthInBits += element.getLengthInBits(); - } - } - - return lengthInBits; - } - - public static Plc4xMessageBuilder staticParsePlc4xMessageBuilder(ReadBuffer readBuffer) - throws ParseException { - readBuffer.pullContext("Plc4xWriteRequest"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - int connectionId = - readSimpleField( - "connectionId", - readUnsignedInt(readBuffer, 16), - WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN)); - - short numTags = - readImplicitField( - "numTags", - readUnsignedShort(readBuffer, 8), - WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN)); - - List tags = - readCountArrayField( - "tags", - new DataReaderComplexDefault<>( - () -> Plc4xTagValueRequest.staticParse(readBuffer), readBuffer), - numTags, - WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN)); - - readBuffer.closeContext("Plc4xWriteRequest"); - // Create the instance - return new Plc4xWriteRequestBuilderImpl(connectionId, tags); - } - - public static class Plc4xWriteRequestBuilderImpl implements Plc4xMessage.Plc4xMessageBuilder { - private final int connectionId; - private final List tags; - - public Plc4xWriteRequestBuilderImpl(int connectionId, List tags) { - this.connectionId = connectionId; - this.tags = tags; - } - - public Plc4xWriteRequest build(int requestId) { - Plc4xWriteRequest plc4xWriteRequest = new Plc4xWriteRequest(requestId, connectionId, tags); - return plc4xWriteRequest; - } - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof Plc4xWriteRequest)) { - return false; - } - Plc4xWriteRequest that = (Plc4xWriteRequest) o; - return (getConnectionId() == that.getConnectionId()) - && (getTags() == that.getTags()) - && super.equals(that) - && true; - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode(), getConnectionId(), getTags()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/tools/plc4x-server/src/main/generated/org/apache/plc4x/java/plc4x/readwrite/Plc4xWriteResponse.java b/plc4j/tools/plc4x-server/src/main/generated/org/apache/plc4x/java/plc4x/readwrite/Plc4xWriteResponse.java deleted file mode 100644 index 7966508f0c6..00000000000 --- a/plc4j/tools/plc4x-server/src/main/generated/org/apache/plc4x/java/plc4x/readwrite/Plc4xWriteResponse.java +++ /dev/null @@ -1,234 +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.plc4x.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class Plc4xWriteResponse extends Plc4xMessage implements Message { - - // Accessors for discriminator values. - public Plc4xRequestType getRequestType() { - return Plc4xRequestType.WRITE_RESPONSE; - } - - // Properties. - protected final int connectionId; - protected final Plc4xResponseCode responseCode; - protected final List tags; - - public Plc4xWriteResponse( - int requestId, - int connectionId, - Plc4xResponseCode responseCode, - List tags) { - super(requestId); - this.connectionId = connectionId; - this.responseCode = responseCode; - this.tags = tags; - } - - public int getConnectionId() { - return connectionId; - } - - public Plc4xResponseCode getResponseCode() { - return responseCode; - } - - public List getTags() { - return tags; - } - - @Override - protected void serializePlc4xMessageChild(WriteBuffer writeBuffer) throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("Plc4xWriteResponse"); - - // Simple Field (connectionId) - writeSimpleField( - "connectionId", - connectionId, - writeUnsignedInt(writeBuffer, 16), - WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN)); - - // Simple Field (responseCode) - writeSimpleEnumField( - "responseCode", - "Plc4xResponseCode", - responseCode, - new DataWriterEnumDefault<>( - Plc4xResponseCode::getValue, - Plc4xResponseCode::name, - writeUnsignedShort(writeBuffer, 8)), - WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN)); - - // Implicit Field (numTags) (Used for parsing, but its value is not stored as it's implicitly - // given by the objects content) - short numTags = (short) (COUNT(getTags())); - writeImplicitField( - "numTags", - numTags, - writeUnsignedShort(writeBuffer, 8), - WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN)); - - // Array Field (tags) - writeComplexTypeArrayField( - "tags", tags, writeBuffer, WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN)); - - writeBuffer.popContext("Plc4xWriteResponse"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = super.getLengthInBits(); - Plc4xWriteResponse _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Simple field (connectionId) - lengthInBits += 16; - - // Simple field (responseCode) - lengthInBits += 8; - - // Implicit Field (numTags) - lengthInBits += 8; - - // Array field - if (tags != null) { - int i = 0; - for (Plc4xTagResponse element : tags) { - ThreadLocalHelper.lastItemThreadLocal.set(++i >= tags.size()); - lengthInBits += element.getLengthInBits(); - } - } - - return lengthInBits; - } - - public static Plc4xMessageBuilder staticParsePlc4xMessageBuilder(ReadBuffer readBuffer) - throws ParseException { - readBuffer.pullContext("Plc4xWriteResponse"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - int connectionId = - readSimpleField( - "connectionId", - readUnsignedInt(readBuffer, 16), - WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN)); - - Plc4xResponseCode responseCode = - readEnumField( - "responseCode", - "Plc4xResponseCode", - new DataReaderEnumDefault<>( - Plc4xResponseCode::enumForValue, readUnsignedShort(readBuffer, 8)), - WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN)); - - short numTags = - readImplicitField( - "numTags", - readUnsignedShort(readBuffer, 8), - WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN)); - - List tags = - readCountArrayField( - "tags", - new DataReaderComplexDefault<>( - () -> Plc4xTagResponse.staticParse(readBuffer), readBuffer), - numTags, - WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN)); - - readBuffer.closeContext("Plc4xWriteResponse"); - // Create the instance - return new Plc4xWriteResponseBuilderImpl(connectionId, responseCode, tags); - } - - public static class Plc4xWriteResponseBuilderImpl implements Plc4xMessage.Plc4xMessageBuilder { - private final int connectionId; - private final Plc4xResponseCode responseCode; - private final List tags; - - public Plc4xWriteResponseBuilderImpl( - int connectionId, Plc4xResponseCode responseCode, List tags) { - this.connectionId = connectionId; - this.responseCode = responseCode; - this.tags = tags; - } - - public Plc4xWriteResponse build(int requestId) { - Plc4xWriteResponse plc4xWriteResponse = - new Plc4xWriteResponse(requestId, connectionId, responseCode, tags); - return plc4xWriteResponse; - } - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof Plc4xWriteResponse)) { - return false; - } - Plc4xWriteResponse that = (Plc4xWriteResponse) o; - return (getConnectionId() == that.getConnectionId()) - && (getResponseCode() == that.getResponseCode()) - && (getTags() == that.getTags()) - && super.equals(that) - && true; - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode(), getConnectionId(), getResponseCode(), getTags()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/transports/socketcan/pom.xml b/plc4j/transports/socketcan/pom.xml index c5e9b8975d9..ede13ef581b 100644 --- a/plc4j/transports/socketcan/pom.xml +++ b/plc4j/transports/socketcan/pom.xml @@ -72,19 +72,6 @@ javacan-core - - org.apache.plc4x - plc4x-protocols-socketcan - 0.12.0-SNAPSHOT - provided - - - org.apache.plc4x - plc4x-code-generation-language-java - 0.12.0-SNAPSHOT - provided - - io.netty netty-transport @@ -121,6 +108,22 @@ + + + + org.apache.plc4x + plc4x-protocols-socketcan + 0.12.0-SNAPSHOT + provided + + + + org.apache.plc4x + plc4x-code-generation-language-java + 0.12.0-SNAPSHOT + provided + + diff --git a/plc4net/pom.xml b/plc4net/pom.xml index 9fe1f3d49d2..570c23da41d 100644 --- a/plc4net/pom.xml +++ b/plc4net/pom.xml @@ -96,24 +96,6 @@ - - - org.apache.plc4x - plc4x-code-generation-language-cs - 0.12.0-SNAPSHOT - - provided - - - - org.apache.plc4x - plc4x-protocols-knxnetip - 0.12.0-SNAPSHOT - - provided - - - update-generated-code @@ -140,6 +122,24 @@ + + + + org.apache.plc4x + plc4x-code-generation-language-cs + 0.12.0-SNAPSHOT + + provided + + + + org.apache.plc4x + plc4x-protocols-knxnetip + 0.12.0-SNAPSHOT + + provided + + diff --git a/pom.xml b/pom.xml index 9bdd1a4c9b3..4c48b3f3f68 100644 --- a/pom.xml +++ b/pom.xml @@ -589,6 +589,18 @@ 3.2.4 + + org.skyscreamer + jsonassert + 1.5.1 + + + com.vaadin.external.google + android-json + + + + - provided - - - - org.apache.plc4x - plc4x-protocols-modbus - 0.12.0-SNAPSHOT - - provided - - - - org.apache.plc4x - plc4x-protocols-simulated - 0.12.0-SNAPSHOT - - provided - - - update-generated-code @@ -289,6 +262,32 @@ + + + + org.apache.plc4x + plc4x-code-generation-language-python + 0.12.0-SNAPSHOT + + provided + + + + org.apache.plc4x + plc4x-protocols-modbus + 0.12.0-SNAPSHOT + + provided + + + + org.apache.plc4x + plc4x-protocols-simulated + 0.12.0-SNAPSHOT + + provided + + diff --git a/sandbox/test-java-df1-driver/pom.xml b/sandbox/test-java-df1-driver/pom.xml index a71e497936d..fea255c5d3e 100644 --- a/sandbox/test-java-df1-driver/pom.xml +++ b/sandbox/test-java-df1-driver/pom.xml @@ -30,30 +30,6 @@ Sandbox: Test Df1 Driver - - - - org.apache.plc4x.plugins - plc4x-maven-plugin - - - generate-driver - generate-sources - - generate-driver - - - df1 - java - read-write - src/main/generated - - - - - - - org.apache.plc4x @@ -140,22 +116,6 @@ test - - org.apache.plc4x - plc4x-code-generation-language-java - 0.12.0-SNAPSHOT - - provided - - - - org.apache.plc4x - plc4x-protocols-df1 - 0.12.0-SNAPSHOT - - provided - - org.apache.plc4x plc4x-protocols-df1 @@ -171,8 +131,45 @@ update-generated-code + + org.apache.plc4x.plugins + plc4x-maven-plugin + + + generate-driver + generate-sources + + generate-driver + + + df1 + java + read-write + src/main/generated + + + + + + + + org.apache.plc4x + plc4x-code-generation-language-java + 0.12.0-SNAPSHOT + + provided + + + + org.apache.plc4x + plc4x-protocols-df1 + 0.12.0-SNAPSHOT + + provided + +