After you call orb_flush(), you can determine whether the
flush is completed by listening to the POLLPRI event
of fd and getting the event in orb_get_events.
After calling orb_get_events, the flush events will be cleared.
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
to avoid potential fd leak which means fork/vfork will duplicate fd
without O_CLOEXEC flag to the child process.
Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
Sensors are just a part of uORB, and there are many virtual topics used
within uORB as well. For the library apps/system/uorb/, the nuttx/uorb.h
version is more preferable. So, move public type and definition to
nuttx/uorb.h.
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
1.orb_advertise, orb_advertise_queue for instance 0
2.orb_advertise_multi, orb_advertise__multi_queue for specified instance
3.If orb_advertise_multi_queue with instance is NULL, auto increase
instance from existing base.
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
Listener can scan device under ORB_SENSOR_PATH, subscribe them and
cotinue printing messages by call their cb.
'-T' can Continuously print updating objects, '-l' means only
print once.
Signed-off-by: jihandong <jihandong@xiaomi.com>
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
refer to: https://docs.px4.io/v1.12/en/middleware/uorb.html
- orb_open: do real work for advertise() and subscribe(), if thre is
no user, register topic first, then save meta in driver;
only first user can successfully set buffer number.
- orb_exists: check topic state, if topic only has subscribers,
return "not exists".
Signed-off-by: jihandong <jihandong@xiaomi.com>