GCS_MAVLink: move update_sensor_status_flags into GCS subclasses

This commit is contained in:
Peter Barker 2019-02-14 12:59:00 +11:00 committed by Peter Barker
parent bb706305d0
commit 8de4ee7348
3 changed files with 20 additions and 2 deletions

View File

@ -2,6 +2,17 @@
extern const AP_HAL::HAL& hal;
void GCS::get_sensor_status_flags(uint32_t &present,
uint32_t &enabled,
uint32_t &health)
{
update_sensor_status_flags();
present = control_sensors_present;
enabled = control_sensors_enabled;
health = control_sensors_health;
}
/*
send a text message to all GCS
*/

View File

@ -774,7 +774,14 @@ public:
// update uart pass-thru
void update_passthru();
virtual void get_sensor_status_flags(uint32_t &present, uint32_t &enabled, uint32_t &health) = 0;
void get_sensor_status_flags(uint32_t &present, uint32_t &enabled, uint32_t &health);
protected:
uint32_t control_sensors_present;
uint32_t control_sensors_enabled;
uint32_t control_sensors_health;
virtual void update_sensor_status_flags(void) = 0;
private:

View File

@ -54,5 +54,5 @@ class GCS_Dummy : public GCS
void send_statustext(MAV_SEVERITY severity, uint8_t dest_bitmask, const char *text) { hal.console->printf("TOGCS: %s\n", text); }
void get_sensor_status_flags(uint32_t &present, uint32_t &enabled, uint32_t &health) override { present = 0; enabled = 0; health = 0; }
void update_sensor_status_flags(void) override {};
};