You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by cd...@apache.org on 2019/01/29 12:44:32 UTC
[incubator-plc4x] 01/02: - Cleaned up the structure of the s7
protocol module - Removed the duplicate definitions for the separate
protocol layers - Added a dummy SCXML definition of the S7 protocol
This is an automated email from the ASF dual-hosted git repository.
cdutz pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/incubator-plc4x.git
commit 841554b976321c52d9d565ecdf74e39521c858ea
Author: Christofer Dutz <ch...@c-ware.de>
AuthorDate: Tue Jan 29 13:44:01 2019 +0100
- Cleaned up the structure of the s7 protocol module
- Removed the duplicate definitions for the separate protocol layers
- Added a dummy SCXML definition of the S7 protocol
---
protocols/s7/pom.xml | 9 -
.../apache/plc4x/protocols/cotp-protocol.dfdl.xsd | 291 ----------
.../apache/plc4x/protocols/s7-protocol.dfdl.xsd | 599 ---------------------
.../apache/plc4x/protocols/tpkt-protocol.dfdl.xsd | 87 ---
.../daffodil-built-in-catalog.xml | 8 +-
.../apache/plc4x/protocols/s7/protocol.dfdl.xsd} | 286 +++++-----
.../apache/plc4x/protocols/s7/protocol.scxml.xml | 432 +++++++++++++++
.../apache/plc4x/protocols/CotpProtocolTest.java | 31 --
.../plc4x/protocols/S7FullStackProtocolTest.java | 31 --
.../ProtocolTest.java} | 10 +-
.../org/apache/plc4x/protocols/cotp-protocol.tdml | 538 ------------------
.../protocol.tdml} | 8 +-
.../org/apache/plc4x/protocols/tpkt-protocol.tdml | 112 ----
13 files changed, 586 insertions(+), 1856 deletions(-)
diff --git a/protocols/s7/pom.xml b/protocols/s7/pom.xml
index d0764ae..ca8211d 100644
--- a/protocols/s7/pom.xml
+++ b/protocols/s7/pom.xml
@@ -32,15 +32,6 @@
<name>Protocols: S7</name>
<description>Base protocol specifications for the Siemens S7 protocol</description>
- <build>
- <!-- This project should only contain the DFDL definitions for our protocols -->
- <resources>
- <resource>
- <directory>src/main/dfdl</directory>
- </resource>
- </resources>
- </build>
-
<dependencies>
<dependency>
<groupId>org.apache.daffodil</groupId>
diff --git a/protocols/s7/src/main/dfdl/org/apache/plc4x/protocols/cotp-protocol.dfdl.xsd b/protocols/s7/src/main/dfdl/org/apache/plc4x/protocols/cotp-protocol.dfdl.xsd
deleted file mode 100644
index 665c4b1..0000000
--- a/protocols/s7/src/main/dfdl/org/apache/plc4x/protocols/cotp-protocol.dfdl.xsd
+++ /dev/null
@@ -1,291 +0,0 @@
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- 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.
- -->
-<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
- xmlns:dfdl="http://www.ogf.org/dfdl/dfdl-1.0/"
- xmlns:cotp="http://plc4x.apache.org/cotp"
- targetNamespace="http://plc4x.apache.org/cotp">
-
- <xs:annotation>
- <xs:appinfo source="http://www.ogf.org/dfdl/">
- <dfdl:defineVariable name="messageType" type="xs:string"/>
- <dfdl:defineFormat name="cotpFormat">
- <dfdl:format representation="binary"
- binaryNumberRep="binary"
- byteOrder="bigEndian"
- lengthKind="implicit" lengthUnits="bytes" length="0"
- occursCountKind="implicit"
- textOutputMinLength="0"
- alignment="1" alignmentUnits="bits"
- leadingSkip="0" trailingSkip="0"
- textPadKind="none" ignoreCase="no"
- encoding="utf-8" truncateSpecifiedLengthString="no"
- initiator="" terminator=""
- sequenceKind="ordered" separator=""
- escapeSchemeRef="" initiatedContent="no"/>
- </dfdl:defineFormat>
- <dfdl:format ref="cotp:cotpFormat"/>
- </xs:appinfo>
- </xs:annotation>
-
- <!--
-
- Simple type definition.
-
- -->
-
- <xs:simpleType name="byte" dfdl:lengthUnits="bytes" dfdl:length="1" dfdl:lengthKind="explicit">
- <xs:restriction base="xs:unsignedByte"/>
- </xs:simpleType>
-
- <xs:simpleType name="short" dfdl:lengthUnits="bytes" dfdl:length="2" dfdl:lengthKind="explicit">
- <xs:restriction base="xs:unsignedShort"/>
- </xs:simpleType>
-
- <xs:simpleType name="CotpTpduType">
- <xs:restriction base="xs:unsignedByte">
- <xs:enumeration id="tpduTypeConnectionRequest" value="224">
- <xs:annotation>
- <xs:appinfo source="http://plc4x.apache.org/">ConnectionRequest</xs:appinfo>
- </xs:annotation>
- </xs:enumeration>
- <xs:enumeration id="tpduTypeConnectionResponse" value="208">
- <xs:annotation>
- <xs:appinfo source="http://plc4x.apache.org/">ConnectionResponse</xs:appinfo>
- </xs:annotation>
- </xs:enumeration>
- <xs:enumeration value="128">
- <xs:annotation>
- <xs:appinfo source="http://plc4x.apache.org/">DisconnectRequest</xs:appinfo>
- </xs:annotation>
- </xs:enumeration>
- <xs:enumeration value="192">
- <xs:annotation>
- <xs:appinfo source="http://plc4x.apache.org/">DisconnectResponse</xs:appinfo>
- </xs:annotation>
- </xs:enumeration>
- <xs:enumeration value="112">
- <xs:annotation>
- <xs:appinfo source="http://plc4x.apache.org/">Error</xs:appinfo>
- </xs:annotation>
- </xs:enumeration>
- <xs:enumeration value="240">
- <xs:annotation>
- <xs:appinfo source="http://plc4x.apache.org/">Data</xs:appinfo>
- </xs:annotation>
- </xs:enumeration>
- </xs:restriction>
- </xs:simpleType>
-
- <xs:simpleType name="CotpParameterType">
- <xs:restriction base="xs:unsignedByte">
- <xs:enumeration value="192">
- <xs:annotation>
- <xs:appinfo source="http://plc4x.apache.org/">TpduSize</xs:appinfo>
- </xs:annotation>
- </xs:enumeration>
- <xs:enumeration value="193">
- <xs:annotation>
- <xs:appinfo source="http://plc4x.apache.org/">CallingTsap</xs:appinfo>
- </xs:annotation>
- </xs:enumeration>
- <xs:enumeration value="194">
- <xs:annotation>
- <xs:appinfo source="http://plc4x.apache.org/">CalledTsap</xs:appinfo>
- </xs:annotation>
- </xs:enumeration>
- <xs:enumeration value="195">
- <xs:annotation>
- <xs:appinfo source="http://plc4x.apache.org/">Checksum</xs:appinfo>
- </xs:annotation>
- </xs:enumeration>
- <xs:enumeration value="224">
- <xs:annotation>
- <xs:appinfo source="http://plc4x.apache.org/">DisconnectAdditionalInformation</xs:appinfo>
- </xs:annotation>
- </xs:enumeration>
- </xs:restriction>
- </xs:simpleType>
-
- <!--
-
- ISO 8073/X.224 - ISO-TP - COTP - Connection-Oriented Transport Protocol Messages
-
- -->
-
- <xs:element name="CoTpTPDU" type="cotp:CotpMessageType"/>
-
- <xs:complexType name="CotpMessageType">
- <xs:sequence>
- <!-- Length of the COTP header data -->
- <xs:element name="headerLength" type="cotp:byte"/>
- <xs:element name="type" type="cotp:CotpTpduType"/>
- <xs:choice dfdl:choiceDispatchKey="{type}">
- <xs:element dfdl:choiceBranchKey="224" ref="cotp:CotpTpduConnectionRequest"/>
- <xs:element dfdl:choiceBranchKey="208" ref="cotp:CotpTpduConnectionResponse"/>
- <xs:element dfdl:choiceBranchKey="128" ref="cotp:CotpTpduDisconnectRequest"/>
- <xs:element dfdl:choiceBranchKey="192" ref="cotp:CotpTpduDisconnectResponse"/>
- <xs:element dfdl:choiceBranchKey="112" ref="cotp:CotpTpduError"/>
- <xs:element dfdl:choiceBranchKey="240" ref="cotp:CotpTpduData"/>
- </xs:choice>
- <xs:element name="userData" type="xs:hexBinary"
- dfdl:byteOrder="bigEndian" dfdl:lengthKind="delimited"
- dfdl:encoding="ISO-8859-1" dfdl:textTrimKind="none" />
- </xs:sequence>
- </xs:complexType>
-
- <xs:element name="CotpTpduConnectionRequest">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="destinationReference" type="cotp:short"/>
- <xs:element name="sourceReference" type="cotp:short"/>
- <xs:element name="protocolClass" type="cotp:byte"/>
- <xs:element ref="cotp:parameters" minOccurs="0"
- dfdl:lengthKind="explicit" dfdl:lengthUnits="bytes" dfdl:length="{../../headerLength - 6}"
- dfdl:occursCountKind="expression" dfdl:occursCount="{if(../../headerLength gt 6) then 1 else 0}"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
-
- <xs:element name="CotpTpduConnectionResponse">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="destinationReference" type="cotp:short"/>
- <xs:element name="sourceReference" type="cotp:short"/>
- <xs:element name="protocolClass" type="cotp:byte"/>
- <xs:element ref="cotp:parameters" minOccurs="0"
- dfdl:lengthKind="explicit" dfdl:lengthUnits="bytes" dfdl:length="{../../headerLength - 6}"
- dfdl:occursCountKind="expression" dfdl:occursCount="{if(../../headerLength gt 6) then 1 else 0}"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
-
- <xs:element name="CotpTpduDisconnectRequest">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="destinationReference" type="cotp:short"/>
- <xs:element name="sourceReference" type="cotp:short"/>
- <xs:element name="disconnectReason" type="cotp:byte"/>
- <xs:element ref="cotp:parameters" minOccurs="0"
- dfdl:lengthKind="explicit" dfdl:lengthUnits="bytes" dfdl:length="{../../headerLength - 6}"
- dfdl:occursCountKind="expression" dfdl:occursCount="{if(../../headerLength gt 6) then 1 else 0}"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
-
- <xs:element name="CotpTpduDisconnectResponse">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="destinationReference" type="cotp:short"/>
- <xs:element name="sourceReference" type="cotp:short"/>
- <xs:element ref="cotp:parameters" minOccurs="0"
- dfdl:lengthKind="explicit" dfdl:lengthUnits="bytes" dfdl:length="{../../headerLength - 5}"
- dfdl:occursCountKind="expression" dfdl:occursCount="{if(../../headerLength gt 5) then 1 else 0}"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
-
- <xs:element name="CotpTpduError">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="destinationReference" type="cotp:short"/>
- <xs:element name="rejectCause" type="cotp:byte"/>
- <xs:element ref="cotp:parameters" minOccurs="0"
- dfdl:lengthKind="explicit" dfdl:lengthUnits="bytes" dfdl:length="{../../headerLength - 4}"
- dfdl:occursCountKind="expression" dfdl:occursCount="{if(../../headerLength gt 4) then 1 else 0}"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
-
- <xs:element name="CotpTpduData">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="endOfTransmission" type="xs:unsignedInt"
- dfdl:lengthKind="explicit" dfdl:lengthUnits="bits" dfdl:length="1"/>
- <xs:element name="tpduRef" type="xs:unsignedInt"
- dfdl:lengthKind="explicit" dfdl:lengthUnits="bits" dfdl:length="7"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
-
- <xs:element name="parameters">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="parameter" maxOccurs="unbounded">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="type" type="cotp:CotpParameterType"/>
- <xs:element name="parameterLength" type="cotp:byte"/>
- <xs:choice dfdl:choiceDispatchKey="{type}">
- <xs:element dfdl:choiceBranchKey="192" ref="cotp:CotpParameterTpduSize"/>
- <xs:element dfdl:choiceBranchKey="193" ref="cotp:CotpParameterCallingTsap"/>
- <xs:element dfdl:choiceBranchKey="194" ref="cotp:CotpParameterCalledTsap"/>
- <xs:element dfdl:choiceBranchKey="195" ref="cotp:CotpParameterChecksum"/>
- <xs:element dfdl:choiceBranchKey="224"
- ref="cotp:CotpParameterDisconnectAdditionalInformation"/>
- </xs:choice>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
-
- <xs:element name="CotpParameterTpduSize">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="tpduSize" type="cotp:byte"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
-
- <xs:element name="CotpParameterCallingTsap">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="tsapId" type="cotp:short"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
-
- <xs:element name="CotpParameterCalledTsap">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="tsapId" type="cotp:short"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
-
- <xs:element name="CotpParameterChecksum">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="checksum" type="cotp:byte"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
-
- <xs:element name="CotpParameterDisconnectAdditionalInformation">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="data" type="xs:hexBinary"
- dfdl:byteOrder="bigEndian" dfdl:lengthUnits="bytes" dfdl:lengthKind="explicit"
- dfdl:length="{../../parameterLength}"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
-
-</xs:schema>
\ No newline at end of file
diff --git a/protocols/s7/src/main/dfdl/org/apache/plc4x/protocols/s7-protocol.dfdl.xsd b/protocols/s7/src/main/dfdl/org/apache/plc4x/protocols/s7-protocol.dfdl.xsd
deleted file mode 100644
index 0001cdf..0000000
--- a/protocols/s7/src/main/dfdl/org/apache/plc4x/protocols/s7-protocol.dfdl.xsd
+++ /dev/null
@@ -1,599 +0,0 @@
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- 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.
- -->
-<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
- xmlns:dfdl="http://www.ogf.org/dfdl/dfdl-1.0/"
- xmlns:fn="http://www.w3.org/2005/xpath-functions"
- xmlns:s7="http://plc4x.apache.org/s7"
- targetNamespace="http://plc4x.apache.org/s7">
-
- <xs:annotation>
- <xs:appinfo source="http://www.ogf.org/dfdl/">
- <dfdl:defineVariable name="messageType" type="xs:string"/>
- <dfdl:format representation="binary"
- binaryNumberRep="binary"
- byteOrder="bigEndian"
- lengthKind="implicit" lengthUnits="bytes" length="0"
- occursCountKind="implicit"
- textOutputMinLength="0"
- alignment="1" alignmentUnits="bits"
- leadingSkip="0" trailingSkip="0"
- textPadKind="none" ignoreCase="no"
- encoding="utf-8" truncateSpecifiedLengthString="no"
- initiator="" terminator=""
- sequenceKind="ordered" separator=""
- escapeSchemeRef="" initiatedContent="no"/>
- </xs:appinfo>
- </xs:annotation>
-
- <!--
-
- Simple type definition.
-
- -->
-
- <xs:simpleType name="bit" dfdl:lengthUnits="bits" dfdl:length="1" dfdl:lengthKind="explicit">
- <xs:restriction base="xs:boolean" />
- </xs:simpleType>
-
- <xs:simpleType name="byte" dfdl:lengthUnits="bytes" dfdl:length="1" dfdl:lengthKind="explicit">
- <xs:restriction base="xs:unsignedByte"/>
- </xs:simpleType>
-
- <xs:simpleType name="short" dfdl:lengthUnits="bytes" dfdl:length="2" dfdl:lengthKind="explicit">
- <xs:restriction base="xs:unsignedShort"/>
- </xs:simpleType>
-
- <xs:simpleType name="hexByte" dfdl:lengthUnits="bytes" dfdl:length="1" dfdl:lengthKind="explicit">
- <xs:restriction base="xs:hexBinary" />
- </xs:simpleType>
-
- <!--
-
- S7 Types
-
- -->
-
- <xs:element name="S7Message">
- <xs:complexType>
- <xs:sequence>
- <!-- S7 Magic Byte always 0x32 -->
- <xs:element name="magicByte" type="s7:byte">
- <xs:annotation>
- <xs:appinfo source="http://www.ogf.org/dfdl/">
- <dfdl:assert message="Magic number was not 0x32."
- test="{. eq 50}" />
- </xs:appinfo>
- </xs:annotation>
- </xs:element>
- <xs:element name="type" type="s7:byte"/>
- <!--
- Unfortunately the response for a CPU Functions request follows the rules of a
- response, however has the header structure of a request
- (no error code or error class). As mapping to the same type is not allowed,
- we map to strings and use that as choice-key.
- -->
- <xs:choice dfdl:choiceDispatchKey="{
- if(type eq 1) then 'request'
- else if(type eq 3) then 'response'
- else if(type eq 7) then 'response'
- else 'unknown'
- }">
- <xs:element dfdl:choiceBranchKey="request" ref="s7:S7RequestMessage"/>
- <xs:element dfdl:choiceBranchKey="response" ref="s7:S7ResponseMessage"/>
- </xs:choice>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
-
- <xs:element name="S7RequestMessage">
- <xs:complexType>
- <xs:sequence>
- <!-- Reserved value always 0x0000 -->
- <xs:element name="reserved" type="s7:short" fixed="0"/>
- <xs:element name="tpduReference" type="s7:short"/>
- <xs:element name="parametersLength" type="s7:short"/>
- <xs:element name="payloadsLength" type="s7:short"/>
- <xs:element name="parameters" minOccurs="0"
- dfdl:lengthKind="explicit" dfdl:lengthUnits="bytes" dfdl:length="{../parametersLength}"
- dfdl:occursCountKind="expression" dfdl:occursCount="{if(../parametersLength gt 0) then 1 else 0}">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="parameter" maxOccurs="unbounded">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="type" type="s7:byte"/>
- <xs:choice dfdl:choiceDispatchKey="{type}">
- <xs:element dfdl:choiceBranchKey="240" ref="s7:S7GeneralParameterSetupCommunication"/>
- <xs:element dfdl:choiceBranchKey="0" ref="s7:SS7RequestParameterCPUService"/>
- <xs:element dfdl:choiceBranchKey="4" ref="s7:S7RequestParameterReadVar"/>
- <xs:element dfdl:choiceBranchKey="5" ref="s7:S7RequestParameterWriteVar"/>
- </xs:choice>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <!--
- As we might be outputting an empty payload block for a parameter that might not have a payload,
- we have to output this element if the parameters are not empty. The case that the payloads are
- not empty but the parameters are can't happen during normal operation.
- -->
- <xs:element name="payloads" minOccurs="0"
- dfdl:lengthKind="explicit" dfdl:lengthUnits="bytes" dfdl:length="{../payloadsLength}"
- dfdl:occursCountKind="expression" dfdl:occursCount="{if(../parametersLength gt 0) then 1 else 0}">
- <xs:complexType>
- <xs:sequence>
- <!--
- For every parameter we'll be outputting a payload block, even if this might be empty.
- This is required in order to find the matching parameter for every payload we might
- be having. We need to match these as otherwise we couldn't determin the type of a
- payload as this has no type information and we need to be able to access the number
- of items for a read/write request in order to process the correct number of items in
- the payload.
- -->
- <xs:element name="payload" maxOccurs="unbounded"
- dfdl:occursCountKind="expression" dfdl:occursCount="{fn:count(../../parameters[1]/parameter)}">
- <xs:complexType>
- <xs:sequence>
- <xs:choice dfdl:choiceDispatchKey="{../../parameters[1]/parameter[dfdl:occursIndex()]/type}">
- <xs:element dfdl:choiceBranchKey="240" ref="s7:S7GeneralPayloadSetupCommunication"/>
- <xs:element dfdl:choiceBranchKey="0" ref="s7:S7RequestPayloadCpuServices"/>
- <xs:element dfdl:choiceBranchKey="4" ref="s7:S7RequestPayloadReadVar"/>
- <xs:element dfdl:choiceBranchKey="5" ref="s7:S7RequestPayloadWriteVar"/>
- </xs:choice>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
-
- <xs:element name="S7ResponseMessage">
- <xs:complexType>
- <xs:sequence>
- <!-- Reserved value always 0x0000 -->
- <xs:element name="reserved" type="s7:short" fixed="0"/>
- <xs:element name="tpduReference" type="s7:short"/>
- <xs:element name="parametersLength" type="s7:short"/>
- <xs:element name="payloadsLength" type="s7:short"/>
- <!-- UserData (type 7) responses don't have the error class and code -->
- <xs:element name="errorClass" type="s7:byte" minOccurs="0"
- dfdl:occursCountKind="expression" dfdl:occursCount="{if(../../type eq 3) then 1 else 0}"/>
- <xs:element name="errorCode" type="s7:byte" minOccurs="0"
- dfdl:occursCountKind="expression" dfdl:occursCount="{if(../../type eq 3) then 1 else 0}"/>
- <xs:element name="parameters" minOccurs="0"
- dfdl:lengthKind="explicit" dfdl:lengthUnits="bytes" dfdl:length="{../parametersLength}"
- dfdl:occursCountKind="expression" dfdl:occursCount="{if(../parametersLength gt 0) then 1 else 0}">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="parameter" maxOccurs="unbounded">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="type" type="s7:byte"/>
- <xs:choice dfdl:choiceDispatchKey="{type}">
- <xs:element dfdl:choiceBranchKey="240" ref="s7:S7GeneralParameterSetupCommunication"/>
- <xs:element dfdl:choiceBranchKey="0" ref="s7:S7ResponseParameterCPUService"/>
- <xs:element dfdl:choiceBranchKey="4" ref="s7:S7ResponseParameterReadVar"/>
- <xs:element dfdl:choiceBranchKey="5" ref="s7:S7ResponseParameterWriteVar"/>
- </xs:choice>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <!--
- As we might be outputting an empty payload block for a parameter that might not have a payload,
- we have to output this element if the parameters are not empty. The case that the payloads are
- not empty but the parameters are can't happen during normal operation.
- -->
- <xs:element name="payloads" minOccurs="0"
- dfdl:lengthKind="explicit" dfdl:lengthUnits="bytes" dfdl:length="{../payloadsLength}"
- dfdl:occursCountKind="expression" dfdl:occursCount="{if(../parametersLength gt 0) then 1 else 0}">
- <xs:complexType>
- <xs:sequence>
- <!--
- For every parameter we'll be outputting a payload block, even if this might be empty.
- This is required in order to find the matching parameter for every payload we might
- be having. We need to match these as otherwise we couldn't determin the type of a
- payload as this has no type information and we need to be able to access the number
- of items for a read/write request in order to process the correct number of items in
- the payload.
- -->
- <xs:element name="payload" maxOccurs="unbounded"
- dfdl:occursCountKind="expression" dfdl:occursCount="{fn:count(../../parameters[1]/parameter)}">
- <xs:complexType>
- <xs:sequence>
- <xs:choice dfdl:choiceDispatchKey="{../../parameters[1]/parameter[dfdl:occursIndex()]/type}">
- <xs:element dfdl:choiceBranchKey="240" ref="s7:S7GeneralPayloadSetupCommunication"/>
- <xs:element dfdl:choiceBranchKey="0" ref="s7:S7ResponsePayloadCpuServices"/>
- <xs:element dfdl:choiceBranchKey="4" ref="s7:S7ResponsePayloadReadVar"/>
- <xs:element dfdl:choiceBranchKey="5" ref="s7:S7ResponsePayloadWriteVar"/>
- </xs:choice>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
-
- <!--
-
- Parameters.
-
- -->
-
- <xs:element name="S7GeneralParameterSetupCommunication">
- <xs:complexType>
- <xs:sequence>
- <!-- Reserved value always 0x00 -->
- <xs:element name="reserved" type="s7:byte" fixed="0"/>
- <xs:element name="maxAmqCaller" type="s7:short"/>
- <xs:element name="maxAmqCallee" type="s7:short"/>
- <xs:element name="pduLength" type="s7:short"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
-
- <xs:element name="SS7RequestParameterCPUService">
- <xs:complexType>
- <xs:sequence>
- <!-- Fixed header 0x0112 274 -> -->
- <xs:element name="header" type="s7:short"/><!-- fixed="274"-->
- <xs:element name="length" type="s7:byte"/><!-- fixed="4"-->
- <!-- Request: 0x11 -> 17 -->
- <xs:element name="typeCode" type="s7:byte"/><!-- fixed="17"-->
- <!-- First 4 bits: Request 0x40, last 4 bits: Function Group 0x04 = 0x44 -> 68 -->
- <xs:element name="functionGroup" type="s7:byte"/><!-- fixed="68"-->
- <!-- READ SSL = 0x01 -->
- <xs:element name="subFunctionGroup" type="s7:byte"/><!-- fixed="1"-->
- <xs:element name="sequenceNumber" type="s7:byte"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
-
- <xs:element name="S7ResponseParameterCPUService">
- <xs:complexType>
- <xs:sequence>
- <!-- Fixed header 0x0112 274 -> -->
- <xs:element name="header" type="s7:short"/><!-- fixed="274"-->
- <xs:element name="paramLength" type="s7:byte"/><!-- fixed="8"-->
- <!-- Response: 0x12 -> 18 -->
- <xs:element name="typeCode" type="s7:byte"/><!-- fixed="18"-->
- <!-- First 4 bits: Response 0x80, last 4 bits: Function Group 0x04 = 0x84 -> 132 -->
- <xs:element name="functionGroup" type="s7:byte"/><!-- fixed="132"-->
- <!-- READ SSL = 0x01 -->
- <xs:element name="subFunctionGroup" type="s7:byte"/><!-- fixed="1"-->
- <xs:element name="sequenceNumber" type="s7:byte"/>
- <xs:element name="dataUnitReferenceNumber" type="s7:byte"/>
- <xs:element name="lastDataUnit" type="s7:byte"/>
- <xs:element name="error" type="s7:short"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
-
- <xs:element name="S7RequestParameterReadVar">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="numItems" type="s7:byte"/>
- <xs:element name="items" minOccurs="0"
- dfdl:occursCountKind="expression" dfdl:occursCount="{if(../numItems gt 0) then 1 else 0}">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="item" minOccurs="0"
- dfdl:occursCountKind="expression" dfdl:occursCount="{../../numItems}">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="type" type="s7:byte"/>
- <xs:choice dfdl:choiceDispatchKey="{type}">
- <xs:element dfdl:choiceBranchKey="18" ref="s7:S7RequestParameterReadVarAnyItem"/>
- </xs:choice>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
-
- <xs:element name="S7RequestParameterReadVarAnyItem">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="paramLength" type="s7:byte"/><!-- fixed="10"-->
- <!-- Addressing Mode: Any 0x10 -> 16 -->
- <xs:element name="addressingMode" type="s7:byte"/><!-- fixed="16"-->
- <xs:element name="dataType" type="s7:byte"/>
- <xs:element name="numElements" type="s7:short"/>
- <xs:element name="dataBlockNumber" type="s7:short"/>
- <xs:element name="memoryArea" type="s7:byte"/>
- <!--
- The next 3 bytes (24 bits) contain the byte- and bit-offset,
- were the last byte contains the bit-offset in the last 3 bits
- and the byteOffset is encoded in the higher level 21 bits
- -->
- <xs:element name="byteOffset" type="xs:unsignedInt"
- dfdl:lengthKind="explicit" dfdl:lengthUnits="bits" dfdl:length="21"/>
- <xs:element name="bitOffset" type="xs:unsignedInt"
- dfdl:lengthKind="explicit" dfdl:lengthUnits="bits" dfdl:length="3"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
-
- <xs:element name="S7ResponseParameterReadVar">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="numItems" type="s7:byte"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
-
- <xs:element name="S7RequestParameterWriteVar">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="numItems" type="s7:byte"/>
- <xs:element name="items" minOccurs="0"
- dfdl:occursCountKind="expression" dfdl:occursCount="{if(../numItems gt 0) then 1 else 0}">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="item" minOccurs="0"
- dfdl:occursCountKind="expression" dfdl:occursCount="{../../numItems}">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="type" type="s7:byte"/>
- <xs:choice dfdl:choiceDispatchKey="{type}">
- <xs:element dfdl:choiceBranchKey="18" ref="s7:S7RequestParameterWriteVarAnyItem"/>
- </xs:choice>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
-
- <xs:element name="S7RequestParameterWriteVarAnyItem">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="itemLength" type="s7:byte"/><!-- fixed="10"-->
- <!-- Addressing Mode: Any 0x10 -> 16 -->
- <xs:element name="addressingMode" type="s7:byte"/><!-- fixed="16"-->
- <xs:element name="dataType" type="s7:byte"/>
- <xs:element name="numElements" type="s7:short"/>
- <xs:element name="dataBlockNumber" type="s7:short"/>
- <xs:element name="memoryArea" type="s7:byte"/>
- <!--
- The next 3 bytes (24 bits) contain the byte- and bit-offset,
- were the last byte contains the bit-offset in the last 3 bits
- and the byteOffset is encoded in the higher level 21 bits
- -->
- <xs:element name="byteOffset" type="xs:unsignedInt"
- dfdl:lengthKind="explicit" dfdl:lengthUnits="bits" dfdl:length="21"/>
- <xs:element name="bitOffset" type="xs:unsignedInt"
- dfdl:lengthKind="explicit" dfdl:lengthUnits="bits" dfdl:length="3"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
-
- <xs:element name="S7ResponseParameterWriteVar">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="numItems" type="s7:byte"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
-
- <!--
-
- Payloads.
-
- -->
-
- <xs:element name="S7GeneralPayloadSetupCommunication" type="xs:hexBinary" dfdl:length="0">
- <!--xs:complexType>
- <xs:sequence>
- <xs:element name="payload" type="s7f:byte" minOccurs="0"/>
- </xs:sequence>
- </xs:complexType-->>
- </xs:element>
-
- <xs:element name="S7RequestPayloadCpuServices">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="transportSize" type="s7:byte"/><!-- fixed="9"-->
- <xs:element name="length" type="s7:byte"/>
- <xs:element name="sslId" type="s7:short"/>
- <xs:element name="sslIndex" type="s7:short"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
-
- <xs:element name="S7ResponsePayloadCpuServices">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="returnCode" type="s7:byte"/>
- <!-- Transport Size: Octet String = 0x09 -> 9 -->
- <xs:element name="transportSize" type="s7:byte"/><!-- fixed="9"-->
- <xs:element name="length" type="s7:short"/>
- <xs:element name="sslId" type="s7:short"/>
- <xs:element name="sslIndex" type="s7:short"/>
- <xs:element name="partialList" minOccurs="0"
- dfdl:lengthKind="explicit" dfdl:lengthUnits="bytes" dfdl:length="{../length - 4}"
- dfdl:occursCountKind="expression" dfdl:occursCount="{../length gt 4}">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="partialListLengthInWords" type="s7:short"/>
- <xs:element name="partialListCount" type="s7:short"/>
- <xs:element name="sslDataRecords">
- <xs:complexType>
- <xs:sequence dfdl:lengthKind="explicit" dfdl:lengthUnits="bytes" dfdl:length="{../length - 8}">
- <xs:choice>
- <xs:element ref="s7:S7ResponsePayloadCpuServicesSslDataRecordModuleIdentification"/>
- </xs:choice>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
-
- <xs:element name="S7ResponsePayloadCpuServicesSslDataRecordModuleIdentification">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="index" type="s7:short"/>
- <xs:element name="articleNumber" type="xs:unsignedByte"
- dfdl:lengthUnits="bytes" dfdl:length="20" dfdl:lengthKind="explicit"/>
- <xs:element name="bgType" type="s7:short"/>
- <xs:element name="moduleOrOsVersion" type="s7:short"/>
- <xs:element name="pgDescriptionFileVersion" type="s7:short"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
-
- <xs:element name="S7RequestPayloadReadVar">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="payload" type="s7f:byte" minOccurs="0"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
-
- <xs:element name="S7ResponsePayloadReadVar">
- <xs:complexType>
- <xs:sequence>
- <!-- The number of items which should be read is transmitted in the matching parameter -->
- <xs:element name="numItems" type="s7:byte"
- dfdl:inputValueCalc="{
- ../../../../parameters[1]/parameter[dfdl:occursIndex()]/s7:S7ResponseParameterReadVar/numItems
- }"/>
- <xs:element name="item" minOccurs="0"
- dfdl:occursCountKind="expression" dfdl:occursCount="{../numItems}">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="returnCode" type="s7:byte"/>
- <xs:element name="transportSize" type="s7:byte"/>
- <xs:element name="rawLength" type="s7:short"/>
- <!--
- For some reason the types BIT, BYTE_WORD_DWORD and INTEGER are transferred in "bits",
- the rest is transferred in "bytes"
- -->
- <xs:element name="lengthInBytes" type="s7:short" dfdl:inputValueCalc="{
- if((../transportSize eq 3) or (../transportSize eq 4) or (../transportSize eq 5))
- then fn:ceiling(../rawLength div 8)
- else ../rawLength}"/>
- <xs:element name="data" type="xs:hexBinary"
- dfdl:byteOrder="bigEndian" dfdl:lengthUnits="bytes" dfdl:lengthKind="explicit"
- dfdl:length="{../lengthInBytes}"/>
- <!--
- Transport sizes: BIT, BYTE_WORD_DWORD and OCTET_STRING require a blank byte.
- However only if this is not the last item in the result.
- -->
- <xs:element name="reserved" type="s7:byte" minOccurs="0"
- dfdl:occursCountKind="expression" dfdl:occursCount="{
- if(((../transportSize eq 3) or
- (../transportSize eq 4) or
- (../transportSize eq 9)) and
- (dfdl:occursIndex() ne ../../numItems)) then 1 else 0}"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
-
- <xs:element name="S7RequestPayloadWriteVar">
- <xs:complexType>
- <xs:sequence>
- <!-- The number of items which should be read is transmitted in the matching parameter -->
- <xs:element name="numItems" type="s7:byte"
- dfdl:inputValueCalc="{
- ../../../../parameters[1]/parameter[dfdl:occursIndex()]/s7:S7RequestParameterWriteVar/numItems
- }"/>
- <xs:element name="item" minOccurs="0"
- dfdl:occursCountKind="expression" dfdl:occursCount="{../numItems}">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="returnCode" type="s7:byte"/>
- <xs:element name="transportSize" type="s7:byte"/>
- <xs:element name="rawLength" type="s7:short"/>
- <!--
- For some reason the types BIT, BYTE_WORD_DWORD and INTEGER are transferred in "bits",
- the rest is transferred in "bytes"
- -->
- <xs:element name="lengthInBytes" type="s7:short" dfdl:inputValueCalc="{
- if((../transportSize eq 3) or (../transportSize eq 4) or (../transportSize eq 5))
- then fn:ceiling(../rawLength div 8)
- else ../rawLength}"/>
- <xs:element name="data" type="xs:hexBinary"
- dfdl:byteOrder="bigEndian" dfdl:lengthUnits="bytes" dfdl:lengthKind="explicit"
- dfdl:length="{../lengthInBytes}"/>
- <!--
- Transport sizes: BIT, BYTE_WORD_DWORD and OCTET_STRING require a blank byte.
- However only if this is not the last item in the result.
-
- Actually the S7 device will never process data that contains more
- than one item in a write request, so this is rather a cosmetic fine-tuning.
- -->
- <xs:element name="reserved" type="s7:byte" minOccurs="0"
- dfdl:occursCountKind="expression" dfdl:occursCount="{
- if(((../transportSize eq 3) or
- (../transportSize eq 4) or
- (../transportSize eq 9)) and
- (dfdl:occursIndex() ne ../../numItems)) then 1 else 0}"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
-
- <xs:element name="S7ResponsePayloadWriteVar">
- <xs:complexType>
- <xs:sequence>
- <!-- The number of items which should be read is transmitted in the matching parameter -->
- <xs:element name="numItems" type="s7:byte"
- dfdl:inputValueCalc="{
- ../../../../parameters[1]/parameter[dfdl:occursIndex()]/s7:S7ResponseParameterWriteVar/numItems
- }"/>
- <xs:element name="item" minOccurs="0"
- dfdl:occursCountKind="expression" dfdl:occursCount="{../numItems}">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="returnCode" type="s7:byte"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
-
-</xs:schema>
\ No newline at end of file
diff --git a/protocols/s7/src/main/dfdl/org/apache/plc4x/protocols/tpkt-protocol.dfdl.xsd b/protocols/s7/src/main/dfdl/org/apache/plc4x/protocols/tpkt-protocol.dfdl.xsd
deleted file mode 100644
index 6c3e73a..0000000
--- a/protocols/s7/src/main/dfdl/org/apache/plc4x/protocols/tpkt-protocol.dfdl.xsd
+++ /dev/null
@@ -1,87 +0,0 @@
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- 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.
- -->
-<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
- xmlns:dfdl="http://www.ogf.org/dfdl/dfdl-1.0/"
- xmlns:tpkt="http://plc4x.apache.org/tpkt"
- targetNamespace="http://plc4x.apache.org/tpkt">
-
- <xs:annotation>
- <xs:appinfo source="http://www.ogf.org/dfdl/">
- <dfdl:defineVariable name="messageType" type="xs:string"/>
- <dfdl:defineFormat name="tpktFormat">
- <dfdl:format representation="binary"
- binaryNumberRep="binary"
- byteOrder="bigEndian"
- lengthKind="implicit" lengthUnits="bytes" length="0"
- occursCountKind="implicit"
- textOutputMinLength="0"
- alignment="1" alignmentUnits="bits"
- leadingSkip="0" trailingSkip="0"
- textPadKind="none" ignoreCase="no"
- encoding="utf-8" truncateSpecifiedLengthString="no"
- initiator="" terminator=""
- sequenceKind="ordered" separator=""
- escapeSchemeRef="" initiatedContent="no"/>
- </dfdl:defineFormat>
- <dfdl:format ref="tpkt:tpktFormat"/>
- </xs:appinfo>
- </xs:annotation>
-
- <!--
-
- Simple type definition.
-
- -->
-
- <xs:simpleType name="byte" dfdl:lengthUnits="bytes" dfdl:length="1" dfdl:lengthKind="explicit">
- <xs:restriction base="xs:unsignedByte"/>
- </xs:simpleType>
-
- <xs:simpleType name="short" dfdl:lengthUnits="bytes" dfdl:length="2" dfdl:lengthKind="explicit">
- <xs:restriction base="xs:unsignedShort"/>
- </xs:simpleType>
-
- <!--
-
- TPKT - Iso-On-TCP
-
- -->
-
- <xs:element name="TpktMessage" type="tpkt:TpktMessageType"/>
-
- <xs:complexType name="TpktMessageType">
- <xs:sequence>
- <!-- TPKT Magic Byte always 0x03 -->
- <xs:element name="magicByte" type="tpkt:byte">
- <xs:annotation>
- <xs:appinfo source="http://www.ogf.org/dfdl/">
- <dfdl:assert message="Magic number was not 0x03."
- test="{. eq 3}" />
- </xs:appinfo>
- </xs:annotation>
- </xs:element>
- <xs:element name="reserved" type="tpkt:byte"/>
- <xs:element name="length" type="tpkt:short"/>
- <xs:element name="userData" type="xs:hexBinary"
- dfdl:byteOrder="bigEndian" dfdl:lengthUnits="bytes" dfdl:lengthKind="explicit"
- dfdl:length="{../length - 4}"/>
- </xs:sequence>
- </xs:complexType>
-
-</xs:schema>
\ No newline at end of file
diff --git a/protocols/s7/src/main/dfdl/daffodil-built-in-catalog.xml b/protocols/s7/src/main/resources/daffodil-built-in-catalog.xml
similarity index 69%
rename from protocols/s7/src/main/dfdl/daffodil-built-in-catalog.xml
rename to protocols/s7/src/main/resources/daffodil-built-in-catalog.xml
index ae2a712..b6a5d23 100644
--- a/protocols/s7/src/main/dfdl/daffodil-built-in-catalog.xml
+++ b/protocols/s7/src/main/resources/daffodil-built-in-catalog.xml
@@ -16,12 +16,6 @@
limitations under the License.
-->
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
- <uri name="http://plc4x.apache.org/tpkt"
- uri="org/apache/plc4x/protocols/tpkt-protocol.dfdl.xsd"/>
- <uri name="http://plc4x.apache.org/cotp"
- uri="org/apache/plc4x/protocols/cotp-protocol.dfdl.xsd"/>
<uri name="http://plc4x.apache.org/s7"
- uri="org/apache/plc4x/protocols/s7-protocol.dfdl.xsd"/>
- <uri name="http://plc4x.apache.org/s7-full"
- uri="org/apache/plc4x/protocols/s7-full-stack-protocol.dfdl.xsd"/>
+ uri="org/apache/plc4x/protocols/s7/protocol.dfdl.xsd"/>
</catalog>
\ No newline at end of file
diff --git a/protocols/s7/src/main/dfdl/org/apache/plc4x/protocols/s7-full-stack-protocol.dfdl.xsd b/protocols/s7/src/main/resources/org/apache/plc4x/protocols/s7/protocol.dfdl.xsd
similarity index 82%
rename from protocols/s7/src/main/dfdl/org/apache/plc4x/protocols/s7-full-stack-protocol.dfdl.xsd
rename to protocols/s7/src/main/resources/org/apache/plc4x/protocols/s7/protocol.dfdl.xsd
index cb6a961..07715ab 100644
--- a/protocols/s7/src/main/dfdl/org/apache/plc4x/protocols/s7-full-stack-protocol.dfdl.xsd
+++ b/protocols/s7/src/main/resources/org/apache/plc4x/protocols/s7/protocol.dfdl.xsd
@@ -18,9 +18,9 @@
-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:dfdl="http://www.ogf.org/dfdl/dfdl-1.0/"
- xmlns:s7f="http://plc4x.apache.org/s7-full"
+ xmlns:s7="http://plc4x.apache.org/s7"
xmlns:fn="http://www.w3.org/2005/xpath-functions"
- targetNamespace="http://plc4x.apache.org/s7-full">
+ targetNamespace="http://plc4x.apache.org/s7">
<xs:annotation>
<xs:appinfo source="http://www.ogf.org/dfdl/">
@@ -40,7 +40,7 @@
sequenceKind="ordered" separator=""
escapeSchemeRef="" initiatedContent="no"/>
</dfdl:defineFormat>
- <dfdl:format ref="s7f:s7FullFormat"/>
+ <dfdl:format ref="s7:s7FullFormat"/>
</xs:appinfo>
</xs:annotation>
@@ -72,12 +72,12 @@
-->
- <xs:element name="TpktMessage" type="s7f:TpktMessageType"/>
+ <xs:element name="TpktMessage" type="s7:TpktMessageType"/>
<xs:complexType name="TpktMessageType">
<xs:sequence>
<!-- TPKT Magic Byte always 0x03 -->
- <xs:element name="magicByte" type="s7f:byte">
+ <xs:element name="magicByte" type="s7:byte">
<xs:annotation>
<xs:appinfo source="http://www.ogf.org/dfdl/">
<dfdl:assert message="Magic number was not 0x03."
@@ -85,9 +85,9 @@
</xs:appinfo>
</xs:annotation>
</xs:element>
- <xs:element name="reserved" type="s7f:byte"/>
- <xs:element name="length" type="s7f:short"/>
- <xs:element name="userData" type="s7f:CotpMessageType"/>
+ <xs:element name="reserved" type="s7:byte"/>
+ <xs:element name="length" type="s7:short"/>
+ <xs:element name="userData" type="s7:CotpMessageType"/>
</xs:sequence>
</xs:complexType>
@@ -165,17 +165,17 @@
<xs:complexType name="CotpMessageType">
<xs:sequence>
<!-- Length of the COTP header data -->
- <xs:element name="headerLength" type="s7f:byte"/>
- <xs:element name="type" type="s7f:CotpTpduType"/>
+ <xs:element name="headerLength" type="s7:byte"/>
+ <xs:element name="type" type="s7:CotpTpduType"/>
<xs:choice dfdl:choiceDispatchKey="{type}">
- <xs:element dfdl:choiceBranchKey="224" ref="s7f:CotpTpduConnectionRequest"/>
- <xs:element dfdl:choiceBranchKey="208" ref="s7f:CotpTpduConnectionResponse"/>
- <xs:element dfdl:choiceBranchKey="128" ref="s7f:CotpTpduDisconnectRequest"/>
- <xs:element dfdl:choiceBranchKey="192" ref="s7f:CotpTpduDisconnectResponse"/>
- <xs:element dfdl:choiceBranchKey="112" ref="s7f:CotpTpduError"/>
- <xs:element dfdl:choiceBranchKey="240" ref="s7f:CotpTpduData"/>
+ <xs:element dfdl:choiceBranchKey="224" ref="s7:CotpTpduConnectionRequest"/>
+ <xs:element dfdl:choiceBranchKey="208" ref="s7:CotpTpduConnectionResponse"/>
+ <xs:element dfdl:choiceBranchKey="128" ref="s7:CotpTpduDisconnectRequest"/>
+ <xs:element dfdl:choiceBranchKey="192" ref="s7:CotpTpduDisconnectResponse"/>
+ <xs:element dfdl:choiceBranchKey="112" ref="s7:CotpTpduError"/>
+ <xs:element dfdl:choiceBranchKey="240" ref="s7:CotpTpduData"/>
</xs:choice>
- <xs:element name="userData" type="s7f:S7MessageType" minOccurs="0"
+ <xs:element name="userData" type="s7:S7MessageType" minOccurs="0"
dfdl:occursCountKind="expression"
dfdl:occursCount="{if((../../length - (../headerLength + 1)) gt 0) then 1 else 0}"/>
</xs:sequence>
@@ -184,10 +184,10 @@
<xs:element name="CotpTpduConnectionRequest">
<xs:complexType>
<xs:sequence>
- <xs:element name="destinationReference" type="s7f:short"/>
- <xs:element name="sourceReference" type="s7f:short"/>
- <xs:element name="protocolClass" type="s7f:byte"/>
- <xs:element ref="s7f:parameters" minOccurs="0"
+ <xs:element name="destinationReference" type="s7:short"/>
+ <xs:element name="sourceReference" type="s7:short"/>
+ <xs:element name="protocolClass" type="s7:byte"/>
+ <xs:element ref="s7:parameters" minOccurs="0"
dfdl:lengthKind="explicit" dfdl:lengthUnits="bytes" dfdl:length="{../../headerLength - 6}"
dfdl:occursCountKind="expression"
dfdl:occursCount="{if(../../headerLength gt 6) then 1 else 0}"/>
@@ -198,10 +198,10 @@
<xs:element name="CotpTpduConnectionResponse">
<xs:complexType>
<xs:sequence>
- <xs:element name="destinationReference" type="s7f:short"/>
- <xs:element name="sourceReference" type="s7f:short"/>
- <xs:element name="protocolClass" type="s7f:byte"/>
- <xs:element ref="s7f:parameters" minOccurs="0"
+ <xs:element name="destinationReference" type="s7:short"/>
+ <xs:element name="sourceReference" type="s7:short"/>
+ <xs:element name="protocolClass" type="s7:byte"/>
+ <xs:element ref="s7:parameters" minOccurs="0"
dfdl:lengthKind="explicit" dfdl:lengthUnits="bytes" dfdl:length="{../../headerLength - 6}"
dfdl:occursCountKind="expression"
dfdl:occursCount="{if(../../headerLength gt 6) then 1 else 0}"/>
@@ -212,10 +212,10 @@
<xs:element name="CotpTpduDisconnectRequest">
<xs:complexType>
<xs:sequence>
- <xs:element name="destinationReference" type="s7f:short"/>
- <xs:element name="sourceReference" type="s7f:short"/>
- <xs:element name="disconnectReason" type="s7f:byte"/>
- <xs:element ref="s7f:parameters" minOccurs="0"
+ <xs:element name="destinationReference" type="s7:short"/>
+ <xs:element name="sourceReference" type="s7:short"/>
+ <xs:element name="disconnectReason" type="s7:byte"/>
+ <xs:element ref="s7:parameters" minOccurs="0"
dfdl:lengthKind="explicit" dfdl:lengthUnits="bytes" dfdl:length="{../../headerLength - 6}"
dfdl:occursCountKind="expression"
dfdl:occursCount="{if(../../headerLength gt 6) then 1 else 0}"/>
@@ -226,9 +226,9 @@
<xs:element name="CotpTpduDisconnectResponse">
<xs:complexType>
<xs:sequence>
- <xs:element name="destinationReference" type="s7f:short"/>
- <xs:element name="sourceReference" type="s7f:short"/>
- <xs:element ref="s7f:parameters" minOccurs="0"
+ <xs:element name="destinationReference" type="s7:short"/>
+ <xs:element name="sourceReference" type="s7:short"/>
+ <xs:element ref="s7:parameters" minOccurs="0"
dfdl:lengthKind="explicit" dfdl:lengthUnits="bytes" dfdl:length="{../../headerLength - 5}"
dfdl:occursCountKind="expression"
dfdl:occursCount="{if(../../headerLength gt 5) then 1 else 0}"/>
@@ -239,9 +239,9 @@
<xs:element name="CotpTpduError">
<xs:complexType>
<xs:sequence>
- <xs:element name="destinationReference" type="s7f:short"/>
- <xs:element name="rejectCause" type="s7f:byte"/>
- <xs:element ref="s7f:parameters" minOccurs="0"
+ <xs:element name="destinationReference" type="s7:short"/>
+ <xs:element name="rejectCause" type="s7:byte"/>
+ <xs:element ref="s7:parameters" minOccurs="0"
dfdl:lengthKind="explicit" dfdl:lengthUnits="bytes" dfdl:length="{../../headerLength - 4}"
dfdl:occursCountKind="expression"
dfdl:occursCount="{if(../../headerLength gt 4) then 1 else 0}"/>
@@ -266,15 +266,15 @@
<xs:element name="parameter" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
- <xs:element name="type" type="s7f:CotpParameterType"/>
- <xs:element name="parameterLength" type="s7f:byte"/>
+ <xs:element name="type" type="s7:CotpParameterType"/>
+ <xs:element name="parameterLength" type="s7:byte"/>
<xs:choice dfdl:choiceDispatchKey="{type}">
- <xs:element dfdl:choiceBranchKey="192" ref="s7f:CotpParameterTpduSize"/>
- <xs:element dfdl:choiceBranchKey="193" ref="s7f:CotpParameterCallingTsap"/>
- <xs:element dfdl:choiceBranchKey="194" ref="s7f:CotpParameterCalledTsap"/>
- <xs:element dfdl:choiceBranchKey="195" ref="s7f:CotpParameterChecksum"/>
+ <xs:element dfdl:choiceBranchKey="192" ref="s7:CotpParameterTpduSize"/>
+ <xs:element dfdl:choiceBranchKey="193" ref="s7:CotpParameterCallingTsap"/>
+ <xs:element dfdl:choiceBranchKey="194" ref="s7:CotpParameterCalledTsap"/>
+ <xs:element dfdl:choiceBranchKey="195" ref="s7:CotpParameterChecksum"/>
<xs:element dfdl:choiceBranchKey="224"
- ref="s7f:CotpParameterDisconnectAdditionalInformation"/>
+ ref="s7:CotpParameterDisconnectAdditionalInformation"/>
</xs:choice>
</xs:sequence>
</xs:complexType>
@@ -286,7 +286,7 @@
<xs:element name="CotpParameterTpduSize">
<xs:complexType>
<xs:sequence>
- <xs:element name="tpduSize" type="s7f:byte"/>
+ <xs:element name="tpduSize" type="s7:byte"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@ -294,7 +294,7 @@
<xs:element name="CotpParameterCallingTsap">
<xs:complexType>
<xs:sequence>
- <xs:element name="tsapId" type="s7f:short"/>
+ <xs:element name="tsapId" type="s7:short"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@ -302,7 +302,7 @@
<xs:element name="CotpParameterCalledTsap">
<xs:complexType>
<xs:sequence>
- <xs:element name="tsapId" type="s7f:short"/>
+ <xs:element name="tsapId" type="s7:short"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@ -310,7 +310,7 @@
<xs:element name="CotpParameterChecksum">
<xs:complexType>
<xs:sequence>
- <xs:element name="checksum" type="s7f:byte"/>
+ <xs:element name="checksum" type="s7:byte"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@ -334,7 +334,7 @@
<xs:complexType name="S7MessageType">
<xs:sequence>
<!-- S7 Magic Byte always 0x32 -->
- <xs:element name="magicByte" type="s7f:byte">
+ <xs:element name="magicByte" type="s7:byte">
<xs:annotation>
<xs:appinfo source="http://www.ogf.org/dfdl/">
<dfdl:assert message="Magic number was not 0x32."
@@ -342,7 +342,7 @@
</xs:appinfo>
</xs:annotation>
</xs:element>
- <xs:element name="type" type="s7f:byte"/>
+ <xs:element name="type" type="s7:byte"/>
<!--
Unfortunately the response for a CPU Functions request follows the rules of a
response, however has the header structure of a request
@@ -350,9 +350,9 @@
we map to strings and use that as choice-key.
-->
<xs:choice dfdl:choiceDispatchKey="{type}">
- <xs:element dfdl:choiceBranchKey="1" ref="s7f:S7RequestMessage"/>
- <xs:element dfdl:choiceBranchKey="3" ref="s7f:S7ResponseMessage"/>
- <xs:element dfdl:choiceBranchKey="7" ref="s7f:S7UserDataMessage"/>
+ <xs:element dfdl:choiceBranchKey="1" ref="s7:S7RequestMessage"/>
+ <xs:element dfdl:choiceBranchKey="3" ref="s7:S7ResponseMessage"/>
+ <xs:element dfdl:choiceBranchKey="7" ref="s7:S7UserDataMessage"/>
</xs:choice>
</xs:sequence>
</xs:complexType>
@@ -361,10 +361,10 @@
<xs:complexType>
<xs:sequence>
<!-- Reserved value always 0x0000 -->
- <xs:element name="reserved" type="s7f:short" fixed="0"/>
- <xs:element name="tpduReference" type="s7f:short"/>
- <xs:element name="parametersLength" type="s7f:short"/>
- <xs:element name="payloadsLength" type="s7f:short"/>
+ <xs:element name="reserved" type="s7:short" fixed="0"/>
+ <xs:element name="tpduReference" type="s7:short"/>
+ <xs:element name="parametersLength" type="s7:short"/>
+ <xs:element name="payloadsLength" type="s7:short"/>
<xs:element name="parameters" minOccurs="0"
dfdl:lengthKind="explicit" dfdl:lengthUnits="bytes" dfdl:length="{../parametersLength}"
dfdl:occursCountKind="expression"
@@ -374,12 +374,12 @@
<xs:element name="parameter" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
- <xs:element name="type" type="s7f:byte"/>
+ <xs:element name="type" type="s7:byte"/>
<xs:choice dfdl:choiceDispatchKey="{type}">
<xs:element dfdl:choiceBranchKey="240"
- ref="s7f:S7GeneralParameterSetupCommunication"/>
- <xs:element dfdl:choiceBranchKey="4" ref="s7f:S7RequestParameterReadVar"/>
- <xs:element dfdl:choiceBranchKey="5" ref="s7f:S7RequestParameterWriteVar"/>
+ ref="s7:S7GeneralParameterSetupCommunication"/>
+ <xs:element dfdl:choiceBranchKey="4" ref="s7:S7RequestParameterReadVar"/>
+ <xs:element dfdl:choiceBranchKey="5" ref="s7:S7RequestParameterWriteVar"/>
</xs:choice>
</xs:sequence>
</xs:complexType>
@@ -414,9 +414,9 @@
<xs:choice
dfdl:choiceDispatchKey="{../../parameters[1]/parameter[dfdl:occursIndex()]/type}">
<xs:element dfdl:choiceBranchKey="240"
- ref="s7f:S7GeneralPayloadSetupCommunication"/>
- <xs:element dfdl:choiceBranchKey="4" ref="s7f:S7RequestPayloadReadVar"/>
- <xs:element dfdl:choiceBranchKey="5" ref="s7f:S7RequestPayloadWriteVar"/>
+ ref="s7:S7GeneralPayloadSetupCommunication"/>
+ <xs:element dfdl:choiceBranchKey="4" ref="s7:S7RequestPayloadReadVar"/>
+ <xs:element dfdl:choiceBranchKey="5" ref="s7:S7RequestPayloadWriteVar"/>
</xs:choice>
</xs:sequence>
</xs:complexType>
@@ -432,14 +432,14 @@
<xs:complexType>
<xs:sequence>
<!-- Reserved value always 0x0000 -->
- <xs:element name="reserved" type="s7f:short" fixed="0"/>
- <xs:element name="tpduReference" type="s7f:short"/>
- <xs:element name="parametersLength" type="s7f:short"/>
- <xs:element name="payloadsLength" type="s7f:short"/>
+ <xs:element name="reserved" type="s7:short" fixed="0"/>
+ <xs:element name="tpduReference" type="s7:short"/>
+ <xs:element name="parametersLength" type="s7:short"/>
+ <xs:element name="payloadsLength" type="s7:short"/>
<!-- UserData (type 7) responses don't have the error class and code -->
- <xs:element name="errorClass" type="s7f:byte" minOccurs="0"
+ <xs:element name="errorClass" type="s7:byte" minOccurs="0"
dfdl:occursCountKind="expression" dfdl:occursCount="{if(../../type eq 3) then 1 else 0}"/>
- <xs:element name="errorCode" type="s7f:byte" minOccurs="0"
+ <xs:element name="errorCode" type="s7:byte" minOccurs="0"
dfdl:occursCountKind="expression" dfdl:occursCount="{if(../../type eq 3) then 1 else 0}"/>
<xs:element name="parameters" minOccurs="0"
dfdl:lengthKind="explicit" dfdl:lengthUnits="bytes" dfdl:length="{../parametersLength}"
@@ -450,12 +450,12 @@
<xs:element name="parameter" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
- <xs:element name="type" type="s7f:byte"/>
+ <xs:element name="type" type="s7:byte"/>
<xs:choice dfdl:choiceDispatchKey="{type}">
<xs:element dfdl:choiceBranchKey="240"
- ref="s7f:S7GeneralParameterSetupCommunication"/>
- <xs:element dfdl:choiceBranchKey="4" ref="s7f:S7ResponseParameterReadVar"/>
- <xs:element dfdl:choiceBranchKey="5" ref="s7f:S7ResponseParameterWriteVar"/>
+ ref="s7:S7GeneralParameterSetupCommunication"/>
+ <xs:element dfdl:choiceBranchKey="4" ref="s7:S7ResponseParameterReadVar"/>
+ <xs:element dfdl:choiceBranchKey="5" ref="s7:S7ResponseParameterWriteVar"/>
</xs:choice>
</xs:sequence>
</xs:complexType>
@@ -490,9 +490,9 @@
<xs:choice
dfdl:choiceDispatchKey="{../../parameters[1]/parameter[dfdl:occursIndex()]/type}">
<xs:element dfdl:choiceBranchKey="240"
- ref="s7f:S7GeneralPayloadSetupCommunication"/>
- <xs:element dfdl:choiceBranchKey="4" ref="s7f:S7ResponsePayloadReadVar"/>
- <xs:element dfdl:choiceBranchKey="5" ref="s7f:S7ResponsePayloadWriteVar"/>
+ ref="s7:S7GeneralPayloadSetupCommunication"/>
+ <xs:element dfdl:choiceBranchKey="4" ref="s7:S7ResponsePayloadReadVar"/>
+ <xs:element dfdl:choiceBranchKey="5" ref="s7:S7ResponsePayloadWriteVar"/>
</xs:choice>
</xs:sequence>
</xs:complexType>
@@ -509,10 +509,10 @@
<xs:complexType>
<xs:sequence>
<!-- Reserved value always 0x0000 -->
- <xs:element name="reserved" type="s7f:short" fixed="0"/>
- <xs:element name="tpduReference" type="s7f:short"/>
- <xs:element name="parametersLength" type="s7f:short"/>
- <xs:element name="payloadsLength" type="s7f:short"/>
+ <xs:element name="reserved" type="s7:short" fixed="0"/>
+ <xs:element name="tpduReference" type="s7:short"/>
+ <xs:element name="parametersLength" type="s7:short"/>
+ <xs:element name="payloadsLength" type="s7:short"/>
<xs:element name="parameters" minOccurs="0"
dfdl:lengthKind="explicit" dfdl:lengthUnits="bytes" dfdl:length="{../parametersLength}"
dfdl:occursCountKind="expression"
@@ -522,10 +522,10 @@
<xs:element name="parameter" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
- <xs:element name="type" type="s7f:byte"/>
+ <xs:element name="type" type="s7:byte"/>
<xs:choice dfdl:choiceDispatchKey="{type}">
<xs:element dfdl:choiceBranchKey="0"
- ref="s7f:S7UserDataParameterCPUService"/>
+ ref="s7:S7UserDataParameterCPUService"/>
</xs:choice>
</xs:sequence>
</xs:complexType>
@@ -560,7 +560,7 @@
<xs:choice
dfdl:choiceDispatchKey="{../../parameters[1]/parameter[dfdl:occursIndex()]/type}">
<xs:element dfdl:choiceBranchKey="0"
- ref="s7f:S7UserDataPayloadCpuServices"/>
+ ref="s7:S7UserDataPayloadCpuServices"/>
</xs:choice>
</xs:sequence>
</xs:complexType>
@@ -582,10 +582,10 @@
<xs:complexType>
<xs:sequence>
<!-- Reserved value always 0x00 -->
- <xs:element name="reserved" type="s7f:byte" fixed="0"/>
- <xs:element name="maxAmqCaller" type="s7f:short"/>
- <xs:element name="maxAmqCallee" type="s7f:short"/>
- <xs:element name="pduLength" type="s7f:short"/>
+ <xs:element name="reserved" type="s7:byte" fixed="0"/>
+ <xs:element name="maxAmqCaller" type="s7:short"/>
+ <xs:element name="maxAmqCallee" type="s7:short"/>
+ <xs:element name="pduLength" type="s7:short"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@ -594,25 +594,25 @@
<xs:complexType>
<xs:sequence>
<!-- Fixed header 0x0112 274 -> -->
- <xs:element name="header" type="s7f:short"/><!-- fixed="274"-->
- <xs:element name="paramLength" type="s7f:byte"/><!-- fixed="4"-->
+ <xs:element name="header" type="s7:short"/><!-- fixed="274"-->
+ <xs:element name="paramLength" type="s7:byte"/><!-- fixed="4"-->
<!-- Request: 0x11 -> 17 -->
- <xs:element name="typeCode" type="s7f:byte"/><!-- fixed="17"-->
+ <xs:element name="typeCode" type="s7:byte"/><!-- fixed="17"-->
<xs:element name="type" type="xs:unsignedByte" dfdl:lengthKind="explicit" dfdl:lengthUnits="bits"
dfdl:length="4"/>
<!-- First 4 bits: Request 0x40, last 4 bits: Function Group 0x04 = 0x44 -> 68 -->
<xs:element name="functionGroup" type="xs:unsignedByte" dfdl:lengthKind="explicit"
dfdl:lengthUnits="bits" dfdl:length="4"/><!-- fixed="68"-->
<!-- READ SSL = 0x01 -->
- <xs:element name="subFunctionGroup" type="s7f:byte"/><!-- fixed="1"-->
- <xs:element name="sequenceNumber" type="s7f:byte"/>
- <xs:element name="dataUnitReferenceNumber" type="s7f:byte" minOccurs="0"
+ <xs:element name="subFunctionGroup" type="s7:byte"/><!-- fixed="1"-->
+ <xs:element name="sequenceNumber" type="s7:byte"/>
+ <xs:element name="dataUnitReferenceNumber" type="s7:byte" minOccurs="0"
dfdl:occursCountKind="expression"
dfdl:occursCount="{if(../sequenceNumber eq 2) then 1 else 0}"/>
- <xs:element name="lastDataUnit" type="s7f:byte" minOccurs="0"
+ <xs:element name="lastDataUnit" type="s7:byte" minOccurs="0"
dfdl:occursCountKind="expression"
dfdl:occursCount="{if(../sequenceNumber eq 2) then 1 else 0}"/>
- <xs:element name="errorCode" type="s7f:short" minOccurs="0"
+ <xs:element name="errorCode" type="s7:short" minOccurs="0"
dfdl:occursCountKind="expression"
dfdl:occursCount="{if(../sequenceNumber eq 2) then 1 else 0}"/>
</xs:sequence>
@@ -622,7 +622,7 @@
<xs:element name="S7RequestParameterReadVar">
<xs:complexType>
<xs:sequence>
- <xs:element name="numItems" type="s7f:byte"/>
+ <xs:element name="numItems" type="s7:byte"/>
<xs:element name="items" minOccurs="0"
dfdl:occursCountKind="expression" dfdl:occursCount="{if(../numItems gt 0) then 1 else 0}">
<xs:complexType>
@@ -631,10 +631,10 @@
dfdl:occursCountKind="expression" dfdl:occursCount="{../../numItems}">
<xs:complexType>
<xs:sequence>
- <xs:element name="type" type="s7f:byte"/>
+ <xs:element name="type" type="s7:byte"/>
<xs:choice dfdl:choiceDispatchKey="{type}">
<xs:element dfdl:choiceBranchKey="18"
- ref="s7f:S7RequestParameterReadVarAnyItem"/>
+ ref="s7:S7RequestParameterReadVarAnyItem"/>
</xs:choice>
</xs:sequence>
</xs:complexType>
@@ -649,13 +649,13 @@
<xs:element name="S7RequestParameterReadVarAnyItem">
<xs:complexType>
<xs:sequence>
- <xs:element name="paramLength" type="s7f:byte"/><!-- fixed="10"-->
+ <xs:element name="paramLength" type="s7:byte"/><!-- fixed="10"-->
<!-- Addressing Mode: Any 0x10 -> 16 -->
- <xs:element name="addressingMode" type="s7f:byte"/><!-- fixed="16"-->
- <xs:element name="dataType" type="s7f:byte"/>
- <xs:element name="numElements" type="s7f:short"/>
- <xs:element name="dataBlockNumber" type="s7f:short"/>
- <xs:element name="memoryArea" type="s7f:byte"/>
+ <xs:element name="addressingMode" type="s7:byte"/><!-- fixed="16"-->
+ <xs:element name="dataType" type="s7:byte"/>
+ <xs:element name="numElements" type="s7:short"/>
+ <xs:element name="dataBlockNumber" type="s7:short"/>
+ <xs:element name="memoryArea" type="s7:byte"/>
<!--
The next 3 bytes (24 bits) contain the byte- and bit-offset,
were the last byte contains the bit-offset in the last 3 bits
@@ -672,7 +672,7 @@
<xs:element name="S7ResponseParameterReadVar">
<xs:complexType>
<xs:sequence>
- <xs:element name="numItems" type="s7f:byte"/>
+ <xs:element name="numItems" type="s7:byte"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@ -680,7 +680,7 @@
<xs:element name="S7RequestParameterWriteVar">
<xs:complexType>
<xs:sequence>
- <xs:element name="numItems" type="s7f:byte"/>
+ <xs:element name="numItems" type="s7:byte"/>
<xs:element name="items" minOccurs="0"
dfdl:occursCountKind="expression" dfdl:occursCount="{if(../numItems gt 0) then 1 else 0}">
<xs:complexType>
@@ -689,10 +689,10 @@
dfdl:occursCountKind="expression" dfdl:occursCount="{../../numItems}">
<xs:complexType>
<xs:sequence>
- <xs:element name="type" type="s7f:byte"/>
+ <xs:element name="type" type="s7:byte"/>
<xs:choice dfdl:choiceDispatchKey="{type}">
<xs:element dfdl:choiceBranchKey="18"
- ref="s7f:S7RequestParameterWriteVarAnyItem"/>
+ ref="s7:S7RequestParameterWriteVarAnyItem"/>
</xs:choice>
</xs:sequence>
</xs:complexType>
@@ -707,13 +707,13 @@
<xs:element name="S7RequestParameterWriteVarAnyItem">
<xs:complexType>
<xs:sequence>
- <xs:element name="itemLength" type="s7f:byte"/><!-- fixed="10"-->
+ <xs:element name="itemLength" type="s7:byte"/><!-- fixed="10"-->
<!-- Addressing Mode: Any 0x10 -> 16 -->
- <xs:element name="addressingMode" type="s7f:byte"/><!-- fixed="16"-->
- <xs:element name="dataType" type="s7f:byte"/>
- <xs:element name="numElements" type="s7f:short"/>
- <xs:element name="dataBlockNumber" type="s7f:short"/>
- <xs:element name="memoryArea" type="s7f:byte"/>
+ <xs:element name="addressingMode" type="s7:byte"/><!-- fixed="16"-->
+ <xs:element name="dataType" type="s7:byte"/>
+ <xs:element name="numElements" type="s7:short"/>
+ <xs:element name="dataBlockNumber" type="s7:short"/>
+ <xs:element name="memoryArea" type="s7:byte"/>
<!--
The next 3 bytes (24 bits) contain the byte- and bit-offset,
were the last byte contains the bit-offset in the last 3 bits
@@ -730,7 +730,7 @@
<xs:element name="S7ResponseParameterWriteVar">
<xs:complexType>
<xs:sequence>
- <xs:element name="numItems" type="s7f:byte"/>
+ <xs:element name="numItems" type="s7:byte"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@ -747,21 +747,21 @@
<xs:element name="S7UserDataPayloadCpuServices">
<xs:complexType>
<xs:sequence>
- <xs:element name="returnCode" type="s7f:byte"/>
- <xs:element name="transportSize" type="s7f:byte"/><!-- fixed="9"-->
- <xs:element name="length" type="s7f:short"/>
- <xs:element name="sslId" type="s7f:short" minOccurs="0"
+ <xs:element name="returnCode" type="s7:byte"/>
+ <xs:element name="transportSize" type="s7:byte"/><!-- fixed="9"-->
+ <xs:element name="length" type="s7:short"/>
+ <xs:element name="sslId" type="s7:short" minOccurs="0"
dfdl:occursCountKind="expression"
dfdl:occursCount="{if(../returnCode eq 255) then 1 else 0}"/>
- <xs:element name="sslIndex" type="s7f:short" minOccurs="0"
+ <xs:element name="sslIndex" type="s7:short" minOccurs="0"
dfdl:occursCountKind="expression"
dfdl:occursCount="{if(../returnCode eq 255) then 1 else 0}"/>
<xs:element name="partialList" minOccurs="0"
dfdl:occursCountKind="expression" dfdl:occursCount="{if((../returnCode eq 255) and (../length gt 4)) then 1 else 0}">
<xs:complexType>
<xs:sequence>
- <xs:element name="partialListLengthInBytes" type="s7f:short"/>
- <xs:element name="partialListCount" type="s7f:short"/>
+ <xs:element name="partialListLengthInBytes" type="s7:short"/>
+ <xs:element name="partialListCount" type="s7:short"/>
<xs:element name="sslDataRecords">
<xs:complexType>
<xs:sequence>
@@ -771,7 +771,7 @@
<xs:sequence>
<xs:choice dfdl:choiceDispatchKey="{../../../sslId[1]}">
<xs:element dfdl:choiceBranchKey="17"
- ref="s7f:S7ResponsePayloadCpuServicesSslDataRecordModuleIdentification"/>
+ ref="s7:S7ResponsePayloadCpuServicesSslDataRecordModuleIdentification"/>
</xs:choice>
</xs:sequence>
</xs:complexType>
@@ -789,12 +789,12 @@
<xs:element name="S7ResponsePayloadCpuServicesSslDataRecordModuleIdentification">
<xs:complexType>
<xs:sequence>
- <xs:element name="index" type="s7f:short"/>
+ <xs:element name="index" type="s7:short"/>
<xs:element name="articleNumber" type="xs:string" dfdl:textTrimKind="none" dfdl:alignmentUnits="bytes"
dfdl:lengthKind="explicit" dfdl:lengthUnits="bytes" dfdl:length="20"/>
- <xs:element name="bgType" type="s7f:short"/>
- <xs:element name="moduleOrOsVersion" type="s7f:short"/>
- <xs:element name="pgDescriptionFileVersion" type="s7f:short"/>
+ <xs:element name="bgType" type="s7:short"/>
+ <xs:element name="moduleOrOsVersion" type="s7:short"/>
+ <xs:element name="pgDescriptionFileVersion" type="s7:short"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@ -806,22 +806,22 @@
<xs:complexType>
<xs:sequence>
<!-- The number of items which should be read is transmitted in the matching parameter -->
- <xs:element name="numItems" type="s7f:byte"
+ <xs:element name="numItems" type="s7:byte"
dfdl:inputValueCalc="{
- ../../../../parameters[1]/parameter[dfdl:occursIndex()]/s7f:S7ResponseParameterReadVar/numItems
+ ../../../../parameters[1]/parameter[dfdl:occursIndex()]/s7:S7ResponseParameterReadVar/numItems
}"/>
<xs:element name="item" minOccurs="0"
dfdl:occursCountKind="expression" dfdl:occursCount="{../numItems}">
<xs:complexType>
<xs:sequence>
- <xs:element name="returnCode" type="s7f:byte"/>
- <xs:element name="transportSize" type="s7f:byte"/>
- <xs:element name="rawLength" type="s7f:short"/>
+ <xs:element name="returnCode" type="s7:byte"/>
+ <xs:element name="transportSize" type="s7:byte"/>
+ <xs:element name="rawLength" type="s7:short"/>
<!--
For some reason the types BIT, BYTE_WORD_DWORD and INTEGER are transferred in "bits",
the rest is transferred in "bytes"
-->
- <xs:element name="lengthInBytes" type="s7f:short" dfdl:inputValueCalc="{
+ <xs:element name="lengthInBytes" type="s7:short" dfdl:inputValueCalc="{
if((../transportSize eq 3) or (../transportSize eq 4) or (../transportSize eq 5))
then fn:ceiling(../rawLength div 8)
else ../rawLength}"/>
@@ -832,7 +832,7 @@
Transport sizes: BIT, BYTE_WORD_DWORD and OCTET_STRING require a blank byte.
However only if this is not the last item in the result.
-->
- <xs:element name="fillByte" type="s7f:byte" minOccurs="0"
+ <xs:element name="fillByte" type="s7:byte" minOccurs="0"
dfdl:occursCountKind="expression" dfdl:occursCount="{
if((../lengthInBytes eq 1) and
(dfdl:occursIndex() ne ../../numItems)) then 1 else 0}"/>
@@ -847,22 +847,22 @@
<xs:complexType>
<xs:sequence>
<!-- The number of items which should be read is transmitted in the matching parameter -->
- <xs:element name="numItems" type="s7f:byte"
+ <xs:element name="numItems" type="s7:byte"
dfdl:inputValueCalc="{
- ../../../../parameters[1]/parameter[dfdl:occursIndex()]/s7f:S7RequestParameterWriteVar/numItems
+ ../../../../parameters[1]/parameter[dfdl:occursIndex()]/s7:S7RequestParameterWriteVar/numItems
}"/>
<xs:element name="item" minOccurs="0"
dfdl:occursCountKind="expression" dfdl:occursCount="{../numItems}">
<xs:complexType>
<xs:sequence>
- <xs:element name="returnCode" type="s7f:byte"/>
- <xs:element name="transportSize" type="s7f:byte"/>
- <xs:element name="rawLength" type="s7f:short"/>
+ <xs:element name="returnCode" type="s7:byte"/>
+ <xs:element name="transportSize" type="s7:byte"/>
+ <xs:element name="rawLength" type="s7:short"/>
<!--
For some reason the types BIT, BYTE_WORD_DWORD and INTEGER are transferred in "bits",
the rest is transferred in "bytes"
-->
- <xs:element name="lengthInBytes" type="s7f:short" dfdl:inputValueCalc="{
+ <xs:element name="lengthInBytes" type="s7:short" dfdl:inputValueCalc="{
if((../transportSize eq 3) or (../transportSize eq 4) or (../transportSize eq 5))
then fn:ceiling(../rawLength div 8)
else ../rawLength}"/>
@@ -876,7 +876,7 @@
Actually the S7 device will never process data that contains more
than one item in a write request, so this is rather a cosmetic fine-tuning.
-->
- <xs:element name="fillByte" type="s7f:byte" minOccurs="0"
+ <xs:element name="fillByte" type="s7:byte" minOccurs="0"
dfdl:occursCountKind="expression" dfdl:occursCount="{
if((../lengthInBytes eq 1) and
(dfdl:occursIndex() ne ../../numItems)) then 1 else 0}"/>
@@ -891,15 +891,15 @@
<xs:complexType>
<xs:sequence>
<!-- The number of items which should be read is transmitted in the matching parameter -->
- <xs:element name="numItems" type="s7f:byte"
+ <xs:element name="numItems" type="s7:byte"
dfdl:inputValueCalc="{
- ../../../../parameters[1]/parameter[dfdl:occursIndex()]/s7f:S7ResponseParameterWriteVar/numItems
+ ../../../../parameters[1]/parameter[dfdl:occursIndex()]/s7:S7ResponseParameterWriteVar/numItems
}"/>
<xs:element name="item" minOccurs="0"
dfdl:occursCountKind="expression" dfdl:occursCount="{../numItems}">
<xs:complexType>
<xs:sequence>
- <xs:element name="returnCode" type="s7f:byte"/>
+ <xs:element name="returnCode" type="s7:byte"/>
</xs:sequence>
</xs:complexType>
</xs:element>
diff --git a/protocols/s7/src/main/resources/org/apache/plc4x/protocols/s7/protocol.scxml.xml b/protocols/s7/src/main/resources/org/apache/plc4x/protocols/s7/protocol.scxml.xml
new file mode 100644
index 0000000..1073a0b
--- /dev/null
+++ b/protocols/s7/src/main/resources/org/apache/plc4x/protocols/s7/protocol.scxml.xml
@@ -0,0 +1,432 @@
+<!--
+ 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.
+ -->
+<scxml xmlns="http://www.w3.org/2005/07/scxml"
+ version="1.0"
+ xmlns:plc4x="https://plc4x.apache.org/scxml-extension"
+ xmlns:s7="http://plc4x.apache.org/s7"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ initial="init"
+ datamodel="jexl"
+ xsi:schemaLocation="http://www.w3.org/2005/07/scxml http://www.w3.org/2011/04/SCXML/scxml.xsd">
+
+ <state id="init">
+ <onentry>
+ <!-- Setup the initial content of the connection context (Callback in the driver) -->
+ <plc4x:initContext/>
+ <plc4x:connect type="tcp" host="{connection-host}" port="{connection-port}"/>
+ </onentry>
+ <initial>
+ <transition target="connect"/>
+ </initial>
+ <onentry>
+ <log expr="'Connecting'"/>
+ </onentry>
+ </state>
+
+ <state id="connect">
+ <initial>
+ <transition target="sendCotpConnectionRequest"/>
+ </initial>
+
+ <state id="sendCotpConnectionRequest">
+ <onentry>
+ <plc4x:send>
+ <s7:tpktMessage>
+ <magicByte>3</magicByte>
+ <reserved>0</reserved>
+ <length>18</length>
+ <userData>
+ <headerLength>17</headerLength>
+ <type>224</type>
+ <CotpTpduConnectionRequest>
+ <destinationReference>1</destinationReference>
+ <!-- Insert the value for "cotp-local-reference" as short here -->
+ <sourceReference><plc4x:insert type="s7:short" name="cotp-local-reference"/></sourceReference>
+ <protocolClass>0</protocolClass>
+ <parameters>
+ <parameter>
+ <type>193</type>
+ <parameterLength>2</parameterLength>
+ <CotpParameterCallingTsap>
+ <tsapId><plc4x:insert type="s7:short" name="cotp-calling-tsap"/></tsapId>
+ </CotpParameterCallingTsap>
+ </parameter>
+ <parameter>
+ <type>194</type>
+ <parameterLength>2</parameterLength>
+ <CotpParameterCalledTsap>
+ <tsapId><plc4x:insert type="s7:short" name="cotp-called-tsap"/></tsapId>
+ </CotpParameterCalledTsap>
+ </parameter>
+ <parameter>
+ <type>192</type>
+ <parameterLength>1</parameterLength>
+ <CotpParameterTpduSize>
+ <tpduSize><plc4x:insert type="s7:byte" name="cotp-tpdu-size"/></tpduSize>
+ </CotpParameterTpduSize>
+ </parameter>
+ </parameters>
+ </CotpTpduConnectionRequest>
+ </userData>
+ </s7:tpktMessage>
+ </plc4x:send>
+ </onentry>
+ <transition target="receiveCotpConnectionResponse"/>
+ </state>
+
+ <state id="receiveCotpConnectionResponse">
+ <onentry>
+ <plc4x:receive timeout="5000">
+ <s7:tpktMessage>
+ <magicByte>3</magicByte>
+ <reserved>0</reserved>
+ <!-- Just ignore the content of this field, we don't care about it as it's only required for parsing. -->
+ <length><plc4x:ignore/></length>
+ <userData>
+ <!-- Just ignore the content of this field, we don't care about it as it's only required for parsing. -->
+ <headerLength><plc4x:ignore/></headerLength>
+ <type>208</type>
+ <CotpTpduConnectionResponse>
+ <!-- Make sure the reply uses the same reference as we used in the request. -->
+ <destinationReference><plc4x:verify type="s7:short" name="cotp-local-reference"/></destinationReference>
+ <!-- Extract the reference the remote would like us to use in this session. -->
+ <sourceReference><plc4x:extract type="s7:short" name="cotp-remote-reference"/></sourceReference>
+ <protocolClass>0</protocolClass>
+ <parameters>
+ <!--
+ These elements might be transferred in alternate order, we just care about all of them being
+ transferred.
+ -->
+ <plc4x:unordered>
+ <parameter>
+ <type>192</type>
+ <parameterLength>1</parameterLength>
+ <CotpParameterTpduSize>
+ <tpduSize><plc4x:extract type="s7:byte" name="cotp-tpdu-size"/></tpduSize>
+ </CotpParameterTpduSize>
+ </parameter>
+ <parameter>
+ <type>193</type>
+ <parameterLength>2</parameterLength>
+ <CotpParameterCallingTsap>
+ <tsapId><plc4x:extract type="s7:short" name="cotp-calling-tsap"/></tsapId>
+ </CotpParameterCallingTsap>
+ </parameter>
+ <parameter>
+ <type>194</type>
+ <parameterLength>2</parameterLength>
+ <CotpParameterCalledTsap>
+ <tsapId><plc4x:extract type="s7:short" name="cotp-called-tsap"/></tsapId>
+ </CotpParameterCalledTsap>
+ </parameter>
+ <!-- The remote might be passing other parameters, we'll just ignore them for now -->
+ <plc4x:ignore/>
+ </plc4x:unordered>
+ </parameters>
+ </CotpTpduConnectionResponse>
+ </userData>
+ </s7:tpktMessage>
+ </plc4x:receive>
+ </onentry>
+ <transition cond="" target="sendS7SetupCommunicationRequest"/>
+ <transition cond="" target="error"/>
+ </state>
+
+ <state id="sendS7SetupCommunicationRequest">
+ <onentry>
+ <plc4x:send>
+ <s7:tpktMessage>
+ <magicByte>3</magicByte>
+ <reserved>0</reserved>
+ <length>25</length>
+ <userData>
+ <headerLength>2</headerLength>
+ <type>240</type>
+ <CotpTpduData>
+ <endOfTransmission>1</endOfTransmission>
+ <tpduRef>0</tpduRef>
+ </CotpTpduData>
+ <userData>
+ <magicByte>50</magicByte>
+ <type>1</type>
+ <S7RequestMessage>
+ <reserved>0</reserved>
+ <tpduReference>0</tpduReference>
+ <parametersLength>8</parametersLength>
+ <payloadsLength>0</payloadsLength>
+ <parameters>
+ <parameter>
+ <type>240</type>
+ <S7GeneralParameterSetupCommunication>
+ <reserved>0</reserved>
+ <maxAmqCaller><plc4x:insert type="s7:short" name="s7-max-amq-caller"/></maxAmqCaller>
+ <maxAmqCallee><plc4x:insert type="s7:short" name="s7-max-amq-callee"/></maxAmqCallee>
+ <pduLength><plc4x:insert type="s7:short" name="s7-pdu-length"/></pduLength>
+ </S7GeneralParameterSetupCommunication>
+ </parameter>
+ </parameters>
+ <payloads>
+ <payload>
+ <S7GeneralPayloadSetupCommunication/>
+ </payload>
+ </payloads>
+ </S7RequestMessage>
+ </userData>
+ </userData>
+ </s7:tpktMessage>
+ </plc4x:send>
+ </onentry>
+ <transition target="receiveS7SetupCommunicationResponse"/>
+ </state>
+
+ <state id="receiveS7SetupCommunicationResponse">
+ <onentry>
+ <plc4x:receive timeout="5000">
+ <s7:tpktMessage>
+ <magicByte>3</magicByte>
+ <reserved>0</reserved>
+ <length><plc4x:ignore/></length>
+ <userData>
+ <headerLength>2</headerLength>
+ <type>240</type>
+ <CotpTpduData>
+ <endOfTransmission>1</endOfTransmission>
+ <tpduRef>0</tpduRef>
+ </CotpTpduData>
+ <userData>
+ <magicByte>50</magicByte>
+ <type>3</type>
+ <S7ResponseMessage>
+ <reserved>0</reserved>
+ <tpduReference>0</tpduReference>
+ <parametersLength><plc4x:ignore/></parametersLength>
+ <payloadsLength>0</payloadsLength>
+ <errorClass><plc4x:ignore/></errorClass>
+ <errorCode><plc4x:extract/></errorCode>
+ <parameters>
+ <plc4x:unordered>
+ <parameter>
+ <type>240</type>
+ <S7GeneralParameterSetupCommunication>
+ <reserved>0</reserved>
+ <maxAmqCaller><plc4x:extract type="s7:short" name="s7-max-amq-caller"/></maxAmqCaller>
+ <maxAmqCallee><plc4x:extract type="s7:short" name="s7-max-amq-callee"/></maxAmqCallee>
+ <pduLength><plc4x:extract type="s7:short" name="s7-pdu-length"/></pduLength>
+ </S7GeneralParameterSetupCommunication>
+ </parameter>
+ <plc4x:ignore/>
+ </plc4x:unordered>
+ </parameters>
+ <payloads>
+ <payload>
+ <S7GeneralPayloadSetupCommunication/>
+ </payload>
+ </payloads>
+ </S7ResponseMessage>
+ </userData>
+ </userData>
+ </s7:tpktMessage>
+ </plc4x:receive>
+ </onentry>
+ <transition cond="{type == null}" target="sendS7IdentificationRequest"/>
+ <transition cond="{type != null}" target="connected"/>
+ <transition cond="" target="error"/>
+ </state>
+
+ <state id="sendS7IdentificationRequest">
+ <onentry>
+ <plc4x:send>
+ <s7:tpktMessage>
+ <magicByte>3</magicByte>
+ <reserved>0</reserved>
+ <length>33</length>
+ <userData>
+ <headerLength>2</headerLength>
+ <type>240</type>
+ <CotpTpduData>
+ <endOfTransmission>1</endOfTransmission>
+ <tpduRef>0</tpduRef>
+ </CotpTpduData>
+ <userData>
+ <magicByte>50</magicByte>
+ <type>7</type>
+ <S7UserDataMessage>
+ <reserved>0</reserved>
+ <tpduReference>256</tpduReference>
+ <parametersLength>8</parametersLength>
+ <payloadsLength>8</payloadsLength>
+ <parameters>
+ <parameter>
+ <type>0</type>
+ <S7UserDataParameterCPUService>
+ <header>274</header>
+ <paramLength>4</paramLength>
+ <typeCode>17</typeCode>
+ <type>4</type>
+ <functionGroup>4</functionGroup>
+ <subFunctionGroup>1</subFunctionGroup>
+ <sequenceNumber>0</sequenceNumber>
+ </S7UserDataParameterCPUService>
+ </parameter>
+ </parameters>
+ <payloads>
+ <payload>
+ <S7UserDataPayloadCpuServices>
+ <returnCode>255</returnCode>
+ <transportSize>9</transportSize>
+ <length>4</length>
+ <sslId>17</sslId>
+ <sslIndex>0</sslIndex>
+ </S7UserDataPayloadCpuServices>
+ </payload>
+ </payloads>
+ </S7UserDataMessage>
+ </userData>
+ </userData>
+ </s7:tpktMessage>
+ </plc4x:send>
+ </onentry>
+ <transition target="receiveS7IdentificationRequest"/>
+ </state>
+
+ <state id="receiveS7IdentificationRequest">
+ <onentry>
+ <plc4x:receive>
+ <s7:tpktMessage>
+ <magicByte>3</magicByte>
+ <reserved>0</reserved>
+ <length><plc4x:ignore/></length>
+ <userData>
+ <headerLength>2</headerLength>
+ <type>240</type>
+ <CotpTpduData>
+ <endOfTransmission>1</endOfTransmission>
+ <tpduRef>0</tpduRef>
+ </CotpTpduData>
+ <userData>
+ <magicByte>50</magicByte>
+ <type>7</type>
+ <S7UserDataMessage>
+ <reserved>0</reserved>
+ <tpduReference>256</tpduReference>
+ <parametersLength><plc4x:ignore/></parametersLength>
+ <payloadsLength><plc4x:ignore/></payloadsLength>
+ <parameters>
+ <plc4x:unordered>
+ <parameter>
+ <type>0</type>
+ <S7UserDataParameterCPUService>
+ <header>274</header>
+ <paramLength>8</paramLength>
+ <typeCode>18</typeCode>
+ <type>8</type>
+ <functionGroup>4</functionGroup>
+ <subFunctionGroup>1</subFunctionGroup>
+ <sequenceNumber>2</sequenceNumber>
+ <dataUnitReferenceNumber>0</dataUnitReferenceNumber>
+ <lastDataUnit>0</lastDataUnit>
+ <errorCode>0</errorCode>
+ </S7UserDataParameterCPUService>
+ </parameter>
+ <plc4x:ignore/>
+ </plc4x:unordered>
+ </parameters>
+ <payloads>
+ <plc4x:unordered>
+ <payload>
+ <S7UserDataPayloadCpuServices>
+ <returnCode>255</returnCode>
+ <transportSize>9</transportSize>
+ <length>120</length>
+ <sslId>17</sslId>
+ <sslIndex>0</sslIndex>
+ <partialList>
+ <partialListLengthInBytes>28</partialListLengthInBytes>
+ <partialListCount>4</partialListCount>
+ <sslDataRecords>
+ <plc4x:unordered>
+ <sslDataRecord>
+ <S7ResponsePayloadCpuServicesSslDataRecordModuleIdentification>
+ <index>1</index>
+ <articleNumber><plc4x:extract type="s7:short" name="s7-ssl-1"/></articleNumber>
+ <bgType>192</bgType>
+ <moduleOrOsVersion>3</moduleOrOsVersion>
+ <pgDescriptionFileVersion>1</pgDescriptionFileVersion>
+ </S7ResponsePayloadCpuServicesSslDataRecordModuleIdentification>
+ </sslDataRecord>
+ <sslDataRecord>
+ <S7ResponsePayloadCpuServicesSslDataRecordModuleIdentification>
+ <index>6</index>
+ <articleNumber><plc4x:extract type="s7:short" name="s7-ssl-6"/></articleNumber>
+ <bgType>192</bgType>
+ <moduleOrOsVersion>3</moduleOrOsVersion>
+ <pgDescriptionFileVersion>1</pgDescriptionFileVersion>
+ </S7ResponsePayloadCpuServicesSslDataRecordModuleIdentification>
+ </sslDataRecord>
+ <sslDataRecord>
+ <S7ResponsePayloadCpuServicesSslDataRecordModuleIdentification>
+ <index>7</index>
+ <articleNumber><plc4x:extract type="s7:short" name="s7-ssl-7"/></articleNumber>
+ <bgType>192</bgType>
+ <moduleOrOsVersion>22019</moduleOrOsVersion>
+ <pgDescriptionFileVersion>519</pgDescriptionFileVersion>
+ </S7ResponsePayloadCpuServicesSslDataRecordModuleIdentification>
+ </sslDataRecord>
+ <sslDataRecord>
+ <S7ResponsePayloadCpuServicesSslDataRecordModuleIdentification>
+ <index>129</index>
+ <articleNumber><plc4x:extract type="s7:short" name="s7-ssl-129"/></articleNumber>
+ <bgType>0</bgType>
+ <moduleOrOsVersion>16672</moduleOrOsVersion>
+ <pgDescriptionFileVersion>2313</pgDescriptionFileVersion>
+ </S7ResponsePayloadCpuServicesSslDataRecordModuleIdentification>
+ </sslDataRecord>
+ <plc4x:ignore/>
+ </plc4x:unordered>
+ </sslDataRecords>
+ </partialList>
+ </S7UserDataPayloadCpuServices>
+ </payload>
+ <plc4x:ignore/>
+ </plc4x:unordered>
+ </payloads>
+ </S7UserDataMessage>
+ </userData>
+ </userData>
+ </s7:tpktMessage>
+ </plc4x:receive>
+ </onentry>
+ <transition cond="" target="connected"/>
+ <transition cond="" target="error"/>
+ </state>
+
+ <final id="connected">
+ <onentry>
+ <log expr="'Connected'"/>
+ </onentry>
+ </final>
+
+ <final id="error">
+ <onentry>
+ <log expr="'Error connecting'"/>
+ </onentry>
+ </final>
+ </state>
+
+</scxml>
\ No newline at end of file
diff --git a/protocols/s7/src/test/java/org/apache/plc4x/protocols/CotpProtocolTest.java b/protocols/s7/src/test/java/org/apache/plc4x/protocols/CotpProtocolTest.java
deleted file mode 100644
index 507e65c..0000000
--- a/protocols/s7/src/test/java/org/apache/plc4x/protocols/CotpProtocolTest.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- 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 org.apache.plc4x.protocols;
-
-/**
- * Executes all tests for the ISO on TCP / TPKT protocol.
- */
-public class CotpProtocolTest extends AbstractProtocolTest {
-
- public CotpProtocolTest() {
- super("org/apache/plc4x/protocols/cotp-protocol.tdml");
- }
-
-}
diff --git a/protocols/s7/src/test/java/org/apache/plc4x/protocols/S7FullStackProtocolTest.java b/protocols/s7/src/test/java/org/apache/plc4x/protocols/S7FullStackProtocolTest.java
deleted file mode 100644
index ddee1e7..0000000
--- a/protocols/s7/src/test/java/org/apache/plc4x/protocols/S7FullStackProtocolTest.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- 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 org.apache.plc4x.protocols;
-
-/**
- * Executes all tests for the ISO on TCP / TPKT protocol.
- */
-public class S7FullStackProtocolTest extends AbstractProtocolTest {
-
- public S7FullStackProtocolTest() {
- super("org/apache/plc4x/protocols/s7-full-stack-protocol.tdml");
- }
-
-}
diff --git a/protocols/s7/src/test/java/org/apache/plc4x/protocols/TpktProtocolTest.java b/protocols/s7/src/test/java/org/apache/plc4x/protocols/s7/ProtocolTest.java
similarity index 77%
rename from protocols/s7/src/test/java/org/apache/plc4x/protocols/TpktProtocolTest.java
rename to protocols/s7/src/test/java/org/apache/plc4x/protocols/s7/ProtocolTest.java
index f67dbb1..a7816e4 100644
--- a/protocols/s7/src/test/java/org/apache/plc4x/protocols/TpktProtocolTest.java
+++ b/protocols/s7/src/test/java/org/apache/plc4x/protocols/s7/ProtocolTest.java
@@ -17,15 +17,17 @@
under the License.
*/
-package org.apache.plc4x.protocols;
+package org.apache.plc4x.protocols.s7;
+
+import org.apache.plc4x.protocols.AbstractProtocolTest;
/**
* Executes all tests for the ISO on TCP / TPKT protocol.
*/
-public class TpktProtocolTest extends AbstractProtocolTest {
+public class ProtocolTest extends AbstractProtocolTest {
- public TpktProtocolTest() {
- super("org/apache/plc4x/protocols/tpkt-protocol.tdml");
+ public ProtocolTest() {
+ super("org/apache/plc4x/protocols/s7/protocol.tdml");
}
}
diff --git a/protocols/s7/src/test/resources/org/apache/plc4x/protocols/cotp-protocol.tdml b/protocols/s7/src/test/resources/org/apache/plc4x/protocols/cotp-protocol.tdml
deleted file mode 100644
index a85cfdc..0000000
--- a/protocols/s7/src/test/resources/org/apache/plc4x/protocols/cotp-protocol.tdml
+++ /dev/null
@@ -1,538 +0,0 @@
-<?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.
- -->
-
-<testSuite xmlns:dfdl="http://www.ogf.org/dfdl/dfdl-1.0/"
- xmlns:test="plc4x-protocol-test"
- xmlns:tdml="http://www.ibm.com/xmlns/dfdl/testData"
- xmlns:cotp="http://plc4x.apache.org/cotp"
- xmlns:xs="http://www.w3.org/2001/XMLSchema"
- suiteName="COTP protocol (ISOTp)"
- description="Testsuite for the COTP protocol"
- defaultRoundTrip="true">
-
- <tdml:defineSchema name="cotpSchema" elementFormDefault="unqualified">
- <!-- Import the Schema -->
- <xs:import namespace="http://plc4x.apache.org/cotp"
- schemaLocation="cotp-protocol.dfdl.xsd"/>
-
- <!-- Import the format settings -->
- <dfdl:format ref="cotp:cotpFormat"/>
-
- <!-- Define the root element name and type -->
- <xs:element name="cotpMessage" type="cotp:CotpMessageType"/>
- </tdml:defineSchema>
-
- <!--
-
- Tests for the basic TPDU types (no parameters)
-
- -->
-
- <tdml:parserTestCase name="typeConnectionRequest"
- root="cotpMessage"
- model="cotpSchema"
- description="Minimal valid COTP Connection Request TPDU">
- <!-- Define the input -->
- <tdml:document>
- <tdml:documentPart type="byte">06E00001000200</tdml:documentPart>
- </tdml:document>
-
- <!-- Define the expected output -->
- <tdml:infoset>
- <tdml:dfdlInfoset>
- <test:cotpMessage>
- <headerLength>6</headerLength>
- <type>224</type>
- <CotpTpduConnectionRequest>
- <destinationReference>1</destinationReference>
- <sourceReference>2</sourceReference>
- <protocolClass>0</protocolClass>
- </CotpTpduConnectionRequest>
- <userData/>
- </test:cotpMessage>
- </tdml:dfdlInfoset>
- </tdml:infoset>
- </tdml:parserTestCase>
-
- <tdml:parserTestCase name="typeConnectionResponse"
- root="cotpMessage"
- model="cotpSchema"
- description="Minimal valid COTP Connection Response TPDU">
- <!-- Define the input -->
- <tdml:document>
- <tdml:documentPart type="byte">06D00001000200</tdml:documentPart>
- </tdml:document>
-
- <!-- Define the expected output -->
- <tdml:infoset>
- <tdml:dfdlInfoset>
- <test:cotpMessage>
- <headerLength>6</headerLength>
- <type>208</type>
- <CotpTpduConnectionResponse>
- <destinationReference>1</destinationReference>
- <sourceReference>2</sourceReference>
- <protocolClass>0</protocolClass>
- </CotpTpduConnectionResponse>
- <userData/>
- </test:cotpMessage>
- </tdml:dfdlInfoset>
- </tdml:infoset>
- </tdml:parserTestCase>
-
- <tdml:parserTestCase name="typeDisconnectionRequest"
- root="cotpMessage"
- model="cotpSchema"
- description="Minimal valid COTP Disconnection Request TPDU">
- <!-- Define the input -->
- <tdml:document>
- <tdml:documentPart type="byte">06800001000200</tdml:documentPart>
- </tdml:document>
-
- <!-- Define the expected output -->
- <tdml:infoset>
- <tdml:dfdlInfoset>
- <test:cotpMessage>
- <headerLength>6</headerLength>
- <type>128</type>
- <CotpTpduDisconnectRequest>
- <destinationReference>1</destinationReference>
- <sourceReference>2</sourceReference>
- <disconnectReason>0</disconnectReason>
- </CotpTpduDisconnectRequest>
- <userData/>
- </test:cotpMessage>
- </tdml:dfdlInfoset>
- </tdml:infoset>
- </tdml:parserTestCase>
-
- <tdml:parserTestCase name="typeDisconnectionResponse"
- root="cotpMessage"
- model="cotpSchema"
- description="Minimal valid COTP Disconnection Response TPDU">
- <!-- Define the input -->
- <tdml:document>
- <tdml:documentPart type="byte">05C000010002</tdml:documentPart>
- </tdml:document>
-
- <!-- Define the expected output -->
- <tdml:infoset>
- <tdml:dfdlInfoset>
- <test:cotpMessage>
- <headerLength>5</headerLength>
- <type>192</type>
- <CotpTpduDisconnectResponse>
- <destinationReference>1</destinationReference>
- <sourceReference>2</sourceReference>
- </CotpTpduDisconnectResponse>
- <userData/>
- </test:cotpMessage>
- </tdml:dfdlInfoset>
- </tdml:infoset>
- </tdml:parserTestCase>
-
- <tdml:parserTestCase name="typeError"
- root="cotpMessage"
- model="cotpSchema"
- description="Minimal valid COTP Error TPDU">
- <!-- Define the input -->
- <tdml:document>
- <tdml:documentPart type="byte">0470000102</tdml:documentPart>
- </tdml:document>
-
- <!-- Define the expected output -->
- <tdml:infoset>
- <tdml:dfdlInfoset>
- <test:cotpMessage>
- <headerLength>4</headerLength>
- <type>112</type>
- <CotpTpduError>
- <destinationReference>1</destinationReference>
- <rejectCause>2</rejectCause>
- </CotpTpduError>
- <userData/>
- </test:cotpMessage>
- </tdml:dfdlInfoset>
- </tdml:infoset>
- </tdml:parserTestCase>
-
- <tdml:parserTestCase name="typeData"
- root="cotpMessage"
- model="cotpSchema"
- description="Minimal valid COTP Data TPDU">
- <!-- Define the input -->
- <tdml:document>
- <tdml:documentPart type="byte">02F002</tdml:documentPart>
- </tdml:document>
-
- <!-- Define the expected output -->
- <tdml:infoset>
- <tdml:dfdlInfoset>
- <test:cotpMessage>
- <headerLength>2</headerLength>
- <type>240</type>
- <CotpTpduData>
- <endOfTransmission>0</endOfTransmission>
- <tpduRef>2</tpduRef>
- </CotpTpduData>
- <userData/>
- </test:cotpMessage>
- </tdml:dfdlInfoset>
- </tdml:infoset>
- </tdml:parserTestCase>
-
- <tdml:parserTestCase name="typeDataEndOfTransmission"
- root="cotpMessage"
- model="cotpSchema"
- description="Minimal valid COTP Data (End Of Transmission) TPDU">
- <!-- Define the input -->
- <tdml:document>
- <tdml:documentPart type="byte">02F082</tdml:documentPart>
- </tdml:document>
-
- <!-- Define the expected output -->
- <tdml:infoset>
- <tdml:dfdlInfoset>
- <test:cotpMessage>
- <headerLength>2</headerLength>
- <type>240</type>
- <CotpTpduData>
- <endOfTransmission>1</endOfTransmission>
- <tpduRef>2</tpduRef>
- </CotpTpduData>
- <userData/>
- </test:cotpMessage>
- </tdml:dfdlInfoset>
- </tdml:infoset>
- </tdml:parserTestCase>
-
- <!--
-
- Tests for the parameter types.
-
- -->
-
- <tdml:parserTestCase name="parameterTpduSize"
- root="cotpMessage"
- model="cotpSchema"
- description="parameterTpduSize">
- <!-- Define the input -->
- <tdml:document>
- <tdml:documentPart type="byte">09E00001000200C00109</tdml:documentPart>
- </tdml:document>
-
- <!-- Define the expected output -->
- <tdml:infoset>
- <tdml:dfdlInfoset>
- <test:cotpMessage>
- <headerLength>9</headerLength>
- <type>224</type>
- <CotpTpduConnectionRequest>
- <destinationReference>1</destinationReference>
- <sourceReference>2</sourceReference>
- <protocolClass>0</protocolClass>
- <parameters>
- <parameter>
- <type>192</type>
- <parameterLength>1</parameterLength>
- <CotpParameterTpduSize>
- <tpduSize>9</tpduSize>
- </CotpParameterTpduSize>
- </parameter>
- </parameters>
- </CotpTpduConnectionRequest>
- <userData/>
- </test:cotpMessage>
- </tdml:dfdlInfoset>
- </tdml:infoset>
- </tdml:parserTestCase>
-
- <tdml:parserTestCase name="parameterCallingTsap"
- root="cotpMessage"
- model="cotpSchema"
- description="parameterCallingTsap">
- <!-- Define the input -->
- <tdml:document>
- <tdml:documentPart type="byte">0AE00001000200C1020009</tdml:documentPart>
- </tdml:document>
-
- <!-- Define the expected output -->
- <tdml:infoset>
- <tdml:dfdlInfoset>
- <test:cotpMessage>
- <headerLength>10</headerLength>
- <type>224</type>
- <CotpTpduConnectionRequest>
- <destinationReference>1</destinationReference>
- <sourceReference>2</sourceReference>
- <protocolClass>0</protocolClass>
- <parameters>
- <parameter>
- <type>193</type>
- <parameterLength>2</parameterLength>
- <CotpParameterCallingTsap>
- <tsapId>9</tsapId>
- </CotpParameterCallingTsap>
- </parameter>
- </parameters>
- </CotpTpduConnectionRequest>
- <userData/>
- </test:cotpMessage>
- </tdml:dfdlInfoset>
- </tdml:infoset>
- </tdml:parserTestCase>
-
- <tdml:parserTestCase name="parameterCalledTsap"
- root="cotpMessage"
- model="cotpSchema"
- description="parameterCalledTsap">
- <!-- Define the input -->
- <tdml:document>
- <tdml:documentPart type="byte">0AE00001000200C2020009</tdml:documentPart>
- </tdml:document>
-
- <!-- Define the expected output -->
- <tdml:infoset>
- <tdml:dfdlInfoset>
- <test:cotpMessage>
- <headerLength>10</headerLength>
- <type>224</type>
- <CotpTpduConnectionRequest>
- <destinationReference>1</destinationReference>
- <sourceReference>2</sourceReference>
- <protocolClass>0</protocolClass>
- <parameters>
- <parameter>
- <type>194</type>
- <parameterLength>2</parameterLength>
- <CotpParameterCalledTsap>
- <tsapId>9</tsapId>
- </CotpParameterCalledTsap>
- </parameter>
- </parameters>
- </CotpTpduConnectionRequest>
- <userData/>
- </test:cotpMessage>
- </tdml:dfdlInfoset>
- </tdml:infoset>
- </tdml:parserTestCase>
-
- <tdml:parserTestCase name="parameterChecksum"
- root="cotpMessage"
- model="cotpSchema"
- description="parameterChecksum">
- <!-- Define the input -->
- <tdml:document>
- <tdml:documentPart type="byte">09E00001000200C30109</tdml:documentPart>
- </tdml:document>
-
- <!-- Define the expected output -->
- <tdml:infoset>
- <tdml:dfdlInfoset>
- <test:cotpMessage>
- <headerLength>9</headerLength>
- <type>224</type>
- <CotpTpduConnectionRequest>
- <destinationReference>1</destinationReference>
- <sourceReference>2</sourceReference>
- <protocolClass>0</protocolClass>
- <parameters>
- <parameter>
- <type>195</type>
- <parameterLength>1</parameterLength>
- <CotpParameterChecksum>
- <checksum>9</checksum>
- </CotpParameterChecksum>
- </parameter>
- </parameters>
- </CotpTpduConnectionRequest>
- <userData/>
- </test:cotpMessage>
- </tdml:dfdlInfoset>
- </tdml:infoset>
- </tdml:parserTestCase>
-
- <tdml:parserTestCase name="parameterDisconnectAdditionalInformation"
- root="cotpMessage"
- model="cotpSchema"
- description="parameterDisconnectAdditionalInformation">
- <!-- Define the input -->
- <tdml:document>
- <tdml:documentPart type="byte">0EE00001000200E006010203040506</tdml:documentPart>
- </tdml:document>
-
- <!-- Define the expected output -->
- <tdml:infoset>
- <tdml:dfdlInfoset>
- <test:cotpMessage>
- <headerLength>14</headerLength>
- <type>224</type>
- <CotpTpduConnectionRequest>
- <destinationReference>1</destinationReference>
- <sourceReference>2</sourceReference>
- <protocolClass>0</protocolClass>
- <parameters>
- <parameter>
- <type>224</type>
- <parameterLength>6</parameterLength>
- <CotpParameterDisconnectAdditionalInformation>
- <data>010203040506</data>
- </CotpParameterDisconnectAdditionalInformation>
- </parameter>
- </parameters>
- </CotpTpduConnectionRequest>
- <userData/>
- </test:cotpMessage>
- </tdml:dfdlInfoset>
- </tdml:infoset>
- </tdml:parserTestCase>
-
- <!--
-
- Tests for typical packets used in PLC4X
-
- -->
-
- <tdml:parserTestCase name="scenarioConnectionRequest"
- root="cotpMessage"
- model="cotpSchema"
- description="COTP Connection request used for initiating an S7 protocol connection.">
- <!-- Define the input -->
- <tdml:document>
- <tdml:documentPart type="byte">11E00001000200C1020100C2020102c0010a</tdml:documentPart>
- </tdml:document>
-
- <!-- Define the expected output -->
- <tdml:infoset>
- <tdml:dfdlInfoset>
- <test:cotpMessage>
- <headerLength>17</headerLength>
- <type>224</type>
- <CotpTpduConnectionRequest>
- <destinationReference>1</destinationReference>
- <sourceReference>2</sourceReference>
- <protocolClass>0</protocolClass>
- <parameters>
- <parameter>
- <type>193</type>
- <parameterLength>2</parameterLength>
- <CotpParameterCallingTsap>
- <tsapId>256</tsapId>
- </CotpParameterCallingTsap>
- </parameter>
- <parameter>
- <type>194</type>
- <parameterLength>2</parameterLength>
- <CotpParameterCalledTsap>
- <tsapId>258</tsapId>
- </CotpParameterCalledTsap>
- </parameter>
- <parameter>
- <type>192</type>
- <parameterLength>1</parameterLength>
- <CotpParameterTpduSize>
- <tpduSize>10</tpduSize>
- </CotpParameterTpduSize>
- </parameter>
- </parameters>
- </CotpTpduConnectionRequest>
- <userData/>
- </test:cotpMessage>
- </tdml:dfdlInfoset>
- </tdml:infoset>
- </tdml:parserTestCase>
-
- <tdml:parserTestCase name="scenarioConnectionResponse"
- root="cotpMessage"
- model="cotpSchema"
- description="Minimal valid COTP Message">
- <!-- Define the input -->
- <tdml:document>
- <tdml:documentPart type="byte">11D00001000200C00109C1020100C2020102</tdml:documentPart>
- </tdml:document>
-
- <!-- Define the expected output -->
- <tdml:infoset>
- <tdml:dfdlInfoset>
- <test:cotpMessage>
- <headerLength>17</headerLength>
- <type>208</type>
- <CotpTpduConnectionResponse>
- <destinationReference>1</destinationReference>
- <sourceReference>2</sourceReference>
- <protocolClass>0</protocolClass>
- <parameters>
- <parameter>
- <type>192</type>
- <parameterLength>1</parameterLength>
- <CotpParameterTpduSize>
- <tpduSize>9</tpduSize>
- </CotpParameterTpduSize>
- </parameter>
- <parameter>
- <type>193</type>
- <parameterLength>2</parameterLength>
- <CotpParameterCallingTsap>
- <tsapId>256</tsapId>
- </CotpParameterCallingTsap>
- </parameter>
- <parameter>
- <type>194</type>
- <parameterLength>2</parameterLength>
- <CotpParameterCalledTsap>
- <tsapId>258</tsapId>
- </CotpParameterCalledTsap>
- </parameter>
- </parameters>
- </CotpTpduConnectionResponse>
- <userData/>
- </test:cotpMessage>
- </tdml:dfdlInfoset>
- </tdml:infoset>
- </tdml:parserTestCase>
-
- <tdml:parserTestCase name="scenarioDataTpdu"
- root="cotpMessage"
- model="cotpSchema"
- description="Typical Data TPDU used for transferring S7 packets.">
- <!-- Define the input -->
- <tdml:document>
- <tdml:documentPart type="byte">02F080320700000300000800080001120411440100ff09000401320004</tdml:documentPart>
- </tdml:document>
-
- <!-- Define the expected output -->
- <tdml:infoset>
- <tdml:dfdlInfoset>
- <test:cotpMessage>
- <headerLength>2</headerLength>
- <type>240</type>
- <CotpTpduData>
- <endOfTransmission>1</endOfTransmission>
- <tpduRef>0</tpduRef>
- </CotpTpduData>
- <userData>320700000300000800080001120411440100FF09000401320004</userData>
- </test:cotpMessage>
- </tdml:dfdlInfoset>
- </tdml:infoset>
- </tdml:parserTestCase>
-
-</testSuite>
-
-
diff --git a/protocols/s7/src/test/resources/org/apache/plc4x/protocols/s7-full-stack-protocol.tdml b/protocols/s7/src/test/resources/org/apache/plc4x/protocols/s7/protocol.tdml
similarity index 99%
rename from protocols/s7/src/test/resources/org/apache/plc4x/protocols/s7-full-stack-protocol.tdml
rename to protocols/s7/src/test/resources/org/apache/plc4x/protocols/s7/protocol.tdml
index c6bd782..e9aff9f 100644
--- a/protocols/s7/src/test/resources/org/apache/plc4x/protocols/s7-full-stack-protocol.tdml
+++ b/protocols/s7/src/test/resources/org/apache/plc4x/protocols/s7/protocol.tdml
@@ -21,16 +21,16 @@
<testSuite xmlns:dfdl="http://www.ogf.org/dfdl/dfdl-1.0/"
xmlns:test="plc4x-protocol-test"
xmlns:tdml="http://www.ibm.com/xmlns/dfdl/testData"
- xmlns:s7="http://plc4x.apache.org/s7-full"
+ xmlns:s7="http://plc4x.apache.org/s7"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
suiteName="S7 protocol (Full-Stack)"
description="Testsuite for the full stack of the S7 protocol"
- defaultRoundTrip="true">
+ defaultRoundTrip="onePass">
<tdml:defineSchema name="s7Schema" elementFormDefault="unqualified">
<!-- Import the Schema -->
- <xs:import namespace="http://plc4x.apache.org/s7-full"
- schemaLocation="s7-full-stack-protocol.dfdl.xsd"/>
+ <xs:import namespace="http://plc4x.apache.org/s7"
+ schemaLocation="protocol.dfdl.xsd"/>
<!-- Import the format settings -->
<dfdl:format ref="s7:s7FullFormat"/>
diff --git a/protocols/s7/src/test/resources/org/apache/plc4x/protocols/tpkt-protocol.tdml b/protocols/s7/src/test/resources/org/apache/plc4x/protocols/tpkt-protocol.tdml
deleted file mode 100644
index e713497..0000000
--- a/protocols/s7/src/test/resources/org/apache/plc4x/protocols/tpkt-protocol.tdml
+++ /dev/null
@@ -1,112 +0,0 @@
-<?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.
- -->
-
-<testSuite xmlns:dfdl="http://www.ogf.org/dfdl/dfdl-1.0/"
- xmlns:test="plc4x-protocol-test"
- xmlns:tdml="http://www.ibm.com/xmlns/dfdl/testData"
- xmlns:tpkt="http://plc4x.apache.org/tpkt"
- xmlns:xs="http://www.w3.org/2001/XMLSchema"
- suiteName="TPKT protocol (ISO-on-TCP)"
- description="Testsuite for the TPKT protocol"
- defaultRoundTrip="true">
-
- <tdml:defineSchema name="tkptSchema" elementFormDefault="unqualified">
- <!-- Import the Schema -->
- <xs:import namespace="http://plc4x.apache.org/tpkt"
- schemaLocation="tpkt-protocol.dfdl.xsd"/>
-
- <!-- Import the format settings -->
- <dfdl:format ref="tpkt:tpktFormat"/>
-
- <!-- Define the root element name and type -->
- <xs:element name="tpktMessage" type="tpkt:TpktMessageType"/>
- </tdml:defineSchema>
-
- <!--
- In this test-case the data should be parsable to a valid result.
- It's a TPKT package containing a COTP connection-response payload.
- -->
- <tdml:parserTestCase name="tpktPacketContainingCotpConnectResponse"
- root="tpktMessage"
- model="tkptSchema"
- description="Simple TKPT packet which contains a COTP Connection-Response as payload.">
- <!-- Define the input -->
- <tdml:document>
- <tdml:documentPart type="byte">0300001611D00001000200C00109C1020100C2020102</tdml:documentPart>
- </tdml:document>
-
- <!-- Define the expected output -->
- <tdml:infoset>
- <tdml:dfdlInfoset>
- <!-- Referencing what we defined as root element in the defineSchema section -->
- <test:tpktMessage>
- <magicByte>3</magicByte>
- <reserved>0</reserved>
- <length>22</length>
- <userData>11D00001000200C00109C1020100C2020102</userData>
- </test:tpktMessage>
- </tdml:dfdlInfoset>
- </tdml:infoset>
- </tdml:parserTestCase>
-
- <!--
- In this test-case the packet doesn't start with the required magic byte 0x03.
- -->
- <tdml:parserTestCase name="invalidMagicByte">
- <tdml:document>
- <tdml:documentPart type="byte">0400001611D00001000200C00109C1020100C2020102</tdml:documentPart>
- </tdml:document>
-
- <tdml:errors>
- <tdml:error>Schema Definition Error</tdml:error>
- </tdml:errors>
- </tdml:parserTestCase>
-
- <!--
- In this test-case the payload of the packet doesn't match the
- length provided in the packet header (Too short)
- -->
- <tdml:parserTestCase name="tooShortPayload">
- <tdml:document>
- <tdml:documentPart type="byte">0300001611D00001000200C00109C102010</tdml:documentPart>
- </tdml:document>
-
- <tdml:errors>
- <tdml:error>Schema Definition Error</tdml:error>
- </tdml:errors>
- </tdml:parserTestCase>
-
- <!--
- In this test-case the payload of the packet doesn't match the
- length provided in the packet header (Too long)
- -->
- <tdml:parserTestCase name="tooLongPayload">
-ยด <tdml:document>
- <tdml:documentPart type="byte">0300001611D00001000200C00109C1020100C20201021234567890</tdml:documentPart>
- </tdml:document>
-
- <tdml:errors>
- <tdml:error>Schema Definition Error</tdml:error>
- </tdml:errors>
- </tdml:parserTestCase>
-
-</testSuite>
-
-