diff options
author | Thomas Gubler <thomasgubler@gmail.com> | 2014-11-25 11:50:35 +0100 |
---|---|---|
committer | Thomas Gubler <thomasgubler@gmail.com> | 2014-11-25 11:50:35 +0100 |
commit | 55cf2fc61c7b90725cd960f9c7d72737024f1cfc (patch) | |
tree | dca32b803a55a4f2154c8fc08d5b6bcfb035c8b7 /src/platforms/px4_subscriber.h | |
parent | c167df90380fdd99d1b56024c4de104a3f0a2f85 (diff) | |
download | px4-firmware-55cf2fc61c7b90725cd960f9c7d72737024f1cfc.tar.gz px4-firmware-55cf2fc61c7b90725cd960f9c7d72737024f1cfc.tar.bz2 px4-firmware-55cf2fc61c7b90725cd960f9c7d72737024f1cfc.zip |
WIP, towards more px4 compatibility, first macros
Diffstat (limited to 'src/platforms/px4_subscriber.h')
-rw-r--r-- | src/platforms/px4_subscriber.h | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/platforms/px4_subscriber.h b/src/platforms/px4_subscriber.h index 78be3ebff..6312e0cbe 100644 --- a/src/platforms/px4_subscriber.h +++ b/src/platforms/px4_subscriber.h @@ -38,7 +38,11 @@ */ #pragma once #if defined(__linux) || (defined(__APPLE__) && defined(__MACH__)) +/* includes when building for ros */ #include "ros/ros.h" +#else +/* includes when building for NuttX */ +#include <uORB/Subscription.hpp> #endif namespace px4 @@ -48,14 +52,23 @@ namespace px4 class Subscriber { public: - Subscriber(ros::Subscriber ros_sub) : _ros_sub(ros_sub) + Subscriber(ros::Subscriber ros_sub) : + _ros_sub(ros_sub) {} ~Subscriber() {}; private: ros::Subscriber _ros_sub; }; #else -class Subscriber +template<typename M> +class Subscriber : + public uORB::Subscription<M> +public: + Subscriber(List<SubscriptionBase *> * list, + const struct orb_metadata *meta, unsigned interval) : + uORB::Subsciption(list, meta, interval) + {} + ~Subscriber() {}; { }; #endif |