zephyr/samples/subsys/zbus/confirmed_channel
Benjamin Cabé 7c4ff77bf3 doc: zbus: samples: Use new Sphinx extension to document samples
Use the new code-sample directive and roles to document the zbus samples
so that they show up as "Related samples" when browsing zbus API.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-09-11 19:56:57 +02:00
..
src
CMakeLists.txt
README.rst
prj.conf
sample.yaml

README.rst

.. zephyr:code-sample:: zbus-confirmed-channel
   :name: Confirmed channel
   :relevant-api: zbus_apis

   Use confirmed zbus channels to ensure all subscribers consume a message.

Overview
********
This sample implements a simple way of using confirmed channels in zbus.
The confirmed channel can only be published when all the subscribers consume the message.

Building and Running
********************

This project outputs to the console.  It can be built and executed
on QEMU as follows:

.. zephyr-app-commands::
   :zephyr-app: samples/subsys/zbus/confirmed_channel
   :host-os: unix
   :board: qemu_x86
   :goals: run

Sample Output
=============

.. code-block:: console

   I: From listener -> Confirmed message payload = 0
   I: From bar_sub2 subscriber -> Confirmed message payload = 0
   I: From bar_sub1 subscriber -> Confirmed message payload = 0
   I: From bar_sub3 subscriber -> Confirmed message payload = 0
   I: From listener -> Confirmed message payload = 1
   I: From bar_sub2 subscriber -> Confirmed message payload = 1
   I: From bar_sub1 subscriber -> Confirmed message payload = 1
   I: From bar_sub3 subscriber -> Confirmed message payload = 1
   I: From listener -> Confirmed message payload = 2
   I: From bar_sub2 subscriber -> Confirmed message payload = 2
   I: From bar_sub1 subscriber -> Confirmed message payload = 2
   I: From bar_sub3 subscriber -> Confirmed message payload = 2
   I: From listener -> Confirmed message payload = 3
   I: From bar_sub2 subscriber -> Confirmed message payload = 3
   I: From bar_sub1 subscriber -> Confirmed message payload = 3
   I: From bar_sub3 subscriber -> Confirmed message payload = 3
   <continues>

Exit QEMU by pressing :kbd:`CTRL+A` :kbd:`x`.