mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
ucdr/msg.h.em: static inline the (de-)serialization methods
to avoid multiple definitions when using them from different places.
This commit is contained in:
parent
2f91102808
commit
f513c40d62
@ -124,7 +124,7 @@ static inline constexpr int ucdr_topic_size_@(topic)()
|
||||
return @(struct_size);
|
||||
}
|
||||
|
||||
bool ucdr_serialize_@(topic)(const void* data, ucdrBuffer& buf, int64_t time_offset = 0)
|
||||
static inline bool ucdr_serialize_@(topic)(const void* data, ucdrBuffer& buf, int64_t time_offset = 0)
|
||||
{
|
||||
const @(uorb_struct)& topic = *static_cast<const @(uorb_struct)*>(data);
|
||||
@{
|
||||
@ -153,7 +153,7 @@ for field_type, field_name, field_size, padding in fields:
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ucdr_deserialize_@(topic)(ucdrBuffer& buf, @(uorb_struct)& topic, int64_t time_offset = 0)
|
||||
static inline bool ucdr_deserialize_@(topic)(ucdrBuffer& buf, @(uorb_struct)& topic, int64_t time_offset = 0)
|
||||
{
|
||||
@{
|
||||
for field_type, field_name, field_size, padding in fields:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user