You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by cd...@apache.org on 2019/12/09 14:26:55 UTC

[plc4x] branch feature/knxnet-ip updated (3887da1 -> ad5daf1)

This is an automated email from the ASF dual-hosted git repository.

cdutz pushed a change to branch feature/knxnet-ip
in repository https://gitbox.apache.org/repos/asf/plc4x.git.


    from 3887da1  - Refactored the StreamPipes components - Updated to the latest SP version
     new aab7db3  Made the java template output Enum constants in expressions correctly
     new 04ed0b4  Fixed the interpretation of 8/16/32 bit integers
     new d5bf869  If the connection request is not "OK", then some fields are not transmitted (So I made them optional)
     new ad5daf1  Updated to the latest StreamPipes version

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../language/java/JavaLanguageTemplateHelper.java  |   8 +-
 pom.xml                                            |  10 ++
 .../main/resources/protocols/knxnetip/ets5.mspec   |   8 ++
 .../resources/protocols/knxnetip/knxnetip.mspec    |  10 +-
 .../env/development                                |   9 +-
 sandbox/test-streampipes-plc4x-adapters/pom.xml    | 102 +++++++--------------
 .../adapters/source/knxnetip/KnxNetIpAdapter.java  |   7 ++
 .../env/development                                |   3 +-
 sandbox/test-streampipes-plc4x-processors/pom.xml  |  86 +++++++----------
 .../enrich/knxnetip/ets5/Ets5DataEnrichment.java   |   2 +
 .../ets5/Ets5DataEnrichmentController.java         |  14 ++-
 .../strings.en                                     |   3 +
 12 files changed, 127 insertions(+), 135 deletions(-)


[plc4x] 01/04: Made the java template output Enum constants in expressions correctly

Posted by cd...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

cdutz pushed a commit to branch feature/knxnet-ip
in repository https://gitbox.apache.org/repos/asf/plc4x.git

commit aab7db394c799b8a7e85a48df2ee3a1ee95ba3f2
Author: Christofer Dutz <ch...@c-ware.de>
AuthorDate: Mon Dec 9 15:24:43 2019 +0100

    Made the java template output Enum constants in expressions correctly
---
 .../apache/plc4x/language/java/JavaLanguageTemplateHelper.java    | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/build-utils/language-java/src/main/java/org/apache/plc4x/language/java/JavaLanguageTemplateHelper.java b/build-utils/language-java/src/main/java/org/apache/plc4x/language/java/JavaLanguageTemplateHelper.java
index 2dc72ba..23101f6 100644
--- a/build-utils/language-java/src/main/java/org/apache/plc4x/language/java/JavaLanguageTemplateHelper.java
+++ b/build-utils/language-java/src/main/java/org/apache/plc4x/language/java/JavaLanguageTemplateHelper.java
@@ -401,7 +401,13 @@ public class JavaLanguageTemplateHelper implements FreemarkerLanguageTemplateHel
             } else if(term instanceof StringLiteral) {
                 return "\"" + ((StringLiteral) term).getValue() + "\"";
             } else if(term instanceof VariableLiteral) {
-                return variableExpressionGenerator.apply(term);
+                VariableLiteral variableLiteral = (VariableLiteral) term;
+                // If this literal references an Enum type, then we have to output it differently.
+                if(types.get(variableLiteral.getName()) instanceof EnumTypeDefinition) {
+                    return variableLiteral.getName() + "." + variableLiteral.getChild().getName();
+                } else {
+                    return variableExpressionGenerator.apply(term);
+                }
             } else {
                 throw new RuntimeException("Unsupported Literal type " + term.getClass().getName());
             }


[plc4x] 03/04: If the connection request is not "OK", then some fields are not transmitted (So I made them optional)

Posted by cd...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

cdutz pushed a commit to branch feature/knxnet-ip
in repository https://gitbox.apache.org/repos/asf/plc4x.git

commit d5bf86924c75fa24d5898fbd8d2af22a9ce0ed97
Author: Christofer Dutz <ch...@c-ware.de>
AuthorDate: Mon Dec 9 15:26:20 2019 +0100

    If the connection request is not "OK", then some fields are not transmitted (So I made them optional)
