tree: 0e1683d1296a3844beb9829e44c02ab550e4f278 [path history] [tgz]
  1. include/
  2. src/
  3. CMakeLists.txt
  4. LICENSE_BSD2.txt


A interface between sel4 IPC buffers and nanopb.


Nanopb is a small code-size Protocol Buffers implementation in ANSI C. The nanopb generator is implemented as a plug-in for the Google's own protoc compiler. Therefore, you need Google's Protocol Buffers installed in order to run the generator.

This library

Nanopb uses streams for accessing the data in encoded format. This library implements a simple wrapper which allows you to treat the IPC message buffer as a protobuf stream.

Message message = Message_init_zero;
message.somepart = content;
pb_ostream_t output = pb_ostream_from_IPC(0);
if (!pb_encode_delimited(&output, Control_fields, &ctrlmsg))
    ZF_LOGE("Encoding failed: %s\n", PB_GET_ERROR(&output));