Files
mavlink/examples/c
Julian Oes f9dbd8c496 C example fixup (#2333)
* udp_example: add missing include

* udp_example: return on error

Otherwise we set src_addr_set even though it's still unknown.
2025-08-14 14:33:16 +10:00
..
2023-05-04 09:44:41 +10:00
2023-05-04 09:44:41 +10:00
2025-08-14 14:33:16 +10:00

Simple C example

Simple example receiving and sending MAVLink v2 over UDP based on POSIX APIs (e.g. Linux, BSD, macOS).

In top level directory, build and install the MAVLink headers locally into the install folder:

cmake -Bbuild -H. -DCMAKE_INSTALL_PREFIX=install
cmake --build build --target install

Build example

In the example directory, build the example while passing the local install directory:

cd examples/c
cmake -Bbuild -H. -DCMAKE_PREFIX_PATH=$(pwd)/../../install
cmake --build build