|
Project Information
Featured
Downloads
|
What is Protobuf-Embedded-C ?A protocol buffers generator for resource constrained embedded applications written in the C programming language. For example, you may employ Protobuf-Embedded-C to let tiny embedded devices communicate directly with each other or with servers running large scale business applications. These following guidelines drive Protobuf-Embedded-C:
Please note, that these guidelines imply reduced functionality, yet powerful enough to get the typical protobuf communication jobs done. New and NoteworthyProtobuf-Embedded-C Milestone 1.0M2 is available! The new version can be downloaded from here. Compared to the previous release, the current version implements the following new features:
PublicationsWolfgang Schwitzer and Vlad Popa. Using Protocol Buffers for Resource-Constrained Distributed Embedded Systems. Technical Report TUM-I1120, Technische Universitaet Muenchen, 2011. Download.... Quick ExampleWriting the Proto FileSuppose you write a file phone.proto like this: //File: phone.proto
//
//Optional Embedded C internal options:
//@max_repeated_length=100
//@max_string_length=32
enum PhoneType {
MOBILE = 0;
HOME = 1;
WORK = 2;
}
message PhoneNumber {
required string number = 1;
required PhoneType type = 2;
}Compiling the Proto FileNext, call the protoc compiler from the command line like this: java -jar protoc-1.0M2.jar phone.proto Be sure to have java (1.6), protoc-1.0M2.jar and phone.proto in your path. Exploring the Generated APINow, you should see the files phone.c and phone.h next to phone.proto, where phone.h provides you with the API to deal with PhoneNumber messages. The generated file phone.h will look similar like this: /* Excerpt from generated file: phone.h */
#define MAX_REPEATED_LEN 100
#define MAX_STRING_LEN 32
enum PhoneType {
_MOBILE = 0,
_HOME = 1,
_WORK = 2
};
#define MAX_PhoneNumber_SIZE 40
struct PhoneNumber {
int _number_len;
char _number[MAX_STRING_LEN];
enum PhoneType _type;
};
int PhoneNumber_write_delimited_to(struct PhoneNumber *_PhoneNumber, void *_buffer, int offset);
int PhoneNumber_read_delimited_from(void *_buffer, struct PhoneNumber *_PhoneNumber, int offset);Which platforms is Protobuf-Embedded-C running on ?Protobuf-Embedded-C has been reported to run successfully on the following target platform so far: ARM Cortex M3, TI MSP430F5438, IA32 (in-the-loop tests). Milestone Plan
API Compliance
Codebase Statistics and Progress
Who are the people behind Protobuf-Embedded-C ?Protobuf-Embedded-C is developed by the embedded systems research group of the Chair IV - Software & Systems Engineering at the Technische Universität München (TUM), Germany. Parts of Protobuf-Embedded-C have been developed in the context of the embedded systems research project SPES2020. Disclaimer: Note that any (registered) trademarks on this website like Google, ARM, TI, Intel and others belong to their respective owners. |