Skip to content

Commit

Permalink
fic: Refactored some of the changes that were lost by merging the lat…
Browse files Browse the repository at this point in the history
…est S7 updates (Also gave the code a thorough review and refactored many details)

chore: Updated the "http" -> "https" in the apache header, where this was wrong.
  • Loading branch information
chrisdutz committed Nov 18, 2023
1 parent 5f6c232 commit 0a1730e
Show file tree
Hide file tree
Showing 171 changed files with 3,442 additions and 3,575 deletions.
2 changes: 1 addition & 1 deletion .mvn/extensions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
Expand Down
2 changes: 1 addition & 1 deletion .mvn/gradle-enterprise.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
~ "License"); you may not use this file except in compliance
~ with the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~ https://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing,
~ software distributed under the License is distributed on an
Expand Down
17 changes: 17 additions & 0 deletions build-reproducible.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,23 @@
# under the License.
# ----------------------------------------------------------------------------

# TODO: Reproducible builds
# - Creating an RC
# - We should run the following builds on the normal developer environment:
# - build with all "with-*" profiles and "update-generated-code" profile enabled
# - release:branch
# - release:prepare
# - The release build (release:perform) should then be run inside the docker-compose build in order to build the jars in the controlled environment
# - Run the signing on all locally staged artifacts
# - Transfer all locally staged artifacts to nexus
#
# - Validating an RC
# - Download the entire content of the staging repo locally
# - Programmatically check the Hashes and the signatures with a script
# - Run a local build in docker-compose but with the "clean validate {compare-artifact}" config



# Run a standard build
function build() {
echo "Building ..."
Expand Down
21 changes: 20 additions & 1 deletion plc4c/generated-sources/s7/include/s7_payload_user_data_item.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,13 @@ enum plc4c_s7_read_write_s7_payload_user_data_item_type {
plc4c_s7_read_write_s7_payload_user_data_item_type_plc4c_s7_read_write_s7_payload_user_data_item_cpu_function_alarm_ack_error_response = 24,
plc4c_s7_read_write_s7_payload_user_data_item_type_plc4c_s7_read_write_s7_payload_user_data_item_cpu_function_alarm_ack_response = 25,
plc4c_s7_read_write_s7_payload_user_data_item_type_plc4c_s7_read_write_s7_payload_user_data_item_cpu_function_alarm_query_request = 26,
plc4c_s7_read_write_s7_payload_user_data_item_type_plc4c_s7_read_write_s7_payload_user_data_item_cpu_function_alarm_query_response = 27};
plc4c_s7_read_write_s7_payload_user_data_item_type_plc4c_s7_read_write_s7_payload_user_data_item_cpu_function_alarm_query_response = 27,
plc4c_s7_read_write_s7_payload_user_data_item_type_plc4c_s7_read_write_s7_payload_user_data_item_clk_request = 28,
plc4c_s7_read_write_s7_payload_user_data_item_type_plc4c_s7_read_write_s7_payload_user_data_item_clk_response = 29,
plc4c_s7_read_write_s7_payload_user_data_item_type_plc4c_s7_read_write_s7_payload_user_data_item_clk_f_request = 30,
plc4c_s7_read_write_s7_payload_user_data_item_type_plc4c_s7_read_write_s7_payload_user_data_item_clk_f_response = 31,
plc4c_s7_read_write_s7_payload_user_data_item_type_plc4c_s7_read_write_s7_payload_user_data_item_clk_set_request = 32,
plc4c_s7_read_write_s7_payload_user_data_item_type_plc4c_s7_read_write_s7_payload_user_data_item_clk_set_response = 33};
typedef enum plc4c_s7_read_write_s7_payload_user_data_item_type plc4c_s7_read_write_s7_payload_user_data_item_type;

// Function to get the discriminator values for a given type.
Expand Down Expand Up @@ -199,6 +205,19 @@ struct plc4c_s7_read_write_s7_payload_user_data_item {
struct { /* S7PayloadUserDataItemCpuFunctionAlarmQueryResponse */
plc4c_list* s7_payload_user_data_item_cpu_function_alarm_query_response_items;
};
struct { /* S7PayloadUserDataItemClkResponse */
uint8_t s7_payload_user_data_item_clk_response_reserved;
uint8_t s7_payload_user_data_item_clk_response_year1;
plc4c_s7_read_write_date_and_time* s7_payload_user_data_item_clk_response_time_stamp;
};
struct { /* S7PayloadUserDataItemClkFResponse */
uint8_t s7_payload_user_data_item_clk_f_response_reserved;
uint8_t s7_payload_user_data_item_clk_f_response_year1;
plc4c_s7_read_write_date_and_time* s7_payload_user_data_item_clk_f_response_time_stamp;
};
struct { /* S7PayloadUserDataItemClkSetRequest */
plc4c_s7_read_write_date_and_time* s7_payload_user_data_item_clk_set_request_time_stamp;
};
};
};
typedef struct plc4c_s7_read_write_s7_payload_user_data_item plc4c_s7_read_write_s7_payload_user_data_item;
Expand Down
4 changes: 3 additions & 1 deletion plc4c/generated-sources/s7/include/transport_size.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ enum plc4c_s7_read_write_transport_size {
plc4c_s7_read_write_transport_size_LTIME = 0x16,
plc4c_s7_read_write_transport_size_DATE = 0x17,
plc4c_s7_read_write_transport_size_TIME_OF_DAY = 0x18,
plc4c_s7_read_write_transport_size_DATE_AND_TIME = 0x1A
plc4c_s7_read_write_transport_size_TOD = 0x19,
plc4c_s7_read_write_transport_size_DATE_AND_TIME = 0x1A,
plc4c_s7_read_write_transport_size_DT = 0x1B
};
typedef enum plc4c_s7_read_write_transport_size plc4c_s7_read_write_transport_size;

