diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2011-01-25 13:32:06 -0500 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2011-01-25 13:32:06 -0500 |
commit | 5f4a2717737a4c8c5a94ca70f47893db83a7cc30 (patch) | |
tree | 0ee988275f485af925468e5640bc9c0e506bb526 /cgps.c | |
parent | e1b64326fdd3037c5a380e9e85e549350bb4bde5 (diff) | |
download | gpsd-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.c | 26 |
1 files changed, 11 insertions, 15 deletions
@@ -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); } } |