Use Mavlink in own program


i’m new here.
I hope you can mehr help.
I will implement the Mavlink protocol in my own application.
I implemented the files “#include “Mavlink/common/mavlink.h” from into my project with add the line”#include “Mavlink/common/mavlink.h”" to my project.
Now i will use it but my problem i have only *.h files.

If i will generate the heatbeat messages i guess i use the function

static inline void mavlink_msg_heartbeat_send(mavlink_channel_t chan, uint8_t type, uint8_t autopilot, uint8_t base_mode, uint32_t custom_mode, uint8_t system_status)

Here the sub function “_mav_finalize_message_chan_send” is used for sending the messages out.
Bui i fount this function (_mav_finalize_message_chan_send) not on my system

Can someon help me?



First off you need to include mavlink/ardupilotmega/mavlink.h and yes it is a .h library only, no .cpp files are included.
But all you need is to use the functions defined in the library.

I do not understand why are you trying to call mavfinalize_message_chan_send()


if i call the function mavlink_msg_heartbeat_pack() i get the messages back.
How i get the messages ready to send.
I mean how can i create the stream for send over the serial interface?

If i call the function mavlink_msg_heartbeat_send() i found the sub function _mav_finalize_message_chan_send().

Or maybe i’m wrong.
How can i send the messages over serial interface.