diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2014-03-16 13:48:33 +0100 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2014-03-16 13:48:33 +0100 |
commit | 3874bca2084bb88dcd739b309bd4a7929db3b417 (patch) | |
tree | e43f65cfe4076fa603aaca2464d046ed8e1ce99f /src/modules/mavlink/mavlink_orb_subscription.h | |
parent | 717e1bd374e7710ce579e91c45852bbba906eba8 (diff) | |
download | px4-firmware-3874bca2084bb88dcd739b309bd4a7929db3b417.tar.gz px4-firmware-3874bca2084bb88dcd739b309bd4a7929db3b417.tar.bz2 px4-firmware-3874bca2084bb88dcd739b309bd4a7929db3b417.zip |
mavlink: Only send messages when we have updates for them.
Diffstat (limited to 'src/modules/mavlink/mavlink_orb_subscription.h')
-rw-r--r-- | src/modules/mavlink/mavlink_orb_subscription.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/modules/mavlink/mavlink_orb_subscription.h b/src/modules/mavlink/mavlink_orb_subscription.h index eacc27034..42d47e96e 100644 --- a/src/modules/mavlink/mavlink_orb_subscription.h +++ b/src/modules/mavlink/mavlink_orb_subscription.h @@ -54,12 +54,21 @@ public: ~MavlinkOrbSubscription(); bool update(const hrt_abstime t); + + /** + * Check if the topic has been published. + * + * This call will return true if the topic was ever published. + * @param true if the topic has been published at least once. + */ + bool is_published(); void *get_data(); const orb_id_t get_topic(); private: const orb_id_t _topic; int _fd; + bool _published; void *_data; hrt_abstime _last_check; }; |