More documentation, small improvements
[apps/agl-service-can-low-level.git] / docs / encoding.rst
1 =========================
2 Nanopb: Encoding messages
3 =========================
4
5 The basic way to encode messages is to:
6
7 1) Create an `output stream`_.
8 2) Fill a structure with your data.
9 3) Call *pb_encode* with the stream, a pointer to *const pb_field_t* array and a pointer to your structure.
10
11 A few extra steps are necessary if you need to know the size of the message beforehand, or if you have dynamically sized fields.
12
13 .. _`output stream`: concepts.html#output-streams
14
15 Function: pb_encode
16 ===================
17
18