Commit Graph

7 Commits

Author SHA1 Message Date
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
Mark Liversedge
22d04f8524 Native ANT+ Part 2 - antlog.bin dignostics
A patch to create an 'antlog.bin' in the current working
directory when working with ANT+ devices. This is to enable
users to test the ANT+ support and share the received messages
to diagnose issues related to parsing messages and displaying
telemetry.

This 'antlog.bin' will ultimately become a native ant file format
and have an associated extension (.ant) and a ridefile reader.
For now it just writes a stream of fixed length messages (12 bytes)
of all received messages.
2011-03-14 21:57:35 +00:00
Mark Liversedge
3cfbfd446a Native ANT+ Part 2 - Improved Power Support
Fix SRM power decoding to stop requiring a new message
pair whenever a zero change occurs - this was erroneous
and severely limited the update rate. Power and Cadence
updates for SRM are now immediate.

Desk check of support for Standard Power messages showed
that the code was interfering with normal cranktorque or
wheeltorque power calculations. This did not show up with
SRM cranks since they do not send standard power messages.

This should help to resolve issues with erratic/incorrect
power readings from Powertaps. I am not sure if Quarq cranks
send standard power messages, but if they do then this should
improve power readings for those too.
2011-03-10 14:26:12 +00:00
Mark Liversedge
fc51026aa7 Native ANT+ Part 2 - Garmin USB1 Stick on Windows
This patch provides support for Garmin USB1 sticks under
Windows. Since the device does not present a serial port
this code uses the USBXpress API from SiLabs that the
Garmin device uses.

Support for USB2 sticks is pending.

To build you will need to download and install the SiLabs
development kit from http://www.silabs.com/products/mcu/Pages/USBXpress.aspx
and set USBXPRESS_INSTALL appropriately in gcconfig.pri. I
have provided instructions in gcconfig.pri.in.

At runtime the SiUSBXp.dll will need to be in the path, I will
assume that Gareth will fix up the windows installer for this, but
for now just copy the file manually.

Tested with a GARMIN USB1 stick on Windows 7 with SRM, Garmin HR and
a GSC-10 dual speed/cadence device.

There are other minor fixes to the ANTMessage code in this patch
related to decoding of calibration messages.
2011-03-07 13:39:17 +00:00
Mark Liversedge
c17c5488bb Native ANT+ Part 2 - tweaks
Couple of little tweaks to the Native ANT support. Firstly,
data channels such as watts, hr and cadence are now rounded
to an integer (lots of grid lines in ride plot looked nasty).

Secondly, basic support for calibration messages; this has been
limited to SRM messages, but will add support for other devices
as we start to debug them.

Part 3 of this work is still pending, this patch only contains
adjustments to part 2. I suspect there will be further adjustments
as we squash bugs for Quarq and PT users.
2011-03-06 21:16:04 +00:00
Mark Liversedge
efe578962f Native ANT+ debug, temporary for testing. 2011-03-06 13:41:16 +00:00
Mark Liversedge
701eb200ef Native ANT+ Support (2 of 3)
Second stage of development, refactored the quarqd sources and introduced
an ANTChannel and ANTMessage class.

This is a functional patch and should work with known ANT+ devices, but
has only been tested with a Garmin HR strap, GSC-10 dual speed/cadence
and SRM wireless cranks. It has only been tested with a first generation
Garmin ANT+ USB stick.

It *should* work with other devices (e.g. Powertap, Quarq) but this has
not been tested.

The configuration pane has not been fixed yet, so you can either add a
Native ANT+ device and leave the profile blank (it will autodiscover
whatever it can when you run) or you can copy the profile from a Quarqd
device and use that.

There are lots of bugs;
* Calibration is not supported, uses a static srm_offset
* Wheel circumference is fixed at 2100mm for speed calculations
* Timeouts are hit and miss and need to be completed
* Sensor loss / timeouts are not managed yet
* Burst data and Acks are not handled
* Device descriptions, versions and battery messages are not handled

Aside from the bugs above part 3 wil also need to include;
* Configuration screen fixups and device pairing
* Add a calibration button to the realtime window

Lastly, the refactoring of the quarqd code is incomplete, there is still
a need to use ANTMessage across the code, especially within the ANTChannel
code which still does a bit of decoding locally.
2011-03-05 15:08:41 +00:00