Skip to content

Commit

Permalink
AntennaTracker: Support new battery failsafes
Browse files Browse the repository at this point in the history
  • Loading branch information
WickedShell authored and OXINARF committed Mar 27, 2018
1 parent b761a57 commit a108ae8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion AntennaTracker/GCS_Mavlink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;}
5 changes: 4 additions & 1 deletion AntennaTracker/Tracker.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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);
Expand Down
7 changes: 7 additions & 0 deletions AntennaTracker/sensors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit a108ae8

Please sign in to comment.