diff options
-rw-r--r-- | TODO | 22 | ||||
-rw-r--r-- | gpsd.h | 3 | ||||
-rw-r--r-- | isgps.c | 2 | ||||
-rw-r--r-- | libgpsd_core.c | 6 | ||||
-rw-r--r-- | packet.c | 3 | ||||
-rw-r--r-- | rtcmdecode.1 | 2 | ||||
-rw-r--r-- | serial.c | 6 |
7 files changed, 23 insertions, 21 deletions
@@ -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 @@ -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; @@ -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++; @@ -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" @@ -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) |