Expand Down
22 changes: 13 additions & 9 deletions plc4c/generated-sources/s7/src/cyc_service_item_type.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,15 @@ plc4c_return_code plc4c_s7_read_write_cyc_service_item_type_parse(plc4x_spi_cont
if( syntaxId == 0x10 ) { /* CycServiceItemAnyType */
(*_message)->_type = plc4c_s7_read_write_cyc_service_item_type_type_plc4c_s7_read_write_cyc_service_item_any_type;

// Simple Field (transportSize)
plc4c_s7_read_write_transport_size transportSize;
_res = plc4c_s7_read_write_transport_size_parse(ctx, readBuffer, (void*) &transportSize);
if(_res != OK) {
return _res;
// Enum field (transportSize)
plc4c_s7_read_write_transport_size transportSize = plc4c_s7_read_write_transport_size_null();
{
uint8_t _constantValue = 0;
_res = plc4c_spi_read_unsigned_byte(readBuffer, 8, (uint8_t*) &_constantValue);
if(_res != OK) {
return _res;
}
transportSize = plc4c_s7_read_write_transport_size_get_first_enum_for_field_code(_constantValue);
}
(*_message)->cyc_service_item_any_type_transport_size = transportSize;

Expand Down Expand Up @@ -200,8 +204,8 @@ plc4c_return_code plc4c_s7_read_write_cyc_service_item_type_serialize(plc4x_spi_
switch(_message->_type) {
case plc4c_s7_read_write_cyc_service_item_type_type_plc4c_s7_read_write_cyc_service_item_any_type: {

// Simple Field (transportSize)
_res = plc4c_s7_read_write_transport_size_serialize(ctx, writeBuffer, &_message->cyc_service_item_any_type_transport_size);
// Enum field (transportSize)
_res = plc4c_spi_write_unsigned_byte(writeBuffer, 8, plc4c_s7_read_write_transport_size_get_code(_message->cyc_service_item_any_type_transport_size));
if(_res != OK) {
return _res;
}
Expand Down Expand Up @@ -279,8 +283,8 @@ uint16_t plc4c_s7_read_write_cyc_service_item_type_length_in_bits(plc4x_spi_cont
switch(_message->_type) {
case plc4c_s7_read_write_cyc_service_item_type_type_plc4c_s7_read_write_cyc_service_item_any_type: {

// Simple field (transportSize)
lengthInBits += plc4c_s7_read_write_transport_size_length_in_bits(ctx, &_message->cyc_service_item_any_type_transport_size);
// Enum Field (transportSize)
lengthInBits += 8;


// Simple field (length)
Expand Down
10 changes: 8 additions & 2 deletions plc4c/generated-sources/s7/src/data_item.c
Original file line number Diff line number Diff line change
Expand Up @@ -687,11 +687,17 @@ uint16_t plc4c_s7_read_write_data_item_length_in_bits(plc4x_spi_context ctx, plc
} else if(strcmp(dataProtocolId, "IEC61131_STRING") == 0) { /* STRING */

// Manual Field (value)
lengthInBits += (((stringLength) * (8))) + (16);
{
char* _value = data_item->data.string_value;
lengthInBits += (plc4c_spi_evaluation_helper_str_len(_value)) + (2);
}
} else if(strcmp(dataProtocolId, "IEC61131_WSTRING") == 0) { /* STRING */

// Manual Field (value)
lengthInBits += (((stringLength) * (16))) + (32);
{
char* _value = data_item->data.string_value;
lengthInBits += (((plc4c_spi_evaluation_helper_str_len(_value)) * (2))) + (2);
}
} else if(strcmp(dataProtocolId, "IEC61131_TIME") == 0) { /* TIME */

// Simple field (milliseconds)
Expand Down
Loading

0 comments on commit 0a1730e

Please sign in to comment.