samples/modules/nanopb/README.html · samples/modules/nanopb/README.rst 공식 원문 ↗

Zephyr 3.7.0 · Samples · Nanopb

Nanopb Sample

Proto3 구조와 buffer·optional field 설정을 Nanopb로 encode하고 decode합니다.

Official pathsamples/modules/nanopb/README.html
Source filesamples/modules/nanopb/README.rst
Source versionZephyr 3.7.0
TranslationFull · reviewed

본문 기준: Zephyr 3.7.0 LTS3 · 이후 유지보수 패치는 별도입니다.

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는 buffer field의 크기를 설정합니다.
  • CONFIG_SAMPLE_UNLUCKY_NUMBER는 unlucky_number field를 활성화하거나 비활성화합니다.

Build와 실행

다음과 같이 application을 QEMU용으로 build하고 실행할 수 있습니다.

west build -b qemu_x86 samples/modules/nanopb
west build -t run

Source

출처

영어 원문에는 문단, 문서 지시문, 표, 코드, 코드 심벌, 경로를 그대로 보존했습니다.