summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gpsd.c6
-rw-r--r--gpsd.xml8
2 files changed, 9 insertions, 5 deletions
diff --git a/gpsd.c b/gpsd.c
index 17686b3a..f30e39a1 100644
--- a/gpsd.c
+++ b/gpsd.c
@@ -335,7 +335,7 @@ struct subscriber_t {
bool tied; /* client set device with F */
bool watcher; /* is client in watcher mode? */
int raw; /* is client in raw mode? */
- enum {GPS,RTCM104v2,ANY} requires; /* type of device requested */
+ enum {GPS,AIS,RTCM104v2,ANY} requires; /* type of device requested */
struct gps_fix_t fixbuffer; /* info to report to the client */
struct gps_fix_t oldfix; /* previous fix for error modeling */
enum {casoc=0, nocasoc=1} buffer_policy; /* buffering policy */
@@ -602,6 +602,8 @@ static bool allocation_filter(struct gps_device_t *channel,
return true;
else if (user->requires==RTCM104v2 && (channel->packet.type==RTCM2_PACKET))
return true;
+ else if (user->requires==AIS && (channel->packet.type==AIS_PACKET))
+ return true;
else if (user->requires == GPS
&& (channel->packet.type!=RTCM2_PACKET) && (channel->packet.type!=BAD_PACKET))
return true;
@@ -1000,6 +1002,8 @@ static int handle_oldstyle(struct subscriber_t *sub, char *buf, int buflen)
sub->requires = RTCM104v2;
else if (strncasecmp(p, "gps", 3) == 0)
sub->requires = GPS;
+ else if (strncasecmp(p, "ais", 3) == 0)
+ sub->requires = AIS;
else
sub->requires = ANY;
p += strcspn(p, ",\r\n");
diff --git a/gpsd.xml b/gpsd.xml
index 21071452..b33207b7 100644
--- a/gpsd.xml
+++ b/gpsd.xml
@@ -394,16 +394,16 @@ client was attached, and multiple devices were not supported.)</para>
<varlistentry>
<term>g</term>
<listitem>
-<para>With =, accepts a single argument which may have either of the
-values 'gps' or 'rtcm104v2', with case ignored. This specifies the
+<para>With =, accepts a single argument which may have any of the
+values 'gps', 'ais', or 'rtcm104v2', with case ignored. This specifies the
type of information the client wants and forces a device assignment.
Without =, forces a device assignment but doesn't force the type.
This command is optional; if it is not given, the client will be
bound to whatever available device the daemon finds first.</para>
<para>This command returns either '?' if no device of the specified
-type(s) could be assigned, otherwise a string ('GPS' or 'RTCM104v2')
-identifying the kind of information the attached device
+type(s) could be assigned, otherwise a string ('GPS', 'AIS' or
+'RTCM104v2') identifying the kind of information the attached device
returns.</para>
<para>(Earlier versions accepted 'RTCM104' and returned 'RTCM104'