mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-21 23:33:57 -04:00
AP_ExternalAHRS: add get_name function for reporting
This commit is contained in:
parent
33b09ff0cb
commit
ec1814da34
@ -213,6 +213,15 @@ void AP_ExternalAHRS::update(void)
|
||||
}
|
||||
}
|
||||
|
||||
// Get model/type name
|
||||
const char* AP_ExternalAHRS::get_name() const
|
||||
{
|
||||
if (backend) {
|
||||
return backend->get_name();
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
namespace AP {
|
||||
|
||||
AP_ExternalAHRS &externalAHRS()
|
||||
|
@ -55,6 +55,9 @@ public:
|
||||
return rate.get();
|
||||
}
|
||||
|
||||
// Get model/type name
|
||||
const char* get_name() const;
|
||||
|
||||
// get serial port number, -1 for not enabled
|
||||
int8_t get_port(void) const;
|
||||
|
||||
|
@ -440,6 +440,12 @@ int8_t AP_ExternalAHRS_LORD::get_port(void) const
|
||||
return port_num;
|
||||
};
|
||||
|
||||
// Get model/type name
|
||||
const char* AP_ExternalAHRS_LORD::get_name() const
|
||||
{
|
||||
return "LORD";
|
||||
}
|
||||
|
||||
bool AP_ExternalAHRS_LORD::healthy(void) const
|
||||
{
|
||||
uint32_t now = AP_HAL::millis();
|
||||
|
@ -35,6 +35,9 @@ public:
|
||||
// get serial port number, -1 for not enabled
|
||||
int8_t get_port(void) const override;
|
||||
|
||||
// Get model/type name
|
||||
const char* get_name() const override;
|
||||
|
||||
// accessors for AP_AHRS
|
||||
bool healthy(void) const override;
|
||||
bool initialised(void) const override;
|
||||
|
@ -29,6 +29,9 @@ public:
|
||||
// get serial port number, -1 for not enabled
|
||||
virtual int8_t get_port(void) const { return -1; }
|
||||
|
||||
// Get model/type name
|
||||
virtual const char* get_name() const = 0;
|
||||
|
||||
// accessors for AP_AHRS
|
||||
virtual bool healthy(void) const = 0;
|
||||
virtual bool initialised(void) const = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user