MavlinkOrbSubscription API reworked

This commit is contained in:
Anton Babushkin
2014-06-11 14:00:44 +02:00
parent fb4bcf87ba
commit 342e08977a
6 changed files with 251 additions and 140 deletions
+15 -3
View File
@@ -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
};