gpsd-dev
[Top][All Lists]
Advanced

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

Re: gpsd subscribers.policy.watcher never be set true


From: Zarey Chang
Subject: Re: gpsd subscribers.policy.watcher never be set true
Date: Tue, 14 Jul 2020 11:59:56 +0800

Hi Gary,
Ok, I get it: some clients does not always watch gpsd data, they request data with "gpsd_json protocal" by themselves.
After added " ?WATCH={"nmea":true}" , GeoClue could received nmea data.
thanks very much.

<gpsd-dev-request@nongnu.org> 于2020年7月14日周二 上午12:00写道:
Send gpsd-dev mailing list submissions to
        gpsd-dev@nongnu.org

To subscribe or unsubscribe via the World Wide Web, visit
        https://lists.nongnu.org/mailman/listinfo/gpsd-dev
or, via email, send a message with subject or body 'help' to
        gpsd-dev-request@nongnu.org

You can reach the person managing the list at
        gpsd-dev-owner@nongnu.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of gpsd-dev digest..."


Today's Topics:

   1. gpsd subscribers.policy.watcher never be set true (Zarey Chang)
   2. Re: gpsd subscribers.policy.watcher never be set true
      (Gary E. Miller)


----------------------------------------------------------------------

Message: 1
Date: Mon, 13 Jul 2020 10:21:18 +0800
From: Zarey Chang <z2care@gmail.com>
To: gpsd-dev@nongnu.org
Subject: gpsd subscribers.policy.watcher never be set true
Message-ID:
        <CAGV3Pyj4N_isUuAeGhG4AQZHWTgEBmb1uZgdrVZMxqcKG7Xfxg@mail.gmail.com" target="_blank">CAGV3Pyj4N_isUuAeGhG4AQZHWTgEBmb1uZgdrVZMxqcKG7Xfxg@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

Hi,

Now, my high level app(GeoClue) connect gpsd with socket by some
modification, but it could not received any data but only first version
from gpsd.

I find out a thread:
https://lists.nongnu.org/archive/html/gpsd-dev/2013-06/msg00000.html
===>

--- 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];
     }
     }

*<===*


I found subscriber.policy.watcher and .nmea had never been set to true in
gpsd3.19, is it for some reason? Because in function gpsd.c:all_reaports()
, only when sub->policy.watcher and sub->policy.nmea are true,
the pseudonmea_report was be performed.

So, If it is not a bug, how can I receive data from gpsd? why gpsd still
check ub->policy.watcher and sub->policy.nmea?

BR.

--
Zarey C.Y. Chang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.nongnu.org/archive/html/gpsd-dev/attachments/20200713/8ddc48db/attachment.html>

------------------------------

Message: 2
Date: Sun, 12 Jul 2020 19:36:57 -0700
From: "Gary E. Miller" <gem@rellim.com>
To: gpsd-dev@nongnu.org
Subject: Re: gpsd subscribers.policy.watcher never be set true
Message-ID: <20200712193657.4b976176@rellim.com" target="_blank">20200712193657.4b976176@rellim.com>
Content-Type: text/plain; charset="utf-8"

Yo Zarey!

On Mon, 13 Jul 2020 10:21:18 +0800
Zarey Chang <z2care@gmail.com> wrote:

> Now, my high level app(GeoClue) connect gpsd with socket by some
> modification, but it could not received any data but only first
> version from gpsd.

What is the command you send to gpsd to get gpsd data?

> I find out a thread:
> https://lists.nongnu.org/archive/html/gpsd-dev/2013-06/msg00000.html

2013 is a tad old.

>      if (subscribers[si].fd == UNALLOCATED_FD) {

So when the socket is unused (UNALLOCATED).

> +        subscribers[si].policy.watcher = true;

Turn on watching of unused fd?  I think not.

> +        subscribers[si].policy.nmea    = true;

The client is supposed to provide this.  Some clients want NMEA, some not.

> +        subscribers[si].policy.json    = false;

The client is supposed to provide this.  Some clients want JSON, some not.

> So, If it is not a bug,

Not a bug.  Just defaults that you override.

> how can I receive data from gpsd?

Depends on what data you want.  NMEA?  JSON?  scaled?  etc.

> why gpsd
> still check ub->policy.watcher and sub->policy.nmea?

Because many clients do not want NMEA, or are not watching all the time.

If you want nmea, send something like this:
        ?WATCH={"nmea":true}

The options are documented in "man gpsd_json".

RGDS
GARY
---------------------------------------------------------------------------
Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703
        gem@rellim.com  Tel:+1 541 382 8588

            Veritas liberabit vos. -- Quid est veritas?
    "If you can't measure it, you can't improve it." - Lord Kelvin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 851 bytes
Desc: OpenPGP digital signature
URL: <https://lists.nongnu.org/archive/html/gpsd-dev/attachments/20200712/e9111a0b/attachment.sig>

------------------------------

Subject: Digest Footer

_______________________________________________
gpsd-dev mailing list
gpsd-dev@nongnu.org
https://lists.nongnu.org/mailman/listinfo/gpsd-dev


------------------------------

End of gpsd-dev Digest, Vol 106, Issue 5
****************************************


--
Zarey C.Y. Chang

reply via email to

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