• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..--

docs/23-Nov-2023-6,3395,812

examples/23-Nov-2023-1,574989

extra/23-Nov-2023-506412

generator/23-Nov-2023-3,0872,458

patches/23-Nov-2023-2825

tests/23-Nov-2023-11,7748,976

tools/23-Nov-2023-17486

.gitignoreD23-Nov-202312 32

AUTHORS.txtD23-Nov-20231.6 KiB4644

Android.bpD23-Nov-20233.2 KiB11398

BUILDD23-Nov-2023340 2218

CHANGELOG.txtD23-Nov-202312.7 KiB303267

CMakeLists.txtD23-Nov-20233.1 KiB9575

CONTRIBUTING.mdD23-Nov-20231.2 KiB3321

CleanSpec.mkD23-Nov-20232.3 KiB552

LICENSE.txtD23-Nov-2023898 2115

METADATAD23-Nov-202339 43

MODULE_LICENSE_PUBLIC_DOMAIND23-Nov-20230

NOTICED23-Nov-2023898 2115

OWNERSD23-Nov-2023180 65

README.androidD23-Nov-2023422 139

README.mdD23-Nov-20232.9 KiB7250

README.versionD23-Nov-202398 43

WORKSPACED23-Nov-202343 21

library.jsonD23-Nov-2023743 2726

pb.hD23-Nov-202322.7 KiB600290

pb_common.cD23-Nov-20232.9 KiB9864

pb_common.hD23-Nov-20231.4 KiB4322

pb_decode.cD23-Nov-202346.4 KiB1,5091,114

pb_decode.hD23-Nov-20236.4 KiB17652

pb_encode.cD23-Nov-202325.9 KiB870656

pb_encode.hD23-Nov-20236.1 KiB17153

README.android

1URL: https://jpa.kapsi.fi/nanopb/
2Version: 0.3.9.1
3License: zlib
4Description: "nanopb-c: A plugin for Google Protobuf compiler that generates C code"
5
6To use with Android modify Android.mk adding .proto files to
7LOCAL_SRC_FILES and set LOCAL_PROTOC_OPTIMIZE_TYPE:
8
9  LOCAL_SRC_FILES += simple.proto
10  LOCAL_PROTOC_OPTIMIZE_TYPE := nanopb-c
11
12Then look at https://jpa.kapsi.fi/nanopb/ Documentation for how to use nanopb-c.
13

README.md

1Nanopb - Protocol Buffers for Embedded Systems
2==============================================
3
4[![Build Status](https://travis-ci.org/nanopb/nanopb.svg?branch=master)](https://travis-ci.org/nanopb/nanopb)
5
6Nanopb is a small code-size Protocol Buffers implementation in ansi C. It is
7especially suitable for use in microcontrollers, but fits any memory
8restricted system.
9
10* **Homepage:** https://jpa.kapsi.fi/nanopb/
11* **Documentation:** https://jpa.kapsi.fi/nanopb/docs/
12* **Downloads:** https://jpa.kapsi.fi/nanopb/download/
13* **Forum:** https://groups.google.com/forum/#!forum/nanopb
14
15
16
17Using the nanopb library
18------------------------
19To use the nanopb library, you need to do two things:
20
211. Compile your .proto files for nanopb, using protoc.
222. Include pb_encode.c, pb_decode.c and pb_common.c in your project.
23
24The easiest way to get started is to study the project in "examples/simple".
25It contains a Makefile, which should work directly under most Linux systems.
26However, for any other kind of build system, see the manual steps in
27README.txt in that folder.
28
29
30
31Using the Protocol Buffers compiler (protoc)
32--------------------------------------------
33The nanopb generator is implemented as a plugin for the Google's own protoc
34compiler. This has the advantage that there is no need to reimplement the
35basic parsing of .proto files. However, it does mean that you need the
36Google's protobuf library in order to run the generator.
37
38If you have downloaded a binary package for nanopb (either Windows, Linux or
39Mac OS X version), the 'protoc' binary is included in the 'generator-bin'
40folder. In this case, you are ready to go. Simply run this command:
41
42    generator-bin/protoc --nanopb_out=. myprotocol.proto
43
44However, if you are using a git checkout or a plain source distribution, you
45need to provide your own version of protoc and the Google's protobuf library.
46On Linux, the necessary packages are protobuf-compiler and python-protobuf.
47On Windows, you can either build Google's protobuf library from source or use
48one of the binary distributions of it. In either case, if you use a separate
49protoc, you need to manually give the path to nanopb generator:
50
51    protoc --plugin=protoc-gen-nanopb=nanopb/generator/protoc-gen-nanopb ...
52
53
54
55Running the tests
56-----------------
57If you want to perform further development of the nanopb core, or to verify
58its functionality using your compiler and platform, you'll want to run the
59test suite. The build rules for the test suite are implemented using Scons,
60so you need to have that installed. To run the tests:
61
62    cd tests
63    scons
64
65This will show the progress of various test cases. If the output does not
66end in an error, the test cases were successful.
67
68Note: Mac OS X by default aliases 'clang' as 'gcc', while not actually
69supporting the same command line options as gcc does. To run tests on
70Mac OS X, use: "scons CC=clang CXX=clang". Same way can be used to run
71tests with different compilers on any platform.
72

README.version

1URL: https://github.com/nanopb/nanopb/archive/0.3.9.1.tar.gz
2Version: 0.3.9.1
3BugComponent: 31808
4