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 2021/08/14 16:48:33 UTC
[plc4x] 02/02: - Fine-tuning of the PR.
This is an automated email from the ASF dual-hosted git repository.
cdutz pushed a commit to branch s7event
in repository https://gitbox.apache.org/repos/asf/plc4x.git
commit c4ea06f9b2f1defdb5e95bfe5dce559f64b7d771
Author: cdutz <ch...@c-ware.de>
AuthorDate: Sat Aug 14 18:48:10 2021 +0200
- Fine-tuning of the PR.
---
.../plc4x/language/java/JavaLanguageOutput.java | 1 -
plc4c/generated-sources/s7/include/s7_parameter.h | 10 +-
.../s7/include/s7_payload_user_data_item.h | 108 +-
plc4c/generated-sources/s7/src/s7_parameter.c | 156 ++-
plc4c/generated-sources/s7/src/s7_payload.c | 2 +-
.../s7/src/s7_payload_user_data_item.c | 1440 ++++++++++++++++++--
.../apache/plc4x/java/s7/events/S7AlarmEvent.java | 38 +-
.../plc4x/java/s7/events/S7CyclicValueEvent.java | 33 +-
.../org/apache/plc4x/java/s7/events/S7Event.java | 33 +-
.../apache/plc4x/java/s7/events/S7ModeEvent.java | 33 +-
.../apache/plc4x/java/s7/events/S7SysEvent.java | 34 +-
.../apache/plc4x/java/s7/events/S7UserEvent.java | 33 +-
.../apache/plc4x/java/s7/readwrite/S7Driver.java | 1 +
.../plc4x/java/s7/readwrite/field/S7SslField.java | 38 +-
.../s7/readwrite/field/S7SubscriptionField.java | 39 +-
.../readwrite/protocol/S7ProtocolEventLogic.java | 10 -
.../readwrite/types/S7SubscriptionFieldType.java | 34 +-
.../readwrite/utils/S7PlcSubscriptionHandle.java | 1 -
.../plc4x/java/s7/utils/S7DiagnosticEventId.java | 31 +-
.../apache/plc4x/java/s7/utils/S7EventHelper.java | 31 +-
.../plc4x/java/s7/utils/S7ParamErrorCode.java | 31 +-
plc4j/examples/plc4j-s7event/pom.xml | 118 +-
.../examples/plc4j/s7event/EventSubscription.java | 150 +-
pom.xml | 2 +-
.../s7/src/main/resources/protocols/s7/s7.mspec | 4 +-
.../resources/protocols/s7/DriverTestsuite.xml | 55 +-
.../protocols/s7/ParserSerializerTestsuite.xml | 50 +-
27 files changed, 2003 insertions(+), 513 deletions(-)
diff --git a/code-generation/language-java/src/main/java/org/apache/plc4x/language/java/JavaLanguageOutput.java b/code-generation/language-java/src/main/java/org/apache/plc4x/language/java/JavaLanguageOutput.java
index 5e404ef..fd05d0d 100644
--- a/code-generation/language-java/src/main/java/org/apache/plc4x/language/java/JavaLanguageOutput.java
+++ b/code-generation/language-java/src/main/java/org/apache/plc4x/language/java/JavaLanguageOutput.java
@@ -25,7 +25,6 @@ import org.apache.plc4x.plugins.codegenerator.types.definitions.TypeDefinition;
import java.io.*;
import java.util.*;
-import org.apache.plc4x.plugins.codegenerator.types.exceptions.GenerationException;
public class JavaLanguageOutput extends FreemarkerLanguageOutput {
diff --git a/plc4c/generated-sources/s7/include/s7_parameter.h b/plc4c/generated-sources/s7/include/s7_parameter.h
index 8b9074e..8fbc56c 100644
--- a/plc4c/generated-sources/s7/include/s7_parameter.h
+++ b/plc4c/generated-sources/s7/include/s7_parameter.h
@@ -50,7 +50,8 @@ enum plc4c_s7_read_write_s7_parameter_type {
plc4c_s7_read_write_s7_parameter_type_plc4c_s7_read_write_s7_parameter_read_var_response = 2,
plc4c_s7_read_write_s7_parameter_type_plc4c_s7_read_write_s7_parameter_write_var_request = 3,
plc4c_s7_read_write_s7_parameter_type_plc4c_s7_read_write_s7_parameter_write_var_response = 4,
- plc4c_s7_read_write_s7_parameter_type_plc4c_s7_read_write_s7_parameter_user_data = 5};
+ plc4c_s7_read_write_s7_parameter_type_plc4c_s7_read_write_s7_parameter_user_data = 5,
+ plc4c_s7_read_write_s7_parameter_type_plc4c_s7_read_write_s7_parameter_mode_transition = 6};
typedef enum plc4c_s7_read_write_s7_parameter_type plc4c_s7_read_write_s7_parameter_type;
// Function to get the discriminator values for a given type.
@@ -81,6 +82,13 @@ struct plc4c_s7_read_write_s7_parameter {
struct { /* S7ParameterUserData */
plc4c_list* s7_parameter_user_data_items;
};
+ struct { /* S7ParameterModeTransition */
+ uint8_t s7_parameter_mode_transition_method;
+ uint8_t s7_parameter_mode_transition_cpu_function_type : 4;
+ uint8_t s7_parameter_mode_transition_cpu_function_group : 4;
+ uint8_t s7_parameter_mode_transition_current_mode;
+ uint8_t s7_parameter_mode_transition_sequence_number;
+ };
};
};
typedef struct plc4c_s7_read_write_s7_parameter plc4c_s7_read_write_s7_parameter;
diff --git a/plc4c/generated-sources/s7/include/s7_payload_user_data_item.h b/plc4c/generated-sources/s7/include/s7_payload_user_data_item.h
index 0ff2970..7427bb9 100644
--- a/plc4c/generated-sources/s7/include/s7_payload_user_data_item.h
+++ b/plc4c/generated-sources/s7/include/s7_payload_user_data_item.h
@@ -26,9 +26,17 @@
#include <plc4c/spi/write_buffer.h>
#include <plc4c/utils/list.h>
#include "data_transport_error_code.h"
-#include "data_transport_size.h"
+#include "syntax_id_type.h"
#include "s7_payload_user_data_item.h"
+#include "alarm_type.h"
+#include "date_and_time.h"
#include "szl_id.h"
+#include "data_transport_size.h"
+#include "alarm_message_object_ack_type.h"
+#include "alarm_message_ack_push_type.h"
+#include "alarm_message_push_type.h"
+#include "alarm_state_type.h"
+#include "query_type.h"
#include "szl_data_tree_item.h"
// Code generated by code-generation. DO NOT EDIT.
@@ -41,13 +49,31 @@ extern "C" {
// Structure used to contain the discriminator values for discriminated types using this as a parent
struct plc4c_s7_read_write_s7_payload_user_data_item_discriminator {
uint8_t cpuFunctionType;
+ uint8_t cpuSubfunction;
+ uint16_t dataLength;
};
typedef struct plc4c_s7_read_write_s7_payload_user_data_item_discriminator plc4c_s7_read_write_s7_payload_user_data_item_discriminator;
// Enum assigning each sub-type an individual id.
enum plc4c_s7_read_write_s7_payload_user_data_item_type {
- plc4c_s7_read_write_s7_payload_user_data_item_type_plc4c_s7_read_write_s7_payload_user_data_item_cpu_function_read_szl_request = 0,
- plc4c_s7_read_write_s7_payload_user_data_item_type_plc4c_s7_read_write_s7_payload_user_data_item_cpu_function_read_szl_response = 1};
+ plc4c_s7_read_write_s7_payload_user_data_item_type_plc4c_s7_read_write_s7_payload_diagnostic_message = 0,
+ plc4c_s7_read_write_s7_payload_user_data_item_type_plc4c_s7_read_write_s7_payload_alarm8 = 1,
+ plc4c_s7_read_write_s7_payload_user_data_item_type_plc4c_s7_read_write_s7_payload_notify = 2,
+ plc4c_s7_read_write_s7_payload_user_data_item_type_plc4c_s7_read_write_s7_payload_alarm_ack_ind = 3,
+ plc4c_s7_read_write_s7_payload_user_data_item_type_plc4c_s7_read_write_s7_payload_alarm_sq = 4,
+ plc4c_s7_read_write_s7_payload_user_data_item_type_plc4c_s7_read_write_s7_payload_alarm_s = 5,
+ plc4c_s7_read_write_s7_payload_user_data_item_type_plc4c_s7_read_write_s7_payload_alarm_sc = 6,
+ plc4c_s7_read_write_s7_payload_user_data_item_type_plc4c_s7_read_write_s7_payload_notify8 = 7,
+ plc4c_s7_read_write_s7_payload_user_data_item_type_plc4c_s7_read_write_s7_payload_user_data_item_cpu_function_read_szl_request = 8,
+ plc4c_s7_read_write_s7_payload_user_data_item_type_plc4c_s7_read_write_s7_payload_user_data_item_cpu_function_read_szl_response = 9,
+ plc4c_s7_read_write_s7_payload_user_data_item_type_plc4c_s7_read_write_s7_payload_user_data_item_cpu_function_msg_subscription = 10,
+ plc4c_s7_read_write_s7_payload_user_data_item_type_plc4c_s7_read_write_s7_payload_user_data_item_cpu_function_msg_subscription_response = 11,
+ plc4c_s7_read_write_s7_payload_user_data_item_type_plc4c_s7_read_write_s7_payload_user_data_item_cpu_function_msg_subscription_sys_response = 12,
+ plc4c_s7_read_write_s7_payload_user_data_item_type_plc4c_s7_read_write_s7_payload_user_data_item_cpu_function_msg_subscription_alarm_response = 13,
+ plc4c_s7_read_write_s7_payload_user_data_item_type_plc4c_s7_read_write_s7_payload_user_data_item_cpu_function_alarm_ack = 14,
+ plc4c_s7_read_write_s7_payload_user_data_item_type_plc4c_s7_read_write_s7_payload_user_data_item_cpu_function_alarm_ack_response = 15,
+ plc4c_s7_read_write_s7_payload_user_data_item_type_plc4c_s7_read_write_s7_payload_user_data_item_cpu_function_alarm_query = 16,
+ plc4c_s7_read_write_s7_payload_user_data_item_type_plc4c_s7_read_write_s7_payload_user_data_item_cpu_function_alarm_query_response = 17};
typedef enum plc4c_s7_read_write_s7_payload_user_data_item_type plc4c_s7_read_write_s7_payload_user_data_item_type;
// Function to get the discriminator values for a given type.
@@ -55,6 +81,8 @@ plc4c_s7_read_write_s7_payload_user_data_item_discriminator plc4c_s7_read_write_
// Constant values.
uint16_t PLC4C_S7_READ_WRITE_S7_PAYLOAD_USER_DATA_ITEM_CPU_FUNCTION_READ_SZL_RESPONSE_SZL_ITEM_LENGTH();
+uint8_t PLC4C_S7_READ_WRITE_S7_PAYLOAD_USER_DATA_ITEM_CPU_FUNCTION_ALARM_QUERY_RESPONSE_NUMBER_MESSAGE_OBJ();
+uint8_t PLC4C_S7_READ_WRITE_S7_PAYLOAD_USER_DATA_ITEM_CPU_FUNCTION_ALARM_QUERY_LENGTH();
struct plc4c_s7_read_write_s7_payload_user_data_item {
/* This is an abstract type so this property saves the type of this typed union */
@@ -62,12 +90,80 @@ struct plc4c_s7_read_write_s7_payload_user_data_item {
/* Properties */
plc4c_s7_read_write_data_transport_error_code return_code;
plc4c_s7_read_write_data_transport_size transport_size;
- plc4c_s7_read_write_szl_id* szl_id;
- uint16_t szl_index;
union {
+ struct { /* S7PayloadDiagnosticMessage */
+ uint16_t s7_payload_diagnostic_message_event_id;
+ uint8_t s7_payload_diagnostic_message_priority_class;
+ uint8_t s7_payload_diagnostic_message_ob_number;
+ uint16_t s7_payload_diagnostic_message_dat_id;
+ uint16_t s7_payload_diagnostic_message_info1;
+ uint32_t s7_payload_diagnostic_message_info2;
+ plc4c_s7_read_write_date_and_time* s7_payload_diagnostic_message_time_stamp;
+ };
+ struct { /* S7PayloadAlarm8 */
+ plc4c_s7_read_write_alarm_message_push_type* s7_payload_alarm8_alarm_message;
+ };
+ struct { /* S7PayloadNotify */
+ plc4c_s7_read_write_alarm_message_push_type* s7_payload_notify_alarm_message;
+ };
+ struct { /* S7PayloadAlarmAckInd */
+ plc4c_s7_read_write_alarm_message_ack_push_type* s7_payload_alarm_ack_ind_alarm_message;
+ };
+ struct { /* S7PayloadAlarmSQ */
+ plc4c_s7_read_write_alarm_message_push_type* s7_payload_alarm_sq_alarm_message;
+ };
+ struct { /* S7PayloadAlarmS */
+ plc4c_s7_read_write_alarm_message_push_type* s7_payload_alarm_s_alarm_message;
+ };
+ struct { /* S7PayloadAlarmSC */
+ plc4c_s7_read_write_alarm_message_push_type* s7_payload_alarm_sc_alarm_message;
+ };
+ struct { /* S7PayloadNotify8 */
+ plc4c_s7_read_write_alarm_message_push_type* s7_payload_notify8_alarm_message;
+ };
+ struct { /* S7PayloadUserDataItemCpuFunctionReadSzlRequest */
+ plc4c_s7_read_write_szl_id* s7_payload_user_data_item_cpu_function_read_szl_request_szl_id;
+ uint16_t s7_payload_user_data_item_cpu_function_read_szl_request_szl_index;
+ };
struct { /* S7PayloadUserDataItemCpuFunctionReadSzlResponse */
+ plc4c_s7_read_write_szl_id* s7_payload_user_data_item_cpu_function_read_szl_response_szl_id;
+ uint16_t s7_payload_user_data_item_cpu_function_read_szl_response_szl_index;
plc4c_list* s7_payload_user_data_item_cpu_function_read_szl_response_items;
};
+ struct { /* S7PayloadUserDataItemCpuFunctionMsgSubscription */
+ uint8_t s7_payload_user_data_item_cpu_function_msg_subscription_subscription;
+ char* s7_payload_user_data_item_cpu_function_msg_subscription_magic_key;
+ plc4c_s7_read_write_alarm_state_type* s7_payload_user_data_item_cpu_function_msg_subscription_alarmtype;
+ uint8_t* s7_payload_user_data_item_cpu_function_msg_subscription_reserve;
+ };
+ struct { /* S7PayloadUserDataItemCpuFunctionMsgSubscriptionSysResponse */
+ uint8_t s7_payload_user_data_item_cpu_function_msg_subscription_sys_response_result;
+ uint8_t s7_payload_user_data_item_cpu_function_msg_subscription_sys_response_reserved01;
+ };
+ struct { /* S7PayloadUserDataItemCpuFunctionMsgSubscriptionAlarmResponse */
+ uint8_t s7_payload_user_data_item_cpu_function_msg_subscription_alarm_response_result;
+ uint8_t s7_payload_user_data_item_cpu_function_msg_subscription_alarm_response_reserved01;
+ plc4c_s7_read_write_alarm_type s7_payload_user_data_item_cpu_function_msg_subscription_alarm_response_alarm_type;
+ uint8_t s7_payload_user_data_item_cpu_function_msg_subscription_alarm_response_reserved02;
+ uint8_t s7_payload_user_data_item_cpu_function_msg_subscription_alarm_response_reserved03;
+ };
+ struct { /* S7PayloadUserDataItemCpuFunctionAlarmAck */
+ uint8_t s7_payload_user_data_item_cpu_function_alarm_ack_function_id;
+ plc4c_list* s7_payload_user_data_item_cpu_function_alarm_ack_message_objects;
+ };
+ struct { /* S7PayloadUserDataItemCpuFunctionAlarmAckResponse */
+ uint8_t s7_payload_user_data_item_cpu_function_alarm_ack_response_function_id;
+ plc4c_list* s7_payload_user_data_item_cpu_function_alarm_ack_response_message_objects;
+ };
+ struct { /* S7PayloadUserDataItemCpuFunctionAlarmQuery */
+ plc4c_s7_read_write_syntax_id_type s7_payload_user_data_item_cpu_function_alarm_query_syntax_id;
+ plc4c_s7_read_write_query_type s7_payload_user_data_item_cpu_function_alarm_query_query_type;
+ plc4c_s7_read_write_alarm_type s7_payload_user_data_item_cpu_function_alarm_query_alarm_type;
+ };
+ struct { /* S7PayloadUserDataItemCpuFunctionAlarmQueryResponse */
+ plc4c_s7_read_write_data_transport_error_code s7_payload_user_data_item_cpu_function_alarm_query_response_pudicf_return_code;
+ plc4c_s7_read_write_data_transport_size s7_payload_user_data_item_cpu_function_alarm_query_response_pudicftransport_size;
+ };
};
};
typedef struct plc4c_s7_read_write_s7_payload_user_data_item plc4c_s7_read_write_s7_payload_user_data_item;
@@ -75,7 +171,7 @@ typedef struct plc4c_s7_read_write_s7_payload_user_data_item plc4c_s7_read_write
// Create an empty NULL-struct
plc4c_s7_read_write_s7_payload_user_data_item plc4c_s7_read_write_s7_payload_user_data_item_null();
-plc4c_return_code plc4c_s7_read_write_s7_payload_user_data_item_parse(plc4c_spi_read_buffer* readBuffer, uint8_t cpuFunctionType, plc4c_s7_read_write_s7_payload_user_data_item** message);
+plc4c_return_code plc4c_s7_read_write_s7_payload_user_data_item_parse(plc4c_spi_read_buffer* readBuffer, uint8_t cpuFunctionType, uint8_t cpuSubfunction, plc4c_s7_read_write_s7_payload_user_data_item** message);
plc4c_return_code plc4c_s7_read_write_s7_payload_user_data_item_serialize(plc4c_spi_write_buffer* writeBuffer, plc4c_s7_read_write_s7_payload_user_data_item* message);
diff --git a/plc4c/generated-sources/s7/src/s7_parameter.c b/plc4c/generated-sources/s7/src/s7_parameter.c
index 913e8ed..c53d46a 100644
--- a/plc4c/generated-sources/s7/src/s7_parameter.c
+++ b/plc4c/generated-sources/s7/src/s7_parameter.c
@@ -38,7 +38,9 @@ const plc4c_s7_read_write_s7_parameter_discriminator plc4c_s7_read_write_s7_para
{/* plc4c_s7_read_write_s7_parameter_write_var_response */
.parameterType = 0x05, .messageType = 0x03},
{/* plc4c_s7_read_write_s7_parameter_user_data */
- .parameterType = 0x00, .messageType = 0x07}
+ .parameterType = 0x00, .messageType = 0x07},
+ {/* plc4c_s7_read_write_s7_parameter_mode_transition */
+ .parameterType = 0x01, .messageType = 0x07}
};
@@ -247,6 +249,81 @@ plc4c_return_code plc4c_s7_read_write_s7_parameter_parse(plc4c_spi_read_buffer*
}
(*_message)->s7_parameter_user_data_items = items;
+ } else
+ if((parameterType == 0x01) && (messageType == 0x07)) { /* S7ParameterModeTransition */
+ (*_message)->_type = plc4c_s7_read_write_s7_parameter_type_plc4c_s7_read_write_s7_parameter_mode_transition;
+
+ // Reserved Field (Compartmentalized so the "reserved" variable can't leak)
+ {
+ uint16_t _reserved = 0;
+ _res = plc4c_spi_read_unsigned_short(readBuffer, 16, (uint16_t*) &_reserved);
+ if(_res != OK) {
+ return _res;
+ }
+ if(_reserved != 0x0010) {
+ printf("Expected constant value '%d' but got '%d' for reserved field.", 0x0010, _reserved);
+ }
+ }
+
+
+
+ // Implicit Field (itemLength) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content)
+ uint8_t itemLength = 0;
+ _res = plc4c_spi_read_unsigned_byte(readBuffer, 8, (uint8_t*) &itemLength);
+ if(_res != OK) {
+ return _res;
+ }
+
+
+
+ // Simple Field (method)
+ uint8_t method = 0;
+ _res = plc4c_spi_read_unsigned_byte(readBuffer, 8, (uint8_t*) &method);
+ if(_res != OK) {
+ return _res;
+ }
+ (*_message)->s7_parameter_mode_transition_method = method;
+
+
+
+ // Simple Field (cpuFunctionType)
+ uint8_t cpuFunctionType = 0;
+ _res = plc4c_spi_read_unsigned_byte(readBuffer, 4, (uint8_t*) &cpuFunctionType);
+ if(_res != OK) {
+ return _res;
+ }
+ (*_message)->s7_parameter_mode_transition_cpu_function_type = cpuFunctionType;
+
+
+
+ // Simple Field (cpuFunctionGroup)
+ uint8_t cpuFunctionGroup = 0;
+ _res = plc4c_spi_read_unsigned_byte(readBuffer, 4, (uint8_t*) &cpuFunctionGroup);
+ if(_res != OK) {
+ return _res;
+ }
+ (*_message)->s7_parameter_mode_transition_cpu_function_group = cpuFunctionGroup;
+
+
+
+ // Simple Field (currentMode)
+ uint8_t currentMode = 0;
+ _res = plc4c_spi_read_unsigned_byte(readBuffer, 8, (uint8_t*) ¤tMode);
+ if(_res != OK) {
+ return _res;
+ }
+ (*_message)->s7_parameter_mode_transition_current_mode = currentMode;
+
+
+
+ // Simple Field (sequenceNumber)
+ uint8_t sequenceNumber = 0;
+ _res = plc4c_spi_read_unsigned_byte(readBuffer, 8, (uint8_t*) &sequenceNumber);
+ if(_res != OK) {
+ return _res;
+ }
+ (*_message)->s7_parameter_mode_transition_sequence_number = sequenceNumber;
+
}
return OK;
@@ -377,6 +454,52 @@ plc4c_return_code plc4c_s7_read_write_s7_parameter_serialize(plc4c_spi_write_buf
break;
}
+ case plc4c_s7_read_write_s7_parameter_type_plc4c_s7_read_write_s7_parameter_mode_transition: {
+
+ // Reserved Field
+ _res = plc4c_spi_write_unsigned_short(writeBuffer, 16, 0x0010);
+ if(_res != OK) {
+ return _res;
+ }
+
+ // Implicit Field (itemLength) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content)
+ _res = plc4c_spi_write_unsigned_byte(writeBuffer, 8, (plc4c_s7_read_write_s7_parameter_length_in_bytes(_message)) - (2));
+ if(_res != OK) {
+ return _res;
+ }
+
+ // Simple Field (method)
+ _res = plc4c_spi_write_unsigned_byte(writeBuffer, 8, _message->s7_parameter_mode_transition_method);
+ if(_res != OK) {
+ return _res;
+ }
+
+ // Simple Field (cpuFunctionType)
+ _res = plc4c_spi_write_unsigned_byte(writeBuffer, 4, _message->s7_parameter_mode_transition_cpu_function_type);
+ if(_res != OK) {
+ return _res;
+ }
+
+ // Simple Field (cpuFunctionGroup)
+ _res = plc4c_spi_write_unsigned_byte(writeBuffer, 4, _message->s7_parameter_mode_transition_cpu_function_group);
+ if(_res != OK) {
+ return _res;
+ }
+
+ // Simple Field (currentMode)
+ _res = plc4c_spi_write_unsigned_byte(writeBuffer, 8, _message->s7_parameter_mode_transition_current_mode);
+ if(_res != OK) {
+ return _res;
+ }
+
+ // Simple Field (sequenceNumber)
+ _res = plc4c_spi_write_unsigned_byte(writeBuffer, 8, _message->s7_parameter_mode_transition_sequence_number);
+ if(_res != OK) {
+ return _res;
+ }
+
+ break;
+ }
}
return OK;
@@ -478,6 +601,37 @@ uint16_t plc4c_s7_read_write_s7_parameter_length_in_bits(plc4c_s7_read_write_s7_
break;
}
+ case plc4c_s7_read_write_s7_parameter_type_plc4c_s7_read_write_s7_parameter_mode_transition: {
+
+ // Reserved Field (reserved)
+ lengthInBits += 16;
+
+
+ // Implicit Field (itemLength)
+ lengthInBits += 8;
+
+
+ // Simple field (method)
+ lengthInBits += 8;
+
+
+ // Simple field (cpuFunctionType)
+ lengthInBits += 4;
+
+
+ // Simple field (cpuFunctionGroup)
+ lengthInBits += 4;
+
+
+ // Simple field (currentMode)
+ lengthInBits += 8;
+
+
+ // Simple field (sequenceNumber)
+ lengthInBits += 8;
+
+ break;
+ }
}
return lengthInBits;
diff --git a/plc4c/generated-sources/s7/src/s7_payload.c b/plc4c/generated-sources/s7/src/s7_payload.c
index bcf91a8..2890b64 100644
--- a/plc4c/generated-sources/s7/src/s7_payload.c
+++ b/plc4c/generated-sources/s7/src/s7_payload.c
@@ -154,7 +154,7 @@ plc4c_return_code plc4c_s7_read_write_s7_payload_parse(plc4c_spi_read_buffer* re
for(int curItem = 0; curItem < itemCount; curItem++) {
bool lastItem = curItem == (itemCount - 1);
plc4c_s7_read_write_s7_payload_user_data_item* _value = NULL;
- _res = plc4c_s7_read_write_s7_payload_user_data_item_parse(readBuffer, ((plc4c_s7_read_write_s7_parameter_user_data_item*) (plc4c_utils_list_get_value(((plc4c_s7_read_write_s7_parameter*) (parameter))->s7_parameter_user_data_items, 0)))->s7_parameter_user_data_item_cpu_functions_cpu_function_type, (void*) &_value);
+ _res = plc4c_s7_read_write_s7_payload_user_data_item_parse(readBuffer, ((plc4c_s7_read_write_s7_parameter_user_data_item*) (plc4c_utils_list_get_value(((plc4c_s7_read_write_s7_parameter*) (parameter))->s7_parameter_user_data_items, 0)))->s7_parameter_user_data_item_cpu_functions_cpu_function_type, ((plc4c_s7_read_write_s7_parameter_user_data_item*) (plc4c_utils_list_get_value(((plc4c_s7_read_write_s7_parameter*) (parameter))->s7_parameter_user_data_items, 0)))->s7_parameter_user_ [...]
if(_res != OK) {
return _res;
}
diff --git a/plc4c/generated-sources/s7/src/s7_payload_user_data_item.c b/plc4c/generated-sources/s7/src/s7_payload_user_data_item.c
index 727253e..d0f4b13 100644
--- a/plc4c/generated-sources/s7/src/s7_payload_user_data_item.c
+++ b/plc4c/generated-sources/s7/src/s7_payload_user_data_item.c
@@ -27,10 +27,42 @@
// (The order is identical to the enum constants so we can use the
// enum constant to directly access a given types discriminator values)
const plc4c_s7_read_write_s7_payload_user_data_item_discriminator plc4c_s7_read_write_s7_payload_user_data_item_discriminators[] = {
+ {/* plc4c_s7_read_write_s7_payload_diagnostic_message */
+ .cpuFunctionType = 0x00, .cpuSubfunction = 0x03, .dataLength = -1},
+ {/* plc4c_s7_read_write_s7_payload_alarm8 */
+ .cpuFunctionType = 0x00, .cpuSubfunction = 0x05, .dataLength = -1},
+ {/* plc4c_s7_read_write_s7_payload_notify */
+ .cpuFunctionType = 0x00, .cpuSubfunction = 0x06, .dataLength = -1},
+ {/* plc4c_s7_read_write_s7_payload_alarm_ack_ind */
+ .cpuFunctionType = 0x00, .cpuSubfunction = 0x0c, .dataLength = -1},
+ {/* plc4c_s7_read_write_s7_payload_alarm_sq */
+ .cpuFunctionType = 0x00, .cpuSubfunction = 0x11, .dataLength = -1},
+ {/* plc4c_s7_read_write_s7_payload_alarm_s */
+ .cpuFunctionType = 0x00, .cpuSubfunction = 0x12, .dataLength = -1},
+ {/* plc4c_s7_read_write_s7_payload_alarm_sc */
+ .cpuFunctionType = 0x00, .cpuSubfunction = 0x13, .dataLength = -1},
+ {/* plc4c_s7_read_write_s7_payload_notify8 */
+ .cpuFunctionType = 0x00, .cpuSubfunction = 0x16, .dataLength = -1},
{/* plc4c_s7_read_write_s7_payload_user_data_item_cpu_function_read_szl_request */
- .cpuFunctionType = 0x04},
+ .cpuFunctionType = 0x04, .cpuSubfunction = 0x01, .dataLength = -1},
{/* plc4c_s7_read_write_s7_payload_user_data_item_cpu_function_read_szl_response */
- .cpuFunctionType = 0x08}
+ .cpuFunctionType = 0x08, .cpuSubfunction = 0x01, .dataLength = -1},
+ {/* plc4c_s7_read_write_s7_payload_user_data_item_cpu_function_msg_subscription */
+ .cpuFunctionType = 0x04, .cpuSubfunction = 0x02, .dataLength = -1},
+ {/* plc4c_s7_read_write_s7_payload_user_data_item_cpu_function_msg_subscription_response */
+ .cpuFunctionType = 0x08, .cpuSubfunction = 0x02, .dataLength = 0x00},
+ {/* plc4c_s7_read_write_s7_payload_user_data_item_cpu_function_msg_subscription_sys_response */
+ .cpuFunctionType = 0x08, .cpuSubfunction = 0x02, .dataLength = 0x02},
+ {/* plc4c_s7_read_write_s7_payload_user_data_item_cpu_function_msg_subscription_alarm_response */
+ .cpuFunctionType = 0x08, .cpuSubfunction = 0x02, .dataLength = 0x05},
+ {/* plc4c_s7_read_write_s7_payload_user_data_item_cpu_function_alarm_ack */
+ .cpuFunctionType = 0x04, .cpuSubfunction = 0x0b, .dataLength = -1},
+ {/* plc4c_s7_read_write_s7_payload_user_data_item_cpu_function_alarm_ack_response */
+ .cpuFunctionType = 0x08, .cpuSubfunction = 0x0b, .dataLength = -1},
+ {/* plc4c_s7_read_write_s7_payload_user_data_item_cpu_function_alarm_query */
+ .cpuFunctionType = 0x04, .cpuSubfunction = 0x13, .dataLength = -1},
+ {/* plc4c_s7_read_write_s7_payload_user_data_item_cpu_function_alarm_query_response */
+ .cpuFunctionType = 0x08, .cpuSubfunction = 0x13, .dataLength = -1}
};
@@ -52,9 +84,17 @@ static const uint16_t PLC4C_S7_READ_WRITE_S7_PAYLOAD_USER_DATA_ITEM_CPU_FUNCTION
uint16_t PLC4C_S7_READ_WRITE_S7_PAYLOAD_USER_DATA_ITEM_CPU_FUNCTION_READ_SZL_RESPONSE_SZL_ITEM_LENGTH() {
return PLC4C_S7_READ_WRITE_S7_PAYLOAD_USER_DATA_ITEM_CPU_FUNCTION_READ_SZL_RESPONSE_SZL_ITEM_LENGTH_const;
}
+static const uint8_t PLC4C_S7_READ_WRITE_S7_PAYLOAD_USER_DATA_ITEM_CPU_FUNCTION_ALARM_QUERY_RESPONSE_NUMBER_MESSAGE_OBJ_const = 0x01;
+uint8_t PLC4C_S7_READ_WRITE_S7_PAYLOAD_USER_DATA_ITEM_CPU_FUNCTION_ALARM_QUERY_RESPONSE_NUMBER_MESSAGE_OBJ() {
+ return PLC4C_S7_READ_WRITE_S7_PAYLOAD_USER_DATA_ITEM_CPU_FUNCTION_ALARM_QUERY_RESPONSE_NUMBER_MESSAGE_OBJ_const;
+}
+static const uint8_t PLC4C_S7_READ_WRITE_S7_PAYLOAD_USER_DATA_ITEM_CPU_FUNCTION_ALARM_QUERY_LENGTH_const = 0x08;
+uint8_t PLC4C_S7_READ_WRITE_S7_PAYLOAD_USER_DATA_ITEM_CPU_FUNCTION_ALARM_QUERY_LENGTH() {
+ return PLC4C_S7_READ_WRITE_S7_PAYLOAD_USER_DATA_ITEM_CPU_FUNCTION_ALARM_QUERY_LENGTH_const;
+}
// Parse function.
-plc4c_return_code plc4c_s7_read_write_s7_payload_user_data_item_parse(plc4c_spi_read_buffer* readBuffer, uint8_t cpuFunctionType, plc4c_s7_read_write_s7_payload_user_data_item** _message) {
+plc4c_return_code plc4c_s7_read_write_s7_payload_user_data_item_parse(plc4c_spi_read_buffer* readBuffer, uint8_t cpuFunctionType, uint8_t cpuSubfunction, plc4c_s7_read_write_s7_payload_user_data_item** _message) {
uint16_t startPos = plc4c_spi_read_get_pos(readBuffer);
uint16_t curPos;
plc4c_return_code _res = OK;
@@ -88,29 +128,208 @@ plc4c_return_code plc4c_s7_read_write_s7_payload_user_data_item_parse(plc4c_spi_
return _res;
}
- // Simple Field (szlId)
- plc4c_s7_read_write_szl_id* szlId;
- _res = plc4c_s7_read_write_szl_id_parse(readBuffer, (void*) &szlId);
- if(_res != OK) {
- return _res;
- }
- (*_message)->szl_id = szlId;
+ // Switch Field (Depending on the discriminator values, passes the instantiation to a sub-type)
+ if((cpuFunctionType == 0x00) && (cpuSubfunction == 0x03)) { /* S7PayloadDiagnosticMessage */
+ (*_message)->_type = plc4c_s7_read_write_s7_payload_user_data_item_type_plc4c_s7_read_write_s7_payload_diagnostic_message;
+
+ // Simple Field (EventId)
+ uint16_t EventId = 0;
+ _res = plc4c_spi_read_unsigned_short(readBuffer, 16, (uint16_t*) &EventId);
+ if(_res != OK) {
+ return _res;
+ }
+ (*_message)->s7_payload_diagnostic_message_event_id = EventId;
- // Simple Field (szlIndex)
- uint16_t szlIndex = 0;
- _res = plc4c_spi_read_unsigned_short(readBuffer, 16, (uint16_t*) &szlIndex);
- if(_res != OK) {
- return _res;
- }
- (*_message)->szl_index = szlIndex;
- // Switch Field (Depending on the discriminator values, passes the instantiation to a sub-type)
- if(cpuFunctionType == 0x04) { /* S7PayloadUserDataItemCpuFunctionReadSzlRequest */
+
+ // Simple Field (PriorityClass)
+ uint8_t PriorityClass = 0;
+ _res = plc4c_spi_read_unsigned_byte(readBuffer, 8, (uint8_t*) &PriorityClass);
+ if(_res != OK) {
+ return _res;
+ }
+ (*_message)->s7_payload_diagnostic_message_priority_class = PriorityClass;
+
+
+
+ // Simple Field (ObNumber)
+ uint8_t ObNumber = 0;
+ _res = plc4c_spi_read_unsigned_byte(readBuffer, 8, (uint8_t*) &ObNumber);
+ if(_res != OK) {
+ return _res;
+ }
+ (*_message)->s7_payload_diagnostic_message_ob_number = ObNumber;
+
+
+
+ // Simple Field (DatId)
+ uint16_t DatId = 0;
+ _res = plc4c_spi_read_unsigned_short(readBuffer, 16, (uint16_t*) &DatId);
+ if(_res != OK) {
+ return _res;
+ }
+ (*_message)->s7_payload_diagnostic_message_dat_id = DatId;
+
+
+
+ // Simple Field (Info1)
+ uint16_t Info1 = 0;
+ _res = plc4c_spi_read_unsigned_short(readBuffer, 16, (uint16_t*) &Info1);
+ if(_res != OK) {
+ return _res;
+ }
+ (*_message)->s7_payload_diagnostic_message_info1 = Info1;
+
+
+
+ // Simple Field (Info2)
+ uint32_t Info2 = 0;
+ _res = plc4c_spi_read_unsigned_int(readBuffer, 32, (uint32_t*) &Info2);
+ if(_res != OK) {
+ return _res;
+ }
+ (*_message)->s7_payload_diagnostic_message_info2 = Info2;
+
+
+
+ // Simple Field (TimeStamp)
+ plc4c_s7_read_write_date_and_time* TimeStamp;
+ _res = plc4c_s7_read_write_date_and_time_parse(readBuffer, (void*) &TimeStamp);
+ if(_res != OK) {
+ return _res;
+ }
+ (*_message)->s7_payload_diagnostic_message_time_stamp = TimeStamp;
+
+ } else
+ if((cpuFunctionType == 0x00) && (cpuSubfunction == 0x05)) { /* S7PayloadAlarm8 */
+ (*_message)->_type = plc4c_s7_read_write_s7_payload_user_data_item_type_plc4c_s7_read_write_s7_payload_alarm8;
+
+ // Simple Field (alarmMessage)
+ plc4c_s7_read_write_alarm_message_push_type* alarmMessage;
+ _res = plc4c_s7_read_write_alarm_message_push_type_parse(readBuffer, (void*) &alarmMessage);
+ if(_res != OK) {
+ return _res;
+ }
+ (*_message)->s7_payload_alarm8_alarm_message = alarmMessage;
+
+ } else
+ if((cpuFunctionType == 0x00) && (cpuSubfunction == 0x06)) { /* S7PayloadNotify */
+ (*_message)->_type = plc4c_s7_read_write_s7_payload_user_data_item_type_plc4c_s7_read_write_s7_payload_notify;
+
+ // Simple Field (alarmMessage)
+ plc4c_s7_read_write_alarm_message_push_type* alarmMessage;
+ _res = plc4c_s7_read_write_alarm_message_push_type_parse(readBuffer, (void*) &alarmMessage);
+ if(_res != OK) {
+ return _res;
+ }
+ (*_message)->s7_payload_notify_alarm_message = alarmMessage;
+
+ } else
+ if((cpuFunctionType == 0x00) && (cpuSubfunction == 0x0c)) { /* S7PayloadAlarmAckInd */
+ (*_message)->_type = plc4c_s7_read_write_s7_payload_user_data_item_type_plc4c_s7_read_write_s7_payload_alarm_ack_ind;
+
+ // Simple Field (alarmMessage)
+ plc4c_s7_read_write_alarm_message_ack_push_type* alarmMessage;
+ _res = plc4c_s7_read_write_alarm_message_ack_push_type_parse(readBuffer, (void*) &alarmMessage);
+ if(_res != OK) {
+ return _res;
+ }
+ (*_message)->s7_payload_alarm_ack_ind_alarm_message = alarmMessage;
+
+ } else
+ if((cpuFunctionType == 0x00) && (cpuSubfunction == 0x11)) { /* S7PayloadAlarmSQ */
+ (*_message)->_type = plc4c_s7_read_write_s7_payload_user_data_item_type_plc4c_s7_read_write_s7_payload_alarm_sq;
+
+ // Simple Field (alarmMessage)
+ plc4c_s7_read_write_alarm_message_push_type* alarmMessage;
+ _res = plc4c_s7_read_write_alarm_message_push_type_parse(readBuffer, (void*) &alarmMessage);
+ if(_res != OK) {
+ return _res;
+ }
+ (*_message)->s7_payload_alarm_sq_alarm_message = alarmMessage;
+
+ } else
+ if((cpuFunctionType == 0x00) && (cpuSubfunction == 0x12)) { /* S7PayloadAlarmS */
+ (*_message)->_type = plc4c_s7_read_write_s7_payload_user_data_item_type_plc4c_s7_read_write_s7_payload_alarm_s;
+
+ // Simple Field (alarmMessage)
+ plc4c_s7_read_write_alarm_message_push_type* alarmMessage;
+ _res = plc4c_s7_read_write_alarm_message_push_type_parse(readBuffer, (void*) &alarmMessage);
+ if(_res != OK) {
+ return _res;
+ }
+ (*_message)->s7_payload_alarm_s_alarm_message = alarmMessage;
+
+ } else
+ if((cpuFunctionType == 0x00) && (cpuSubfunction == 0x13)) { /* S7PayloadAlarmSC */
+ (*_message)->_type = plc4c_s7_read_write_s7_payload_user_data_item_type_plc4c_s7_read_write_s7_payload_alarm_sc;
+
+ // Simple Field (alarmMessage)
+ plc4c_s7_read_write_alarm_message_push_type* alarmMessage;
+ _res = plc4c_s7_read_write_alarm_message_push_type_parse(readBuffer, (void*) &alarmMessage);
+ if(_res != OK) {
+ return _res;
+ }
+ (*_message)->s7_payload_alarm_sc_alarm_message = alarmMessage;
+
+ } else
+ if((cpuFunctionType == 0x00) && (cpuSubfunction == 0x16)) { /* S7PayloadNotify8 */
+ (*_message)->_type = plc4c_s7_read_write_s7_payload_user_data_item_type_plc4c_s7_read_write_s7_payload_notify8;
+
+ // Simple Field (alarmMessage)
+ plc4c_s7_read_write_alarm_message_push_type* alarmMessage;
+ _res = plc4c_s7_read_write_alarm_message_push_type_parse(readBuffer, (void*) &alarmMessage);
+ if(_res != OK) {
+ return _res;
+ }
+ (*_message)->s7_payload_notify8_alarm_message = alarmMessage;
+
+ } else
+ if((cpuFunctionType == 0x04) && (cpuSubfunction == 0x01)) { /* S7PayloadUserDataItemCpuFunctionReadSzlRequest */
(*_message)->_type = plc4c_s7_read_write_s7_payload_user_data_item_type_plc4c_s7_read_write_s7_payload_user_data_item_cpu_function_read_szl_request;
+
+ // Simple Field (szlId)
+ plc4c_s7_read_write_szl_id* szlId;
+ _res = plc4c_s7_read_write_szl_id_parse(readBuffer, (void*) &szlId);
+ if(_res != OK) {
+ return _res;
+ }
+ (*_message)->s7_payload_user_data_item_cpu_function_read_szl_request_szl_id = szlId;
+
+
+
+ // Simple Field (szlIndex)
+ uint16_t szlIndex = 0;
+ _res = plc4c_spi_read_unsigned_short(readBuffer, 16, (uint16_t*) &szlIndex);
+ if(_res != OK) {
+ return _res;
+ }
+ (*_message)->s7_payload_user_data_item_cpu_function_read_szl_request_szl_index = szlIndex;
+
} else
- if(cpuFunctionType == 0x08) { /* S7PayloadUserDataItemCpuFunctionReadSzlResponse */
+ if((cpuFunctionType == 0x08) && (cpuSubfunction == 0x01)) { /* S7PayloadUserDataItemCpuFunctionReadSzlResponse */
(*_message)->_type = plc4c_s7_read_write_s7_payload_user_data_item_type_plc4c_s7_read_write_s7_payload_user_data_item_cpu_function_read_szl_response;
+ // Simple Field (szlId)
+ plc4c_s7_read_write_szl_id* szlId;
+ _res = plc4c_s7_read_write_szl_id_parse(readBuffer, (void*) &szlId);
+ if(_res != OK) {
+ return _res;
+ }
+ (*_message)->s7_payload_user_data_item_cpu_function_read_szl_response_szl_id = szlId;
+
+
+
+ // Simple Field (szlIndex)
+ uint16_t szlIndex = 0;
+ _res = plc4c_spi_read_unsigned_short(readBuffer, 16, (uint16_t*) &szlIndex);
+ if(_res != OK) {
+ return _res;
+ }
+ (*_message)->s7_payload_user_data_item_cpu_function_read_szl_response_szl_index = szlIndex;
+
+
+
// Const Field (szlItemLength)
uint16_t szlItemLength = 0;
_res = plc4c_spi_read_unsigned_short(readBuffer, 16, (uint16_t*) &szlItemLength);
@@ -154,122 +373,968 @@ plc4c_return_code plc4c_s7_read_write_s7_payload_user_data_item_parse(plc4c_spi_
}
(*_message)->s7_payload_user_data_item_cpu_function_read_szl_response_items = items;
- }
-
- return OK;
-}
-
-plc4c_return_code plc4c_s7_read_write_s7_payload_user_data_item_serialize(plc4c_spi_write_buffer* writeBuffer, plc4c_s7_read_write_s7_payload_user_data_item* _message) {
- plc4c_return_code _res = OK;
-
- // Enum field (returnCode)
- _res = plc4c_spi_write_unsigned_byte(writeBuffer, 8, _message->return_code);
- if(_res != OK) {
- return _res;
- }
-
- // Enum field (transportSize)
- _res = plc4c_spi_write_unsigned_byte(writeBuffer, 8, _message->transport_size);
- if(_res != OK) {
- return _res;
- }
-
- // Implicit Field (dataLength) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content)
- _res = plc4c_spi_write_unsigned_short(writeBuffer, 16, (plc4c_s7_read_write_s7_payload_user_data_item_length_in_bytes(_message)) - (4));
- if(_res != OK) {
- return _res;
- }
+ } else
+ if((cpuFunctionType == 0x04) && (cpuSubfunction == 0x02)) { /* S7PayloadUserDataItemCpuFunctionMsgSubscription */
+ (*_message)->_type = plc4c_s7_read_write_s7_payload_user_data_item_type_plc4c_s7_read_write_s7_payload_user_data_item_cpu_function_msg_subscription;
+
+ // Simple Field (Subscription)
+ uint8_t Subscription = 0;
+ _res = plc4c_spi_read_unsigned_byte(readBuffer, 8, (uint8_t*) &Subscription);
+ if(_res != OK) {
+ return _res;
+ }
+ (*_message)->s7_payload_user_data_item_cpu_function_msg_subscription_subscription = Subscription;
- // Simple Field (szlId)
- _res = plc4c_s7_read_write_szl_id_serialize(writeBuffer, _message->szl_id);
- if(_res != OK) {
- return _res;
- }
- // Simple Field (szlIndex)
- _res = plc4c_spi_write_unsigned_short(writeBuffer, 16, _message->szl_index);
- if(_res != OK) {
- return _res;
- }
+
+ // Reserved Field (Compartmentalized so the "reserved" variable can't leak)
+ {
+ uint8_t _reserved = 0;
+ _res = plc4c_spi_read_unsigned_byte(readBuffer, 8, (uint8_t*) &_reserved);
+ if(_res != OK) {
+ return _res;
+ }
+ if(_reserved != 0x00) {
+ printf("Expected constant value '%d' but got '%d' for reserved field.", 0x00, _reserved);
+ }
+ }
- // Switch Field (Depending of the current type, serialize the sub-type elements)
- switch(_message->_type) {
- case plc4c_s7_read_write_s7_payload_user_data_item_type_plc4c_s7_read_write_s7_payload_user_data_item_cpu_function_read_szl_request: {
- break;
+
+ // Simple Field (magicKey)
+ char* magicKey = "";
+ _res = plc4c_spi_read_string(readBuffer, 64, "'UTF-8'", (char**) &magicKey);
+ if(_res != OK) {
+ return _res;
}
- case plc4c_s7_read_write_s7_payload_user_data_item_type_plc4c_s7_read_write_s7_payload_user_data_item_cpu_function_read_szl_response: {
+ (*_message)->s7_payload_user_data_item_cpu_function_msg_subscription_magic_key = magicKey;
- // Const Field (szlItemLength)
- plc4c_spi_write_unsigned_short(writeBuffer, 16, PLC4C_S7_READ_WRITE_S7_PAYLOAD_USER_DATA_ITEM_CPU_FUNCTION_READ_SZL_RESPONSE_SZL_ITEM_LENGTH());
- // Implicit Field (szlItemCount) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content)
- _res = plc4c_spi_write_unsigned_short(writeBuffer, 16, plc4c_spi_evaluation_helper_count(_message->s7_payload_user_data_item_cpu_function_read_szl_response_items));
+
+ // Optional Field (Alarmtype) (Can be skipped, if a given expression evaluates to false)
+ plc4c_s7_read_write_alarm_state_type* Alarmtype = NULL;
+ if((Subscription) >= (128)) {
+ _res = plc4c_s7_read_write_alarm_state_type_parse(readBuffer, &Alarmtype);
if(_res != OK) {
return _res;
}
+ (*_message)->s7_payload_user_data_item_cpu_function_msg_subscription_alarmtype = Alarmtype;
+ } else {
+ (*_message)->s7_payload_user_data_item_cpu_function_msg_subscription_alarmtype = NULL;
+ }
- // Array field (items)
- {
- uint8_t itemCount = plc4c_utils_list_size(_message->s7_payload_user_data_item_cpu_function_read_szl_response_items);
- for(int curItem = 0; curItem < itemCount; curItem++) {
- bool lastItem = curItem == (itemCount - 1);
- plc4c_s7_read_write_szl_data_tree_item* _value = (plc4c_s7_read_write_szl_data_tree_item*) plc4c_utils_list_get_value(_message->s7_payload_user_data_item_cpu_function_read_szl_response_items, curItem);
- _res = plc4c_s7_read_write_szl_data_tree_item_serialize(writeBuffer, (void*) _value);
- if(_res != OK) {
- return _res;
- }
- }
+
+
+ // Optional Field (Reserve) (Can be skipped, if a given expression evaluates to false)
+ uint8_t* Reserve = NULL;
+ if((Subscription) >= (128)) {
+ Reserve = malloc(sizeof(uint8_t));
+ if(Reserve == NULL) {
+ return NO_MEMORY;
+ }
+ *Reserve = 0;
+ _res = plc4c_spi_read_unsigned_byte(readBuffer, 8, (uint8_t*) Reserve);
+ if(_res != OK) {
+ return _res;
}
+ (*_message)->s7_payload_user_data_item_cpu_function_msg_subscription_reserve = Reserve;
+ } else {
+ (*_message)->s7_payload_user_data_item_cpu_function_msg_subscription_reserve = NULL;
+ }
- break;
+ } else
+ if((cpuFunctionType == 0x08) && (cpuSubfunction == 0x02) && (dataLength == 0x00)) { /* S7PayloadUserDataItemCpuFunctionMsgSubscriptionResponse */
+ (*_message)->_type = plc4c_s7_read_write_s7_payload_user_data_item_type_plc4c_s7_read_write_s7_payload_user_data_item_cpu_function_msg_subscription_response;
+ } else
+ if((cpuFunctionType == 0x08) && (cpuSubfunction == 0x02) && (dataLength == 0x02)) { /* S7PayloadUserDataItemCpuFunctionMsgSubscriptionSysResponse */
+ (*_message)->_type = plc4c_s7_read_write_s7_payload_user_data_item_type_plc4c_s7_read_write_s7_payload_user_data_item_cpu_function_msg_subscription_sys_response;
+
+ // Simple Field (result)
+ uint8_t result = 0;
+ _res = plc4c_spi_read_unsigned_byte(readBuffer, 8, (uint8_t*) &result);
+ if(_res != OK) {
+ return _res;
}
- }
+ (*_message)->s7_payload_user_data_item_cpu_function_msg_subscription_sys_response_result = result;
- return OK;
-}
-uint16_t plc4c_s7_read_write_s7_payload_user_data_item_length_in_bytes(plc4c_s7_read_write_s7_payload_user_data_item* _message) {
- return plc4c_s7_read_write_s7_payload_user_data_item_length_in_bits(_message) / 8;
-}
+
+ // Simple Field (reserved01)
+ uint8_t reserved01 = 0;
+ _res = plc4c_spi_read_unsigned_byte(readBuffer, 8, (uint8_t*) &reserved01);
+ if(_res != OK) {
+ return _res;
+ }
+ (*_message)->s7_payload_user_data_item_cpu_function_msg_subscription_sys_response_reserved01 = reserved01;
-uint16_t plc4c_s7_read_write_s7_payload_user_data_item_length_in_bits(plc4c_s7_read_write_s7_payload_user_data_item* _message) {
- uint16_t lengthInBits = 0;
+ } else
+ if((cpuFunctionType == 0x08) && (cpuSubfunction == 0x02) && (dataLength == 0x05)) { /* S7PayloadUserDataItemCpuFunctionMsgSubscriptionAlarmResponse */
+ (*_message)->_type = plc4c_s7_read_write_s7_payload_user_data_item_type_plc4c_s7_read_write_s7_payload_user_data_item_cpu_function_msg_subscription_alarm_response;
+
+ // Simple Field (result)
+ uint8_t result = 0;
+ _res = plc4c_spi_read_unsigned_byte(readBuffer, 8, (uint8_t*) &result);
+ if(_res != OK) {
+ return _res;
+ }
+ (*_message)->s7_payload_user_data_item_cpu_function_msg_subscription_alarm_response_result = result;
- // Enum Field (returnCode)
- lengthInBits += 8;
- // Enum Field (transportSize)
- lengthInBits += 8;
+
+ // Simple Field (reserved01)
+ uint8_t reserved01 = 0;
+ _res = plc4c_spi_read_unsigned_byte(readBuffer, 8, (uint8_t*) &reserved01);
+ if(_res != OK) {
+ return _res;
+ }
+ (*_message)->s7_payload_user_data_item_cpu_function_msg_subscription_alarm_response_reserved01 = reserved01;
- // Implicit Field (dataLength)
- lengthInBits += 16;
- // Simple field (szlId)
- lengthInBits += plc4c_s7_read_write_szl_id_length_in_bits(_message->szl_id);
+
+ // Simple Field (alarmType)
+ plc4c_s7_read_write_alarm_type* alarmType;
+ _res = plc4c_s7_read_write_alarm_type_parse(readBuffer, (void*) &alarmType);
+ if(_res != OK) {
+ return _res;
+ }
+ (*_message)->s7_payload_user_data_item_cpu_function_msg_subscription_alarm_response_alarm_type = alarmType;
+
- // Simple field (szlIndex)
- lengthInBits += 16;
+
+ // Simple Field (reserved02)
+ uint8_t reserved02 = 0;
+ _res = plc4c_spi_read_unsigned_byte(readBuffer, 8, (uint8_t*) &reserved02);
+ if(_res != OK) {
+ return _res;
+ }
+ (*_message)->s7_payload_user_data_item_cpu_function_msg_subscription_alarm_response_reserved02 = reserved02;
- // Depending of the current type, add the length of sub-type elements ...
- switch(_message->_type) {
- case plc4c_s7_read_write_s7_payload_user_data_item_type_plc4c_s7_read_write_s7_payload_user_data_item_cpu_function_read_szl_request: {
- break;
+
+ // Simple Field (reserved03)
+ uint8_t reserved03 = 0;
+ _res = plc4c_spi_read_unsigned_byte(readBuffer, 8, (uint8_t*) &reserved03);
+ if(_res != OK) {
+ return _res;
}
- case plc4c_s7_read_write_s7_payload_user_data_item_type_plc4c_s7_read_write_s7_payload_user_data_item_cpu_function_read_szl_response: {
+ (*_message)->s7_payload_user_data_item_cpu_function_msg_subscription_alarm_response_reserved03 = reserved03;
- // Const Field (szlItemLength)
- lengthInBits += 16;
+ } else
+ if((cpuFunctionType == 0x04) && (cpuSubfunction == 0x0b)) { /* S7PayloadUserDataItemCpuFunctionAlarmAck */
+ (*_message)->_type = plc4c_s7_read_write_s7_payload_user_data_item_type_plc4c_s7_read_write_s7_payload_user_data_item_cpu_function_alarm_ack;
+
+ // Simple Field (functionId)
+ uint8_t functionId = 0;
+ _res = plc4c_spi_read_unsigned_byte(readBuffer, 8, (uint8_t*) &functionId);
+ if(_res != OK) {
+ return _res;
+ }
+ (*_message)->s7_payload_user_data_item_cpu_function_alarm_ack_function_id = functionId;
- // Implicit Field (szlItemCount)
- lengthInBits += 16;
+
+ // Implicit Field (numberOfObjects) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content)
+ uint8_t numberOfObjects = 0;
+ _res = plc4c_spi_read_unsigned_byte(readBuffer, 8, (uint8_t*) &numberOfObjects);
+ if(_res != OK) {
+ return _res;
+ }
- // Array field
- if(_message->s7_payload_user_data_item_cpu_function_read_szl_response_items != NULL) {
- plc4c_list_element* curElement = _message->s7_payload_user_data_item_cpu_function_read_szl_response_items->tail;
+
+ // Array field (messageObjects)
+ plc4c_list* messageObjects = NULL;
+ plc4c_utils_list_create(&messageObjects);
+ if(messageObjects == NULL) {
+ return NO_MEMORY;
+ }
+ {
+ // Count array
+ uint16_t itemCount = numberOfObjects;
+ for(int curItem = 0; curItem < itemCount; curItem++) {
+ bool lastItem = curItem == (itemCount - 1);
+ plc4c_s7_read_write_alarm_message_object_ack_type* _value = NULL;
+ _res = plc4c_s7_read_write_alarm_message_object_ack_type_parse(readBuffer, (void*) &_value);
+ if(_res != OK) {
+ return _res;
+ }
+ plc4c_utils_list_insert_head_value(messageObjects, _value);
+ }
+ }
+ (*_message)->s7_payload_user_data_item_cpu_function_alarm_ack_message_objects = messageObjects;
+
+ } else
+ if((cpuFunctionType == 0x08) && (cpuSubfunction == 0x0b)) { /* S7PayloadUserDataItemCpuFunctionAlarmAckResponse */
+ (*_message)->_type = plc4c_s7_read_write_s7_payload_user_data_item_type_plc4c_s7_read_write_s7_payload_user_data_item_cpu_function_alarm_ack_response;
+
+ // Simple Field (functionId)
+ uint8_t functionId = 0;
+ _res = plc4c_spi_read_unsigned_byte(readBuffer, 8, (uint8_t*) &functionId);
+ if(_res != OK) {
+ return _res;
+ }
+ (*_message)->s7_payload_user_data_item_cpu_function_alarm_ack_response_function_id = functionId;
+
+
+
+ // Implicit Field (numberOfObjects) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content)
+ uint8_t numberOfObjects = 0;
+ _res = plc4c_spi_read_unsigned_byte(readBuffer, 8, (uint8_t*) &numberOfObjects);
+ if(_res != OK) {
+ return _res;
+ }
+
+
+
+ // Array field (messageObjects)
+ plc4c_list* messageObjects = NULL;
+ plc4c_utils_list_create(&messageObjects);
+ if(messageObjects == NULL) {
+ return NO_MEMORY;
+ }
+ {
+ // Count array
+ uint16_t itemCount = numberOfObjects;
+ for(int curItem = 0; curItem < itemCount; curItem++) {
+
+ uint8_t* _value = malloc(sizeof(uint8_t));
+ _res = plc4c_spi_read_unsigned_byte(readBuffer, 8, (uint8_t*) _value);
+ if(_res != OK) {
+ return _res;
+ }
+ plc4c_utils_list_insert_head_value(messageObjects, _value);
+ }
+ }
+ (*_message)->s7_payload_user_data_item_cpu_function_alarm_ack_response_message_objects = messageObjects;
+
+ } else
+ if((cpuFunctionType == 0x04) && (cpuSubfunction == 0x13)) { /* S7PayloadUserDataItemCpuFunctionAlarmQuery */
+ (*_message)->_type = plc4c_s7_read_write_s7_payload_user_data_item_type_plc4c_s7_read_write_s7_payload_user_data_item_cpu_function_alarm_query;
+
+ // Const Field (functionId)
+ uint8_t functionId = 0;
+ _res = plc4c_spi_read_unsigned_byte(readBuffer, 8, (uint8_t*) &functionId);
+ if(_res != OK) {
+ return _res;
+ }
+ if(functionId != PLC4C_S7_READ_WRITE_S7_PAYLOAD_USER_DATA_ITEM_CPU_FUNCTION_ALARM_QUERY_FUNCTION_ID()) {
+ return PARSE_ERROR;
+ // throw new ParseException("Expected constant value " + PLC4C_S7_READ_WRITE_S7_PAYLOAD_USER_DATA_ITEM_CPU_FUNCTION_ALARM_QUERY_FUNCTION_ID + " but got " + functionId);
+ }
+
+
+
+ // Const Field (numberMessageObj)
+ uint8_t numberMessageObj = 0;
+ _res = plc4c_spi_read_unsigned_byte(readBuffer, 8, (uint8_t*) &numberMessageObj);
+ if(_res != OK) {
+ return _res;
+ }
+ if(numberMessageObj != PLC4C_S7_READ_WRITE_S7_PAYLOAD_USER_DATA_ITEM_CPU_FUNCTION_ALARM_QUERY_NUMBER_MESSAGE_OBJ()) {
+ return PARSE_ERROR;
+ // throw new ParseException("Expected constant value " + PLC4C_S7_READ_WRITE_S7_PAYLOAD_USER_DATA_ITEM_CPU_FUNCTION_ALARM_QUERY_NUMBER_MESSAGE_OBJ + " but got " + numberMessageObj);
+ }
+
+
+
+ // Const Field (variableSpec)
+ uint8_t variableSpec = 0;
+ _res = plc4c_spi_read_unsigned_byte(readBuffer, 8, (uint8_t*) &variableSpec);
+ if(_res != OK) {
+ return _res;
+ }
+ if(variableSpec != PLC4C_S7_READ_WRITE_S7_PAYLOAD_USER_DATA_ITEM_CPU_FUNCTION_ALARM_QUERY_VARIABLE_SPEC()) {
+ return PARSE_ERROR;
+ // throw new ParseException("Expected constant value " + PLC4C_S7_READ_WRITE_S7_PAYLOAD_USER_DATA_ITEM_CPU_FUNCTION_ALARM_QUERY_VARIABLE_SPEC + " but got " + variableSpec);
+ }
+
+
+
+ // Const Field (length)
+ uint8_t length = 0;
+ _res = plc4c_spi_read_unsigned_byte(readBuffer, 8, (uint8_t*) &length);
+ if(_res != OK) {
+ return _res;
+ }
+ if(length != PLC4C_S7_READ_WRITE_S7_PAYLOAD_USER_DATA_ITEM_CPU_FUNCTION_ALARM_QUERY_LENGTH()) {
+ return PARSE_ERROR;
+ // throw new ParseException("Expected constant value " + PLC4C_S7_READ_WRITE_S7_PAYLOAD_USER_DATA_ITEM_CPU_FUNCTION_ALARM_QUERY_LENGTH + " but got " + length);
+ }
+
+
+
+ // Enum field (syntaxId)
+ plc4c_s7_read_write_syntax_id_type syntaxId = plc4c_s7_read_write_syntax_id_type_null();
+ _res = plc4c_spi_read_unsigned_byte(readBuffer, 8, (uint8_t*) &syntaxId);
+ if(_res != OK) {
+ return _res;
+ }
+ (*_message)->s7_payload_user_data_item_cpu_function_alarm_query_syntax_id = syntaxId;
+
+
+
+ // Reserved Field (Compartmentalized so the "reserved" variable can't leak)
+ {
+ uint8_t _reserved = 0;
+ _res = plc4c_spi_read_unsigned_byte(readBuffer, 8, (uint8_t*) &_reserved);
+ if(_res != OK) {
+ return _res;
+ }
+ if(_reserved != 0x00) {
+ printf("Expected constant value '%d' but got '%d' for reserved field.", 0x00, _reserved);
+ }
+ }
+
+
+
+ // Enum field (queryType)
+ plc4c_s7_read_write_query_type queryType = plc4c_s7_read_write_query_type_null();
+ _res = plc4c_spi_read_unsigned_byte(readBuffer, 8, (uint8_t*) &queryType);
+ if(_res != OK) {
+ return _res;
+ }
+ (*_message)->s7_payload_user_data_item_cpu_function_alarm_query_query_type = queryType;
+
+
+
+ // Reserved Field (Compartmentalized so the "reserved" variable can't leak)
+ {
+ uint8_t _reserved = 0;
+ _res = plc4c_spi_read_unsigned_byte(readBuffer, 8, (uint8_t*) &_reserved);
+ if(_res != OK) {
+ return _res;
+ }
+ if(_reserved != 0x34) {
+ printf("Expected constant value '%d' but got '%d' for reserved field.", 0x34, _reserved);
+ }
+ }
+
+
+
+ // Enum field (alarmType)
+ plc4c_s7_read_write_alarm_type alarmType = plc4c_s7_read_write_alarm_type_null();
+ _res = plc4c_spi_read_unsigned_byte(readBuffer, 8, (uint8_t*) &alarmType);
+ if(_res != OK) {
+ return _res;
+ }
+ (*_message)->s7_payload_user_data_item_cpu_function_alarm_query_alarm_type = alarmType;
+
+ } else
+ if((cpuFunctionType == 0x08) && (cpuSubfunction == 0x13)) { /* S7PayloadUserDataItemCpuFunctionAlarmQueryResponse */
+ (*_message)->_type = plc4c_s7_read_write_s7_payload_user_data_item_type_plc4c_s7_read_write_s7_payload_user_data_item_cpu_function_alarm_query_response;
+
+ // Const Field (functionId)
+ uint8_t functionId = 0;
+ _res = plc4c_spi_read_unsigned_byte(readBuffer, 8, (uint8_t*) &functionId);
+ if(_res != OK) {
+ return _res;
+ }
+ if(functionId != PLC4C_S7_READ_WRITE_S7_PAYLOAD_USER_DATA_ITEM_CPU_FUNCTION_ALARM_QUERY_RESPONSE_FUNCTION_ID()) {
+ return PARSE_ERROR;
+ // throw new ParseException("Expected constant value " + PLC4C_S7_READ_WRITE_S7_PAYLOAD_USER_DATA_ITEM_CPU_FUNCTION_ALARM_QUERY_RESPONSE_FUNCTION_ID + " but got " + functionId);
+ }
+
+
+
+ // Const Field (numberMessageObj)
+ uint8_t numberMessageObj = 0;
+ _res = plc4c_spi_read_unsigned_byte(readBuffer, 8, (uint8_t*) &numberMessageObj);
+ if(_res != OK) {
+ return _res;
+ }
+ if(numberMessageObj != PLC4C_S7_READ_WRITE_S7_PAYLOAD_USER_DATA_ITEM_CPU_FUNCTION_ALARM_QUERY_RESPONSE_NUMBER_MESSAGE_OBJ()) {
+ return PARSE_ERROR;
+ // throw new ParseException("Expected constant value " + PLC4C_S7_READ_WRITE_S7_PAYLOAD_USER_DATA_ITEM_CPU_FUNCTION_ALARM_QUERY_RESPONSE_NUMBER_MESSAGE_OBJ + " but got " + numberMessageObj);
+ }
+
+
+
+ // Enum field (pudicfReturnCode)
+ plc4c_s7_read_write_data_transport_error_code pudicfReturnCode = plc4c_s7_read_write_data_transport_error_code_null();
+ _res = plc4c_spi_read_unsigned_byte(readBuffer, 8, (uint8_t*) &pudicfReturnCode);
+ if(_res != OK) {
+ return _res;
+ }
+ (*_message)->s7_payload_user_data_item_cpu_function_alarm_query_response_pudicf_return_code = pudicfReturnCode;
+
+
+
+ // Enum field (pudicftransportSize)
+ plc4c_s7_read_write_data_transport_size pudicftransportSize = plc4c_s7_read_write_data_transport_size_null();
+ _res = plc4c_spi_read_unsigned_byte(readBuffer, 8, (uint8_t*) &pudicftransportSize);
+ if(_res != OK) {
+ return _res;
+ }
+ (*_message)->s7_payload_user_data_item_cpu_function_alarm_query_response_pudicftransport_size = pudicftransportSize;
+
+
+
+ // Reserved Field (Compartmentalized so the "reserved" variable can't leak)
+ {
+ uint8_t _reserved = 0;
+ _res = plc4c_spi_read_unsigned_byte(readBuffer, 8, (uint8_t*) &_reserved);
+ if(_res != OK) {
+ return _res;
+ }
+ if(_reserved != 0x00) {
+ printf("Expected constant value '%d' but got '%d' for reserved field.", 0x00, _reserved);
+ }
+ }
+
+ }
+
+ return OK;
+}
+
+plc4c_return_code plc4c_s7_read_write_s7_payload_user_data_item_serialize(plc4c_spi_write_buffer* writeBuffer, plc4c_s7_read_write_s7_payload_user_data_item* _message) {
+ plc4c_return_code _res = OK;
+
+ // Enum field (returnCode)
+ _res = plc4c_spi_write_unsigned_byte(writeBuffer, 8, _message->return_code);
+ if(_res != OK) {
+ return _res;
+ }
+
+ // Enum field (transportSize)
+ _res = plc4c_spi_write_unsigned_byte(writeBuffer, 8, _message->transport_size);
+ if(_res != OK) {
+ return _res;
+ }
+
+ // Implicit Field (dataLength) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content)
+ _res = plc4c_spi_write_unsigned_short(writeBuffer, 16, (plc4c_s7_read_write_s7_payload_user_data_item_length_in_bytes(_message)) - (4));
+ if(_res != OK) {
+ return _res;
+ }
+
+ // Switch Field (Depending of the current type, serialize the sub-type elements)
+ switch(_message->_type) {
+ case plc4c_s7_read_write_s7_payload_user_data_item_type_plc4c_s7_read_write_s7_payload_diagnostic_message: {
+
+ // Simple Field (EventId)
+ _res = plc4c_spi_write_unsigned_short(writeBuffer, 16, _message->s7_payload_diagnostic_message_event_id);
+ if(_res != OK) {
+ return _res;
+ }
+
+ // Simple Field (PriorityClass)
+ _res = plc4c_spi_write_unsigned_byte(writeBuffer, 8, _message->s7_payload_diagnostic_message_priority_class);
+ if(_res != OK) {
+ return _res;
+ }
+
+ // Simple Field (ObNumber)
+ _res = plc4c_spi_write_unsigned_byte(writeBuffer, 8, _message->s7_payload_diagnostic_message_ob_number);
+ if(_res != OK) {
+ return _res;
+ }
+
+ // Simple Field (DatId)
+ _res = plc4c_spi_write_unsigned_short(writeBuffer, 16, _message->s7_payload_diagnostic_message_dat_id);
+ if(_res != OK) {
+ return _res;
+ }
+
+ // Simple Field (Info1)
+ _res = plc4c_spi_write_unsigned_short(writeBuffer, 16, _message->s7_payload_diagnostic_message_info1);
+ if(_res != OK) {
+ return _res;
+ }
+
+ // Simple Field (Info2)
+ _res = plc4c_spi_write_unsigned_int(writeBuffer, 32, _message->s7_payload_diagnostic_message_info2);
+ if(_res != OK) {
+ return _res;
+ }
+
+ // Simple Field (TimeStamp)
+ _res = plc4c_s7_read_write_date_and_time_serialize(writeBuffer, _message->s7_payload_diagnostic_message_time_stamp);
+ if(_res != OK) {
+ return _res;
+ }
+
+ break;
+ }
+ case plc4c_s7_read_write_s7_payload_user_data_item_type_plc4c_s7_read_write_s7_payload_alarm8: {
+
+ // Simple Field (alarmMessage)
+ _res = plc4c_s7_read_write_alarm_message_push_type_serialize(writeBuffer, _message->s7_payload_alarm8_alarm_message);
+ if(_res != OK) {
+ return _res;
+ }
+
+ break;
+ }
+ case plc4c_s7_read_write_s7_payload_user_data_item_type_plc4c_s7_read_write_s7_payload_notify: {
+
+ // Simple Field (alarmMessage)
+ _res = plc4c_s7_read_write_alarm_message_push_type_serialize(writeBuffer, _message->s7_payload_notify_alarm_message);
+ if(_res != OK) {
+ return _res;
+ }
+
+ break;
+ }
+ case plc4c_s7_read_write_s7_payload_user_data_item_type_plc4c_s7_read_write_s7_payload_alarm_ack_ind: {
+
+ // Simple Field (alarmMessage)
+ _res = plc4c_s7_read_write_alarm_message_ack_push_type_serialize(writeBuffer, _message->s7_payload_alarm_ack_ind_alarm_message);
+ if(_res != OK) {
+ return _res;
+ }
+
+ break;
+ }
+ case plc4c_s7_read_write_s7_payload_user_data_item_type_plc4c_s7_read_write_s7_payload_alarm_sq: {
+
+ // Simple Field (alarmMessage)
+ _res = plc4c_s7_read_write_alarm_message_push_type_serialize(writeBuffer, _message->s7_payload_alarm_sq_alarm_message);
+ if(_res != OK) {
+ return _res;
+ }
+
+ break;
+ }
+ case plc4c_s7_read_write_s7_payload_user_data_item_type_plc4c_s7_read_write_s7_payload_alarm_s: {
+
+ // Simple Field (alarmMessage)
+ _res = plc4c_s7_read_write_alarm_message_push_type_serialize(writeBuffer, _message->s7_payload_alarm_s_alarm_message);
+ if(_res != OK) {
+ return _res;
+ }
+
+ break;
+ }
+ case plc4c_s7_read_write_s7_payload_user_data_item_type_plc4c_s7_read_write_s7_payload_alarm_sc: {
+
+ // Simple Field (alarmMessage)
+ _res = plc4c_s7_read_write_alarm_message_push_type_serialize(writeBuffer, _message->s7_payload_alarm_sc_alarm_message);
+ if(_res != OK) {
+ return _res;
+ }
+
+ break;
+ }
+ case plc4c_s7_read_write_s7_payload_user_data_item_type_plc4c_s7_read_write_s7_payload_notify8: {
+
+ // Simple Field (alarmMessage)
+ _res = plc4c_s7_read_write_alarm_message_push_type_serialize(writeBuffer, _message->s7_payload_notify8_alarm_message);
+ if(_res != OK) {
+ return _res;
+ }
+
+ break;
+ }
+ case plc4c_s7_read_write_s7_payload_user_data_item_type_plc4c_s7_read_write_s7_payload_user_data_item_cpu_function_read_szl_request: {
+
+ // Simple Field (szlId)
+ _res = plc4c_s7_read_write_szl_id_serialize(writeBuffer, _message->s7_payload_user_data_item_cpu_function_read_szl_request_szl_id);
+ if(_res != OK) {
+ return _res;
+ }
+
+ // Simple Field (szlIndex)
+ _res = plc4c_spi_write_unsigned_short(writeBuffer, 16, _message->s7_payload_user_data_item_cpu_function_read_szl_request_szl_index);
+ if(_res != OK) {
+ return _res;
+ }
+
+ break;
+ }
+ case plc4c_s7_read_write_s7_payload_user_data_item_type_plc4c_s7_read_write_s7_payload_user_data_item_cpu_function_read_szl_response: {
+
+ // Simple Field (szlId)
+ _res = plc4c_s7_read_write_szl_id_serialize(writeBuffer, _message->s7_payload_user_data_item_cpu_function_read_szl_response_szl_id);
+ if(_res != OK) {
+ return _res;
+ }
+
+ // Simple Field (szlIndex)
+ _res = plc4c_spi_write_unsigned_short(writeBuffer, 16, _message->s7_payload_user_data_item_cpu_function_read_szl_response_szl_index);
+ if(_res != OK) {
+ return _res;
+ }
+
+ // Const Field (szlItemLength)
+ plc4c_spi_write_unsigned_short(writeBuffer, 16, PLC4C_S7_READ_WRITE_S7_PAYLOAD_USER_DATA_ITEM_CPU_FUNCTION_READ_SZL_RESPONSE_SZL_ITEM_LENGTH());
+
+ // Implicit Field (szlItemCount) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content)
+ _res = plc4c_spi_write_unsigned_short(writeBuffer, 16, plc4c_spi_evaluation_helper_count(_message->s7_payload_user_data_item_cpu_function_read_szl_response_items));
+ if(_res != OK) {
+ return _res;
+ }
+
+ // Array field (items)
+ {
+ uint8_t itemCount = plc4c_utils_list_size(_message->s7_payload_user_data_item_cpu_function_read_szl_response_items);
+ for(int curItem = 0; curItem < itemCount; curItem++) {
+ bool lastItem = curItem == (itemCount - 1);
+ plc4c_s7_read_write_szl_data_tree_item* _value = (plc4c_s7_read_write_szl_data_tree_item*) plc4c_utils_list_get_value(_message->s7_payload_user_data_item_cpu_function_read_szl_response_items, curItem);
+ _res = plc4c_s7_read_write_szl_data_tree_item_serialize(writeBuffer, (void*) _value);
+ if(_res != OK) {
+ return _res;
+ }
+ }
+ }
+
+ break;
+ }
+ case plc4c_s7_read_write_s7_payload_user_data_item_type_plc4c_s7_read_write_s7_payload_user_data_item_cpu_function_msg_subscription: {
+
+ // Simple Field (Subscription)
+ _res = plc4c_spi_write_unsigned_byte(writeBuffer, 8, _message->s7_payload_user_data_item_cpu_function_msg_subscription_subscription);
+ if(_res != OK) {
+ return _res;
+ }
+
+ // Reserved Field
+ _res = plc4c_spi_write_unsigned_byte(writeBuffer, 8, 0x00);
+ if(_res != OK) {
+ return _res;
+ }
+
+ // Simple Field (magicKey)
+ _res = plc4c_spi_write_string(writeBuffer, 64, "'UTF-8'", _message->s7_payload_user_data_item_cpu_function_msg_subscription_magic_key);
+ if(_res != OK) {
+ return _res;
+ }
+
+ // Optional Field (Alarmtype)
+ if(_message->s7_payload_user_data_item_cpu_function_msg_subscription_alarmtype != NULL) {
+ _res = plc4c_s7_read_write_alarm_state_type_serialize(writeBuffer, _message->s7_payload_user_data_item_cpu_function_msg_subscription_alarmtype);
+ if(_res != OK) {
+ return _res;
+ }
+ }
+
+ // Optional Field (Reserve)
+ if(_message->s7_payload_user_data_item_cpu_function_msg_subscription_reserve != NULL) {
+ _res = plc4c_spi_write_unsigned_byte(writeBuffer, 8, *_message->s7_payload_user_data_item_cpu_function_msg_subscription_reserve);
+ if(_res != OK) {
+ return _res;
+ }
+ }
+
+ break;
+ }
+ case plc4c_s7_read_write_s7_payload_user_data_item_type_plc4c_s7_read_write_s7_payload_user_data_item_cpu_function_msg_subscription_response: {
+
+ break;
+ }
+ case plc4c_s7_read_write_s7_payload_user_data_item_type_plc4c_s7_read_write_s7_payload_user_data_item_cpu_function_msg_subscription_sys_response: {
+
+ // Simple Field (result)
+ _res = plc4c_spi_write_unsigned_byte(writeBuffer, 8, _message->s7_payload_user_data_item_cpu_function_msg_subscription_sys_response_result);
+ if(_res != OK) {
+ return _res;
+ }
+
+ // Simple Field (reserved01)
+ _res = plc4c_spi_write_unsigned_byte(writeBuffer, 8, _message->s7_payload_user_data_item_cpu_function_msg_subscription_sys_response_reserved01);
+ if(_res != OK) {
+ return _res;
+ }
+
+ break;
+ }
+ case plc4c_s7_read_write_s7_payload_user_data_item_type_plc4c_s7_read_write_s7_payload_user_data_item_cpu_function_msg_subscription_alarm_response: {
+
+ // Simple Field (result)
+ _res = plc4c_spi_write_unsigned_byte(writeBuffer, 8, _message->s7_payload_user_data_item_cpu_function_msg_subscription_alarm_response_result);
+ if(_res != OK) {
+ return _res;
+ }
+
+ // Simple Field (reserved01)
+ _res = plc4c_spi_write_unsigned_byte(writeBuffer, 8, _message->s7_payload_user_data_item_cpu_function_msg_subscription_alarm_response_reserved01);
+ if(_res != OK) {
+ return _res;
+ }
+
+ // Simple Field (alarmType)
+ _res = plc4c_s7_read_write_alarm_type_serialize(writeBuffer, _message->s7_payload_user_data_item_cpu_function_msg_subscription_alarm_response_alarm_type);
+ if(_res != OK) {
+ return _res;
+ }
+
+ // Simple Field (reserved02)
+ _res = plc4c_spi_write_unsigned_byte(writeBuffer, 8, _message->s7_payload_user_data_item_cpu_function_msg_subscription_alarm_response_reserved02);
+ if(_res != OK) {
+ return _res;
+ }
+
+ // Simple Field (reserved03)
+ _res = plc4c_spi_write_unsigned_byte(writeBuffer, 8, _message->s7_payload_user_data_item_cpu_function_msg_subscription_alarm_response_reserved03);
+ if(_res != OK) {
+ return _res;
+ }
+
+ break;
+ }
+ case plc4c_s7_read_write_s7_payload_user_data_item_type_plc4c_s7_read_write_s7_payload_user_data_item_cpu_function_alarm_ack: {
+
+ // Simple Field (functionId)
+ _res = plc4c_spi_write_unsigned_byte(writeBuffer, 8, _message->s7_payload_user_data_item_cpu_function_alarm_ack_function_id);
+ if(_res != OK) {
+ return _res;
+ }
+
+ // Implicit Field (numberOfObjects) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content)
+ _res = plc4c_spi_write_unsigned_byte(writeBuffer, 8, plc4c_spi_evaluation_helper_count(_message->s7_payload_user_data_item_cpu_function_alarm_ack_message_objects));
+ if(_res != OK) {
+ return _res;
+ }
+
+ // Array field (messageObjects)
+ {
+ uint8_t itemCount = plc4c_utils_list_size(_message->s7_payload_user_data_item_cpu_function_alarm_ack_message_objects);
+ for(int curItem = 0; curItem < itemCount; curItem++) {
+ bool lastItem = curItem == (itemCount - 1);
+ plc4c_s7_read_write_alarm_message_object_ack_type* _value = (plc4c_s7_read_write_alarm_message_object_ack_type*) plc4c_utils_list_get_value(_message->s7_payload_user_data_item_cpu_function_alarm_ack_message_objects, curItem);
+ _res = plc4c_s7_read_write_alarm_message_object_ack_type_serialize(writeBuffer, (void*) _value);
+ if(_res != OK) {
+ return _res;
+ }
+ }
+ }
+
+ break;
+ }
+ case plc4c_s7_read_write_s7_payload_user_data_item_type_plc4c_s7_read_write_s7_payload_user_data_item_cpu_function_alarm_ack_response: {
+
+ // Simple Field (functionId)
+ _res = plc4c_spi_write_unsigned_byte(writeBuffer, 8, _message->s7_payload_user_data_item_cpu_function_alarm_ack_response_function_id);
+ if(_res != OK) {
+ return _res;
+ }
+
+ // Implicit Field (numberOfObjects) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content)
+ _res = plc4c_spi_write_unsigned_byte(writeBuffer, 8, plc4c_spi_evaluation_helper_count(_message->s7_payload_user_data_item_cpu_function_alarm_ack_response_message_objects));
+ if(_res != OK) {
+ return _res;
+ }
+
+ // Array field (messageObjects)
+ {
+ uint8_t itemCount = plc4c_utils_list_size(_message->s7_payload_user_data_item_cpu_function_alarm_ack_response_message_objects);
+ for(int curItem = 0; curItem < itemCount; curItem++) {
+
+ uint8_t* _value = (uint8_t*) plc4c_utils_list_get_value(_message->s7_payload_user_data_item_cpu_function_alarm_ack_response_message_objects, curItem);
+ plc4c_spi_write_unsigned_byte(writeBuffer, 8, *_value);
+ }
+ }
+
+ break;
+ }
+ case plc4c_s7_read_write_s7_payload_user_data_item_type_plc4c_s7_read_write_s7_payload_user_data_item_cpu_function_alarm_query: {
+
+ // Const Field (functionId)
+ plc4c_spi_write_unsigned_byte(writeBuffer, 8, PLC4C_S7_READ_WRITE_S7_PAYLOAD_USER_DATA_ITEM_CPU_FUNCTION_ALARM_QUERY_FUNCTION_ID());
+
+ // Const Field (numberMessageObj)
+ plc4c_spi_write_unsigned_byte(writeBuffer, 8, PLC4C_S7_READ_WRITE_S7_PAYLOAD_USER_DATA_ITEM_CPU_FUNCTION_ALARM_QUERY_NUMBER_MESSAGE_OBJ());
+
+ // Const Field (variableSpec)
+ plc4c_spi_write_unsigned_byte(writeBuffer, 8, PLC4C_S7_READ_WRITE_S7_PAYLOAD_USER_DATA_ITEM_CPU_FUNCTION_ALARM_QUERY_VARIABLE_SPEC());
+
+ // Const Field (length)
+ plc4c_spi_write_unsigned_byte(writeBuffer, 8, PLC4C_S7_READ_WRITE_S7_PAYLOAD_USER_DATA_ITEM_CPU_FUNCTION_ALARM_QUERY_LENGTH());
+
+ // Enum field (syntaxId)
+ _res = plc4c_spi_write_unsigned_byte(writeBuffer, 8, _message->s7_payload_user_data_item_cpu_function_alarm_query_syntax_id);
+ if(_res != OK) {
+ return _res;
+ }
+
+ // Reserved Field
+ _res = plc4c_spi_write_unsigned_byte(writeBuffer, 8, 0x00);
+ if(_res != OK) {
+ return _res;
+ }
+
+ // Enum field (queryType)
+ _res = plc4c_spi_write_unsigned_byte(writeBuffer, 8, _message->s7_payload_user_data_item_cpu_function_alarm_query_query_type);
+ if(_res != OK) {
+ return _res;
+ }
+
+ // Reserved Field
+ _res = plc4c_spi_write_unsigned_byte(writeBuffer, 8, 0x34);
+ if(_res != OK) {
+ return _res;
+ }
+
+ // Enum field (alarmType)
+ _res = plc4c_spi_write_unsigned_byte(writeBuffer, 8, _message->s7_payload_user_data_item_cpu_function_alarm_query_alarm_type);
+ if(_res != OK) {
+ return _res;
+ }
+
+ break;
+ }
+ case plc4c_s7_read_write_s7_payload_user_data_item_type_plc4c_s7_read_write_s7_payload_user_data_item_cpu_function_alarm_query_response: {
+
+ // Const Field (functionId)
+ plc4c_spi_write_unsigned_byte(writeBuffer, 8, PLC4C_S7_READ_WRITE_S7_PAYLOAD_USER_DATA_ITEM_CPU_FUNCTION_ALARM_QUERY_RESPONSE_FUNCTION_ID());
+
+ // Const Field (numberMessageObj)
+ plc4c_spi_write_unsigned_byte(writeBuffer, 8, PLC4C_S7_READ_WRITE_S7_PAYLOAD_USER_DATA_ITEM_CPU_FUNCTION_ALARM_QUERY_RESPONSE_NUMBER_MESSAGE_OBJ());
+
+ // Enum field (pudicfReturnCode)
+ _res = plc4c_spi_write_unsigned_byte(writeBuffer, 8, _message->s7_payload_user_data_item_cpu_function_alarm_query_response_pudicf_return_code);
+ if(_res != OK) {
+ return _res;
+ }
+
+ // Enum field (pudicftransportSize)
+ _res = plc4c_spi_write_unsigned_byte(writeBuffer, 8, _message->s7_payload_user_data_item_cpu_function_alarm_query_response_pudicftransport_size);
+ if(_res != OK) {
+ return _res;
+ }
+
+ // Reserved Field
+ _res = plc4c_spi_write_unsigned_byte(writeBuffer, 8, 0x00);
+ if(_res != OK) {
+ return _res;
+ }
+
+ break;
+ }
+ }
+
+ return OK;
+}
+
+uint16_t plc4c_s7_read_write_s7_payload_user_data_item_length_in_bytes(plc4c_s7_read_write_s7_payload_user_data_item* _message) {
+ return plc4c_s7_read_write_s7_payload_user_data_item_length_in_bits(_message) / 8;
+}
+
+uint16_t plc4c_s7_read_write_s7_payload_user_data_item_length_in_bits(plc4c_s7_read_write_s7_payload_user_data_item* _message) {
+ uint16_t lengthInBits = 0;
+
+ // Enum Field (returnCode)
+ lengthInBits += 8;
+
+ // Enum Field (transportSize)
+ lengthInBits += 8;
+
+ // Implicit Field (dataLength)
+ lengthInBits += 16;
+
+ // Depending of the current type, add the length of sub-type elements ...
+ switch(_message->_type) {
+ case plc4c_s7_read_write_s7_payload_user_data_item_type_plc4c_s7_read_write_s7_payload_diagnostic_message: {
+
+ // Simple field (EventId)
+ lengthInBits += 16;
+
+
+ // Simple field (PriorityClass)
+ lengthInBits += 8;
+
+
+ // Simple field (ObNumber)
+ lengthInBits += 8;
+
+
+ // Simple field (DatId)
+ lengthInBits += 16;
+
+
+ // Simple field (Info1)
+ lengthInBits += 16;
+
+
+ // Simple field (Info2)
+ lengthInBits += 32;
+
+
+ // Simple field (TimeStamp)
+ lengthInBits += plc4c_s7_read_write_date_and_time_length_in_bits(_message->s7_payload_diagnostic_message_time_stamp);
+
+ break;
+ }
+ case plc4c_s7_read_write_s7_payload_user_data_item_type_plc4c_s7_read_write_s7_payload_alarm8: {
+
+ // Simple field (alarmMessage)
+ lengthInBits += plc4c_s7_read_write_alarm_message_push_type_length_in_bits(_message->s7_payload_alarm8_alarm_message);
+
+ break;
+ }
+ case plc4c_s7_read_write_s7_payload_user_data_item_type_plc4c_s7_read_write_s7_payload_notify: {
+
+ // Simple field (alarmMessage)
+ lengthInBits += plc4c_s7_read_write_alarm_message_push_type_length_in_bits(_message->s7_payload_notify_alarm_message);
+
+ break;
+ }
+ case plc4c_s7_read_write_s7_payload_user_data_item_type_plc4c_s7_read_write_s7_payload_alarm_ack_ind: {
+
+ // Simple field (alarmMessage)
+ lengthInBits += plc4c_s7_read_write_alarm_message_ack_push_type_length_in_bits(_message->s7_payload_alarm_ack_ind_alarm_message);
+
+ break;
+ }
+ case plc4c_s7_read_write_s7_payload_user_data_item_type_plc4c_s7_read_write_s7_payload_alarm_sq: {
+
+ // Simple field (alarmMessage)
+ lengthInBits += plc4c_s7_read_write_alarm_message_push_type_length_in_bits(_message->s7_payload_alarm_sq_alarm_message);
+
+ break;
+ }
+ case plc4c_s7_read_write_s7_payload_user_data_item_type_plc4c_s7_read_write_s7_payload_alarm_s: {
+
+ // Simple field (alarmMessage)
+ lengthInBits += plc4c_s7_read_write_alarm_message_push_type_length_in_bits(_message->s7_payload_alarm_s_alarm_message);
+
+ break;
+ }
+ case plc4c_s7_read_write_s7_payload_user_data_item_type_plc4c_s7_read_write_s7_payload_alarm_sc: {
+
+ // Simple field (alarmMessage)
+ lengthInBits += plc4c_s7_read_write_alarm_message_push_type_length_in_bits(_message->s7_payload_alarm_sc_alarm_message);
+
+ break;
+ }
+ case plc4c_s7_read_write_s7_payload_user_data_item_type_plc4c_s7_read_write_s7_payload_notify8: {
+
+ // Simple field (alarmMessage)
+ lengthInBits += plc4c_s7_read_write_alarm_message_push_type_length_in_bits(_message->s7_payload_notify8_alarm_message);
+
+ break;
+ }
+ case plc4c_s7_read_write_s7_payload_user_data_item_type_plc4c_s7_read_write_s7_payload_user_data_item_cpu_function_read_szl_request: {
+
+ // Simple field (szlId)
+ lengthInBits += plc4c_s7_read_write_szl_id_length_in_bits(_message->s7_payload_user_data_item_cpu_function_read_szl_request_szl_id);
+
+
+ // Simple field (szlIndex)
+ lengthInBits += 16;
+
+ break;
+ }
+ case plc4c_s7_read_write_s7_payload_user_data_item_type_plc4c_s7_read_write_s7_payload_user_data_item_cpu_function_read_szl_response: {
+
+ // Simple field (szlId)
+ lengthInBits += plc4c_s7_read_write_szl_id_length_in_bits(_message->s7_payload_user_data_item_cpu_function_read_szl_response_szl_id);
+
+
+ // Simple field (szlIndex)
+ lengthInBits += 16;
+
+
+ // Const Field (szlItemLength)
+ lengthInBits += 16;
+
+
+ // Implicit Field (szlItemCount)
+ lengthInBits += 16;
+
+
+ // Array field
+ if(_message->s7_payload_user_data_item_cpu_function_read_szl_response_items != NULL) {
+ plc4c_list_element* curElement = _message->s7_payload_user_data_item_cpu_function_read_szl_response_items->tail;
while (curElement != NULL) {
lengthInBits += plc4c_s7_read_write_szl_data_tree_item_length_in_bits((plc4c_s7_read_write_szl_data_tree_item*) curElement->value);
curElement = curElement->next;
@@ -278,6 +1343,169 @@ uint16_t plc4c_s7_read_write_s7_payload_user_data_item_length_in_bits(plc4c_s7_r
break;
}
+ case plc4c_s7_read_write_s7_payload_user_data_item_type_plc4c_s7_read_write_s7_payload_user_data_item_cpu_function_msg_subscription: {
+
+ // Simple field (Subscription)
+ lengthInBits += 8;
+
+
+ // Reserved Field (reserved)
+ lengthInBits += 8;
+
+
+ // Simple field (magicKey)
+ lengthInBits += -1;
+
+
+ // Optional Field (Alarmtype)
+ if(_message->s7_payload_user_data_item_cpu_function_msg_subscription_alarmtype != NULL) {
+ lengthInBits += plc4c_s7_read_write_alarm_state_type_length_in_bits(_message->s7_payload_user_data_item_cpu_function_msg_subscription_alarmtype);
+ }
+
+
+ // Optional Field (Reserve)
+ if(_message->s7_payload_user_data_item_cpu_function_msg_subscription_reserve != NULL) {
+ lengthInBits += 8;
+ }
+
+ break;
+ }
+ case plc4c_s7_read_write_s7_payload_user_data_item_type_plc4c_s7_read_write_s7_payload_user_data_item_cpu_function_msg_subscription_response: {
+
+ break;
+ }
+ case plc4c_s7_read_write_s7_payload_user_data_item_type_plc4c_s7_read_write_s7_payload_user_data_item_cpu_function_msg_subscription_sys_response: {
+
+ // Simple field (result)
+ lengthInBits += 8;
+
+
+ // Simple field (reserved01)
+ lengthInBits += 8;
+
+ break;
+ }
+ case plc4c_s7_read_write_s7_payload_user_data_item_type_plc4c_s7_read_write_s7_payload_user_data_item_cpu_function_msg_subscription_alarm_response: {
+
+ // Simple field (result)
+ lengthInBits += 8;
+
+
+ // Simple field (reserved01)
+ lengthInBits += 8;
+
+
+ // Simple field (alarmType)
+ lengthInBits += plc4c_s7_read_write_alarm_type_length_in_bits(_message->s7_payload_user_data_item_cpu_function_msg_subscription_alarm_response_alarm_type);
+
+
+ // Simple field (reserved02)
+ lengthInBits += 8;
+
+
+ // Simple field (reserved03)
+ lengthInBits += 8;
+
+ break;
+ }
+ case plc4c_s7_read_write_s7_payload_user_data_item_type_plc4c_s7_read_write_s7_payload_user_data_item_cpu_function_alarm_ack: {
+
+ // Simple field (functionId)
+ lengthInBits += 8;
+
+
+ // Implicit Field (numberOfObjects)
+ lengthInBits += 8;
+
+
+ // Array field
+ if(_message->s7_payload_user_data_item_cpu_function_alarm_ack_message_objects != NULL) {
+ plc4c_list_element* curElement = _message->s7_payload_user_data_item_cpu_function_alarm_ack_message_objects->tail;
+ while (curElement != NULL) {
+ lengthInBits += plc4c_s7_read_write_alarm_message_object_ack_type_length_in_bits((plc4c_s7_read_write_alarm_message_object_ack_type*) curElement->value);
+ curElement = curElement->next;
+ }
+ }
+
+ break;
+ }
+ case plc4c_s7_read_write_s7_payload_user_data_item_type_plc4c_s7_read_write_s7_payload_user_data_item_cpu_function_alarm_ack_response: {
+
+ // Simple field (functionId)
+ lengthInBits += 8;
+
+
+ // Implicit Field (numberOfObjects)
+ lengthInBits += 8;
+
+
+ // Array field
+ lengthInBits += 8 * plc4c_utils_list_size(_message->s7_payload_user_data_item_cpu_function_alarm_ack_response_message_objects);
+
+ break;
+ }
+ case plc4c_s7_read_write_s7_payload_user_data_item_type_plc4c_s7_read_write_s7_payload_user_data_item_cpu_function_alarm_query: {
+
+ // Const Field (functionId)
+ lengthInBits += 8;
+
+
+ // Const Field (numberMessageObj)
+ lengthInBits += 8;
+
+
+ // Const Field (variableSpec)
+ lengthInBits += 8;
+
+
+ // Const Field (length)
+ lengthInBits += 8;
+
+
+ // Enum Field (syntaxId)
+ lengthInBits += 8;
+
+
+ // Reserved Field (reserved)
+ lengthInBits += 8;
+
+
+ // Enum Field (queryType)
+ lengthInBits += 8;
+
+
+ // Reserved Field (reserved)
+ lengthInBits += 8;
+
+
+ // Enum Field (alarmType)
+ lengthInBits += 8;
+
+ break;
+ }
+ case plc4c_s7_read_write_s7_payload_user_data_item_type_plc4c_s7_read_write_s7_payload_user_data_item_cpu_function_alarm_query_response: {
+
+ // Const Field (functionId)
+ lengthInBits += 8;
+
+
+ // Const Field (numberMessageObj)
+ lengthInBits += 8;
+
+
+ // Enum Field (pudicfReturnCode)
+ lengthInBits += 8;
+
+
+ // Enum Field (pudicftransportSize)
+ lengthInBits += 8;
+
+
+ // Reserved Field (reserved)
+ lengthInBits += 8;
+
+ break;
+ }
}
return lengthInBits;
diff --git a/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/events/S7AlarmEvent.java b/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/events/S7AlarmEvent.java
index 755e08a..4d60529 100644
--- a/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/events/S7AlarmEvent.java
+++ b/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/events/S7AlarmEvent.java
@@ -1,24 +1,23 @@
/*
-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.
-*/
-
+ * 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.java.s7.events;
-import io.netty.buffer.ByteBuf;
-import io.netty.buffer.Unpooled;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.time.Instant;
@@ -29,8 +28,6 @@ import java.time.ZoneOffset;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
import org.apache.plc4x.java.api.messages.PlcReadRequest;
import org.apache.plc4x.java.api.model.PlcField;
import org.apache.plc4x.java.api.types.PlcResponseCode;
@@ -44,7 +41,6 @@ import org.apache.plc4x.java.s7.readwrite.DateAndTime;
import org.apache.plc4x.java.s7.readwrite.S7PayloadAlarm8;
import org.apache.plc4x.java.s7.readwrite.S7PayloadAlarmAckInd;
import org.apache.plc4x.java.s7.readwrite.S7PayloadAlarmS;
-import org.apache.plc4x.java.s7.readwrite.S7PayloadAlarmSC;
import org.apache.plc4x.java.s7.readwrite.S7PayloadAlarmSQ;
import org.apache.plc4x.java.s7.readwrite.S7PayloadNotify;
import org.apache.plc4x.java.s7.readwrite.S7PayloadNotify8;
diff --git a/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/events/S7CyclicValueEvent.java b/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/events/S7CyclicValueEvent.java
index a65ef01..798014b 100644
--- a/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/events/S7CyclicValueEvent.java
+++ b/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/events/S7CyclicValueEvent.java
@@ -1,20 +1,21 @@
/*
-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.
-*/
-
+ * 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.java.s7.events;
/**
diff --git a/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/events/S7Event.java b/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/events/S7Event.java
index 3d016af..27ce7ee 100644
--- a/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/events/S7Event.java
+++ b/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/events/S7Event.java
@@ -1,20 +1,21 @@
/*
-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.
-*/
-
+ * 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.java.s7.events;
import java.util.Map;
diff --git a/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/events/S7ModeEvent.java b/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/events/S7ModeEvent.java
index 172053c..b689574 100644
--- a/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/events/S7ModeEvent.java
+++ b/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/events/S7ModeEvent.java
@@ -1,20 +1,21 @@
/*
-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.
-*/
-
+ * 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.java.s7.events;
import java.math.BigDecimal;
diff --git a/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/events/S7SysEvent.java b/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/events/S7SysEvent.java
index 3dc5b99..6ea83a6 100644
--- a/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/events/S7SysEvent.java
+++ b/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/events/S7SysEvent.java
@@ -1,20 +1,21 @@
/*
-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.
-*/
-
+ * 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.java.s7.events;
import java.math.BigDecimal;
@@ -23,7 +24,6 @@ import java.time.Instant;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
-import java.time.Month;
import java.time.ZoneOffset;
import java.util.Collection;
import java.util.HashMap;
diff --git a/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/events/S7UserEvent.java b/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/events/S7UserEvent.java
index 4df82e0..e4f8b90 100644
--- a/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/events/S7UserEvent.java
+++ b/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/events/S7UserEvent.java
@@ -1,20 +1,21 @@
/*
-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.
-*/
-
+ * 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.java.s7.events;
import org.apache.plc4x.java.s7.readwrite.S7PayloadDiagnosticMessage;
diff --git a/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/S7Driver.java b/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/S7Driver.java
index 3c4fcd0..9ce3a48 100644
--- a/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/S7Driver.java
+++ b/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/S7Driver.java
@@ -72,6 +72,7 @@ public class S7Driver extends GeneratedDriverBase<TPKTPacket> {
}
@Override
+ // TODO: Actually this is not quite true ... this is only true for some S7 devices
protected boolean canSubscribe() {
return true;
}
diff --git a/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/field/S7SslField.java b/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/field/S7SslField.java
index f14bc4a..9057522 100644
--- a/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/field/S7SslField.java
+++ b/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/field/S7SslField.java
@@ -1,31 +1,27 @@
/*
-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.
-*/
+ * 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.java.s7.readwrite.field;
-import java.time.Duration;
-import java.util.Optional;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.apache.plc4x.java.api.exceptions.PlcInvalidFieldException;
import org.apache.plc4x.java.api.model.PlcField;
-import org.apache.plc4x.java.api.model.PlcSubscriptionField;
-import org.apache.plc4x.java.api.types.PlcSubscriptionType;
/**
*
diff --git a/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/field/S7SubscriptionField.java b/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/field/S7SubscriptionField.java
index a3f289a..91c494e 100644
--- a/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/field/S7SubscriptionField.java
+++ b/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/field/S7SubscriptionField.java
@@ -1,36 +1,31 @@
/*
-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.
-*/
+ * 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.java.s7.readwrite.field;
-import java.time.Duration;
import java.util.ArrayList;
-import java.util.Optional;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.apache.plc4x.java.api.exceptions.PlcInvalidFieldException;
import org.apache.plc4x.java.api.model.PlcField;
-import org.apache.plc4x.java.api.model.PlcSubscriptionField;
-import org.apache.plc4x.java.api.types.PlcSubscriptionType;
import org.apache.plc4x.java.s7.readwrite.types.AlarmType;
import org.apache.plc4x.java.s7.readwrite.types.EventType;
import org.apache.plc4x.java.s7.readwrite.types.S7SubscriptionFieldType;
-import org.apache.plc4x.java.spi.model.DefaultPlcSubscriptionField;
/**
*
diff --git a/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/S7ProtocolEventLogic.java b/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/S7ProtocolEventLogic.java
index 15aad18..4f19606 100644
--- a/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/S7ProtocolEventLogic.java
+++ b/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/S7ProtocolEventLogic.java
@@ -18,11 +18,8 @@
*/
package org.apache.plc4x.java.s7.readwrite.protocol;
-import java.time.Instant;
-import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
-import java.util.List;
import java.util.Map;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.BlockingQueue;
@@ -42,15 +39,8 @@ import org.apache.plc4x.java.s7.events.S7AlarmEvent;
import org.apache.plc4x.java.s7.events.S7ModeEvent;
import org.apache.plc4x.java.s7.events.S7SysEvent;
import org.apache.plc4x.java.s7.events.S7UserEvent;
-import org.apache.plc4x.java.s7.readwrite.AlarmMessagePushType;
import org.apache.plc4x.java.s7.readwrite.S7ParameterModeTransition;
-import org.apache.plc4x.java.s7.readwrite.S7PayloadAlarm8;
-import org.apache.plc4x.java.s7.readwrite.S7PayloadAlarmS;
-import org.apache.plc4x.java.s7.readwrite.S7PayloadAlarmSC;
-import org.apache.plc4x.java.s7.readwrite.S7PayloadAlarmSQ;
import org.apache.plc4x.java.s7.readwrite.S7PayloadDiagnosticMessage;
-import org.apache.plc4x.java.s7.readwrite.S7PayloadNotify;
-import org.apache.plc4x.java.s7.readwrite.S7PayloadNotify8;
import org.apache.plc4x.java.s7.readwrite.types.EventType;
import org.apache.plc4x.java.s7.readwrite.utils.S7PlcSubscriptionHandle;
import org.apache.plc4x.java.spi.messages.PlcSubscriber;
diff --git a/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/types/S7SubscriptionFieldType.java b/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/types/S7SubscriptionFieldType.java
index 1a786da..0adf878 100644
--- a/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/types/S7SubscriptionFieldType.java
+++ b/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/types/S7SubscriptionFieldType.java
@@ -1,21 +1,21 @@
/*
-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.
-*/
+ * 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.java.s7.readwrite.types;
/**
diff --git a/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/utils/S7PlcSubscriptionHandle.java b/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/utils/S7PlcSubscriptionHandle.java
index 310be52..de0b945 100644
--- a/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/utils/S7PlcSubscriptionHandle.java
+++ b/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/utils/S7PlcSubscriptionHandle.java
@@ -18,7 +18,6 @@
*/
package org.apache.plc4x.java.s7.readwrite.utils;
-import org.apache.plc4x.java.api.model.PlcSubscriptionHandle;
import org.apache.plc4x.java.s7.readwrite.types.EventType;
import org.apache.plc4x.java.spi.messages.PlcSubscriber;
import org.apache.plc4x.java.spi.model.DefaultPlcSubscriptionHandle;
diff --git a/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/utils/S7DiagnosticEventId.java b/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/utils/S7DiagnosticEventId.java
index 97798e9..02cd27d 100644
--- a/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/utils/S7DiagnosticEventId.java
+++ b/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/utils/S7DiagnosticEventId.java
@@ -1,20 +1,21 @@
/*
- 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.
+ * 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.java.s7.utils;
import java.util.HashMap;
diff --git a/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/utils/S7EventHelper.java b/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/utils/S7EventHelper.java
index e017693..a2affa0 100644
--- a/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/utils/S7EventHelper.java
+++ b/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/utils/S7EventHelper.java
@@ -1,20 +1,21 @@
/*
- 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.
+ * 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.java.s7.utils;
import io.netty.buffer.ByteBuf;
diff --git a/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/utils/S7ParamErrorCode.java b/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/utils/S7ParamErrorCode.java
index 60a38de..e4ead82 100644
--- a/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/utils/S7ParamErrorCode.java
+++ b/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/utils/S7ParamErrorCode.java
@@ -1,20 +1,21 @@
/*
- 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.
+ * 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.java.s7.utils;
import java.util.HashMap;
diff --git a/plc4j/examples/plc4j-s7event/pom.xml b/plc4j/examples/plc4j-s7event/pom.xml
index faa6d3a..6db92d2 100644
--- a/plc4j/examples/plc4j-s7event/pom.xml
+++ b/plc4j/examples/plc4j-s7event/pom.xml
@@ -1,41 +1,81 @@
<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.plc4x.examples</groupId>
- <artifactId>plc4j-examples</artifactId>
- <version>0.9.0-SNAPSHOT</version>
- </parent>
- <artifactId>plc4j-s7event</artifactId>
- <packaging>jar</packaging>
- <name>PLC4J: Examples: S7Event example</name>
- <description>Parent of all java based application example modules.
-S7Event capture, MODE, SYS, USR & ALARM events from S7-300 & S7-400</description>
- <dependencies>
- <dependency>
- <groupId>org.apache.plc4x</groupId>
- <artifactId>plc4j-spi</artifactId>
- <version>0.9.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.plc4x</groupId>
- <artifactId>plc4j-transport-tcp</artifactId>
- <version>0.9.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.plc4x</groupId>
- <artifactId>plc4j-driver-s7</artifactId>
- <version>0.9.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-simple</artifactId>
- <version>1.7.30</version>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- <version>1.7.30</version>
- </dependency>
- </dependencies>
+<!--
+ 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.
+ -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.plc4x.examples</groupId>
+ <artifactId>plc4j-examples</artifactId>
+ <version>0.9.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>plc4j-s7event</artifactId>
+
+ <name>PLC4J: Examples: S7Event example</name>
+ <description>Parent of all java based application example modules.
+ S7Event capture, MODE, SYS, USR & ALARM events from S7-300 & S7-400
+ </description>
+
+ <!-- TODO: This is only needed, because the example accesses direct types of the S7 driver we should refactor this to something that is a pure PLC4X API type of thing -->
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <configuration>
+ <usedDependencies combine.children="override">
+ <usedDependency>org.apache.plc4x:plc4j-driver-ab-eth</usedDependency>
+ <usedDependency>org.apache.plc4x:plc4j-driver-ads</usedDependency>
+ <usedDependency>org.apache.plc4x:plc4j-driver-canopen</usedDependency>
+ <usedDependency>org.apache.plc4x:plc4j-driver-eip</usedDependency>
+ <usedDependency>org.apache.plc4x:plc4j-driver-firmata</usedDependency>
+ <usedDependency>org.apache.plc4x:plc4j-driver-knxnetip</usedDependency>
+ <usedDependency>org.apache.plc4x:plc4j-driver-modbus</usedDependency>
+ <usedDependency>org.apache.plc4x:plc4j-driver-opcua</usedDependency>
+ <usedDependency>org.apache.plc4x:plc4j-driver-profinet</usedDependency>
+ <usedDependency>org.apache.plc4x:plc4j-driver-simulated</usedDependency>
+ </usedDependencies>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.plc4x</groupId>
+ <artifactId>plc4j-api</artifactId>
+ <version>0.9.0-SNAPSHOT</version>
+ </dependency>
+
+ <!-- TODO: Only needed because we directly rely on types of the driver -->
+ <dependency>
+ <groupId>org.apache.plc4x</groupId>
+ <artifactId>plc4j-driver-s7</artifactId>
+ <version>0.9.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>1.7.30</version>
+ </dependency>
+ </dependencies>
</project>
\ No newline at end of file
diff --git a/plc4j/examples/plc4j-s7event/src/main/java/org/apache/plc4x/examples/plc4j/s7event/EventSubscription.java b/plc4j/examples/plc4j-s7event/src/main/java/org/apache/plc4x/examples/plc4j/s7event/EventSubscription.java
index 0e7807e..b8ad4f4 100644
--- a/plc4j/examples/plc4j-s7event/src/main/java/org/apache/plc4x/examples/plc4j/s7event/EventSubscription.java
+++ b/plc4j/examples/plc4j-s7event/src/main/java/org/apache/plc4x/examples/plc4j/s7event/EventSubscription.java
@@ -1,37 +1,33 @@
/*
- 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.
+ * 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.examples.plc4j.s7event;
import java.util.Map;
+
import org.apache.plc4x.java.PlcDriverManager;
import org.apache.plc4x.java.api.PlcConnection;
-import org.apache.plc4x.java.api.messages.PlcReadRequest;
import org.apache.plc4x.java.api.messages.PlcSubscriptionRequest;
import org.apache.plc4x.java.api.messages.PlcSubscriptionResponse;
-import org.apache.plc4x.java.api.model.PlcConsumerRegistration;
import org.apache.plc4x.java.s7.events.S7AlarmEvent;
import org.apache.plc4x.java.s7.events.S7ModeEvent;
import org.apache.plc4x.java.s7.events.S7SysEvent;
import org.apache.plc4x.java.s7.events.S7UserEvent;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
/**
* Example for capturing events generated from a Siemens S7-300, S7-400 or VIPA PLC.
@@ -39,88 +35,78 @@ import org.slf4j.LoggerFactory;
* and alarms ("ALM").
* Each consumer shows the fields and associated values of the "map" containing
* the event parameters.
+ *
* @author cgarcia
*/
public class EventSubscription {
- private static final Logger LOGGER = (Logger) LoggerFactory.getLogger(EventSubscription.class);
-
/**
* @param args the command line arguments
*/
public static void main(String[] args) throws Exception {
try (PlcConnection connection = new PlcDriverManager().getConnection("s7://192.168.1.51?remote-rack=0&remote-slot=3&controller-type=S7_400")) {
- final PlcReadRequest.Builder builder = connection.readRequestBuilder();
-
final PlcSubscriptionRequest.Builder subscription = connection.subscriptionRequestBuilder();
subscription.addEventField("myMODE", "MODE");
subscription.addEventField("mySYS", "SYS");
- subscription.addEventField("myUSR", "USR");
- subscription.addEventField("myALM", "ALM");
-
- final PlcSubscriptionRequest sub = subscription.build();
+ subscription.addEventField("myUSR", "USR");
+ subscription.addEventField("myALM", "ALM");
+
+ final PlcSubscriptionRequest sub = subscription.build();
final PlcSubscriptionResponse subresponse = sub.execute().get();
-
//Si todo va bien con la subscripciĆ³n puedo
- PlcConsumerRegistration registerMode =
- subresponse
- .getSubscriptionHandle("myMODE")
- .register(msg -> {
- System.out.println("******** S7ModeEvent ********");
- Map<String, Object> map = ((S7ModeEvent) msg).getMap();
- map.forEach((x, y) -> {
- System.out.println(x + " : " + y);
- });
- System.out.println("****************************");
+ subresponse
+ .getSubscriptionHandle("myMODE")
+ .register(msg -> {
+ System.out.println("******** S7ModeEvent ********");
+ Map<String, Object> map = ((S7ModeEvent) msg).getMap();
+ map.forEach((x, y) -> {
+ System.out.println(x + " : " + y);
+ });
+ System.out.println("****************************");
+ });
+
+ subresponse
+ .getSubscriptionHandle("mySYS")
+ .register(msg -> {
+ System.out.println("******** S7SysEvent ********");
+ Map<String, Object> map = ((S7SysEvent) msg).getMap();
+ map.forEach((x, y) -> {
+ System.out.println(x + " : " + y);
});
-
- PlcConsumerRegistration registerSys =
- subresponse
- .getSubscriptionHandle("mySYS")
- .register(msg -> {
- System.out.println("******** S7SysEvent ********");
- Map<String, Object> map = ((S7SysEvent) msg).getMap();
- map.forEach((x, y) -> {
- System.out.println(x + " : " + y);
- });
- System.out.println("****************************");
- });
-
- PlcConsumerRegistration registerUsr =
- subresponse
- .getSubscriptionHandle("myUSR")
- .register(msg -> {
- System.out.println("******** S7UserEvent *******");
- Map<String, Object> map = ((S7UserEvent) msg).getMap();
- map.forEach((x, y) -> {
- System.out.println(x + " : " + y);
- });
- System.out.println("****************************");
- });
+ System.out.println("****************************");
+ });
+
+ subresponse
+ .getSubscriptionHandle("myUSR")
+ .register(msg -> {
+ System.out.println("******** S7UserEvent *******");
+ Map<String, Object> map = ((S7UserEvent) msg).getMap();
+ map.forEach((x, y) -> {
+ System.out.println(x + " : " + y);
+ });
+ System.out.println("****************************");
+ });
+
+ subresponse
+ .getSubscriptionHandle("myALM")
+ .register(msg -> {
+ System.out.println("******** S7AlmEvent *********");
+ Map<String, Object> map = ((S7AlarmEvent) msg).getMap();
+ map.forEach((x, y) -> {
+ System.out.println(x + " : " + y);
+ });
+ System.out.println("****************************");
+ });
- PlcConsumerRegistration registerAlm =
- subresponse
- .getSubscriptionHandle("myALM")
- .register(msg -> {
- System.out.println("******** S7AlmEvent *********");
- Map<String, Object> map = ((S7AlarmEvent) msg).getMap();
- map.forEach((x, y) -> {
- System.out.println(x + " : " + y);
- });
- System.out.println("****************************");
- });
-
System.out.println("Waiting for events");
-
+
Thread.sleep(120000);
-
+
System.out.println("Bye...");
-
- connection.close();
-
+
}
}
-
+
}
diff --git a/pom.xml b/pom.xml
index 83dfe50..3446edc 100644
--- a/pom.xml
+++ b/pom.xml
@@ -134,7 +134,7 @@
<dom4j.version>2.1.3</dom4j.version>
<elasticsearch.version>7.10.0</elasticsearch.version>
<equalsverifier.version>3.5</equalsverifier.version>
- <freemarker.version>2.3.28</freemarker.version>
+ <freemarker.version>2.3.30</freemarker.version>
<groovy.version>3.0.6</groovy.version>
<gson.version>2.8.6</gson.version>
<guava.version>30.0-jre</guava.version>
diff --git a/protocols/s7/src/main/resources/protocols/s7/s7.mspec b/protocols/s7/src/main/resources/protocols/s7/s7.mspec
index d1ebfa0..197f16c 100644
--- a/protocols/s7/src/main/resources/protocols/s7/s7.mspec
+++ b/protocols/s7/src/main/resources/protocols/s7/s7.mspec
@@ -603,10 +603,10 @@
[manual string '-1' 'UTF-16' 'value' 'STATIC_CALL("org.apache.plc4x.java.s7.utils.StaticHelper.parseS7Char", readBuffer, _type.encoding)' 'STATIC_CALL("org.apache.plc4x.java.s7.utils.StaticHelper.serializeS7Char", writeBuffer, _value, _type.encoding)' '2']
]
['IEC61131_STRING' STRING
- [manual string '-1' 'UTF-8' 'value' 'STATIC_CALL("org.apache.plc4x.java.s7.utils.StaticHelper.parseS7String", readBuffer, stringLength, _type.encoding)' 'STATIC_CALL("org.apache.plc4x.java.s7.utils.StaticHelper.serializeS7String", writeBuffer, _value, stringLength, _type.encoding)' '_value.string.length + 2']
+ [manual string '-1' 'UTF-8' 'value' 'STATIC_CALL("org.apache.plc4x.java.s7.utils.StaticHelper.parseS7String", readBuffer, stringLength, _type.encoding)' 'STATIC_CALL("org.apache.plc4x.java.s7.utils.StaticHelper.serializeS7String", writeBuffer, _value, stringLength, _type.encoding)' 'STR_LEN(_value) + 2']
]
['IEC61131_WSTRING' STRING
- [manual string '-1' 'UTF-16' 'value' 'STATIC_CALL("org.apache.plc4x.java.s7.utils.StaticHelper.parseS7String", readBuffer, stringLength, _type.encoding)' 'STATIC_CALL("org.apache.plc4x.java.s7.utils.StaticHelper.serializeS7String", writeBuffer, _value, stringLength, _type.encoding)' '(_value.string.length * 2) + 2']
+ [manual string '-1' 'UTF-16' 'value' 'STATIC_CALL("org.apache.plc4x.java.s7.utils.StaticHelper.parseS7String", readBuffer, stringLength, _type.encoding)' 'STATIC_CALL("org.apache.plc4x.java.s7.utils.StaticHelper.serializeS7String", writeBuffer, _value, stringLength, _type.encoding)' '(STR_LEN(_value) * 2) + 2']
]
// -----------------------------------------
diff --git a/protocols/s7/src/test/resources/protocols/s7/DriverTestsuite.xml b/protocols/s7/src/test/resources/protocols/s7/DriverTestsuite.xml
index b79fec2..026b020 100644
--- a/protocols/s7/src/test/resources/protocols/s7/DriverTestsuite.xml
+++ b/protocols/s7/src/test/resources/protocols/s7/DriverTestsuite.xml
@@ -258,21 +258,19 @@
</DataTransportSize>
</transportSize>
<dataLength dataType="uint" bitLength="16">4</dataLength>
- <szlId>
- <SzlId>
- <typeClass>
- <SzlModuleTypeClass dataType="uint" bitLength="4" stringRepresentation="CPU">0
- </SzlModuleTypeClass>
- </typeClass>
- <sublistExtract dataType="uint" bitLength="4">0</sublistExtract>
- <sublistList>
- <SzlSublist dataType="uint" bitLength="8" stringRepresentation="MODULE_IDENTIFICATION">17
- </SzlSublist>
- </sublistList>
- </SzlId>
- </szlId>
- <szlIndex dataType="uint" bitLength="16">0</szlIndex>
<S7PayloadUserDataItemCpuFunctionReadSzlRequest>
+ <szlId>
+ <SzlId>
+ <typeClass>
+ <SzlModuleTypeClass dataType="uint" bitLength="4" stringRepresentation="CPU">0</SzlModuleTypeClass>
+ </typeClass>
+ <sublistExtract dataType="uint" bitLength="4">0</sublistExtract>
+ <sublistList>
+ <SzlSublist dataType="uint" bitLength="8" stringRepresentation="MODULE_IDENTIFICATION">17</SzlSublist>
+ </sublistList>
+ </SzlId>
+ </szlId>
+ <szlIndex dataType="uint" bitLength="16">0</szlIndex>
</S7PayloadUserDataItemCpuFunctionReadSzlRequest>
</S7PayloadUserDataItem>
</items>
@@ -343,21 +341,21 @@
</DataTransportSize>
</transportSize>
<dataLength dataType="uint" bitLength="16">92</dataLength>
- <szlId>
- <SzlId>
- <typeClass>
- <SzlModuleTypeClass dataType="uint" bitLength="4" stringRepresentation="CPU">0
- </SzlModuleTypeClass>
- </typeClass>
- <sublistExtract dataType="uint" bitLength="4">0</sublistExtract>
- <sublistList>
- <SzlSublist dataType="uint" bitLength="8" stringRepresentation="MODULE_IDENTIFICATION">17
- </SzlSublist>
- </sublistList>
- </SzlId>
- </szlId>
- <szlIndex dataType="uint" bitLength="16">0</szlIndex>
<S7PayloadUserDataItemCpuFunctionReadSzlResponse>
+ <szlId>
+ <SzlId>
+ <typeClass>
+ <SzlModuleTypeClass dataType="uint" bitLength="4" stringRepresentation="CPU">0
+ </SzlModuleTypeClass>
+ </typeClass>
+ <sublistExtract dataType="uint" bitLength="4">0</sublistExtract>
+ <sublistList>
+ <SzlSublist dataType="uint" bitLength="8" stringRepresentation="MODULE_IDENTIFICATION">17
+ </SzlSublist>
+ </sublistList>
+ </SzlId>
+ </szlId>
+ <szlIndex dataType="uint" bitLength="16">0</szlIndex>
<szlItemLength dataType="uint" bitLength="16">28</szlItemLength>
<szlItemCount dataType="uint" bitLength="16">3</szlItemCount>
<items isList="true">
@@ -392,7 +390,6 @@
</COTPPacket>
</payload>
</TPKTPacket>
-
</incoming-plc-message>
</setup>
diff --git a/protocols/s7/src/test/resources/protocols/s7/ParserSerializerTestsuite.xml b/protocols/s7/src/test/resources/protocols/s7/ParserSerializerTestsuite.xml
index 6464736..74cd661 100644
--- a/protocols/s7/src/test/resources/protocols/s7/ParserSerializerTestsuite.xml
+++ b/protocols/s7/src/test/resources/protocols/s7/ParserSerializerTestsuite.xml
@@ -276,21 +276,19 @@
</DataTransportSize>
</transportSize>
<dataLength dataType="uint" bitLength="16">4</dataLength>
- <szlId>
- <SzlId>
- <typeClass>
- <SzlModuleTypeClass dataType="uint" bitLength="4" stringRepresentation="CPU">0
- </SzlModuleTypeClass>
- </typeClass>
- <sublistExtract dataType="uint" bitLength="4">0</sublistExtract>
- <sublistList>
- <SzlSublist dataType="uint" bitLength="8" stringRepresentation="MODULE_IDENTIFICATION">17
- </SzlSublist>
- </sublistList>
- </SzlId>
- </szlId>
- <szlIndex dataType="uint" bitLength="16">0</szlIndex>
<S7PayloadUserDataItemCpuFunctionReadSzlRequest>
+ <szlId>
+ <SzlId>
+ <typeClass>
+ <SzlModuleTypeClass dataType="uint" bitLength="4" stringRepresentation="CPU">0</SzlModuleTypeClass>
+ </typeClass>
+ <sublistExtract dataType="uint" bitLength="4">0</sublistExtract>
+ <sublistList>
+ <SzlSublist dataType="uint" bitLength="8" stringRepresentation="MODULE_IDENTIFICATION">17</SzlSublist>
+ </sublistList>
+ </SzlId>
+ </szlId>
+ <szlIndex dataType="uint" bitLength="16">0</szlIndex>
</S7PayloadUserDataItemCpuFunctionReadSzlRequest>
</S7PayloadUserDataItem>
</items>
@@ -366,19 +364,19 @@
<DataTransportSize dataType="uint" bitLength="8" stringRepresentation="OCTET_STRING">9</DataTransportSize>
</transportSize>
<dataLength dataType="uint" bitLength="16">92</dataLength>
- <szlId>
- <SzlId>
- <typeClass>
- <SzlModuleTypeClass dataType="uint" bitLength="4" stringRepresentation="CPU">0</SzlModuleTypeClass>
- </typeClass>
- <sublistExtract dataType="uint" bitLength="4">0</sublistExtract>
- <sublistList>
- <SzlSublist dataType="uint" bitLength="8" stringRepresentation="MODULE_IDENTIFICATION">17</SzlSublist>
- </sublistList>
- </SzlId>
- </szlId>
- <szlIndex dataType="uint" bitLength="16">0</szlIndex>
<S7PayloadUserDataItemCpuFunctionReadSzlResponse>
+ <szlId>
+ <SzlId>
+ <typeClass>
+ <SzlModuleTypeClass dataType="uint" bitLength="4" stringRepresentation="CPU">0</SzlModuleTypeClass>
+ </typeClass>
+ <sublistExtract dataType="uint" bitLength="4">0</sublistExtract>
+ <sublistList>
+ <SzlSublist dataType="uint" bitLength="8" stringRepresentation="MODULE_IDENTIFICATION">17</SzlSublist>
+ </sublistList>
+ </SzlId>
+ </szlId>
+ <szlIndex dataType="uint" bitLength="16">0</szlIndex>
<szlItemLength dataType="uint" bitLength="16">28</szlItemLength>
<szlItemCount dataType="uint" bitLength="16">3</szlItemCount>
<items isList="true">