How to switch to Offboard mode through mavlink?

You can refer the answer.