From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from snark.thyrsus.com (static-71-162-243-5.phlapa.fios.verizon.net [71.162.243.5]) by huchra.bufferbloat.net (Postfix) with ESMTP id EC4B6201B52 for ; Wed, 9 May 2012 23:32:02 -0700 (PDT) Received: by snark.thyrsus.com (Postfix, from userid 1000) id AB4FF40478; Thu, 10 May 2012 02:31:25 -0400 (EDT) Date: Thu, 10 May 2012 02:31:25 -0400 From: "Eric S. Raymond" To: Dave Hart Message-ID: <20120510063125.GC12435@thyrsus.com> References: <02af01cd2daf$05b24bb0$1116e310$@navisys.com.tw> <20120509203719.GA3855@thyrsus.com> <4FAADF21.6030907@techstarship.com> <20120509213841.GB4379@thyrsus.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Eric Conspiracy Secret Labs X-Eric-Conspiracy: There is no conspiracy User-Agent: Mutt/1.5.21 (2010-09-15) 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 Reply-To: esr@thyrsus.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 May 2012 06:32:03 -0000 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