mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-09 05:20:35 +08:00
uorb: allow an orb subscription to retrieve data that was published prior to subscribe
This commit is contained in:
@@ -146,13 +146,8 @@ uORB::DeviceNode::open(device::file_t *filp)
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
/* If queue size >1, allow the subscriber to read the data in the queue. Otherwise, assume subscriber is up to date.*/
|
||||
if (_queue_size <= 1) {
|
||||
sd->generation = _generation;
|
||||
|
||||
} else {
|
||||
sd->generation = _generation - (_queue_size < _generation ? _queue_size : _generation);
|
||||
}
|
||||
/* If there were any previous publications, allow the subscriber to read them */
|
||||
sd->generation = _generation - (_queue_size < _generation ? _queue_size : _generation);
|
||||
|
||||
/* set priority */
|
||||
sd->set_priority(_priority);
|
||||
|
||||
Reference in New Issue
Block a user