22 Commits

Author SHA1 Message Date
dongjiuzhu1
de7bbc1b25 uorb/flush: support flush operation
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>
2024-10-09 22:50:13 +08:00
dongjiuzhu1
84e7a1d409 system/uORB: return subscibe latency/interval
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-10-09 22:50:13 +08:00
dongjiuzhu1
2ae831f40d system/uORB: using lib_sprintf to output va_format and printf normal info in aosp adb shell
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-10-09 22:50:13 +08:00
dongjiuzhu1
f0db02740b system/uorb: fix compile warning
1. add string.h becuase strlen in uORB.c
2. add inttypes.h becuase PRIu64/... in sensor/*.c

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-10-09 22:50:13 +08:00
dongjiuzhu1
d076b9815e system/uorb: support build in aosp
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-10-09 22:50:13 +08:00
likun17
9ca75e2977 uORB: Add topic information acquisition and setting interface.
Signed-off-by: likun17 <likun17@xiaomi.com>
2024-10-09 20:17:29 +08:00
wanggang26
767c8ea6ce uorb: enable O_CLOEXEC explicit
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>
2024-09-23 08:34:38 +08:00
likun17
b428af2cad uORB: Add formatted string ("o_format") parameters and remove callback log ("cb") printing.
Signed-off-by: likun17 <likun17@xiaomi.com>
2024-09-21 23:07:33 +08:00
dongjiuzhu1
abdcb33f14 uORB/uORB; using array to save path for sensor_reginfo_s
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-09-19 11:45:49 +08:00
dongjiuzhu1
dfa3ce5f5d system/uorb: using uorb.h to replace sensors header file
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>
2024-09-10 15:58:15 +08:00
Xiang Xiao
e55c0d9aa5 Remove @ tag from all comments
and format the multiple line comments

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-01-04 10:26:49 +01:00
dongjiuzhu1
718fcfac1e system/uorb: Solve the problem of wrong use of return value
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2023-07-28 21:51:10 -07:00
Xiang Xiao
7032c72f2f Indent the define statement by two spaces
follow the code style convention

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-05-21 07:39:53 +03:00
Jiuzhu Dong
e04333c986 driver/sensor: rename /dev/sensor -> /dev/uorb
because this directory contains all topics by uorb using, not just sensors.

Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-08-08 23:11:37 +08:00
Jiuzhu Dong
131e4dc69d system/uorb: simply orb_check by SNIOC_UPDATED
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-07-23 16:57:58 -03:00
Jiuzhu Dong
f02c5a5d7e system/uorb: support new api
orb_advertise_multi_queue_persist

Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-07-23 16:57:58 -03:00
Jiuzhu Dong
5bb4e14aad system/uorb: always let orb_advertise, orb_advertise_queue for instance 0
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>
2022-07-23 16:57:58 -03:00
Jiuzhu Dong
53ee04ba3c uorb/listener: add new api: orb_open and orb_close
don't using subscriber to get state to avoid rpmsg access

Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-07-23 16:57:58 -03:00
Jiuzhu Dong
6fceb913a2 system/uorb: optimize stack used
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-07-23 16:57:58 -03:00
jihandong
9f6d322186 system/uorb: listener, has 'top' command.
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>
2022-07-23 16:57:58 -03:00
Jiuzhu Dong
4ec3f70f1d apps/system/uorb: support orb_get_meta by name string
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-07-23 16:57:58 -03:00
jihandong
3528b5515f apps/system/uorb: c interfaces.
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>
2022-07-23 16:57:58 -03:00