AntennaTracker: Support new battery failsafes

This commit is contained in:
Michael du Breuil 2018-03-01 20:38:30 -07:00 committed by Francisco Ferreira
parent b761a57da3
commit a108ae8f1e
3 changed files with 12 additions and 2 deletions

View File

@ -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;}

View File

@ -151,7 +151,9 @@ private:
#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 @@ private:
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);

View File

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