X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=docs%2Fconcepts.rst;h=f5e32adccdb8d25be79fccdc8071e1c8f3b206ed;hb=c7e2d6cc2fde5a69da7bf2735f4fb33e1633b221;hp=e6076401ae87ccde833a0d64312662e057291e28;hpb=a3534170212675e0c7d3d89e23838e25f3664316;p=apps%2Fagl-service-can-low-level.git diff --git a/docs/concepts.rst b/docs/concepts.rst index e6076401..f5e32adc 100644 --- a/docs/concepts.rst +++ b/docs/concepts.rst @@ -4,7 +4,7 @@ Nanopb: Basic concepts .. include :: menu.rst -The things outlined here are common to both the encoder and the decoder part. +The things outlined here are the underlying concepts of the nanopb design. .. contents:: @@ -201,7 +201,7 @@ Decoding callbacks bool (*decode)(pb_istream_t *stream, const pb_field_t *field, void *arg); -When decoding, the callback receives a length-limited substring that reads the contents of a single field. The field tag has already been read. +When decoding, the callback receives a length-limited substring that reads the contents of a single field. The field tag has already been read. For *string* and *bytes*, the length value has already been parsed, and is available at *stream->bytes_left*. The callback will be called multiple times for repeated fields. For packed fields, you can either read multiple values until the stream ends, or leave it to `pb_decode`_ to call your function over and over until all values have been read.