PX4/Firmware — pull request #791 by julianoes (2014-04-03 19:24:37+00:00)
Title: Mavlink broadcast

This brings the possiblity to forward mavlink messages from one mavlink instance to another (or all others).
A usecase is the communication with an onboard computer (such as an Odroid) over the same serial connection as the FMU for parameters, commands and logs.

The option is disabled by default and can be enabled with two flags:
Forward incoming messages to other mavlink instances:

-f

Pass messages from other mavlink instances on over the serial connection:

-p

To enable the communication in both directions, start both (all) mavlink instances with:

-p -f

Thanks @DrTon for the help with implementing the buffer (and synchronisation) between the instances.

This has been successfully tested using 2 mavlink instances.
However, I'd appreciate a review to make sure I didn't screw up the locking, etc.

Also, the incoming buffer per instance is currently hardcoded at 500 bytes, maybe this needs a commandline option as well.