diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2006-10-31 19:45:05 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2006-10-31 19:45:05 +0000 |
commit | adac953ea01392e50d915dd72e637819c9fff0e9 (patch) | |
tree | 432c64e71c375d970ea2924dc23e41a96be5aebf | |
parent | e5fd5732bd5655ad01ab483267aa48589228766b (diff) | |
download | gpsd-adac953ea01392e50d915dd72e637819c9fff0e9.tar.gz |
Enable clients to display the GPS type.
-rw-r--r-- | gpsd.c | 8 | ||||
-rw-r--r-- | gpsd.h | 1 | ||||
-rw-r--r-- | sirf.c | 1 |
3 files changed, 8 insertions, 2 deletions
@@ -761,10 +761,14 @@ static int handle_gpsd_request(struct subscriber_t* sub, char *buf, int buflen) (void)snprintf(phrase, sizeof(phrase), ",G=GPS"); break; case 'I': - if (assign_channel(sub) && sub->device->device_type!=NULL) + if (assign_channel(sub) && sub->device->device_type!=NULL) { (void)snprintf(phrase, sizeof(phrase), ",I=%s", sub->device->device_type->typename); - else + if (sub->device->subtype[0]) { + (void)strlcat(phrase, " ", sizeof(phrase)); + (void)strlcat(phrase, sub->device->subtype, sizeof(phrase)); + } + } else (void)strlcpy(phrase, ",I=?", BUFSIZ); break; case 'J': @@ -149,6 +149,7 @@ struct gps_device_t { size_t outbuflen; unsigned long char_counter; /* count characters processed */ unsigned long retry_counter; /* count sniff retries */ + char subtype[32]; /* firmware version or subtype ID */ double poll_times[FD_SETSIZE]; /* last daemon poll time */ #ifdef NTPSHM_ENABLE int shmindex; @@ -269,6 +269,7 @@ gps_mask_t sirf_parse(struct gps_device_t *session, unsigned char *buf, size_t l case 0x06: /* Software Version String */ gpsd_report(4, "FV 0x06: Firmware version: %s\n", buf+1); + (void)strlcpy(session->subtype, (char *)buf+1, sizeof(session->subtype)); fv = atof((char *)(buf+1)); if (fv < 231) { session->driver.sirf.driverstate |= SIRF_LT_231; |