5 * th9x - http://code.google.com/p/th9x
6 * er9x - http://code.google.com/p/er9x
7 * gruvin9x - http://code.google.com/p/gruvin9x
9 * License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2 as
13 * published by the Free Software Foundation.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
21 #ifndef OPENTX_MULTI_H
22 #define OPENTX_MULTI_H
27 #include <QStringList>
29 #define MM_RF_CUSTOM_SELECTED 0xff
35 struct radio_mm_definition
{
37 QStringList protocols
;
38 unsigned int maxSubtype
;
42 struct MultiProtocolDefinition
{
44 const QStringList subTypeStrings
;
45 const QString optionsstr
;
47 unsigned int numSubytes() const
49 return (unsigned int) subTypeStrings
.length();
52 int getOptionMin() const;
54 int getOptionMax() const;
56 MultiProtocolDefinition(const radio_mm_definition
&rd
) :
57 protocol(rd
.protocol
),
58 subTypeStrings(rd
.protocols
),
59 optionsstr(rd
.optionsstr
)
61 Q_ASSERT(rd
.maxSubtype
+ 1 == (unsigned int) rd
.protocols
.length());
65 Multiprotocols(std::initializer_list
<radio_mm_definition
> l
)
67 for (radio_mm_definition rd
: l
)
68 protocols
.push_back(MultiProtocolDefinition(rd
));
71 const MultiProtocolDefinition
&getProtocol(int protocol
) const;
75 std::vector
<MultiProtocolDefinition
> protocols
;
79 extern const Multiprotocols multiProtocols
;
81 #endif //OPENTX_MULTI_H