mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-24 07:53:35 +08:00
Modify uORB API to allow cleaner in-app use
This commit is contained in:
@@ -181,6 +181,29 @@ extern orb_advert_t orb_advertise(const struct orb_metadata *meta, const void *d
|
||||
extern orb_advert_t orb_advertise_multi(const struct orb_metadata *meta, const void *data, int *instance,
|
||||
int priority) __EXPORT;
|
||||
|
||||
/**
|
||||
* Advertise and publish as the publisher of a topic.
|
||||
*
|
||||
* This performs the initial advertisement of a topic; it creates the topic
|
||||
* node in /obj if required and publishes the initial data.
|
||||
*
|
||||
* Any number of advertisers may publish to a topic; publications are atomic
|
||||
* but co-ordination between publishers is not provided by the ORB.
|
||||
*
|
||||
* @param meta The uORB metadata (usually from the ORB_ID() macro)
|
||||
* for the topic.
|
||||
* @param data A pointer to the initial data to be published.
|
||||
* For topics updated by interrupt handlers, the advertisement
|
||||
* must be performed from non-interrupt context.
|
||||
* @param instance Pointer to an integer which will yield the instance ID (0-based,
|
||||
* limited by ORB_MULTI_MAX_INSTANCES) of the publication.
|
||||
* @param priority The priority of the instance. If a subscriber subscribes multiple
|
||||
* instances, the priority allows the subscriber to prioritize the best
|
||||
* data source as long as its available.
|
||||
* @return zero on success, error number on failure
|
||||
*/
|
||||
extern int orb_publish_auto(const struct orb_metadata *meta, orb_advert_t *handle, const void *data, int *instance,
|
||||
int priority)
|
||||
|
||||
/**
|
||||
* Publish new data to a topic.
|
||||
|
||||
Reference in New Issue
Block a user