From 54b714a24e20f1208fdba233801ca7c1e8082d0a Mon Sep 17 00:00:00 2001 From: Randy Mackay Date: Fri, 24 Jul 2020 17:40:49 +0900 Subject: [PATCH] Copter: implement send_winch_status --- ArduCopter/GCS_Mavlink.cpp | 13 +++++++++++++ ArduCopter/GCS_Mavlink.h | 1 + 2 files changed, 14 insertions(+) diff --git a/ArduCopter/GCS_Mavlink.cpp b/ArduCopter/GCS_Mavlink.cpp index cd9db07202..b7bc4d17c0 100644 --- a/ArduCopter/GCS_Mavlink.cpp +++ b/ArduCopter/GCS_Mavlink.cpp @@ -229,6 +229,18 @@ void GCS_MAVLINK_Copter::send_pid_tuning() } } +// send winch status message +void GCS_MAVLINK_Copter::send_winch_status() const +{ +#if WINCH_ENABLED == ENABLED + AP_Winch *winch = AP::winch(); + if (winch == nullptr) { + return; + } + winch->send_status(*this); +#endif +} + uint8_t GCS_MAVLINK_Copter::sysid_my_gcs() const { return copter.g.sysid_my_gcs; @@ -445,6 +457,7 @@ static const ap_message STREAM_EXTRA3_msgs[] = { MSG_RPM, MSG_ESC_TELEMETRY, MSG_GENERATOR_STATUS, + MSG_WINCH_STATUS, }; static const ap_message STREAM_PARAMS_msgs[] = { MSG_NEXT_PARAM diff --git a/ArduCopter/GCS_Mavlink.h b/ArduCopter/GCS_Mavlink.h index 1ac207db9e..44abe8593b 100644 --- a/ArduCopter/GCS_Mavlink.h +++ b/ArduCopter/GCS_Mavlink.h @@ -65,4 +65,5 @@ private: void send_pid_tuning() override; + void send_winch_status() const override; };