I am testing the codes in SITL simulator. I used this command to clear missions in ardupilot before loading new missions.
the_connection.mav.mission_clear_all_send(1,1,0)
The mission types are all Mission.
After doing this a number of times. There will comes a problem where it will not be able to clear mission anymore.
It will comes with
MAV_MISSION_ERROR
I tried clearing
the_connection.mav.mission_clear_all_send(1,1,255)
It comes with error 3 which says the command is unsupported
Anyone knows why the Mission Clear all command will generate errors after a few try