So I am using mavlink c_library_v2, Atmel Studios 7, ATMega 328PB, and I am trying to figure out which packing function to use. I have been reading the MAVLink and Arduino: step by step. Unfortunately, they are only interacting with the pixhawk, where I am trying to send data to the GCS. Still it helped me understand MAVlink a little better. According to this article on https://ardupilot.org/dev/docs/mavlink-routing-in-ardupilot.html, as long as the target_system is not set or is 0 it will get routed to the other telem port.
My issue is I am using mavlink_msg_data64_pack() from the ardupilotmega.h file, and it will not proceed past this function. It doesn’t have a target system parameter, and I will be eventually sending 2 float values so 64 bits is perfect. I am unsure what other pack I should use because I have looked through all the other possibilities. The only alternative I am thinking is using the log pack? Which resides in the common folder, but I am just unsure.
Reading all the posts, it seems like it should be as easy as packing, msg->buffer, then send it over to UART and have it automatically routed to the GCS through telemetry. Then it should apparently appear in tlog files according to https://ardupilot.org/planner/docs/common-mission-planner-telemetry-logs.html.