1.. zephyr:code-sample:: zbus-dyn-channel 2 :name: Dynamic channel 3 :relevant-api: zbus_apis 4 5 Use zbus channels with dynamically allocated messages. 6 7Overview 8******** 9This sample implements an application using zbus to illustrate the way zbus supports dynamically allocated channels. 10 11Building and Running 12******************** 13 14This project outputs to the console. It can be built and executed 15on QEMU as follows: 16 17.. zephyr-app-commands:: 18 :zephyr-app: samples/subsys/zbus/dyn_channel 19 :host-os: unix 20 :board: qemu_x86 21 :goals: run 22 23Sample Output 24============= 25 26.. code-block:: console 27 28 W: size=01 29 W: Content 30 W: 00 |. 31 W: size=02 32 W: Content 33 W: 01 01 |.. 34 W: size=03 35 W: Content 36 W: 00 00 00 |... 37 W: size=04 38 W: Content 39 W: 03 03 03 03 |.... 40 W: size=05 41 W: Content 42 W: 00 00 00 00 00 |..... 43 W: size=06 44 W: Content 45 W: 05 05 05 05 05 05 |...... 46 W: size=07 47 W: Content 48 W: 00 00 00 00 00 00 00 |....... 49 W: size=08 50 W: Content 51 W: 07 07 07 07 07 07 07 07 |........ 52 W: size=09 53 W: Content 54 W: 00 00 00 00 00 00 00 00 |........ 55 W: 00 |. 56 W: size=10 57 W: Content 58 W: 09 09 09 09 09 09 09 09 |........ 59 W: 09 09 |.. 60 W: size=11 61 W: Content 62 W: 00 00 00 00 00 00 00 00 |........ 63 W: 00 00 00 |... 64 W: size=12 65 W: Content 66 W: 0b 0b 0b 0b 0b 0b 0b 0b |........ 67 W: 0b 0b 0b 0b |.... 68 W: size=13 69 W: Content 70 W: 00 00 00 00 00 00 00 00 |........ 71 W: 00 00 00 00 00 |..... 72 W: size=14 73 W: Content 74 W: 0d 0d 0d 0d 0d 0d 0d 0d |........ 75 W: 0d 0d 0d 0d 0d 0d |...... 76 W: size=15 77 W: Content 78 W: 00 00 00 00 00 00 00 00 |........ 79 W: 00 00 00 00 00 00 00 |....... 80 W: size=16 81 W: Content 82 W: 0f 0f 0f 0f 0f 0f 0f 0f |........ 83 W: 0f 0f 0f 0f 0f 0f 0f 0f |........ 84 85Exit QEMU by pressing :kbd:`CTRL+A` :kbd:`x`. 86