uorb: allow an orb subscription to retrieve data that was published prior to subscribe

This commit is contained in:
Beat Küng
2018-07-16 09:38:56 +02:00
committed by Lorenz Meier
parent 3f615695b6
commit 2fe5e7735a
2 changed files with 8 additions and 7 deletions
+2 -7
View File
@@ -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);