[PPRZLINK] Code generation for receiving messages

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[PPRZLINK] Code generation for receiving messages

cxiao
Hi all,

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?

Best,
Cindy
Reply | Threaded
Open this post in threaded view
|

Re: [PPRZLINK] Code generation for receiving messages

Gautier Hattenberger-3
Hello,

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:

DL_<MSG_NAME>_<field_name>(payload)

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.

Gautier

Le 17/03/2016 23:45, cxiao a écrit :

> Hi all,
>
> 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
> <https://github.com/paparazzi/pprzlink/blob/master/tools/generator/gen_messages.py>
> , 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?
>
> Best,
> Cindy
>
>
>
> --
> View this message in context: http://lists.paparazziuav.org/PPRZLINK-Code-generation-for-receiving-messages-tp17803.html
> Sent from the paparazzi-devel mailing list archive at Nabble.com.
>
> _______________________________________________
> Paparazzi-devel mailing list
> [hidden email]
> https://lists.nongnu.org/mailman/listinfo/paparazzi-devel


_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel