aboutsummaryrefslogtreecommitdiff
path: root/src/modules/mavlink/mavlink_orb_subscription.h
diff options
context:
space:
mode:
authorAnton Babushkin <anton.babushkin@me.com>2014-06-11 14:00:44 +0200
committerAnton Babushkin <anton.babushkin@me.com>2014-06-11 14:00:44 +0200
commit342e08977ae5bf49c5ba941866e44fddefca4cda (patch)
tree6f50d14687c441f14715cfa55b17599e46d9f5f9 /src/modules/mavlink/mavlink_orb_subscription.h
parentfb4bcf87ba036a2791f303deee8eeda4174bad61 (diff)
downloadpx4-firmware-342e08977ae5bf49c5ba941866e44fddefca4cda.tar.gz
px4-firmware-342e08977ae5bf49c5ba941866e44fddefca4cda.tar.bz2
px4-firmware-342e08977ae5bf49c5ba941866e44fddefca4cda.zip
MavlinkOrbSubscription API reworked
Diffstat (limited to 'src/modules/mavlink/mavlink_orb_subscription.h')
-rw-r--r--src/modules/mavlink/mavlink_orb_subscription.h18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/modules/mavlink/mavlink_orb_subscription.h b/src/modules/mavlink/mavlink_orb_subscription.h
index abd4031bd..71efb43af 100644
--- a/src/modules/mavlink/mavlink_orb_subscription.h
+++ b/src/modules/mavlink/mavlink_orb_subscription.h
@@ -53,7 +53,21 @@ public:
MavlinkOrbSubscription(const orb_id_t topic);
~MavlinkOrbSubscription();
- bool update(const hrt_abstime t, void* data);
+ /**
+ * Check if subscription updated and get data.
+ *
+ * @return true only if topic was updated and data copied to buffer successfully.
+ * If topic was not updated since last check it will return false but still copy the data.
+ * If no data available data buffer will be filled with zeroes.
+ */
+ bool update(uint64_t *time, void* data);
+
+ /**
+ * Copy topic data to given buffer.
+ *
+ * @return true only if topic data copied successfully.
+ */
+ bool update(void* data);
/**
* Check if the topic has been published.
@@ -68,8 +82,6 @@ private:
const orb_id_t _topic; ///< topic metadata
int _fd; ///< subscription handle
bool _published; ///< topic was ever published
- hrt_abstime _last_check; ///< time of last check
- bool _updated; ///< updated on last check
};