All Projects → nanopb → Nanopb

nanopb / Nanopb

Licence: zlib
Protocol Buffers with small code size

Programming Languages

c
50402 projects - #5 most used programming language
python
139335 projects - #7 most used programming language
C++
36643 projects - #6 most used programming language
CMake
9771 projects
shell
77523 projects
Makefile
30231 projects

Projects that are alternatives of or similar to Nanopb

Protozero
Minimalist protocol buffer decoder and encoder in C++
Stars: ✭ 177 (-93.37%)
Mutual labels:  protocol-buffers
Jpa Hibernate Tutorials
Hibernate Tutorials with Spring Boot and Spring-Data-JPA
Stars: ✭ 186 (-93.03%)
Mutual labels:  embedded
Frosted
Frosted: Free POSIX OS for tiny embedded devices
Stars: ✭ 194 (-92.73%)
Mutual labels:  embedded
Awtk
AWTK = Toolkit AnyWhere(为嵌入式、手机和PC打造的通用GUI系统)
Stars: ✭ 2,328 (-12.74%)
Mutual labels:  embedded
Mbeddr.core
The mbeddr core. An extensible C
Stars: ✭ 184 (-93.1%)
Mutual labels:  embedded
Littlefs
A little fail-safe filesystem designed for microcontrollers
Stars: ✭ 2,488 (-6.75%)
Mutual labels:  embedded
Evans
Evans: more expressive universal gRPC client
Stars: ✭ 2,710 (+1.57%)
Mutual labels:  protocol-buffers
Acados
Fast and embedded solvers for nonlinear optimal control
Stars: ✭ 194 (-92.73%)
Mutual labels:  embedded
Nrf Hal
A Rust HAL for the nRF family of devices
Stars: ✭ 186 (-93.03%)
Mutual labels:  embedded
Awesome Embedded Rust
Curated list of resources for Embedded and Low-level development in the Rust programming language
Stars: ✭ 2,805 (+5.13%)
Mutual labels:  embedded
Go Grpc Examples
This repo contains examples and implementations of different types of GRPC services and APIs using Golang.
Stars: ✭ 180 (-93.25%)
Mutual labels:  protocol-buffers
Node Protobuf
Google Protocol Buffers wrapper for Node.js [UNMAINTAINED]
Stars: ✭ 184 (-93.1%)
Mutual labels:  protocol-buffers
Couchbase Lite Core
Cross-platform C++ core library for Couchbase Lite
Stars: ✭ 187 (-92.99%)
Mutual labels:  embedded
Interrupt
A community for embedded software makers.
Stars: ✭ 178 (-93.33%)
Mutual labels:  embedded
Nginx Link Function
It is a NGINX module that provides dynamic linking to your application in server context and call the function of your application in location directive
Stars: ✭ 197 (-92.62%)
Mutual labels:  embedded
Protoc Jar Maven Plugin
Protocol Buffers protobuf maven plugin - based on protoc-jar multi-platform executable protoc JAR
Stars: ✭ 177 (-93.37%)
Mutual labels:  protocol-buffers
Protobuf Dynamic
Protocol Buffers Dynamic Schema - create protobuf schemas programmatically
Stars: ✭ 186 (-93.03%)
Mutual labels:  protocol-buffers
Webgl Plot
A high-Performance real-time 2D plotting library based on native WebGL
Stars: ✭ 200 (-92.5%)
Mutual labels:  embedded
Jled
Non-blocking LED controlling library for Arduino and friends.
Stars: ✭ 197 (-92.62%)
Mutual labels:  embedded
Deviceplane
Open source device management for embedded systems and edge computing
Stars: ✭ 917 (-65.63%)
Mutual labels:  embedded

Nanopb - Protocol Buffers for Embedded Systems

Build Status

Nanopb is a small code-size Protocol Buffers implementation in ansi C. It is especially suitable for use in microcontrollers, but fits any memory restricted system.

Using the nanopb library

To use the nanopb library, you need to do two things:

  1. Compile your .proto files for nanopb, using protoc.
  2. Include pb_encode.c, pb_decode.c and pb_common.c in your project.

The easiest way to get started is to study the project in "examples/simple". It contains a Makefile, which should work directly under most Linux systems. However, for any other kind of build system, see the manual steps in README.txt in that folder.

Generating the headers

Protocol Buffers messages are defined in a .proto file, which follows a standard format that is compatible with all Protocol Buffers libraries. To use it with nanopb, you need to generate .pb.c and .pb.h files from it:

python generator/nanopb_generator.py myprotocol.proto  # For source checkout
generator-bin/nanopb_generator myprotocol.proto        # For binary package

(Note: For instructions for nanopb-0.3.9.x and older, see the documentation of that particular version here)

The binary packages for Windows, Linux and Mac OS X should contain all necessary dependencies, including Python, python-protobuf library and protoc. If you are using a git checkout or a plain source distribution, you will need to install Python separately. Once you have Python, you can install the other dependencies with pip install protobuf grpcio-tools.

You can further customize the header generation by creating an .options file. See documentation for details.

Running the tests

If you want to perform further development of the nanopb core, or to verify its functionality using your compiler and platform, you'll want to run the test suite. The build rules for the test suite are implemented using Scons, so you need to have that installed (ex: sudo apt install scons or pip install scons). To run the tests:

cd tests
scons

This will show the progress of various test cases. If the output does not end in an error, the test cases were successful.

Note: Mac OS X by default aliases 'clang' as 'gcc', while not actually supporting the same command line options as gcc does. To run tests on Mac OS X, use: scons CC=clang CXX=clang. Same way can be used to run tests with different compilers on any platform.

For embedded platforms, there is currently support for running the tests on STM32 discovery board and simavr AVR simulator. Use scons PLATFORM=STM32 and scons PLATFORM=AVR to run these tests.

Build systems and integration

Nanopb C code itself is designed to be portable and easy to build on any platform. Often the bigger hurdle is running the generator which takes in the .proto files and outputs .pb.c definitions.

There exist build rules for several systems:

And also integration to platform interfaces:

Building nanopb - Using vcpkg

You can download and install nanopb using the vcpkg dependency manager:

git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
./bootstrap-vcpkg.sh
./vcpkg integrate install
./vcpkg install nanopb

The nanopb port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please create an issue or pull request on the vcpkg repository.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].