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
This commit is contained in:
Peter Barker 2023-11-08 10:36:58 +11:00 committed by Peter Barker
parent 232edac8d7
commit bc03918ea4
2 changed files with 6 additions and 2 deletions

View File

@ -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();

View File

@ -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.