---
 .../src/main/resources/protocols/knxnetip/knxnetip.mspec       | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/protocols/knxnetip/src/main/resources/protocols/knxnetip/knxnetip.mspec b/protocols/knxnetip/src/main/resources/protocols/knxnetip/knxnetip.mspec
index 9535903..2434cc5 100644
--- a/protocols/knxnetip/src/main/resources/protocols/knxnetip/knxnetip.mspec
+++ b/protocols/knxnetip/src/main/resources/protocols/knxnetip/knxnetip.mspec
@@ -21,7 +21,7 @@
     [implicit      uint 8  'headerLength'    '6']
     [const         uint 8  'protocolVersion' '0x10']
     [discriminator uint 16 'msgType']
-    [implicit      uint 16 'totalLength' 'lengthInBytes']
+    [implicit      uint 16 'totalLength'     'lengthInBytes']
     [typeSwitch 'msgType'
         ['0x0201' SearchRequest
             [simple HPAIDiscoveryEndpoint 'hpaiIDiscoveryEndpoint']
@@ -44,10 +44,10 @@
             [simple ConnectionRequestInformation 'connectionRequestInformation']
         ]
         ['0x0206' ConnectionResponse
-            [simple uint 8 'communicationChannelId']
-            [enum   Status 'status']
-            [simple HPAIDataEndpoint            'hpaiDataEndpoint']
-            [simple ConnectionResponseDataBlock 'connectionResponseDataBlock']
+            [simple   uint 8 'communicationChannelId']
+            [enum     Status 'status']
+            [optional HPAIDataEndpoint            'hpaiDataEndpoint'            'status == Status.NO_ERROR']
+            [optional ConnectionResponseDataBlock 'connectionResponseDataBlock' 'status == Status.NO_ERROR']
         ]
         ['0x0207' ConnectionStateRequest
             [simple   uint 8 'communicationChannelId']


[plc4x] 04/04: Updated to the latest StreamPipes version

Posted by cd...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

cdutz pushed a commit to branch feature/knxnet-ip
in repository https://gitbox.apache.org/repos/asf/plc4x.git

commit ad5daf11a89a1bbab6a39228b5f96fb7779c6532
Author: Christofer Dutz <ch...@c-ware.de>
AuthorDate: Mon Dec 9 15:26:46 2019 +0100

    Updated to the latest StreamPipes version
---
 pom.xml                                            |  10 ++
 .../env/development                                |   9 +-
 sandbox/test-streampipes-plc4x-adapters/pom.xml    | 102 +++++++--------------
 .../adapters/source/knxnetip/KnxNetIpAdapter.java  |   7 ++
 .../env/development                                |   3 +-
 sandbox/test-streampipes-plc4x-processors/pom.xml  |  86 +++++++----------
 .../enrich/knxnetip/ets5/Ets5DataEnrichment.java   |   2 +
 .../ets5/Ets5DataEnrichmentController.java         |  14 ++-
 .../strings.en                                     |   3 +
 9 files changed, 107 insertions(+), 129 deletions(-)

diff --git a/pom.xml b/pom.xml
index efb7a2e..a3e4e5e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -338,6 +338,16 @@
         <version>${netty.version}</version>
       </dependency>
       <dependency>
+        <groupId>jakarta.annotation</groupId>
+        <artifactId>jakarta.annotation-api</artifactId>
+        <version>1.3.5</version>
+      </dependency>
+      <dependency>
+        <groupId>jakarta.validation</groupId>
+        <artifactId>jakarta.validation-api</artifactId>
+        <version>2.0.2</version>
+      </dependency>
+      <dependency>
         <groupId>javax.annotation</groupId>
         <artifactId>javax.annotation-api</artifactId>
         <version>1.3.2</version>
diff --git a/sandbox/test-streampipes-plc4x-adapters/env/development b/sandbox/test-streampipes-plc4x-adapters/env/development
index 8e06237..1d1b919 100644
--- a/sandbox/test-streampipes-plc4x-adapters/env/development
+++ b/sandbox/test-streampipes-plc4x-adapters/env/development
@@ -18,10 +18,9 @@
 # ----------------------------------------------------------------------------
 
 # Redirect some parameters for local development.
-SP_KAFKA_HOST=host.docker.internal
-SP_CONNECT_CONTAINER_HOST=localhost
-SP_CONNECT_CONTAINER_MASTER_HOST=localhost
 SP_CONNECT_CONTAINER_WORKER_HOST=host.docker.internal
-SP_CONNECT_CONTAINER_WORKER_PORT=8198
+SP_CONNECT_CONTAINER_HOST=host.docker.internal
+SP_CONNECT_CONTAINER_MASTER_HOST=localhost
 SP_DATA_LOCATION=./test_data/
-
+SP_DEBUG=true
+SP_DEBUG_CONNECT=false
\ No newline at end of file
diff --git a/sandbox/test-streampipes-plc4x-adapters/pom.xml b/sandbox/test-streampipes-plc4x-adapters/pom.xml
index 05c5cf5..f9a03a8 100644
--- a/sandbox/test-streampipes-plc4x-adapters/pom.xml
+++ b/sandbox/test-streampipes-plc4x-adapters/pom.xml
@@ -33,7 +33,7 @@
   <name>Sandbox: StreamPipes Adapters</name>
 
   <properties>
-    <streampipes.version>0.64.0</streampipes.version>
+    <streampipes.version>0.65.0</streampipes.version>
   </properties>
 
   <dependencies>
@@ -82,36 +82,40 @@
       <version>${streampipes.version}</version>
       <exclusions>
         <exclusion>
-          <groupId>org.jboss.spec.javax.annotation</groupId>
-          <artifactId>jboss-annotations-api_1.2_spec</artifactId>
+          <artifactId>javax.ws.rs-api</artifactId>
+          <groupId>javax.ws.rs</groupId>
         </exclusion>
         <exclusion>
-          <groupId>org.glassfish.hk2.external</groupId>
-          <artifactId>javax.inject</artifactId>
+          <artifactId>javax.servlet-api</artifactId>
+          <groupId>javax.servlet</groupId>
         </exclusion>
         <exclusion>
-          <groupId>org.glassfish.hk2.external</groupId>
-          <artifactId>aopalliance-repackaged</artifactId>
+          <artifactId>javax.annotation-api</artifactId>
+          <groupId>javax.annotation</groupId>
+        </exclusion>
+        <exclusion>
+          <artifactId>javax.inject</artifactId>
+          <groupId>javax.inject</groupId>
         </exclusion>
         <exclusion>
-          <groupId>aopalliance</groupId>
           <artifactId>aopalliance</artifactId>
+          <groupId>aopalliance</groupId>
         </exclusion>
         <exclusion>
-          <groupId>org.glassfish</groupId>
-          <artifactId>javax.el</artifactId>
+          <artifactId>aopalliance-repackaged</artifactId>
+          <groupId>org.glassfish.hk2.external</groupId>
         </exclusion>
         <exclusion>
-          <groupId>org.ow2.spec.ee</groupId>
-          <artifactId>ow2-jpa-1.0-spec</artifactId>
+          <artifactId>tomcat-embed-el</artifactId>
+          <groupId>org.apache.tomcat.embed</groupId>
         </exclusion>
         <exclusion>
-          <groupId>commons-logging</groupId>
-          <artifactId>commons-logging</artifactId>
+          <artifactId>persistence-api</artifactId>
+          <groupId>javax.persistence</groupId>
         </exclusion>
         <exclusion>
-          <groupId>com.google.code.findbugs</groupId>
-          <artifactId>jsr305</artifactId>
+          <artifactId>jboss-annotations-api_1.2_spec</artifactId>
+          <groupId>org.jboss.spec.javax.annotation</groupId>
         </exclusion>
       </exclusions>
     </dependency>
@@ -122,10 +126,6 @@
     </dependency>
 
     <dependency>
-      <groupId>javax.validation</groupId>
-      <artifactId>validation-api</artifactId>
-    </dependency>
-    <dependency>
       <groupId>ch.qos.logback</groupId>
       <artifactId>logback-classic</artifactId>
       <scope>compile</scope>
@@ -146,83 +146,51 @@
   <dependencyManagement>
     <dependencies>
       <dependency>
-        <groupId>commons-beanutils</groupId>
-        <artifactId>commons-beanutils</artifactId>
-        <version>1.9.4</version>
-      </dependency>
-
-      <dependency>
-        <groupId>com.fasterxml.jackson.datatype</groupId>
-        <artifactId>jackson-datatype-jdk8</artifactId>
-        <version>2.9.9</version>
-      </dependency>
-
-      <dependency>
         <groupId>com.squareup.okhttp3</groupId>
         <artifactId>okhttp</artifactId>
-        <version>3.12.1</version>
+        <version>3.14.3</version>
       </dependency>
-
       <dependency>
-        <groupId>org.apache.httpcomponents</groupId>
-        <artifactId>fluent-hc</artifactId>
-        <version>${httpclient.version}</version>
+        <groupId>org.springframework</groupId>
+        <artifactId>spring-aop</artifactId>
+        <version>5.2.1.RELEASE</version>
       </dependency>
       <dependency>
-        <groupId>org.apache.httpcomponents</groupId>
-        <artifactId>httpclient</artifactId>
-        <version>${httpclient.version}</version>
+        <groupId>com.fasterxml.jackson.datatype</groupId>
+        <artifactId>jackson-datatype-jdk8</artifactId>
+        <version>2.10.0</version>
       </dependency>
-
       <dependency>
         <groupId>org.javassist</groupId>
         <artifactId>javassist</artifactId>
         <version>3.25.0-GA</version>
       </dependency>
-
-      <dependency>
-        <groupId>org.jboss.logging</groupId>
-        <artifactId>jboss-logging</artifactId>
-        <version>3.3.2.Final</version>
-      </dependency>
-
-      <dependency>
-        <groupId>org.objenesis</groupId>
-        <artifactId>objenesis</artifactId>
-        <version>2.5.1</version>
-      </dependency>
-
-      <dependency>
-        <groupId>org.springframework</groupId>
-        <artifactId>spring-aop</artifactId>
-        <version>5.1.9.RELEASE</version>
-      </dependency>
       <dependency>
         <groupId>org.springframework</groupId>
         <artifactId>spring-beans</artifactId>
-        <version>5.1.9.RELEASE</version>
+        <version>5.2.1.RELEASE</version>
       </dependency>
       <dependency>
         <groupId>org.springframework</groupId>
         <artifactId>spring-context</artifactId>
-        <version>5.1.9.RELEASE</version>
+        <version>5.2.1.RELEASE</version>
       </dependency>
       <dependency>
         <groupId>org.springframework</groupId>
         <artifactId>spring-core</artifactId>
-        <version>5.1.9.RELEASE</version>
+        <version>5.2.1.RELEASE</version>
       </dependency>
       <dependency>
         <groupId>org.springframework</groupId>
         <artifactId>spring-web</artifactId>
-        <version>5.1.9.RELEASE</version>
+        <version>5.2.1.RELEASE</version>
       </dependency>
-
       <dependency>
-        <groupId>javax.validation</groupId>
-        <artifactId>validation-api</artifactId>
-        <version>2.0.1.Final</version>
+        <groupId>org.jboss.logging</groupId>
+        <artifactId>jboss-logging</artifactId>
+        <version>3.4.1.Final</version>
       </dependency>
     </dependencies>
   </dependencyManagement>
+
 </project>
\ No newline at end of file
diff --git a/sandbox/test-streampipes-plc4x-adapters/src/main/java/org/apache/plc4x/java/streampipes/adapters/source/knxnetip/KnxNetIpAdapter.java b/sandbox/test-streampipes-plc4x-adapters/src/main/java/org/apache/plc4x/java/streampipes/adapters/source/knxnetip/KnxNetIpAdapter.java
index 5580b5e..6f49822 100644
--- a/sandbox/test-streampipes-plc4x-adapters/src/main/java/org/apache/plc4x/java/streampipes/adapters/source/knxnetip/KnxNetIpAdapter.java
+++ b/sandbox/test-streampipes-plc4x-adapters/src/main/java/org/apache/plc4x/java/streampipes/adapters/source/knxnetip/KnxNetIpAdapter.java
@@ -46,6 +46,7 @@ import org.streampipes.sdk.builder.PrimitivePropertyBuilder;
 import org.streampipes.sdk.builder.adapter.SpecificDataStreamAdapterBuilder;
 import org.streampipes.sdk.helpers.Labels;
 import org.streampipes.sdk.utils.Datatypes;
+import org.streampipes.vocabulary.SO;
 
 import java.net.InetAddress;
 import java.net.UnknownHostException;
@@ -92,6 +93,7 @@ public class KnxNetIpAdapter extends SpecificDataStreamAdapter {
         allProperties.add(
             PrimitivePropertyBuilder
                 .create(Datatypes.Long, MAPPING_FIELD_TIME)
+                .domainProperty(SO.DateTime)
                 .label("Time")
                 .description("The time the event was processed in the KNXnet/IP driver.")
                 .build());
@@ -129,6 +131,9 @@ public class KnxNetIpAdapter extends SpecificDataStreamAdapter {
 
     @Override
     public void startAdapter() throws AdapterException {
+        if((connection != null) && (connection.isConnected())) {
+            return;
+        }
         try {
             InetAddress inetAddress = InetAddress.getByName(gatewayIp);
             ChannelFactory channelFactory = new UdpSocketChannelFactory(inetAddress, KnxNetIpConnection.KNXNET_IP_PORT);
@@ -184,6 +189,8 @@ public class KnxNetIpAdapter extends SpecificDataStreamAdapter {
         } catch (UnknownHostException e) {
             logger.error("Error connecting to host " + gatewayIp, e);
             throw new AdapterException("Error connecting to host " + gatewayIp);
+        } catch (Exception e) {
+            logger.error("Something strange went wrong.", e);
         }
     }
 
diff --git a/sandbox/test-streampipes-plc4x-processors/env/development b/sandbox/test-streampipes-plc4x-processors/env/development
index cb9e079..f07810b 100644
--- a/sandbox/test-streampipes-plc4x-processors/env/development
+++ b/sandbox/test-streampipes-plc4x-processors/env/development
@@ -18,6 +18,7 @@
 # ----------------------------------------------------------------------------
 
 # Redirect some parameters for local development.
-SP_PORT=8005
+SP_PORT=8091
 SP_HOST=host.docker.internal
+SP_DEBUG=true
 
diff --git a/sandbox/test-streampipes-plc4x-processors/pom.xml b/sandbox/test-streampipes-plc4x-processors/pom.xml
index f83ea65..8bf5c52 100644
--- a/sandbox/test-streampipes-plc4x-processors/pom.xml
+++ b/sandbox/test-streampipes-plc4x-processors/pom.xml
@@ -32,7 +32,7 @@
   <name>Sandbox: StreamPipes Processors</name>
 
   <properties>
-    <streampipes.version>0.64.0</streampipes.version>
+    <streampipes.version>0.65.0</streampipes.version>
   </properties>
 
   <dependencies>
@@ -74,6 +74,10 @@
           <artifactId>ow2-jpa-1.0-spec</artifactId>
           <groupId>org.ow2.spec.ee</groupId>
         </exclusion>
+        <exclusion>
+          <artifactId>javax.ws.rs-api</artifactId>
+          <groupId>javax.ws.rs</groupId>
+        </exclusion>
       </exclusions>
     </dependency>
     <dependency>
@@ -91,6 +95,20 @@
       <groupId>org.streampipes</groupId>
       <artifactId>streampipes-sdk</artifactId>
       <version>${streampipes.version}</version>
+      <exclusions>
+        <exclusion>
+          <artifactId>aopalliance</artifactId>
+          <groupId>aopalliance</groupId>
+        </exclusion>
+        <exclusion>
+          <artifactId>ow2-jpa-1.0-spec</artifactId>
+          <groupId>org.ow2.spec.ee</groupId>
+        </exclusion>
+        <exclusion>
+          <artifactId>javax.inject</artifactId>
+          <groupId>javax.inject</groupId>
+        </exclusion>
+      </exclusions>
     </dependency>
     <dependency>
       <groupId>org.streampipes</groupId>
@@ -134,10 +152,6 @@
       <version>${streampipes.version}</version>
       <exclusions>
         <exclusion>
-          <artifactId>jboss-annotations-api_1.2_spec</artifactId>
-          <groupId>org.jboss.spec.javax.annotation</groupId>
-        </exclusion>
-        <exclusion>
           <artifactId>aopalliance-repackaged</artifactId>
           <groupId>org.glassfish.hk2.external</groupId>
         </exclusion>
@@ -145,6 +159,10 @@
           <artifactId>tomcat-embed-el</artifactId>
           <groupId>org.apache.tomcat.embed</groupId>
         </exclusion>
+        <exclusion>
+          <artifactId>jboss-annotations-api_1.2_spec</artifactId>
+          <groupId>org.jboss.spec.javax.annotation</groupId>
+        </exclusion>
       </exclusions>
     </dependency>
     <dependency>
@@ -153,10 +171,6 @@
       <version>0.6.0-SNAPSHOT</version>
     </dependency>
     <dependency>
-      <groupId>javax.validation</groupId>
-      <artifactId>validation-api</artifactId>
-    </dependency>
-    <dependency>
       <groupId>ch.qos.logback</groupId>
       <artifactId>logback-classic</artifactId>
       <scope>compile</scope>
@@ -177,85 +191,51 @@
   <dependencyManagement>
     <dependencies>
       <dependency>
-        <groupId>commons-beanutils</groupId>
-        <artifactId>commons-beanutils</artifactId>
-        <version>1.9.4</version>
-      </dependency>
-
-      <dependency>
         <groupId>com.fasterxml.jackson.datatype</groupId>
         <artifactId>jackson-datatype-jdk8</artifactId>
-        <version>2.9.9</version>
+        <version>2.10.0</version>
       </dependency>
-
       <dependency>
         <groupId>com.squareup.okhttp3</groupId>
         <artifactId>okhttp</artifactId>
-        <version>3.12.1</version>
-      </dependency>
-
-      <dependency>
-        <groupId>org.apache.httpcomponents</groupId>
-        <artifactId>fluent-hc</artifactId>
-        <version>${httpclient.version}</version>
-      </dependency>
-      <dependency>
-        <groupId>org.apache.httpcomponents</groupId>
-        <artifactId>httpclient</artifactId>
-        <version>${httpclient.version}</version>
+        <version>3.14.3</version>
       </dependency>
-
       <dependency>
         <groupId>org.javassist</groupId>
         <artifactId>javassist</artifactId>
         <version>3.25.0-GA</version>
       </dependency>
-
-      <dependency>
-        <groupId>org.jboss.logging</groupId>
-        <artifactId>jboss-logging</artifactId>
-        <version>3.3.2.Final</version>
-      </dependency>
-
-      <dependency>
-        <groupId>org.objenesis</groupId>
-        <artifactId>objenesis</artifactId>
-        <version>2.5.1</version>
-      </dependency>
-
       <dependency>
         <groupId>org.springframework</groupId>
         <artifactId>spring-aop</artifactId>
-        <version>5.1.9.RELEASE</version>
+        <version>5.2.1.RELEASE</version>
       </dependency>
       <dependency>
         <groupId>org.springframework</groupId>
         <artifactId>spring-beans</artifactId>
-        <version>5.1.9.RELEASE</version>
+        <version>5.2.1.RELEASE</version>
       </dependency>
       <dependency>
         <groupId>org.springframework</groupId>
         <artifactId>spring-context</artifactId>
-        <version>5.1.9.RELEASE</version>
+        <version>5.2.1.RELEASE</version>
       </dependency>
       <dependency>
         <groupId>org.springframework</groupId>
         <artifactId>spring-core</artifactId>
-        <version>5.1.9.RELEASE</version>
+        <version>5.2.1.RELEASE</version>
       </dependency>
       <dependency>
         <groupId>org.springframework</groupId>
         <artifactId>spring-web</artifactId>
-        <version>5.1.9.RELEASE</version>
+        <version>5.2.1.RELEASE</version>
       </dependency>
-
       <dependency>
-        <groupId>javax.validation</groupId>
-        <artifactId>validation-api</artifactId>
-        <version>2.0.1.Final</version>
+        <groupId>org.jboss.logging</groupId>
+        <artifactId>jboss-logging</artifactId>
+        <version>3.4.1.Final</version>
       </dependency>
     </dependencies>
   </dependencyManagement>
 
-
 </project>
\ No newline at end of file
diff --git a/sandbox/test-streampipes-plc4x-processors/src/main/java/org/apache/plc4x/java/streampipes/processors/enrich/knxnetip/ets5/Ets5DataEnrichment.java b/sandbox/test-streampipes-plc4x-processors/src/main/java/org/apache/plc4x/java/streampipes/processors/enrich/knxnetip/ets5/Ets5DataEnrichment.java
index d9d1bf7..bc08b31 100644
--- a/sandbox/test-streampipes-plc4x-processors/src/main/java/org/apache/plc4x/java/streampipes/processors/enrich/knxnetip/ets5/Ets5DataEnrichment.java
+++ b/sandbox/test-streampipes-plc4x-processors/src/main/java/org/apache/plc4x/java/streampipes/processors/enrich/knxnetip/ets5/Ets5DataEnrichment.java
@@ -86,6 +86,8 @@ public class Ets5DataEnrichment implements EventProcessor<Ets5DataEnrichmentPara
                 event.addField(Ets5DataEnrichmentController.MAPPING_FIELD_DECODED_PROPERTY_VALUE,
                     jsonDatapoint);
 
+                System.out.println(hexEncodedRawData + " decoded to: " + jsonDatapoint + " " + groupAddress.getType().getMainType() + " " + groupAddress.getType().getSubType());
+
                 //Event enrichedEvent = new Event()
                 spOutputCollector.collect(event);
             } else {
diff --git a/sandbox/test-streampipes-plc4x-processors/src/main/java/org/apache/plc4x/java/streampipes/processors/enrich/knxnetip/ets5/Ets5DataEnrichmentController.java b/sandbox/test-streampipes-plc4x-processors/src/main/java/org/apache/plc4x/java/streampipes/processors/enrich/knxnetip/ets5/Ets5DataEnrichmentController.java
index d5420aa..4389723 100644
--- a/sandbox/test-streampipes-plc4x-processors/src/main/java/org/apache/plc4x/java/streampipes/processors/enrich/knxnetip/ets5/Ets5DataEnrichmentController.java
+++ b/sandbox/test-streampipes-plc4x-processors/src/main/java/org/apache/plc4x/java/streampipes/processors/enrich/knxnetip/ets5/Ets5DataEnrichmentController.java
@@ -36,10 +36,13 @@ import org.streampipes.sdk.utils.Datatypes;
 import org.streampipes.wrapper.standalone.ConfiguredEventProcessor;
 import org.streampipes.wrapper.standalone.declarer.StandaloneEventProcessingDeclarer;
 
+import java.io.IOException;
+
 public class Ets5DataEnrichmentController extends StandaloneEventProcessingDeclarer<Ets5DataEnrichmentParameters> {
 
     public static final String ID = "org.apache.plc4x.streampipes.processors.enrich.knxnetip.ets5";
 
+    private static final String PROJECT_FILE_KEY = "project-fIle";
     private static final String DESTINATION_ID_MAPPING = "destination-id-mapping";
     private static final String PAYLOAD_ID_MAPPING = "payload-id-mapping";
 
@@ -55,7 +58,7 @@ public class Ets5DataEnrichmentController extends StandaloneEventProcessingDecla
         return ProcessingElementBuilder
             .create(ID, "ETS5", "Processor that interprets a data stream from a KXNnet/IP Datasource according to the settings in the ETS5 'knxproj' file")
             .category(DataProcessorType.ENRICH)
-            .withAssets(Assets.DOCUMENTATION, Assets.ICON)
+            //.withAssets(Assets.DOCUMENTATION, Assets.ICON)
             .withLocales(Locales.EN)
             .requiredStream(StreamRequirementsBuilder
                 .create()
@@ -70,7 +73,7 @@ public class Ets5DataEnrichmentController extends StandaloneEventProcessingDecla
                 PrimitivePropertyBuilder.create(Datatypes.String, MAPPING_FIELD_MEANING).build(),
                 PrimitivePropertyBuilder.create(Datatypes.String, MAPPING_FIELD_DECODED_PROPERTY_VALUE).build()
             ))
-            .requiredFile(Labels.from("File", "ETS5 Project File", "ETS5 Project File (.knxproj)"))
+            .requiredFile(Labels.withId(PROJECT_FILE_KEY))
             .build();
     }
 
@@ -78,7 +81,12 @@ public class Ets5DataEnrichmentController extends StandaloneEventProcessingDecla
     public ConfiguredEventProcessor<Ets5DataEnrichmentParameters> onInvocation(DataProcessorInvocation graph, ProcessingElementParameterExtractor extractor) {
         String destinationIdFieldName = extractor.mappingPropertyValue(DESTINATION_ID_MAPPING);
         String payloadIdFieldName = extractor.mappingPropertyValue(PAYLOAD_ID_MAPPING);
-
+        String fileContents = null;
+        try {
+            fileContents = extractor.fileContentsAsString(PROJECT_FILE_KEY);
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
         Ets5DataEnrichmentParameters params = new Ets5DataEnrichmentParameters(graph, destinationIdFieldName, payloadIdFieldName);
         return new ConfiguredEventProcessor<>(params, Ets5DataEnrichment::new);
     }
diff --git a/sandbox/test-streampipes-plc4x-processors/src/main/resources/org.apache.plc4x.streampipes.processors.enrich.knxnetip.ets5/strings.en b/sandbox/test-streampipes-plc4x-processors/src/main/resources/org.apache.plc4x.streampipes.processors.enrich.knxnetip.ets5/strings.en
index ed9a3d3..5f5c591 100644
--- a/sandbox/test-streampipes-plc4x-processors/src/main/resources/org.apache.plc4x.streampipes.processors.enrich.knxnetip.ets5/strings.en
+++ b/sandbox/test-streampipes-plc4x-processors/src/main/resources/org.apache.plc4x.streampipes.processors.enrich.knxnetip.ets5/strings.en
@@ -25,3 +25,6 @@ payload-id-mapping.description=
 
 destination-id-mapping.title=Destination Id Field
 destination-id-mapping.description=
+
+project-fIle.title=ETS5 Project File
+project-fIle.description=ETS5 Project File (.knxproj)
\ No newline at end of file


[plc4x] 02/04: Fixed the interpretation of 8/16/32 bit integers

Posted by cd...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

cdutz pushed a commit to branch feature/knxnet-ip
in repository https://gitbox.apache.org/repos/asf/plc4x.git

commit 04ed0b4804331b7a5bdb773199e405a0aa555d65
Author: Christofer Dutz <ch...@c-ware.de>
AuthorDate: Mon Dec 9 15:25:26 2019 +0100

    Fixed the interpretation of 8/16/32 bit integers
---
 .../knxnetip/src/main/resources/protocols/knxnetip/ets5.mspec     | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/protocols/knxnetip/src/main/resources/protocols/knxnetip/ets5.mspec b/protocols/knxnetip/src/main/resources/protocols/knxnetip/ets5.mspec
index 632b6c6..6df2b19 100644
--- a/protocols/knxnetip/src/main/resources/protocols/knxnetip/ets5.mspec
+++ b/protocols/knxnetip/src/main/resources/protocols/knxnetip/ets5.mspec
@@ -70,12 +70,15 @@
             [simple   uint 6 'val']
         ]
         ['5' KnxDatapointU8
+            [reserved uint 8 '0x0']
             [simple   uint 8 'val']
         ]
         ['7' KnxDatapointU16
+            [reserved uint 8 '0x0']
             [simple uint 16 'val']
         ]
         ['12' KnxDatapointU32
+            [reserved uint 8 '0x0']
             [simple uint 32 'val']
         ]
         ['6','20' KnxDatapointB5I3
@@ -87,12 +90,15 @@
             [simple   int 8  'val']
         ]
         ['6' KnxDatapointI8
+            [reserved uint 8 '0x0']
             [simple int 8  'val']
         ]
         ['8' KnxDatapointI16
+            [reserved uint 8 '0x0']
             [simple int 16 'val']
         ]
         ['13' KnxDatapointI32
+            [reserved uint 8 '0x0']
             [simple int 32 'val']
         ]
         ['9' KnxDatapointF16
@@ -107,9 +113,11 @@
             [simple   float 32 'val']
         ]
         ['4' KnxDatapointA8
+            [reserved uint 8 '0x0']
             [simple int 8 'val']
         ]
         ['16' KnxDatapointA112
+            [reserved uint 8 '0x0']
             [array int 8 'val' count '14']
         ]
         ['10' KnxDatapointTime24