From: robertl Date: Thu, 21 Jan 2010 05:01:33 +0000 (+0000) Subject: Add wintec_test format for Wintec WBT-202 GPS mass storage files. X-Git-Tag: archive/raspbian/1.10.0+ds-2+rpi1~1^2~199^2~69 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=880ad7b709f9154517a4d4bc858e1001e88c7570;p=gpsbabel.git Add wintec_test format for Wintec WBT-202 GPS mass storage files. --- diff --git a/Makefile.in b/Makefile.in index 75e0631d2..3caab7882 100644 --- a/Makefile.in +++ b/Makefile.in @@ -64,7 +64,7 @@ ALL_FMTS=$(MINIMAL_FMTS) gtm.o gpsutil.o pcx.o cetus.o copilot.o \ igo8.o gopal.o humminbird.o mapasia.o gnav_trl.o navitel.o ggv_ovl.o \ jtr.o sbp.o sbn.o mmo.o skyforce.o itracku.o v900.o delbin.o \ pocketfms_bc.o pocketfms_fp.o pocketfms_wp.o naviguide.o enigma.o \ - vpl.o teletype.o jogmap.o bushnell.o bushnell_trl.o \ + vpl.o teletype.o jogmap.o bushnell.o bushnell_trl.o wintec_tes.o \ FMTS=@FMTS@ diff --git a/reference/track/wintec_tes.tes b/reference/track/wintec_tes.tes new file mode 100755 index 000000000..f8bae485a Binary files /dev/null and b/reference/track/wintec_tes.tes differ diff --git a/reference/track/wintec_tes~gpx.gpx b/reference/track/wintec_tes~gpx.gpx new file mode 100644 index 000000000..f967fa694 --- /dev/null +++ b/reference/track/wintec_tes~gpx.gpx @@ -0,0 +1,2006 @@ + + + + + + + + 55.000000 + + + + -2.000000 + + + + -2.000000 + + + + -6.000000 + + + + 8.000000 + + + + 9.000000 + + + + 3.000000 + + + + 8.000000 + + + + 10.000000 + + + + 14.000000 + + + + 9.000000 + + + + 8.000000 + + + + 6.000000 + + + + 5.000000 + + + + 5.000000 + + + + 4.000000 + + + + 3.000000 + + + + 3.000000 + + + + -1.000000 + + + + -2.000000 + + + + -1.000000 + + + + -1.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -3.000000 + + + + -3.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -1.000000 + + + + -2.000000 + + + + -2.000000 + + + + -3.000000 + + + + -3.000000 + + + + -4.000000 + + + + -4.000000 + + + + -5.000000 + + + + -5.000000 + + + + -5.000000 + + + + -5.000000 + + + + -5.000000 + + + + -5.000000 + + + + -6.000000 + + + + -5.000000 + + + + -5.000000 + + + + -5.000000 + + + + -5.000000 + + + + -5.000000 + + + + -5.000000 + + + + -5.000000 + + + + -4.000000 + + + + -4.000000 + + + + -4.000000 + + + + -4.000000 + + + + -3.000000 + + + + -3.000000 + + + + -4.000000 + + + + -3.000000 + + + + -4.000000 + + + + -4.000000 + + + + -4.000000 + + + + -4.000000 + + + + -4.000000 + + + + -4.000000 + + + + -4.000000 + + + + -4.000000 + + + + -4.000000 + + + + -4.000000 + + + + -3.000000 + + + + -3.000000 + + + + -4.000000 + + + + -4.000000 + + + + -4.000000 + + + + -4.000000 + + + + -4.000000 + + + + -4.000000 + + + + -4.000000 + + + + -4.000000 + + + + -3.000000 + + + + -4.000000 + + + + -4.000000 + + + + -5.000000 + + + + -5.000000 + + + + -5.000000 + + + + -5.000000 + + + + -5.000000 + + + + -5.000000 + + + + -5.000000 + + + + -5.000000 + + + + -5.000000 + + + + -4.000000 + + + + -4.000000 + + + + -4.000000 + + + + -3.000000 + + + + -3.000000 + + + + -3.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -1.000000 + + + + -1.000000 + + + + 0.000000 + + + + 0.000000 + + + + 0.000000 + + + + -1.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -1.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -3.000000 + + + + -4.000000 + + + + -3.000000 + + + + -3.000000 + + + + -3.000000 + + + + -3.000000 + + + + -3.000000 + + + + -3.000000 + + + + -3.000000 + + + + -3.000000 + + + + -2.000000 + + + + -3.000000 + + + + -3.000000 + + + + -3.000000 + + + + -3.000000 + + + + -3.000000 + + + + -3.000000 + + + + -3.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -3.000000 + + + + -3.000000 + + + + -3.000000 + + + + -3.000000 + + + + -3.000000 + + + + -3.000000 + + + + -3.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -1.000000 + + + + -1.000000 + + + + -1.000000 + + + + -1.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -1.000000 + + + + -1.000000 + + + + -1.000000 + + + + -1.000000 + + + + -1.000000 + + + + -1.000000 + + + + -1.000000 + + + + -1.000000 + + + + -1.000000 + + + + -1.000000 + + + + -1.000000 + + + + -1.000000 + + + + -1.000000 + + + + -1.000000 + + + + -1.000000 + + + + -1.000000 + + + + -1.000000 + + + + -1.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -3.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + 0.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -3.000000 + + + + -3.000000 + + + + -3.000000 + + + + -3.000000 + + + + -3.000000 + + + + -3.000000 + + + + -3.000000 + + + + -3.000000 + + + + -3.000000 + + + + -3.000000 + + + + -3.000000 + + + + -3.000000 + + + + -3.000000 + + + + -3.000000 + + + + -3.000000 + + + + -3.000000 + + + + -3.000000 + + + + -3.000000 + + + + -3.000000 + + + + -3.000000 + + + + -3.000000 + + + + -3.000000 + + + + -3.000000 + + + + -3.000000 + + + + -3.000000 + + + + -3.000000 + + + + -3.000000 + + + + -3.000000 + + + + -3.000000 + + + + -3.000000 + + + + -3.000000 + + + + -3.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -3.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -1.000000 + + + + -1.000000 + + + + -2.000000 + + + + -2.000000 + + + + -4.000000 + + + + -3.000000 + + + + -3.000000 + + + + -3.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -3.000000 + + + + -2.000000 + + + + -1.000000 + + + + -1.000000 + + + + -2.000000 + + + + -3.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -1.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -3.000000 + + + + -3.000000 + + + + -3.000000 + + + + -3.000000 + + + + -3.000000 + + + + -3.000000 + + + + -3.000000 + + + + -3.000000 + + + + -3.000000 + + + + -2.000000 + + + + -3.000000 + + + + -3.000000 + + + + -3.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -3.000000 + + + + -3.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -3.000000 + + + + -3.000000 + + + + -3.000000 + + + + -3.000000 + + + + -3.000000 + + + + -2.000000 + + + + -2.000000 + + + + -1.000000 + + + + 0.000000 + + + + 0.000000 + + + + 0.000000 + + + + 0.000000 + + + + 0.000000 + + + + 0.000000 + + + + 0.000000 + + + + 0.000000 + + + + 0.000000 + + + + 0.000000 + + + + 0.000000 + + + + 0.000000 + + + + -1.000000 + + + + -1.000000 + + + + -1.000000 + + + + -1.000000 + + + + 0.000000 + + + + -1.000000 + + + + -1.000000 + + + + -1.000000 + + + + -1.000000 + + + + -1.000000 + + + + 0.000000 + + + + -1.000000 + + + + -1.000000 + + + + -1.000000 + + + + -1.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -3.000000 + + + + -3.000000 + + + + -3.000000 + + + + -3.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -3.000000 + + + + -3.000000 + + + + -2.000000 + + + + -1.000000 + + + + -1.000000 + + + + -1.000000 + + + + -1.000000 + + + + -1.000000 + + + + -1.000000 + + + + 0.000000 + + + + 0.000000 + + + + 0.000000 + + + + 0.000000 + + + + 0.000000 + + + + 0.000000 + + + + 0.000000 + + + + -1.000000 + + + + 0.000000 + + + + 0.000000 + + + + 0.000000 + + + + 0.000000 + + + + -1.000000 + + + + -1.000000 + + + + -1.000000 + + + + -1.000000 + + + + -1.000000 + + + + -1.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + 0.000000 + + + + 0.000000 + + + + 1.000000 + + + + 1.000000 + + + + 1.000000 + + + + 0.000000 + + + + 0.000000 + + + + 0.000000 + + + + 0.000000 + + + + 0.000000 + + + + 0.000000 + + + + 0.000000 + + + + -2.000000 + + + + -3.000000 + + + + -5.000000 + + + + -3.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -2.000000 + + + + -1.000000 + + + + -1.000000 + + + + -1.000000 + + + + -1.000000 + + + + -1.000000 + + + + -1.000000 + + + + -3.000000 + + + + -2.000000 + + + + 0.000000 + + + + 2.000000 + + + + 3.000000 + + + + 3.000000 + + + + 3.000000 + + + + 3.000000 + + + + 3.000000 + + + + 2.000000 + + + + 0.000000 + + + + 1.000000 + + + + 0.000000 + + + + 0.000000 + + + + -1.000000 + + + + -1.000000 + + + + -2.000000 + + + + 0.000000 + + + + 0.000000 + + + + 0.000000 + + + + 0.000000 + + + + -1.000000 + + + + -1.000000 + + + + -2.000000 + + + + 0.000000 + + + + -1.000000 + + + + 1.000000 + + + + 2.000000 + + + + -3.000000 + + + + 0.000000 + + + + -2.000000 + + + + 0.000000 + + + + -2.000000 + + + + -4.000000 + + + + -7.000000 + + + + -10.000000 + + + + -7.000000 + + + + -5.000000 + + + + -2.000000 + + + + -3.000000 + + + + -5.000000 + + + + -3.000000 + + + + 0.000000 + + + + 2.000000 + + + + 1.000000 + + + + 0.000000 + + + + 0.000000 + + + + -1.000000 + + + + -2.000000 + + + + -2.000000 + + + + -3.000000 + + + + -3.000000 + + + + -5.000000 + + + + -4.000000 + + + + -1.000000 + + + + + diff --git a/testo.d/wintec_tes.test b/testo.d/wintec_tes.test new file mode 100644 index 000000000..48a1d5ee2 --- /dev/null +++ b/testo.d/wintec_tes.test @@ -0,0 +1,6 @@ +rm -f ${TMPDIR}/wintec_tes.* + +# Currently one-way. +gpsbabel -i wintec_tes -f ${REFERENCE}/track/wintec_tes.tes -o gpx -F ${TMPDIR}/wintec_tes.gpx +compare ${REFERENCE}/track/wintec_tes~gpx.gpx ${TMPDIR}/wintec_tes.gpx + diff --git a/vecs.c b/vecs.c index 03cc09e95..1d1f51504 100644 --- a/vecs.c +++ b/vecs.c @@ -170,6 +170,7 @@ extern ff_vecs_t enigma_vecs; extern ff_vecs_t vpl_vecs; extern ff_vecs_t teletype_vecs; extern ff_vecs_t jogmap_vecs; +extern ff_vecs_t wintec_tes_vecs; static vecs_t vec_list[] = { @@ -998,6 +999,12 @@ vecs_t vec_list[] = { "Jogmap.de XML format", "xml" }, + { + &wintec_tes_vecs, + "wintec_tes", + "Wintec TES file", + "tes" + }, #endif // MAXIMAL_ENABLED { NULL, diff --git a/wintec_tes.c b/wintec_tes.c new file mode 100644 index 000000000..1201b3c8a --- /dev/null +++ b/wintec_tes.c @@ -0,0 +1,104 @@ +/* + + Wintec tes support. + + Copyright (C) 2010 Robert Lipe, robertlipe@gpsbabel.org + + 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., 59 Temple Place - Suite 330, Boston, MA 02111 USA + + */ + +#include "defs.h" + +#define MYNAME "wintec_tes" + +static gbfile* fin; + +static void +wintec_tes_rd_init(const char *fname) +{ + fin = gbfopen(fname, "r", MYNAME); +} + +static void +wintec_tes_rd_deinit(void) +{ + gbfclose(fin); +} + +static time_t +wintec_date_to_time(gbuint32 w) +{ + time_t t; + struct tm tm; + memset(&tm, 0, sizeof(tm)); + tm.tm_sec = ((w & 0x0000003f)); + tm.tm_min = ((w & 0x00000fc0) >> 6); + tm.tm_hour = ((w & 0x0001f000) >> 12); + tm.tm_mday = ((w & 0x00370000) >> 17); + tm.tm_mon = ((w & 0x03c00000) >> 22) - 1; + tm.tm_year = ((w & 0xfc000000) >> 26) + 100; + + return mkgmtime(&tm);; +} + +static void +wintec_tes_read(void) +{ + route_head *trk = route_head_alloc(); + track_add_head(trk); + + while (!gbfeof(fin)) { + waypoint *wpt; + gbuint16 flags = gbfgetuint16(fin); + gbuint32 date = gbfgetuint32(fin); + gbint32 latitude = gbfgetint32(fin); + gbint32 longitude = gbfgetint32(fin); + gbint16 alt = gbfgetint16(fin); // Signed. Meters. + + wpt = waypt_new(); + wpt->latitude = latitude / 1.0e7; + wpt->longitude = longitude / 1.0e7; + wpt->creation_time = wintec_date_to_time(date); + // The unit of altitude isn't clear and we have a lot of + // samples with wildly negative values, so ignore those for now. + wpt->altitude = alt; + track_add_wpt(trk, wpt); + } +} + +static +arglist_t wintec_tes_args[] = { + ARG_TERMINATOR +}; + +ff_vecs_t wintec_tes_vecs = { + ff_type_file, + { + ff_cap_none /* waypoints */, + ff_cap_read /* tracks */, + ff_cap_none /* routes */ + }, + wintec_tes_rd_init, + NULL, + wintec_tes_rd_deinit, + NULL, + wintec_tes_read, + NULL, + NULL, + wintec_tes_args, + CET_CHARSET_ASCII, 0 /* ascii is the expected character set */ + /* not fixed, can be changed through command line parameter */ +}; diff --git a/xmldoc/formats/wintec_tes.xml b/xmldoc/formats/wintec_tes.xml new file mode 100644 index 000000000..29c16fd75 --- /dev/null +++ b/xmldoc/formats/wintec_tes.xml @@ -0,0 +1,26 @@ +This format supports Wintec .tec files, such as appear on the +Wintec WBT-202 data logger. + + +The WinTec WBT-202 stores tracks and waypoints on an internal +MICRO-SD Memory card. The log files can be accessed by connecting to an USB +host and setting the device into a mass storage device (MSD) mode. To enter +this mode, attach it to the computer, then hold the power button until the +GPS and Bluetooth LEDs go out. It will then behave like an USB Memory stick. +and individual files containing your tracks will show up on the "disk" with +names ending in .tes. You can use GPSBabel to read these files directly +or copy them to your host computer. + + +Note that this format is for the TES files on the GPS, it has no relationship +to the .TK2 files created by Wintec's Time Machine software for Windows. + + +Despite the physical similarity to the +Wintec WBT-201, this is believed to be a rather +different product. While this GPS probably works fine for +realtime tracking over the bluetooth or +serial lines (once you have appropriate serial drivers), it's expected +to not work with GPSBabel's GPSBabel WBT +Protocol module. +