diff --git a/src/generate/templates/ping-message-.h.in b/src/generate/templates/ping-message-.h.in index 5186520..7b2b495 100644 --- a/src/generate/templates/ping-message-.h.in +++ b/src/generate/templates/ping-message-.h.in @@ -30,7 +30,23 @@ class {{class_name}} : public ping_message { public: {{class_name}}(const ping_message& msg) : ping_message { msg } {} - {{class_name}}(uint8_t* buf) : ping_message { buf, {{8 + total_payload + 2}} } + {{class_name}}(uint8_t* buf +{%- for payload in m.payload %} +{% if generator.is_vector(payload.type) %}, +{% if payload.vector.sizetype -%} + {{generator.get_type_string(payload.vector.sizetype)}} {{payload.name}}_length +{% else -%} + uint16_t {{payload.name}}_length +{%- endif %} +{% endif %} +{% endfor %}{# each payload field #} +) : ping_message { buf, static_cast({{8 + total_payload + 2}} +{%- for payload in m.payload %} +{% if generator.is_vector(payload.type) %} + + {{payload.name}}_length +{%- endif %} +{% endfor %}) }{# each payload field #} + { msgData[0] = 'B'; msgData[1] = 'R';