summaryrefslogtreecommitdiff
path: root/cgps.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2011-01-25 13:32:06 -0500
committerEric S. Raymond <esr@thyrsus.com>2011-01-25 13:32:06 -0500
commit5f4a2717737a4c8c5a94ca70f47893db83a7cc30 (patch)
tree0ee988275f485af925468e5640bc9c0e506bb526 /cgps.c
parente1b64326fdd3037c5a380e9e85e549350bb4bde5 (diff)
downloadgpsd-5f4a2717737a4c8c5a94ca70f47893db83a7cc30.tar.gz
The raw_hook mwember and set_raw_hook are gone; client API cleanup is done.
Diffstat (limited to 'cgps.c')
-rw-r--r--cgps.c26
1 files changed, 11 insertions, 15 deletions
diff --git a/cgps.c b/cgps.c
index 55c3ff3a..f124f546 100644
--- a/cgps.c
+++ b/cgps.c
@@ -416,8 +416,7 @@ static void resize(int sig UNUSED)
#ifdef TRUENORTH
/* This gets called once for each new compass sentence. */
-static void update_compass_panel(struct gps_data_t *gpsdata,
- char *message, size_t len UNUSED)
+static void update_compass_panel(struct gps_data_t *gpsdata)
{
char scr[128];
/* Print time/date. */
@@ -471,8 +470,7 @@ static void update_compass_panel(struct gps_data_t *gpsdata,
#endif /* TRUENORTH */
/* This gets called once for each new GPS sentence. */
-static void update_gps_panel(struct gps_data_t *gpsdata,
- char *message, size_t len UNUSED)
+static void update_gps_panel(struct gps_data_t *gpsdata)
{
int i, j, n;
int newstate;
@@ -708,7 +706,7 @@ static void update_gps_panel(struct gps_data_t *gpsdata,
/* Be quiet if the user requests silence. */
if (!silent_flag && raw_flag) {
- (void)waddstr(messages, message);
+ (void)waddstr(messages, gpsdata->buffer);
}
/* Reset the status_timer if the state has changed. */
@@ -870,16 +868,6 @@ int main(int argc, char *argv[])
windowsetup();
- /* Here's where updates go now that things are established. */
-#ifdef TRUENORTH
- if (compass_flag) {
- gps_set_raw_hook(&gpsdata, update_compass_panel);
- } else
-#endif /* TRUENORTH */
- {
- gps_set_raw_hook(&gpsdata, update_gps_panel);
- }
-
status_timer = time(NULL);
(void)gps_stream(&gpsdata, WATCH_ENABLE, NULL);
@@ -909,6 +897,14 @@ int main(int argc, char *argv[])
if (gps_read(&gpsdata) == -1) {
fprintf(stderr, "cgps: socket error 4\n");
die(errno == 0 ? GPS_GONE : GPS_ERROR);
+ } else {
+ /* Here's where updates go now that things are established. */
+#ifdef TRUENORTH
+ if (compass_flag)
+ update_compass_panel(&gpsdata);
+ else
+#endif /* TRUENORTH */
+ update_gps_panel(&gpsdata);
}
}