• Home
Name Date Size #Lines LOC

..--

MakefileD03-May-2024659 2211

README.txtD03-May-2024835 3018

simple.cD03-May-20242 KiB6934

simple.protoD03-May-2024138 85

README.txt

1Nanopb example "simple"
2=======================
3
4This example demonstrates the very basic use of nanopb. It encodes and
5decodes a simple message.
6
7The code uses four different API functions:
8
9  * pb_ostream_from_buffer() to declare the output buffer that is to be used
10  * pb_encode() to encode a message
11  * pb_istream_from_buffer() to declare the input buffer that is to be used
12  * pb_decode() to decode a message
13
14Example usage
15-------------
16
17On Linux, simply type "make" to build the example. After that, you can
18run it with the command: ./simple
19
20On other platforms, you first have to compile the protocol definition using
21the following command::
22
23  ../../generator-bin/protoc --nanopb_out=. simple.proto
24
25After that, add the following four files to your project and compile:
26
27  simple.c  simple.pb.c  pb_encode.c  pb_decode.c
28
29
30