4 XCSoar Glide Computer - http://www.xcsoar.org/
5 Copyright (C) 2000-2013 The XCSoar Project
6 A detailed list of copyright holders can be found in the file "AUTHORS".
8 This program is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License
10 as published by the Free Software Foundation; either version 2
11 of the License, or (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 #include "Device/Register.hpp"
25 #include "Device/Driver.hpp"
26 #include "Device/Driver/CAI302.hpp"
27 #include "Device/Driver/CaiGpsNav.hpp"
28 #include "Device/Driver/EW.hpp"
29 #include "Device/Driver/Eye.hpp"
30 #include "Device/Driver/AltairPro.hpp"
31 #include "Device/Driver/Generic.hpp"
32 #include "Device/Driver/Vega.hpp"
33 #include "Device/Driver/NmeaOut.hpp"
34 #include "Device/Driver/GTAltimeter.hpp"
35 #include "Device/Driver/PosiGraph.hpp"
36 #include "Device/Driver/BorgeltB50.hpp"
37 #include "Device/Driver/Volkslogger.hpp"
38 #include "Device/Driver/EWMicroRecorder.hpp"
39 #include "Device/Driver/LX.hpp"
40 #include "Device/Driver/IMI.hpp"
41 #include "Device/Driver/Zander.hpp"
42 #include "Device/Driver/FlymasterF1.hpp"
43 #include "Device/Driver/XCOM760.hpp"
44 #include "Device/Driver/Condor.hpp"
45 #include "Device/Driver/Leonardo.hpp"
46 #include "Device/Driver/Flytec.hpp"
47 #include "Device/Driver/ILEC.hpp"
48 #include "Device/Driver/Westerboer.hpp"
49 #include "Device/Driver/WesterboerVW921.hpp"
50 #include "Device/Driver/FLARM.hpp"
51 #include "Device/Driver/FlyNet.hpp"
52 #include "Device/Driver/CProbe.hpp"
53 #include "Device/Driver/LevilAHRS_G.hpp"
54 #include "Device/Driver/BlueFlyVario.hpp"
55 #include "Util/Macros.hpp"
60 /** NULL terminated array of available device drivers. */
61 static const struct DeviceRegister
*const driver_list
[] = {
62 // IMPORTANT: ADD NEW ONES TO BOTTOM OF THIS LIST
63 &generic_driver
, // MUST BE FIRST
73 &ew_microrecorder_driver
,
85 &westerboer_vw921_driver
,
95 const struct DeviceRegister
*
96 GetDriverByIndex(unsigned i
)
98 assert(i
< ARRAY_SIZE(driver_list
));
100 return driver_list
[i
];
103 const struct DeviceRegister
*
104 FindDriverByName(const TCHAR
*name
)
106 for (auto i
= driver_list
; *i
!= NULL
; ++i
) {
107 const DeviceRegister
&driver
= **i
;
108 if (_tcscmp(driver
.name
, name
) == 0)
112 return driver_list
[0];
116 FindDriverDisplayName(const TCHAR
*name
)
118 assert(name
!= NULL
);
120 for (auto i
= driver_list
; *i
!= NULL
; ++i
) {
121 const DeviceRegister
&driver
= **i
;
122 if (_tcscmp(driver
.name
, name
) == 0)
123 return driver
.display_name
;