uORB::DeviceNode mark advertised on write

- this is a workaround if multiple publishers for the same topic exists and one unadvertises (eg uORB::Publication destruction)
This commit is contained in:
Daniel Agar 2023-12-07 21:32:07 -05:00
parent efc6a5036b
commit ce67fee6b9
1 changed files with 5 additions and 3 deletions

View File

@ -219,14 +219,16 @@ uORB::DeviceNode::write(cdev::file_t *filp, const char *buffer, size_t buflen)
memcpy(_data + (_meta->o_size * (generation % _queue_size)), buffer, _meta->o_size);
/* Mark at least one data has been published */
_data_valid = true;
mark_as_advertised();
// callbacks
for (auto item : _callbacks) {
item->call();
}
/* Mark at least one data has been published */
_data_valid = true;
ATOMIC_LEAVE;
/* notify any poll waiters */