Skip to content

Commit

Permalink
feat(plc4c): Added string-length support in data-io
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisdutz committed Mar 26, 2023
1 parent 8d5f754 commit 8385cb6
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,11 @@ plc4c_return_code ${helper.getCTypeName(type.name)}_parse(plc4x_spi_context ctx,
return new PlcStruct(${field.name});
<#break-->
<#case "STRING">
<#if (parserArguments?filter(parserArgument->parserArgument.name=="stringLength"))?has_content>
*data_item = plc4c_data_create_string_data(stringLength, ${manualField.name});
<#else>
*data_item = plc4c_data_create_string_data(strlen(value), ${manualField.name});
</#if>
<#break>
<#default>
*data_item = plc4c_data_create_${case.name?lower_case}_data(${manualField.name});
Expand Down

0 comments on commit 8385cb6

Please sign in to comment.