Firmware
|
API for the uORB lightweight object broker. More...
#include <sys/types.h>
#include <stdint.h>
#include <stdbool.h>
Go to the source code of this file.
Classes | |
struct | orb_metadata |
Object metadata. More... | |
Macros | |
#define | ORB_MULTI_MAX_INSTANCES 4 |
Maximum number of multi topic instances. | |
#define | ORB_ID(_name) &__orb_##_name |
Generates a pointer to the uORB metadata structure for a given topic. More... | |
#define | ORB_DECLARE(_name) extern const struct orb_metadata __orb_##_name __EXPORT |
Declare (prototype) the uORB metadata for a topic (used by code generators). More... | |
#define | ORB_DEFINE(_name, _struct, _size_no_padding, _fields) |
Define (instantiate) the uORB metadata for a topic. More... | |
#define | ORB_ID_VEHICLE_ATTITUDE_CONTROLS ORB_ID(actuator_controls_0) |
Typedefs | |
typedef const struct orb_metadata * | orb_id_t |
typedef uint8_t | arming_state_t |
typedef uint8_t | main_state_t |
typedef uint8_t | hil_state_t |
typedef uint8_t | navigation_state_t |
typedef uint8_t | switch_pos_t |
Enumerations | |
enum | ORB_PRIO { ORB_PRIO_MIN = 1, ORB_PRIO_VERY_LOW = 25, ORB_PRIO_LOW = 50, ORB_PRIO_DEFAULT = 75, ORB_PRIO_HIGH = 100, ORB_PRIO_VERY_HIGH = 125, ORB_PRIO_MAX = 255 } |
Topic priority. More... | |
Functions | |
orb_advert_t | orb_advertise (const struct orb_metadata *meta, const void *data) __EXPORT |
orb_advert_t | orb_advertise_queue (const struct orb_metadata *meta, const void *data, unsigned int queue_size) __EXPORT |
orb_advert_t | orb_advertise_multi (const struct orb_metadata *meta, const void *data, int *instance, int priority) __EXPORT |
orb_advert_t | orb_advertise_multi_queue (const struct orb_metadata *meta, const void *data, int *instance, int priority, unsigned int queue_size) __EXPORT |
int | orb_unadvertise (orb_advert_t handle) __EXPORT |
int | orb_publish (const struct orb_metadata *meta, orb_advert_t handle, const void *data) __EXPORT |
int | orb_subscribe (const struct orb_metadata *meta) __EXPORT |
int | orb_subscribe_multi (const struct orb_metadata *meta, unsigned instance) __EXPORT |
int | orb_unsubscribe (int handle) __EXPORT |
int | orb_copy (const struct orb_metadata *meta, int handle, void *buffer) __EXPORT |
int | orb_check (int handle, bool *updated) __EXPORT |
int | orb_stat (int handle, uint64_t *time) __EXPORT |
int | orb_exists (const struct orb_metadata *meta, int instance) __EXPORT |
int | orb_group_count (const struct orb_metadata *meta) __EXPORT |
Get the number of published instances of a topic group. More... | |
int | orb_priority (int handle, int32_t *priority) __EXPORT |
int | orb_set_interval (int handle, unsigned interval) __EXPORT |
int | orb_get_interval (int handle, unsigned *interval) __EXPORT |
Variables | |
__BEGIN_DECLS typedef void * | orb_advert_t |
ORB topic advertiser handle. More... | |
API for the uORB lightweight object broker.
#define ORB_DECLARE | ( | _name | ) | extern const struct orb_metadata __orb_##_name __EXPORT |
Declare (prototype) the uORB metadata for a topic (used by code generators).
_name | The name of the topic. |
#define ORB_DEFINE | ( | _name, | |
_struct, | |||
_size_no_padding, | |||
_fields | |||
) |
Define (instantiate) the uORB metadata for a topic.
The uORB metadata is used to help ensure that updates and copies are accessing the right data.
Note that there must be no more than one instance of this macro for each topic.
_name | The name of the topic. |
_struct | The structure the topic provides. |
_size_no_padding | Struct size w/o padding at the end |
_fields | All fields in a semicolon separated list e.g: "float[3] position;bool armed" |
#define ORB_ID | ( | _name | ) | &__orb_##_name |
Generates a pointer to the uORB metadata structure for a given topic.
The topic must have been declared previously in scope with ORB_DECLARE().
_name | The name of the topic. |
enum ORB_PRIO |
Topic priority.
Relevant for multi-topics / topic groups
orb_advert_t orb_advertise | ( | const struct orb_metadata * | meta, |
const void * | data | ||
) |
orb_advert_t orb_advertise_multi | ( | const struct orb_metadata * | meta, |
const void * | data, | ||
int * | instance, | ||
int | priority | ||
) |
orb_advert_t orb_advertise_multi_queue | ( | const struct orb_metadata * | meta, |
const void * | data, | ||
int * | instance, | ||
int | priority, | ||
unsigned int | queue_size | ||
) |
orb_advert_t orb_advertise_queue | ( | const struct orb_metadata * | meta, |
const void * | data, | ||
unsigned int | queue_size | ||
) |
int orb_check | ( | int | handle, |
bool * | updated | ||
) |
int orb_copy | ( | const struct orb_metadata * | meta, |
int | handle, | ||
void * | buffer | ||
) |
int orb_exists | ( | const struct orb_metadata * | meta, |
int | instance | ||
) |
int orb_get_interval | ( | int | handle, |
unsigned * | interval | ||
) |
int orb_group_count | ( | const struct orb_metadata * | meta | ) |
Get the number of published instances of a topic group.
meta | ORB topic metadata. |
int orb_priority | ( | int | handle, |
int32_t * | priority | ||
) |
int orb_publish | ( | const struct orb_metadata * | meta, |
orb_advert_t | handle, | ||
const void * | data | ||
) |
int orb_set_interval | ( | int | handle, |
unsigned | interval | ||
) |
int orb_stat | ( | int | handle, |
uint64_t * | time | ||
) |
int orb_subscribe | ( | const struct orb_metadata * | meta | ) |
int orb_subscribe_multi | ( | const struct orb_metadata * | meta, |
unsigned | instance | ||
) |
int orb_unadvertise | ( | orb_advert_t | handle | ) |
int orb_unsubscribe | ( | int | handle | ) |
__BEGIN_DECLS typedef void* orb_advert_t |
ORB topic advertiser handle.
Advertiser handles are global; once obtained they can be shared freely and do not need to be closed or released.
This permits publication from interrupt context and other contexts where a file-descriptor-based handle would not otherwise be in scope for the publisher.