Nanopb - Protocol Buffers for Embedded Systems
==============================================
[![Build Status](https://travis-ci.org/nanopb/nanopb.svg?branch=master)](https://travis-ci.org/nanopb/nanopb)
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.
* **Homepage:** http://kapsi.fi/~jpa/nanopb/
* **Documentation:** http://kapsi.fi/~jpa/nanopb/docs/
* **Downloads:** http://kapsi.fi/~jpa/nanopb/download/
* **Forum:** https://groups.google.com/forum/#!forum/nanopb
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 and pb_decode.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.
Using the Protocol Buffers compiler (protoc)
--------------------------------------------
The nanopb generator is implemented as a plugin for the Google's own protoc
compiler. This has the advantage that there is no need to reimplement the
basic parsing of .proto files. However, it does mean that you need the
Google's protobuf library in order to run the generator.
If you have downloaded a binary package for nanopb (either Windows, Linux or
Mac OS X version), the 'protoc' binary is included in the 'generator-bin'
folder. In this case, you are ready to go. Simply run this command:
generator-bin/protoc --nanopb_out=. myprotocol.proto
However, if you are using a git checkout or a plain source distribution, you
need to provide your own version of protoc and the Google's protobuf library.
On Linux, the necessary packages are protobuf-compiler and python-protobuf.
On Windows, you can either build Google's protobuf library from source or use
one of the binary distributions of it. In either case, if you use a separate
protoc, you need to manually give the path to nanopb generator:
protoc --plugin=protoc-gen-nanopb=nanopb/generator/protoc-gen-nanopb ...
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. 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.
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
protocol buffer 在单片机、arm等无操作系统上的工具库 nanopb-0.3.6。Nanopb is a plain-C implementation of Google's Protocol Buffers data format. It is targeted at 32 bit microcontrollers, but is also fit for other embedded systems with tight (2-10 kB ROM, <1 kB RAM) memory constraints.
资源推荐
资源详情
资源评论
收起资源包目录
protocol buffer 在单片机、arm等无操作系统上的工具库 nanopb-0.3.6 (314个子文件)
libcrypto.so.1.0.0 1.73MB
libssl.so.1.0.0 350KB
libbz2.so.1.0 64KB
libexpat.so.1 157KB
libgcc_s.so.1 112KB
libz.so.1 94KB
libtinfo.so.5 122KB
libreadline.so.6 241KB
libprotobuf.so.9 7.12MB
libprotoc.so.9 6.83MB
EarlywarningProto.proto.bak 489B
protoc-gen-nanopb.bat 435B
protoc.bin 115KB
pb_decode.c 41KB
pb_encode.c 20KB
encode_alltypes_callback.c 14KB
decode_unittests.c 14KB
decode_alltypes_callback.c 14KB
fuzztest.c 12KB
encode_unittests.c 11KB
EarthqukeProto.pb.c 10KB
alltypes_legacy.c 10KB
decode_alltypes.c 9KB
decode_alltypes_pointer.c 9KB
decode_legacy.c 8KB
encode_alltypes_pointer.c 8KB
intsizes_unittests.c 6KB
fuzzstub.c 6KB
mem_release.c 5KB
encode_alltypes.c 5KB
encode_legacy.c 5KB
server.c 4KB
client.c 4KB
encode_cyclic_callback.c 4KB
io_errors.c 3KB
decode_oneof.c 3KB
decode_callbacks.c 3KB
pb_common.c 3KB
decode.c 3KB
double_conversion.c 3KB
generate_message.c 3KB
encode_callbacks.c 2KB
encode.c 2KB
decode_buffer.c 2KB
simple.c 2KB
simple.c 2KB
enumsizes_unittests.c 2KB
decode_oneof.c 2KB
decode_stream.c 2KB
test_conversions.c 2KB
encode_oneof.c 2KB
decode_extensions.c 1KB
encode_extensions.c 1KB
missing_fields.c 1KB
enum_encoded_size.c 1KB
encode_stream.c 1KB
malloc_wrappers.c 1KB
encode_buffer.c 1KB
common.c 921B
decode_double.c 765B
encode_double.c 599B
test_multiple_files.c 521B
simple.pb.c 509B
size_corruption.c 213B
msg_size.c 129B
dummy.c 126B
FindNanopb.cmake 10KB
lsr.css 4KB
options.expected 437B
testproto.expected 211B
person_with_extra_field.expected 180B
extensionbug.expected 53B
comments.expected 32B
test.expected 29B
.gitignore 493B
pb.h 21KB
alltypes_legacy.h 11KB
EarthqukeProto.pb.h 10KB
pb_encode.h 6KB
pb_decode.h 5KB
pb_syshdr.h 2KB
pb_common.h 1KB
simple.pb.h 1KB
double_conversion.h 749B
malloc_wrappers_syshdr.h 353B
unittests.h 345B
test_helpers.h 268B
malloc_wrappers.h 197B
common.h 175B
library.json 673B
Makefile 1KB
Makefile 720B
Makefile 594B
Makefile 466B
Makefile 412B
Makefile 356B
Makefile 293B
Makefile 78B
README.md 3KB
CONTRIBUTING.md 1KB
共 314 条
- 1
- 2
- 3
- 4
资源评论
show3me
- 粉丝: 0
- 资源: 3
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 造价咨询薪酬管理办法.doc
- 中铁三局集团第二工程有限公司项目薪酬实施办法.doc
- 2025健康管理师三级专业能力考试题及答案.docx
- 2025健康素养知识竞赛题库(含答案).docx
- 2025交管12123驾驶证学法减分(学法免分)测试题及答案.docx
- 造价咨询公司绩效提成方案 (1).docx
- 造价咨询公司绩效提成方案.docx
- 工程造价咨询从业人员绩效考核制度.docx
- 造价咨询公司(咨询工作室)绩效提成方案-2018修订版 (1).docx
- 2025交管12123学法减分考试试题库及答案(通用版).docx
- 2025交管12123学法减分题库大全(附答案).docx
- 2025教师资格证结构化面试题库及答案.docx
- 2025教师招聘义务教育道德与法治课程方案(2022版)必考题库及答案.docx
- 2025教师资格证考试《教育知识与能力》知识点大全.docx
- 2025教育学公共基础知识考试题库及答案(通用版).docx
- 2025京东pop售前客服认证考试题及答案.docx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功