#
# Humminbird waypoints/routes
#
gpsbabel -i humminbird -f ${REFERENCE}/humminbird.hwr -o unicsv,utc=0 -F ${TMPDIR}/humminbird~hwr.csv
compare ${REFERENCE}/humminbird~hwr.csv ${TMPDIR}/humminbird~hwr.csv
gpsbabel -i humminbird -f ${REFERENCE}/humminbird.hwr -o humminbird -F ${TMPDIR}/humminbird.hwr
bincompare ${REFERENCE}/humminbird.hwr ${TMPDIR}/humminbird.hwr
gpsbabel -i humminbird -f ${REFERENCE}/route/humminbird.hwr -o gpx -F ${TMPDIR}/humminbird~hwr.gpx
compare ${REFERENCE}/route/humminbird~hwr.gpx ${TMPDIR}/humminbird~hwr.gpx

# The provenance of humminbird.hwr is unclear.
# The routes have timestamps
# 48 a8 59 72 (Sun Aug 17 2008 17:01:38 GMT+0000)
# 48 a8 5a 77 (Sun Aug 17 2008 17:05:59 GMT+0000)
# 48 a8 5a 80 (Sun Aug 17 2008 17:06:08 GMT+0000)
# which suggests they may be real.
# The unused entries in the points array of the route headers appear to be random.
# To add regresssion for our writer we generated a corresponding hwr file with GPSBABEL_FREEZE_TIME=y
# gpsbabel -i humminbird -f reference/route/humminbird.hwr -o humminbird -F reference/route/humminbird_gpsbabel.hwr
# This has zeroed timestamps and zeroed unused entries in the points arrays.
gpsbabel -i humminbird -f ${REFERENCE}/route/humminbird_gpsbabel.hwr -o humminbird -F ${TMPDIR}/humminbird_gpsbabel~hwr.hwr
compare ${REFERENCE}/route/humminbird_gpsbabel.hwr ${TMPDIR}/humminbird_gpsbabel~hwr.hwr

#
#
# Humminbird tracks
#
gpsbabel -i humminbird -f ${REFERENCE}/track/humminbird.ht -o humminbird_ht -F ${TMPDIR}/humminbird.ht
bincompare ${REFERENCE}/track/humminbird.ht ${TMPDIR}/humminbird.ht

gpsbabel -i humminbird -f ${REFERENCE}/humminbird.hwr -f ${REFERENCE}/track/humminbird.ht -o gpx,humminbirdextensions=1 -F ${TMPDIR}/combo.gpx
gpsbabel -i gpx -f ${TMPDIR}/combo.gpx -o humminbird -F ${TMPDIR}/funky.hwr -o humminbird_ht -F ${TMPDIR}/funky.ht
bincompare ${REFERENCE}/humminbird.hwr ${TMPDIR}/funky.hwr
bincompare ${REFERENCE}/track/humminbird.ht ${TMPDIR}/funky.ht 

# In 2012, Humminbird changed their format in incompatible ways.  We call them
# v2 and v3 but we don't really know that they have names.  The version number
# internally didn't change.

gpsbabel -i humminbird -f ${REFERENCE}/humminbird-rte-v2.hwr  -o gpx,humminbirdextensions=1 -F ${TMPDIR}/humminbird-rte-v2~gpx.gpx
compare ${REFERENCE}/humminbird-rte-v2~gpx.gpx ${TMPDIR}/humminbird-rte-v2~gpx.gpx 

gpsbabel -i humminbird -f ${REFERENCE}/humminbird-rte-v3.hwr  -o gpx,humminbirdextensions=1 -F ${TMPDIR}/humminbird-rte-v3~gpx.gpx
compare ${REFERENCE}/humminbird-rte-v3~gpx.gpx ${TMPDIR}/humminbird-rte-v3~gpx.gpx 

