[LinuxPPS] LinuxPPS - odd behaviour. (Please Read)
clemens at dwf.com
clemens at dwf.com
Thu Nov 8 22:37:11 CET 2007
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?
--
Reg.Clemens
reg at dwf.com
More information about the LinuxPPS
mailing list