diff options
author | Mark D. Roth <roth@google.com> | 2016-09-30 07:48:00 -0700 |
---|---|---|
committer | Mark D. Roth <roth@google.com> | 2016-09-30 07:48:00 -0700 |
commit | 43b817ced14083de585111c2657bbe34040bdcc7 (patch) | |
tree | 3b9e28af5b7e90e9183acae48f0750d1099fbae8 /third_party/nanopb/examples/simple/README.txt | |
parent | 366c6ceb8c53a4f8c4a2f9aa2c6fee8f2a070479 (diff) | |
parent | be43240564891aaa34bbd911332994fe8d197c0b (diff) |
Merge remote-tracking branch 'upstream/master' into run_interop_tests_go
Diffstat (limited to 'third_party/nanopb/examples/simple/README.txt')
-rw-r--r-- | third_party/nanopb/examples/simple/README.txt | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/third_party/nanopb/examples/simple/README.txt b/third_party/nanopb/examples/simple/README.txt new file mode 100644 index 0000000000..ee77bfc70c --- /dev/null +++ b/third_party/nanopb/examples/simple/README.txt @@ -0,0 +1,29 @@ +Nanopb example "simple" +======================= + +This example demonstrates the very basic use of nanopb. It encodes and +decodes a simple message. + +The code uses four different API functions: + + * pb_ostream_from_buffer() to declare the output buffer that is to be used + * pb_encode() to encode a message + * pb_istream_from_buffer() to declare the input buffer that is to be used + * pb_decode() to decode a message + +Example usage +------------- + +On Linux, simply type "make" to build the example. After that, you can +run it with the command: ./simple + +On other platforms, you first have to compile the protocol definition using +the following command:: + + ../../generator-bin/protoc --nanopb_out=. simple.proto + +After that, add the following four files to your project and compile: + + simple.c simple.pb.c pb_encode.c pb_decode.c + + |