You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by cd...@apache.org on 2020/06/30 12:11:51 UTC
[plc4x] branch develop updated: - Fixed some static initializing of
null-values for complex types
This is an automated email from the ASF dual-hosted git repository.
cdutz pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/plc4x.git
The following commit(s) were added to refs/heads/develop by this push:
new 5046efd - Fixed some static initializing of null-values for complex types
5046efd is described below
commit 5046efd753b29bb9890ac90937521962e1504de3
Author: Christofer Dutz <ch...@c-ware.de>
AuthorDate: Tue Jun 30 14:11:41 2020 +0200
- Fixed some static initializing of null-values for complex types
---
.../plc4x/language/c/CLanguageTemplateHelper.java | 79 ++++++------
.../main/resources/templates/c/enum-template.ftlh | 3 +
.../resources/templates/c/pojo-template-c.ftlh | 24 ++--
.../resources/templates/c/pojo-template-h.ftlh | 3 +
.../modbus/includes/modbus_constants.h | 3 +
.../generated-sources/modbus/includes/modbus_pdu.h | 3 +
.../modbus_pdu_read_file_record_request_item.h | 3 +
.../modbus_pdu_read_file_record_response_item.h | 3 +
.../modbus_pdu_write_file_record_request_item.h | 3 +
.../modbus_pdu_write_file_record_response_item.h | 3 +
.../modbus/includes/modbus_serial_adu.h | 3 +
.../modbus/includes/modbus_tcp_adu.h | 3 +
.../modbus/src/modbus_constants.c | 2 +-
.../generated-sources/modbus/src/modbus_pdu.c | 142 ++++++++++-----------
.../src/modbus_pdu_read_file_record_request_item.c | 8 +-
.../modbus_pdu_read_file_record_response_item.c | 6 +-
.../modbus_pdu_write_file_record_request_item.c | 10 +-
.../modbus_pdu_write_file_record_response_item.c | 10 +-
.../modbus/src/modbus_serial_adu.c | 8 +-
.../generated-sources/modbus/src/modbus_tcp_adu.c | 8 +-
.../generated-sources/s7/includes/cotp_packet.h | 3 +
.../generated-sources/s7/includes/cotp_parameter.h | 3 +
.../s7/includes/cotp_protocol_class.h | 3 +
.../generated-sources/s7/includes/cotp_tpdu_size.h | 3 +
.../s7/includes/data_transport_error_code.h | 3 +
.../s7/includes/data_transport_size.h | 3 +
.../generated-sources/s7/includes/device_group.h | 3 +
.../generated-sources/s7/includes/memory_area.h | 3 +
.../generated-sources/s7/includes/s7_address.h | 3 +
.../generated-sources/s7/includes/s7_message.h | 3 +
.../generated-sources/s7/includes/s7_parameter.h | 3 +
.../s7/includes/s7_parameter_user_data_item.h | 3 +
.../generated-sources/s7/includes/s7_payload.h | 3 +
.../s7/includes/s7_payload_user_data_item.h | 3 +
.../s7/includes/s7_var_payload_data_item.h | 3 +
.../s7/includes/s7_var_payload_status_item.h | 3 +
.../s7/includes/s7_var_request_parameter_item.h | 3 +
.../s7/includes/szl_data_tree_item.h | 3 +
.../plc4c/generated-sources/s7/includes/szl_id.h | 3 +
.../s7/includes/szl_module_type_class.h | 3 +
.../generated-sources/s7/includes/szl_sublist.h | 3 +
.../generated-sources/s7/includes/tpkt_packet.h | 3 +
.../generated-sources/s7/includes/transport_size.h | 3 +
.../plc4c/generated-sources/s7/src/cotp_packet.c | 40 +++---
.../generated-sources/s7/src/cotp_parameter.c | 16 +--
.../plc4c/generated-sources/s7/src/s7_address.c | 20 +--
.../plc4c/generated-sources/s7/src/s7_message.c | 20 +--
.../plc4c/generated-sources/s7/src/s7_parameter.c | 20 +--
.../s7/src/s7_parameter_user_data_item.c | 20 +--
.../s7/src/s7_payload_user_data_item.c | 16 +--
.../s7/src/s7_var_payload_data_item.c | 14 +-
.../s7/src/s7_var_payload_status_item.c | 4 +-
.../s7/src/s7_var_request_parameter_item.c | 4 +-
.../generated-sources/s7/src/szl_data_tree_item.c | 10 +-
sandbox/plc4c/generated-sources/s7/src/szl_id.c | 10 +-
.../plc4c/generated-sources/s7/src/tpkt_packet.c | 6 +-
56 files changed, 346 insertions(+), 250 deletions(-)
diff --git a/build-utils/language-c/src/main/java/org/apache/plc4x/language/c/CLanguageTemplateHelper.java b/build-utils/language-c/src/main/java/org/apache/plc4x/language/c/CLanguageTemplateHelper.java
index 84a3987..aece801 100644
--- a/build-utils/language-c/src/main/java/org/apache/plc4x/language/c/CLanguageTemplateHelper.java
+++ b/build-utils/language-c/src/main/java/org/apache/plc4x/language/c/CLanguageTemplateHelper.java
@@ -236,34 +236,6 @@ public class CLanguageTemplateHelper extends BaseFreemarkerLanguageTemplateHelpe
}
}
- public String getDefaultValueForTypeReference(TypeReference typeReference) {
- if (typeReference instanceof SimpleTypeReference) {
- SimpleTypeReference simpleTypeReference = (SimpleTypeReference) typeReference;
- switch (simpleTypeReference.getBaseType()) {
- case BIT:
- return "false";
- case UINT:
- case INT: {
- return "0";
- }
- case FLOAT:
- case UFLOAT:
- return "0.0";
- case STRING:
- return "\"\"";
- case TIME:
- return "unsupported";
- case DATE:
- return "unsupported";
- case DATETIME:
- return "unsupported";
- }
- return "unsupported";
- } else {
- return "NULL";
- }
- }
-
public String getLoopExpressionSuffix(TypedField field) {
if (field instanceof ArrayField) {
ArrayField arrayField = (ArrayField) field;
@@ -379,52 +351,52 @@ public class CLanguageTemplateHelper extends BaseFreemarkerLanguageTemplateHelpe
public String getReadBufferReadMethodCall(SimpleTypeReference simpleTypeReference, String valueString) {
switch (simpleTypeReference.getBaseType()) {
case BIT: {
- return "plc4c_spi_read_bit(buf, " + valueString + ")";
+ return "plc4c_spi_read_bit(buf, (bool*) " + valueString + ")";
}
case UINT: {
IntegerTypeReference integerTypeReference = (IntegerTypeReference) simpleTypeReference;
if (integerTypeReference.getSizeInBits() <= 4) {
- return "plc4c_spi_read_unsigned_byte(buf, " + integerTypeReference.getSizeInBits() + ", " + valueString + ")";
+ return "plc4c_spi_read_unsigned_byte(buf, " + integerTypeReference.getSizeInBits() + ", (uint8_t*) " + valueString + ")";
}
if (integerTypeReference.getSizeInBits() <= 8) {
- return "plc4c_spi_read_unsigned_short(buf, " + integerTypeReference.getSizeInBits() + ", " + valueString + ")";
+ return "plc4c_spi_read_unsigned_short(buf, " + integerTypeReference.getSizeInBits() + ", (uint16_t*) " + valueString + ")";
}
if (integerTypeReference.getSizeInBits() <= 16) {
- return "plc4c_spi_read_unsigned_int(buf, " + integerTypeReference.getSizeInBits() + ", " + valueString + ")";
+ return "plc4c_spi_read_unsigned_int(buf, " + integerTypeReference.getSizeInBits() + ", (uint32_t*) " + valueString + ")";
}
if (integerTypeReference.getSizeInBits() <= 32) {
- return "plc4c_spi_read_unsigned_long(buf, " + integerTypeReference.getSizeInBits() + ", " + valueString + ")";
+ return "plc4c_spi_read_unsigned_long(buf, " + integerTypeReference.getSizeInBits() + ", (uint64_t*) " + valueString + ")";
}
return "plc4c_spi_read_unsigned_big_integer(buf, " + integerTypeReference.getSizeInBits() + ", " + valueString + ")";
}
case INT: {
IntegerTypeReference integerTypeReference = (IntegerTypeReference) simpleTypeReference;
if (integerTypeReference.getSizeInBits() <= 8) {
- return "plc4c_spi_read_byte(buf, " + integerTypeReference.getSizeInBits() + ", " + valueString + ")";
+ return "plc4c_spi_read_byte(buf, " + integerTypeReference.getSizeInBits() + ", (int8_t*) " + valueString + ")";
}
if (integerTypeReference.getSizeInBits() <= 16) {
- return "plc4c_spi_read_short(buf, " + integerTypeReference.getSizeInBits() + ", " + valueString + ")";
+ return "plc4c_spi_read_short(buf, " + integerTypeReference.getSizeInBits() + ", (int16_t*) " + valueString + ")";
}
if (integerTypeReference.getSizeInBits() <= 32) {
- return "plc4c_spi_read_int(buf, " + integerTypeReference.getSizeInBits() + ", " + valueString + ")";
+ return "plc4c_spi_read_int(buf, " + integerTypeReference.getSizeInBits() + ", (int32_t*) " + valueString + ")";
}
if (integerTypeReference.getSizeInBits() <= 64) {
- return "plc4c_spi_read_long(buf, " + integerTypeReference.getSizeInBits() + ", " + valueString + ")";
+ return "plc4c_spi_read_long(buf, " + integerTypeReference.getSizeInBits() + ", (int64_t*) " + valueString + ")";
}
return "plc4c_spi_read_big_integer(buf, " + integerTypeReference.getSizeInBits() + ", " + valueString + ")";
}
case FLOAT: {
FloatTypeReference floatTypeReference = (FloatTypeReference) simpleTypeReference;
if (floatTypeReference.getSizeInBits() <= 32) {
- return "plc4c_spi_read_float(buf, " + floatTypeReference.getSizeInBits() + ", " + valueString + ")";
+ return "plc4c_spi_read_float(buf, " + floatTypeReference.getSizeInBits() + ", (float*) " + valueString + ")";
} else {
- return "plc4c_spi_read_double(buf, " + floatTypeReference.getSizeInBits() + ", " + valueString + ")";
+ return "plc4c_spi_read_double(buf, " + floatTypeReference.getSizeInBits() + ", (double*) " + valueString + ")";
}
}
case STRING: {
StringTypeReference stringTypeReference = (StringTypeReference) simpleTypeReference;
return "plc4c_spi_read_string(buf, " + stringTypeReference.getSizeInBits() + ", \"" +
- stringTypeReference.getEncoding() + "\"" + ", " + valueString + ")";
+ stringTypeReference.getEncoding() + "\"" + ", (char**) " + valueString + ")";
}
}
return "Hurz";
@@ -487,7 +459,32 @@ public class CLanguageTemplateHelper extends BaseFreemarkerLanguageTemplateHelpe
@Override
public String getNullValueForTypeReference(TypeReference typeReference) {
- return null;
+ if (typeReference instanceof SimpleTypeReference) {
+ SimpleTypeReference simpleTypeReference = (SimpleTypeReference) typeReference;
+ switch (simpleTypeReference.getBaseType()) {
+ case BIT:
+ return "false";
+ case UINT:
+ case INT: {
+ return "0";
+ }
+ case FLOAT:
+ case UFLOAT:
+ return "0.0";
+ case STRING:
+ return "\"\"";
+ case TIME:
+ return "unsupported";
+ case DATE:
+ return "unsupported";
+ case DATETIME:
+ return "unsupported";
+ }
+ return "unsupported";
+ } else {
+ ComplexTypeReference complexTypeReference = (ComplexTypeReference) typeReference;
+ return "plc4c_" + getCTypeName(complexTypeReference.getName()) + "_null";
+ }
}
diff --git a/build-utils/language-c/src/main/resources/templates/c/enum-template.ftlh b/build-utils/language-c/src/main/resources/templates/c/enum-template.ftlh
index 8979de9..0c91c40 100644
--- a/build-utils/language-c/src/main/resources/templates/c/enum-template.ftlh
+++ b/build-utils/language-c/src/main/resources/templates/c/enum-template.ftlh
@@ -63,6 +63,9 @@ enum plc4c_${helper.getCTypeName(type.name)} {
};
typedef enum plc4c_${helper.getCTypeName(type.name)} plc4c_${helper.getCTypeName(type.name)};
+// Create an empty NULL-struct
+static const plc4c_${helper.getCTypeName(type.name)} plc4c_${helper.getCTypeName(type.name)}_null;
+
<#--
If this enum also defines constant values, output one function for each.
Each of these functions consist of a simple switch statement using the enum as switch-value
diff --git a/build-utils/language-c/src/main/resources/templates/c/pojo-template-c.ftlh b/build-utils/language-c/src/main/resources/templates/c/pojo-template-c.ftlh
index db5d9f6..d2aae13 100644
--- a/build-utils/language-c/src/main/resources/templates/c/pojo-template-c.ftlh
+++ b/build-utils/language-c/src/main/resources/templates/c/pojo-template-c.ftlh
@@ -123,7 +123,7 @@ plc4c_return_code plc4c_${helper.getCTypeName(type.name)}_parse(plc4c_spi_read_b
<#if indentContent> </#if> <#if !helper.isSimpleTypeReference(arrayField.type)>bool lastItem = curItem == (itemCount - 1);</#if>
<#-- Inizialize a local variable with the simple type (Intentionally keeping the java-style names so they can be used in expressions) -->
<#if indentContent> </#if> <#if helper.isSimpleTypeReference(arrayField.type)>
-<#if indentContent> </#if> ${helper.getLanguageTypeNameForTypeReference(arrayField.type)} _value = ${helper.getDefaultValueForTypeReference(arrayField.type)};
+<#if indentContent> </#if> ${helper.getLanguageTypeNameForTypeReference(arrayField.type)} _value = ${helper.getNullValueForTypeReference(arrayField.type)};
<#if indentContent> </#if> _res = ${helper.getReadBufferReadMethodCall(arrayField.type, "&_value")};
<#if indentContent> </#if> if(_res != OK) {
<#if indentContent> </#if> return _res;
@@ -147,7 +147,7 @@ plc4c_return_code plc4c_${helper.getCTypeName(type.name)}_parse(plc4c_spi_read_b
<#if indentContent> </#if> while(plc4c_spi_read_get_pos(buf) < ${arrayField.name}EndPos) {
<#-- Inizialize a local variable with the simple type (Intentionally keeping the java-style names so they can be used in expressions) -->
<#if helper.isSimpleTypeReference(arrayField.type)>
-<#if indentContent> </#if> ${helper.getLanguageTypeNameForTypeReference(arrayField.type)} _value = ${helper.getDefaultValueForTypeReference(arrayField.type)};
+<#if indentContent> </#if> ${helper.getLanguageTypeNameForTypeReference(arrayField.type)} _value = ${helper.getNullValueForTypeReference(arrayField.type)};
<#if indentContent> </#if> _res = ${helper.getReadBufferReadMethodCall(arrayField.type, "&_value")};
<#if indentContent> </#if> if(_res != OK) {
<#if indentContent> </#if> return _res;
@@ -173,7 +173,7 @@ plc4c_return_code plc4c_${helper.getCTypeName(type.name)}_parse(plc4c_spi_read_b
<#if indentContent> </#if> while(!((boolean) (${helper.toParseExpression(baseType, arrayField, arrayField.loopExpression, baseType.parserArguments)}))) {
<#-- Inizialize a local variable with the simple type (Intentionally keeping the java-style names so they can be used in expressions) -->
<#if helper.isSimpleTypeReference(arrayField.type)>
-<#if indentContent> </#if> ${helper.getLanguageTypeNameForTypeReference(arrayField.type)} _value = ${helper.getDefaultValueForTypeReference(arrayField.type)};
+<#if indentContent> </#if> ${helper.getLanguageTypeNameForTypeReference(arrayField.type)} _value = ${helper.getNullValueForTypeReference(arrayField.type)};
<#if indentContent> </#if> _res = ${helper.getReadBufferReadMethodCall(arrayField.type, "&_value")};
<#if indentContent> </#if> if(_res != OK) {
<#if indentContent> </#if> return _res;
@@ -205,7 +205,7 @@ plc4c_return_code plc4c_${helper.getCTypeName(type.name)}_parse(plc4c_spi_read_b
<#if indentContent> </#if> {
<#if indentContent> </#if> // Create an array of all the bytes read in this message element so far.
<#if indentContent> </#if> byte[] checksumRawData = plc4c_spi_read_get_bytes(buf, startPos, plc4c_spi_read_get_pos(buf));
-<#if indentContent> </#if> ${helper.getLanguageTypeNameForField(field)} _checksumRef = ${helper.getDefaultValueForTypeReference(checksumField.type)};
+<#if indentContent> </#if> ${helper.getLanguageTypeNameForField(field)} _checksumRef = ${helper.getNullValueForTypeReference(checksumField.type)};
<#if indentContent> </#if> _res = ${helper.getReadBufferReadMethodCall(checksumField.type, "&_checksumRef")};
<#if indentContent> </#if> if(_res != OK) {
<#if indentContent> </#if> return _res;
@@ -222,7 +222,7 @@ plc4c_return_code plc4c_${helper.getCTypeName(type.name)}_parse(plc4c_spi_read_b
<#assign simpleTypeReference = constField.type>
<#if indentContent> </#if> // Const Field (${constField.name})
-<#if indentContent> </#if> ${helper.getLanguageTypeNameForField(field)} ${constField.name} = ${helper.getDefaultValueForTypeReference(constField.type)};
+<#if indentContent> </#if> ${helper.getLanguageTypeNameForField(field)} ${constField.name} = ${helper.getNullValueForTypeReference(constField.type)};
<#if indentContent> </#if> _res = ${helper.getReadBufferReadMethodCall(constField.type, "&" + constField.name)};
<#if indentContent> </#if> if(_res != OK) {
<#if indentContent> </#if> return _res;
@@ -237,7 +237,7 @@ plc4c_return_code plc4c_${helper.getCTypeName(type.name)}_parse(plc4c_spi_read_b
<#assign simpleTypeReference = discriminatorField.type>
<#if indentContent> </#if> // Discriminator Field (${discriminatorField.name}) (Used as input to a switch field)
-<#if indentContent> </#if> ${helper.getLanguageTypeNameForField(field)} ${discriminatorField.name} = ${helper.getDefaultValueForTypeReference(discriminatorField.type)};
+<#if indentContent> </#if> ${helper.getLanguageTypeNameForField(field)} ${discriminatorField.name} = ${helper.getNullValueForTypeReference(discriminatorField.type)};
<#if indentContent> </#if> _res = ${helper.getReadBufferReadMethodCall(discriminatorField.type, "&" + discriminatorField.name)};
<#if indentContent> </#if> if(_res != OK) {
<#if indentContent> </#if> return _res;
@@ -247,7 +247,7 @@ plc4c_return_code plc4c_${helper.getCTypeName(type.name)}_parse(plc4c_spi_read_b
<#assign enumField = field>
<#if indentContent> </#if> // Enum field (${enumField.name})
-<#if indentContent> </#if> ${helper.getLanguageTypeNameForField(field)} ${enumField.name} = ${helper.getDefaultValueForTypeReference(enumField.type)};
+<#if indentContent> </#if> ${helper.getLanguageTypeNameForField(field)} ${enumField.name} = ${helper.getNullValueForTypeReference(enumField.type)};
<#if indentContent> </#if> _res = ${helper.getReadBufferReadMethodCall(helper.getEnumBaseTypeReference(enumField.type), "&" + enumField.name)};
<#if indentContent> </#if> if(_res != OK) {
<#if indentContent> </#if> return _res;
@@ -259,7 +259,7 @@ plc4c_return_code plc4c_${helper.getCTypeName(type.name)}_parse(plc4c_spi_read_b
<#assign simpleTypeReference = implicitField.type>
<#if indentContent> </#if> // Implicit Field (${implicitField.name}) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content)
-<#if indentContent> </#if> ${helper.getLanguageTypeNameForField(field)} ${implicitField.name} = ${helper.getDefaultValueForTypeReference(implicitField.type)};
+<#if indentContent> </#if> ${helper.getLanguageTypeNameForField(field)} ${implicitField.name} = ${helper.getNullValueForTypeReference(implicitField.type)};
<#if indentContent> </#if> _res = ${helper.getReadBufferReadMethodCall(implicitField.type, "&" + implicitField.name)};
<#if indentContent> </#if> if(_res != OK) {
<#if indentContent> </#if> return _res;
@@ -291,7 +291,7 @@ plc4c_return_code plc4c_${helper.getCTypeName(type.name)}_parse(plc4c_spi_read_b
<#if indentContent> </#if> return NO_MEMORY;
<#if indentContent> </#if> }
<#if helper.isSimpleTypeReference(optionalField.type)>
-<#if indentContent> </#if> *${optionalField.name} = ${helper.getDefaultValueForTypeReference(optionalField.type)};
+<#if indentContent> </#if> *${optionalField.name} = ${helper.getNullValueForTypeReference(optionalField.type)};
<#if indentContent> </#if> _res = ${helper.getReadBufferReadMethodCall(optionalField.type, "&" + optionalField.name)};
<#else>
<#if indentContent> </#if> _res = plc4c_${helper.getCTypeName(optionalField.type.name)}_parse(buf<#if optionalField.params?has_content>, <#list optionalField.params as parserTerm>${helper.toParseExpression(baseType, optionalField, parserTerm, baseType.parserArguments)}<#sep>, </#sep></#list></#if>, &${optionalField.name});
@@ -311,7 +311,7 @@ plc4c_return_code plc4c_${helper.getCTypeName(type.name)}_parse(plc4c_spi_read_b
<#if indentContent> </#if> bool _needsPadding = (bool) ((plc4c_spi_read_has_more(buf, ${helper.getNumBits(paddingField.type)})) && (${helper.toParseExpression(baseType, paddingField, paddingField.paddingCondition, baseType.parserArguments)}));
<#if indentContent> </#if> if(_needsPadding) {
<#if indentContent> </#if> // Just read the padding data and ignore it
-<#if indentContent> </#if> ${helper.getLanguageTypeNameForField(field)} _paddingValue = ${helper.getDefaultValueForTypeReference(paddingField.type)};
+<#if indentContent> </#if> ${helper.getLanguageTypeNameForField(field)} _paddingValue = ${helper.getNullValueForTypeReference(paddingField.type)};
<#if indentContent> </#if> _res = ${helper.getReadBufferReadMethodCall(paddingField.type, "&_paddingValue")};
<#if indentContent> </#if> if(_res != OK) {
<#if indentContent> </#if> return _res;
@@ -325,7 +325,7 @@ plc4c_return_code plc4c_${helper.getCTypeName(type.name)}_parse(plc4c_spi_read_b
<#if indentContent> </#if> // Reserved Field (Compartmentalized so the "reserved" variable can't leak)
<#if indentContent> </#if> {
-<#if indentContent> </#if> ${helper.getLanguageTypeNameForField(field)} _reserved = ${helper.getDefaultValueForTypeReference(reservedField.type)};
+<#if indentContent> </#if> ${helper.getLanguageTypeNameForField(field)} _reserved = ${helper.getNullValueForTypeReference(reservedField.type)};
<#if indentContent> </#if> _res = ${helper.getReadBufferReadMethodCall(reservedField.type, "_reserved")};
<#if indentContent> </#if> if(_res != OK) {
<#if indentContent> </#if> return _res;
@@ -341,7 +341,7 @@ plc4c_return_code plc4c_${helper.getCTypeName(type.name)}_parse(plc4c_spi_read_b
<#if indentContent> </#if> // Simple Field (${simpleField.name})
<#-- Inizialize a local variable with the simple type (Intentionally keeping the java-style names so they can be used in expressions) -->
<#if helper.isSimpleTypeReference(simpleField.type)>
-<#if indentContent> </#if> ${helper.getLanguageTypeNameForField(field)} ${simpleField.name} = ${helper.getDefaultValueForTypeReference(simpleField.type)};
+<#if indentContent> </#if> ${helper.getLanguageTypeNameForField(field)} ${simpleField.name} = ${helper.getNullValueForTypeReference(simpleField.type)};
<#if indentContent> </#if> _res = ${helper.getReadBufferReadMethodCall(simpleField.type, "&" + simpleField.name)};
<#else>
<#-- Inizialize a local variable with the complex type (Intentionally keeping the java-style names so they can be used in expressions) -->
diff --git a/build-utils/language-c/src/main/resources/templates/c/pojo-template-h.ftlh b/build-utils/language-c/src/main/resources/templates/c/pojo-template-h.ftlh
index 4e8cfbe..036ec1d 100644
--- a/build-utils/language-c/src/main/resources/templates/c/pojo-template-h.ftlh
+++ b/build-utils/language-c/src/main/resources/templates/c/pojo-template-h.ftlh
@@ -140,6 +140,9 @@ struct plc4c_${helper.getCTypeName(type.name)} {
};
typedef struct plc4c_${helper.getCTypeName(type.name)} plc4c_${helper.getCTypeName(type.name)};
+// Create an empty NULL-struct
+static const plc4c_${helper.getCTypeName(type.name)} plc4c_${helper.getCTypeName(type.name)}_null;
+
<#--
Define the parse-method for elements of this tpye
-->
diff --git a/sandbox/plc4c/generated-sources/modbus/includes/modbus_constants.h b/sandbox/plc4c/generated-sources/modbus/includes/modbus_constants.h
index 99d71ec..5c6e407 100644
--- a/sandbox/plc4c/generated-sources/modbus/includes/modbus_constants.h
+++ b/sandbox/plc4c/generated-sources/modbus/includes/modbus_constants.h
@@ -35,6 +35,9 @@ struct plc4c_modbus_read_write_modbus_constants {
};
typedef struct plc4c_modbus_read_write_modbus_constants plc4c_modbus_read_write_modbus_constants;
+// Create an empty NULL-struct
+static const plc4c_modbus_read_write_modbus_constants plc4c_modbus_read_write_modbus_constants_null;
+
plc4c_return_code plc4c_modbus_read_write_modbus_constants_parse(plc4c_spi_read_buffer* buf, plc4c_modbus_read_write_modbus_constants** message);
plc4c_return_code plc4c_modbus_read_write_modbus_constants_serialize(plc4c_spi_write_buffer* buf, plc4c_modbus_read_write_modbus_constants* message);
diff --git a/sandbox/plc4c/generated-sources/modbus/includes/modbus_pdu.h b/sandbox/plc4c/generated-sources/modbus/includes/modbus_pdu.h
index c1259a0..12db8cf 100644
--- a/sandbox/plc4c/generated-sources/modbus/includes/modbus_pdu.h
+++ b/sandbox/plc4c/generated-sources/modbus/includes/modbus_pdu.h
@@ -220,6 +220,9 @@ struct plc4c_modbus_read_write_modbus_pdu {
};
typedef struct plc4c_modbus_read_write_modbus_pdu plc4c_modbus_read_write_modbus_pdu;
+// Create an empty NULL-struct
+static const plc4c_modbus_read_write_modbus_pdu plc4c_modbus_read_write_modbus_pdu_null;
+
plc4c_return_code plc4c_modbus_read_write_modbus_pdu_parse(plc4c_spi_read_buffer* buf, bool response, plc4c_modbus_read_write_modbus_pdu** message);
plc4c_return_code plc4c_modbus_read_write_modbus_pdu_serialize(plc4c_spi_write_buffer* buf, plc4c_modbus_read_write_modbus_pdu* message);
diff --git a/sandbox/plc4c/generated-sources/modbus/includes/modbus_pdu_read_file_record_request_item.h b/sandbox/plc4c/generated-sources/modbus/includes/modbus_pdu_read_file_record_request_item.h
index 1272e13..f7c3620 100644
--- a/sandbox/plc4c/generated-sources/modbus/includes/modbus_pdu_read_file_record_request_item.h
+++ b/sandbox/plc4c/generated-sources/modbus/includes/modbus_pdu_read_file_record_request_item.h
@@ -35,6 +35,9 @@ struct plc4c_modbus_read_write_modbus_pdu_read_file_record_request_item {
};
typedef struct plc4c_modbus_read_write_modbus_pdu_read_file_record_request_item plc4c_modbus_read_write_modbus_pdu_read_file_record_request_item;
+// Create an empty NULL-struct
+static const plc4c_modbus_read_write_modbus_pdu_read_file_record_request_item plc4c_modbus_read_write_modbus_pdu_read_file_record_request_item_null;
+
plc4c_return_code plc4c_modbus_read_write_modbus_pdu_read_file_record_request_item_parse(plc4c_spi_read_buffer* buf, plc4c_modbus_read_write_modbus_pdu_read_file_record_request_item** message);
plc4c_return_code plc4c_modbus_read_write_modbus_pdu_read_file_record_request_item_serialize(plc4c_spi_write_buffer* buf, plc4c_modbus_read_write_modbus_pdu_read_file_record_request_item* message);
diff --git a/sandbox/plc4c/generated-sources/modbus/includes/modbus_pdu_read_file_record_response_item.h b/sandbox/plc4c/generated-sources/modbus/includes/modbus_pdu_read_file_record_response_item.h
index f377f04..9e3e3e8 100644
--- a/sandbox/plc4c/generated-sources/modbus/includes/modbus_pdu_read_file_record_response_item.h
+++ b/sandbox/plc4c/generated-sources/modbus/includes/modbus_pdu_read_file_record_response_item.h
@@ -33,6 +33,9 @@ struct plc4c_modbus_read_write_modbus_pdu_read_file_record_response_item {
};
typedef struct plc4c_modbus_read_write_modbus_pdu_read_file_record_response_item plc4c_modbus_read_write_modbus_pdu_read_file_record_response_item;
+// Create an empty NULL-struct
+static const plc4c_modbus_read_write_modbus_pdu_read_file_record_response_item plc4c_modbus_read_write_modbus_pdu_read_file_record_response_item_null;
+
plc4c_return_code plc4c_modbus_read_write_modbus_pdu_read_file_record_response_item_parse(plc4c_spi_read_buffer* buf, plc4c_modbus_read_write_modbus_pdu_read_file_record_response_item** message);
plc4c_return_code plc4c_modbus_read_write_modbus_pdu_read_file_record_response_item_serialize(plc4c_spi_write_buffer* buf, plc4c_modbus_read_write_modbus_pdu_read_file_record_response_item* message);
diff --git a/sandbox/plc4c/generated-sources/modbus/includes/modbus_pdu_write_file_record_request_item.h b/sandbox/plc4c/generated-sources/modbus/includes/modbus_pdu_write_file_record_request_item.h
index 539e8c3..95fbb59 100644
--- a/sandbox/plc4c/generated-sources/modbus/includes/modbus_pdu_write_file_record_request_item.h
+++ b/sandbox/plc4c/generated-sources/modbus/includes/modbus_pdu_write_file_record_request_item.h
@@ -35,6 +35,9 @@ struct plc4c_modbus_read_write_modbus_pdu_write_file_record_request_item {
};
typedef struct plc4c_modbus_read_write_modbus_pdu_write_file_record_request_item plc4c_modbus_read_write_modbus_pdu_write_file_record_request_item;
+// Create an empty NULL-struct
+static const plc4c_modbus_read_write_modbus_pdu_write_file_record_request_item plc4c_modbus_read_write_modbus_pdu_write_file_record_request_item_null;
+
plc4c_return_code plc4c_modbus_read_write_modbus_pdu_write_file_record_request_item_parse(plc4c_spi_read_buffer* buf, plc4c_modbus_read_write_modbus_pdu_write_file_record_request_item** message);
plc4c_return_code plc4c_modbus_read_write_modbus_pdu_write_file_record_request_item_serialize(plc4c_spi_write_buffer* buf, plc4c_modbus_read_write_modbus_pdu_write_file_record_request_item* message);
diff --git a/sandbox/plc4c/generated-sources/modbus/includes/modbus_pdu_write_file_record_response_item.h b/sandbox/plc4c/generated-sources/modbus/includes/modbus_pdu_write_file_record_response_item.h
index 9f7b890..1b5298f 100644
--- a/sandbox/plc4c/generated-sources/modbus/includes/modbus_pdu_write_file_record_response_item.h
+++ b/sandbox/plc4c/generated-sources/modbus/includes/modbus_pdu_write_file_record_response_item.h
@@ -35,6 +35,9 @@ struct plc4c_modbus_read_write_modbus_pdu_write_file_record_response_item {
};
typedef struct plc4c_modbus_read_write_modbus_pdu_write_file_record_response_item plc4c_modbus_read_write_modbus_pdu_write_file_record_response_item;
+// Create an empty NULL-struct
+static const plc4c_modbus_read_write_modbus_pdu_write_file_record_response_item plc4c_modbus_read_write_modbus_pdu_write_file_record_response_item_null;
+
plc4c_return_code plc4c_modbus_read_write_modbus_pdu_write_file_record_response_item_parse(plc4c_spi_read_buffer* buf, plc4c_modbus_read_write_modbus_pdu_write_file_record_response_item** message);
plc4c_return_code plc4c_modbus_read_write_modbus_pdu_write_file_record_response_item_serialize(plc4c_spi_write_buffer* buf, plc4c_modbus_read_write_modbus_pdu_write_file_record_response_item* message);
diff --git a/sandbox/plc4c/generated-sources/modbus/includes/modbus_serial_adu.h b/sandbox/plc4c/generated-sources/modbus/includes/modbus_serial_adu.h
index b97447a..240d97a 100644
--- a/sandbox/plc4c/generated-sources/modbus/includes/modbus_serial_adu.h
+++ b/sandbox/plc4c/generated-sources/modbus/includes/modbus_serial_adu.h
@@ -36,6 +36,9 @@ struct plc4c_modbus_read_write_modbus_serial_adu {
};
typedef struct plc4c_modbus_read_write_modbus_serial_adu plc4c_modbus_read_write_modbus_serial_adu;
+// Create an empty NULL-struct
+static const plc4c_modbus_read_write_modbus_serial_adu plc4c_modbus_read_write_modbus_serial_adu_null;
+
plc4c_return_code plc4c_modbus_read_write_modbus_serial_adu_parse(plc4c_spi_read_buffer* buf, bool response, plc4c_modbus_read_write_modbus_serial_adu** message);
plc4c_return_code plc4c_modbus_read_write_modbus_serial_adu_serialize(plc4c_spi_write_buffer* buf, plc4c_modbus_read_write_modbus_serial_adu* message);
diff --git a/sandbox/plc4c/generated-sources/modbus/includes/modbus_tcp_adu.h b/sandbox/plc4c/generated-sources/modbus/includes/modbus_tcp_adu.h
index 7421b0f..04a3cc2 100644
--- a/sandbox/plc4c/generated-sources/modbus/includes/modbus_tcp_adu.h
+++ b/sandbox/plc4c/generated-sources/modbus/includes/modbus_tcp_adu.h
@@ -39,6 +39,9 @@ struct plc4c_modbus_read_write_modbus_tcp_adu {
};
typedef struct plc4c_modbus_read_write_modbus_tcp_adu plc4c_modbus_read_write_modbus_tcp_adu;
+// Create an empty NULL-struct
+static const plc4c_modbus_read_write_modbus_tcp_adu plc4c_modbus_read_write_modbus_tcp_adu_null;
+
plc4c_return_code plc4c_modbus_read_write_modbus_tcp_adu_parse(plc4c_spi_read_buffer* buf, bool response, plc4c_modbus_read_write_modbus_tcp_adu** message);
plc4c_return_code plc4c_modbus_read_write_modbus_tcp_adu_serialize(plc4c_spi_write_buffer* buf, plc4c_modbus_read_write_modbus_tcp_adu* message);
diff --git a/sandbox/plc4c/generated-sources/modbus/src/modbus_constants.c b/sandbox/plc4c/generated-sources/modbus/src/modbus_constants.c
index eb0bb4b..767cf1a 100644
--- a/sandbox/plc4c/generated-sources/modbus/src/modbus_constants.c
+++ b/sandbox/plc4c/generated-sources/modbus/src/modbus_constants.c
@@ -37,7 +37,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_constants_parse(plc4c_spi_read_
// Const Field (modbusTcpDefaultPort)
uint16_t modbusTcpDefaultPort = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &modbusTcpDefaultPort);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &modbusTcpDefaultPort);
if(_res != OK) {
return _res;
}
diff --git a/sandbox/plc4c/generated-sources/modbus/src/modbus_pdu.c b/sandbox/plc4c/generated-sources/modbus/src/modbus_pdu.c
index c186c7a..241835e 100644
--- a/sandbox/plc4c/generated-sources/modbus/src/modbus_pdu.c
+++ b/sandbox/plc4c/generated-sources/modbus/src/modbus_pdu.c
@@ -120,14 +120,14 @@ plc4c_return_code plc4c_modbus_read_write_modbus_pdu_parse(plc4c_spi_read_buffer
// Discriminator Field (error) (Used as input to a switch field)
bool error = false;
- _res = plc4c_spi_read_bit(buf, &error);
+ _res = plc4c_spi_read_bit(buf, (bool*) &error);
if(_res != OK) {
return _res;
}
// Discriminator Field (function) (Used as input to a switch field)
unsigned int function = 0;
- _res = plc4c_spi_read_unsigned_short(buf, 7, &function);
+ _res = plc4c_spi_read_unsigned_short(buf, 7, (uint16_t*) &function);
if(_res != OK) {
return _res;
}
@@ -138,7 +138,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_pdu_parse(plc4c_spi_read_buffer
// Simple Field (exceptionCode)
uint8_t exceptionCode = 0;
- _res = plc4c_spi_read_unsigned_short(buf, 8, &exceptionCode);
+ _res = plc4c_spi_read_unsigned_short(buf, 8, (uint16_t*) &exceptionCode);
if(_res != OK) {
return _res;
}
@@ -150,7 +150,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_pdu_parse(plc4c_spi_read_buffer
// Simple Field (startingAddress)
uint16_t startingAddress = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &startingAddress);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &startingAddress);
if(_res != OK) {
return _res;
}
@@ -160,7 +160,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_pdu_parse(plc4c_spi_read_buffer
// Simple Field (quantity)
uint16_t quantity = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &quantity);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &quantity);
if(_res != OK) {
return _res;
}
@@ -172,7 +172,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_pdu_parse(plc4c_spi_read_buffer
// Implicit Field (byteCount) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content)
uint8_t byteCount = 0;
- _res = plc4c_spi_read_unsigned_short(buf, 8, &byteCount);
+ _res = plc4c_spi_read_unsigned_short(buf, 8, (uint16_t*) &byteCount);
if(_res != OK) {
return _res;
}
@@ -191,7 +191,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_pdu_parse(plc4c_spi_read_buffer
int8_t _value = 0;
- _res = plc4c_spi_read_byte(buf, 8, &_value);
+ _res = plc4c_spi_read_byte(buf, 8, (int8_t*) &_value);
if(_res != OK) {
return _res;
}
@@ -206,7 +206,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_pdu_parse(plc4c_spi_read_buffer
// Simple Field (startingAddress)
uint16_t startingAddress = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &startingAddress);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &startingAddress);
if(_res != OK) {
return _res;
}
@@ -216,7 +216,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_pdu_parse(plc4c_spi_read_buffer
// Simple Field (quantity)
uint16_t quantity = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &quantity);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &quantity);
if(_res != OK) {
return _res;
}
@@ -228,7 +228,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_pdu_parse(plc4c_spi_read_buffer
// Implicit Field (byteCount) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content)
uint8_t byteCount = 0;
- _res = plc4c_spi_read_unsigned_short(buf, 8, &byteCount);
+ _res = plc4c_spi_read_unsigned_short(buf, 8, (uint16_t*) &byteCount);
if(_res != OK) {
return _res;
}
@@ -247,7 +247,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_pdu_parse(plc4c_spi_read_buffer
int8_t _value = 0;
- _res = plc4c_spi_read_byte(buf, 8, &_value);
+ _res = plc4c_spi_read_byte(buf, 8, (int8_t*) &_value);
if(_res != OK) {
return _res;
}
@@ -262,7 +262,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_pdu_parse(plc4c_spi_read_buffer
// Simple Field (address)
uint16_t address = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &address);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &address);
if(_res != OK) {
return _res;
}
@@ -272,7 +272,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_pdu_parse(plc4c_spi_read_buffer
// Simple Field (value)
uint16_t value = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &value);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &value);
if(_res != OK) {
return _res;
}
@@ -284,7 +284,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_pdu_parse(plc4c_spi_read_buffer
// Simple Field (address)
uint16_t address = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &address);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &address);
if(_res != OK) {
return _res;
}
@@ -294,7 +294,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_pdu_parse(plc4c_spi_read_buffer
// Simple Field (value)
uint16_t value = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &value);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &value);
if(_res != OK) {
return _res;
}
@@ -306,7 +306,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_pdu_parse(plc4c_spi_read_buffer
// Simple Field (startingAddress)
uint16_t startingAddress = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &startingAddress);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &startingAddress);
if(_res != OK) {
return _res;
}
@@ -316,7 +316,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_pdu_parse(plc4c_spi_read_buffer
// Simple Field (quantity)
uint16_t quantity = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &quantity);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &quantity);
if(_res != OK) {
return _res;
}
@@ -326,7 +326,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_pdu_parse(plc4c_spi_read_buffer
// Implicit Field (byteCount) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content)
uint8_t byteCount = 0;
- _res = plc4c_spi_read_unsigned_short(buf, 8, &byteCount);
+ _res = plc4c_spi_read_unsigned_short(buf, 8, (uint16_t*) &byteCount);
if(_res != OK) {
return _res;
}
@@ -345,7 +345,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_pdu_parse(plc4c_spi_read_buffer
int8_t _value = 0;
- _res = plc4c_spi_read_byte(buf, 8, &_value);
+ _res = plc4c_spi_read_byte(buf, 8, (int8_t*) &_value);
if(_res != OK) {
return _res;
}
@@ -360,7 +360,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_pdu_parse(plc4c_spi_read_buffer
// Simple Field (startingAddress)
uint16_t startingAddress = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &startingAddress);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &startingAddress);
if(_res != OK) {
return _res;
}
@@ -370,7 +370,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_pdu_parse(plc4c_spi_read_buffer
// Simple Field (quantity)
uint16_t quantity = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &quantity);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &quantity);
if(_res != OK) {
return _res;
}
@@ -382,7 +382,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_pdu_parse(plc4c_spi_read_buffer
// Simple Field (startingAddress)
uint16_t startingAddress = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &startingAddress);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &startingAddress);
if(_res != OK) {
return _res;
}
@@ -392,7 +392,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_pdu_parse(plc4c_spi_read_buffer
// Simple Field (quantity)
uint16_t quantity = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &quantity);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &quantity);
if(_res != OK) {
return _res;
}
@@ -404,7 +404,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_pdu_parse(plc4c_spi_read_buffer
// Implicit Field (byteCount) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content)
uint8_t byteCount = 0;
- _res = plc4c_spi_read_unsigned_short(buf, 8, &byteCount);
+ _res = plc4c_spi_read_unsigned_short(buf, 8, (uint16_t*) &byteCount);
if(_res != OK) {
return _res;
}
@@ -423,7 +423,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_pdu_parse(plc4c_spi_read_buffer
int8_t _value = 0;
- _res = plc4c_spi_read_byte(buf, 8, &_value);
+ _res = plc4c_spi_read_byte(buf, 8, (int8_t*) &_value);
if(_res != OK) {
return _res;
}
@@ -438,7 +438,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_pdu_parse(plc4c_spi_read_buffer
// Simple Field (startingAddress)
uint16_t startingAddress = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &startingAddress);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &startingAddress);
if(_res != OK) {
return _res;
}
@@ -448,7 +448,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_pdu_parse(plc4c_spi_read_buffer
// Simple Field (quantity)
uint16_t quantity = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &quantity);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &quantity);
if(_res != OK) {
return _res;
}
@@ -460,7 +460,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_pdu_parse(plc4c_spi_read_buffer
// Implicit Field (byteCount) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content)
uint8_t byteCount = 0;
- _res = plc4c_spi_read_unsigned_short(buf, 8, &byteCount);
+ _res = plc4c_spi_read_unsigned_short(buf, 8, (uint16_t*) &byteCount);
if(_res != OK) {
return _res;
}
@@ -479,7 +479,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_pdu_parse(plc4c_spi_read_buffer
int8_t _value = 0;
- _res = plc4c_spi_read_byte(buf, 8, &_value);
+ _res = plc4c_spi_read_byte(buf, 8, (int8_t*) &_value);
if(_res != OK) {
return _res;
}
@@ -494,7 +494,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_pdu_parse(plc4c_spi_read_buffer
// Simple Field (address)
uint16_t address = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &address);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &address);
if(_res != OK) {
return _res;
}
@@ -504,7 +504,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_pdu_parse(plc4c_spi_read_buffer
// Simple Field (value)
uint16_t value = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &value);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &value);
if(_res != OK) {
return _res;
}
@@ -516,7 +516,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_pdu_parse(plc4c_spi_read_buffer
// Simple Field (address)
uint16_t address = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &address);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &address);
if(_res != OK) {
return _res;
}
@@ -526,7 +526,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_pdu_parse(plc4c_spi_read_buffer
// Simple Field (value)
uint16_t value = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &value);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &value);
if(_res != OK) {
return _res;
}
@@ -538,7 +538,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_pdu_parse(plc4c_spi_read_buffer
// Simple Field (startingAddress)
uint16_t startingAddress = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &startingAddress);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &startingAddress);
if(_res != OK) {
return _res;
}
@@ -548,7 +548,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_pdu_parse(plc4c_spi_read_buffer
// Simple Field (quantity)
uint16_t quantity = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &quantity);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &quantity);
if(_res != OK) {
return _res;
}
@@ -558,7 +558,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_pdu_parse(plc4c_spi_read_buffer
// Implicit Field (byteCount) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content)
uint8_t byteCount = 0;
- _res = plc4c_spi_read_unsigned_short(buf, 8, &byteCount);
+ _res = plc4c_spi_read_unsigned_short(buf, 8, (uint16_t*) &byteCount);
if(_res != OK) {
return _res;
}
@@ -577,7 +577,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_pdu_parse(plc4c_spi_read_buffer
int8_t _value = 0;
- _res = plc4c_spi_read_byte(buf, 8, &_value);
+ _res = plc4c_spi_read_byte(buf, 8, (int8_t*) &_value);
if(_res != OK) {
return _res;
}
@@ -592,7 +592,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_pdu_parse(plc4c_spi_read_buffer
// Simple Field (startingAddress)
uint16_t startingAddress = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &startingAddress);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &startingAddress);
if(_res != OK) {
return _res;
}
@@ -602,7 +602,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_pdu_parse(plc4c_spi_read_buffer
// Simple Field (quantity)
uint16_t quantity = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &quantity);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &quantity);
if(_res != OK) {
return _res;
}
@@ -614,7 +614,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_pdu_parse(plc4c_spi_read_buffer
// Simple Field (readStartingAddress)
uint16_t readStartingAddress = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &readStartingAddress);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &readStartingAddress);
if(_res != OK) {
return _res;
}
@@ -624,7 +624,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_pdu_parse(plc4c_spi_read_buffer
// Simple Field (readQuantity)
uint16_t readQuantity = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &readQuantity);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &readQuantity);
if(_res != OK) {
return _res;
}
@@ -634,7 +634,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_pdu_parse(plc4c_spi_read_buffer
// Simple Field (writeStartingAddress)
uint16_t writeStartingAddress = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &writeStartingAddress);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &writeStartingAddress);
if(_res != OK) {
return _res;
}
@@ -644,7 +644,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_pdu_parse(plc4c_spi_read_buffer
// Simple Field (writeQuantity)
uint16_t writeQuantity = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &writeQuantity);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &writeQuantity);
if(_res != OK) {
return _res;
}
@@ -654,7 +654,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_pdu_parse(plc4c_spi_read_buffer
// Implicit Field (byteCount) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content)
uint8_t byteCount = 0;
- _res = plc4c_spi_read_unsigned_short(buf, 8, &byteCount);
+ _res = plc4c_spi_read_unsigned_short(buf, 8, (uint16_t*) &byteCount);
if(_res != OK) {
return _res;
}
@@ -673,7 +673,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_pdu_parse(plc4c_spi_read_buffer
int8_t _value = 0;
- _res = plc4c_spi_read_byte(buf, 8, &_value);
+ _res = plc4c_spi_read_byte(buf, 8, (int8_t*) &_value);
if(_res != OK) {
return _res;
}
@@ -688,7 +688,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_pdu_parse(plc4c_spi_read_buffer
// Implicit Field (byteCount) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content)
uint8_t byteCount = 0;
- _res = plc4c_spi_read_unsigned_short(buf, 8, &byteCount);
+ _res = plc4c_spi_read_unsigned_short(buf, 8, (uint16_t*) &byteCount);
if(_res != OK) {
return _res;
}
@@ -707,7 +707,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_pdu_parse(plc4c_spi_read_buffer
int8_t _value = 0;
- _res = plc4c_spi_read_byte(buf, 8, &_value);
+ _res = plc4c_spi_read_byte(buf, 8, (int8_t*) &_value);
if(_res != OK) {
return _res;
}
@@ -722,7 +722,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_pdu_parse(plc4c_spi_read_buffer
// Simple Field (referenceAddress)
uint16_t referenceAddress = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &referenceAddress);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &referenceAddress);
if(_res != OK) {
return _res;
}
@@ -732,7 +732,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_pdu_parse(plc4c_spi_read_buffer
// Simple Field (andMask)
uint16_t andMask = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &andMask);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &andMask);
if(_res != OK) {
return _res;
}
@@ -742,7 +742,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_pdu_parse(plc4c_spi_read_buffer
// Simple Field (orMask)
uint16_t orMask = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &orMask);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &orMask);
if(_res != OK) {
return _res;
}
@@ -754,7 +754,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_pdu_parse(plc4c_spi_read_buffer
// Simple Field (referenceAddress)
uint16_t referenceAddress = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &referenceAddress);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &referenceAddress);
if(_res != OK) {
return _res;
}
@@ -764,7 +764,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_pdu_parse(plc4c_spi_read_buffer
// Simple Field (andMask)
uint16_t andMask = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &andMask);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &andMask);
if(_res != OK) {
return _res;
}
@@ -774,7 +774,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_pdu_parse(plc4c_spi_read_buffer
// Simple Field (orMask)
uint16_t orMask = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &orMask);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &orMask);
if(_res != OK) {
return _res;
}
@@ -786,7 +786,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_pdu_parse(plc4c_spi_read_buffer
// Simple Field (fifoPointerAddress)
uint16_t fifoPointerAddress = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &fifoPointerAddress);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &fifoPointerAddress);
if(_res != OK) {
return _res;
}
@@ -798,7 +798,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_pdu_parse(plc4c_spi_read_buffer
// Implicit Field (byteCount) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content)
uint16_t byteCount = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &byteCount);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &byteCount);
if(_res != OK) {
return _res;
}
@@ -807,7 +807,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_pdu_parse(plc4c_spi_read_buffer
// Implicit Field (fifoCount) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content)
uint16_t fifoCount = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &fifoCount);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &fifoCount);
if(_res != OK) {
return _res;
}
@@ -826,7 +826,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_pdu_parse(plc4c_spi_read_buffer
uint16_t _value = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &_value);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &_value);
if(_res != OK) {
return _res;
}
@@ -841,7 +841,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_pdu_parse(plc4c_spi_read_buffer
// Implicit Field (byteCount) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content)
uint8_t byteCount = 0;
- _res = plc4c_spi_read_unsigned_short(buf, 8, &byteCount);
+ _res = plc4c_spi_read_unsigned_short(buf, 8, (uint16_t*) &byteCount);
if(_res != OK) {
return _res;
}
@@ -874,7 +874,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_pdu_parse(plc4c_spi_read_buffer
// Implicit Field (byteCount) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content)
uint8_t byteCount = 0;
- _res = plc4c_spi_read_unsigned_short(buf, 8, &byteCount);
+ _res = plc4c_spi_read_unsigned_short(buf, 8, (uint16_t*) &byteCount);
if(_res != OK) {
return _res;
}
@@ -907,7 +907,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_pdu_parse(plc4c_spi_read_buffer
// Implicit Field (byteCount) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content)
uint8_t byteCount = 0;
- _res = plc4c_spi_read_unsigned_short(buf, 8, &byteCount);
+ _res = plc4c_spi_read_unsigned_short(buf, 8, (uint16_t*) &byteCount);
if(_res != OK) {
return _res;
}
@@ -940,7 +940,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_pdu_parse(plc4c_spi_read_buffer
// Implicit Field (byteCount) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content)
uint8_t byteCount = 0;
- _res = plc4c_spi_read_unsigned_short(buf, 8, &byteCount);
+ _res = plc4c_spi_read_unsigned_short(buf, 8, (uint16_t*) &byteCount);
if(_res != OK) {
return _res;
}
@@ -976,7 +976,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_pdu_parse(plc4c_spi_read_buffer
// Simple Field (value)
uint8_t value = 0;
- _res = plc4c_spi_read_unsigned_short(buf, 8, &value);
+ _res = plc4c_spi_read_unsigned_short(buf, 8, (uint16_t*) &value);
if(_res != OK) {
return _res;
}
@@ -988,7 +988,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_pdu_parse(plc4c_spi_read_buffer
// Simple Field (status)
uint16_t status = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &status);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &status);
if(_res != OK) {
return _res;
}
@@ -998,7 +998,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_pdu_parse(plc4c_spi_read_buffer
// Simple Field (eventCount)
uint16_t eventCount = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &eventCount);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &eventCount);
if(_res != OK) {
return _res;
}
@@ -1013,7 +1013,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_pdu_parse(plc4c_spi_read_buffer
// Implicit Field (byteCount) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content)
uint8_t byteCount = 0;
- _res = plc4c_spi_read_unsigned_short(buf, 8, &byteCount);
+ _res = plc4c_spi_read_unsigned_short(buf, 8, (uint16_t*) &byteCount);
if(_res != OK) {
return _res;
}
@@ -1022,7 +1022,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_pdu_parse(plc4c_spi_read_buffer
// Simple Field (status)
uint16_t status = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &status);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &status);
if(_res != OK) {
return _res;
}
@@ -1032,7 +1032,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_pdu_parse(plc4c_spi_read_buffer
// Simple Field (eventCount)
uint16_t eventCount = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &eventCount);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &eventCount);
if(_res != OK) {
return _res;
}
@@ -1042,7 +1042,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_pdu_parse(plc4c_spi_read_buffer
// Simple Field (messageCount)
uint16_t messageCount = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &messageCount);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &messageCount);
if(_res != OK) {
return _res;
}
@@ -1062,7 +1062,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_pdu_parse(plc4c_spi_read_buffer
int8_t _value = 0;
- _res = plc4c_spi_read_byte(buf, 8, &_value);
+ _res = plc4c_spi_read_byte(buf, 8, (int8_t*) &_value);
if(_res != OK) {
return _res;
}
@@ -1080,7 +1080,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_pdu_parse(plc4c_spi_read_buffer
// Implicit Field (byteCount) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content)
uint8_t byteCount = 0;
- _res = plc4c_spi_read_unsigned_short(buf, 8, &byteCount);
+ _res = plc4c_spi_read_unsigned_short(buf, 8, (uint16_t*) &byteCount);
if(_res != OK) {
return _res;
}
@@ -1099,7 +1099,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_pdu_parse(plc4c_spi_read_buffer
int8_t _value = 0;
- _res = plc4c_spi_read_byte(buf, 8, &_value);
+ _res = plc4c_spi_read_byte(buf, 8, (int8_t*) &_value);
if(_res != OK) {
return _res;
}
diff --git a/sandbox/plc4c/generated-sources/modbus/src/modbus_pdu_read_file_record_request_item.c b/sandbox/plc4c/generated-sources/modbus/src/modbus_pdu_read_file_record_request_item.c
index 63766db..544a2b5 100644
--- a/sandbox/plc4c/generated-sources/modbus/src/modbus_pdu_read_file_record_request_item.c
+++ b/sandbox/plc4c/generated-sources/modbus/src/modbus_pdu_read_file_record_request_item.c
@@ -37,7 +37,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_pdu_read_file_record_request_it
// Simple Field (referenceType)
uint8_t referenceType = 0;
- _res = plc4c_spi_read_unsigned_short(buf, 8, &referenceType);
+ _res = plc4c_spi_read_unsigned_short(buf, 8, (uint16_t*) &referenceType);
if(_res != OK) {
return _res;
}
@@ -45,7 +45,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_pdu_read_file_record_request_it
// Simple Field (fileNumber)
uint16_t fileNumber = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &fileNumber);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &fileNumber);
if(_res != OK) {
return _res;
}
@@ -53,7 +53,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_pdu_read_file_record_request_it
// Simple Field (recordNumber)
uint16_t recordNumber = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &recordNumber);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &recordNumber);
if(_res != OK) {
return _res;
}
@@ -61,7 +61,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_pdu_read_file_record_request_it
// Simple Field (recordLength)
uint16_t recordLength = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &recordLength);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &recordLength);
if(_res != OK) {
return _res;
}
diff --git a/sandbox/plc4c/generated-sources/modbus/src/modbus_pdu_read_file_record_response_item.c b/sandbox/plc4c/generated-sources/modbus/src/modbus_pdu_read_file_record_response_item.c
index bf90007..48443d3 100644
--- a/sandbox/plc4c/generated-sources/modbus/src/modbus_pdu_read_file_record_response_item.c
+++ b/sandbox/plc4c/generated-sources/modbus/src/modbus_pdu_read_file_record_response_item.c
@@ -37,14 +37,14 @@ plc4c_return_code plc4c_modbus_read_write_modbus_pdu_read_file_record_response_i
// Implicit Field (dataLength) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content)
uint8_t dataLength = 0;
- _res = plc4c_spi_read_unsigned_short(buf, 8, &dataLength);
+ _res = plc4c_spi_read_unsigned_short(buf, 8, (uint16_t*) &dataLength);
if(_res != OK) {
return _res;
}
// Simple Field (referenceType)
uint8_t referenceType = 0;
- _res = plc4c_spi_read_unsigned_short(buf, 8, &referenceType);
+ _res = plc4c_spi_read_unsigned_short(buf, 8, (uint16_t*) &referenceType);
if(_res != OK) {
return _res;
}
@@ -61,7 +61,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_pdu_read_file_record_response_i
uint8_t dataEndPos = plc4c_spi_read_get_pos(buf) + _dataLength;
while(plc4c_spi_read_get_pos(buf) < dataEndPos) {
uint16_t _value = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &_value);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &_value);
if(_res != OK) {
return _res;
}
diff --git a/sandbox/plc4c/generated-sources/modbus/src/modbus_pdu_write_file_record_request_item.c b/sandbox/plc4c/generated-sources/modbus/src/modbus_pdu_write_file_record_request_item.c
index 161ee2e..dc2fe82 100644
--- a/sandbox/plc4c/generated-sources/modbus/src/modbus_pdu_write_file_record_request_item.c
+++ b/sandbox/plc4c/generated-sources/modbus/src/modbus_pdu_write_file_record_request_item.c
@@ -37,7 +37,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_pdu_write_file_record_request_i
// Simple Field (referenceType)
uint8_t referenceType = 0;
- _res = plc4c_spi_read_unsigned_short(buf, 8, &referenceType);
+ _res = plc4c_spi_read_unsigned_short(buf, 8, (uint16_t*) &referenceType);
if(_res != OK) {
return _res;
}
@@ -45,7 +45,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_pdu_write_file_record_request_i
// Simple Field (fileNumber)
uint16_t fileNumber = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &fileNumber);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &fileNumber);
if(_res != OK) {
return _res;
}
@@ -53,7 +53,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_pdu_write_file_record_request_i
// Simple Field (recordNumber)
uint16_t recordNumber = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &recordNumber);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &recordNumber);
if(_res != OK) {
return _res;
}
@@ -61,7 +61,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_pdu_write_file_record_request_i
// Implicit Field (recordLength) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content)
uint16_t recordLength = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &recordLength);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &recordLength);
if(_res != OK) {
return _res;
}
@@ -77,7 +77,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_pdu_write_file_record_request_i
uint8_t recordDataEndPos = plc4c_spi_read_get_pos(buf) + _recordDataLength;
while(plc4c_spi_read_get_pos(buf) < recordDataEndPos) {
uint16_t _value = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &_value);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &_value);
if(_res != OK) {
return _res;
}
diff --git a/sandbox/plc4c/generated-sources/modbus/src/modbus_pdu_write_file_record_response_item.c b/sandbox/plc4c/generated-sources/modbus/src/modbus_pdu_write_file_record_response_item.c
index af8e4f8..c7f7241 100644
--- a/sandbox/plc4c/generated-sources/modbus/src/modbus_pdu_write_file_record_response_item.c
+++ b/sandbox/plc4c/generated-sources/modbus/src/modbus_pdu_write_file_record_response_item.c
@@ -37,7 +37,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_pdu_write_file_record_response_
// Simple Field (referenceType)
uint8_t referenceType = 0;
- _res = plc4c_spi_read_unsigned_short(buf, 8, &referenceType);
+ _res = plc4c_spi_read_unsigned_short(buf, 8, (uint16_t*) &referenceType);
if(_res != OK) {
return _res;
}
@@ -45,7 +45,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_pdu_write_file_record_response_
// Simple Field (fileNumber)
uint16_t fileNumber = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &fileNumber);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &fileNumber);
if(_res != OK) {
return _res;
}
@@ -53,7 +53,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_pdu_write_file_record_response_
// Simple Field (recordNumber)
uint16_t recordNumber = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &recordNumber);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &recordNumber);
if(_res != OK) {
return _res;
}
@@ -61,7 +61,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_pdu_write_file_record_response_
// Implicit Field (recordLength) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content)
uint16_t recordLength = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &recordLength);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &recordLength);
if(_res != OK) {
return _res;
}
@@ -77,7 +77,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_pdu_write_file_record_response_
uint8_t recordDataEndPos = plc4c_spi_read_get_pos(buf) + _recordDataLength;
while(plc4c_spi_read_get_pos(buf) < recordDataEndPos) {
uint16_t _value = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &_value);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &_value);
if(_res != OK) {
return _res;
}
diff --git a/sandbox/plc4c/generated-sources/modbus/src/modbus_serial_adu.c b/sandbox/plc4c/generated-sources/modbus/src/modbus_serial_adu.c
index a0e01c9..cc0dc77 100644
--- a/sandbox/plc4c/generated-sources/modbus/src/modbus_serial_adu.c
+++ b/sandbox/plc4c/generated-sources/modbus/src/modbus_serial_adu.c
@@ -37,7 +37,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_serial_adu_parse(plc4c_spi_read
// Simple Field (transactionId)
uint16_t transactionId = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &transactionId);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &transactionId);
if(_res != OK) {
return _res;
}
@@ -46,7 +46,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_serial_adu_parse(plc4c_spi_read
// Reserved Field (Compartmentalized so the "reserved" variable can't leak)
{
uint16_t _reserved = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, _reserved);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) _reserved);
if(_res != OK) {
return _res;
}
@@ -57,7 +57,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_serial_adu_parse(plc4c_spi_read
// Simple Field (length)
uint16_t length = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &length);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &length);
if(_res != OK) {
return _res;
}
@@ -65,7 +65,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_serial_adu_parse(plc4c_spi_read
// Simple Field (address)
uint8_t address = 0;
- _res = plc4c_spi_read_unsigned_short(buf, 8, &address);
+ _res = plc4c_spi_read_unsigned_short(buf, 8, (uint16_t*) &address);
if(_res != OK) {
return _res;
}
diff --git a/sandbox/plc4c/generated-sources/modbus/src/modbus_tcp_adu.c b/sandbox/plc4c/generated-sources/modbus/src/modbus_tcp_adu.c
index f62bd54..5a67bc2 100644
--- a/sandbox/plc4c/generated-sources/modbus/src/modbus_tcp_adu.c
+++ b/sandbox/plc4c/generated-sources/modbus/src/modbus_tcp_adu.c
@@ -37,7 +37,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_tcp_adu_parse(plc4c_spi_read_bu
// Simple Field (transactionIdentifier)
uint16_t transactionIdentifier = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &transactionIdentifier);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &transactionIdentifier);
if(_res != OK) {
return _res;
}
@@ -45,7 +45,7 @@ plc4c_return_code plc4c_modbus_read_write_modbus_tcp_adu_parse(plc4c_spi_read_bu
// Const Field (protocolIdentifier)
uint16_t protocolIdentifier = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &protocolIdentifier);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &protocolIdentifier);
if(_res != OK) {
return _res;
}
@@ -56,14 +56,14 @@ plc4c_return_code plc4c_modbus_read_write_modbus_tcp_adu_parse(plc4c_spi_read_bu
// Implicit Field (length) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content)
uint16_t length = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &length);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &length);
if(_res != OK) {
return _res;
}
// Simple Field (unitIdentifier)
uint8_t unitIdentifier = 0;
- _res = plc4c_spi_read_unsigned_short(buf, 8, &unitIdentifier);
+ _res = plc4c_spi_read_unsigned_short(buf, 8, (uint16_t*) &unitIdentifier);
if(_res != OK) {
return _res;
}
diff --git a/sandbox/plc4c/generated-sources/s7/includes/cotp_packet.h b/sandbox/plc4c/generated-sources/s7/includes/cotp_packet.h
index a39142d..a573bd4 100644
--- a/sandbox/plc4c/generated-sources/s7/includes/cotp_packet.h
+++ b/sandbox/plc4c/generated-sources/s7/includes/cotp_packet.h
@@ -87,6 +87,9 @@ struct plc4c_s7_read_write_cotp_packet {
};
typedef struct plc4c_s7_read_write_cotp_packet plc4c_s7_read_write_cotp_packet;
+// Create an empty NULL-struct
+static const plc4c_s7_read_write_cotp_packet plc4c_s7_read_write_cotp_packet_null;
+
plc4c_return_code plc4c_s7_read_write_cotp_packet_parse(plc4c_spi_read_buffer* buf, uint16_t cotpLen, plc4c_s7_read_write_cotp_packet** message);
plc4c_return_code plc4c_s7_read_write_cotp_packet_serialize(plc4c_spi_write_buffer* buf, plc4c_s7_read_write_cotp_packet* message);
diff --git a/sandbox/plc4c/generated-sources/s7/includes/cotp_parameter.h b/sandbox/plc4c/generated-sources/s7/includes/cotp_parameter.h
index ce54f97..d34f060 100644
--- a/sandbox/plc4c/generated-sources/s7/includes/cotp_parameter.h
+++ b/sandbox/plc4c/generated-sources/s7/includes/cotp_parameter.h
@@ -70,6 +70,9 @@ struct plc4c_s7_read_write_cotp_parameter {
};
typedef struct plc4c_s7_read_write_cotp_parameter plc4c_s7_read_write_cotp_parameter;
+// Create an empty NULL-struct
+static const plc4c_s7_read_write_cotp_parameter plc4c_s7_read_write_cotp_parameter_null;
+
plc4c_return_code plc4c_s7_read_write_cotp_parameter_parse(plc4c_spi_read_buffer* buf, uint8_t rest, plc4c_s7_read_write_cotp_parameter** message);
plc4c_return_code plc4c_s7_read_write_cotp_parameter_serialize(plc4c_spi_write_buffer* buf, plc4c_s7_read_write_cotp_parameter* message);
diff --git a/sandbox/plc4c/generated-sources/s7/includes/cotp_protocol_class.h b/sandbox/plc4c/generated-sources/s7/includes/cotp_protocol_class.h
index 6cd97c8..dd8657c 100644
--- a/sandbox/plc4c/generated-sources/s7/includes/cotp_protocol_class.h
+++ b/sandbox/plc4c/generated-sources/s7/includes/cotp_protocol_class.h
@@ -34,6 +34,9 @@ enum plc4c_s7_read_write_cotp_protocol_class {
};
typedef enum plc4c_s7_read_write_cotp_protocol_class plc4c_s7_read_write_cotp_protocol_class;
+// Create an empty NULL-struct
+static const plc4c_s7_read_write_cotp_protocol_class plc4c_s7_read_write_cotp_protocol_class_null;
+
#ifdef __cplusplus
}
diff --git a/sandbox/plc4c/generated-sources/s7/includes/cotp_tpdu_size.h b/sandbox/plc4c/generated-sources/s7/includes/cotp_tpdu_size.h
index 5087daa..a330bc3 100644
--- a/sandbox/plc4c/generated-sources/s7/includes/cotp_tpdu_size.h
+++ b/sandbox/plc4c/generated-sources/s7/includes/cotp_tpdu_size.h
@@ -36,6 +36,9 @@ enum plc4c_s7_read_write_cotp_tpdu_size {
};
typedef enum plc4c_s7_read_write_cotp_tpdu_size plc4c_s7_read_write_cotp_tpdu_size;
+// Create an empty NULL-struct
+static const plc4c_s7_read_write_cotp_tpdu_size plc4c_s7_read_write_cotp_tpdu_size_null;
+
uint16_t plc4c_s7_read_write_cotp_tpdu_size_get_size_in_bytes(plc4c_s7_read_write_cotp_tpdu_size value) {
switch(value) {
diff --git a/sandbox/plc4c/generated-sources/s7/includes/data_transport_error_code.h b/sandbox/plc4c/generated-sources/s7/includes/data_transport_error_code.h
index 8a68299..d6e9928 100644
--- a/sandbox/plc4c/generated-sources/s7/includes/data_transport_error_code.h
+++ b/sandbox/plc4c/generated-sources/s7/includes/data_transport_error_code.h
@@ -35,6 +35,9 @@ enum plc4c_s7_read_write_data_transport_error_code {
};
typedef enum plc4c_s7_read_write_data_transport_error_code plc4c_s7_read_write_data_transport_error_code;
+// Create an empty NULL-struct
+static const plc4c_s7_read_write_data_transport_error_code plc4c_s7_read_write_data_transport_error_code_null;
+
#ifdef __cplusplus
}
diff --git a/sandbox/plc4c/generated-sources/s7/includes/data_transport_size.h b/sandbox/plc4c/generated-sources/s7/includes/data_transport_size.h
index c3e958e..647b813 100644
--- a/sandbox/plc4c/generated-sources/s7/includes/data_transport_size.h
+++ b/sandbox/plc4c/generated-sources/s7/includes/data_transport_size.h
@@ -36,6 +36,9 @@ enum plc4c_s7_read_write_data_transport_size {
};
typedef enum plc4c_s7_read_write_data_transport_size plc4c_s7_read_write_data_transport_size;
+// Create an empty NULL-struct
+static const plc4c_s7_read_write_data_transport_size plc4c_s7_read_write_data_transport_size_null;
+
bool plc4c_s7_read_write_data_transport_size_get_size_in_bits(plc4c_s7_read_write_data_transport_size value) {
switch(value) {
diff --git a/sandbox/plc4c/generated-sources/s7/includes/device_group.h b/sandbox/plc4c/generated-sources/s7/includes/device_group.h
index 97bff6d..e21f7f9 100644
--- a/sandbox/plc4c/generated-sources/s7/includes/device_group.h
+++ b/sandbox/plc4c/generated-sources/s7/includes/device_group.h
@@ -32,6 +32,9 @@ enum plc4c_s7_read_write_device_group {
};
typedef enum plc4c_s7_read_write_device_group plc4c_s7_read_write_device_group;
+// Create an empty NULL-struct
+static const plc4c_s7_read_write_device_group plc4c_s7_read_write_device_group_null;
+
#ifdef __cplusplus
}
diff --git a/sandbox/plc4c/generated-sources/s7/includes/memory_area.h b/sandbox/plc4c/generated-sources/s7/includes/memory_area.h
index 2ae4407..883e000 100644
--- a/sandbox/plc4c/generated-sources/s7/includes/memory_area.h
+++ b/sandbox/plc4c/generated-sources/s7/includes/memory_area.h
@@ -38,6 +38,9 @@ enum plc4c_s7_read_write_memory_area {
};
typedef enum plc4c_s7_read_write_memory_area plc4c_s7_read_write_memory_area;
+// Create an empty NULL-struct
+static const plc4c_s7_read_write_memory_area plc4c_s7_read_write_memory_area_null;
+
char * plc4c_s7_read_write_memory_area_get_short_name(plc4c_s7_read_write_memory_area value) {
switch(value) {
diff --git a/sandbox/plc4c/generated-sources/s7/includes/s7_address.h b/sandbox/plc4c/generated-sources/s7/includes/s7_address.h
index 3dd232f..a8c1379 100644
--- a/sandbox/plc4c/generated-sources/s7/includes/s7_address.h
+++ b/sandbox/plc4c/generated-sources/s7/includes/s7_address.h
@@ -60,6 +60,9 @@ struct plc4c_s7_read_write_s7_address {
};
typedef struct plc4c_s7_read_write_s7_address plc4c_s7_read_write_s7_address;
+// Create an empty NULL-struct
+static const plc4c_s7_read_write_s7_address plc4c_s7_read_write_s7_address_null;
+
plc4c_return_code plc4c_s7_read_write_s7_address_parse(plc4c_spi_read_buffer* buf, plc4c_s7_read_write_s7_address** message);
plc4c_return_code plc4c_s7_read_write_s7_address_serialize(plc4c_spi_write_buffer* buf, plc4c_s7_read_write_s7_address* message);
diff --git a/sandbox/plc4c/generated-sources/s7/includes/s7_message.h b/sandbox/plc4c/generated-sources/s7/includes/s7_message.h
index 05cd4ec..2efe20b 100644
--- a/sandbox/plc4c/generated-sources/s7/includes/s7_message.h
+++ b/sandbox/plc4c/generated-sources/s7/includes/s7_message.h
@@ -74,6 +74,9 @@ struct plc4c_s7_read_write_s7_message {
};
typedef struct plc4c_s7_read_write_s7_message plc4c_s7_read_write_s7_message;
+// Create an empty NULL-struct
+static const plc4c_s7_read_write_s7_message plc4c_s7_read_write_s7_message_null;
+
plc4c_return_code plc4c_s7_read_write_s7_message_parse(plc4c_spi_read_buffer* buf, plc4c_s7_read_write_s7_message** message);
plc4c_return_code plc4c_s7_read_write_s7_message_serialize(plc4c_spi_write_buffer* buf, plc4c_s7_read_write_s7_message* message);
diff --git a/sandbox/plc4c/generated-sources/s7/includes/s7_parameter.h b/sandbox/plc4c/generated-sources/s7/includes/s7_parameter.h
index 5590c4f..c5166f2 100644
--- a/sandbox/plc4c/generated-sources/s7/includes/s7_parameter.h
+++ b/sandbox/plc4c/generated-sources/s7/includes/s7_parameter.h
@@ -78,6 +78,9 @@ struct plc4c_s7_read_write_s7_parameter {
};
typedef struct plc4c_s7_read_write_s7_parameter plc4c_s7_read_write_s7_parameter;
+// Create an empty NULL-struct
+static const plc4c_s7_read_write_s7_parameter plc4c_s7_read_write_s7_parameter_null;
+
plc4c_return_code plc4c_s7_read_write_s7_parameter_parse(plc4c_spi_read_buffer* buf, uint8_t messageType, plc4c_s7_read_write_s7_parameter** message);
plc4c_return_code plc4c_s7_read_write_s7_parameter_serialize(plc4c_spi_write_buffer* buf, plc4c_s7_read_write_s7_parameter* message);
diff --git a/sandbox/plc4c/generated-sources/s7/includes/s7_parameter_user_data_item.h b/sandbox/plc4c/generated-sources/s7/includes/s7_parameter_user_data_item.h
index f47dce6..a92d913 100644
--- a/sandbox/plc4c/generated-sources/s7/includes/s7_parameter_user_data_item.h
+++ b/sandbox/plc4c/generated-sources/s7/includes/s7_parameter_user_data_item.h
@@ -60,6 +60,9 @@ struct plc4c_s7_read_write_s7_parameter_user_data_item {
};
typedef struct plc4c_s7_read_write_s7_parameter_user_data_item plc4c_s7_read_write_s7_parameter_user_data_item;
+// Create an empty NULL-struct
+static const plc4c_s7_read_write_s7_parameter_user_data_item plc4c_s7_read_write_s7_parameter_user_data_item_null;
+
plc4c_return_code plc4c_s7_read_write_s7_parameter_user_data_item_parse(plc4c_spi_read_buffer* buf, plc4c_s7_read_write_s7_parameter_user_data_item** message);
plc4c_return_code plc4c_s7_read_write_s7_parameter_user_data_item_serialize(plc4c_spi_write_buffer* buf, plc4c_s7_read_write_s7_parameter_user_data_item* message);
diff --git a/sandbox/plc4c/generated-sources/s7/includes/s7_payload.h b/sandbox/plc4c/generated-sources/s7/includes/s7_payload.h
index f5879da..c445b97 100644
--- a/sandbox/plc4c/generated-sources/s7/includes/s7_payload.h
+++ b/sandbox/plc4c/generated-sources/s7/includes/s7_payload.h
@@ -70,6 +70,9 @@ struct plc4c_s7_read_write_s7_payload {
};
typedef struct plc4c_s7_read_write_s7_payload plc4c_s7_read_write_s7_payload;
+// Create an empty NULL-struct
+static const plc4c_s7_read_write_s7_payload plc4c_s7_read_write_s7_payload_null;
+
plc4c_return_code plc4c_s7_read_write_s7_payload_parse(plc4c_spi_read_buffer* buf, uint8_t messageType, plc4c_s7_read_write_s7_parameter* parameter, plc4c_s7_read_write_s7_payload** message);
plc4c_return_code plc4c_s7_read_write_s7_payload_serialize(plc4c_spi_write_buffer* buf, plc4c_s7_read_write_s7_payload* message);
diff --git a/sandbox/plc4c/generated-sources/s7/includes/s7_payload_user_data_item.h b/sandbox/plc4c/generated-sources/s7/includes/s7_payload_user_data_item.h
index e24685f..beb4db3 100644
--- a/sandbox/plc4c/generated-sources/s7/includes/s7_payload_user_data_item.h
+++ b/sandbox/plc4c/generated-sources/s7/includes/s7_payload_user_data_item.h
@@ -67,6 +67,9 @@ struct plc4c_s7_read_write_s7_payload_user_data_item {
};
typedef struct plc4c_s7_read_write_s7_payload_user_data_item plc4c_s7_read_write_s7_payload_user_data_item;
+// Create an empty NULL-struct
+static const 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* buf, unsigned int cpuFunctionType, 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* buf, plc4c_s7_read_write_s7_payload_user_data_item* message);
diff --git a/sandbox/plc4c/generated-sources/s7/includes/s7_var_payload_data_item.h b/sandbox/plc4c/generated-sources/s7/includes/s7_var_payload_data_item.h
index ed9c478..be57402 100644
--- a/sandbox/plc4c/generated-sources/s7/includes/s7_var_payload_data_item.h
+++ b/sandbox/plc4c/generated-sources/s7/includes/s7_var_payload_data_item.h
@@ -37,6 +37,9 @@ struct plc4c_s7_read_write_s7_var_payload_data_item {
};
typedef struct plc4c_s7_read_write_s7_var_payload_data_item plc4c_s7_read_write_s7_var_payload_data_item;
+// Create an empty NULL-struct
+static const plc4c_s7_read_write_s7_var_payload_data_item plc4c_s7_read_write_s7_var_payload_data_item_null;
+
plc4c_return_code plc4c_s7_read_write_s7_var_payload_data_item_parse(plc4c_spi_read_buffer* buf, bool lastItem, plc4c_s7_read_write_s7_var_payload_data_item** message);
plc4c_return_code plc4c_s7_read_write_s7_var_payload_data_item_serialize(plc4c_spi_write_buffer* buf, plc4c_s7_read_write_s7_var_payload_data_item* message, bool lastItem);
diff --git a/sandbox/plc4c/generated-sources/s7/includes/s7_var_payload_status_item.h b/sandbox/plc4c/generated-sources/s7/includes/s7_var_payload_status_item.h
index b9b73fd..000912f 100644
--- a/sandbox/plc4c/generated-sources/s7/includes/s7_var_payload_status_item.h
+++ b/sandbox/plc4c/generated-sources/s7/includes/s7_var_payload_status_item.h
@@ -33,6 +33,9 @@ struct plc4c_s7_read_write_s7_var_payload_status_item {
};
typedef struct plc4c_s7_read_write_s7_var_payload_status_item plc4c_s7_read_write_s7_var_payload_status_item;
+// Create an empty NULL-struct
+static const plc4c_s7_read_write_s7_var_payload_status_item plc4c_s7_read_write_s7_var_payload_status_item_null;
+
plc4c_return_code plc4c_s7_read_write_s7_var_payload_status_item_parse(plc4c_spi_read_buffer* buf, plc4c_s7_read_write_s7_var_payload_status_item** message);
plc4c_return_code plc4c_s7_read_write_s7_var_payload_status_item_serialize(plc4c_spi_write_buffer* buf, plc4c_s7_read_write_s7_var_payload_status_item* message);
diff --git a/sandbox/plc4c/generated-sources/s7/includes/s7_var_request_parameter_item.h b/sandbox/plc4c/generated-sources/s7/includes/s7_var_request_parameter_item.h
index 0d05c95..6caa56d 100644
--- a/sandbox/plc4c/generated-sources/s7/includes/s7_var_request_parameter_item.h
+++ b/sandbox/plc4c/generated-sources/s7/includes/s7_var_request_parameter_item.h
@@ -54,6 +54,9 @@ struct plc4c_s7_read_write_s7_var_request_parameter_item {
};
typedef struct plc4c_s7_read_write_s7_var_request_parameter_item plc4c_s7_read_write_s7_var_request_parameter_item;
+// Create an empty NULL-struct
+static const plc4c_s7_read_write_s7_var_request_parameter_item plc4c_s7_read_write_s7_var_request_parameter_item_null;
+
plc4c_return_code plc4c_s7_read_write_s7_var_request_parameter_item_parse(plc4c_spi_read_buffer* buf, plc4c_s7_read_write_s7_var_request_parameter_item** message);
plc4c_return_code plc4c_s7_read_write_s7_var_request_parameter_item_serialize(plc4c_spi_write_buffer* buf, plc4c_s7_read_write_s7_var_request_parameter_item* message);
diff --git a/sandbox/plc4c/generated-sources/s7/includes/szl_data_tree_item.h b/sandbox/plc4c/generated-sources/s7/includes/szl_data_tree_item.h
index a38dfcb..01e932d 100644
--- a/sandbox/plc4c/generated-sources/s7/includes/szl_data_tree_item.h
+++ b/sandbox/plc4c/generated-sources/s7/includes/szl_data_tree_item.h
@@ -36,6 +36,9 @@ struct plc4c_s7_read_write_szl_data_tree_item {
};
typedef struct plc4c_s7_read_write_szl_data_tree_item plc4c_s7_read_write_szl_data_tree_item;
+// Create an empty NULL-struct
+static const plc4c_s7_read_write_szl_data_tree_item plc4c_s7_read_write_szl_data_tree_item_null;
+
plc4c_return_code plc4c_s7_read_write_szl_data_tree_item_parse(plc4c_spi_read_buffer* buf, plc4c_s7_read_write_szl_data_tree_item** message);
plc4c_return_code plc4c_s7_read_write_szl_data_tree_item_serialize(plc4c_spi_write_buffer* buf, plc4c_s7_read_write_szl_data_tree_item* message);
diff --git a/sandbox/plc4c/generated-sources/s7/includes/szl_id.h b/sandbox/plc4c/generated-sources/s7/includes/szl_id.h
index 91645e1..b866a23 100644
--- a/sandbox/plc4c/generated-sources/s7/includes/szl_id.h
+++ b/sandbox/plc4c/generated-sources/s7/includes/szl_id.h
@@ -36,6 +36,9 @@ struct plc4c_s7_read_write_szl_id {
};
typedef struct plc4c_s7_read_write_szl_id plc4c_s7_read_write_szl_id;
+// Create an empty NULL-struct
+static const plc4c_s7_read_write_szl_id plc4c_s7_read_write_szl_id_null;
+
plc4c_return_code plc4c_s7_read_write_szl_id_parse(plc4c_spi_read_buffer* buf, plc4c_s7_read_write_szl_id** message);
plc4c_return_code plc4c_s7_read_write_szl_id_serialize(plc4c_spi_write_buffer* buf, plc4c_s7_read_write_szl_id* message);
diff --git a/sandbox/plc4c/generated-sources/s7/includes/szl_module_type_class.h b/sandbox/plc4c/generated-sources/s7/includes/szl_module_type_class.h
index 6c40d23..b6a4416 100644
--- a/sandbox/plc4c/generated-sources/s7/includes/szl_module_type_class.h
+++ b/sandbox/plc4c/generated-sources/s7/includes/szl_module_type_class.h
@@ -33,6 +33,9 @@ enum plc4c_s7_read_write_szl_module_type_class {
};
typedef enum plc4c_s7_read_write_szl_module_type_class plc4c_s7_read_write_szl_module_type_class;
+// Create an empty NULL-struct
+static const plc4c_s7_read_write_szl_module_type_class plc4c_s7_read_write_szl_module_type_class_null;
+
#ifdef __cplusplus
}
diff --git a/sandbox/plc4c/generated-sources/s7/includes/szl_sublist.h b/sandbox/plc4c/generated-sources/s7/includes/szl_sublist.h
index 8d1ea66..652eafd 100644
--- a/sandbox/plc4c/generated-sources/s7/includes/szl_sublist.h
+++ b/sandbox/plc4c/generated-sources/s7/includes/szl_sublist.h
@@ -48,6 +48,9 @@ enum plc4c_s7_read_write_szl_sublist {
};
typedef enum plc4c_s7_read_write_szl_sublist plc4c_s7_read_write_szl_sublist;
+// Create an empty NULL-struct
+static const plc4c_s7_read_write_szl_sublist plc4c_s7_read_write_szl_sublist_null;
+
#ifdef __cplusplus
}
diff --git a/sandbox/plc4c/generated-sources/s7/includes/tpkt_packet.h b/sandbox/plc4c/generated-sources/s7/includes/tpkt_packet.h
index ab3849e..f9f408a 100644
--- a/sandbox/plc4c/generated-sources/s7/includes/tpkt_packet.h
+++ b/sandbox/plc4c/generated-sources/s7/includes/tpkt_packet.h
@@ -37,6 +37,9 @@ struct plc4c_s7_read_write_tpkt_packet {
};
typedef struct plc4c_s7_read_write_tpkt_packet plc4c_s7_read_write_tpkt_packet;
+// Create an empty NULL-struct
+static const plc4c_s7_read_write_tpkt_packet plc4c_s7_read_write_tpkt_packet_null;
+
plc4c_return_code plc4c_s7_read_write_tpkt_packet_parse(plc4c_spi_read_buffer* buf, plc4c_s7_read_write_tpkt_packet** message);
plc4c_return_code plc4c_s7_read_write_tpkt_packet_serialize(plc4c_spi_write_buffer* buf, plc4c_s7_read_write_tpkt_packet* message);
diff --git a/sandbox/plc4c/generated-sources/s7/includes/transport_size.h b/sandbox/plc4c/generated-sources/s7/includes/transport_size.h
index 9850c8b..141ec56 100644
--- a/sandbox/plc4c/generated-sources/s7/includes/transport_size.h
+++ b/sandbox/plc4c/generated-sources/s7/includes/transport_size.h
@@ -55,6 +55,9 @@ enum plc4c_s7_read_write_transport_size {
};
typedef enum plc4c_s7_read_write_transport_size plc4c_s7_read_write_transport_size;
+// Create an empty NULL-struct
+static const plc4c_s7_read_write_transport_size plc4c_s7_read_write_transport_size_null;
+
bool plc4c_s7_read_write_transport_size_get_supported__s7_300(plc4c_s7_read_write_transport_size value) {
switch(value) {
diff --git a/sandbox/plc4c/generated-sources/s7/src/cotp_packet.c b/sandbox/plc4c/generated-sources/s7/src/cotp_packet.c
index f171ffd..d462a70 100644
--- a/sandbox/plc4c/generated-sources/s7/src/cotp_packet.c
+++ b/sandbox/plc4c/generated-sources/s7/src/cotp_packet.c
@@ -60,14 +60,14 @@ plc4c_return_code plc4c_s7_read_write_cotp_packet_parse(plc4c_spi_read_buffer* b
// Implicit Field (headerLength) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content)
uint8_t headerLength = 0;
- _res = plc4c_spi_read_unsigned_short(buf, 8, &headerLength);
+ _res = plc4c_spi_read_unsigned_short(buf, 8, (uint16_t*) &headerLength);
if(_res != OK) {
return _res;
}
// Discriminator Field (tpduCode) (Used as input to a switch field)
uint8_t tpduCode = 0;
- _res = plc4c_spi_read_unsigned_short(buf, 8, &tpduCode);
+ _res = plc4c_spi_read_unsigned_short(buf, 8, (uint16_t*) &tpduCode);
if(_res != OK) {
return _res;
}
@@ -78,7 +78,7 @@ plc4c_return_code plc4c_s7_read_write_cotp_packet_parse(plc4c_spi_read_buffer* b
// Simple Field (eot)
bool eot = false;
- _res = plc4c_spi_read_bit(buf, &eot);
+ _res = plc4c_spi_read_bit(buf, (bool*) &eot);
if(_res != OK) {
return _res;
}
@@ -88,7 +88,7 @@ plc4c_return_code plc4c_s7_read_write_cotp_packet_parse(plc4c_spi_read_buffer* b
// Simple Field (tpduRef)
unsigned int tpduRef = 0;
- _res = plc4c_spi_read_unsigned_short(buf, 7, &tpduRef);
+ _res = plc4c_spi_read_unsigned_short(buf, 7, (uint16_t*) &tpduRef);
if(_res != OK) {
return _res;
}
@@ -100,7 +100,7 @@ plc4c_return_code plc4c_s7_read_write_cotp_packet_parse(plc4c_spi_read_buffer* b
// Simple Field (destinationReference)
uint16_t destinationReference = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &destinationReference);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &destinationReference);
if(_res != OK) {
return _res;
}
@@ -110,7 +110,7 @@ plc4c_return_code plc4c_s7_read_write_cotp_packet_parse(plc4c_spi_read_buffer* b
// Simple Field (sourceReference)
uint16_t sourceReference = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &sourceReference);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &sourceReference);
if(_res != OK) {
return _res;
}
@@ -119,8 +119,8 @@ plc4c_return_code plc4c_s7_read_write_cotp_packet_parse(plc4c_spi_read_buffer* b
// Enum field (protocolClass)
- plc4c_s7_read_write_cotp_protocol_class protocolClass = NULL;
- _res = plc4c_spi_read_byte(buf, 8, &protocolClass);
+ plc4c_s7_read_write_cotp_protocol_class protocolClass = plc4c_s7_read_write_cotp_protocol_class_null;
+ _res = plc4c_spi_read_byte(buf, 8, (int8_t*) &protocolClass);
if(_res != OK) {
return _res;
}
@@ -132,7 +132,7 @@ plc4c_return_code plc4c_s7_read_write_cotp_packet_parse(plc4c_spi_read_buffer* b
// Simple Field (destinationReference)
uint16_t destinationReference = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &destinationReference);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &destinationReference);
if(_res != OK) {
return _res;
}
@@ -142,7 +142,7 @@ plc4c_return_code plc4c_s7_read_write_cotp_packet_parse(plc4c_spi_read_buffer* b
// Simple Field (sourceReference)
uint16_t sourceReference = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &sourceReference);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &sourceReference);
if(_res != OK) {
return _res;
}
@@ -151,8 +151,8 @@ plc4c_return_code plc4c_s7_read_write_cotp_packet_parse(plc4c_spi_read_buffer* b
// Enum field (protocolClass)
- plc4c_s7_read_write_cotp_protocol_class protocolClass = NULL;
- _res = plc4c_spi_read_byte(buf, 8, &protocolClass);
+ plc4c_s7_read_write_cotp_protocol_class protocolClass = plc4c_s7_read_write_cotp_protocol_class_null;
+ _res = plc4c_spi_read_byte(buf, 8, (int8_t*) &protocolClass);
if(_res != OK) {
return _res;
}
@@ -164,7 +164,7 @@ plc4c_return_code plc4c_s7_read_write_cotp_packet_parse(plc4c_spi_read_buffer* b
// Simple Field (destinationReference)
uint16_t destinationReference = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &destinationReference);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &destinationReference);
if(_res != OK) {
return _res;
}
@@ -174,7 +174,7 @@ plc4c_return_code plc4c_s7_read_write_cotp_packet_parse(plc4c_spi_read_buffer* b
// Simple Field (sourceReference)
uint16_t sourceReference = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &sourceReference);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &sourceReference);
if(_res != OK) {
return _res;
}
@@ -183,8 +183,8 @@ plc4c_return_code plc4c_s7_read_write_cotp_packet_parse(plc4c_spi_read_buffer* b
// Enum field (protocolClass)
- plc4c_s7_read_write_cotp_protocol_class protocolClass = NULL;
- _res = plc4c_spi_read_byte(buf, 8, &protocolClass);
+ plc4c_s7_read_write_cotp_protocol_class protocolClass = plc4c_s7_read_write_cotp_protocol_class_null;
+ _res = plc4c_spi_read_byte(buf, 8, (int8_t*) &protocolClass);
if(_res != OK) {
return _res;
}
@@ -196,7 +196,7 @@ plc4c_return_code plc4c_s7_read_write_cotp_packet_parse(plc4c_spi_read_buffer* b
// Simple Field (destinationReference)
uint16_t destinationReference = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &destinationReference);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &destinationReference);
if(_res != OK) {
return _res;
}
@@ -206,7 +206,7 @@ plc4c_return_code plc4c_s7_read_write_cotp_packet_parse(plc4c_spi_read_buffer* b
// Simple Field (sourceReference)
uint16_t sourceReference = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &sourceReference);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &sourceReference);
if(_res != OK) {
return _res;
}
@@ -218,7 +218,7 @@ plc4c_return_code plc4c_s7_read_write_cotp_packet_parse(plc4c_spi_read_buffer* b
// Simple Field (destinationReference)
uint16_t destinationReference = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &destinationReference);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &destinationReference);
if(_res != OK) {
return _res;
}
@@ -228,7 +228,7 @@ plc4c_return_code plc4c_s7_read_write_cotp_packet_parse(plc4c_spi_read_buffer* b
// Simple Field (rejectCause)
uint8_t rejectCause = 0;
- _res = plc4c_spi_read_unsigned_short(buf, 8, &rejectCause);
+ _res = plc4c_spi_read_unsigned_short(buf, 8, (uint16_t*) &rejectCause);
if(_res != OK) {
return _res;
}
diff --git a/sandbox/plc4c/generated-sources/s7/src/cotp_parameter.c b/sandbox/plc4c/generated-sources/s7/src/cotp_parameter.c
index 36d15d1..f06b98d 100644
--- a/sandbox/plc4c/generated-sources/s7/src/cotp_parameter.c
+++ b/sandbox/plc4c/generated-sources/s7/src/cotp_parameter.c
@@ -58,14 +58,14 @@ plc4c_return_code plc4c_s7_read_write_cotp_parameter_parse(plc4c_spi_read_buffer
// Discriminator Field (parameterType) (Used as input to a switch field)
uint8_t parameterType = 0;
- _res = plc4c_spi_read_unsigned_short(buf, 8, ¶meterType);
+ _res = plc4c_spi_read_unsigned_short(buf, 8, (uint16_t*) ¶meterType);
if(_res != OK) {
return _res;
}
// Implicit Field (parameterLength) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content)
uint8_t parameterLength = 0;
- _res = plc4c_spi_read_unsigned_short(buf, 8, ¶meterLength);
+ _res = plc4c_spi_read_unsigned_short(buf, 8, (uint16_t*) ¶meterLength);
if(_res != OK) {
return _res;
}
@@ -75,8 +75,8 @@ plc4c_return_code plc4c_s7_read_write_cotp_parameter_parse(plc4c_spi_read_buffer
(*_message)->_type = plc4c_s7_read_write_cotp_parameter_type_s7_read_write_cotp_parameter_tpdu_size;
// Enum field (tpduSize)
- plc4c_s7_read_write_cotp_tpdu_size tpduSize = NULL;
- _res = plc4c_spi_read_byte(buf, 8, &tpduSize);
+ plc4c_s7_read_write_cotp_tpdu_size tpduSize = plc4c_s7_read_write_cotp_tpdu_size_null;
+ _res = plc4c_spi_read_byte(buf, 8, (int8_t*) &tpduSize);
if(_res != OK) {
return _res;
}
@@ -88,7 +88,7 @@ plc4c_return_code plc4c_s7_read_write_cotp_parameter_parse(plc4c_spi_read_buffer
// Simple Field (tsapId)
uint16_t tsapId = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &tsapId);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &tsapId);
if(_res != OK) {
return _res;
}
@@ -100,7 +100,7 @@ plc4c_return_code plc4c_s7_read_write_cotp_parameter_parse(plc4c_spi_read_buffer
// Simple Field (tsapId)
uint16_t tsapId = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &tsapId);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &tsapId);
if(_res != OK) {
return _res;
}
@@ -112,7 +112,7 @@ plc4c_return_code plc4c_s7_read_write_cotp_parameter_parse(plc4c_spi_read_buffer
// Simple Field (crc)
uint8_t crc = 0;
- _res = plc4c_spi_read_unsigned_short(buf, 8, &crc);
+ _res = plc4c_spi_read_unsigned_short(buf, 8, (uint16_t*) &crc);
if(_res != OK) {
return _res;
}
@@ -134,7 +134,7 @@ plc4c_return_code plc4c_s7_read_write_cotp_parameter_parse(plc4c_spi_read_buffer
uint8_t _value = 0;
- _res = plc4c_spi_read_unsigned_short(buf, 8, &_value);
+ _res = plc4c_spi_read_unsigned_short(buf, 8, (uint16_t*) &_value);
if(_res != OK) {
return _res;
}
diff --git a/sandbox/plc4c/generated-sources/s7/src/s7_address.c b/sandbox/plc4c/generated-sources/s7/src/s7_address.c
index f170db3..652ea36 100644
--- a/sandbox/plc4c/generated-sources/s7/src/s7_address.c
+++ b/sandbox/plc4c/generated-sources/s7/src/s7_address.c
@@ -50,7 +50,7 @@ plc4c_return_code plc4c_s7_read_write_s7_address_parse(plc4c_spi_read_buffer* bu
// Discriminator Field (addressType) (Used as input to a switch field)
uint8_t addressType = 0;
- _res = plc4c_spi_read_unsigned_short(buf, 8, &addressType);
+ _res = plc4c_spi_read_unsigned_short(buf, 8, (uint16_t*) &addressType);
if(_res != OK) {
return _res;
}
@@ -60,8 +60,8 @@ plc4c_return_code plc4c_s7_read_write_s7_address_parse(plc4c_spi_read_buffer* bu
(*_message)->_type = plc4c_s7_read_write_s7_address_type_s7_read_write_s7_address_any;
// Enum field (transportSize)
- plc4c_s7_read_write_transport_size transportSize = NULL;
- _res = plc4c_spi_read_byte(buf, 8, &transportSize);
+ plc4c_s7_read_write_transport_size transportSize = plc4c_s7_read_write_transport_size_null;
+ _res = plc4c_spi_read_byte(buf, 8, (int8_t*) &transportSize);
if(_res != OK) {
return _res;
}
@@ -71,7 +71,7 @@ plc4c_return_code plc4c_s7_read_write_s7_address_parse(plc4c_spi_read_buffer* bu
// Simple Field (numberOfElements)
uint16_t numberOfElements = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &numberOfElements);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &numberOfElements);
if(_res != OK) {
return _res;
}
@@ -81,7 +81,7 @@ plc4c_return_code plc4c_s7_read_write_s7_address_parse(plc4c_spi_read_buffer* bu
// Simple Field (dbNumber)
uint16_t dbNumber = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &dbNumber);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &dbNumber);
if(_res != OK) {
return _res;
}
@@ -90,8 +90,8 @@ plc4c_return_code plc4c_s7_read_write_s7_address_parse(plc4c_spi_read_buffer* bu
// Enum field (area)
- plc4c_s7_read_write_memory_area area = NULL;
- _res = plc4c_spi_read_byte(buf, 8, &area);
+ plc4c_s7_read_write_memory_area area = plc4c_s7_read_write_memory_area_null;
+ _res = plc4c_spi_read_byte(buf, 8, (int8_t*) &area);
if(_res != OK) {
return _res;
}
@@ -102,7 +102,7 @@ plc4c_return_code plc4c_s7_read_write_s7_address_parse(plc4c_spi_read_buffer* bu
// Reserved Field (Compartmentalized so the "reserved" variable can't leak)
{
unsigned int _reserved = 0;
- _res = plc4c_spi_read_unsigned_short(buf, 5, _reserved);
+ _res = plc4c_spi_read_unsigned_short(buf, 5, (uint16_t*) _reserved);
if(_res != OK) {
return _res;
}
@@ -115,7 +115,7 @@ plc4c_return_code plc4c_s7_read_write_s7_address_parse(plc4c_spi_read_buffer* bu
// Simple Field (byteAddress)
uint16_t byteAddress = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &byteAddress);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &byteAddress);
if(_res != OK) {
return _res;
}
@@ -125,7 +125,7 @@ plc4c_return_code plc4c_s7_read_write_s7_address_parse(plc4c_spi_read_buffer* bu
// Simple Field (bitAddress)
unsigned int bitAddress = 0;
- _res = plc4c_spi_read_unsigned_byte(buf, 3, &bitAddress);
+ _res = plc4c_spi_read_unsigned_byte(buf, 3, (uint8_t*) &bitAddress);
if(_res != OK) {
return _res;
}
diff --git a/sandbox/plc4c/generated-sources/s7/src/s7_message.c b/sandbox/plc4c/generated-sources/s7/src/s7_message.c
index 56a13ca..34797d6 100644
--- a/sandbox/plc4c/generated-sources/s7/src/s7_message.c
+++ b/sandbox/plc4c/generated-sources/s7/src/s7_message.c
@@ -56,7 +56,7 @@ plc4c_return_code plc4c_s7_read_write_s7_message_parse(plc4c_spi_read_buffer* bu
// Const Field (protocolId)
uint8_t protocolId = 0;
- _res = plc4c_spi_read_unsigned_short(buf, 8, &protocolId);
+ _res = plc4c_spi_read_unsigned_short(buf, 8, (uint16_t*) &protocolId);
if(_res != OK) {
return _res;
}
@@ -67,7 +67,7 @@ plc4c_return_code plc4c_s7_read_write_s7_message_parse(plc4c_spi_read_buffer* bu
// Discriminator Field (messageType) (Used as input to a switch field)
uint8_t messageType = 0;
- _res = plc4c_spi_read_unsigned_short(buf, 8, &messageType);
+ _res = plc4c_spi_read_unsigned_short(buf, 8, (uint16_t*) &messageType);
if(_res != OK) {
return _res;
}
@@ -75,7 +75,7 @@ plc4c_return_code plc4c_s7_read_write_s7_message_parse(plc4c_spi_read_buffer* bu
// Reserved Field (Compartmentalized so the "reserved" variable can't leak)
{
uint16_t _reserved = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, _reserved);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) _reserved);
if(_res != OK) {
return _res;
}
@@ -86,7 +86,7 @@ plc4c_return_code plc4c_s7_read_write_s7_message_parse(plc4c_spi_read_buffer* bu
// Simple Field (tpduReference)
uint16_t tpduReference = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &tpduReference);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &tpduReference);
if(_res != OK) {
return _res;
}
@@ -94,14 +94,14 @@ plc4c_return_code plc4c_s7_read_write_s7_message_parse(plc4c_spi_read_buffer* bu
// Implicit Field (parameterLength) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content)
uint16_t parameterLength = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, ¶meterLength);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) ¶meterLength);
if(_res != OK) {
return _res;
}
// Implicit Field (payloadLength) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content)
uint16_t payloadLength = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &payloadLength);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &payloadLength);
if(_res != OK) {
return _res;
}
@@ -115,7 +115,7 @@ plc4c_return_code plc4c_s7_read_write_s7_message_parse(plc4c_spi_read_buffer* bu
// Simple Field (errorClass)
uint8_t errorClass = 0;
- _res = plc4c_spi_read_unsigned_short(buf, 8, &errorClass);
+ _res = plc4c_spi_read_unsigned_short(buf, 8, (uint16_t*) &errorClass);
if(_res != OK) {
return _res;
}
@@ -125,7 +125,7 @@ plc4c_return_code plc4c_s7_read_write_s7_message_parse(plc4c_spi_read_buffer* bu
// Simple Field (errorCode)
uint8_t errorCode = 0;
- _res = plc4c_spi_read_unsigned_short(buf, 8, &errorCode);
+ _res = plc4c_spi_read_unsigned_short(buf, 8, (uint16_t*) &errorCode);
if(_res != OK) {
return _res;
}
@@ -137,7 +137,7 @@ plc4c_return_code plc4c_s7_read_write_s7_message_parse(plc4c_spi_read_buffer* bu
// Simple Field (errorClass)
uint8_t errorClass = 0;
- _res = plc4c_spi_read_unsigned_short(buf, 8, &errorClass);
+ _res = plc4c_spi_read_unsigned_short(buf, 8, (uint16_t*) &errorClass);
if(_res != OK) {
return _res;
}
@@ -147,7 +147,7 @@ plc4c_return_code plc4c_s7_read_write_s7_message_parse(plc4c_spi_read_buffer* bu
// Simple Field (errorCode)
uint8_t errorCode = 0;
- _res = plc4c_spi_read_unsigned_short(buf, 8, &errorCode);
+ _res = plc4c_spi_read_unsigned_short(buf, 8, (uint16_t*) &errorCode);
if(_res != OK) {
return _res;
}
diff --git a/sandbox/plc4c/generated-sources/s7/src/s7_parameter.c b/sandbox/plc4c/generated-sources/s7/src/s7_parameter.c
index 40a01dd..059dea8 100644
--- a/sandbox/plc4c/generated-sources/s7/src/s7_parameter.c
+++ b/sandbox/plc4c/generated-sources/s7/src/s7_parameter.c
@@ -60,7 +60,7 @@ plc4c_return_code plc4c_s7_read_write_s7_parameter_parse(plc4c_spi_read_buffer*
// Discriminator Field (parameterType) (Used as input to a switch field)
uint8_t parameterType = 0;
- _res = plc4c_spi_read_unsigned_short(buf, 8, ¶meterType);
+ _res = plc4c_spi_read_unsigned_short(buf, 8, (uint16_t*) ¶meterType);
if(_res != OK) {
return _res;
}
@@ -72,7 +72,7 @@ plc4c_return_code plc4c_s7_read_write_s7_parameter_parse(plc4c_spi_read_buffer*
// Reserved Field (Compartmentalized so the "reserved" variable can't leak)
{
uint8_t _reserved = 0;
- _res = plc4c_spi_read_unsigned_short(buf, 8, _reserved);
+ _res = plc4c_spi_read_unsigned_short(buf, 8, (uint16_t*) _reserved);
if(_res != OK) {
return _res;
}
@@ -85,7 +85,7 @@ plc4c_return_code plc4c_s7_read_write_s7_parameter_parse(plc4c_spi_read_buffer*
// Simple Field (maxAmqCaller)
uint16_t maxAmqCaller = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &maxAmqCaller);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &maxAmqCaller);
if(_res != OK) {
return _res;
}
@@ -95,7 +95,7 @@ plc4c_return_code plc4c_s7_read_write_s7_parameter_parse(plc4c_spi_read_buffer*
// Simple Field (maxAmqCallee)
uint16_t maxAmqCallee = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &maxAmqCallee);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &maxAmqCallee);
if(_res != OK) {
return _res;
}
@@ -105,7 +105,7 @@ plc4c_return_code plc4c_s7_read_write_s7_parameter_parse(plc4c_spi_read_buffer*
// Simple Field (pduLength)
uint16_t pduLength = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &pduLength);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &pduLength);
if(_res != OK) {
return _res;
}
@@ -117,7 +117,7 @@ plc4c_return_code plc4c_s7_read_write_s7_parameter_parse(plc4c_spi_read_buffer*
// Implicit Field (numItems) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content)
uint8_t numItems = 0;
- _res = plc4c_spi_read_unsigned_short(buf, 8, &numItems);
+ _res = plc4c_spi_read_unsigned_short(buf, 8, (uint16_t*) &numItems);
if(_res != OK) {
return _res;
}
@@ -150,7 +150,7 @@ plc4c_return_code plc4c_s7_read_write_s7_parameter_parse(plc4c_spi_read_buffer*
// Simple Field (numItems)
uint8_t numItems = 0;
- _res = plc4c_spi_read_unsigned_short(buf, 8, &numItems);
+ _res = plc4c_spi_read_unsigned_short(buf, 8, (uint16_t*) &numItems);
if(_res != OK) {
return _res;
}
@@ -162,7 +162,7 @@ plc4c_return_code plc4c_s7_read_write_s7_parameter_parse(plc4c_spi_read_buffer*
// Implicit Field (numItems) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content)
uint8_t numItems = 0;
- _res = plc4c_spi_read_unsigned_short(buf, 8, &numItems);
+ _res = plc4c_spi_read_unsigned_short(buf, 8, (uint16_t*) &numItems);
if(_res != OK) {
return _res;
}
@@ -195,7 +195,7 @@ plc4c_return_code plc4c_s7_read_write_s7_parameter_parse(plc4c_spi_read_buffer*
// Simple Field (numItems)
uint8_t numItems = 0;
- _res = plc4c_spi_read_unsigned_short(buf, 8, &numItems);
+ _res = plc4c_spi_read_unsigned_short(buf, 8, (uint16_t*) &numItems);
if(_res != OK) {
return _res;
}
@@ -207,7 +207,7 @@ plc4c_return_code plc4c_s7_read_write_s7_parameter_parse(plc4c_spi_read_buffer*
// Implicit Field (numItems) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content)
uint8_t numItems = 0;
- _res = plc4c_spi_read_unsigned_short(buf, 8, &numItems);
+ _res = plc4c_spi_read_unsigned_short(buf, 8, (uint16_t*) &numItems);
if(_res != OK) {
return _res;
}
diff --git a/sandbox/plc4c/generated-sources/s7/src/s7_parameter_user_data_item.c b/sandbox/plc4c/generated-sources/s7/src/s7_parameter_user_data_item.c
index fa90799..0577ef6 100644
--- a/sandbox/plc4c/generated-sources/s7/src/s7_parameter_user_data_item.c
+++ b/sandbox/plc4c/generated-sources/s7/src/s7_parameter_user_data_item.c
@@ -50,7 +50,7 @@ plc4c_return_code plc4c_s7_read_write_s7_parameter_user_data_item_parse(plc4c_sp
// Discriminator Field (itemType) (Used as input to a switch field)
uint8_t itemType = 0;
- _res = plc4c_spi_read_unsigned_short(buf, 8, &itemType);
+ _res = plc4c_spi_read_unsigned_short(buf, 8, (uint16_t*) &itemType);
if(_res != OK) {
return _res;
}
@@ -61,7 +61,7 @@ plc4c_return_code plc4c_s7_read_write_s7_parameter_user_data_item_parse(plc4c_sp
// 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_short(buf, 8, &itemLength);
+ _res = plc4c_spi_read_unsigned_short(buf, 8, (uint16_t*) &itemLength);
if(_res != OK) {
return _res;
}
@@ -70,7 +70,7 @@ plc4c_return_code plc4c_s7_read_write_s7_parameter_user_data_item_parse(plc4c_sp
// Simple Field (method)
uint8_t method = 0;
- _res = plc4c_spi_read_unsigned_short(buf, 8, &method);
+ _res = plc4c_spi_read_unsigned_short(buf, 8, (uint16_t*) &method);
if(_res != OK) {
return _res;
}
@@ -80,7 +80,7 @@ plc4c_return_code plc4c_s7_read_write_s7_parameter_user_data_item_parse(plc4c_sp
// Simple Field (cpuFunctionType)
unsigned int cpuFunctionType = 0;
- _res = plc4c_spi_read_unsigned_byte(buf, 4, &cpuFunctionType);
+ _res = plc4c_spi_read_unsigned_byte(buf, 4, (uint8_t*) &cpuFunctionType);
if(_res != OK) {
return _res;
}
@@ -90,7 +90,7 @@ plc4c_return_code plc4c_s7_read_write_s7_parameter_user_data_item_parse(plc4c_sp
// Simple Field (cpuFunctionGroup)
unsigned int cpuFunctionGroup = 0;
- _res = plc4c_spi_read_unsigned_byte(buf, 4, &cpuFunctionGroup);
+ _res = plc4c_spi_read_unsigned_byte(buf, 4, (uint8_t*) &cpuFunctionGroup);
if(_res != OK) {
return _res;
}
@@ -100,7 +100,7 @@ plc4c_return_code plc4c_s7_read_write_s7_parameter_user_data_item_parse(plc4c_sp
// Simple Field (cpuSubfunction)
uint8_t cpuSubfunction = 0;
- _res = plc4c_spi_read_unsigned_short(buf, 8, &cpuSubfunction);
+ _res = plc4c_spi_read_unsigned_short(buf, 8, (uint16_t*) &cpuSubfunction);
if(_res != OK) {
return _res;
}
@@ -110,7 +110,7 @@ plc4c_return_code plc4c_s7_read_write_s7_parameter_user_data_item_parse(plc4c_sp
// Simple Field (sequenceNumber)
uint8_t sequenceNumber = 0;
- _res = plc4c_spi_read_unsigned_short(buf, 8, &sequenceNumber);
+ _res = plc4c_spi_read_unsigned_short(buf, 8, (uint16_t*) &sequenceNumber);
if(_res != OK) {
return _res;
}
@@ -126,7 +126,7 @@ plc4c_return_code plc4c_s7_read_write_s7_parameter_user_data_item_parse(plc4c_sp
return NO_MEMORY;
}
*dataUnitReferenceNumber = 0;
- _res = plc4c_spi_read_unsigned_short(buf, 8, &dataUnitReferenceNumber);
+ _res = plc4c_spi_read_unsigned_short(buf, 8, (uint16_t*) &dataUnitReferenceNumber);
if(_res != OK) {
return _res;
}
@@ -143,7 +143,7 @@ plc4c_return_code plc4c_s7_read_write_s7_parameter_user_data_item_parse(plc4c_sp
return NO_MEMORY;
}
*lastDataUnit = 0;
- _res = plc4c_spi_read_unsigned_short(buf, 8, &lastDataUnit);
+ _res = plc4c_spi_read_unsigned_short(buf, 8, (uint16_t*) &lastDataUnit);
if(_res != OK) {
return _res;
}
@@ -160,7 +160,7 @@ plc4c_return_code plc4c_s7_read_write_s7_parameter_user_data_item_parse(plc4c_sp
return NO_MEMORY;
}
*errorCode = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &errorCode);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &errorCode);
if(_res != OK) {
return _res;
}
diff --git a/sandbox/plc4c/generated-sources/s7/src/s7_payload_user_data_item.c b/sandbox/plc4c/generated-sources/s7/src/s7_payload_user_data_item.c
index 6d266b6..408aab0 100644
--- a/sandbox/plc4c/generated-sources/s7/src/s7_payload_user_data_item.c
+++ b/sandbox/plc4c/generated-sources/s7/src/s7_payload_user_data_item.c
@@ -51,16 +51,16 @@ plc4c_return_code plc4c_s7_read_write_s7_payload_user_data_item_parse(plc4c_spi_
}
// Enum field (returnCode)
- plc4c_s7_read_write_data_transport_error_code returnCode = NULL;
- _res = plc4c_spi_read_byte(buf, 8, &returnCode);
+ plc4c_s7_read_write_data_transport_error_code returnCode = plc4c_s7_read_write_data_transport_error_code_null;
+ _res = plc4c_spi_read_byte(buf, 8, (int8_t*) &returnCode);
if(_res != OK) {
return _res;
}
(*_message)->return_code = returnCode;
// Enum field (transportSize)
- plc4c_s7_read_write_data_transport_size transportSize = NULL;
- _res = plc4c_spi_read_byte(buf, 8, &transportSize);
+ plc4c_s7_read_write_data_transport_size transportSize = plc4c_s7_read_write_data_transport_size_null;
+ _res = plc4c_spi_read_byte(buf, 8, (int8_t*) &transportSize);
if(_res != OK) {
return _res;
}
@@ -68,7 +68,7 @@ plc4c_return_code plc4c_s7_read_write_s7_payload_user_data_item_parse(plc4c_spi_
// Implicit Field (dataLength) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content)
uint16_t dataLength = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &dataLength);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &dataLength);
if(_res != OK) {
return _res;
}
@@ -83,7 +83,7 @@ plc4c_return_code plc4c_s7_read_write_s7_payload_user_data_item_parse(plc4c_spi_
// Simple Field (szlIndex)
uint16_t szlIndex = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &szlIndex);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &szlIndex);
if(_res != OK) {
return _res;
}
@@ -98,7 +98,7 @@ plc4c_return_code plc4c_s7_read_write_s7_payload_user_data_item_parse(plc4c_spi_
// Const Field (szlItemLength)
uint16_t szlItemLength = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &szlItemLength);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &szlItemLength);
if(_res != OK) {
return _res;
}
@@ -111,7 +111,7 @@ plc4c_return_code plc4c_s7_read_write_s7_payload_user_data_item_parse(plc4c_spi_
// Implicit Field (szlItemCount) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content)
uint16_t szlItemCount = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &szlItemCount);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &szlItemCount);
if(_res != OK) {
return _res;
}
diff --git a/sandbox/plc4c/generated-sources/s7/src/s7_var_payload_data_item.c b/sandbox/plc4c/generated-sources/s7/src/s7_var_payload_data_item.c
index 7840ad0..8ffde19 100644
--- a/sandbox/plc4c/generated-sources/s7/src/s7_var_payload_data_item.c
+++ b/sandbox/plc4c/generated-sources/s7/src/s7_var_payload_data_item.c
@@ -36,16 +36,16 @@ plc4c_return_code plc4c_s7_read_write_s7_var_payload_data_item_parse(plc4c_spi_r
}
// Enum field (returnCode)
- plc4c_s7_read_write_data_transport_error_code returnCode = NULL;
- _res = plc4c_spi_read_byte(buf, 8, &returnCode);
+ plc4c_s7_read_write_data_transport_error_code returnCode = plc4c_s7_read_write_data_transport_error_code_null;
+ _res = plc4c_spi_read_byte(buf, 8, (int8_t*) &returnCode);
if(_res != OK) {
return _res;
}
(*_message)->return_code = returnCode;
// Enum field (transportSize)
- plc4c_s7_read_write_data_transport_size transportSize = NULL;
- _res = plc4c_spi_read_byte(buf, 8, &transportSize);
+ plc4c_s7_read_write_data_transport_size transportSize = plc4c_s7_read_write_data_transport_size_null;
+ _res = plc4c_spi_read_byte(buf, 8, (int8_t*) &transportSize);
if(_res != OK) {
return _res;
}
@@ -53,7 +53,7 @@ plc4c_return_code plc4c_s7_read_write_s7_var_payload_data_item_parse(plc4c_spi_r
// Simple Field (dataLength)
uint16_t dataLength = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &dataLength);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &dataLength);
if(_res != OK) {
return _res;
}
@@ -71,7 +71,7 @@ plc4c_return_code plc4c_s7_read_write_s7_var_payload_data_item_parse(plc4c_spi_r
int8_t _value = 0;
- _res = plc4c_spi_read_byte(buf, 8, &_value);
+ _res = plc4c_spi_read_byte(buf, 8, (int8_t*) &_value);
if(_res != OK) {
return _res;
}
@@ -86,7 +86,7 @@ plc4c_return_code plc4c_s7_read_write_s7_var_payload_data_item_parse(plc4c_spi_r
if(_needsPadding) {
// Just read the padding data and ignore it
uint8_t _paddingValue = 0;
- _res = plc4c_spi_read_unsigned_short(buf, 8, &_paddingValue);
+ _res = plc4c_spi_read_unsigned_short(buf, 8, (uint16_t*) &_paddingValue);
if(_res != OK) {
return _res;
}
diff --git a/sandbox/plc4c/generated-sources/s7/src/s7_var_payload_status_item.c b/sandbox/plc4c/generated-sources/s7/src/s7_var_payload_status_item.c
index 794a2a7..d068f9e 100644
--- a/sandbox/plc4c/generated-sources/s7/src/s7_var_payload_status_item.c
+++ b/sandbox/plc4c/generated-sources/s7/src/s7_var_payload_status_item.c
@@ -36,8 +36,8 @@ plc4c_return_code plc4c_s7_read_write_s7_var_payload_status_item_parse(plc4c_spi
}
// Enum field (returnCode)
- plc4c_s7_read_write_data_transport_error_code returnCode = NULL;
- _res = plc4c_spi_read_byte(buf, 8, &returnCode);
+ plc4c_s7_read_write_data_transport_error_code returnCode = plc4c_s7_read_write_data_transport_error_code_null;
+ _res = plc4c_spi_read_byte(buf, 8, (int8_t*) &returnCode);
if(_res != OK) {
return _res;
}
diff --git a/sandbox/plc4c/generated-sources/s7/src/s7_var_request_parameter_item.c b/sandbox/plc4c/generated-sources/s7/src/s7_var_request_parameter_item.c
index 7f63703..69418de 100644
--- a/sandbox/plc4c/generated-sources/s7/src/s7_var_request_parameter_item.c
+++ b/sandbox/plc4c/generated-sources/s7/src/s7_var_request_parameter_item.c
@@ -50,7 +50,7 @@ plc4c_return_code plc4c_s7_read_write_s7_var_request_parameter_item_parse(plc4c_
// Discriminator Field (itemType) (Used as input to a switch field)
uint8_t itemType = 0;
- _res = plc4c_spi_read_unsigned_short(buf, 8, &itemType);
+ _res = plc4c_spi_read_unsigned_short(buf, 8, (uint16_t*) &itemType);
if(_res != OK) {
return _res;
}
@@ -61,7 +61,7 @@ plc4c_return_code plc4c_s7_read_write_s7_var_request_parameter_item_parse(plc4c_
// 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_short(buf, 8, &itemLength);
+ _res = plc4c_spi_read_unsigned_short(buf, 8, (uint16_t*) &itemLength);
if(_res != OK) {
return _res;
}
diff --git a/sandbox/plc4c/generated-sources/s7/src/szl_data_tree_item.c b/sandbox/plc4c/generated-sources/s7/src/szl_data_tree_item.c
index f508054..4c8c549 100644
--- a/sandbox/plc4c/generated-sources/s7/src/szl_data_tree_item.c
+++ b/sandbox/plc4c/generated-sources/s7/src/szl_data_tree_item.c
@@ -37,7 +37,7 @@ plc4c_return_code plc4c_s7_read_write_szl_data_tree_item_parse(plc4c_spi_read_bu
// Simple Field (itemIndex)
uint16_t itemIndex = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &itemIndex);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &itemIndex);
if(_res != OK) {
return _res;
}
@@ -55,7 +55,7 @@ plc4c_return_code plc4c_s7_read_write_szl_data_tree_item_parse(plc4c_spi_read_bu
int8_t _value = 0;
- _res = plc4c_spi_read_byte(buf, 8, &_value);
+ _res = plc4c_spi_read_byte(buf, 8, (int8_t*) &_value);
if(_res != OK) {
return _res;
}
@@ -66,7 +66,7 @@ plc4c_return_code plc4c_s7_read_write_szl_data_tree_item_parse(plc4c_spi_read_bu
// Simple Field (moduleTypeId)
uint16_t moduleTypeId = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &moduleTypeId);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &moduleTypeId);
if(_res != OK) {
return _res;
}
@@ -74,7 +74,7 @@ plc4c_return_code plc4c_s7_read_write_szl_data_tree_item_parse(plc4c_spi_read_bu
// Simple Field (ausbg)
uint16_t ausbg = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &ausbg);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &ausbg);
if(_res != OK) {
return _res;
}
@@ -82,7 +82,7 @@ plc4c_return_code plc4c_s7_read_write_szl_data_tree_item_parse(plc4c_spi_read_bu
// Simple Field (ausbe)
uint16_t ausbe = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &ausbe);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &ausbe);
if(_res != OK) {
return _res;
}
diff --git a/sandbox/plc4c/generated-sources/s7/src/szl_id.c b/sandbox/plc4c/generated-sources/s7/src/szl_id.c
index 0c4a1f8..fd25b01 100644
--- a/sandbox/plc4c/generated-sources/s7/src/szl_id.c
+++ b/sandbox/plc4c/generated-sources/s7/src/szl_id.c
@@ -36,8 +36,8 @@ plc4c_return_code plc4c_s7_read_write_szl_id_parse(plc4c_spi_read_buffer* buf, p
}
// Enum field (typeClass)
- plc4c_s7_read_write_szl_module_type_class typeClass = NULL;
- _res = plc4c_spi_read_byte(buf, 4, &typeClass);
+ plc4c_s7_read_write_szl_module_type_class typeClass = plc4c_s7_read_write_szl_module_type_class_null;
+ _res = plc4c_spi_read_byte(buf, 4, (int8_t*) &typeClass);
if(_res != OK) {
return _res;
}
@@ -45,15 +45,15 @@ plc4c_return_code plc4c_s7_read_write_szl_id_parse(plc4c_spi_read_buffer* buf, p
// Simple Field (sublistExtract)
unsigned int sublistExtract = 0;
- _res = plc4c_spi_read_unsigned_byte(buf, 4, &sublistExtract);
+ _res = plc4c_spi_read_unsigned_byte(buf, 4, (uint8_t*) &sublistExtract);
if(_res != OK) {
return _res;
}
(*_message)->sublist_extract = sublistExtract;
// Enum field (sublistList)
- plc4c_s7_read_write_szl_sublist sublistList = NULL;
- _res = plc4c_spi_read_byte(buf, 8, &sublistList);
+ plc4c_s7_read_write_szl_sublist sublistList = plc4c_s7_read_write_szl_sublist_null;
+ _res = plc4c_spi_read_byte(buf, 8, (int8_t*) &sublistList);
if(_res != OK) {
return _res;
}
diff --git a/sandbox/plc4c/generated-sources/s7/src/tpkt_packet.c b/sandbox/plc4c/generated-sources/s7/src/tpkt_packet.c
index 0b14a90..2fdffbd 100644
--- a/sandbox/plc4c/generated-sources/s7/src/tpkt_packet.c
+++ b/sandbox/plc4c/generated-sources/s7/src/tpkt_packet.c
@@ -37,7 +37,7 @@ plc4c_return_code plc4c_s7_read_write_tpkt_packet_parse(plc4c_spi_read_buffer* b
// Const Field (protocolId)
uint8_t protocolId = 0;
- _res = plc4c_spi_read_unsigned_short(buf, 8, &protocolId);
+ _res = plc4c_spi_read_unsigned_short(buf, 8, (uint16_t*) &protocolId);
if(_res != OK) {
return _res;
}
@@ -49,7 +49,7 @@ plc4c_return_code plc4c_s7_read_write_tpkt_packet_parse(plc4c_spi_read_buffer* b
// Reserved Field (Compartmentalized so the "reserved" variable can't leak)
{
uint8_t _reserved = 0;
- _res = plc4c_spi_read_unsigned_short(buf, 8, _reserved);
+ _res = plc4c_spi_read_unsigned_short(buf, 8, (uint16_t*) _reserved);
if(_res != OK) {
return _res;
}
@@ -60,7 +60,7 @@ plc4c_return_code plc4c_s7_read_write_tpkt_packet_parse(plc4c_spi_read_buffer* b
// Implicit Field (len) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content)
uint16_t len = 0;
- _res = plc4c_spi_read_unsigned_int(buf, 16, &len);
+ _res = plc4c_spi_read_unsigned_int(buf, 16, (uint32_t*) &len);
if(_res != OK) {
return _res;
}