mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-22 08:13:34 +08:00
uORB::Publication improvements and cleanup (#14784)
- create common uORB::PublicationBase - uORB::PublicationQueued types are now type aliases - ORB_PRIO use enum type everywhere to avoid accidental misuse - PX4Accelerometer/PX4Gyroscope/etc driver libs explicitly advertise on construction, unadvertise on destruction. This is a workaround for any potential issues that might appear when accel/gyro cdev and uORB indexing doesn't align.
This commit is contained in:
@@ -55,7 +55,7 @@ class SubscriptionCallback;
|
||||
class uORB::DeviceNode : public cdev::CDev, public ListNode<uORB::DeviceNode *>
|
||||
{
|
||||
public:
|
||||
DeviceNode(const struct orb_metadata *meta, const uint8_t instance, const char *path, uint8_t priority,
|
||||
DeviceNode(const struct orb_metadata *meta, const uint8_t instance, const char *path, ORB_PRIO priority,
|
||||
uint8_t queue_size = 1);
|
||||
virtual ~DeviceNode();
|
||||
|
||||
@@ -116,8 +116,8 @@ public:
|
||||
static int unadvertise(orb_advert_t handle);
|
||||
|
||||
#ifdef ORB_COMMUNICATOR
|
||||
static int16_t topic_advertised(const orb_metadata *meta, int priority);
|
||||
//static int16_t topic_unadvertised(const orb_metadata *meta, int priority);
|
||||
static int16_t topic_advertised(const orb_metadata *meta, ORB_PRIO priority);
|
||||
//static int16_t topic_unadvertised(const orb_metadata *meta, ORB_PRIO priority);
|
||||
|
||||
/**
|
||||
* processes a request for add subscription from remote
|
||||
@@ -263,8 +263,8 @@ private:
|
||||
uint32_t _lost_messages = 0; /**< nr of lost messages for all subscribers. If two subscribers lose the same
|
||||
message, it is counted as two. */
|
||||
|
||||
ORB_PRIO _priority; /**< priority of the topic */
|
||||
const uint8_t _instance; /**< orb multi instance identifier */
|
||||
uint8_t _priority; /**< priority of the topic */
|
||||
bool _advertised{false}; /**< has ever been advertised (not necessarily published data yet) */
|
||||
uint8_t _queue_size; /**< maximum number of elements in the queue */
|
||||
int8_t _subscriber_count{0};
|
||||
|
||||
Reference in New Issue
Block a user