summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2011-02-22 08:16:31 -0500
committerEric S. Raymond <esr@thyrsus.com>2011-02-22 13:01:55 -0500
commitd4c7e7bb9c9bcb0fcbd8af0a3a79e6d884f53dda (patch)
treeb130525a63185405d7044e9fea96fdf8989a0cc8
parentaca2b1ad6b2593799a0f3848d84dd95bc039546f (diff)
downloadgpsd-d4c7e7bb9c9bcb0fcbd8af0a3a79e6d884f53dda.tar.gz
Move a warning about speeds < 38400 that triggered too often.
I have profiled. For GPS data, 9600 is sufficient. The exception is if subframe data is enabled.
-rw-r--r--gpsd.h-tail1
-rw-r--r--libgpsd_core.c3
-rw-r--r--subframe.c7
3 files changed, 8 insertions, 3 deletions
diff --git a/gpsd.h-tail b/gpsd.h-tail
index ebdaf40a..43fc49ab 100644
--- a/gpsd.h-tail
+++ b/gpsd.h-tail
@@ -350,6 +350,7 @@ struct gps_device_t {
int saved_baud;
struct gps_packet_t packet;
int getcount;
+ int subframe_count;
char subtype[64]; /* firmware version or subtype ID */
double opentime;
double releasetime;
diff --git a/libgpsd_core.c b/libgpsd_core.c
index 0934dc6a..fb03f9ac 100644
--- a/libgpsd_core.c
+++ b/libgpsd_core.c
@@ -1420,9 +1420,6 @@ gps_mask_t gpsd_poll(struct gps_device_t *session)
session->device_type->type_name,
timestamp() - session->opentime,
speed);
- if ( 38400 > speed ) {
- gpsd_report(LOG_WARN, "speed less than 38,400 may cause data lag and loss of functionality\n");
- }
/*@+nullderef@*/
/* fire the identified hook */
if (session->device_type != NULL
diff --git a/subframe.c b/subframe.c
index 7738d7d7..48d90bfd 100644
--- a/subframe.c
+++ b/subframe.c
@@ -18,6 +18,13 @@ gps_mask_t gpsd_interpret_subframe_raw(struct gps_device_t *session,
uint8_t preamble;
uint32_t parity;
+ if (session->subframe_count++ == 0) {
+ speed_t speed = gpsd_get_speed(&session->ttyset);
+
+ if (speed < 38400)
+ gpsd_report(LOG_WARN, "speed less than 38,400 may cause data lag and loss of functionality\n");
+ }
+
/*
* This function assumes an array of 10 ints, each of which carries
* a raw 30-bit GPS word use your favorite search engine to find the