From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-gg0-f171.google.com (mail-gg0-f171.google.com [209.85.161.171]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority" (verified OK)) by huchra.bufferbloat.net (Postfix) with ESMTPS id 867AE21F0B7 for ; Thu, 10 May 2012 07:55:41 -0700 (PDT) Received: by ggki1 with SMTP id i1so1995861ggk.16 for ; Thu, 10 May 2012 07:55:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=t+7kHTHMGaafJL2JOBy9evenfIZGAYsBFEuL6JOKcl4=; b=apJt4xGwmUwPscSWifHOxzUYol5W+5RbpB9gRCD75oHgjLIl4oF4TAuHE7deER2GQs pDNkXPXdUeq6397ulrKzjFEF2WiLUrY05vM7Wn474KcFQJaipBGkH9+qLJWNHH/CL29z SqSIjYc8aQUfrGec5gCwux211Sm+yCqN+9GwR7CFBTEZu60L7ISKeIQ0QZ+uaVwUPucG /wLaukT+F4+ji+s5W8e/EOoJcMBFgnDgAPUkMq3Ci7RsKPzsdAt1VR0Ra+XT2aUsptaH Wk4qNkWJSykAH0RERA5TfSQg48Ueua3GoOdvyxXRPVDq2vyGZ2DxBHlIRAq8rkHgc/Ls EdRg== MIME-Version: 1.0 Received: by 10.60.9.102 with SMTP id y6mr6221227oea.46.1336661740306; Thu, 10 May 2012 07:55:40 -0700 (PDT) Received: by 10.182.113.40 with HTTP; Thu, 10 May 2012 07:55:39 -0700 (PDT) Received: by 10.182.113.40 with HTTP; Thu, 10 May 2012 07:55:39 -0700 (PDT) In-Reply-To: <20120510063125.GC12435@thyrsus.com> References: <02af01cd2daf$05b24bb0$1116e310$@navisys.com.tw> <20120509203719.GA3855@thyrsus.com> <4FAADF21.6030907@techstarship.com> <20120509213841.GB4379@thyrsus.com> <20120510063125.GC12435@thyrsus.com> Date: Thu, 10 May 2012 10:55:39 -0400 Message-ID: From: tz To: esr@thyrsus.com Content-Type: multipart/alternative; boundary=e89a8fb1f184373fac04bfafd03d Cc: thumbgps-devel@lists.bufferbloat.net Subject: Re: [Thumbgps-devel] Article -- Macx-1: GPS receiver with standard USB connector and PPS support X-BeenThere: thumbgps-devel@lists.bufferbloat.net X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 May 2012 14:55:42 -0000 --e89a8fb1f184373fac04bfafd03d Content-Type: text/plain; charset=ISO-8859-1 But this requires a recompile to change lines, not a command line option, or some detection method. If gpsd is compiled for RI, it wont respond to DCD. On May 10, 2012 2:31 AM, "Eric S. Raymond" wrote: > Dave Hart : > > While I appreciate GPSD's flexibility, I advise against exercising it > > needlessly. All of the PPSAPI implementations which support serial > > port control line input that I'm aware of want to see it on the > > carrier detect line. If you know you'll only ever care about using > > the hardware with GPSD, any control line will do for PPS, but to use > > it directly with ntpd, the PPSAPI implementations dictate using the > > DCD line. > > > > I had a vague recollection GPSD could use PPSAPI where it's available. > > If that's true, when GPSD is using PPSAPI, isn't it restricted to > > using carrier detect in practice? > > Which line the PPS arrives on is a hardware feature of the GPS completely > decoupled from anything PPSAPI has any control over. > > There's no code-complexity cost for being flexible. Here's what the > code looks like: > > #define PPS_LINE_TIOC (TIOCM_CD|TIOCM_CAR|TIOCM_RI|TIOCM_CTS) > > /* > * Wait for status change on any handshake line. The only assumption > here > * is that no GPS lights up more than one of these pins. By waiting on > * all of them we remove a configuration switch. > */ > while (1) { > int ok = 0; > char *log = NULL; > char *log1 = NULL; > > if (ioctl(session->gpsdata.gps_fd, TIOCMIWAIT, PPS_LINE_TIOC) != 0) > { > gpsd_report(LOG_ERROR, "PPS ioctl(TIOCMIWAIT) failed: %d > %.40s\n" > , errno, strerror(errno)); > break; > } > > That definition of PPS_LINE_TIOC is quite literally the only place in > GPSD where the identity of the PPS pin matters. It used to not include > TIOCM_CTS, but we got a bug report from someone using sonething called > an "Xtreme104 12 port serial board" which actually mungs all the > handshake lines into CTS. > -- > Eric S. Raymond > _______________________________________________ > Thumbgps-devel mailing list > Thumbgps-devel@lists.bufferbloat.net > https://lists.bufferbloat.net/listinfo/thumbgps-devel > --e89a8fb1f184373fac04bfafd03d Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

But this requires a recompile to change lines, not a command line option= , or some detection method.=A0 If gpsd is compiled for RI, it wont respond = to DCD.

On May 10, 2012 2:31 AM, "Eric S. Raymond&q= uot; <esr@thyrsus.com> wrote:<= br type=3D"attribution">
Dave Hart <d= avehart_gmail_exchange_tee@davehart.net>:
> While I appreciate GPSD's flexibility, I advise against exercising= it
> needlessly. =A0All of the PPSAPI implementations which support serial<= br> > port control line input that I'm aware of want to see it on the > carrier detect line. =A0If you know you'll only ever care about us= ing
> the hardware with GPSD, any control line will do for PPS, but to use > it directly with ntpd, the PPSAPI implementations dictate using the > DCD line.
>
> I had a vague recollection GPSD could use PPSAPI where it's availa= ble.
> =A0If that's true, when GPSD is using PPSAPI, isn't it restric= ted to
> using carrier detect in practice?

Which line the PPS arrives on is a hardware feature of the GPS completely decoupled from anything PPSAPI has any control over.

There's no code-complexity cost for being flexible. =A0Here's what = the
code looks like:

#define PPS_LINE_TIOC (TIOCM_CD|TIOCM_CAR|TIOCM_RI|TIOCM_CTS)

=A0 =A0/*
=A0 =A0 * Wait for status change on any handshake line. The only assumptio= n here
=A0 =A0 * is that no GPS lights up more than one of these pins. =A0By wait= ing on
=A0 =A0 * all of them we remove a configuration switch.
=A0 =A0 */
=A0 =A0while (1) {
=A0 =A0 =A0 =A0int ok =3D 0;
=A0 =A0 =A0 =A0char *log =3D NULL;
=A0 =A0 =A0 =A0char *log1 =3D NULL;

=A0 =A0 =A0 =A0if (ioctl(session->gpsdata.gps_fd, TIOCMIWAIT, PPS_LINE_= TIOC) !=3D 0) {
=A0 =A0 =A0 =A0 =A0 =A0gpsd_report(LOG_ERROR, "PPS ioctl(TIOCMIWAIT) = failed: %d %.40s\n"
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0, errno, strerror(errno));
=A0 =A0 =A0 =A0 =A0 =A0break;
=A0 =A0 =A0 =A0}

That definition of PPS_LINE_TIOC is quite literally the only place in
GPSD where the identity of the PPS pin matters. It used to not include
TIOCM_CTS, but we got a bug report from someone using sonething called
an "Xtreme104 12 port serial board" which actually mungs all the<= br> handshake lines into CTS.
--
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0<a href=3D"http://www.catb.org/~esr/">Eric= S. Raymond</a>
_______________________________________________
Thumbgps-devel mailing list
Thumbgps-devel@list= s.bufferbloat.net
https://lists.bufferbloat.net/listinfo/thumbgps-devel
--e89a8fb1f184373fac04bfafd03d--