Line data Source code
1 : /* 2 : SITL airspeed backend - a perfect airspeed sensor 3 : */ 4 : #pragma once 5 : 6 : #include "AP_Airspeed_config.h" 7 : 8 : #if AP_AIRSPEED_SITL_ENABLED 9 : 10 : #include <AP_HAL/AP_HAL.h> 11 : #include "AP_Airspeed_Backend.h" 12 : 13 : class AP_Airspeed_SITL : public AP_Airspeed_Backend 14 : { 15 : public: 16 : 17 : using AP_Airspeed_Backend::AP_Airspeed_Backend; 18 : 19 6 : bool init(void) override { 20 6 : set_bus_id(AP_HAL::Device::make_bus_id( 21 : AP_HAL::Device::BUS_TYPE_SITL, 22 : 0, 23 : 0, 24 : uint8_t(DevType::SITL) 25 : )); 26 6 : return true; 27 : } 28 : 29 : // return the current differential_pressure in Pascal 30 : bool get_differential_pressure(float &pressure) override; 31 : 32 : // temperature not available via analog backend 33 : bool get_temperature(float &temperature) override; 34 : 35 : private: 36 : }; 37 : 38 : #endif // AP_AIRSPEED_SITL_ENABLED