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/07/01 21:31:39 UTC

[plc4x] branch develop updated: - Added a lot of tests based on a recording at my house - Fixed a bug in the spec of the type DIBDeviceInfo

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

cdutz pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/plc4x.git


The following commit(s) were added to refs/heads/develop by this push:
     new 1c5387b  - Added a lot of tests based on a recording at my house - Fixed a bug in the spec of the type DIBDeviceInfo
1c5387b is described below

commit 1c5387b82cec7d80f09aac75959f6c831240f842
Author: Christofer Dutz <ch...@c-ware.de>
AuthorDate: Mon Jul 1 22:46:45 2019 +0200

    - Added a lot of tests based on a recording at my house
    - Fixed a bug in the spec of the type DIBDeviceInfo
---
 .../resources/protocols/knxnetip/knxnetip.mspec    |  12 +-
 .../test/resources/testsuite/KNXNetIPTestsuite.xml | 454 +++++++++++++++++++++
 2 files changed, 462 insertions(+), 4 deletions(-)

diff --git a/protocols/knxnetip/src/main/resources/protocols/knxnetip/knxnetip.mspec b/protocols/knxnetip/src/main/resources/protocols/knxnetip/knxnetip.mspec
index 5e3439e..eef4d3a 100644
--- a/protocols/knxnetip/src/main/resources/protocols/knxnetip/knxnetip.mspec
+++ b/protocols/knxnetip/src/main/resources/protocols/knxnetip/knxnetip.mspec
@@ -117,10 +117,10 @@
     [field      DeviceStatus 'deviceStatus']
     [field      KNXAddress   'knxAddress']
     [field      ProjectInstallationIdentifier 'projectInstallationIdentifier']
-    [arrayField uint 8 'knxNetIpDeviceSerialNumber' count '6']
-    [field      uint 8       'knxNetIpDeviceMulticastAddress']
-    [arrayField uint 8 'knxNetIpDeviceMacAddress'   count '6']
-    [arrayField uint 8 'deviceFriendlyName'         count '30']
+    [arrayField uint 8       'knxNetIpDeviceSerialNumber' count '6']
+    [field      IPAddress    'knxNetIpDeviceMulticastAddress']
+    [field      MACAddress   'knxNetIpDeviceMacAddress']
+    [arrayField uint 8       'deviceFriendlyName'         count '30']
 ]
 
 [type 'DIBSuppSvcFamilies'
@@ -165,6 +165,10 @@
     [arrayField uint 8 'addr' count '4']
 ]
 
