From 423daaa71f03118344c37a08dc9401a6a5925a7c Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Fri, 27 Sep 2024 11:01:24 +1000 Subject: [PATCH] GCS_MAVLink: split sending terrain report from terrain request --- libraries/GCS_MAVLink/GCS_Common.cpp | 6 ++++-- libraries/GCS_MAVLink/ap_message.h | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/libraries/GCS_MAVLink/GCS_Common.cpp b/libraries/GCS_MAVLink/GCS_Common.cpp index a564972a67..2fb3a3fa9c 100644 --- a/libraries/GCS_MAVLink/GCS_Common.cpp +++ b/libraries/GCS_MAVLink/GCS_Common.cpp @@ -1049,8 +1049,10 @@ ap_message GCS_MAVLINK::mavlink_id_to_ap_message_id(const uint32_t mavlink_id) c { MAVLINK_MSG_ID_RANGEFINDER, MSG_RANGEFINDER}, #endif { MAVLINK_MSG_ID_DISTANCE_SENSOR, MSG_DISTANCE_SENSOR}, - // request also does report: - { MAVLINK_MSG_ID_TERRAIN_REQUEST, MSG_TERRAIN}, +#if AP_TERRAIN_AVAILABLE + { MAVLINK_MSG_ID_TERRAIN_REQUEST, MSG_TERRAIN_REQUEST}, + { MAVLINK_MSG_ID_TERRAIN_REPORT, MSG_TERRAIN_REPORT}, +#endif #if AP_MAVLINK_BATTERY2_ENABLED { MAVLINK_MSG_ID_BATTERY2, MSG_BATTERY2}, #endif diff --git a/libraries/GCS_MAVLink/ap_message.h b/libraries/GCS_MAVLink/ap_message.h index 570c708f68..a14be7cd53 100644 --- a/libraries/GCS_MAVLink/ap_message.h +++ b/libraries/GCS_MAVLink/ap_message.h @@ -52,7 +52,8 @@ enum ap_message : uint8_t { MSG_WIND, MSG_RANGEFINDER, MSG_DISTANCE_SENSOR, - MSG_TERRAIN, + MSG_TERRAIN_REQUEST, + MSG_TERRAIN_REPORT, MSG_BATTERY2, MSG_CAMERA_FEEDBACK, MSG_CAMERA_INFORMATION,