Thanx.  Committed.

Just under the wire for 1.4.1.

RJL

On Sun, Jun 27, 2010 at 5:29 PM, Stefan Bauer <yoltia-maintain@freenet.de> wrote:
Am Sonntag 27 Juni 2010 19:10:15 schrieb Robert Lipe:
> On Sat, Jun 26, 2010 at 8:14 PM, Russell Strong <russell@strong.id.au> wrote:
>
> > Hi,
> >
> > I have found a problem decoding elevation and speed with decoding of height
> > from a Holux GPSport 245 logger.
> >
> > 1007c1007
> > .<                   hspd = data[i] + data[i+1]*0x100 + data[i+2]*0x10000 + data[i+2]*0x1000000;
> > ---
> > .>                   hspd = data[i] + data[i+1]*0x100 + data[i+2]*0x10000;
>
> It does seem wrong that we have the factor in there twice.   I wonder if
> that is actually a four byte field and the last element should be data[i+3].

Looking at line 1302, it really seems like this.

> > 1419c1419
> > .<             if ((mtk_device != HOLUX_GR245) && (memcmp(&buf[i], "HOLUXGR245", 10) == 0)) {
> > ---
> > .>             if ((mtk_device == HOLUX_GR245) && (memcmp(&buf[i], "HOLUXGR245", 10) == 0)) {
>
> But the holux245_init() code that's about to be called is what sets
> mtk_device to HOLUX_GR245.  Oh, wait, we broke this test on 4/4 when we
> added the "USB processing" stuff.

Sigh, sorry for that. Never looked at the height / speed fields. Based on Russells patch, here is another one that adresses your hints.

> How about we just drop that first clause completely?

Sounds sensible. I'm now also calling holux245_init() just before the 'greeting' instead of just setting mtk_device to HOLUX_GR245 to be save.

> Do we know that i is always less than ten bytes from the end
> of the buffer?  If not, perhaps all those memcmp in tha tloop should be
> strncmps.

I'm really not sure of that, so I'm not touching it for now.


--Stefan

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Gpsbabel-code mailing list  http://www.gpsbabel.org
Gpsbabel-code@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gpsbabel-code