From: Keith Packard Date: Sun, 22 Nov 2009 02:57:45 +0000 (-0800) Subject: Decode HDOP data from skytraq GPS X-Git-Tag: debian/0.6+43+gd6ba07e~10 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=80b23f3044a654d61212891a61fadb8a3a4e5572;ds=sidebyside Decode HDOP data from skytraq GPS The hdop data was getting dropped on the floor, but is rather useful when deciding if the GPS position is crazy or not. This reports HDOP * 5 (giving a useful range of .2-50). Signed-off-by: Keith Packard --- diff --git a/src/ao_gps_skytraq.c b/src/ao_gps_skytraq.c index bf192f28..ef581349 100644 --- a/src/ao_gps_skytraq.c +++ b/src/ao_gps_skytraq.c @@ -271,7 +271,15 @@ ao_gps(void) __reentrant ao_gps_next.flags |= i; ao_gps_lexchar(); - ao_gps_skip_field(); /* Horizontal dilution */ + ao_gps_next.hdop = ao_gps_decimal(0xff); + if (ao_gps_next.hdop <= 50) { + ao_gps_next.hdop = (uint8_t) 5 * ao_gps_next.hdop; + if (ao_gps_char == '.') + ao_gps_next.hdop = (ao_gps_next.hdop + + ((uint8_t) ao_gps_decimal(1) >> 1)); + } else + ao_gps_next.hdop = 255; + ao_gps_skip_field(); ao_gps_next.altitude = ao_gps_decimal(0xff); ao_gps_skip_field(); /* skip any fractional portion */