iamandi / nanopb

Automatically exported from code.google.com/p/nanopb
zlib License
0 stars 0 forks source link

Make a "cookbook" document #81

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
It could be useful to have a kind of "cookbook" document with examples for the 
most common usage patterns. Such as:

1. Getting message length
2. Using string/bytes/array fields
3. Using field callbacks
4. Wrapping a custom stream
5. Initializing message to defaults
6. Merging messages

.. what else?

Original issue reported on code.google.com by Petteri.Aimonen on 31 Jul 2013 at 6:16

GoogleCodeExporter commented 9 years ago
As an advanced topic, this could also tell about using nanopb to encode message 
incrementally. I.e. instead of using pb_encode(), using pb_encode_tag() and the 
pb_encode_*() functions to manually encode fields.

This may sometimes make dynamic message generation easier than using callbacks.

Original comment by Petteri.Aimonen on 21 Aug 2013 at 2:54