Share incoming data from serial port?

Hi,

I want to sample what's coming from the serial port /dev/cuau0 in a script or program.

The problem is that the serial port is used by ntpd and if I do # cat /dev/cuau0 I can see what's coming from the serial port but I also interrupt the communication between the serial port and ntpd.

Is there a way to share the communication from the serial port to two applications at the same time?

Thanks in advance for any help.

Cheers,
Pete
 
ISTR that gpsd (either astro/gpsd or... damn, there's another gpsd that's part of another GPS port, can't recall) does something like that for GPS devices. But the applications are written to work with it.

That gets trickier with ntpd. Anything between it and a time source could cause accuracy problems.
 
Thanks guys. I will work around it by periodically opening the serial port, steal a few bytes with # dd and then close it.
 
PeteS said:
Thanks guys. I will work around it by periodically opening the serial port, steal a few bytes with # dd and then close it.

For example:
# dd if=/dev/gps0 count=3
 
Back
Top