mavlink: fixed WP upload

The previous code accepted arbitrary command codes here, and ACKed
them. Later we should specifically list which ones are OK
This commit is contained in:
Andrew Tridgell 2011-10-26 12:18:24 +11:00
parent 92bd8b5d8b
commit 2b9daf65ff
1 changed files with 8 additions and 0 deletions

View File

@ -1537,6 +1537,12 @@ void GCS_MAVLINK::handleMessage(mavlink_message_t* msg)
if (result != MAV_MISSION_ACCEPTED) goto mission_failed;
switch (tell_command.id) { // Switch to map APM command fields inot MAVLink command fields
case MAV_CMD_NAV_WAYPOINT:
case MAV_CMD_NAV_LOITER_UNLIM:
case MAV_CMD_NAV_RETURN_TO_LAUNCH:
case MAV_CMD_NAV_LAND:
break;
case MAV_CMD_NAV_LOITER_TURNS:
case MAV_CMD_NAV_TAKEOFF:
case MAV_CMD_DO_SET_HOME:
@ -1578,7 +1584,9 @@ void GCS_MAVLINK::handleMessage(mavlink_message_t* msg)
break;
default:
#ifdef MAVLINK10
result = MAV_MISSION_UNSUPPORTED;
#endif
break;
}