diff --git a/AntennaTracker/GCS_Mavlink.cpp b/AntennaTracker/GCS_Mavlink.cpp index bb4a3d8ada0cd8..32b2001bf0af86 100644 --- a/AntennaTracker/GCS_Mavlink.cpp +++ b/AntennaTracker/GCS_Mavlink.cpp @@ -826,4 +826,4 @@ void AP_Camera::send_feedback(mavlink_channel_t chan) {} /* end dummy methods to avoid having to link against AP_Camera */ // dummy method to avoid linking AFS -bool AP_AdvancedFailsafe::gcs_terminate(bool should_terminate) {return false;} +bool AP_AdvancedFailsafe::gcs_terminate(bool should_terminate, const char *reason) {return false;} diff --git a/AntennaTracker/Tracker.h b/AntennaTracker/Tracker.h index 89a63db8b12ad5..a1820981cac584 100644 --- a/AntennaTracker/Tracker.h +++ b/AntennaTracker/Tracker.h @@ -151,7 +151,9 @@ class Tracker : public AP_HAL::HAL::Callbacks { #endif // Battery Sensors - AP_BattMonitor battery{MASK_LOG_CURRENT}; + AP_BattMonitor battery{MASK_LOG_CURRENT, + FUNCTOR_BIND_MEMBER(&Tracker::handle_battery_failsafe, void, const char*, const int8_t), + nullptr}; struct Location current_loc; @@ -263,6 +265,7 @@ class Tracker : public AP_HAL::HAL::Callbacks { void Log_Write_Vehicle_Startup_Messages(); void log_init(void); bool should_log(uint32_t mask); + void handle_battery_failsafe(const char* type_str, const int8_t action); public: void mavlink_snoop(const mavlink_message_t* msg); diff --git a/AntennaTracker/sensors.cpp b/AntennaTracker/sensors.cpp index cfb2e3818f3d92..23f8e6a6570ec5 100644 --- a/AntennaTracker/sensors.cpp +++ b/AntennaTracker/sensors.cpp @@ -127,3 +127,10 @@ void Tracker::update_GPS(void) } } +void Tracker::handle_battery_failsafe(const char* type_str, const int8_t action) +{ + // NOP + // useful failsafes in the future would include actually recalling the vehicle + // that is tracked before the tracker loses power to continue tracking it +} +