mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-06 12:31:35 +08:00
MavlinkOrbSubscription API reworked
This commit is contained in:
@@ -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
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user