summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--TODO22
-rw-r--r--gpsd.h3
-rw-r--r--isgps.c2
-rw-r--r--libgpsd_core.c6
-rw-r--r--packet.c3
-rw-r--r--rtcmdecode.12
-rw-r--r--serial.c6
7 files changed, 23 insertions, 21 deletions
diff --git a/TODO b/TODO
index 20c4cb2a..8349aa93 100644
--- a/TODO
+++ b/TODO
@@ -93,27 +93,27 @@ packet-cracking needed to get the data off the chips.
We have an RTCM packet decoder. Here's the plan for the rest of it:
-1) Add code to packet.c that can recognize RTCM104 data packets. This
- would be the hard part -- that format is *nasty*.
+1) Finish the packet.c code that recognizes RTCM104 data packets.
+ When that's done we'll have RTCM104 sessions integrated into the
+ gpsd architecture; we can hand RTCM104 sources like DGPS radios to
+ gpsd on the command line or via the control socket, just like
+ GPSes.
-2) Write a trivial RTCM104 driver that just copies recognized packets
- into a save buffer. Now we have RTCM104 sessions integrated into
- the gpsd architecture; we can hand RTCM104 sources like DGPS radios
- to gpsd on the command line or via the control socket, just like GPSes.
-
-3) Arrange for packets from any attached RTCM104 sessions to get
+2) Arrange for packets from any attached RTCM104 sessions to get
automatically copied from their save buffers to any GPSes attached.
-4) When there are attached RTCM104 sources, tell the daemon to serve
+3) When there are attached RTCM104 sources, tell the daemon to serve
these packets on port 2101. At this point we will have replaced
- dgpsip's server function, through not yet its RTCM dumper function.
+ dgpsip's server function.
-5) Get rid of the -d option by hacking open_device() so that when it
+4) Get rid of the -d option by hacking open_device() so that when it
sees a command-line option of the form server:port (with no
embedded backslashes) it opens a socket to read from that server.
Now any GPS-packet and RTCM data sources given on the command line
can be remote as well as local.
+5) Make RTCM encoding work with an 'invert' option to rtcmdecode.
+
*** Do the research to figure out just what is going on with status bits
NMEA actually has *four* kinds of validity bits: Mode, Status, the
diff --git a/gpsd.h b/gpsd.h
index 40131c44..1166ad38 100644
--- a/gpsd.h
+++ b/gpsd.h
@@ -124,7 +124,8 @@ struct gps_device_t {
unsigned /*@observer@*/char *inbufptr;
unsigned char outbuffer[MAX_PACKET_LENGTH+1];
size_t outbuflen;
- unsigned long counter;
+ unsigned long char_counter; /* count characters processed */
+ unsigned long retry_counter; /* count sniff retries */
double poll_times[FD_SETSIZE]; /* last daemon poll time */
#ifdef NTPSHM_ENABLE
int shmTime;
diff --git a/isgps.c b/isgps.c
index 8ea83d9f..cbed50e2 100644
--- a/isgps.c
+++ b/isgps.c
@@ -207,7 +207,7 @@ enum isgpsstat_t isgps_decode(struct gps_device_t *session,
} else {
session->driver.isgps.curr_word |= c >> -(session->driver.isgps.curr_offset);
}
- gpsd_report(RTCM_ERRLEVEL_BASE+2, "syncing at byte %d: %0x%08x\n", session->counter, session->driver.isgps.curr_word);
+ gpsd_report(RTCM_ERRLEVEL_BASE+2, "syncing at byte %d: %0x%08x\n", session->char_counter, session->driver.isgps.curr_word);
if (preamble_match(&session->driver.isgps.curr_word)) {
if (isgpsparityok(session->driver.isgps.curr_word)) {
diff --git a/libgpsd_core.c b/libgpsd_core.c
index bc7c9ef0..fef3b969 100644
--- a/libgpsd_core.c
+++ b/libgpsd_core.c
@@ -155,7 +155,8 @@ int gpsd_activate(struct gps_device_t *session)
#ifdef SIRFII_ENABLE
session->driver.sirf.satcounter = 0;
#endif /* SIRFII_ENABLE */
- session->counter = 0;
+ session->char_counter = 0;
+ session->retry_counter = 0;
gpsd_report(1, "gpsd_activate: opened GPS (%d)\n", session->gpsdata.gps_fd);
// session->gpsdata.online = 0;
session->gpsdata.fix.mode = MODE_NOT_SEEN;
@@ -564,8 +565,7 @@ gps_mask_t gpsd_poll(struct gps_device_t *session)
gps_merge_fix(&session->gpsdata.fix, received, &session->gpsdata.newdata);
session->gpsdata.set = ONLINE_SET | dopmask | received;
- /* count all packets and good fixes */
- session->counter++;
+ /* count good fixes */
if (session->gpsdata.status > STATUS_NO_FIX)
session->context->fixcnt++;
diff --git a/packet.c b/packet.c
index 49fddec1..bfe61c54 100644
--- a/packet.c
+++ b/packet.c
@@ -623,10 +623,11 @@ ssize_t packet_parse(struct gps_device_t *session, size_t newdata)
};
nextstate(session, c);
gpsd_report(7, "%08ld: character '%c' [%02x], new state: %s\n",
- session->counter,
+ session->char_counter,
(isprint(c)?c:'.'),
c,
state_table[session->packet_state]);
+ session->char_counter++;
if (session->packet_state == GROUND_STATE) {
character_discard(session);
diff --git a/rtcmdecode.1 b/rtcmdecode.1
index 667e26b0..df43ff8c 100644
--- a/rtcmdecode.1
+++ b/rtcmdecode.1
@@ -60,7 +60,7 @@ Ordering instructions are accessible from the website of the Radio Technical Com
.SH "BUGS"
.PP
-This program will fail quietly, never achieving sync lock with the RTCM stream, on a non\-little\-endian machine\&. The decoder logic is sufficiently convoluted to confuse some compiler optimizers, notably in GCC 3\&.x at \-O2, into generating bad code\&.
+The decoder logic is sufficiently convoluted to confuse some compiler optimizers, notably in GCC 3\&.x at \-O2, into generating bad code\&.
.SH "AUTHOR"
diff --git a/serial.c b/serial.c
index 41861448..68a13c47 100644
--- a/serial.c
+++ b/serial.c
@@ -142,7 +142,7 @@ int gpsd_open(struct gps_device_t *session)
session->ttyset.c_cflag |= CREAD | CLOCAL;
session->ttyset.c_iflag = session->ttyset.c_oflag = session->ttyset.c_lflag = (tcflag_t) 0;
- session->counter = session->baudindex = 0;
+ session->baudindex = 0;
gpsd_set_speed(session,
gpsd_get_speed(&session->ttyset_old), 'N', 1);
}
@@ -163,8 +163,8 @@ bool gpsd_next_hunt_setting(struct gps_device_t *session)
/* every rate we're likely to see on a GPS */
static unsigned int rates[] = {0, 4800, 9600, 19200, 38400, 57600};
- if (session->counter++ >= SNIFF_RETRIES) {
- session->counter = 0;
+ if (session->retry_counter++ >= SNIFF_RETRIES) {
+ session->retry_counter = 0;
if (session->baudindex++ >= (unsigned int)(sizeof(rates)/sizeof(rates[0]))) {
session->baudindex = 0;
if (session->gpsdata.stopbits++ >= 2)