How to control drone's gimbal

I need to know for a gimbal and camera that are not mavlink compatible, what are the ways/what is the communication protocol to control such a gimbal and camera from code?

Thanks in advance.