Skip to content

Commit

Permalink
fixed bug with printing of type uint8_t to csv
Browse files Browse the repository at this point in the history
  • Loading branch information
Michal Reiser committed Aug 8, 2024
1 parent 03d8bd8 commit b23898d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions umsg_gen/umsg_gen/templates/log_parser.cpp.j2
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ void sort_{{dict.name}}_type(std::ifstream &file)
{% for field in msg_dict.fields %}
{% if not field.bitfield %}
{% if field.length %}
for(uint32_t i=0;i<{{field.length}}; i++){ file_{{dict.name}}_{{msg_dict.name}} << message->{{field.name}}[i] << ", " ;}
for(uint32_t i=0;i<{{field.length}}; i++){ file_{{dict.name}}_{{msg_dict.name}} << {% if field.type =="uint8"%} static_cast<int>(message->{{field.name}}[i]) {% else %}message->{{field.name}}[i] {% endif %}<< ", " ;}
{% endif %}
{% if not field.length %}
file_{{dict.name}}_{{msg_dict.name}} << message->{{field.name}}{% if not loop.last%} << ", "{% endif %};
file_{{dict.name}}_{{msg_dict.name}} << {% if field.type =="uint8"%} static_cast<int>(message->{{field.name}}) {% else %}message->{{field.name}}{% endif %}{% if not loop.last%} << ", "{% endif %};
{% endif %}
{% endif %}
{% if field.bitfield %}
Expand Down

0 comments on commit b23898d

Please sign in to comment.