From: Robert Lipe <robertlipe@us...> - 2002-12-21 17:38:31
I just went to shoot a couple hundred waypoints into a borrowed (thanx,
JoGPS!) Garmin GPS V and the unit kept locking up after about 30
waypoints. Watching the traffic on the serial hose made it apparent
that the code was sending needlessly large amounts of data for unused
fields and this was apparently blowing the unit away.
It turns out that libjeeps initializes all the waypoint text fields to
all spaces and then shuffles then around with strlen which, of course,
means we send boatloads of spaces to the unit in empty/unused fields.
I can argue that the unit shouldn't lock up, but the patch below makes
us send a lot less data and quits laying the soul of the V to waste.
If you Garminites get a chance, please confirm that this makes life no
worse for you and I'll include this in the 1.1.1 release when I return
from Christmas travels.
RCS file: /cvsroot/gpsbabel/gpsbabel/garmin.c,v
retrieving revision 1.16
diff -p -u -r1.16 garmin.c
--- garmin.c 13 Dec 2002 18:56:31 -0000 1.16
+++ garmin.c 21 Dec 2002 17:32:39 -0000
@@ -221,6 +221,19 @@ data_write(void)
wpt = (waypoint *) elem;
+ * Undo less than helpful defaults from Way_New.
+ way[i]->rte_ident = 0;
+ way[i]->rte_cmnt = 0;
+ way[i]->rte_link_subclass = 0;
+ way[i]->rte_link_ident = 0;
+ way[i]->city = 0;
+ way[i]->state = 0;
+ way[i]->facility = 0;
+ way[i]->addr = 0;
+ way[i]->cross_road = 0;
if(wpt->description) src = wpt->description;
if(wpt->notes) src = wpt->notes;