1<!-- 2 Copyright 2019, Data61, CSIRO (ABN 41 687 119 230) 3 4 SPDX-License-Identifier: CC-BY-SA-4.0 5--> 6 7# libsel4nanopb 8 9A interface between sel4 IPC buffers and nanopb. 10### Nanopb 11Nanopb is a small code-size Protocol Buffers implementation in ANSI C. 12The nanopb generator is implemented as a plug-in for the Google's own protoc compiler. 13Therefore, you need [Google's Protocol Buffers](https://developers.google.com/protocol-buffers/docs/reference/overview) installed in order to run the generator. 14 15### This library 16Nanopb uses streams for accessing the data in encoded format. This library implements a simple wrapper 17which allows you to treat the IPC message buffer as a protobuf stream. 18``` 19Message message = Message_init_zero; 20message.somepart = content; 21pb_ostream_t output = pb_ostream_from_IPC(0); 22if (!pb_encode_delimited(&output, Control_fields, &ctrlmsg)) 23{ 24 ZF_LOGE("Encoding failed: %s\n", PB_GET_ERROR(&output)); 25} 26``` 27