summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2005-05-25 14:38:37 +0000
committerEric S. Raymond <esr@thyrsus.com>2005-05-25 14:38:37 +0000
commitb0554b4411443e203f98ebefb5bf46a2388d0a75 (patch)
treecf702e67d58737b822032e81ccdcd049b48dfb63
parentefb0c81d002a087b905147de37d25410dedcab66 (diff)
downloadgpsd-b0554b4411443e203f98ebefb5bf46a2388d0a75.tar.gz
Rob Janssen's fix for PPS threading.
-rw-r--r--gpsd.c5
-rw-r--r--gpsd.h10
-rw-r--r--libgpsd_core.c2
-rw-r--r--ntpshm.c5
-rw-r--r--sirfmon.c16
-rw-r--r--www/index.html.in11
6 files changed, 33 insertions, 16 deletions
diff --git a/gpsd.c b/gpsd.c
index 5a8899e6..bed93409 100644
--- a/gpsd.c
+++ b/gpsd.c
@@ -59,6 +59,9 @@ static struct gps_context_t context = {0, LEAP_SECONDS, CENTURY_BASE,
#ifdef NTPSHM_ENABLE
{0},
{0},
+# ifdef PPS_ENABLE
+ 0,
+# endif /* PPS_ENABLE */
#endif /* NTPSHM_ENABLE */
};
@@ -919,7 +922,7 @@ int main(int argc, char *argv[])
#ifdef NTPSHM_ENABLE
nice(-10); /* for precise timekeeping, increase priority */
- ntpshm_init(&context);
+ ntpshm_init(&context,nowait);
#endif /* NTPSHM_ENABLE */
/* make default devices accessible even after we drop privileges */
diff --git a/gpsd.h b/gpsd.h
index f86c3109..cc30d2fd 100644
--- a/gpsd.h
+++ b/gpsd.h
@@ -36,6 +36,9 @@ struct gps_context_t {
#ifdef NTPSHM_ENABLE
struct shmTime *shmTime[NTPSHMSEGS];
int shmTimeInuse[NTPSHMSEGS];
+# ifdef PPS_ENABLE
+ int shmTimePPS;
+# endif /* PPS_ENABLE */
#endif /* NTPSHM_ENABLE */
};
@@ -108,6 +111,9 @@ struct gps_device_t {
#ifdef SIRFII_ENABLE
unsigned long satcounter;
#endif /* SIRFII_ENABLE */
+#ifdef TSIP_ENABLE
+ time_t last_request; /* Last time a packets were sent */
+#endif /* SIRFII_ENABLE */
#ifdef GARMIN_ENABLE /* private housekeeping stuff for the Garmin driver */
void *GarminBuffer; /* Pointer Garmin packet buffer
void *, to keep the packet details out of the
@@ -138,7 +144,7 @@ struct gps_device_t {
int shmTime;
# ifdef PPS_ENABLE
int shmTimeP;
-# endif /* NTPSHM_ENABLE */
+# endif /* PPS_ENABLE */
#endif /* NTPSHM_ENABLE */
};
@@ -174,7 +180,7 @@ extern void gpsd_binary_quality_dump(struct gps_device_t *, char *);
extern int netlib_connectsock(const char *, const char *, const char *);
-extern int ntpshm_init(struct gps_context_t *);
+extern int ntpshm_init(struct gps_context_t *, int);
extern int ntpshm_alloc(struct gps_context_t *context);
extern int ntpshm_free(struct gps_context_t *context, int segment);
extern int ntpshm_put(struct gps_device_t *, double);
diff --git a/libgpsd_core.c b/libgpsd_core.c
index c6b41860..70f926a6 100644
--- a/libgpsd_core.c
+++ b/libgpsd_core.c
@@ -174,7 +174,7 @@ int gpsd_activate(struct gps_device_t *session)
#ifdef NTPSHM_ENABLE
session->shmTime = ntpshm_alloc(session->context);
#if defined(PPS_ENABLE) && defined(TIOCMIWAIT)
- if (session->shmTime >= 0) {
+ if (session->shmTime >= 0 && session->context->shmTimePPS) {
if ((session->shmTimeP = ntpshm_alloc(session->context)) >= 0)
pthread_create(&pt,NULL,gpsd_ppsmonitor, (void *)session);
}
diff --git a/ntpshm.c b/ntpshm.c
index 562ccf9c..42469729 100644
--- a/ntpshm.c
+++ b/ntpshm.c
@@ -65,7 +65,7 @@ static struct shmTime *getShmTime(int unit)
/* attach all NTP SHM segments. called once at startup, while still root */
-int ntpshm_init(struct gps_context_t *context)
+int ntpshm_init(struct gps_context_t *context, int enablepps)
{
int i;
@@ -73,6 +73,9 @@ int ntpshm_init(struct gps_context_t *context)
context->shmTime[i] = getShmTime(i);
memset(context->shmTimeInuse,0,sizeof(context->shmTimeInuse));
+# ifdef PPS_ENABLE
+ context->shmTimePPS = enablepps;
+# endif /* PPS_ENABLE */
return 1;
}
diff --git a/sirfmon.c b/sirfmon.c
index e938b4ba..63ea4030 100644
--- a/sirfmon.c
+++ b/sirfmon.c
@@ -103,11 +103,11 @@ static WINDOW *mid19win, *mid27win, *cmdwin, *debugwin;
#define SIRF_PACKET 1
#define NMEA_PACKET 2
-/******************************************************************************
+/*****************************************************************************
*
* NMEA command composition
*
- ******************************************************************************/
+ *****************************************************************************/
static void nmea_add_checksum(char *sentence)
/* add NMEA checksum to a possibly *-terminated sentence */
@@ -146,11 +146,11 @@ static int nmea_send(int fd, const char *fmt, ... )
}
}
-/******************************************************************************
+/*****************************************************************************
*
* SiRF packet-decoding routines
*
- ******************************************************************************/
+ *****************************************************************************/
static void decode_time(int week, int tow)
{
@@ -537,11 +537,11 @@ static void decode_sirf(unsigned char buf[], int len)
wprintw(debugwin, "\n");
}
-/******************************************************************************
+/*****************************************************************************
*
* Serial-line handling
*
- ******************************************************************************/
+ *****************************************************************************/
static int get_speed(struct termios* ttyctl)
{
@@ -792,11 +792,11 @@ static int sendpkt(unsigned char *buf, int len)
return (write(gps_fd,buf,len) == len);
}
-/******************************************************************************
+/*****************************************************************************
*
* Main sequence and display machinery
*
- ******************************************************************************/
+ *****************************************************************************/
static int tzoffset(void)
{
diff --git a/www/index.html.in b/www/index.html.in
index 960e262b..82cd122d 100644
--- a/www/index.html.in
+++ b/www/index.html.in
@@ -172,6 +172,9 @@ GPS</a> receivers.</p>
<p>We supply a Gentoo Linux <a href="gpsd.ebuild">ebuild
script</a>.</p>
+<p>You can find Debian-stable packages
+<a href='http://packages.debian.org/unstable/misc/gpsd'>here</a>.</p>
+
<h1 id='others'>Other GPSDs</h1>
<p>There are two Linux-based forks of <code>gpsd</code> in the wild, but
@@ -202,9 +205,11 @@ program that simulates the output of a GPS in motion, and can be used
for testing GPS-aware applications.</p>
<p>We aren't Green Parrot Software Development, nor are we the
-Greenville Public School District or the Greater Peoria Sanitary
-District, nor do we have anything to do with the General Product
-Safety Directive.</p>
+Greenville Public School District nor the Greater Peoria Sanitary
+District, nor even the Greater Portland Soccer District, nor the Green
+Party of San Diego, nor do we have anything to do with the General
+Product Safety Directive, the the Guiding Principles of Sustainable
+Design, nor the Glatt Plagiarism Self-Detection Program.</p>
</div>
<hr/>