From bc03918ea49961cf35901e6e5a5e3241c6182290 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Wed, 8 Nov 2023 10:36:58 +1100 Subject: [PATCH] GCS_MAVLink: create and use AP_MAVLINK_MSG_UAVIONIX_ADSB_OUT_STATUS_ENABLED narrower define we can use when not compiling in the backends which use this --- libraries/GCS_MAVLink/GCS_Common.cpp | 4 ++-- libraries/GCS_MAVLink/GCS_config.h | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/libraries/GCS_MAVLink/GCS_Common.cpp b/libraries/GCS_MAVLink/GCS_Common.cpp index f501f7d465..8d2776681f 100644 --- a/libraries/GCS_MAVLink/GCS_Common.cpp +++ b/libraries/GCS_MAVLink/GCS_Common.cpp @@ -1062,7 +1062,7 @@ ap_message GCS_MAVLINK::mavlink_id_to_ap_message_id(const uint32_t mavlink_id) c #if AP_AIS_ENABLED { MAVLINK_MSG_ID_AIS_VESSEL, MSG_AIS_VESSEL}, #endif -#if HAL_ADSB_ENABLED +#if AP_MAVLINK_MSG_UAVIONIX_ADSB_OUT_STATUS_ENABLED { MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_STATUS, MSG_UAVIONIX_ADSB_OUT_STATUS}, #endif #if AP_MAVLINK_MSG_RELAY_STATUS_ENABLED @@ -6071,7 +6071,7 @@ bool GCS_MAVLINK::try_send_message(const enum ap_message id) } #endif -#if HAL_ADSB_ENABLED +#if AP_MAVLINK_MSG_UAVIONIX_ADSB_OUT_STATUS_ENABLED case MSG_UAVIONIX_ADSB_OUT_STATUS: CHECK_PAYLOAD_SIZE(UAVIONIX_ADSB_OUT_STATUS); send_uavionix_adsb_out_status(); diff --git a/libraries/GCS_MAVLink/GCS_config.h b/libraries/GCS_MAVLink/GCS_config.h index ae978c1253..7a9e38b519 100644 --- a/libraries/GCS_MAVLink/GCS_config.h +++ b/libraries/GCS_MAVLink/GCS_config.h @@ -79,6 +79,10 @@ #define AP_MAVLINK_MSG_SERIAL_CONTROL_ENABLED HAL_GCS_ENABLED #endif +#ifndef AP_MAVLINK_MSG_UAVIONIX_ADSB_OUT_STATUS_ENABLED +#define AP_MAVLINK_MSG_UAVIONIX_ADSB_OUT_STATUS_ENABLED HAL_ADSB_ENABLED +#endif + // GCS should be using MISSION_REQUEST_INT instead; this is a waste of // flash. MISSION_REQUEST was deprecated in June 2020. We started // sending warnings to the GCS in Sep 2022 if this command was used.