refactor uxrce_dds_client: reduce amount of generated code for SendTopicsSubs

Reduces flash usage by ~4KB for current set of topics.
This commit is contained in:
Beat Küng
2023-08-07 14:42:20 +02:00
committed by Daniel Agar
parent 8e1dd710a6
commit d4c7ea74ef
2 changed files with 40 additions and 20 deletions
+2 -1
View File
@@ -124,8 +124,9 @@ static inline constexpr int ucdr_topic_size_@(topic)()
return @(struct_size);
}
bool ucdr_serialize_@(topic)(const @(uorb_struct)& topic, ucdrBuffer& buf, int64_t time_offset = 0)
bool ucdr_serialize_@(topic)(const void* data, ucdrBuffer& buf, int64_t time_offset = 0)
{
const @(uorb_struct)& topic = *static_cast<const @(uorb_struct)*>(data);
@{
for field_type, field_name, field_size, padding in fields:
if padding > 0: