We have been taking a look at the PPRZLINK library for generating C code to read telemetry messages over a serial port, from our Lisa/MX to an onboard single-board Linux computer. We've tried using the python gen_messages tool, but it seems to generate code for sending messages, rather than receiving and parsing them.
In particular, we are looking for a code generation tool that will parse our messages.xml file for the order of data fields and the size of each field in a message type, then generate a function to read a particular message type. Is this something that gen_messages.py does (are we missing something)? Is there another tool in PPRZLINK that can do this?
Re: [PPRZLINK] Code generation for receiving messages
PPRZLINK is generating both sending and reading macros and functions.
The reading macros are at the end of the file and they have the form:
So once you have extracted the payload part of the message (PPRZ_DATA in
http://wiki.paparazziuav.org/wiki/Messages_Format), you give this buffer
to the macro corresponding to the field you want to read and it returns
the value with correct type.