gpsd-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gpsd-dev] problem with gpsmon for an oncore device


From: Mick Durkin
Subject: [gpsd-dev] problem with gpsmon for an oncore device
Date: Thu, 17 Oct 2013 21:31:56 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130805 Thunderbird/17.0.8

Hi Gents,

I noticed that I was getting suspicious "unhealthy" flags against certain SVs when using gpsmon with an Oncore device.

I checked the packet dump and all the SVs were showing good health, so I had a dig into the code of monitor_oncore.c. It looks as though the "health" variable is being read too "early" in the buffer. The "az" variable which precedes it is a 16 bit value, so the offset between them should be 2 bytes, not one.

Here is my suggestion for a fix. The last line of the embedded diff wraps locally in my mailer as the original source line is over 80 characters. I'm not sure how that will show up when it reaches you.

BR

Mick

=====================================

$ git diff -u
diff --git a/monitor_oncore.c b/monitor_oncore.c
index ed2d1dc..f5aec8d 100644
--- a/monitor_oncore.c
+++ b/monitor_oncore.c
@@ -326,7 +326,7 @@ static void oncore_update(void)
            doppl = (int)getbes16(buf, off + 1);
            el = (int)getub(buf, off + 3);
            az = (int)getbeu16(buf, off + 4);
-           health = (int)getub(buf, off + 5);
+           health = (int)getub(buf, off + 6);

            (void)wmove(Bbwin, (int)Bblines[i], 1);
(void)wprintw(Bbwin, "%3d %3d %2d %5d %c%c", sv, az, el, doppl, (health & 0x02) ? 'U' : ' ', /* unhealthy */



reply via email to

[Prev in Thread] Current Thread [Next in Thread]