uORBDevices: set the priority when advertising a node that's already subscribed

This fixes the case where a topic instance is already subscribed, and
advertised later. The subscriber will create the DeviceNode with default
priority, and the advertiser will just use the existing DeviceNode,
without updating to the requested priority.
This commit is contained in:
Beat Küng
2018-01-19 11:48:12 +01:00
committed by Lorenz Meier
parent c8a1050323
commit 2cb698f01f
2 changed files with 4 additions and 1 deletions
+1
View File
@@ -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 {