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 2020/10/15 16:47:58 UTC
[plc4x] branch feature/plc4go updated: - Started working on the
PLC4Go API
This is an automated email from the ASF dual-hosted git repository.
cdutz pushed a commit to branch feature/plc4go
in repository https://gitbox.apache.org/repos/asf/plc4x.git
The following commit(s) were added to refs/heads/feature/plc4go by this push:
new df574d7 - Started working on the PLC4Go API
df574d7 is described below
commit df574d7fecbf00d60adb608eed373f4785b639df
Author: Christofer Dutz <ch...@c-ware.de>
AuthorDate: Thu Oct 15 18:47:45 2020 +0200
- Started working on the PLC4Go API
---
.../knxnetip/ParserSerializerTestsuite.xml | 500 ++++++++++++++++++++
.../protocols/modbus/ParserSerializerTestsuite.xml | 179 ++++++++
.../testing/protocols/s7/DriverTestsuite.xml | 383 ++++++++++++++++
.../protocols/s7/ParserSerializerTestsuite.xml | 501 +++++++++++++++++++++
sandbox/plc4go/cmd/main/drivers/bacnetip_test.go | 3 +
sandbox/plc4go/cmd/main/drivers/knxnetip_test.go | 3 +
sandbox/plc4go/cmd/main/drivers/modbus_test.go | 7 +
sandbox/plc4go/cmd/main/drivers/s7_test.go | 3 +
sandbox/plc4go/cmd/main/main.go | 3 +
.../examples/read/hello_world_plc4go_read.go | 45 ++
sandbox/plc4go/go.mod | 3 +
.../plc4go/bacnetip/BacnetIpDriver.go} | 10 +-
.../plc4go/knxnetip/KnxNetIpDriver.go} | 10 +-
.../plc4go/modbus/ModbusDriver.go} | 10 +-
.../internal/plc4go/model/plc_read_request.go | 69 +++
.../plc4go/model/plc_reader.go} | 10 +-
.../internal/plc4go/model/plc_write_request.go | 76 ++++
.../plc4go/model/plc_writer.go} | 10 +-
.../plc4go/plc_field_handler.go} | 12 +-
.../main.go => internal/plc4go/s7/S7Driver.go} | 10 +-
.../testutils/ParserSerializerTestRunner.go} | 21 +-
sandbox/plc4go/pkg/plc4go/connection.go | 45 ++
sandbox/plc4go/pkg/plc4go/driver.go | 34 ++
sandbox/plc4go/pkg/plc4go/driverManager.go | 91 ++++
.../plc4go/model/plc_connection_metadata.go} | 15 +-
.../main/main.go => pkg/plc4go/model/plc_field.go} | 7 +-
.../main.go => pkg/plc4go/model/plc_message.go} | 7 +-
.../plc4go/model/plc_read_request.go} | 13 +-
.../plc4go/model/plc_read_response.go} | 7 +-
.../main.go => pkg/plc4go/model/plc_request.go} | 9 +-
.../main.go => pkg/plc4go/model/plc_response.go} | 8 +-
.../plc4go/model/plc_subscription_event.go} | 10 +-
.../plc4go/model/plc_subscription_request.go} | 17 +-
.../plc4go/model/plc_subscription_response.go} | 7 +-
.../plc4go/model/plc_unsubscription_request.go} | 11 +-
.../plc4go/model/plc_unsubscription_response.go} | 7 +-
.../plc4go/model/plc_write_request.go} | 16 +-
.../plc4go/model/plc_write_response.go} | 7 +-
.../main.go => pkg/plc4go/values/plc_value.go} | 7 +-
sandbox/plc4go/pom.xml | 51 +++
40 files changed, 2187 insertions(+), 50 deletions(-)
diff --git a/sandbox/plc4go/assets/testing/protocols/knxnetip/ParserSerializerTestsuite.xml b/sandbox/plc4go/assets/testing/protocols/knxnetip/ParserSerializerTestsuite.xml
new file mode 100644
index 0000000..939c1b9
--- /dev/null
+++ b/sandbox/plc4go/assets/testing/protocols/knxnetip/ParserSerializerTestsuite.xml
@@ -0,0 +1,500 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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
+
+ http://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.
+ -->
+<test:testsuite xmlns:test="https://plc4x.apache.org/schemas/parser-serializer-testsuite.xsd" bigEndian="true">
+
+ <name>KNXNet/IP</name>
+
+ <!--testcase>
+ <name>Causes Failure 1</name>
+ <raw>0610042000180404ce002b0703010404025002bab8b838bb</raw>
+ Raw CEMI Frame: bab8b838bb
+ Raw CEMI Frame: ba
+
+ Decoded as Extended Frame Format:
+ group address: true
+ hop count: 3
+ extended frame format: 8 (1 0 0 0)
+ source address: 11/8/56
+
+ <raw>061004200018047ddf002b07030104040207029f9c9c9cdc</raw>
+ Raw CEMI Frame: 9f9c9c9cdc
+ Control Field: 9f
+
+ Differences from normal:
+ Repeat: True
+ Last two reserved bits are true
+ <root-type>KNXNetIPMessage</root-type>
+ <xml>
+ <TunnelingRequest className="org.apache.plc4x.java.knxnetip.readwrite.TunnelingRequest">
+ <tunnelingRequestDataBlock className="org.apache.plc4x.java.knxnetip.readwrite.TunnelingRequestDataBlock">
+ <communicationChannelId>125</communicationChannelId>
+ <sequenceCounter>223</sequenceCounter>
+ </tunnelingRequestDataBlock>
+ <cemi className="org.apache.plc4x.java.knxnetip.readwrite.CEMIBusmonInd">
+ <additionalInformationLength>7</additionalInformationLength>
+ <additionalInformation>
+ <additionalInformation className="org.apache.plc4x.java.knxnetip.readwrite.CEMIAdditionalInformationBusmonitorInfo">
+ <frameErrorFlag>false</frameErrorFlag>
+ <bitErrorFlag>false</bitErrorFlag>
+ <parityErrorFlag>false</parityErrorFlag>
+ <unknownFlag>false</unknownFlag>
+ <lostFlag>false</lostFlag>
+ <sequenceNumber>4</sequenceNumber>
+ </additionalInformation>
+ <additionalInformation className="org.apache.plc4x.java.knxnetip.readwrite.CEMIAdditionalInformationRelativeTimestamp">
+ <relativeTimestamp className="org.apache.plc4x.java.knxnetip.readwrite.RelativeTimestamp">
+ <timestamp>1794</timestamp>
+ </relativeTimestamp>
+ </additionalInformation>
+ </additionalInformation>
+ <cemiFrame className="org.apache.plc4x.java.knxnetip.readwrite.CEMIFramePollingData">
+ <doNotRepeat>false</doNotRepeat>
+ <priority>LOW</priority>
+ <errorFlag>true</errorFlag>
+ </cemiFrame>
+ </cemi>
+ </TunnelingRequest>
+ </xml>
+ </testcase>
+
+ <testcase>
+ <name>Causes Failure 2</name>
+ <raw>0610042000180401c2002b0703010304025601bab8b838bb</raw>
+ Raw CEMI Frame: bab8b838bb
+ Control Field: ba
+ First of the last two reserved bits is true
+ <root-type>KNXNetIPMessage</root-type>
+ <xml>
+ <TunnelingRequest className="org.apache.plc4x.java.knxnetip.readwrite.TunnelingRequest">
+ <tunnelingRequestDataBlock className="org.apache.plc4x.java.knxnetip.readwrite.TunnelingRequestDataBlock">
+ <communicationChannelId>1</communicationChannelId>
+ <sequenceCounter>194</sequenceCounter>
+ </tunnelingRequestDataBlock>
+ <cemi className="org.apache.plc4x.java.knxnetip.readwrite.CEMIBusmonInd">
+ <additionalInformationLength>7</additionalInformationLength>
+ <additionalInformation>
+ <additionalInformation className="org.apache.plc4x.java.knxnetip.readwrite.CEMIAdditionalInformationBusmonitorInfo">
+ <frameErrorFlag>false</frameErrorFlag>
+ <bitErrorFlag>false</bitErrorFlag>
+ <parityErrorFlag>false</parityErrorFlag>
+ <unknownFlag>false</unknownFlag>
+ <lostFlag>false</lostFlag>
+ <sequenceNumber>3</sequenceNumber>
+ </additionalInformation>
+ <additionalInformation className="org.apache.plc4x.java.knxnetip.readwrite.CEMIAdditionalInformationRelativeTimestamp">
+ <relativeTimestamp className="org.apache.plc4x.java.knxnetip.readwrite.RelativeTimestamp">
+ <timestamp>22017</timestamp>
+ </relativeTimestamp>
+ </additionalInformation>
+ </additionalInformation>
+ <cemiFrame className="org.apache.plc4x.java.knxnetip.readwrite.CEMIFramePollingData">
+ <doNotRepeat>true</doNotRepeat>
+ <priority>URGENT</priority>
+ <errorFlag>false</errorFlag>
+ </cemiFrame>
+ </cemi>
+ </TunnelingRequest>
+ </xml>
+ </testcase-->
+
+ <testcase>
+ <name>Search Request</name>
+ <raw>06100201000e0801c0a82a46ef8e</raw>
+ <root-type>KNXNetIPMessage</root-type>
+ <xml>
+ <SearchRequest className="org.apache.plc4x.java.knxnetip.readwrite.SearchRequest">
+ <hpaiIDiscoveryEndpoint className="org.apache.plc4x.java.knxnetip.readwrite.HPAIDiscoveryEndpoint">
+ <hostProtocolCode>IPV4_UDP</hostProtocolCode>
+ <ipAddress className="org.apache.plc4x.java.knxnetip.readwrite.IPAddress">
+ <addr>wKgqRg==</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.readwrite.SearchResponse">
+ <hpaiControlEndpoint className="org.apache.plc4x.java.knxnetip.readwrite.HPAIControlEndpoint">
+ <hostProtocolCode>IPV4_UDP</hostProtocolCode>
+ <ipAddress className="org.apache.plc4x.java.knxnetip.readwrite.IPAddress">
+ <addr>wKgqCw==</addr>
+ </ipAddress>
+ <ipPort>3671</ipPort>
+ </hpaiControlEndpoint>
+ <dibDeviceInfo className="org.apache.plc4x.java.knxnetip.readwrite.DIBDeviceInfo">
+ <descriptionType>1</descriptionType>
+ <knxMedium>2</knxMedium>
+ <deviceStatus className="org.apache.plc4x.java.knxnetip.readwrite.DeviceStatus">
+ <programMode>false</programMode>
+ </deviceStatus>
+ <knxAddress className="org.apache.plc4x.java.knxnetip.readwrite.KNXAddress">
+ <mainGroup>15</mainGroup>
+ <middleGroup>15</middleGroup>
+ <subGroup>255</subGroup>
+ </knxAddress>
+ <projectInstallationIdentifier className="org.apache.plc4x.java.knxnetip.readwrite.ProjectInstallationIdentifier">
+ <projectNumber>0</projectNumber>
+ <installationNumber>0</installationNumber>
+ </projectInstallationIdentifier>
+ <knxNetIpDeviceSerialNumber>AAgtQJhS</knxNetIpDeviceSerialNumber>
+ <knxNetIpDeviceMulticastAddress className="org.apache.plc4x.java.knxnetip.readwrite.IPAddress">
+ <addr>4AAXDA==</addr>
+ </knxNetIpDeviceMulticastAddress>
+ <knxNetIpDeviceMacAddress className="org.apache.plc4x.java.knxnetip.readwrite.MACAddress">
+ <addr>AAqzJ1U2</addr>
+ </knxNetIpDeviceMacAddress>
+ <deviceFriendlyName>R2lyYSBLTlgvSVAtU2Nobml0dHN0ZWxsZQAAAAAA</deviceFriendlyName>
+ </dibDeviceInfo>
+ <dibSuppSvcFamilies className="org.apache.plc4x.java.knxnetip.readwrite.DIBSuppSvcFamilies">
+ <descriptionType>2</descriptionType>
+ <serviceIds>
+ <serviceIds className="org.apache.plc4x.java.knxnetip.readwrite.KnxNetIpCore">
+ <version>1</version>
+ </serviceIds>
+ <serviceIds className="org.apache.plc4x.java.knxnetip.readwrite.KnxNetIpDeviceManagement">
+ <version>1</version>
+ </serviceIds>
+ <serviceIds className="org.apache.plc4x.java.knxnetip.readwrite.KnxNetIpTunneling">
+ <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.readwrite.DescriptionRequest">
+ <hpaiControlEndpoint className="org.apache.plc4x.java.knxnetip.readwrite.HPAIControlEndpoint">
+ <hostProtocolCode>IPV4_UDP</hostProtocolCode>
+ <ipAddress className="org.apache.plc4x.java.knxnetip.readwrite.IPAddress">
+ <addr>AAAAAA==</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.readwrite.DescriptionResponse">
+ <dibDeviceInfo className="org.apache.plc4x.java.knxnetip.readwrite.DIBDeviceInfo">
+ <descriptionType>1</descriptionType>
+ <knxMedium>2</knxMedium>
+ <deviceStatus className="org.apache.plc4x.java.knxnetip.readwrite.DeviceStatus">
+ <programMode>false</programMode>
+ </deviceStatus>
+ <knxAddress className="org.apache.plc4x.java.knxnetip.readwrite.KNXAddress">
+ <mainGroup>15</mainGroup>
+ <middleGroup>15</middleGroup>
+ <subGroup>255</subGroup>
+ </knxAddress>
+ <projectInstallationIdentifier className="org.apache.plc4x.java.knxnetip.readwrite.ProjectInstallationIdentifier">
+ <projectNumber>0</projectNumber>
+ <installationNumber>0</installationNumber>
+ </projectInstallationIdentifier>
+ <knxNetIpDeviceSerialNumber>AAgtQJhS</knxNetIpDeviceSerialNumber>
+ <knxNetIpDeviceMulticastAddress className="org.apache.plc4x.java.knxnetip.readwrite.IPAddress">
+ <addr>4AAXDA==</addr>
+ </knxNetIpDeviceMulticastAddress>
+ <knxNetIpDeviceMacAddress className="org.apache.plc4x.java.knxnetip.readwrite.MACAddress">
+ <addr>AAqzJ1U2</addr>
+ </knxNetIpDeviceMacAddress>
+ <deviceFriendlyName>R2lyYSBLTlgvSVAtU2Nobml0dHN0ZWxsZQAAAAAA</deviceFriendlyName>
+ </dibDeviceInfo>
+ <dibSuppSvcFamilies className="org.apache.plc4x.java.knxnetip.readwrite.DIBSuppSvcFamilies">
+ <descriptionType>2</descriptionType>
+ <serviceIds>
+ <serviceIds className="org.apache.plc4x.java.knxnetip.readwrite.KnxNetIpCore">
+ <version>1</version>
+ </serviceIds>
+ <serviceIds className="org.apache.plc4x.java.knxnetip.readwrite.KnxNetIpDeviceManagement">
+ <version>1</version>
+ </serviceIds>
+ <serviceIds className="org.apache.plc4x.java.knxnetip.readwrite.KnxNetIpTunneling">
+ <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.readwrite.ConnectionRequest">
+ <hpaiDiscoveryEndpoint className="org.apache.plc4x.java.knxnetip.readwrite.HPAIDiscoveryEndpoint">
+ <hostProtocolCode>IPV4_UDP</hostProtocolCode>
+ <ipAddress className="org.apache.plc4x.java.knxnetip.readwrite.IPAddress">
+ <addr>wKgqRg==</addr>
+ </ipAddress>
+ <ipPort>62513</ipPort>
+ </hpaiDiscoveryEndpoint>
+ <hpaiDataEndpoint className="org.apache.plc4x.java.knxnetip.readwrite.HPAIDataEndpoint">
+ <hostProtocolCode>IPV4_UDP</hostProtocolCode>
+ <ipAddress className="org.apache.plc4x.java.knxnetip.readwrite.IPAddress">
+ <addr>wKgqRg==</addr>
+ </ipAddress>
+ <ipPort>62514</ipPort>
+ </hpaiDataEndpoint>
+ <connectionRequestInformation className="org.apache.plc4x.java.knxnetip.readwrite.ConnectionRequestInformationTunnelConnection">
+ <knxLayer>TUNNEL_LINK_LAYER</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.readwrite.ConnectionResponse">
+ <communicationChannelId>102</communicationChannelId>
+ <status>NO_ERROR</status>
+ <hpaiDataEndpoint className="org.apache.plc4x.java.knxnetip.readwrite.HPAIDataEndpoint">
+ <hostProtocolCode>IPV4_UDP</hostProtocolCode>
+ <ipAddress className="org.apache.plc4x.java.knxnetip.readwrite.IPAddress">
+ <addr>wKgqCw==</addr>
+ </ipAddress>
+ <ipPort>3671</ipPort>
+ </hpaiDataEndpoint>
+ <connectionResponseDataBlock className="org.apache.plc4x.java.knxnetip.readwrite.ConnectionResponseDataBlockTunnelConnection">
+ <knxAddress className="org.apache.plc4x.java.knxnetip.readwrite.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.readwrite.ConnectionStateRequest">
+ <communicationChannelId>102</communicationChannelId>
+ <hpaiControlEndpoint className="org.apache.plc4x.java.knxnetip.readwrite.HPAIControlEndpoint">
+ <hostProtocolCode>IPV4_UDP</hostProtocolCode>
+ <ipAddress className="org.apache.plc4x.java.knxnetip.readwrite.IPAddress">
+ <addr>wKgqRg==</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.readwrite.ConnectionStateResponse">
+ <communicationChannelId>102</communicationChannelId>
+ <status>NO_ERROR</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.readwrite.DeviceConfigurationRequest">
+ <deviceConfigurationRequestDataBlock className="org.apache.plc4x.java.knxnetip.readwrite.DeviceConfigurationRequestDataBlock">
+ <communicationChannelId>103</communicationChannelId>
+ <sequenceCounter>0</sequenceCounter>
+ </deviceConfigurationRequestDataBlock>
+ <cemi className="org.apache.plc4x.java.knxnetip.readwrite.CEMIMPropReadReq">
+ <interfaceObjectType>0</interfaceObjectType>
+ <objectInstance>1</objectInstance>
+ <propertyId>83</propertyId>
+ <numberOfElements>1</numberOfElements>
+ <startIndex>1</startIndex>
+ </cemi>
+ </DeviceConfigurationRequest>
+ </xml>
+ </testcase>
+
+ <testcase>
+ <name>Device Configuration Ack</name>
+ <raw>06100311000a04670000</raw>
+ <root-type>KNXNetIPMessage</root-type>
+ <xml>
+ <DeviceConfigurationAck className="org.apache.plc4x.java.knxnetip.readwrite.DeviceConfigurationAck">
+ <deviceConfigurationAckDataBlock className="org.apache.plc4x.java.knxnetip.readwrite.DeviceConfigurationAckDataBlock">
+ <communicationChannelId>103</communicationChannelId>
+ <sequenceCounter>0</sequenceCounter>
+ <status>NO_ERROR</status>
+ </deviceConfigurationAckDataBlock>
+ </DeviceConfigurationAck>
+ </xml>
+ </testcase>
+
+ <testcase>
+ <name>Disconnect Request</name>
+ <raw>06100209001067000801c0a82a46f431</raw>
+ <root-type>KNXNetIPMessage</root-type>
+ <xml>
+ <DisconnectRequest className="org.apache.plc4x.java.knxnetip.readwrite.DisconnectRequest">
+ <communicationChannelId>103</communicationChannelId>
+ <hpaiControlEndpoint className="org.apache.plc4x.java.knxnetip.readwrite.HPAIControlEndpoint">
+ <hostProtocolCode>IPV4_UDP</hostProtocolCode>
+ <ipAddress className="org.apache.plc4x.java.knxnetip.readwrite.IPAddress">
+ <addr>wKgqRg==</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.readwrite.DisconnectResponse">
+ <communicationChannelId>102</communicationChannelId>
+ <status>NO_ERROR</status>
+ </DisconnectResponse>
+ </xml>
+ </testcase>
+
+ <testcase>
+ <name>Tunneling Request</name>
+ <raw>06100420001c046b00002b0703010504024502bc360a1e0ce100810d</raw>
+ <!--
+ Raw CEMI Frame: bc360a1e0ce100810d
+ Control Field: bc
+ -->
+ <root-type>KNXNetIPMessage</root-type>
+ <xml>
+ <TunnelingRequest className="org.apache.plc4x.java.knxnetip.readwrite.TunnelingRequest">
+ <tunnelingRequestDataBlock className="org.apache.plc4x.java.knxnetip.readwrite.TunnelingRequestDataBlock">
+ <communicationChannelId>107</communicationChannelId>
+ <sequenceCounter>0</sequenceCounter>
+ </tunnelingRequestDataBlock>
+ <cemi className="org.apache.plc4x.java.knxnetip.readwrite.CEMIBusmonInd">
+ <additionalInformationLength>7</additionalInformationLength>
+ <additionalInformation>
+ <additionalInformation className="org.apache.plc4x.java.knxnetip.readwrite.CEMIAdditionalInformationBusmonitorInfo">
+ <frameErrorFlag>false</frameErrorFlag>
+ <bitErrorFlag>false</bitErrorFlag>
+ <parityErrorFlag>false</parityErrorFlag>
+ <unknownFlag>false</unknownFlag>
+ <lostFlag>false</lostFlag>
+ <sequenceNumber>5</sequenceNumber>
+ </additionalInformation>
+ <additionalInformation className="org.apache.plc4x.java.knxnetip.readwrite.CEMIAdditionalInformationRelativeTimestamp">
+ <relativeTimestamp className="org.apache.plc4x.java.knxnetip.readwrite.RelativeTimestamp">
+ <timestamp>17666</timestamp>
+ </relativeTimestamp>
+ </additionalInformation>
+ </additionalInformation>
+ <cemiFrame className="org.apache.plc4x.java.knxnetip.readwrite.CEMIFrameData">
+ <repeated>true</repeated>
+ <priority>LOW</priority>
+ <acknowledgeRequested>false</acknowledgeRequested>
+ <errorFlag>false</errorFlag>
+ <sourceAddress className="org.apache.plc4x.java.knxnetip.readwrite.KNXAddress">
+ <mainGroup>3</mainGroup>
+ <middleGroup>6</middleGroup>
+ <subGroup>10</subGroup>
+ </sourceAddress>
+ <destinationAddress>Hgw=</destinationAddress>
+ <groupAddress>true</groupAddress>
+ <hopCount>6</hopCount>
+ <dataLength>1</dataLength>
+ <tcpi>UNNUMBERED_DATA_PACKET</tcpi>
+ <counter>0</counter>
+ <apci>GROUP_VALUE_WRITE_PDU</apci>
+ <dataFirstByte>1</dataFirstByte>
+ <data></data>
+ <crc>13</crc>
+ </cemiFrame>
+ </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.readwrite.TunnelingResponse">
+ <tunnelingResponseDataBlock className="org.apache.plc4x.java.knxnetip.readwrite.TunnelingResponseDataBlock">
+ <communicationChannelId>107</communicationChannelId>
+ <sequenceCounter>0</sequenceCounter>
+ <status>NO_ERROR</status>
+ </tunnelingResponseDataBlock>
+ </TunnelingResponse>
+ </xml>
+ </testcase>
+
+ <testcase>
+ <name>Default</name>
+ <raw>0610020500180801c0a82a46c4090801c0a82a46c40a0203</raw>
+ <root-type>KNXNetIPMessage</root-type>
+ <xml>
+ <ConnectionRequest className="org.apache.plc4x.java.knxnetip.readwrite.ConnectionRequest">
+ <hpaiDiscoveryEndpoint className="org.apache.plc4x.java.knxnetip.readwrite.HPAIDiscoveryEndpoint">
+ <hostProtocolCode>IPV4_UDP</hostProtocolCode>
+ <ipAddress className="org.apache.plc4x.java.knxnetip.readwrite.IPAddress">
+ <addr>wKgqRg==</addr>
+ </ipAddress>
+ <ipPort>50185</ipPort>
+ </hpaiDiscoveryEndpoint>
+ <hpaiDataEndpoint className="org.apache.plc4x.java.knxnetip.readwrite.HPAIDataEndpoint">
+ <hostProtocolCode>IPV4_UDP</hostProtocolCode>
+ <ipAddress className="org.apache.plc4x.java.knxnetip.readwrite.IPAddress">
+ <addr>wKgqRg==</addr>
+ </ipAddress>
+ <ipPort>50186</ipPort>
+ </hpaiDataEndpoint>
+ <connectionRequestInformation className="org.apache.plc4x.java.knxnetip.readwrite.ConnectionRequestInformationDeviceManagement"/>
+ </ConnectionRequest>
+ </xml>
+ </testcase>
+
+</test:testsuite>
\ No newline at end of file
diff --git a/sandbox/plc4go/assets/testing/protocols/modbus/ParserSerializerTestsuite.xml b/sandbox/plc4go/assets/testing/protocols/modbus/ParserSerializerTestsuite.xml
new file mode 100644
index 0000000..ccef65b
--- /dev/null
+++ b/sandbox/plc4go/assets/testing/protocols/modbus/ParserSerializerTestsuite.xml
@@ -0,0 +1,179 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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
+
+ http://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.
+ -->
+<test:testsuite xmlns:test="https://plc4x.apache.org/schemas/parser-serializer-testsuite.xsd" bigEndian="true">
+
+ <name>Modbus</name>
+
+ <testcase>
+ <name>Read Input Registers Request</name>
+ <raw>000000000006ff0408d20002</raw>
+ <root-type>ModbusTcpADU</root-type>
+ <parser-arguments>
+ <response>false</response>
+ </parser-arguments>
+ <xml>
+ <ModbusTcpADU className="org.apache.plc4x.java.modbus.readwrite.ModbusTcpADU">
+ <transactionIdentifier>0</transactionIdentifier>
+ <unitIdentifier>255</unitIdentifier>
+ <pdu className="org.apache.plc4x.java.modbus.readwrite.ModbusPDUReadInputRegistersRequest">
+ <startingAddress>2258</startingAddress>
+ <quantity>2</quantity>
+ </pdu>
+ </ModbusTcpADU>
+ </xml>
+ </testcase>
+
+ <testcase>
+ <name>Read Input Registers Response</name>
+ <raw>7cfe000000c9ff04c600000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000004000000000000000000000000000001db000001d600004a380000000000000000000000000000000000000000000000000000000000006461696d006e0000000000000000000000000000303100300000000000000000000000000000000000000000000000000000000000000000000000000000</raw>
+ <root-type>ModbusTcpADU</root-type>
+ <parser-arguments>
+ <response>true</response>
+ </parser-arguments>
+ <xml>
+ <ModbusTcpADU className="org.apache.plc4x.java.modbus.readwrite.ModbusTcpADU">
+ <transactionIdentifier>31998</transactionIdentifier>
+ <unitIdentifier>255</unitIdentifier>
+ <pdu className="org.apache.plc4x.java.modbus.readwrite.ModbusPDUReadInputRegistersResponse">
+ <value>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAABAAAABAAAAAAAAAAAAAAAAAAAAdsAAAHWAABKOAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAGRhaW0AbgAAAAAAAAAAAAAAAAAAMDEAMAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA</value>
+ </pdu>
+ </ModbusTcpADU>
+ </xml>
+ </testcase>
+
+ <testcase>
+ <name>Read Extended Registers Request Split File Record</name>
+ <raw>000a0000001101140e060003270e000206000400000008</raw>
+ <root-type>ModbusTcpADU</root-type>
+ <parser-arguments>
+ <response>false</response>
+ </parser-arguments>
+ <xml>
+ <ModbusTcpADU className="org.apache.plc4x.java.modbus.readwrite.ModbusTcpADU">
+ <transactionIdentifier>10</transactionIdentifier>
+ <unitIdentifier>1</unitIdentifier>
+ <pdu className="org.apache.plc4x.java.modbus.readwrite.ModbusPDUReadFileRecordRequest">
+ <items>
+ <items className="org.apache.plc4x.java.modbus.readwrite.ModbusPDUReadFileRecordRequestItem">
+ <referenceType>6</referenceType>
+ <fileNumber>3</fileNumber>
+ <recordNumber>9998</recordNumber>
+ <recordLength>2</recordLength>
+ </items>
+ <items className="org.apache.plc4x.java.modbus.readwrite.ModbusPDUReadFileRecordRequestItem">
+ <referenceType>6</referenceType>
+ <fileNumber>4</fileNumber>
+ <recordNumber>0</recordNumber>
+ <recordLength>8</recordLength>
+ </items>
+ </items>
+ </pdu>
+ </ModbusTcpADU>
+ </xml>
+ </testcase>
+
+ <testcase>
+ <name>Read Extended Registers Response Split File Record</name>
+ <raw>000a0000001b011418050600000000110600000000000000000000000000000000</raw>
+ <root-type>ModbusTcpADU</root-type>
+ <parser-arguments>
+ <response>true</response>
+ </parser-arguments>
+ <xml>
+ <ModbusTcpADU className="org.apache.plc4x.java.modbus.readwrite.ModbusTcpADU">
+ <transactionIdentifier>10</transactionIdentifier>
+ <unitIdentifier>1</unitIdentifier>
+ <pdu className="org.apache.plc4x.java.modbus.readwrite.ModbusPDUReadFileRecordResponse">
+ <items>
+ <items className="org.apache.plc4x.java.modbus.readwrite.ModbusPDUReadFileRecordResponseItem">
+ <referenceType>6</referenceType>
+ <data>AAAAAA==</data>
+ </items>
+ <items className="org.apache.plc4x.java.modbus.readwrite.ModbusPDUReadFileRecordResponseItem">
+ <referenceType>6</referenceType>
+ <data>AAAAAAAAAAAAAAAAAAAAAA==</data>
+ </items>
+ </items>
+ </pdu>
+ </ModbusTcpADU>
+ </xml>
+ </testcase>
+
+ <testcase>
+ <name>Write Extended Registers Request File Record</name>
+
+ <raw>000a0000000c011509060002000000010008</raw>
+ <root-type>ModbusTcpADU</root-type>
+ <parser-arguments>
+ <response>false</response>
+ </parser-arguments>
+ <xml>
+ <ModbusTcpADU className="org.apache.plc4x.java.modbus.readwrite.ModbusTcpADU">
+ <transactionIdentifier>10</transactionIdentifier>
+ <unitIdentifier>1</unitIdentifier>
+ <pdu className="org.apache.plc4x.java.modbus.readwrite.ModbusPDUWriteFileRecordRequest">
+ <items>
+ <items className="org.apache.plc4x.java.modbus.readwrite.ModbusPDUWriteFileRecordRequestItem">
+ <referenceType>6</referenceType>
+ <fileNumber>2</fileNumber>
+ <recordNumber>0</recordNumber>
+ <recordData>AAg=</recordData>
+ </items>
+ </items>
+ </pdu>
+ </ModbusTcpADU>
+ </xml>
+ </testcase>
+
+ <testcase>
+ <name>Write Extended Registers Request Split File Record</name>
+ <raw>000a00000015011512060001270F00010000060002000000010000</raw>
+ <root-type>ModbusTcpADU</root-type>
+ <parser-arguments>
+ <response>false</response>
+ </parser-arguments>
+ <xml>
+ <ModbusTcpADU className="org.apache.plc4x.java.modbus.readwrite.ModbusTcpADU">
+ <transactionIdentifier>10</transactionIdentifier>
+ <unitIdentifier>1</unitIdentifier>
+ <pdu className="org.apache.plc4x.java.modbus.readwrite.ModbusPDUWriteFileRecordRequest">
+ <items>
+ <items className="org.apache.plc4x.java.modbus.readwrite.ModbusPDUWriteFileRecordRequestItem">
+ <referenceType>6</referenceType>
+ <fileNumber>1</fileNumber>
+ <recordNumber>9999</recordNumber>
+ <recordData>AAA=</recordData>
+ </items>
+ <items className="org.apache.plc4x.java.modbus.readwrite.ModbusPDUWriteFileRecordRequestItem">
+ <referenceType>6</referenceType>
+ <fileNumber>2</fileNumber>
+ <recordNumber>0</recordNumber>
+ <recordData>AAA=</recordData>
+ </items>
+ </items>
+ </pdu>
+ </ModbusTcpADU>
+ </xml>
+ </testcase>
+
+</test:testsuite>
diff --git a/sandbox/plc4go/assets/testing/protocols/s7/DriverTestsuite.xml b/sandbox/plc4go/assets/testing/protocols/s7/DriverTestsuite.xml
new file mode 100644
index 0000000..baa2eb0
--- /dev/null
+++ b/sandbox/plc4go/assets/testing/protocols/s7/DriverTestsuite.xml
@@ -0,0 +1,383 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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
+
+ http://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.
+ -->
+<test:driver-testsuite xmlns:test="https://plc4x.apache.org/schemas/driver-testsuite.xsd"
+ bigEndian="true">
+
+ <name>S7</name>
+
+ <driver-name>s7</driver-name>
+
+ <setup>
+ <!-- First the driver is expected to send a COTP connection request -->
+ <outgoing-plc-message name="Send COTP Connection Request">
+ <TPKTPacket className="org.apache.plc4x.java.s7.readwrite.TPKTPacket">
+ <payload className="org.apache.plc4x.java.s7.readwrite.COTPPacketConnectionRequest">
+ <parameters>
+ <parameters className="org.apache.plc4x.java.s7.readwrite.COTPParameterCalledTsap">
+ <tsapId>256</tsapId>
+ </parameters>
+ <parameters className="org.apache.plc4x.java.s7.readwrite.COTPParameterCallingTsap">
+ <tsapId>785</tsapId>
+ </parameters>
+ <parameters className="org.apache.plc4x.java.s7.readwrite.COTPParameterTpduSize">
+ <tpduSize>SIZE_1024</tpduSize>
+ </parameters>
+ </parameters>
+ <payload/>
+ <destinationReference>0</destinationReference>
+ <sourceReference>15</sourceReference>
+ <protocolClass>CLASS_0</protocolClass>
+ </payload>
+ </TPKTPacket>
+ </outgoing-plc-message>
+ <!-- The PLC will send a COTP connection response -->
+ <incoming-plc-message name="Receive COTP Connection Response">
+ <TPKTPacket className="org.apache.plc4x.java.s7.readwrite.TPKTPacket">
+ <payload className="org.apache.plc4x.java.s7.readwrite.COTPPacketConnectionResponse">
+ <parameters>
+ <parameters className="org.apache.plc4x.java.s7.readwrite.COTPParameterTpduSize">
+ <tpduSize>SIZE_1024</tpduSize>
+ </parameters>
+ <parameters className="org.apache.plc4x.java.s7.readwrite.COTPParameterCallingTsap">
+ <tsapId>785</tsapId>
+ </parameters>
+ <parameters className="org.apache.plc4x.java.s7.readwrite.COTPParameterCalledTsap">
+ <tsapId>256</tsapId>
+ </parameters>
+ </parameters>
+ <payload/>
+ <destinationReference>15</destinationReference>
+ <sourceReference>11</sourceReference>
+ <protocolClass>CLASS_0</protocolClass>
+ </payload>
+ </TPKTPacket>
+ </incoming-plc-message>
+ <!-- After that the driver will send a S7 connection request -->
+ <outgoing-plc-message name="Send S7 Connection Request">
+ <TPKTPacket className="org.apache.plc4x.java.s7.readwrite.TPKTPacket">
+ <payload className="org.apache.plc4x.java.s7.readwrite.COTPPacketData">
+ <parameters/>
+ <payload className="org.apache.plc4x.java.s7.readwrite.S7MessageRequest">
+ <tpduReference>0</tpduReference>
+ <parameter className="org.apache.plc4x.java.s7.readwrite.S7ParameterSetupCommunication">
+ <maxAmqCaller>8</maxAmqCaller>
+ <maxAmqCallee>8</maxAmqCallee>
+ <pduLength>1008</pduLength>
+ </parameter>
+ <payload/>
+ </payload>
+ <eot>true</eot>
+ <tpduRef>1</tpduRef>
+ </payload>
+ </TPKTPacket>
+ </outgoing-plc-message>
+ <!-- The PLC will send a S7 connection response -->
+ <incoming-plc-message name="Receive S7 Connection Response">
+ <TPKTPacket className="org.apache.plc4x.java.s7.readwrite.TPKTPacket">
+ <payload className="org.apache.plc4x.java.s7.readwrite.COTPPacketData">
+ <parameters/>
+ <payload className="org.apache.plc4x.java.s7.readwrite.S7MessageResponseData">
+ <tpduReference>0</tpduReference>
+ <parameter className="org.apache.plc4x.java.s7.readwrite.S7ParameterSetupCommunication">
+ <maxAmqCaller>3</maxAmqCaller>
+ <maxAmqCallee>3</maxAmqCallee>
+ <pduLength>240</pduLength>
+ </parameter>
+ <payload/>
+ <errorClass>0</errorClass>
+ <errorCode>0</errorCode>
+ </payload>
+ <eot>true</eot>
+ <tpduRef>0</tpduRef>
+ </payload>
+ </TPKTPacket>
+ </incoming-plc-message>
+ <!-- Next we'll query some type information -->
+ <outgoing-plc-message name="Send S7 Identification Request">
+ <TPKTPacket className="org.apache.plc4x.java.s7.readwrite.TPKTPacket">
+ <payload className="org.apache.plc4x.java.s7.readwrite.COTPPacketData">
+ <parameters/>
+ <payload className="org.apache.plc4x.java.s7.readwrite.S7MessageUserData">
+ <tpduReference>1</tpduReference>
+ <parameter className="org.apache.plc4x.java.s7.readwrite.S7ParameterUserData">
+ <items>
+ <items className="org.apache.plc4x.java.s7.readwrite.S7ParameterUserDataItemCPUFunctions">
+ <method>17</method>
+ <cpuFunctionType>4</cpuFunctionType>
+ <cpuFunctionGroup>4</cpuFunctionGroup>
+ <cpuSubfunction>1</cpuSubfunction>
+ <sequenceNumber>0</sequenceNumber>
+ <dataUnitReferenceNumber/>
+ <lastDataUnit/>
+ <errorCode/>
+ </items>
+ </items>
+ </parameter>
+ <payload className="org.apache.plc4x.java.s7.readwrite.S7PayloadUserData">
+ <items>
+ <items className="org.apache.plc4x.java.s7.readwrite.S7PayloadUserDataItemCpuFunctionReadSzlRequest">
+ <returnCode>OK</returnCode>
+ <transportSize>OCTET_STRING</transportSize>
+ <szlId className="org.apache.plc4x.java.s7.readwrite.SzlId">
+ <typeClass>CPU</typeClass>
+ <sublistExtract>0</sublistExtract>
+ <sublistList>MODULE_IDENTIFICATION</sublistList>
+ </szlId>
+ <szlIndex>0</szlIndex>
+ </items>
+ </items>
+ </payload>
+ </payload>
+ <eot>true</eot>
+ <tpduRef>2</tpduRef>
+ </payload>
+ </TPKTPacket>
+ </outgoing-plc-message>
+ <!-- Which the PLC will gladly provide to us -->
+ <incoming-plc-message name="Receive S7 Identification Response">
+ <TPKTPacket className="org.apache.plc4x.java.s7.readwrite.TPKTPacket">
+ <payload className="org.apache.plc4x.java.s7.readwrite.COTPPacketData">
+ <parameters/>
+ <payload className="org.apache.plc4x.java.s7.readwrite.S7MessageUserData">
+ <tpduReference>1</tpduReference>
+ <parameter className="org.apache.plc4x.java.s7.readwrite.S7ParameterUserData">
+ <items>
+ <items className="org.apache.plc4x.java.s7.readwrite.S7ParameterUserDataItemCPUFunctions">
+ <method>18</method>
+ <cpuFunctionType>8</cpuFunctionType>
+ <cpuFunctionGroup>4</cpuFunctionGroup>
+ <cpuSubfunction>1</cpuSubfunction>
+ <sequenceNumber>1</sequenceNumber>
+ <dataUnitReferenceNumber>0</dataUnitReferenceNumber>
+ <lastDataUnit>0</lastDataUnit>
+ <errorCode>0</errorCode>
+ </items>
+ </items>
+ </parameter>
+ <payload className="org.apache.plc4x.java.s7.readwrite.S7PayloadUserData">
+ <items>
+ <items className="org.apache.plc4x.java.s7.readwrite.S7PayloadUserDataItemCpuFunctionReadSzlResponse">
+ <returnCode>OK</returnCode>
+ <transportSize>OCTET_STRING</transportSize>
+ <szlId className="org.apache.plc4x.java.s7.readwrite.SzlId">
+ <typeClass>CPU</typeClass>
+ <sublistExtract>0</sublistExtract>
+ <sublistList>MODULE_IDENTIFICATION</sublistList>
+ </szlId>
+ <szlIndex>0</szlIndex>
+ <items>
+ <items className="org.apache.plc4x.java.s7.readwrite.SzlDataTreeItem">
+ <itemIndex>1</itemIndex>
+ <mlfb>NkVTNyAyMTItMUJEMzAtMFhCMCA=</mlfb>
+ <moduleTypeId>8224</moduleTypeId>
+ <ausbg>1</ausbg>
+ <ausbe>8224</ausbe>
+ </items>
+ <items className="org.apache.plc4x.java.s7.readwrite.SzlDataTreeItem">
+ <itemIndex>6</itemIndex>
+ <mlfb>NkVTNyAyMTItMUJEMzAtMFhCMCA=</mlfb>
+ <moduleTypeId>8224</moduleTypeId>
+ <ausbg>1</ausbg>
+ <ausbe>8224</ausbe>
+ </items>
+ <items className="org.apache.plc4x.java.s7.readwrite.SzlDataTreeItem">
+ <itemIndex>7</itemIndex>
+ <mlfb>NkVTNyAyMTItMUJEMzAtMFhCMCA=</mlfb>
+ <moduleTypeId>8224</moduleTypeId>
+ <ausbg>22018</ausbg>
+ <ausbe>2</ausbe>
+ </items>
+ </items>
+ </items>
+ </items>
+ </payload>
+ </payload>
+ <eot>true</eot>
+ <tpduRef>0</tpduRef>
+ </payload>
+ </TPKTPacket>
+ </incoming-plc-message>
+ </setup>
+
+ <testcase>
+ <name>Single element read request</name>
+ <steps>
+ <api-request name="Receive Read Request from application">
+ <TestReadRequest className="org.apache.plc4x.test.driver.model.api.TestReadRequest">
+ <fields>
+ <field className="org.apache.plc4x.test.driver.model.api.TestField">
+ <name>hurz</name>
+ <address>%Q0.0:BOOL</address>
+ </field>
+ </fields>
+ </TestReadRequest>
+ </api-request>
+ <outgoing-plc-message name="Send S7 Read Request">
+ <TPKTPacket className="org.apache.plc4x.java.s7.readwrite.TPKTPacket">
+ <payload className="org.apache.plc4x.java.s7.readwrite.COTPPacketData">
+ <parameters/>
+ <payload className="org.apache.plc4x.java.s7.readwrite.S7MessageRequest">
+ <tpduReference>10</tpduReference>
+ <parameter className="org.apache.plc4x.java.s7.readwrite.S7ParameterReadVarRequest">
+ <items>
+ <items className="org.apache.plc4x.java.s7.readwrite.S7VarRequestParameterItemAddress">
+ <address className="org.apache.plc4x.java.s7.readwrite.S7AddressAny">
+ <transportSize>BOOL</transportSize>
+ <numberOfElements>1</numberOfElements>
+ <dbNumber>0</dbNumber>
+ <area>OUTPUTS</area>
+ <byteAddress>0</byteAddress>
+ <bitAddress>0</bitAddress>
+ </address>
+ </items>
+ </items>
+ </parameter>
+ <payload/>
+ </payload>
+ <eot>true</eot>
+ <tpduRef>10</tpduRef>
+ </payload>
+ </TPKTPacket>
+ </outgoing-plc-message>
+ <incoming-plc-message name="Receive S7 Read Response">
+ <TPKTPacket className="org.apache.plc4x.java.s7.readwrite.TPKTPacket">
+ <payload className="org.apache.plc4x.java.s7.readwrite.COTPPacketData">
+ <parameters/>
+ <payload className="org.apache.plc4x.java.s7.readwrite.S7MessageResponseData">
+ <tpduReference>10</tpduReference>
+ <parameter className="org.apache.plc4x.java.s7.readwrite.S7ParameterReadVarResponse">
+ <numItems>1</numItems>
+ </parameter>
+ <payload className="org.apache.plc4x.java.s7.readwrite.S7PayloadReadVarResponse">
+ <items>
+ <items className="org.apache.plc4x.java.s7.readwrite.S7VarPayloadDataItem">
+ <returnCode>OK</returnCode>
+ <transportSize>BIT</transportSize>
+ <data>AQ==</data>
+ </items>
+ </items>
+ </payload>
+ <errorClass>0</errorClass>
+ <errorCode>0</errorCode>
+ </payload>
+ <eot>true</eot>
+ <tpduRef>0</tpduRef>
+ </payload>
+ </TPKTPacket>
+ </incoming-plc-message>
+ <api-response name="Report Read Response to application">
+ <DefaultPlcReadResponse className="org.apache.plc4x.java.spi.messages.DefaultPlcReadResponse">
+ <request className="org.apache.plc4x.java.spi.messages.DefaultPlcReadRequest">
+ <hurz className="org.apache.plc4x.java.s7.readwrite.field.S7Field">
+ <dataType>BOOL</dataType>
+ <memoryArea>OUTPUTS</memoryArea>
+ <blockNumber>0</blockNumber>
+ <byteOffset>0</byteOffset>
+ <bitOffset>0</bitOffset>
+ <numElements>1</numElements>
+ </hurz>
+ </request>
+ <hurz>
+ <code>OK</code>
+ <value className="org.apache.plc4x.java.api.value.PlcBOOL">
+ <object>true</object>
+ </value>
+ </hurz>
+ </DefaultPlcReadResponse>
+ </api-response>
+ </steps>
+ </testcase>
+
+ <testcase>
+ <name>Single element read request with disabled PUT/GET</name>
+ <steps>
+ <api-request name="Receive Read Request from application">
+ <TestReadRequest className="org.apache.plc4x.test.driver.model.api.TestReadRequest">
+ <fields>
+ <field className="org.apache.plc4x.test.driver.model.api.TestField">
+ <name>hurz</name>
+ <address>%Q0.0:BOOL</address>
+ </field>
+ </fields>
+ </TestReadRequest>
+ </api-request>
+ <outgoing-plc-message name="Send S7 Read Request">
+ <TPKTPacket className="org.apache.plc4x.java.s7.readwrite.TPKTPacket">
+ <payload className="org.apache.plc4x.java.s7.readwrite.COTPPacketData">
+ <parameters/>
+ <payload className="org.apache.plc4x.java.s7.readwrite.S7MessageRequest">
+ <tpduReference>10</tpduReference>
+ <parameter className="org.apache.plc4x.java.s7.readwrite.S7ParameterReadVarRequest">
+ <items>
+ <items className="org.apache.plc4x.java.s7.readwrite.S7VarRequestParameterItemAddress">
+ <address className="org.apache.plc4x.java.s7.readwrite.S7AddressAny">
+ <transportSize>BOOL</transportSize>
+ <numberOfElements>1</numberOfElements>
+ <dbNumber>0</dbNumber>
+ <area>OUTPUTS</area>
+ <byteAddress>0</byteAddress>
+ <bitAddress>0</bitAddress>
+ </address>
+ </items>
+ </items>
+ </parameter>
+ <payload/>
+ </payload>
+ <eot>true</eot>
+ <tpduRef>10</tpduRef>
+ </payload>
+ </TPKTPacket>
+ </outgoing-plc-message>
+ <incoming-plc-message name="Receive S7 Read Response">
+ <TPKTPacket className="org.apache.plc4x.java.s7.readwrite.TPKTPacket">
+ <payload className="org.apache.plc4x.java.s7.readwrite.COTPPacketData">
+ <parameters/>
+ <payload className="org.apache.plc4x.java.s7.readwrite.S7MessageResponse">
+ <tpduReference>10</tpduReference>
+ <errorClass>129</errorClass>
+ <errorCode>4</errorCode>
+ </payload>
+ <eot>true</eot>
+ <tpduRef>0</tpduRef>
+ </payload>
+ </TPKTPacket>
+ </incoming-plc-message>
+ <api-response name="Report Read Response to application">
+ <DefaultPlcReadResponse className="org.apache.plc4x.java.spi.messages.DefaultPlcReadResponse">
+ <request className="org.apache.plc4x.java.spi.messages.DefaultPlcReadRequest">
+ <hurz className="org.apache.plc4x.java.s7.readwrite.field.S7Field">
+ <dataType>BOOL</dataType>
+ <memoryArea>OUTPUTS</memoryArea>
+ <blockNumber>0</blockNumber>
+ <byteOffset>0</byteOffset>
+ <bitOffset>0</bitOffset>
+ <numElements>1</numElements>
+ </hurz>
+ </request>
+ <hurz>
+ <code>ACCESS_DENIED</code>
+ <value/>
+ </hurz>
+ </DefaultPlcReadResponse>
+ </api-response>
+ </steps>
+ </testcase>
+
+</test:driver-testsuite>
\ No newline at end of file
diff --git a/sandbox/plc4go/assets/testing/protocols/s7/ParserSerializerTestsuite.xml b/sandbox/plc4go/assets/testing/protocols/s7/ParserSerializerTestsuite.xml
new file mode 100644
index 0000000..1c3b735
--- /dev/null
+++ b/sandbox/plc4go/assets/testing/protocols/s7/ParserSerializerTestsuite.xml
@@ -0,0 +1,501 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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
+
+ http://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.
+ -->
+<test:testsuite xmlns:test="https://plc4x.apache.org/schemas/parser-serializer-testsuite.xsd" bigEndian="true">
+
+ <name>S7</name>
+
+ <testcase>
+ <name>COTP Connection Request</name>
+ <raw>0300001611e00000000f00c2020100c1020311c0010a</raw>
+ <root-type>TPKTPacket</root-type>
+ <xml>
+ <TPKTPacket className="org.apache.plc4x.java.s7.readwrite.TPKTPacket">
+ <payload className="org.apache.plc4x.java.s7.readwrite.COTPPacketConnectionRequest">
+ <parameters>
+ <parameters className="org.apache.plc4x.java.s7.readwrite.COTPParameterCalledTsap">
+ <tsapId>256</tsapId>
+ </parameters>
+ <parameters className="org.apache.plc4x.java.s7.readwrite.COTPParameterCallingTsap">
+ <tsapId>785</tsapId>
+ </parameters>
+ <parameters className="org.apache.plc4x.java.s7.readwrite.COTPParameterTpduSize">
+ <tpduSize>SIZE_1024</tpduSize>
+ </parameters>
+ </parameters>
+ <payload/>
+ <destinationReference>0</destinationReference>
+ <sourceReference>15</sourceReference>
+ <protocolClass>CLASS_0</protocolClass>
+ </payload>
+ </TPKTPacket>
+ </xml>
+ </testcase>
+
+ <testcase>
+ <name>COTP Connection Response</name>
+ <raw>0300001611d0000f000b00c0010ac1020311c2020100</raw>
+ <root-type>TPKTPacket</root-type>
+ <xml>
+ <TPKTPacket className="org.apache.plc4x.java.s7.readwrite.TPKTPacket">
+ <payload className="org.apache.plc4x.java.s7.readwrite.COTPPacketConnectionResponse">
+ <parameters>
+ <parameters className="org.apache.plc4x.java.s7.readwrite.COTPParameterTpduSize">
+ <tpduSize>SIZE_1024</tpduSize>
+ </parameters>
+ <parameters className="org.apache.plc4x.java.s7.readwrite.COTPParameterCallingTsap">
+ <tsapId>785</tsapId>
+ </parameters>
+ <parameters className="org.apache.plc4x.java.s7.readwrite.COTPParameterCalledTsap">
+ <tsapId>256</tsapId>
+ </parameters>
+ </parameters>
+ <payload/>
+ <destinationReference>15</destinationReference>
+ <sourceReference>11</sourceReference>
+ <protocolClass>CLASS_0</protocolClass>
+ </payload>
+ </TPKTPacket>
+ </xml>
+ </testcase>
+
+ <testcase>
+ <name>S7 Setup Communication Request</name>
+ <raw>0300001902f08132010000000000080000f0000008000803f0</raw>
+ <root-type>TPKTPacket</root-type>
+ <xml>
+ <TPKTPacket className="org.apache.plc4x.java.s7.readwrite.TPKTPacket">
+ <payload className="org.apache.plc4x.java.s7.readwrite.COTPPacketData">
+ <parameters/>
+ <payload className="org.apache.plc4x.java.s7.readwrite.S7MessageRequest">
+ <tpduReference>0</tpduReference>
+ <parameter className="org.apache.plc4x.java.s7.readwrite.S7ParameterSetupCommunication">
+ <maxAmqCaller>8</maxAmqCaller>
+ <maxAmqCallee>8</maxAmqCallee>
+ <pduLength>1008</pduLength>
+ </parameter>
+ <payload/>
+ </payload>
+ <eot>true</eot>
+ <tpduRef>1</tpduRef>
+ </payload>
+ </TPKTPacket>
+ </xml>
+ </testcase>
+
+ <testcase>
+ <name>S7 Setup Communication Response</name>
+ <raw>0300001b02f080320300000000000800000000f0000003000300f0</raw>
+ <root-type>TPKTPacket</root-type>
+ <xml>
+ <TPKTPacket className="org.apache.plc4x.java.s7.readwrite.TPKTPacket">
+ <payload className="org.apache.plc4x.java.s7.readwrite.COTPPacketData">
+ <parameters/>
+ <payload className="org.apache.plc4x.java.s7.readwrite.S7MessageResponseData">
+ <tpduReference>0</tpduReference>
+ <parameter className="org.apache.plc4x.java.s7.readwrite.S7ParameterSetupCommunication">
+ <maxAmqCaller>3</maxAmqCaller>
+ <maxAmqCallee>3</maxAmqCallee>
+ <pduLength>240</pduLength>
+ </parameter>
+ <payload/>
+ <errorClass>0</errorClass>
+ <errorCode>0</errorCode>
+ </payload>
+ <eot>true</eot>
+ <tpduRef>0</tpduRef>
+ </payload>
+ </TPKTPacket>
+ </xml>
+ </testcase>
+
+ <testcase>
+ <name>S7 Read PLC Type Request</name>
+ <raw>0300002102f082320700000001000800080001120411440100ff09000400110000</raw>
+ <root-type>TPKTPacket</root-type>
+ <xml>
+ <TPKTPacket className="org.apache.plc4x.java.s7.readwrite.TPKTPacket">
+ <payload className="org.apache.plc4x.java.s7.readwrite.COTPPacketData">
+ <parameters/>
+ <payload className="org.apache.plc4x.java.s7.readwrite.S7MessageUserData">
+ <tpduReference>1</tpduReference>
+ <parameter className="org.apache.plc4x.java.s7.readwrite.S7ParameterUserData">
+ <items>
+ <items className="org.apache.plc4x.java.s7.readwrite.S7ParameterUserDataItemCPUFunctions">
+ <method>17</method>
+ <cpuFunctionType>4</cpuFunctionType>
+ <cpuFunctionGroup>4</cpuFunctionGroup>
+ <cpuSubfunction>1</cpuSubfunction>
+ <sequenceNumber>0</sequenceNumber>
+ <dataUnitReferenceNumber/>
+ <lastDataUnit/>
+ <errorCode/>
+ </items>
+ </items>
+ </parameter>
+ <payload className="org.apache.plc4x.java.s7.readwrite.S7PayloadUserData">
+ <items>
+ <items className="org.apache.plc4x.java.s7.readwrite.S7PayloadUserDataItemCpuFunctionReadSzlRequest">
+ <returnCode>OK</returnCode>
+ <transportSize>OCTET_STRING</transportSize>
+ <szlId className="org.apache.plc4x.java.s7.readwrite.SzlId">
+ <typeClass>CPU</typeClass>
+ <sublistExtract>0</sublistExtract>
+ <sublistList>MODULE_IDENTIFICATION</sublistList>
+ </szlId>
+ <szlIndex>0</szlIndex>
+ </items>
+ </items>
+ </payload>
+ </payload>
+ <eot>true</eot>
+ <tpduRef>2</tpduRef>
+ </payload>
+ </TPKTPacket>
+ </xml>
+ </testcase>
+
+ <testcase>
+ <name>S7 Read PLC Type Response</name>
+ <raw>0300007d02f080320700000001000c0060000112081284010100000000ff09005c00110000001c0003000136455337203231322d31424433302d3058423020202000012020000636455337203231322d31424433302d3058423020202000012020000736455337203231322d31424433302d3058423020202056020002</raw>
+ <root-type>TPKTPacket</root-type>
+ <xml>
+ <TPKTPacket className="org.apache.plc4x.java.s7.readwrite.TPKTPacket">
+ <payload className="org.apache.plc4x.java.s7.readwrite.COTPPacketData">
+ <parameters/>
+ <payload className="org.apache.plc4x.java.s7.readwrite.S7MessageUserData">
+ <tpduReference>1</tpduReference>
+ <parameter className="org.apache.plc4x.java.s7.readwrite.S7ParameterUserData">
+ <items>
+ <items className="org.apache.plc4x.java.s7.readwrite.S7ParameterUserDataItemCPUFunctions">
+ <method>18</method>
+ <cpuFunctionType>8</cpuFunctionType>
+ <cpuFunctionGroup>4</cpuFunctionGroup>
+ <cpuSubfunction>1</cpuSubfunction>
+ <sequenceNumber>1</sequenceNumber>
+ <dataUnitReferenceNumber>0</dataUnitReferenceNumber>
+ <lastDataUnit>0</lastDataUnit>
+ <errorCode>0</errorCode>
+ </items>
+ </items>
+ </parameter>
+ <payload className="org.apache.plc4x.java.s7.readwrite.S7PayloadUserData">
+ <items>
+ <items className="org.apache.plc4x.java.s7.readwrite.S7PayloadUserDataItemCpuFunctionReadSzlResponse">
+ <returnCode>OK</returnCode>
+ <transportSize>OCTET_STRING</transportSize>
+ <szlId className="org.apache.plc4x.java.s7.readwrite.SzlId">
+ <typeClass>CPU</typeClass>
+ <sublistExtract>0</sublistExtract>
+ <sublistList>MODULE_IDENTIFICATION</sublistList>
+ </szlId>
+ <szlIndex>0</szlIndex>
+ <items>
+ <items className="org.apache.plc4x.java.s7.readwrite.SzlDataTreeItem">
+ <itemIndex>1</itemIndex>
+ <mlfb>NkVTNyAyMTItMUJEMzAtMFhCMCA=</mlfb>
+ <moduleTypeId>8224</moduleTypeId>
+ <ausbg>1</ausbg>
+ <ausbe>8224</ausbe>
+ </items>
+ <items className="org.apache.plc4x.java.s7.readwrite.SzlDataTreeItem">
+ <itemIndex>6</itemIndex>
+ <mlfb>NkVTNyAyMTItMUJEMzAtMFhCMCA=</mlfb>
+ <moduleTypeId>8224</moduleTypeId>
+ <ausbg>1</ausbg>
+ <ausbe>8224</ausbe>
+ </items>
+ <items className="org.apache.plc4x.java.s7.readwrite.SzlDataTreeItem">
+ <itemIndex>7</itemIndex>
+ <mlfb>NkVTNyAyMTItMUJEMzAtMFhCMCA=</mlfb>
+ <moduleTypeId>8224</moduleTypeId>
+ <ausbg>22018</ausbg>
+ <ausbe>2</ausbe>
+ </items>
+ </items>
+ </items>
+ </items>
+ </payload>
+ </payload>
+ <eot>true</eot>
+ <tpduRef>0</tpduRef>
+ </payload>
+ </TPKTPacket>
+ </xml>
+ </testcase>
+
+ <testcase>
+ <name>S7 Read Request</name>
+ <raw>0300004302f08b32010000000b003200000404120a10010001000082000000120a10010001000082000000120a10010001000082000000120a10010001000082000000</raw>
+ <root-type>TPKTPacket</root-type>
+ <xml>
+ <TPKTPacket className="org.apache.plc4x.java.s7.readwrite.TPKTPacket">
+ <payload className="org.apache.plc4x.java.s7.readwrite.COTPPacketData">
+ <parameters/>
+ <payload className="org.apache.plc4x.java.s7.readwrite.S7MessageRequest">
+ <tpduReference>11</tpduReference>
+ <parameter className="org.apache.plc4x.java.s7.readwrite.S7ParameterReadVarRequest">
+ <items>
+ <items className="org.apache.plc4x.java.s7.readwrite.S7VarRequestParameterItemAddress">
+ <address className="org.apache.plc4x.java.s7.readwrite.S7AddressAny">
+ <transportSize>BOOL</transportSize>
+ <numberOfElements>1</numberOfElements>
+ <dbNumber>0</dbNumber>
+ <area>OUTPUTS</area>
+ <byteAddress>0</byteAddress>
+ <bitAddress>0</bitAddress>
+ </address>
+ </items>
+ <items className="org.apache.plc4x.java.s7.readwrite.S7VarRequestParameterItemAddress">
+ <address className="org.apache.plc4x.java.s7.readwrite.S7AddressAny">
+ <transportSize>BOOL</transportSize>
+ <numberOfElements>1</numberOfElements>
+ <dbNumber>0</dbNumber>
+ <area>OUTPUTS</area>
+ <byteAddress>0</byteAddress>
+ <bitAddress>0</bitAddress>
+ </address>
+ </items>
+ <items className="org.apache.plc4x.java.s7.readwrite.S7VarRequestParameterItemAddress">
+ <address className="org.apache.plc4x.java.s7.readwrite.S7AddressAny">
+ <transportSize>BOOL</transportSize>
+ <numberOfElements>1</numberOfElements>
+ <dbNumber>0</dbNumber>
+ <area>OUTPUTS</area>
+ <byteAddress>0</byteAddress>
+ <bitAddress>0</bitAddress>
+ </address>
+ </items>
+ <items className="org.apache.plc4x.java.s7.readwrite.S7VarRequestParameterItemAddress">
+ <address className="org.apache.plc4x.java.s7.readwrite.S7AddressAny">
+ <transportSize>BOOL</transportSize>
+ <numberOfElements>1</numberOfElements>
+ <dbNumber>0</dbNumber>
+ <area>OUTPUTS</area>
+ <byteAddress>0</byteAddress>
+ <bitAddress>0</bitAddress>
+ </address>
+ </items>
+ </items>
+ </parameter>
+ <payload/>
+ </payload>
+ <eot>true</eot>
+ <tpduRef>11</tpduRef>
+ </payload>
+ </TPKTPacket>
+ </xml>
+ </testcase>
+
+ <testcase>
+ <name>S7 Read Response</name>
+ <raw>0300002d02f08032030000000b0002001800000404ff0300010100ff0300010100ff0300010100ff0300010100</raw>
+ <!--raw>0300002c02f08032030000000b0002001700000404ff0300010100ff0300010100ff0300010100ff03000101</raw-->
+ <root-type>TPKTPacket</root-type>
+ <xml>
+ <TPKTPacket className="org.apache.plc4x.java.s7.readwrite.TPKTPacket">
+ <payload className="org.apache.plc4x.java.s7.readwrite.COTPPacketData">
+ <parameters/>
+ <payload className="org.apache.plc4x.java.s7.readwrite.S7MessageResponseData">
+ <tpduReference>11</tpduReference>
+ <parameter className="org.apache.plc4x.java.s7.readwrite.S7ParameterReadVarResponse">
+ <numItems>4</numItems>
+ </parameter>
+ <payload className="org.apache.plc4x.java.s7.readwrite.S7PayloadReadVarResponse">
+ <items>
+ <items className="org.apache.plc4x.java.s7.readwrite.S7VarPayloadDataItem">
+ <returnCode>OK</returnCode>
+ <transportSize>BIT</transportSize>
+ <data>AQ==</data>
+ </items>
+ <items className="org.apache.plc4x.java.s7.readwrite.S7VarPayloadDataItem">
+ <returnCode>OK</returnCode>
+ <transportSize>BIT</transportSize>
+ <data>AQ==</data>
+ </items>
+ <items className="org.apache.plc4x.java.s7.readwrite.S7VarPayloadDataItem">
+ <returnCode>OK</returnCode>
+ <transportSize>BIT</transportSize>
+ <data>AQ==</data>
+ </items>
+ <items className="org.apache.plc4x.java.s7.readwrite.S7VarPayloadDataItem">
+ <returnCode>OK</returnCode>
+ <transportSize>BIT</transportSize>
+ <data>AQ==</data>
+ </items>
+ </items>
+ </payload>
+ <errorClass>0</errorClass>
+ <errorCode>0</errorCode>
+ </payload>
+ <eot>true</eot>
+ <tpduRef>0</tpduRef>
+ </payload>
+ </TPKTPacket>
+ </xml>
+ </testcase>
+
+ <testcase>
+ <name>S7 Read Error Response</name>
+ <raw>0300001302f08032020000000a000000008500</raw>
+ <root-type>TPKTPacket</root-type>
+ <xml>
+ <TPKTPacket className="org.apache.plc4x.java.s7.readwrite.TPKTPacket">
+ <payload className="org.apache.plc4x.java.s7.readwrite.COTPPacketData">
+ <parameters/>
+ <payload className="org.apache.plc4x.java.s7.readwrite.S7MessageResponse">
+ <tpduReference>10</tpduReference>
+ <parameter/>
+ <payload/>
+ <errorClass>133</errorClass>
+ <errorCode>0</errorCode>
+ </payload>
+ <eot>true</eot>
+ <tpduRef>0</tpduRef>
+ </payload>
+ </TPKTPacket>
+ </xml>
+ </testcase>
+
+ <testcase>
+ <name>S7 Write Request</name>
+ <raw>0300005b02f08e32010000000e003200180504120a10010001000082000000120a10010001000082000001120a10010001000082000002120a10010001000082000003ff0300010100ff0300010100ff0300010100ff0300010100</raw>
+ <root-type>TPKTPacket</root-type>
+ <xml>
+ <TPKTPacket className="org.apache.plc4x.java.s7.readwrite.TPKTPacket">
+ <payload className="org.apache.plc4x.java.s7.readwrite.COTPPacketData">
+ <parameters/>
+ <payload className="org.apache.plc4x.java.s7.readwrite.S7MessageRequest">
+ <tpduReference>14</tpduReference>
+ <parameter className="org.apache.plc4x.java.s7.readwrite.S7ParameterWriteVarRequest">
+ <items>
+ <items className="org.apache.plc4x.java.s7.readwrite.S7VarRequestParameterItemAddress">
+ <address className="org.apache.plc4x.java.s7.readwrite.S7AddressAny">
+ <transportSize>BOOL</transportSize>
+ <numberOfElements>1</numberOfElements>
+ <dbNumber>0</dbNumber>
+ <area>OUTPUTS</area>
+ <byteAddress>0</byteAddress>
+ <bitAddress>0</bitAddress>
+ </address>
+ </items>
+ <items className="org.apache.plc4x.java.s7.readwrite.S7VarRequestParameterItemAddress">
+ <address className="org.apache.plc4x.java.s7.readwrite.S7AddressAny">
+ <transportSize>BOOL</transportSize>
+ <numberOfElements>1</numberOfElements>
+ <dbNumber>0</dbNumber>
+ <area>OUTPUTS</area>
+ <byteAddress>0</byteAddress>
+ <bitAddress>1</bitAddress>
+ </address>
+ </items>
+ <items className="org.apache.plc4x.java.s7.readwrite.S7VarRequestParameterItemAddress">
+ <address className="org.apache.plc4x.java.s7.readwrite.S7AddressAny">
+ <transportSize>BOOL</transportSize>
+ <numberOfElements>1</numberOfElements>
+ <dbNumber>0</dbNumber>
+ <area>OUTPUTS</area>
+ <byteAddress>0</byteAddress>
+ <bitAddress>2</bitAddress>
+ </address>
+ </items>
+ <items className="org.apache.plc4x.java.s7.readwrite.S7VarRequestParameterItemAddress">
+ <address className="org.apache.plc4x.java.s7.readwrite.S7AddressAny">
+ <transportSize>BOOL</transportSize>
+ <numberOfElements>1</numberOfElements>
+ <dbNumber>0</dbNumber>
+ <area>OUTPUTS</area>
+ <byteAddress>0</byteAddress>
+ <bitAddress>3</bitAddress>
+ </address>
+ </items>
+ </items>
+ </parameter>
+ <payload className="org.apache.plc4x.java.s7.readwrite.S7PayloadWriteVarRequest">
+ <items>
+ <items className="org.apache.plc4x.java.s7.readwrite.S7VarPayloadDataItem">
+ <returnCode>OK</returnCode>
+ <transportSize>BIT</transportSize>
+ <data>AQ==</data>
+ </items>
+ <items className="org.apache.plc4x.java.s7.readwrite.S7VarPayloadDataItem">
+ <returnCode>OK</returnCode>
+ <transportSize>BIT</transportSize>
+ <data>AQ==</data>
+ </items>
+ <items className="org.apache.plc4x.java.s7.readwrite.S7VarPayloadDataItem">
+ <returnCode>OK</returnCode>
+ <transportSize>BIT</transportSize>
+ <data>AQ==</data>
+ </items>
+ <items className="org.apache.plc4x.java.s7.readwrite.S7VarPayloadDataItem">
+ <returnCode>OK</returnCode>
+ <transportSize>BIT</transportSize>
+ <data>AQ==</data>
+ </items>
+ </items>
+ </payload>
+ </payload>
+ <eot>true</eot>
+ <tpduRef>14</tpduRef>
+ </payload>
+ </TPKTPacket>
+ </xml>
+ </testcase>
+
+ <testcase>
+ <name>S7 Write Response</name>
+ <raw>0300001902f08032030000000e0002000400000504ffffffff</raw>
+ <root-type>TPKTPacket</root-type>
+ <xml>
+ <TPKTPacket className="org.apache.plc4x.java.s7.readwrite.TPKTPacket">
+ <payload className="org.apache.plc4x.java.s7.readwrite.COTPPacketData">
+ <parameters/>
+ <payload className="org.apache.plc4x.java.s7.readwrite.S7MessageResponseData">
+ <tpduReference>14</tpduReference>
+ <parameter className="org.apache.plc4x.java.s7.readwrite.S7ParameterWriteVarResponse">
+ <numItems>4</numItems>
+ </parameter>
+ <payload className="org.apache.plc4x.java.s7.readwrite.S7PayloadWriteVarResponse">
+ <items>
+ <items className="org.apache.plc4x.java.s7.readwrite.S7VarPayloadStatusItem">
+ <returnCode>OK</returnCode>
+ </items>
+ <items className="org.apache.plc4x.java.s7.readwrite.S7VarPayloadStatusItem">
+ <returnCode>OK</returnCode>
+ </items>
+ <items className="org.apache.plc4x.java.s7.readwrite.S7VarPayloadStatusItem">
+ <returnCode>OK</returnCode>
+ </items>
+ <items className="org.apache.plc4x.java.s7.readwrite.S7VarPayloadStatusItem">
+ <returnCode>OK</returnCode>
+ </items>
+ </items>
+ </payload>
+ <errorClass>0</errorClass>
+ <errorCode>0</errorCode>
+ </payload>
+ <eot>true</eot>
+ <tpduRef>0</tpduRef>
+ </payload>
+ </TPKTPacket>
+ </xml>
+ </testcase>
+
+</test:testsuite>
\ No newline at end of file
diff --git a/sandbox/plc4go/cmd/main/drivers/bacnetip_test.go b/sandbox/plc4go/cmd/main/drivers/bacnetip_test.go
index 4e9ef59..bddd4ff 100644
--- a/sandbox/plc4go/cmd/main/drivers/bacnetip_test.go
+++ b/sandbox/plc4go/cmd/main/drivers/bacnetip_test.go
@@ -1,3 +1,6 @@
+//
+// 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
diff --git a/sandbox/plc4go/cmd/main/drivers/knxnetip_test.go b/sandbox/plc4go/cmd/main/drivers/knxnetip_test.go
index 8160542..a5b729f 100644
--- a/sandbox/plc4go/cmd/main/drivers/knxnetip_test.go
+++ b/sandbox/plc4go/cmd/main/drivers/knxnetip_test.go
@@ -1,3 +1,6 @@
+//
+// 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
diff --git a/sandbox/plc4go/cmd/main/drivers/modbus_test.go b/sandbox/plc4go/cmd/main/drivers/modbus_test.go
index d858a80..fb8f674 100644
--- a/sandbox/plc4go/cmd/main/drivers/modbus_test.go
+++ b/sandbox/plc4go/cmd/main/drivers/modbus_test.go
@@ -1,3 +1,6 @@
+//
+// 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
@@ -22,11 +25,15 @@ import (
"os"
"plc4x.apache.org/plc4go-modbus-driver/0.8.0/internal/plc4go/modbus/readwrite/model"
"plc4x.apache.org/plc4go-modbus-driver/0.8.0/internal/plc4go/spi"
+ "plc4x.apache.org/plc4go-modbus-driver/0.8.0/internal/plc4go/testutils"
"strings"
"testing"
)
func TestModbus(t *testing.T) {
+
+ testutils.NewParserSerializerTestsuite("")
+
test(t, "000000000006ff0408d20002", false)
test(t, "7cfe000000c9ff04c600000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000004000000000000000000000000000001db000001d600004a380000000000000000000000000000000000000000000000000000000000006461696d006e0000000000000000000000000000303100300000000000000000000000000000000000000000000000000000000000000000000000000000", true)
test(t, "000a0000001101140e060003270e000206000400000008", false)
diff --git a/sandbox/plc4go/cmd/main/drivers/s7_test.go b/sandbox/plc4go/cmd/main/drivers/s7_test.go
index 7a3011b..0129a58 100644
--- a/sandbox/plc4go/cmd/main/drivers/s7_test.go
+++ b/sandbox/plc4go/cmd/main/drivers/s7_test.go
@@ -1,3 +1,6 @@
+//
+// 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
diff --git a/sandbox/plc4go/cmd/main/main.go b/sandbox/plc4go/cmd/main/main.go
index 60524d6..ca11c9e 100644
--- a/sandbox/plc4go/cmd/main/main.go
+++ b/sandbox/plc4go/cmd/main/main.go
@@ -1,3 +1,6 @@
+//
+// 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
diff --git a/sandbox/plc4go/examples/read/hello_world_plc4go_read.go b/sandbox/plc4go/examples/read/hello_world_plc4go_read.go
new file mode 100644
index 0000000..1c9fa96
--- /dev/null
+++ b/sandbox/plc4go/examples/read/hello_world_plc4go_read.go
@@ -0,0 +1,45 @@
+package read
+
+import (
+ "encoding/json"
+ "fmt"
+ "os"
+ "plc4x.apache.org/plc4go-modbus-driver/0.8.0/pkg/plc4go"
+)
+
+func main() {
+ // Get a connection to a remote PLC
+ connection, err := plc4go.NewPlcDriverManager().GetConnectedConnection("s7://192.168.23.30")
+ if err != nil {
+ _ = fmt.Errorf("error connecting to PLC: %s", err.Error())
+ os.Exit(1)
+ }
+
+ // Prepare a read-request
+ rrb, err := connection.ReadRequestBuilder()
+ if err != nil {
+ _ = fmt.Errorf("error getting read-request builder: %s", err.Error())
+ os.Exit(2)
+ }
+ rrb.AddField("output-field", "%Q0.0")
+ rrb.AddField("input-field", "I0.0")
+ readRequest := rrb.Build()
+
+ // Execute a read-request
+ rr, err := readRequest.Execute()
+ if err != nil {
+ _ = fmt.Errorf("error executing read-request: %s", err.Error())
+ os.Exit(2)
+ }
+
+ // Wait for the response to finish
+ readResponse := <-rr
+
+ // Do something with the response
+ readResponseJson, err := json.Marshal(readResponse)
+ if err != nil {
+ _ = fmt.Errorf("error serializing read-response: %s", err.Error())
+ os.Exit(2)
+ }
+ fmt.Printf("Result: %s\n", string(readResponseJson))
+}
diff --git a/sandbox/plc4go/go.mod b/sandbox/plc4go/go.mod
index 732da7f..abf31a2 100644
--- a/sandbox/plc4go/go.mod
+++ b/sandbox/plc4go/go.mod
@@ -1,3 +1,6 @@
+//
+// 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
diff --git a/sandbox/plc4go/cmd/main/main.go b/sandbox/plc4go/internal/plc4go/bacnetip/BacnetIpDriver.go
similarity index 71%
copy from sandbox/plc4go/cmd/main/main.go
copy to sandbox/plc4go/internal/plc4go/bacnetip/BacnetIpDriver.go
index 60524d6..b58f726 100644
--- a/sandbox/plc4go/cmd/main/main.go
+++ b/sandbox/plc4go/internal/plc4go/bacnetip/BacnetIpDriver.go
@@ -1,3 +1,6 @@
+//
+// 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
@@ -13,7 +16,10 @@
// specific language governing permissions and limitations
// under the License.
//
-package main
+package bacnetip
+
+import "plc4x.apache.org/plc4go-modbus-driver/0.8.0/pkg/plc4go"
-func main() {
+func NewBacnetIpDriver() plc4go.PlcDriver {
+ return nil
}
diff --git a/sandbox/plc4go/cmd/main/main.go b/sandbox/plc4go/internal/plc4go/knxnetip/KnxNetIpDriver.go
similarity index 71%
copy from sandbox/plc4go/cmd/main/main.go
copy to sandbox/plc4go/internal/plc4go/knxnetip/KnxNetIpDriver.go
index 60524d6..eb1ab6d 100644
--- a/sandbox/plc4go/cmd/main/main.go
+++ b/sandbox/plc4go/internal/plc4go/knxnetip/KnxNetIpDriver.go
@@ -1,3 +1,6 @@
+//
+// 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
@@ -13,7 +16,10 @@
// specific language governing permissions and limitations
// under the License.
//
-package main
+package knxnetip
+
+import "plc4x.apache.org/plc4go-modbus-driver/0.8.0/pkg/plc4go"
-func main() {
+func NewKnxNetIpDriver() plc4go.PlcDriver {
+ return nil
}
diff --git a/sandbox/plc4go/cmd/main/main.go b/sandbox/plc4go/internal/plc4go/modbus/ModbusDriver.go
similarity index 72%
copy from sandbox/plc4go/cmd/main/main.go
copy to sandbox/plc4go/internal/plc4go/modbus/ModbusDriver.go
index 60524d6..66f5a24 100644
--- a/sandbox/plc4go/cmd/main/main.go
+++ b/sandbox/plc4go/internal/plc4go/modbus/ModbusDriver.go
@@ -1,3 +1,6 @@
+//
+// 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
@@ -13,7 +16,10 @@
// specific language governing permissions and limitations
// under the License.
//
-package main
+package modbus
+
+import "plc4x.apache.org/plc4go-modbus-driver/0.8.0/pkg/plc4go"
-func main() {
+func NewModbusDriver() plc4go.PlcDriver {
+ return nil
}
diff --git a/sandbox/plc4go/internal/plc4go/model/plc_read_request.go b/sandbox/plc4go/internal/plc4go/model/plc_read_request.go
new file mode 100644
index 0000000..1aecbab
--- /dev/null
+++ b/sandbox/plc4go/internal/plc4go/model/plc_read_request.go
@@ -0,0 +1,69 @@
+//
+// 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
+//
+// http://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 model
+
+import (
+ "plc4x.apache.org/plc4go-modbus-driver/0.8.0/internal/plc4go"
+ "plc4x.apache.org/plc4go-modbus-driver/0.8.0/pkg/plc4go/model"
+ "plc4x.apache.org/plc4go-modbus-driver/0.8.0/pkg/plc4go/values"
+)
+
+type DefaultPlcReadRequestBuilder struct {
+ names []string
+ queries []string
+ fieldHandler plc4go.PlcFieldHandler
+ reader PlcReader
+}
+
+func NewDefaultPlcReadRequestBuilder(fieldHandler plc4go.PlcFieldHandler, reader PlcReader) *DefaultPlcReadRequestBuilder {
+ return &DefaultPlcReadRequestBuilder{
+ names: []string{},
+ queries: []string{},
+ fieldHandler: fieldHandler,
+ reader: reader,
+ }
+}
+
+func (m *DefaultPlcReadRequestBuilder) AddItem(name string, query string) *DefaultPlcReadRequestBuilder {
+ m.names = append(m.names, name)
+ m.queries = append(m.queries, query)
+ return m
+}
+
+func (m *DefaultPlcReadRequestBuilder) Build() model.PlcReadRequest {
+ fields := make(map[string]values.PlcValue)
+ for i, name := range m.names {
+ query := m.queries[i]
+ field := m.fieldHandler.ParseQuery(query)
+ fields[name] = field
+ }
+ return defaultPlcReadRequest{
+ fields: fields,
+ reader: m.reader,
+ }
+}
+
+type defaultPlcReadRequest struct {
+ fields map[string]values.PlcValue
+ reader PlcReader
+}
+
+func (m defaultPlcReadRequest) Execute() (<-chan model.PlcReadResponse, error) {
+ return m.reader.Read()
+}
diff --git a/sandbox/plc4go/cmd/main/main.go b/sandbox/plc4go/internal/plc4go/model/plc_reader.go
similarity index 70%
copy from sandbox/plc4go/cmd/main/main.go
copy to sandbox/plc4go/internal/plc4go/model/plc_reader.go
index 60524d6..15e85af 100644
--- a/sandbox/plc4go/cmd/main/main.go
+++ b/sandbox/plc4go/internal/plc4go/model/plc_reader.go
@@ -1,3 +1,6 @@
+//
+// 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
@@ -13,7 +16,10 @@
// specific language governing permissions and limitations
// under the License.
//
-package main
+package model
+
+import "plc4x.apache.org/plc4go-modbus-driver/0.8.0/pkg/plc4go/model"
-func main() {
+type PlcReader interface {
+ Read() (<-chan model.PlcReadResponse, error)
}
diff --git a/sandbox/plc4go/internal/plc4go/model/plc_write_request.go b/sandbox/plc4go/internal/plc4go/model/plc_write_request.go
new file mode 100644
index 0000000..8f67652
--- /dev/null
+++ b/sandbox/plc4go/internal/plc4go/model/plc_write_request.go
@@ -0,0 +1,76 @@
+//
+// 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
+//
+// http://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 model
+
+import (
+ "plc4x.apache.org/plc4go-modbus-driver/0.8.0/internal/plc4go"
+ "plc4x.apache.org/plc4go-modbus-driver/0.8.0/pkg/plc4go/model"
+ "plc4x.apache.org/plc4go-modbus-driver/0.8.0/pkg/plc4go/values"
+)
+
+type DefaultPlcWriteRequestBuilder struct {
+ names []string
+ queries []string
+ plcValues []values.PlcValue
+ fieldHandler plc4go.PlcFieldHandler
+ writer PlcWriter
+}
+
+func NewDefaultPlcWriteRequestBuilder(fieldHandler plc4go.PlcFieldHandler, writer PlcWriter) *DefaultPlcWriteRequestBuilder {
+ return &DefaultPlcWriteRequestBuilder{
+ names: []string{},
+ queries: []string{},
+ plcValues: []values.PlcValue{},
+ fieldHandler: fieldHandler,
+ writer: writer,
+ }
+}
+
+func (m *DefaultPlcWriteRequestBuilder) AddItem(name string, query string, plcValues values.PlcValue) *DefaultPlcWriteRequestBuilder {
+ m.names = append(m.names, name)
+ m.queries = append(m.queries, query)
+ m.plcValues = append(m.plcValues, plcValues)
+ return m
+}
+
+func (m *DefaultPlcWriteRequestBuilder) Build() model.PlcWriteRequest {
+ fields := make(map[string]model.PlcField)
+ plcValues := make(map[string]values.PlcValue)
+ for i, name := range m.names {
+ query := m.queries[i]
+ field := m.fieldHandler.ParseQuery(query)
+ fields[name] = field
+ plcValues[name] = m.plcValues[i]
+ }
+ return defaultPlcWriteRequest{
+ fields: fields,
+ plcValues: plcValues,
+ writer: m.writer,
+ }
+}
+
+type defaultPlcWriteRequest struct {
+ fields map[string]model.PlcField
+ plcValues map[string]values.PlcValue
+ writer PlcWriter
+}
+
+func (m defaultPlcWriteRequest) Execute() (<-chan model.PlcWriteResponse, error) {
+ return m.writer.Write()
+}
diff --git a/sandbox/plc4go/cmd/main/main.go b/sandbox/plc4go/internal/plc4go/model/plc_writer.go
similarity index 70%
copy from sandbox/plc4go/cmd/main/main.go
copy to sandbox/plc4go/internal/plc4go/model/plc_writer.go
index 60524d6..2b469c1 100644
--- a/sandbox/plc4go/cmd/main/main.go
+++ b/sandbox/plc4go/internal/plc4go/model/plc_writer.go
@@ -1,3 +1,6 @@
+//
+// 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
@@ -13,7 +16,10 @@
// specific language governing permissions and limitations
// under the License.
//
-package main
+package model
+
+import "plc4x.apache.org/plc4go-modbus-driver/0.8.0/pkg/plc4go/model"
-func main() {
+type PlcWriter interface {
+ Write() (<-chan model.PlcWriteResponse, error)
}
diff --git a/sandbox/plc4go/cmd/main/main.go b/sandbox/plc4go/internal/plc4go/plc_field_handler.go
similarity index 63%
copy from sandbox/plc4go/cmd/main/main.go
copy to sandbox/plc4go/internal/plc4go/plc_field_handler.go
index 60524d6..f0b4f5a 100644
--- a/sandbox/plc4go/cmd/main/main.go
+++ b/sandbox/plc4go/internal/plc4go/plc_field_handler.go
@@ -1,3 +1,6 @@
+//
+// 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
@@ -13,7 +16,12 @@
// specific language governing permissions and limitations
// under the License.
//
-package main
+package plc4go
+
+import "plc4x.apache.org/plc4go-modbus-driver/0.8.0/pkg/plc4go/model"
+
+type PlcFieldHandler interface {
-func main() {
+ // Parser function to parse query strings for a given driver and produce PlcField instances from that
+ ParseQuery(query string) model.PlcField
}
diff --git a/sandbox/plc4go/cmd/main/main.go b/sandbox/plc4go/internal/plc4go/s7/S7Driver.go
similarity index 72%
copy from sandbox/plc4go/cmd/main/main.go
copy to sandbox/plc4go/internal/plc4go/s7/S7Driver.go
index 60524d6..5169d0a 100644
--- a/sandbox/plc4go/cmd/main/main.go
+++ b/sandbox/plc4go/internal/plc4go/s7/S7Driver.go
@@ -1,3 +1,6 @@
+//
+// 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
@@ -13,7 +16,10 @@
// specific language governing permissions and limitations
// under the License.
//
-package main
+package s7
+
+import "plc4x.apache.org/plc4go-modbus-driver/0.8.0/pkg/plc4go"
-func main() {
+func NewS7Driver() plc4go.PlcDriver {
+ return nil
}
diff --git a/sandbox/plc4go/cmd/main/main.go b/sandbox/plc4go/internal/plc4go/testutils/ParserSerializerTestRunner.go
similarity index 65%
copy from sandbox/plc4go/cmd/main/main.go
copy to sandbox/plc4go/internal/plc4go/testutils/ParserSerializerTestRunner.go
index 60524d6..408a230 100644
--- a/sandbox/plc4go/cmd/main/main.go
+++ b/sandbox/plc4go/internal/plc4go/testutils/ParserSerializerTestRunner.go
@@ -1,3 +1,6 @@
+//
+// 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
@@ -13,7 +16,21 @@
// specific language governing permissions and limitations
// under the License.
//
-package main
+package testutils
+
+import (
+ "fmt"
+ "log"
+ "os"
+)
+
+type ParserSerializerTestsuite struct {
+}
-func main() {
+func NewParserSerializerTestsuite(testPath string) {
+ dir, err := os.Getwd()
+ if err != nil {
+ log.Fatal(err)
+ }
+ fmt.Println(dir)
}
diff --git a/sandbox/plc4go/pkg/plc4go/connection.go b/sandbox/plc4go/pkg/plc4go/connection.go
new file mode 100644
index 0000000..994e5a0
--- /dev/null
+++ b/sandbox/plc4go/pkg/plc4go/connection.go
@@ -0,0 +1,45 @@
+//
+// 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
+//
+// http://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 plc4go
+
+import "plc4x.apache.org/plc4go-modbus-driver/0.8.0/pkg/plc4go/model"
+
+type PlcConnection interface {
+ // Initiate the connection to the PLC
+ Connect() <-chan error
+ // Close the connection to the PLC (gracefully)
+ Close() <-chan error
+ // Checks if the connection is currently still connected
+ IsConnected() bool
+
+ // Get some metadata regarding the current connection
+ GetMetadata() (model.PlcConnectionMetadata, error)
+
+ // Executes a no-op operation to check if the current connection is still able to communicate
+ Ping() error
+
+ // Create a builder for assembling read-requests
+ ReadRequestBuilder() (model.PlcReadRequestBuilder, error)
+ // Create a builder for assembling write-requests
+ WriteRequestBuilder() (model.PlcWriteRequestBuilder, error)
+ // Create a builder for assembling subscription-requests
+ SubscriptionRequestBuilder() (model.PlcSubscriptionRequestBuilder, error)
+ // Create a builder for assembling unsubscription-requests
+ UnsubscriptionRequestBuilder() (model.PlcUnsubscriptionRequestBuilder, error)
+}
diff --git a/sandbox/plc4go/pkg/plc4go/driver.go b/sandbox/plc4go/pkg/plc4go/driver.go
new file mode 100644
index 0000000..777087f
--- /dev/null
+++ b/sandbox/plc4go/pkg/plc4go/driver.go
@@ -0,0 +1,34 @@
+//
+// 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
+//
+// http://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 plc4go
+
+import "plc4x.apache.org/plc4go-modbus-driver/0.8.0/pkg/plc4go/model"
+
+type PlcDriver interface {
+ // Get the short code used to identify this driver (As used in the connection string)
+ GetProtocolCode() string
+ // Get a human readable name for this driver
+ GetProtocolName() string
+
+ // Establishes a connection to a given PLC using the information in the connectionString
+ GetConnection(connectionString string) (PlcConnection, error)
+
+ // Parses a given query string and produces PlcField instances for this driver implementation
+ PrepareField(query string) (model.PlcField, error)
+}
diff --git a/sandbox/plc4go/pkg/plc4go/driverManager.go b/sandbox/plc4go/pkg/plc4go/driverManager.go
new file mode 100644
index 0000000..07db7e9
--- /dev/null
+++ b/sandbox/plc4go/pkg/plc4go/driverManager.go
@@ -0,0 +1,91 @@
+//
+// 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
+//
+// http://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 plc4go
+
+import (
+ "errors"
+ "net/url"
+ "plc4x.apache.org/plc4go-modbus-driver/0.8.0/internal/plc4go/bacnetip"
+ "plc4x.apache.org/plc4go-modbus-driver/0.8.0/internal/plc4go/knxnetip"
+ "plc4x.apache.org/plc4go-modbus-driver/0.8.0/internal/plc4go/modbus"
+ "plc4x.apache.org/plc4go-modbus-driver/0.8.0/internal/plc4go/s7"
+)
+
+// This is the main entry point for PLC4Go applications
+type PlcDriverManager interface {
+ // List the names of all drivers registered in the system
+ ListDriverNames() []string
+ // Get access to a driver instance for a given driver-name
+ GetDriver(driverName string) (PlcDriver, error)
+
+ // Get a connection to a remote PLC for a given plc4x connection-string
+ GetConnectedConnection(connectionString string) (PlcConnection, error)
+}
+
+func NewPlcDriverManager() PlcDriverManager {
+ return plcDriverManger{
+ drivers: map[string]PlcDriver{
+ "bacnetip": bacnetip.NewBacnetIpDriver(),
+ "knxnetip": knxnetip.NewKnxNetIpDriver(),
+ "modbus": modbus.NewModbusDriver(),
+ "s7": s7.NewS7Driver(),
+ },
+ }
+}
+
+type plcDriverManger struct {
+ drivers map[string]PlcDriver
+}
+
+func (m plcDriverManger) ListDriverNames() []string {
+ driverNames := make([]string, len(m.drivers))
+ for driverName := range m.drivers {
+ driverNames = append(driverNames, driverName)
+ }
+ return driverNames
+}
+
+func (m plcDriverManger) GetDriver(driverName string) (PlcDriver, error) {
+ if m.drivers[driverName] == nil {
+ return nil, errors.New("Couldn't find driver " + driverName)
+ }
+ return m.drivers[driverName], nil
+}
+
+func (m plcDriverManger) GetConnectedConnection(connectionString string) (PlcConnection, error) {
+ connectionUrl, err := url.Parse(connectionString)
+ if err != nil {
+ return nil, errors.New("Error parsing connection string: " + err.Error())
+ }
+ driverName := connectionUrl.Scheme
+ driver, err := m.GetDriver(driverName)
+ if err != nil {
+ return nil, errors.New("Error getting driver for connection string: " + err.Error())
+ }
+ connection, err := driver.GetConnection(connectionString)
+ if err != nil {
+ return nil, errors.New("Error connecting for connection string: " + err.Error())
+ }
+ errConsumer := connection.Connect()
+ connectionErr := <-errConsumer
+ if connectionErr != nil {
+ return nil, connectionErr
+ }
+ return connection, nil
+}
diff --git a/sandbox/plc4go/cmd/main/main.go b/sandbox/plc4go/pkg/plc4go/model/plc_connection_metadata.go
similarity index 57%
copy from sandbox/plc4go/cmd/main/main.go
copy to sandbox/plc4go/pkg/plc4go/model/plc_connection_metadata.go
index 60524d6..c7e6f6b 100644
--- a/sandbox/plc4go/cmd/main/main.go
+++ b/sandbox/plc4go/pkg/plc4go/model/plc_connection_metadata.go
@@ -1,3 +1,6 @@
+//
+// 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
@@ -13,7 +16,15 @@
// specific language governing permissions and limitations
// under the License.
//
-package main
+package model
-func main() {
+// Information about connection capabilities.
+// This includes connection and driver specific metadata.
+type PlcConnectionMetadata interface {
+ // Indicates that the connection supports reading.
+ CanRead() bool
+ // Indicates that the connection supports writing.
+ CanWrite() bool
+ // Indicates that the connection supports subscription.
+ CanSubscribe() bool
}
diff --git a/sandbox/plc4go/cmd/main/main.go b/sandbox/plc4go/pkg/plc4go/model/plc_field.go
similarity index 80%
copy from sandbox/plc4go/cmd/main/main.go
copy to sandbox/plc4go/pkg/plc4go/model/plc_field.go
index 60524d6..01f62f2 100644
--- a/sandbox/plc4go/cmd/main/main.go
+++ b/sandbox/plc4go/pkg/plc4go/model/plc_field.go
@@ -1,3 +1,6 @@
+//
+// 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
@@ -13,7 +16,7 @@
// specific language governing permissions and limitations
// under the License.
//
-package main
+package model
-func main() {
+type PlcField interface {
}
diff --git a/sandbox/plc4go/cmd/main/main.go b/sandbox/plc4go/pkg/plc4go/model/plc_message.go
similarity index 80%
copy from sandbox/plc4go/cmd/main/main.go
copy to sandbox/plc4go/pkg/plc4go/model/plc_message.go
index 60524d6..d9bba7a 100644
--- a/sandbox/plc4go/cmd/main/main.go
+++ b/sandbox/plc4go/pkg/plc4go/model/plc_message.go
@@ -1,3 +1,6 @@
+//
+// 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
@@ -13,7 +16,7 @@
// specific language governing permissions and limitations
// under the License.
//
-package main
+package model
-func main() {
+type PlcMessage interface {
}
diff --git a/sandbox/plc4go/cmd/main/main.go b/sandbox/plc4go/pkg/plc4go/model/plc_read_request.go
similarity index 66%
copy from sandbox/plc4go/cmd/main/main.go
copy to sandbox/plc4go/pkg/plc4go/model/plc_read_request.go
index 60524d6..13f5209 100644
--- a/sandbox/plc4go/cmd/main/main.go
+++ b/sandbox/plc4go/pkg/plc4go/model/plc_read_request.go
@@ -1,3 +1,6 @@
+//
+// 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
@@ -13,7 +16,13 @@
// specific language governing permissions and limitations
// under the License.
//
-package main
+package model
+
+type PlcReadRequestBuilder interface {
+ AddField(name string, query string) *PlcReadRequestBuilder
+ Build() PlcReadRequest
+}
-func main() {
+type PlcReadRequest interface {
+ Execute() (<-chan PlcReadResponse, error)
}
diff --git a/sandbox/plc4go/cmd/main/main.go b/sandbox/plc4go/pkg/plc4go/model/plc_read_response.go
similarity index 79%
copy from sandbox/plc4go/cmd/main/main.go
copy to sandbox/plc4go/pkg/plc4go/model/plc_read_response.go
index 60524d6..24af243 100644
--- a/sandbox/plc4go/cmd/main/main.go
+++ b/sandbox/plc4go/pkg/plc4go/model/plc_read_response.go
@@ -1,3 +1,6 @@
+//
+// 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
@@ -13,7 +16,7 @@
// specific language governing permissions and limitations
// under the License.
//
-package main
+package model
-func main() {
+type PlcReadResponse interface {
}
diff --git a/sandbox/plc4go/cmd/main/main.go b/sandbox/plc4go/pkg/plc4go/model/plc_request.go
similarity index 75%
copy from sandbox/plc4go/cmd/main/main.go
copy to sandbox/plc4go/pkg/plc4go/model/plc_request.go
index 60524d6..80705cf 100644
--- a/sandbox/plc4go/cmd/main/main.go
+++ b/sandbox/plc4go/pkg/plc4go/model/plc_request.go
@@ -1,3 +1,6 @@
+//
+// 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
@@ -13,7 +16,9 @@
// specific language governing permissions and limitations
// under the License.
//
-package main
+package model
-func main() {
+type PlcRequest interface {
+ Execute() (<-chan PlcResponse, error)
+ PlcMessage
}
diff --git a/sandbox/plc4go/cmd/main/main.go b/sandbox/plc4go/pkg/plc4go/model/plc_response.go
similarity index 78%
copy from sandbox/plc4go/cmd/main/main.go
copy to sandbox/plc4go/pkg/plc4go/model/plc_response.go
index 60524d6..8e85f1d 100644
--- a/sandbox/plc4go/cmd/main/main.go
+++ b/sandbox/plc4go/pkg/plc4go/model/plc_response.go
@@ -1,3 +1,6 @@
+//
+// 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
@@ -13,7 +16,8 @@
// specific language governing permissions and limitations
// under the License.
//
-package main
+package model
-func main() {
+type PlcResponse interface {
+ PlcMessage
}
diff --git a/sandbox/plc4go/go.mod b/sandbox/plc4go/pkg/plc4go/model/plc_subscription_event.go
similarity index 82%
copy from sandbox/plc4go/go.mod
copy to sandbox/plc4go/pkg/plc4go/model/plc_subscription_event.go
index 732da7f..773175b 100644
--- a/sandbox/plc4go/go.mod
+++ b/sandbox/plc4go/pkg/plc4go/model/plc_subscription_event.go
@@ -1,3 +1,6 @@
+//
+// 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
@@ -13,9 +16,4 @@
// specific language governing permissions and limitations
// under the License.
//
-module plc4x.apache.org/plc4go-modbus-driver/0.8.0
-
-go 1.15
-
-require github.com/sirupsen/logrus v1.7.0
-require github.com/icza/bitio v1.0.0
+package model
diff --git a/sandbox/plc4go/cmd/main/main.go b/sandbox/plc4go/pkg/plc4go/model/plc_subscription_request.go
similarity index 60%
copy from sandbox/plc4go/cmd/main/main.go
copy to sandbox/plc4go/pkg/plc4go/model/plc_subscription_request.go
index 60524d6..742762a 100644
--- a/sandbox/plc4go/cmd/main/main.go
+++ b/sandbox/plc4go/pkg/plc4go/model/plc_subscription_request.go
@@ -1,3 +1,6 @@
+//
+// 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
@@ -13,7 +16,17 @@
// specific language governing permissions and limitations
// under the License.
//
-package main
+package model
+
+import "time"
+
+type PlcSubscriptionRequestBuilder interface {
+ AddCyclicItem(name string, query string, interval time.Duration)
+ AddChangeOfStateItem(name string, query string)
+ AddEventItem(name string, query string)
+ Build() PlcSubscriptionRequest
+}
-func main() {
+type PlcSubscriptionRequest interface {
+ PlcRequest
}
diff --git a/sandbox/plc4go/cmd/main/main.go b/sandbox/plc4go/pkg/plc4go/model/plc_subscription_response.go
similarity index 79%
copy from sandbox/plc4go/cmd/main/main.go
copy to sandbox/plc4go/pkg/plc4go/model/plc_subscription_response.go
index 60524d6..71457bd 100644
--- a/sandbox/plc4go/cmd/main/main.go
+++ b/sandbox/plc4go/pkg/plc4go/model/plc_subscription_response.go
@@ -1,3 +1,6 @@
+//
+// 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
@@ -13,7 +16,7 @@
// specific language governing permissions and limitations
// under the License.
//
-package main
+package model
-func main() {
+type PlcSubscriptionResponse struct {
}
diff --git a/sandbox/plc4go/cmd/main/main.go b/sandbox/plc4go/pkg/plc4go/model/plc_unsubscription_request.go
similarity index 73%
copy from sandbox/plc4go/cmd/main/main.go
copy to sandbox/plc4go/pkg/plc4go/model/plc_unsubscription_request.go
index 60524d6..7395b35 100644
--- a/sandbox/plc4go/cmd/main/main.go
+++ b/sandbox/plc4go/pkg/plc4go/model/plc_unsubscription_request.go
@@ -1,3 +1,6 @@
+//
+// 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
@@ -13,7 +16,11 @@
// specific language governing permissions and limitations
// under the License.
//
-package main
+package model
+
+type PlcUnsubscriptionRequestBuilder interface {
+}
-func main() {
+type PlcUnsubscriptionRequest interface {
+ PlcRequest
}
diff --git a/sandbox/plc4go/cmd/main/main.go b/sandbox/plc4go/pkg/plc4go/model/plc_unsubscription_response.go
similarity index 78%
copy from sandbox/plc4go/cmd/main/main.go
copy to sandbox/plc4go/pkg/plc4go/model/plc_unsubscription_response.go
index 60524d6..dd46fc9 100644
--- a/sandbox/plc4go/cmd/main/main.go
+++ b/sandbox/plc4go/pkg/plc4go/model/plc_unsubscription_response.go
@@ -1,3 +1,6 @@
+//
+// 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
@@ -13,7 +16,7 @@
// specific language governing permissions and limitations
// under the License.
//
-package main
+package model
-func main() {
+type PlcUnsubscriptionResponse struct {
}
diff --git a/sandbox/plc4go/cmd/main/main.go b/sandbox/plc4go/pkg/plc4go/model/plc_write_request.go
similarity index 59%
copy from sandbox/plc4go/cmd/main/main.go
copy to sandbox/plc4go/pkg/plc4go/model/plc_write_request.go
index 60524d6..d881f52 100644
--- a/sandbox/plc4go/cmd/main/main.go
+++ b/sandbox/plc4go/pkg/plc4go/model/plc_write_request.go
@@ -1,3 +1,6 @@
+//
+// 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
@@ -13,7 +16,16 @@
// specific language governing permissions and limitations
// under the License.
//
-package main
+package model
+
+import "plc4x.apache.org/plc4go-modbus-driver/0.8.0/pkg/plc4go/values"
+
+type PlcWriteRequestBuilder interface {
+ Execute() (<-chan PlcWriteResponse, error)
+ AddField(name string, query string, value values.PlcValue)
+ Build() PlcWriteRequest
+}
-func main() {
+type PlcWriteRequest interface {
+ Execute() (<-chan PlcWriteResponse, error)
}
diff --git a/sandbox/plc4go/cmd/main/main.go b/sandbox/plc4go/pkg/plc4go/model/plc_write_response.go
similarity index 79%
copy from sandbox/plc4go/cmd/main/main.go
copy to sandbox/plc4go/pkg/plc4go/model/plc_write_response.go
index 60524d6..a3c57da 100644
--- a/sandbox/plc4go/cmd/main/main.go
+++ b/sandbox/plc4go/pkg/plc4go/model/plc_write_response.go
@@ -1,3 +1,6 @@
+//
+// 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
@@ -13,7 +16,7 @@
// specific language governing permissions and limitations
// under the License.
//
-package main
+package model
-func main() {
+type PlcWriteResponse struct {
}
diff --git a/sandbox/plc4go/cmd/main/main.go b/sandbox/plc4go/pkg/plc4go/values/plc_value.go
similarity index 80%
copy from sandbox/plc4go/cmd/main/main.go
copy to sandbox/plc4go/pkg/plc4go/values/plc_value.go
index 60524d6..6e5736b 100644
--- a/sandbox/plc4go/cmd/main/main.go
+++ b/sandbox/plc4go/pkg/plc4go/values/plc_value.go
@@ -1,3 +1,6 @@
+//
+// 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
@@ -13,7 +16,7 @@
// specific language governing permissions and limitations
// under the License.
//
-package main
+package values
-func main() {
+type PlcValue interface {
}
diff --git a/sandbox/plc4go/pom.xml b/sandbox/plc4go/pom.xml
index 7b20f90..971ad30 100644
--- a/sandbox/plc4go/pom.xml
+++ b/sandbox/plc4go/pom.xml
@@ -37,6 +37,57 @@
<build>
<sourceDirectory>cmd</sourceDirectory>
<plugins>
+ <!-- Copy the test-resources in here -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>unpack-protocol-test-suites</id>
+ <phase>generate-resources</phase>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.apache.plc4x</groupId>
+ <artifactId>plc4x-protocols-bacnetip</artifactId>
+ <classifier>tests</classifier>
+ <type>test-jar</type>
+ <outputDirectory>${project.basedir}/assets/testing</outputDirectory>
+ <excludes>META-INF/**</excludes>
+ </artifactItem>
+ <artifactItem>
+ <groupId>org.apache.plc4x</groupId>
+ <artifactId>plc4x-protocols-knxnetip</artifactId>
+ <classifier>tests</classifier>
+ <type>test-jar</type>
+ <outputDirectory>${project.basedir}/assets/testing</outputDirectory>
+ <excludes>META-INF/**,org/**</excludes>
+ </artifactItem>
+ <artifactItem>
+ <groupId>org.apache.plc4x</groupId>
+ <artifactId>plc4x-protocols-modbus</artifactId>
+ <classifier>tests</classifier>
+ <type>test-jar</type>
+ <outputDirectory>${project.basedir}/assets/testing</outputDirectory>
+ <excludes>META-INF/**</excludes>
+ </artifactItem>
+ <artifactItem>
+ <groupId>org.apache.plc4x</groupId>
+ <artifactId>plc4x-protocols-s7</artifactId>
+ <classifier>tests</classifier>
+ <type>test-jar</type>
+ <outputDirectory>${project.basedir}/assets/testing</outputDirectory>
+ <excludes>META-INF/**,org/**</excludes>
+ </artifactItem>
+ </artifactItems>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
<!--
Generate the driver code.
-->