+[type 'MACAddress'
+    [arrayField uint 8 'addr' count '6']
+]
+
 [type 'KNXAddress'
     [field uint 4 'mainGroup']
     [field uint 4 'middleGroup']
diff --git a/sandbox/test-java-knxnetip-driver/src/test/resources/testsuite/KNXNetIPTestsuite.xml b/sandbox/test-java-knxnetip-driver/src/test/resources/testsuite/KNXNetIPTestsuite.xml
index 39274da..86aa5b3 100644
--- a/sandbox/test-java-knxnetip-driver/src/test/resources/testsuite/KNXNetIPTestsuite.xml
+++ b/sandbox/test-java-knxnetip-driver/src/test/resources/testsuite/KNXNetIPTestsuite.xml
@@ -22,6 +22,460 @@
   <name>KNXNet/IP</name>
 
   <testcase>
+    <name>Search Request</name>
+    <raw>06100201000e0801c0a82a46ef8e</raw>
+    <root-type>KNXNetIPMessage</root-type>
+    <xml>
+      <SearchRequest className="org.apache.plc4x.java.knxnetip.SearchRequest">
+        <protocolVersion>16</protocolVersion>
+        <hpaiIDiscoveryEndpoint>
+          <hostProtocolCode>1</hostProtocolCode>
+          <ipAddress>
+            <addr>
+              <addr>192</addr>
+              <addr>168</addr>
+              <addr>42</addr>
+              <addr>70</addr>
+            </addr>
+          </ipAddress>
+          <ipPort>61326</ipPort>
+        </hpaiIDiscoveryEndpoint>
+      </SearchRequest>
+    </xml>
+  </testcase>
+
+  <testcase>
+    <name>Search Response</name>
+    <raw>06100202004c0801c0a82a0b0e5736010200ffff000000082d409852e000170c000ab327553647697261204b4e582f49502d5363686e6974747374656c6c6500000000000802020103010401</raw>
+    <root-type>KNXNetIPMessage</root-type>
+    <xml>
+      <SearchResponse className="org.apache.plc4x.java.knxnetip.SearchResponse">
+        <protocolVersion>16</protocolVersion>
+        <hpaiControlEndpoint>
+          <hostProtocolCode>1</hostProtocolCode>
+          <ipAddress>
+            <addr>
+              <addr>192</addr>
+              <addr>168</addr>
+              <addr>42</addr>
+              <addr>11</addr>
+            </addr>
+          </ipAddress>
+          <ipPort>3671</ipPort>
+        </hpaiControlEndpoint>
+        <dibDeviceInfo>
+          <descriptionType>1</descriptionType>
+          <knxMedium>2</knxMedium>
+          <deviceStatus>
+            <programMode>false</programMode>
+          </deviceStatus>
+          <knxAddress>
+            <mainGroup>15</mainGroup>
+            <middleGroup>15</middleGroup>
+            <subGroup>255</subGroup>
+          </knxAddress>
+          <projectInstallationIdentifier>
+            <projectNumber>0</projectNumber>
+            <installationNumber>0</installationNumber>
+          </projectInstallationIdentifier>
+          <knxNetIpDeviceSerialNumber>
+            <knxNetIpDeviceSerialNumber>0</knxNetIpDeviceSerialNumber>
+            <knxNetIpDeviceSerialNumber>8</knxNetIpDeviceSerialNumber>
+            <knxNetIpDeviceSerialNumber>45</knxNetIpDeviceSerialNumber>
+            <knxNetIpDeviceSerialNumber>64</knxNetIpDeviceSerialNumber>
+            <knxNetIpDeviceSerialNumber>152</knxNetIpDeviceSerialNumber>
+            <knxNetIpDeviceSerialNumber>82</knxNetIpDeviceSerialNumber>
+          </knxNetIpDeviceSerialNumber>
+          <knxNetIpDeviceMulticastAddress>
+            <addr>
+              <addr>224</addr>
+              <addr>0</addr>
+              <addr>23</addr>
+              <addr>12</addr>
+            </addr>
+          </knxNetIpDeviceMulticastAddress>
+          <knxNetIpDeviceMacAddress>
+            <addr>
+              <addr>0</addr>
+              <addr>10</addr>
+              <addr>179</addr>
+              <addr>39</addr>
+              <addr>85</addr>
+              <addr>54</addr>
+            </addr>
+          </knxNetIpDeviceMacAddress>
+          <deviceFriendlyName>
+            <deviceFriendlyName>71</deviceFriendlyName>
+            <deviceFriendlyName>105</deviceFriendlyName>
+            <deviceFriendlyName>114</deviceFriendlyName>
+            <deviceFriendlyName>97</deviceFriendlyName>
+            <deviceFriendlyName>32</deviceFriendlyName>
+            <deviceFriendlyName>75</deviceFriendlyName>
+            <deviceFriendlyName>78</deviceFriendlyName>
+            <deviceFriendlyName>88</deviceFriendlyName>
+            <deviceFriendlyName>47</deviceFriendlyName>
+            <deviceFriendlyName>73</deviceFriendlyName>
+            <deviceFriendlyName>80</deviceFriendlyName>
+            <deviceFriendlyName>45</deviceFriendlyName>
+            <deviceFriendlyName>83</deviceFriendlyName>
+            <deviceFriendlyName>99</deviceFriendlyName>
+            <deviceFriendlyName>104</deviceFriendlyName>
+            <deviceFriendlyName>110</deviceFriendlyName>
+            <deviceFriendlyName>105</deviceFriendlyName>
+            <deviceFriendlyName>116</deviceFriendlyName>
+            <deviceFriendlyName>116</deviceFriendlyName>
+            <deviceFriendlyName>115</deviceFriendlyName>
+            <deviceFriendlyName>116</deviceFriendlyName>
+            <deviceFriendlyName>101</deviceFriendlyName>
+            <deviceFriendlyName>108</deviceFriendlyName>
+            <deviceFriendlyName>108</deviceFriendlyName>
+            <deviceFriendlyName>101</deviceFriendlyName>
+            <deviceFriendlyName>0</deviceFriendlyName>
+            <deviceFriendlyName>0</deviceFriendlyName>
+            <deviceFriendlyName>0</deviceFriendlyName>
+            <deviceFriendlyName>0</deviceFriendlyName>
+            <deviceFriendlyName>0</deviceFriendlyName>
+          </deviceFriendlyName>
+        </dibDeviceInfo>
+        <dibSuppSvcFamilies>
+          <descriptionType>2</descriptionType>
+          <serviceIds>
+            <serviceIds className="org.apache.plc4x.java.knxnetip.KnxNetIpCore">
+              <version>1</version>
+            </serviceIds>
+            <serviceIds className="org.apache.plc4x.java.knxnetip.KnxNetIpDeviceManagement">
+              <version>1</version>
+            </serviceIds>
+          </serviceIds>
+        </dibSuppSvcFamilies>
+      </SearchResponse>
+    </xml>
+  </testcase>
+
+  <testcase>
+    <name>Description Request</name>
+    <raw>06100203000e0801000000000000</raw>
+    <root-type>KNXNetIPMessage</root-type>
+    <xml>
+      <DescriptionRequest className="org.apache.plc4x.java.knxnetip.DescriptionRequest">
+        <protocolVersion>16</protocolVersion>
+        <hpaiControlEndpoint>
+          <hostProtocolCode>1</hostProtocolCode>
+          <ipAddress>
+            <addr>
+              <addr>0</addr>
+              <addr>0</addr>
+              <addr>0</addr>
+              <addr>0</addr>
+            </addr>
+          </ipAddress>
+          <ipPort>0</ipPort>
+        </hpaiControlEndpoint>
+      </DescriptionRequest>
+    </xml>
+  </testcase>
+
+  <testcase>
+    <name>Description Response</name>
+    <raw>06100204004436010200ffff000000082d409852e000170c000ab327553647697261204b4e582f49502d5363686e6974747374656c6c6500000000000802020103010401</raw>
+    <root-type>KNXNetIPMessage</root-type>
+    <xml>
+      <DescriptionResponse className="org.apache.plc4x.java.knxnetip.DescriptionResponse">
+        <protocolVersion>16</protocolVersion>
+        <dibDeviceInfo>
+          <descriptionType>1</descriptionType>
+          <knxMedium>2</knxMedium>
+          <deviceStatus>
+            <programMode>false</programMode>
+          </deviceStatus>
+          <knxAddress>
+            <mainGroup>15</mainGroup>
+            <middleGroup>15</middleGroup>
+            <subGroup>255</subGroup>
+          </knxAddress>
+          <projectInstallationIdentifier>
+            <projectNumber>0</projectNumber>
+            <installationNumber>0</installationNumber>
+          </projectInstallationIdentifier>
+          <knxNetIpDeviceSerialNumber>
+            <knxNetIpDeviceSerialNumber>0</knxNetIpDeviceSerialNumber>
+            <knxNetIpDeviceSerialNumber>8</knxNetIpDeviceSerialNumber>
+            <knxNetIpDeviceSerialNumber>45</knxNetIpDeviceSerialNumber>
+            <knxNetIpDeviceSerialNumber>64</knxNetIpDeviceSerialNumber>
+            <knxNetIpDeviceSerialNumber>152</knxNetIpDeviceSerialNumber>
+            <knxNetIpDeviceSerialNumber>82</knxNetIpDeviceSerialNumber>
+          </knxNetIpDeviceSerialNumber>
+          <knxNetIpDeviceMulticastAddress>
+            <addr>
+              <addr>224</addr>
+              <addr>0</addr>
+              <addr>23</addr>
+              <addr>12</addr>
+            </addr>
+          </knxNetIpDeviceMulticastAddress>
+          <knxNetIpDeviceMacAddress>
+            <addr>
+              <addr>0</addr>
+              <addr>10</addr>
+              <addr>179</addr>
+              <addr>39</addr>
+              <addr>85</addr>
+              <addr>54</addr>
+            </addr>
+          </knxNetIpDeviceMacAddress>
+          <deviceFriendlyName>
+            <deviceFriendlyName>71</deviceFriendlyName>
+            <deviceFriendlyName>105</deviceFriendlyName>
+            <deviceFriendlyName>114</deviceFriendlyName>
+            <deviceFriendlyName>97</deviceFriendlyName>
+            <deviceFriendlyName>32</deviceFriendlyName>
+            <deviceFriendlyName>75</deviceFriendlyName>
+            <deviceFriendlyName>78</deviceFriendlyName>
+            <deviceFriendlyName>88</deviceFriendlyName>
+            <deviceFriendlyName>47</deviceFriendlyName>
+            <deviceFriendlyName>73</deviceFriendlyName>
+            <deviceFriendlyName>80</deviceFriendlyName>
+            <deviceFriendlyName>45</deviceFriendlyName>
+            <deviceFriendlyName>83</deviceFriendlyName>
+            <deviceFriendlyName>99</deviceFriendlyName>
+            <deviceFriendlyName>104</deviceFriendlyName>
+            <deviceFriendlyName>110</deviceFriendlyName>
+            <deviceFriendlyName>105</deviceFriendlyName>
+            <deviceFriendlyName>116</deviceFriendlyName>
+            <deviceFriendlyName>116</deviceFriendlyName>
+            <deviceFriendlyName>115</deviceFriendlyName>
+            <deviceFriendlyName>116</deviceFriendlyName>
+            <deviceFriendlyName>101</deviceFriendlyName>
+            <deviceFriendlyName>108</deviceFriendlyName>
+            <deviceFriendlyName>108</deviceFriendlyName>
+            <deviceFriendlyName>101</deviceFriendlyName>
+            <deviceFriendlyName>0</deviceFriendlyName>
+            <deviceFriendlyName>0</deviceFriendlyName>
+            <deviceFriendlyName>0</deviceFriendlyName>
+            <deviceFriendlyName>0</deviceFriendlyName>
+            <deviceFriendlyName>0</deviceFriendlyName>
+          </deviceFriendlyName>
+        </dibDeviceInfo>
+        <dibSuppSvcFamilies>
+          <descriptionType>2</descriptionType>
+          <serviceIds>
+            <serviceIds className="org.apache.plc4x.java.knxnetip.KnxNetIpCore">
+              <version>1</version>
+            </serviceIds>
+            <serviceIds className="org.apache.plc4x.java.knxnetip.KnxNetIpDeviceManagement">
+              <version>1</version>
+            </serviceIds>
+          </serviceIds>
+        </dibSuppSvcFamilies>
+      </DescriptionResponse>
+    </xml>
+  </testcase>
+
+  <testcase>
+    <name>Connect Request</name>
+    <raw>06100205001a0801c0a82a46f4310801c0a82a46f43204040200</raw>
+    <root-type>KNXNetIPMessage</root-type>
+    <xml>
+      <ConnectionRequest className="org.apache.plc4x.java.knxnetip.ConnectionRequest">
+        <protocolVersion>16</protocolVersion>
+        <hpaiDiscoveryEndpoint>
+          <hostProtocolCode>1</hostProtocolCode>
+          <ipAddress>
+            <addr>
+              <addr>192</addr>
+              <addr>168</addr>
+              <addr>42</addr>
+              <addr>70</addr>
+            </addr>
+          </ipAddress>
+          <ipPort>62513</ipPort>
+        </hpaiDiscoveryEndpoint>
+        <hpaiDataEndpoint>
+          <hostProtocolCode>1</hostProtocolCode>
+          <ipAddress>
+            <addr>
+              <addr>192</addr>
+              <addr>168</addr>
+              <addr>42</addr>
+              <addr>70</addr>
+            </addr>
+          </ipAddress>
+          <ipPort>62514</ipPort>
+        </hpaiDataEndpoint>
+        <connectionRequestInformation className="org.apache.plc4x.java.knxnetip.ConnectionRequestInformationTunnelConnection">
+          <knxLayer>2</knxLayer>
+        </connectionRequestInformation>
+      </ConnectionRequest>
+    </xml>
+  </testcase>
+
+  <testcase>
+    <name>Connect Response</name>
+    <raw>06100206001466000801c0a82a0b0e5704041101</raw>
+    <root-type>KNXNetIPMessage</root-type>
+    <xml>
+      <ConnectionResponse className="org.apache.plc4x.java.knxnetip.ConnectionResponse">
+        <protocolVersion>16</protocolVersion>
+        <communicationChannelId>102</communicationChannelId>
+        <status>0</status>
+        <hpaiDataEndpoint>
+          <hostProtocolCode>1</hostProtocolCode>
+          <ipAddress>
+            <addr>
+              <addr>192</addr>
+              <addr>168</addr>
+              <addr>42</addr>
+              <addr>11</addr>
+            </addr>
+          </ipAddress>
+          <ipPort>3671</ipPort>
+        </hpaiDataEndpoint>
+        <connectionResponseDataBlock className="org.apache.plc4x.java.knxnetip.ConnectionResponseDataBlockTunnelConnection">
+          <knxAddress>
+            <mainGroup>1</mainGroup>
+            <middleGroup>1</middleGroup>
+            <subGroup>1</subGroup>
+          </knxAddress>
+        </connectionResponseDataBlock>
+      </ConnectionResponse>
+    </xml>
+  </testcase>
+
+  <testcase>
+    <name>Connection State Request</name>
+    <raw>06100207001066000801c0a82a46f431</raw>
+    <root-type>KNXNetIPMessage</root-type>
+    <xml>
+      <ConnectionStateRequest className="org.apache.plc4x.java.knxnetip.ConnectionStateRequest">
+        <protocolVersion>16</protocolVersion>
+        <communicationChannelId>102</communicationChannelId>
+        <hpaiControlEndpoint>
+          <hostProtocolCode>1</hostProtocolCode>
+          <ipAddress>
+            <addr>
+              <addr>192</addr>
+              <addr>168</addr>
+              <addr>42</addr>
+              <addr>70</addr>
+            </addr>
+          </ipAddress>
+          <ipPort>62513</ipPort>
+        </hpaiControlEndpoint>
+      </ConnectionStateRequest>
+    </xml>
+  </testcase>
+
+  <testcase>
+    <name>Connection State Response</name>
+    <raw>0610020800086600</raw>
+    <root-type>KNXNetIPMessage</root-type>
+    <xml>
+      <ConnectionStateResponse className="org.apache.plc4x.java.knxnetip.ConnectionStateResponse">
+        <protocolVersion>16</protocolVersion>
+        <communicationChannelId>102</communicationChannelId>
+        <status>0</status>
+      </ConnectionStateResponse>
+    </xml>
+  </testcase>
+
+  <testcase>
+    <name>Device Configuration Request</name>
+    <raw>06100310001104670000fc000001531001</raw>
+    <root-type>KNXNetIPMessage</root-type>
+    <xml>
+      <DeviceConfigurationRequest className="org.apache.plc4x.java.knxnetip.DeviceConfigurationRequest">
+        <protocolVersion>16</protocolVersion>
+        <communicationChannelId>103</communicationChannelId>
+        <sequenceCounter>0</sequenceCounter>
+        <cemi>
+          <test>252</test>
+        </cemi>
+      </DeviceConfigurationRequest>
+    </xml>
+  </testcase>
+
+  <testcase>
+    <name>Device Configuration Response</name>
+    <raw>06100311000a04670000</raw>
+    <root-type>KNXNetIPMessage</root-type>
+    <xml>
+      <DeviceConfigurationResponse className="org.apache.plc4x.java.knxnetip.DeviceConfigurationResponse">
+        <protocolVersion>16</protocolVersion>
+        <communicationChannelId>103</communicationChannelId>
+        <sequenceCounter>0</sequenceCounter>
+        <status>0</status>
+      </DeviceConfigurationResponse>
+    </xml>
+  </testcase>
+
+  <testcase>
+    <name>Disconnect Request</name>
+    <raw>06100209001067000801c0a82a46f431</raw>
+    <root-type>KNXNetIPMessage</root-type>
+    <xml>
+      <DisconnectRequest className="org.apache.plc4x.java.knxnetip.DisconnectRequest">
+        <protocolVersion>16</protocolVersion>
+        <communicationChannelId>103</communicationChannelId>
+        <hpaiControlEndpoint>
+          <hostProtocolCode>1</hostProtocolCode>
+          <ipAddress>
+            <addr>
+              <addr>192</addr>
+              <addr>168</addr>
+              <addr>42</addr>
+              <addr>70</addr>
+            </addr>
+          </ipAddress>
+          <ipPort>62513</ipPort>
+        </hpaiControlEndpoint>
+      </DisconnectRequest>
+    </xml>
+  </testcase>
+
+  <testcase>
+    <name>Disconnect Response</name>
+    <raw>0610020a00086600</raw>
+    <root-type>KNXNetIPMessage</root-type>
+    <xml>
+      <DisconnectResponse className="org.apache.plc4x.java.knxnetip.DisconnectResponse">
+        <protocolVersion>16</protocolVersion>
+        <communicationChannelId>102</communicationChannelId>
+        <status>0</status>
+      </DisconnectResponse>
+    </xml>
+  </testcase>
+
+  <testcase>
+    <name>Tunneling Request</name>
+    <raw>06100420001c046b00002b0703010504024502bc360a1e0ce100810d</raw>
+    <root-type>KNXNetIPMessage</root-type>
+    <xml>
+      <TunnelingRequest className="org.apache.plc4x.java.knxnetip.TunnelingRequest">
+        <protocolVersion>16</protocolVersion>
+        <communicationChannelId>107</communicationChannelId>
+        <sequenceCounter>0</sequenceCounter>
+        <cemi>
+          <test>43</test>
+        </cemi>
+      </TunnelingRequest>
+    </xml>
+  </testcase>
+
+  <testcase>
+    <name>Tunneling Response</name>
+    <raw>06100421000a046b0000</raw>
+    <root-type>KNXNetIPMessage</root-type>
+    <xml>
+      <TunnelingResponse className="org.apache.plc4x.java.knxnetip.TunnelingResponse">
+        <protocolVersion>16</protocolVersion>
+        <communicationChannelId>107</communicationChannelId>
+        <sequenceCounter>0</sequenceCounter>
+        <status>0</status>
+      </TunnelingResponse>
+    </xml>
+  </testcase>
+
+  <testcase>
     <name>Default</name>
     <raw>0610020500180801c0a82a46c4090801c0a82a46c40a0203</raw>
     <root-type>KNXNetIPMessage</root-type>