How to package data using C language mavlink library

images

Downloaded MAVLINK protocol C language library function from Mavlink.org.
My requirement is to use the microcontroller to send data packets to the aircraft and change the position of the aircraft HOME so that it can always follow my car.
But I didn’t find a more suitable routine. There is no more detailed description of the communication method with the aircraft. Need help. Has anyone done similar development?

		l = mavlink_msg_command_int_pack(0xa8, 0XBE, &msg,
			1, 1, 0,
			0, 0, 0,
			0, 0, 0, 0, 0x12178EE1   , 0x478B23B3   , 156);
		l = mavlink_msg_to_send_buffer(sendda,&msg);
		HAL_UART_Transmit(&huart2, sendda, l, 100);

There is no response to random packaging and sending like this

We did that in 2016 for the first time and countless other people also do it daily.

You should read the documentation of FOLLOW_ME flight mode.

Thank you for your reply.
Thank you very much, I passed through https://ardupilot.org/dev/docs/mavlink-get-set-home-and-origin.html I saw the use of this command and successfully ran it in C language, and changed the location of my home in the simulator.
The official website of AP is clearer than the official website of MAVLINK. Because the regular values on the right are clearer than what they write. The instructions on the mavlink official website left me completely unsure of what to write in the first few parameters of the function.


https://mavlink.io/en/services/mission.html
I found the development instructions here, which are quite detailed. But for personnel in other non drone development industries, it still takes a long time to understand these things and debug them function by function. But it’s better than nothing. Just spend more time