diff --git a/src/modules/uORB/uORBDevices.cpp b/src/modules/uORB/uORBDevices.cpp index 1a59e0f4f3..5a88d366e2 100644 --- a/src/modules/uORB/uORBDevices.cpp +++ b/src/modules/uORB/uORBDevices.cpp @@ -927,6 +927,7 @@ uORB::DeviceMaster::ioctl(device::file_t *filp, int cmd, unsigned long arg) if ((existing_node != nullptr) && !(existing_node->is_published())) { /* nothing has been published yet, lets claim it */ + existing_node->set_priority(adv->priority); ret = PX4_OK; } else { diff --git a/src/modules/uORB/uORBDevices.hpp b/src/modules/uORB/uORBDevices.hpp index 2625330c23..d92886898c 100644 --- a/src/modules/uORB/uORBDevices.hpp +++ b/src/modules/uORB/uORBDevices.hpp @@ -185,6 +185,8 @@ public: unsigned int published_message_count() const { return _generation; } const struct orb_metadata *get_meta() const { return _meta; } + void set_priority(uint8_t priority) { _priority = priority; } + protected: virtual pollevent_t poll_state(device::file_t *filp); virtual void poll_notify_one(px4_pollfd_struct_t *fds, pollevent_t events); @@ -215,7 +217,7 @@ private: uint8_t *_data; /**< allocated object buffer */ hrt_abstime _last_update; /**< time the object was last updated */ volatile unsigned _generation; /**< object generation count */ - const uint8_t _priority; /**< priority of the topic */ + uint8_t _priority; /**< priority of the topic */ bool _published; /**< has ever data been published */ uint8_t _queue_size; /**< maximum number of elements in the queue */ int16_t _subscriber_count;