• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..--

MakefileD23-Nov-2023720 2312

README.txtD23-Nov-2023835 3018

rules.mkD23-Nov-2023521 2516

simple.cD23-Nov-20232.2 KiB7234

simple.pb.cD23-Nov-2023511 208

simple.pb.hD23-Nov-20231.2 KiB5224

simple.protoD23-Nov-2023158 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