Part 1
요약·해설
Dynamic channel message size 증가와 content pattern을 설명합니다.
Allocation
Dynamic messages
Sizes
1 to 16 bytes
Output
Hex dump
Part 2
접을 수 있는 영어 원문 전체
영어 원문 전체 펼치기
원문 SHA-256
5602D879E30ADCC6E0DB4532D4526B8D58DFB4B04CE996269E7713B6C195B5C7
.. zephyr:code-sample:: zbus-dyn-channel
:name: Dynamic channel
:relevant-api: zbus_apis
Use zbus channels with dynamically allocated messages.
Overview
********
This sample implements an application using zbus to illustrate the way zbus supports dynamically allocated channels.
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/dyn_channel
:host-os: unix
:board: qemu_x86
:goals: run
Sample Output
=============
.. code-block:: console
W: size=01
W: Content
W: 00 |.
W: size=02
W: Content
W: 01 01 |..
W: size=03
W: Content
W: 00 00 00 |...
W: size=04
W: Content
W: 03 03 03 03 |....
W: size=05
W: Content
W: 00 00 00 00 00 |.....
W: size=06
W: Content
W: 05 05 05 05 05 05 |......
W: size=07
W: Content
W: 00 00 00 00 00 00 00 |.......
W: size=08
W: Content
W: 07 07 07 07 07 07 07 07 |........
W: size=09
W: Content
W: 00 00 00 00 00 00 00 00 |........
W: 00 |.
W: size=10
W: Content
W: 09 09 09 09 09 09 09 09 |........
W: 09 09 |..
W: size=11
W: Content
W: 00 00 00 00 00 00 00 00 |........
W: 00 00 00 |...
W: size=12
W: Content
W: 0b 0b 0b 0b 0b 0b 0b 0b |........
W: 0b 0b 0b 0b |....
W: size=13
W: Content
W: 00 00 00 00 00 00 00 00 |........
W: 00 00 00 00 00 |.....
W: size=14
W: Content
W: 0d 0d 0d 0d 0d 0d 0d 0d |........
W: 0d 0d 0d 0d 0d 0d |......
W: size=15
W: Content
W: 00 00 00 00 00 00 00 00 |........
W: 00 00 00 00 00 00 00 |.......
W: size=16
W: Content
W: 0f 0f 0f 0f 0f 0f 0f 0f |........
W: 0f 0f 0f 0f 0f 0f 0f 0f |........
Exit QEMU by pressing :kbd:`CTRL+A` :kbd:`x`.
Part 3
한국어 전문 번역
개요
동적으로 할당한 message를 사용하는 Zbus channel 지원 방식을 보여 주는 sample application입니다.
빌드 및 실행
Console로 출력하며 다음 command로 qemu_x86에서 build하고 실행합니다.
# From the root of the zephyr repository
west build -b qemu_x86 samples/subsys/zbus/dyn_channel
west build -t run
샘플 출력
동적 message 크기가 1 byte부터 16 byte까지 증가하며 각 content를 hex dump로 표시합니다. Output에서는 홀수 크기의 buffer가 0으로 채워지고, 짝수 크기는 크기보다 1 작은 값(01, 03, 05 … 0f)으로 채워지는 pattern을 확인할 수 있습니다.
W: size=01
W: Content
W: 00 |.
W: size=02
W: Content
W: 01 01 |..
W: size=03
W: Content
W: 00 00 00 |...
W: size=04
W: Content
W: 03 03 03 03 |....
W: size=05
W: Content
W: 00 00 00 00 00 |.....
W: size=06
W: Content
W: 05 05 05 05 05 05 |......
W: size=07
W: Content
W: 00 00 00 00 00 00 00 |.......
W: size=08
W: Content
W: 07 07 07 07 07 07 07 07 |........
W: size=09
W: Content
W: 00 00 00 00 00 00 00 00 |........
W: 00 |.
W: size=10
W: Content
W: 09 09 09 09 09 09 09 09 |........
W: 09 09 |..
W: size=11
W: Content
W: 00 00 00 00 00 00 00 00 |........
W: 00 00 00 |...
W: size=12
W: Content
W: 0b 0b 0b 0b 0b 0b 0b 0b |........
W: 0b 0b 0b 0b |....
W: size=13
W: Content
W: 00 00 00 00 00 00 00 00 |........
W: 00 00 00 00 00 |.....
W: size=14
W: Content
W: 0d 0d 0d 0d 0d 0d 0d 0d |........
W: 0d 0d 0d 0d 0d 0d |......
W: size=15
W: Content
W: 00 00 00 00 00 00 00 00 |........
W: 00 00 00 00 00 00 00 |.......
W: size=16
W: Content
W: 0f 0f 0f 0f 0f 0f 0f 0f |........
W: 0f 0f 0f 0f 0f 0f 0f 0f |........
QEMU를 종료하려면 CTRL+A를 누른 뒤 x를 누릅니다.
Source
출처
영어 원문에는 문단, 문서 지시문, 표, 코드, 코드 심벌, 경로를 그대로 보존했습니다.