gpsd-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gpsd-dev] nmea watch enabled at client connect?


From: Bernd Ocklin
Subject: [gpsd-dev] nmea watch enabled at client connect?
Date: Wed, 5 Jun 2013 11:36:20 +0200 (CEST)

Hi,

the below 3 lines enable / disable nmea when a new subscriber connects. This is
needed to serve apps like iNavX who don't speak gpsd. Would a proper patch have
any chance to get review and into gpsd when I submit one?

How about a new config option -W (--watch)? This option has either the json
command string {"enabled": true, ...} or a simple string "nmea, raw" as
parameter:

e.g. gpsd -W '{"enabled": true, "nmea": true, ...}'

or

gpsd -W 'nmea,json' if you want to enable nmea and json format at client
subscription.

Any preferences?

I use this patch in production with a hardcoded change in allocate_client() but
happy to provide a better patch with config options and proper formating if
there is interest.

--- a/gpsd.c
+++ b/gpsd.c
@@ -549,6 +549,9 @@ static /address@hidden@*//address@hidden@ */ struct
     for (si = 0; si < NITEMS(subscribers); si++) {
     if (subscribers[si].fd == UNALLOCATED_FD) {
         subscribers[si].fd = 0;    /* mark subscriber as allocated */
+        subscribers[si].policy.watcher = true;
+        subscribers[si].policy.nmea    = true;
+        subscribers[si].policy.json    = false;
         return &subscribers[si];
     }
     }

Bernd



reply via email to

[Prev in Thread] Current Thread [Next in Thread]