X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=docs%2Findex.rst;h=93f04c6ca346b58c1f7da5b9ec41562409fb8099;hb=2cefaeaf61f38f1566293e53b4708e9ceff2d945;hp=0ae6f0fdd34dc47773fc63a3d016f433a053368c;hpb=842d52633d650286ce62490362f8dfa356e17800;p=apps%2Fagl-service-can-low-level.git diff --git a/docs/index.rst b/docs/index.rst index 0ae6f0fd..93f04c6c 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -2,6 +2,8 @@ Nanopb: Protocol Buffers with small code size ============================================= +.. include :: menu.rst + Nanopb is an ANSI-C library for encoding and decoding messages in Google's `Protocol Buffers`__ format with minimal requirements for RAM and code space. It is primarily suitable for 32-bit microcontrollers. @@ -55,8 +57,12 @@ For starters, consider this simple message:: required int32 value = 1; } -Save this in *example.proto* and run it through *nanopb_generate.py*. You -should now have in *example.h*:: +Save this in *example.proto* and compile it:: + + user@host:~$ protoc -omessage.pb message.proto + user@host:~$ python ../generator/nanopb_generator.py message.pb + +You should now have in *example.h*:: typedef struct { int32_t value; @@ -75,19 +81,8 @@ After that, buffer will contain the encoded message. The number of bytes in the message is stored in *stream.bytes_written*. You can feed the message to *protoc --decode=Example example.proto* to verify its validity. -Library reference -================= - -**Encoding** - -**Decoding** - -**Specifying field options** - -**Generated code** - Wishlist ======== #) A specialized encoder for encoding to a memory buffer. Should serialize in reverse order to avoid having to determine submessage size beforehand. -#) A cleaner rewrite of the source generator. +#) A cleaner rewrite of the Python-based source generator. #) Better performance for 16- and 8-bit platforms: use smaller datatypes where possible.