From 5848d8a5e6d86d7a051cf5103253bd2b277be94d Mon Sep 17 00:00:00 2001 From: Michael Oborne Date: Tue, 8 Mar 2016 10:41:11 +0800 Subject: [PATCH] ArduCopter: support MAVLINK_MSG_ID_MISSION_ITEM_INT --- ArduCopter/GCS_Mavlink.cpp | 11 ++++++++++- ArduCopter/capabilities.cpp | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ArduCopter/GCS_Mavlink.cpp b/ArduCopter/GCS_Mavlink.cpp index 900383ed85..b764e3a45a 100644 --- a/ArduCopter/GCS_Mavlink.cpp +++ b/ArduCopter/GCS_Mavlink.cpp @@ -1070,9 +1070,18 @@ void GCS_MAVLINK::handleMessage(mavlink_message_t* msg) } break; } + + case MAVLINK_MSG_ID_MISSION_ITEM_INT: + { + if (handle_mission_item(msg, copter.mission)) { + copter.DataFlash.Log_Write_EntireMission(copter.mission); + } + break; + } // read an individual command from EEPROM and send it to the GCS - case MAVLINK_MSG_ID_MISSION_REQUEST: // MAV ID: 40 + case MAVLINK_MSG_ID_MISSION_REQUEST_INT: + case MAVLINK_MSG_ID_MISSION_REQUEST: // MAV ID: 40, 51 { handle_mission_request(copter.mission, msg); break; diff --git a/ArduCopter/capabilities.cpp b/ArduCopter/capabilities.cpp index e80fabea93..238a7ffddf 100644 --- a/ArduCopter/capabilities.cpp +++ b/ArduCopter/capabilities.cpp @@ -6,6 +6,7 @@ void Copter::init_capabilities(void) { hal.util->set_capabilities(MAV_PROTOCOL_CAPABILITY_MISSION_FLOAT); hal.util->set_capabilities(MAV_PROTOCOL_CAPABILITY_PARAM_FLOAT); + hal.util->set_capabilities(MAV_PROTOCOL_CAPABILITY_MISSION_INT); hal.util->set_capabilities(MAV_PROTOCOL_CAPABILITY_SET_POSITION_TARGET_LOCAL_NED); hal.util->set_capabilities(MAV_PROTOCOL_CAPABILITY_SET_POSITION_TARGET_GLOBAL_INT); hal.util->set_capabilities(MAV_PROTOCOL_CAPABILITY_FLIGHT_TERMINATION);