summaryrefslogtreecommitdiff
path: root/gpsd.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2006-10-31 19:45:05 +0000
committerEric S. Raymond <esr@thyrsus.com>2006-10-31 19:45:05 +0000
commitadac953ea01392e50d915dd72e637819c9fff0e9 (patch)
tree432c64e71c375d970ea2924dc23e41a96be5aebf /gpsd.c
parente5fd5732bd5655ad01ab483267aa48589228766b (diff)
downloadgpsd-adac953ea01392e50d915dd72e637819c9fff0e9.tar.gz
Enable clients to display the GPS type.
Diffstat (limited to 'gpsd.c')
-rw-r--r--gpsd.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/gpsd.c b/gpsd.c
index 5b96236b..b0f7e87d 100644
--- a/gpsd.c
+++ b/gpsd.c
@@ -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':