Kernel 3.11 exposes the Suunto ANT+ stick as a USB serial device,
this prevents GC from opening it in training mode unless the
kernel driver is detached first.
Decoupled classes from MainWindow to reference Context
and Athlete (and introduced a couple of new headers).
We no longer pass around a MainWindow pointer to children
but pass a context instead.
There are still a few pieces left in MainWindow that need
to move to a better place;
* Setting/clearing filter selection
* Working with Intervals
* Adding/Deleting Rides
* Save on Exit
As mentioned previously there are lots of other parts to
this refactor left to do;
* break MainWindow Gui elements into Toolbar and Views
* migrate from RideItem and Ridelist to ActivityCollection
and Activity classes that are not tied into gui elements.
* introduce Application Context and AthleteCollection
Introduce a wizard for adding realtime devices since it
is prone to user error, is relatively complicated and is
something most users will only ever do once or twice.
There are several logical updates within this patch:
First; Fix intermittent ANT+ not working
* LibUsb - check bufRemaining is > 0 not non-zero
* LibUsb - Always reset the USB stick on open
* ANT.cpp - Support > 4 channels on USB2
* ANTChannel - Do not use pairing, but always
* unassign, assign and set channel id.
Second; Fix device discovery
* Find and discover support in realtime controllers
* Extend Serial.cpp to cover more Serial devices
* Support for 4 or 8 ANT channels for USB1/USB2
Third; Introduce Add Device Wizard with
* General and Specific wizard pages for each device type
* Device pairing with telemetry display
* fixed compile time warnings
Fourth; Update Device Config Page
* use wizard to add new device
* remove edit fields, replaced by wizard
* remove pair, firmware buttons replaced by wizard
Fifth; Deprecate/Remove Device Types
* Null Device - used by developers only
* Quarqd client - replaced by Native ANT+
* GC Server - not implemented yet
I have also introduced a device specific wheel size
and flags for controlling the default selection and
sources for sensor data when in multi-device mode. These
are not yet supported in the code.
Fixes#611.
Fixes#497.
It was neccessary to reset the USB2 stick between
sessions. This was due to incorrect state data
being maintained within the ANT code.
New sessions should start without requiring a USB
device reset or running ANT agent etc.
Fixes#558.
Under Mac OSX the Tacx Fortius support needed
a few minor tweaks;
* sleep 60ms between read/write operations to
avoid interrupt errors
* clear_halt on read/write endpoints before
attempting to read/write to the device
* remove the errant usb_reset which really should
not have been called in LibUsb since it deletes
the device structure(!)
The LibUsb class has been modified to clear_halt
when opening ANT devices too -- since regression
testing on Mac showed that a) you need the latest
drivers to work with a USB2 stick on Lion (64bit)
and it now appears to mandate a clear_halt when
opening the device (but this may be related to the
Garmin ANT agent leaving it in an unknown state).
Initial support for Tacx Fortius devices.
Note this requires libusb support to be present and will
work on Linux, Mac and Windows.
The handlebar buttons up/down will increase/decrease the
load/intensity in a similar fashion to the +/- keys on
the Computrainer controller.
The cancel button will stop a workout and the enter key
is used to mark a lap.
Slope and Ergo modes are supported, but we do not set the
brake at all if the speed is below 10kph, this is to
ensure it does not get burnt out when users 'grind'.
SPECIAL NOTE:
The Fortius handlebar controller is a Ez-Usb device
and requires firmware to be loaded when it is connected.
Since this is copyrighted by Tacx BV we do not distribute
it, instead, when the user sets up a Fortius device they
must also provide the file. Full instructions on how this
should be done are given when configuring the device.
Additionally, for Linux users udev rules should be added to
ensure that the USB devices are accessible to non-root users.
Fixes#538.
We call usb_reset between sessions on Linux/Mac
because the USB device is left in an undetermined
state after close. In the comments I noted that
it was odd this was not required on Windows.
Well, it turns out it is not available on Windows.
This patch ensures we do not try to call it when
compiling for Windows.
This update completes support for USB2 sticks for ANT+ devices
in train view. The code now works on Linux and Mac as well as
Windows.
IOKit is now a required framework for builds on Mac OSX and
src.pro has been updated accordingly.
I have also added a tarball of the required version of libusb
in a new 'contrib' directory. Users may wish to use a later
version or download from an alternative source, but this
version is guaranteed to work.
Fixes#310
Fixup support for USB2 on Linux via libusb. The code
is pretty ghetto with a maze of pre-processor conditionals.
But it works.
Of special note:
* You MUST build with a very specific version of libusb, the
stock libs in Ubuntu do not work. Might pull the code into
the main repo, since its pretty darned tiny.
* On Linux access controls for the USB devices is controlled
by udev, and requires a rule adding to ensure the devie can
be read/written by users other than root. A udev rule file
has been added to a 'linux' subdirectory in src.
Some of the timeouts and usb setup/reset code has been adjusted
to ensure the device is always in a consistent state. This appears
to be more important on Linux than Windows for some reason.
This means that libusb0.dll does not have to be included in the
Golden Cheetah distribution - the code will load it automatically
from windows\system32 on demand when realtime mode is invoked in
Native ANT+ mode. Insertion of a USB2 ANT+ stick will cause Windows
to download and install libusb0 automatically.
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.