Comunication b/w flight controller and CC without MAVLINK

I want to send the data from companion computer to flight controller, how can I do that ?
I read this article, which was helpful, but I dont want to use MAVLINK, is there any other way where I can send and receive data only from UART?

if I want to use my custom protocol, where should I write the code of it in ardupilot repository?

You would need to use lua scripting, no need to change the C++ source code for that:

But usually MAVLink is a better way.

ok thanks, I will look into this article.

Can I test these lua scripts on SITL ??

Yes. You can do it the same way as on a real vehicle.

Thankyou so much, I have understood eveything