diff options
author | Thomas Gubler <thomasgubler@gmail.com> | 2014-11-26 11:36:23 +0100 |
---|---|---|
committer | Thomas Gubler <thomasgubler@gmail.com> | 2014-11-26 11:36:23 +0100 |
commit | e7c1e5b1ff7b1bbdc11ab2cae6b99fe459487119 (patch) | |
tree | ed69515032079068a3f9fcbf46356a0f860e2f48 /src/platforms/px4_publisher.h | |
parent | 3c6f6618e8709c22ac21f8f0353f292f25da22f7 (diff) | |
download | px4-firmware-e7c1e5b1ff7b1bbdc11ab2cae6b99fe459487119.tar.gz px4-firmware-e7c1e5b1ff7b1bbdc11ab2cae6b99fe459487119.tar.bz2 px4-firmware-e7c1e5b1ff7b1bbdc11ab2cae6b99fe459487119.zip |
wip, working on the nuttx wrapper
Diffstat (limited to 'src/platforms/px4_publisher.h')
-rw-r--r-- | src/platforms/px4_publisher.h | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/src/platforms/px4_publisher.h b/src/platforms/px4_publisher.h index 53e63b695..9ce211d25 100644 --- a/src/platforms/px4_publisher.h +++ b/src/platforms/px4_publisher.h @@ -43,6 +43,7 @@ #else /* includes when building for NuttX */ #include <uORB/Publication.hpp> +#include <containers/List.hpp> #endif namespace px4 @@ -60,16 +61,24 @@ private: ros::Publisher _ros_pub; }; #else -template<typename M> class Publisher : - public uORB::Publication<M> + public uORB::PublicationNode +{ public: - Publisher(List<SubscriptionBase *> * list, - const struct orb_metadata *meta, unsigned interval) : - uORB::Publication(list, meta) + Publisher(const struct orb_metadata *meta, + List<uORB::PublicationNode *> * list) : + uORB::PublicationNode(meta, list) {} ~Publisher() {}; -{ + template<typename M> + int publish(const M &msg) { + uORB::PublicationBase::update((void*)&msg); + return 0; + } + + void update() { + //XXX list traversal callback, needed? + } ; }; #endif } |