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_nodehandle.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_nodehandle.h')
-rw-r--r-- | src/platforms/px4_nodehandle.h | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/src/platforms/px4_nodehandle.h b/src/platforms/px4_nodehandle.h index fa2c8d6a4..34a605647 100644 --- a/src/platforms/px4_nodehandle.h +++ b/src/platforms/px4_nodehandle.h @@ -39,8 +39,8 @@ #pragma once /* includes for all platforms */ -#include <px4_subscriber.h> -#include <px4_publisher.h> +#include "px4_subscriber.h" +#include "px4_publisher.h" #if defined(__linux) || (defined(__APPLE__) && defined(__MACH__)) /* includes when building for ros */ @@ -49,7 +49,6 @@ #include <inttypes.h> #else /* includes when building for NuttX */ -#include <containers/List.hpp> #endif namespace px4 @@ -90,7 +89,7 @@ private: std::list<Publisher> _pubs; }; #else -class NodeHandle +class __EXPORT NodeHandle { public: NodeHandle() : @@ -101,20 +100,22 @@ public: ~NodeHandle() {}; template<typename M> - Subscriber subscribe(const char *topic, void(*fp)(M)) { - Subscriber sub(&_subs, , interval); + Subscriber * subscribe(const struct orb_metadata *meta, void(*fp)(M)) { + unsigned interval = 0;//XXX decide how to wrap this, ros equivalent? + //XXX + Subscriber *sub = new Subscriber(meta, interval, fp, &_subs); return sub; } template<typename M> - Publisher advertise(const char *topic) { - Publisher pub(ros_pub); - _pubs.push_back(pub); + Publisher * advertise(const struct orb_metadata *meta) { + //XXX + Publisher * pub = new Publisher(meta, &_pubs); return pub; } private: - List<Subscriber> _subs; - List<Publisher> _pubs; + List<uORB::SubscriptionNode*> _subs; + List<uORB::PublicationNode*> _pubs; }; #endif |