mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-21 16:18:29 -04:00
AP_ADSB: create an enum class for logging
This commit is contained in:
parent
40cdb5d01e
commit
37109e649e
@ -828,17 +828,17 @@ bool AP_ADSB::get_vehicle_by_ICAO(const uint32_t icao, adsb_vehicle_t &vehicle)
|
||||
*/
|
||||
void AP_ADSB::write_log(const adsb_vehicle_t &vehicle) const
|
||||
{
|
||||
switch (_log) {
|
||||
case logging::SPECIAL_ONLY:
|
||||
switch ((Logging)_log) {
|
||||
case Logging::SPECIAL_ONLY:
|
||||
if (!is_special_vehicle(vehicle.info.ICAO_address)) {
|
||||
return;
|
||||
}
|
||||
break;
|
||||
|
||||
case logging::ALL:
|
||||
case Logging::ALL:
|
||||
break;
|
||||
|
||||
case logging::NONE:
|
||||
case Logging::NONE:
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
@ -288,13 +288,13 @@ private:
|
||||
void push_sample(const adsb_vehicle_t &vehicle);
|
||||
|
||||
// logging
|
||||
AP_Int8 _log;
|
||||
void write_log(const adsb_vehicle_t &vehicle) const;
|
||||
enum logging {
|
||||
enum class Logging {
|
||||
NONE = 0,
|
||||
SPECIAL_ONLY = 1,
|
||||
ALL = 2
|
||||
};
|
||||
AP_Enum<Logging> _log;
|
||||
|
||||
// reference to backend
|
||||
AP_ADSB_Backend *_backend[ADSB_MAX_INSTANCES];
|
||||
|
Loading…
Reference in New Issue
Block a user