Files
GoldenCheetah/src/DeviceTypes.cpp
Darren Hague f8d60bfbe2 Native ANT+ part 2 - USB2 Support and minor improvements
This patch adds support for the Garmin USB2 stick using
libusb-win library. Instructions are included in gcconfig.pri.in
for configuring and installing the neccessary libs.

To enable support for USB1 and USB2 support in the same binary
stubs are created when UsbXpress/Libusb are not available and the
device i/o attempts to use USB2 before falling back to USB1.

Since I was also in the middle of some coding changes I merged
my developments (Mark) with Darren's patch whilst fixing it up
for commit, namely:

1. the configuration screen no longer demands a COMx port
   when using Native ANT+ on Windows.
2.  new signals in ANTChannel notify the ANT class when info is
   stale or lost (but they are not used at present).
3. The previous debug messages have been removed, although new
   debug messages are added for stale/drop/timeout signals.
2011-03-19 21:03:43 +00:00

68 lines
2.5 KiB
C++

/*
* Copyright (c) 2009 Mark Liversedge (liversedge@gmail.com)
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc., 51
* Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <QDebug>
#include "DeviceTypes.h"
// NOTE:
// Device Types not fully supported in this release (functionally) have
// been commented out. As new features or existing features are updated to
// use this new class then the lines will be uncommented
//
// As a result, only Realtime uses this feature at present (and the associated
// configuration DeviceConfiguration class and preferences pane
static DeviceType SupportedDevices[] =
{
#ifdef Q_OS_WIN32
{ DEV_ANTLOCAL, DEV_USB, (char *) "Native ANT+", true, false },
#else
{ DEV_ANTLOCAL, DEV_SERIAL, (char *) "Native ANT+", true, false },
#endif
{ DEV_CT, DEV_SERIAL, (char *) "Computrainer", true, false },
{ DEV_GSERVER, DEV_TCP, (char *) "Golden Cheetah Server", false, false },
{ DEV_NULL, DEV_TCP, (char *) "Null device (testing)", false, false },
{ DEV_ANTPLUS, DEV_QUARQ, (char *) "ANT+ via Quarqd", true, false },
// { DEV_PT, DEV_SERIAL, (char *) "Powertap Head Unit", false, true },
// { DEV_SRM, DEV_SERIAL, (char *) "SRM PowerControl V/VI", false, true },
// { DEV_GCLIENT, DEV_TCP, (char *) "Golden Cheetah Client", false, false },
{ 0, 0, NULL, 0, 0 }
};
DeviceTypes::DeviceTypes()
{
for (int i=0; SupportedDevices[i].type;i++)
Supported.append(SupportedDevices[i]);
}
DeviceTypes::~DeviceTypes()
{}
QList<DeviceType> DeviceTypes::getList()
{
return Supported;
}
DeviceType DeviceTypes::getType(int type)
{
for (int i=0; i< Supported.count(); i++) {
if (Supported.at(i).type == type)
return Supported.at(i);
}
return Supported.at(0); // yuck.whatever
}