2 * Author - Bertrand Songis <bsongis@gmail.com>
4 * Based on th9x -> http://code.google.com/p/th9x/
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
17 #ifndef opentx_interface_h
18 #define opentx_interface_h
20 #include "eeprominterface.h"
24 class OpenTxEepromInterface
: public EEPROMInterface
28 OpenTxEepromInterface(BoardEnum board
);
30 virtual ~OpenTxEepromInterface();
32 virtual const int getEEpromSize();
34 virtual const int getMaxModels();
36 virtual unsigned long load(RadioData
&, const uint8_t *eeprom
, int size
);
38 virtual unsigned long loadBackup(RadioData
&, uint8_t *eeprom
, int esize
, int index
);
40 virtual unsigned long loadxml(RadioData
&radioData
, QDomDocument
&doc
);
42 virtual int save(uint8_t *eeprom
, RadioData
&radioData
, uint32_t variant
=0, uint8_t version
=0);
44 virtual int getSize(const ModelData
&);
46 virtual int getSize(const GeneralSettings
&);
50 const char * getName();
52 EepromLoadErrors
checkVersion(unsigned int version
);
54 bool checkVariant(unsigned int version
, unsigned int variant
);
57 bool loadModel(ModelData
&model
, uint8_t *data
, int index
, unsigned int stickMode
=0);
60 bool loadModelVariant(unsigned int index
, ModelData
&model
, uint8_t *data
, unsigned int version
, unsigned int variant
);
62 bool loadModel(uint8_t version
, ModelData
&model
, uint8_t *data
, int index
, unsigned int variant
, unsigned int stickMode
=0);
65 bool saveModel(unsigned int index
, ModelData
&model
, unsigned int version
, unsigned int variant
);
68 bool loadGeneral(GeneralSettings
&settings
, unsigned int version
);
71 bool saveGeneral(GeneralSettings
&settings
, BoardEnum board
, uint32_t version
, uint32_t variant
);
77 class OpenTxFirmware
: public Firmware
{
79 OpenTxFirmware(const QString
& id
, OpenTxFirmware
* parent
):
80 Firmware(parent
, id
, parent
->getName(), parent
->getBoard(), parent
->eepromInterface
)
84 OpenTxFirmware(const QString
& id
, const QString
& name
, const BoardEnum board
):
85 Firmware(id
, name
, board
, new OpenTxEepromInterface(board
))
100 addTTSLanguage("de");
101 addTTSLanguage("es");
102 addTTSLanguage("fr");
103 addTTSLanguage("hu");
104 addTTSLanguage("it");
105 addTTSLanguage("nl");
106 addTTSLanguage("pl");
107 addTTSLanguage("pt");
108 addTTSLanguage("se");
109 addTTSLanguage("sk");
112 virtual Firmware
* getFirmwareVariant(const QString
& id
);
114 virtual QString
getStampUrl();
116 virtual QString
getReleaseNotesUrl();
118 virtual QString
getFirmwareUrl();
120 virtual int getCapability(Capability
);
122 virtual Switch
getSwitch(unsigned int index
);
124 virtual QTime
getMaxTimerStart();
126 virtual bool isTelemetrySourceAvailable(int source
);
128 virtual int isAvailable(PulsesProtocol proto
, int port
=0);
132 QString
getFirmwareBaseUrl();
136 void registerOpenTxFirmwares();
137 void unregisterOpenTxFirmwares();