[LinuxPPS] LinuxPPS - odd behaviour. (Please Read)

Rodolfo Giometti giometti at enneenne.com
Fri Nov 9 11:50:28 CET 2007


On Thu, Nov 08, 2007 at 02:37:11PM -0700, clemens at dwf.com wrote:
> 
> OK, the logic I suggested earlier isnt going to work for two reasons.
>     (1) the link may be a hard link rather than a symbolic link, so
>           readlink isnt going to work.
>     (2)  until the 'parent' device, /dev/ppssource (in Udo's nomenclature)
>           is opened, your probably not going to see anything in /sys.
> 
> How about this:
> 
>     (a) Add a third device to the list of symbolic links, for the oncore 
>          they would be
>             /dev/oncore.serial.0
>             /dev/oncore.pps.0
>             /dev/oncore.ppssource.0
> 
> ppssource, ppsparent, I have no strong feelings as to its name.
> OK, with the logic below, it would only need to be specified *if* the ppssource
> file was not the same as the serial file, so current users dont need to know 
> about
> it unless they are using the parallel-port pps, which is unlikely.
> 
> OK, here we go:
>         (a) open the serial file, call this fd1
>         (b) compare the serial and ppssource files using my stty logic, 
>               if they are the same, go to (d)
>               if ppssource does not exist go to (d)
>               otherwise open ppssource as fd3, and we can ignore its file 
> descriptor
> 	except for possibly closing it when we exit.
>         (c)  compare the serial and pps files using my stty logic.
> 	if they are the same just set fd2 = fd1
> 	if they differ then open pps and call it fd2.
>         (d) end
>   
> Anyone see any holes in this one?

I think we are going to complicate things with no reasonable reasons. :)

We can simply point out that refclock works only iif:

* the alternate device is a "child" of the main device, so it is
  enabled by its "parent", or

* the alternate device is connected to an hardware which is enabled
  directly by doing open() on it.

Ciao,

Rodolfo

-- 

GNU/Linux Solutions                  e-mail:    giometti at enneenne.com
Linux Device Driver                             giometti at gnudd.com
Embedded Systems                     		giometti at linux.it
UNIX programming                     phone:     +39 349 2432127



More information about the LinuxPPS mailing list