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].


 
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.  How about we just drop that first clause completely?   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.



RJL
 

Sorry I didn't report this before the 1.4 release.  After having trouble with
beta, I tried writing my own python decoder.  Not so easy, but I've just
finished it, which is where I found what was going on.

Regards,
Russell


------------------------------------------------------------------------------
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