From c46de4a9a036adaeb3afe5c31ca04a5df70d3a3c Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Thu, 29 Mar 2018 12:03:21 +1100 Subject: [PATCH] Tracker: GCS_MAVLink takes care of mavlink capabilities --- AntennaTracker/GCS_Mavlink.cpp | 7 +++++++ AntennaTracker/GCS_Mavlink.h | 1 + AntennaTracker/Tracker.h | 3 --- AntennaTracker/capabilities.cpp | 7 ------- AntennaTracker/system.cpp | 2 -- 5 files changed, 8 insertions(+), 12 deletions(-) delete mode 100644 AntennaTracker/capabilities.cpp diff --git a/AntennaTracker/GCS_Mavlink.cpp b/AntennaTracker/GCS_Mavlink.cpp index c9e3e90841..0696ef7c65 100644 --- a/AntennaTracker/GCS_Mavlink.cpp +++ b/AntennaTracker/GCS_Mavlink.cpp @@ -530,6 +530,13 @@ mission_failed: } // end handle mavlink +uint64_t GCS_MAVLINK_Tracker::capabilities() const +{ + return (MAV_PROTOCOL_CAPABILITY_PARAM_FLOAT | + MAV_PROTOCOL_CAPABILITY_COMPASS_CALIBRATION | + GCS_MAVLINK::capabilities()); +} + /* * a delay() callback that processes MAVLink packets. We set this as the * callback in long running library initialisation routines to allow diff --git a/AntennaTracker/GCS_Mavlink.h b/AntennaTracker/GCS_Mavlink.h index 0c11f46867..fda4513635 100644 --- a/AntennaTracker/GCS_Mavlink.h +++ b/AntennaTracker/GCS_Mavlink.h @@ -30,6 +30,7 @@ protected: bool set_home_to_current_location(bool lock) override WARN_IF_UNUSED { return false; } bool set_home(const Location& loc, bool lock) override WARN_IF_UNUSED { return false; } + uint64_t capabilities() const override; void send_nav_controller_output() const override; diff --git a/AntennaTracker/Tracker.h b/AntennaTracker/Tracker.h index c698cd7803..9f626b3c40 100644 --- a/AntennaTracker/Tracker.h +++ b/AntennaTracker/Tracker.h @@ -202,9 +202,6 @@ private: void one_second_loop(); void ten_hz_logging_loop(); - // capabilities.cpp - void init_capabilities(void); - // control_auto.cpp void update_auto(void); void calc_angle_error(float pitch, float yaw, bool direction_reversed); diff --git a/AntennaTracker/capabilities.cpp b/AntennaTracker/capabilities.cpp deleted file mode 100644 index 2999fb6477..0000000000 --- a/AntennaTracker/capabilities.cpp +++ /dev/null @@ -1,7 +0,0 @@ -#include "Tracker.h" - -void Tracker::init_capabilities(void) -{ - hal.util->set_capabilities(MAV_PROTOCOL_CAPABILITY_PARAM_FLOAT | - MAV_PROTOCOL_CAPABILITY_COMPASS_CALIBRATION); -} diff --git a/AntennaTracker/system.cpp b/AntennaTracker/system.cpp index 5f2ebbe3f7..251e3a32c2 100644 --- a/AntennaTracker/system.cpp +++ b/AntennaTracker/system.cpp @@ -17,8 +17,6 @@ void Tracker::init_tracker() AP::fwversion().fw_string, (unsigned)hal.util->available_memory()); - init_capabilities(); - // Check the EEPROM format version before loading any parameters from EEPROM load_parameters();