summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2015-02-09 13:29:24 -0500
committerEric S. Raymond <esr@thyrsus.com>2015-02-09 13:32:04 -0500
commit7c78d5fdc837d084d61169c975ec204fee604fcf (patch)
treed9bafb6f63d59a3495da47b2553dbe073b4b81be
parentdbf118b5dfef3359aa8c1dc76cda474339594c71 (diff)
downloadgpsd-7c78d5fdc837d084d61169c975ec204fee604fcf.tar.gz
Remove some remnants of the adaptive-delay experiment.
All regression tests pass.
-rw-r--r--gpsd.h-tail8
-rw-r--r--libgpsd_core.c21
2 files changed, 0 insertions, 29 deletions
diff --git a/gpsd.h-tail b/gpsd.h-tail
index b8d9e54c..bf323230 100644
--- a/gpsd.h-tail
+++ b/gpsd.h-tail
@@ -283,14 +283,6 @@ struct gps_context_t {
#endif
ssize_t (*serial_write)(struct gps_device_t *,
const char *buf, const size_t len);
- /*
- * Used for calculation of sleep time before select();
- * needed to sidestep buggy fast-looping selects.
- */
-#define WINDOW_AVG_SIZE 8 /* reset avg after this number of reads */
- float inbytesavg; /* average number of bytes per read */
- unsigned char inbyteswpos;
- bool selectbug; /* true if the slect bug is triggered */
};
/* state for resolving interleaved Type 24 packets */
diff --git a/libgpsd_core.c b/libgpsd_core.c
index dcf268fa..7d8d16fe 100644
--- a/libgpsd_core.c
+++ b/libgpsd_core.c
@@ -300,9 +300,6 @@ void gps_context_init(struct gps_context_t *context,
.shmexport = NULL,
#endif /* SHM_EXPORT_ENABLE */
.serial_write = gpsd_serial_write,
- .inbytesavg = 0.0,
- .inbyteswpos = (char) 0,
- .selectbug = false
};
/*@ +initallelements +nullassign +nullderef +fullinitblock @*/
/* *INDENT-ON* */
@@ -1199,24 +1196,6 @@ gps_mask_t gpsd_poll(struct gps_device_t *session)
newlen = generic_get(session);
}
- /* Calculate window average of read count */
- session->context->inbyteswpos = session->context->inbyteswpos % WINDOW_AVG_SIZE;
- alpha = (session->context->inbyteswpos== (unsigned char) 0) ? 0.0f:1.0f;
- if (newlen > 0)
- session->context->inbytesavg = alpha*session->context->inbytesavg + (float) newlen;
- else
- /* error reading -- counts as 0 */
- session->context->inbytesavg = alpha*session->context->inbytesavg;
-
- if (session->context->inbyteswpos== (unsigned char) (WINDOW_AVG_SIZE-1)) {
- session->context->inbytesavg/=WINDOW_AVG_SIZE;
- }
- session->context->inbyteswpos += (unsigned char) 1;
-
- gpsd_report(&session->context->errout, LOG_RAW,
- "window average of received byte count is %f\n",
- session->context->inbytesavg);
-
/* update the scoreboard structure from the GPS */
gpsd_report(&session->context->errout, LOG_RAW + 2,
"%s sent %zd new characters\n",