0

Is there a Protocol Buffers implementation, or alternative, for C99, which works with statically allocated data, without the need for malloc?

I.e. if all my structs have fixed length arrays:

// this could be autogenerated using a tool, like in protobuf struct some_struct { size_t names_len; int names[MAX_NAMES_LEN]; size_t addresses_len; int addresses[MAX_ADDRESSES_LEN]; }; 

Is there a library/framework for C which would allow serialization of such structures, without the need to write extra code?

(needless to say, it's a project with many such structs, and we would like to avoid writing serializers by hand)

1 Answer 1

1

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.

https://github.com/nanopb/nanopb

It lacks some of the original protocol buffers specifications such as services so it's not suitable to run RPC with it

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.