• Home
Name Date Size #Lines LOC

..--

MakefileD03-May-2024720 2312

README.txtD03-May-2024835 3018

rules.mkD03-May-2024521 2516

simple.cD03-May-20242.2 KiB7234

simple.pb.cD03-May-2024511 208

simple.pb.hD03-May-20241.2 KiB5224

simple.protoD03-May-2024158 106

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