Part 1
요약·해설
SimpleMessage schema, 두 Kconfig option과 qemu_x86 실행을 보존합니다.
Schema
Proto3
Fields
3
Board
qemu_x86
Part 2
접을 수 있는 영어 원문 전체
영어 원문 전체 펼치기
원문 SHA-256
272DBF02C4260E5324862379BC65AA9ECBF6550AC3E0351A8779A4DD8409622B
.. _nanopb_sample:
Nanopb sample
#############
Overview
********
A simple protocol buffer sample using :ref:`nanopb_reference` for serializing structured data
to platform independent raw buffers or streams.
The structured data to encode/decode is presented as follows:
.. code-block:: proto
syntax = "proto3";
message SimpleMessage {
int32 lucky_number = 1;
bytes buffer = 2;
int32 unlucky_number = 3;
}
Configuration
*************
This sample uses two configuration options to modify the behavior.
* :kconfig:option:`CONFIG_SAMPLE_BUFFER_SIZE` sets the ``buffer`` field's size
* :kconfig:option:`CONFIG_SAMPLE_UNLUCKY_NUMBER` either enables or disables the ``unlucky_number``
field.
Building and Running
********************
This application can be built as follows:
.. zephyr-app-commands::
:zephyr-app: samples/modules/nanopb
:host-os: unix
:board: qemu_x86
:goals: run
:compact:
Part 3
한국어 전문 번역
개요
Nanopb를 사용해 structured data를 platform-independent raw buffer 또는 stream으로 serialize하는 간단한 protocol buffer sample입니다.
Encode하고 decode할 structured data는 다음과 같습니다.
syntax = "proto3";
message SimpleMessage {
int32 lucky_number = 1;
bytes buffer = 2;
int32 unlucky_number = 3;
}
설정
두 configuration option으로 sample 동작을 바꿀 수 있습니다.
CONFIG_SAMPLE_BUFFER_SIZE는bufferfield의 크기를 설정합니다.CONFIG_SAMPLE_UNLUCKY_NUMBER는unlucky_numberfield를 활성화하거나 비활성화합니다.
Build와 실행
다음과 같이 application을 QEMU용으로 build하고 실행할 수 있습니다.
west build -b qemu_x86 samples/modules/nanopb
west build -t run
Source
출처
영어 원문에는 문단, 문서 지시문, 표, 코드, 코드 심벌, 경로를 그대로 보존했습니다.