diff options
author | Keith Packard <keithp@keithp.com> | 2009-08-21 10:47:46 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2009-08-21 10:47:46 -0700 |
commit | 0d65bff443c17d4d98c18b620ec075ab66b30efd (patch) | |
tree | 6716972968e065a5a1c72b7dfd77e834b1679b09 | |
parent | 4486d9156e19e4280b42bcd422d81d04f2d04a92 (diff) |
Turn off GPS tracking data when not present in data stream
Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r-- | ao-view/aoview_monitor.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ao-view/aoview_monitor.c b/ao-view/aoview_monitor.c index 1f4c8f72..8564014b 100644 --- a/ao-view/aoview_monitor.c +++ b/ao-view/aoview_monitor.c @@ -136,6 +136,7 @@ aoview_monitor_parse(const char *input_line) data.gps.gps_time.hour = data.gps.gps_time.minute = data.gps.gps_time.second = 0; data.gps.lat = data.gps.lon = 0; data.gps.alt = 0; + tracking_pos = -1; } if (nword >= 46) { data.gps.gps_extended = 1; @@ -154,7 +155,7 @@ aoview_monitor_parse(const char *input_line) data.gps.h_error = 0; data.gps.v_error = 0; } - if (nword >= tracking_pos + 2 && strcmp(words[tracking_pos], "SAT") == 0) { + if (tracking_pos >= 0 && nword >= tracking_pos + 2 && strcmp(words[tracking_pos], "SAT") == 0) { int c, n, pos; aoview_parse_int(&n, words[tracking_pos + 1]); pos = tracking_pos + 2; @@ -172,6 +173,8 @@ aoview_monitor_parse(const char *input_line) } else { data.gps_tracking.channels = 0; } + } else { + data.gps_tracking.channels = 0; } aoview_state_notify(&data); return TRUE; |