aboutsummaryrefslogtreecommitdiff
path: root/src/platforms/px4_subscriber.h
diff options
context:
space:
mode:
authorThomas Gubler <thomasgubler@gmail.com>2014-12-25 12:51:38 +0100
committerThomas Gubler <thomasgubler@gmail.com>2014-12-25 13:40:14 +0100
commit195472fddf0242bfb881aef9e53d910c81a2b003 (patch)
tree48c3ff79f55e4aab94082cd9952608094b472228 /src/platforms/px4_subscriber.h
parenta93362c70013281457fb44ab0494157325eb28f9 (diff)
downloadpx4-firmware-195472fddf0242bfb881aef9e53d910c81a2b003.tar.gz
px4-firmware-195472fddf0242bfb881aef9e53d910c81a2b003.tar.bz2
px4-firmware-195472fddf0242bfb881aef9e53d910c81a2b003.zip
fix init of published structs
Diffstat (limited to 'src/platforms/px4_subscriber.h')
-rw-r--r--src/platforms/px4_subscriber.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/platforms/px4_subscriber.h b/src/platforms/px4_subscriber.h
index 8c299c748..e7e344201 100644
--- a/src/platforms/px4_subscriber.h
+++ b/src/platforms/px4_subscriber.h
@@ -80,6 +80,10 @@ public:
* Get the last message value
*/
virtual const M& get() = 0;
+ /**
+ * Get void pointer to last message value
+ */
+ virtual void * get_void_ptr() = 0;
};
#if defined(__linux) || (defined(__APPLE__) && defined(__MACH__))
@@ -121,6 +125,10 @@ public:
* Get the last message value
*/
const M& get() { return _msg_current; }
+ /**
+ * Get void pointer to last message value
+ */
+ void * get_void_ptr() { return (void*)&_msg_current; }
protected:
/**
@@ -197,6 +205,10 @@ public:
* Get the last message value
*/
const M& get() { return uORB::Subscription<M>::getData(); }
+ /**
+ * Get void pointer to last message value
+ */
+ void * get_void_ptr() { return uORB::Subscription<M>::getDataVoidPtr(); }
};
template<typename M>