README.txt 848 B

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