Skip to content
Snippets Groups Projects
Commit 3ab75b83 authored by TSC21's avatar TSC21 Committed by Beat Küng
Browse files

microcdr and IDL: remove field ordering, causing improper serialization/deserialization

parent bff93685
No related branches found
No related tags found
No related merge requests found
......@@ -131,14 +131,10 @@ def add_deserialize_functions(fields, scope_name):
add_deserialize_functions(children_fields, name + ('[%d].' %i))
def add_code_to_serialize():
# sort fields (using a stable sort) as in the declaration of the type
sorted_fields = sorted(spec.parsed_fields(), key=sizeof_field_type, reverse=True)
add_serialize_functions(sorted_fields, "")
add_serialize_functions(spec.parsed_fields(), "")
def add_code_to_deserialize():
# sort fields (using a stable sort) as in the declaration of the type
sorted_fields = sorted(spec.parsed_fields(), key=sizeof_field_type, reverse=True)
add_deserialize_functions(sorted_fields, "")
add_deserialize_functions(spec.parsed_fields(), "")
}@
void serialize_@(topic_name)(ucdrBuffer *writer, const struct @(uorb_struct) *input, char *output, uint32_t *length)
......
......@@ -78,10 +78,7 @@ def add_msg_field(field):
def add_msg_fields():
# sort fields (using a stable sort) as in the declaration of the type
sorted_fields = sorted(spec.parsed_fields(),
key=sizeof_field_type, reverse=True)
for field in sorted_fields:
for field in spec.parsed_fields():
add_msg_field(field)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment