Line data Source code
1 : /* 2 : This program is free software: you can redistribute it and/or modify 3 : it under the terms of the GNU General Public License as published by 4 : the Free Software Foundation, either version 3 of the License, or 5 : (at your option) any later version. 6 : 7 : This program is distributed in the hope that it will be useful, 8 : but WITHOUT ANY WARRANTY; without even the implied warranty of 9 : MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 : GNU General Public License for more details. 11 : 12 : You should have received a copy of the GNU General Public License 13 : along with this program. If not, see <http://www.gnu.org/licenses/>. 14 : */ 15 : /* 16 : Base class for serial rangefinders 17 : */ 18 : 19 : #pragma once 20 : 21 : #include "SIM_Aircraft.h" 22 : 23 : #include <SITL/SITL.h> 24 : 25 : #include "SIM_SerialDevice.h" 26 : 27 : namespace SITL { 28 : 29 : class Frsky : public SerialDevice { 30 : public: 31 : 32 0 : Frsky() {}; 33 : 34 : // update state 35 : virtual void update() = 0; 36 : 37 : protected: 38 : 39 : enum class DataID { 40 : GPS_ALT_BP = 0x01, 41 : TEMP1 = 0x02, 42 : FUEL = 0x04, 43 : TEMP2 = 0x05, 44 : GPS_ALT_AP = 0x09, 45 : BARO_ALT_BP = 0x10, 46 : GPS_SPEED_BP = 0x11, 47 : GPS_LONG_BP = 0x12, 48 : GPS_LAT_BP = 0x13, 49 : GPS_COURS_BP = 0x14, 50 : GPS_SPEED_AP = 0x19, 51 : GPS_LONG_AP = 0x1A, 52 : GPS_LAT_AP = 0x1B, 53 : BARO_ALT_AP = 0x21, 54 : GPS_LONG_EW = 0x22, 55 : GPS_LAT_NS = 0x23, 56 : CURRENT = 0x28, 57 : VFAS = 0x39, 58 : }; 59 : 60 : const char *dataid_string(DataID id); 61 : }; 62 : 63 : }