... | ... | @@ -16,7 +16,7 @@ Protocol buffer can serialize data from variety of languages such as Java, Pytho |
|
|
|
|
|
# Installation and Setup
|
|
|
|
|
|
## Setup for Nanopb
|
|
|
## Setting up Nanopb
|
|
|
To use Nanopb, protocol compiler needs to be installed. Follow the [installation instructions](https://github.com/protocolbuffers/protobuf#protocol-compiler-installation) here.
|
|
|
|
|
|
Protocol Buffers messages are defined in a `proto file` as follows:
|
... | ... | @@ -26,12 +26,14 @@ message Foo { |
|
|
required int id = 1;
|
|
|
}
|
|
|
```
|
|
|
To use Nanopb Headers(.h) and source files(.c) generation from `.proto` file is required.
|
|
|
Headers(.h) and source files(.c) are generated using a python script provided by Nanopb.
|
|
|
```
|
|
|
python generator/nanopb_generator.py myprotocol.proto
|
|
|
python generator/nanopb_generator.py foo.proto
|
|
|
```
|
|
|
These header and source files are required to be used with Nanopb.
|
|
|
Follow the [instructions here](Follow the [installation instructions]).
|
|
|
Follow the [instructions here](ihttps://github.com/nanopb/nanopb#generating-the-headers).
|
|
|
|
|
|
**Note**: Sibros repository Integrates Nanopb library in [Bazel](https://www.bazel.build/). Refer to [Sibros Nanopb Bazel]() article for more information.
|
|
|
|
|
|
# Implementation and Examples
|
|
|
|
... | ... | |