uORB: generate ORBTypeMap and example usage (uORB::Publication2)

This commit is contained in:
Daniel Agar
2020-10-27 10:22:45 -04:00
parent d5245a22d3
commit 2859fc66fa
3 changed files with 120 additions and 0 deletions
+10
View File
@@ -70,6 +70,10 @@ topic_name = spec.short_name
#include <uORB/uORB.h>
#ifdef __cplusplus
#include <uORB/topics/uORBTopics.hpp>
#endif
@##############################
@# Includes for dependencies
@##############################
@@ -135,5 +139,11 @@ ORB_DECLARE(@multi_topic);
@[end for]
#ifdef __cplusplus
@[for multi_topic in topics]@
template<> struct ORBTypeMap<ORB_ID::@multi_topic> {
using type = @(uorb_struct);
};
@[end for]
void print_message(const @uorb_struct& message);
#endif
+2
View File
@@ -73,4 +73,6 @@ enum class ORB_ID : uint8_t {
INVALID
};
template<ORB_ID> struct ORBTypeMap;
const struct orb_metadata *get_orb_meta(ORB_ID id);