xiaoxiang781216 commented on code in PR #3743:
URL: https://github.com/apache/nuttx-apps/pull/3743#discussion_r3838884419


##########
system/zbus/README.rst:
##########
@@ -0,0 +1,58 @@
+==========================
+``zbus`` ZBus message bus

Review Comment:
   move to nuttx/Documentation



##########
system/zbus/Kconfig:
##########
@@ -0,0 +1,132 @@
+#
+# For a description of the syntax of this configuration file,
+# see the file kconfig-language.txt in the NuttX tools repository.
+#
+
+menuconfig ZBUS
+       bool "ZBus message bus library"
+       default n
+       depends on !DISABLE_MQUEUE
+       ---help---
+               Enable the zbus message bus library (port of the Zephyr zbus).
+               Channels and observers are defined statically with the
+               ZBUS_CHAN_DEFINE/ZBUS_LISTENER_DEFINE/ZBUS_SUBSCRIBER_DEFINE
+               macros and collected in linker iterable sections.  The board
+               linker script must include <nuttx/linker/common-rom.ld> (inside
+               .text) and <nuttx/linker/common-ram.ld> (inside .data).
+
+               For protection against priority inversion during the
+               notification process, enable CONFIG_PRIORITY_INHERITANCE.
+
+if ZBUS
+
+config ZBUS_CHANNEL_NAME
+       bool "Channel name field"
+       default n
+       ---help---
+               Store the channel name string and enable zbus_chan_name() and
+               zbus_chan_from_name().
+
+config ZBUS_CHANNEL_ID
+       bool "Channel identifier field"
+       default n
+       ---help---
+               Store a unique numeric channel identifier and enable
+               zbus_chan_from_id().  Use ZBUS_CHAN_DEFINE_WITH_ID.
+
+config ZBUS_OBSERVER_NAME
+       bool "Observer name field"
+       default n
+       ---help---
+               Store the observer name string and enable zbus_obs_name().
+
+config ZBUS_CHANNEL_PUBLISH_STATS
+       bool "Channel publishing statistics (timestamp and count)"
+       default n
+
+config ZBUS_MSG_SUBSCRIBER
+       bool "Message subscribers (receive message copies in sequence)"
+       default n
+       ---help---
+               Enable ZBUS_MSG_SUBSCRIBER_DEFINE and zbus_sub_wait_msg().
+               Message subscribers receive a copy of every published message
+               through a POSIX message queue.
+
+if ZBUS_MSG_SUBSCRIBER
+
+config ZBUS_MSG_SUBSCRIBER_MAX_MSG_SIZE
+       int "Size of the biggest message used with zbus (bytes)"
+       default 64
+       ---help---
+               Messages larger than this cannot be delivered to message
+               subscribers.  Defines the message queue slot size.
+
+               NOTE: CONFIG_MQ_MAXMSGSIZE must be at least this value plus
+               the size of a pointer, otherwise the message subscriber
+               queues fail to open with -EINVAL.
+
+config ZBUS_MSG_SUBSCRIBER_QUEUE_SIZE
+       int "Message subscriber queue depth"
+       default 4
+
+endif # ZBUS_MSG_SUBSCRIBER
+
+config ZBUS_ASYNC_LISTENER
+       bool "Async listeners"
+       default n
+       depends on ZBUS_MSG_SUBSCRIBER
+       depends on SCHED_LPWORK
+       ---help---
+               Async listeners execute their callback on the low priority work
+               queue with a copy of the published message, instead of running
+               synchronously in the publisher context.  Enable with
+               ZBUS_ASYNC_LISTENER_DEFINE.
+
+config ZBUS_ISR_PUBLISHER

Review Comment:
   userspace shouldn't handle isr



##########
system/zbus/Kconfig:
##########
@@ -0,0 +1,132 @@
+#
+# For a description of the syntax of this configuration file,
+# see the file kconfig-language.txt in the NuttX tools repository.
+#
+
+menuconfig ZBUS
+       bool "ZBus message bus library"
+       default n
+       depends on !DISABLE_MQUEUE
+       ---help---
+               Enable the zbus message bus library (port of the Zephyr zbus).
+               Channels and observers are defined statically with the
+               ZBUS_CHAN_DEFINE/ZBUS_LISTENER_DEFINE/ZBUS_SUBSCRIBER_DEFINE
+               macros and collected in linker iterable sections.  The board
+               linker script must include <nuttx/linker/common-rom.ld> (inside
+               .text) and <nuttx/linker/common-ram.ld> (inside .data).
+
+               For protection against priority inversion during the
+               notification process, enable CONFIG_PRIORITY_INHERITANCE.
+
+if ZBUS
+
+config ZBUS_CHANNEL_NAME
+       bool "Channel name field"
+       default n
+       ---help---
+               Store the channel name string and enable zbus_chan_name() and
+               zbus_chan_from_name().
+
+config ZBUS_CHANNEL_ID
+       bool "Channel identifier field"
+       default n
+       ---help---
+               Store a unique numeric channel identifier and enable
+               zbus_chan_from_id().  Use ZBUS_CHAN_DEFINE_WITH_ID.
+
+config ZBUS_OBSERVER_NAME
+       bool "Observer name field"
+       default n
+       ---help---
+               Store the observer name string and enable zbus_obs_name().
+
+config ZBUS_CHANNEL_PUBLISH_STATS
+       bool "Channel publishing statistics (timestamp and count)"
+       default n
+
+config ZBUS_MSG_SUBSCRIBER
+       bool "Message subscribers (receive message copies in sequence)"
+       default n
+       ---help---
+               Enable ZBUS_MSG_SUBSCRIBER_DEFINE and zbus_sub_wait_msg().
+               Message subscribers receive a copy of every published message
+               through a POSIX message queue.
+
+if ZBUS_MSG_SUBSCRIBER
+
+config ZBUS_MSG_SUBSCRIBER_MAX_MSG_SIZE
+       int "Size of the biggest message used with zbus (bytes)"
+       default 64
+       ---help---
+               Messages larger than this cannot be delivered to message
+               subscribers.  Defines the message queue slot size.
+
+               NOTE: CONFIG_MQ_MAXMSGSIZE must be at least this value plus
+               the size of a pointer, otherwise the message subscriber
+               queues fail to open with -EINVAL.
+
+config ZBUS_MSG_SUBSCRIBER_QUEUE_SIZE
+       int "Message subscriber queue depth"
+       default 4
+
+endif # ZBUS_MSG_SUBSCRIBER
+
+config ZBUS_ASYNC_LISTENER
+       bool "Async listeners"
+       default n
+       depends on ZBUS_MSG_SUBSCRIBER
+       depends on SCHED_LPWORK

Review Comment:
   userspace should avoid to use LPWORK



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to