26 lines
752 B
Django/Jinja
26 lines
752 B
Django/Jinja
#pragma once
|
|
typedef enum {
|
|
{{protocol.name}}_PARSER_RESULT_OK,
|
|
{{protocol.name}}_PARSER_RESULT_ERROR_INVALID_SIZE,
|
|
{{protocol.name}}_PARSER_RESULT_ERROR_INVALID_ID,
|
|
{{protocol.name}}_PARSER_RESULT_ERROR_INVALID_CRC,
|
|
} {{protocol.name}}_PARSER_RESULT;
|
|
|
|
typedef enum {
|
|
{%- for msg in messages %}
|
|
{{msg.id_name}} = {{msg.id}}{% if not loop.last %},{% endif %}
|
|
{%- endfor %}
|
|
} {{protocol.name}}_MSG_ID ;
|
|
|
|
typedef enum {
|
|
{%- for msg in messages %}
|
|
{{msg.size_name}} = {{msg.size}}{% if not loop.last %},{% endif %}
|
|
{%- endfor %}
|
|
} {{protocol.name}}_MSG_SIZE;
|
|
{% for enum in enums %}
|
|
typedef enum {
|
|
{%- for v in enum.consts %}
|
|
{{ v[0] }} = {{ v[1] }}{% if not loop.last %},{% endif %}
|
|
{%- endfor %}
|
|
} {{enum.name}};
|
|
{% endfor %} |