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 /gpsd.c | |
parent | e5fd5732bd5655ad01ab483267aa48589228766b (diff) | |
download | gpsd-adac953ea01392e50d915dd72e637819c9fff0e9.tar.gz |
Enable clients to display the GPS type.
Diffstat (limited to 'gpsd.c')
-rw-r--r-- | gpsd.c | 8 |
1 files changed, 6 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': |