Re: Reading data from a tty
- From: <laixsoft@xxxxxxxxxxxx>
- Date: Thu, 20 Apr 2006 01:13:58 GMT
I have a serial line going to tty1, where tty1 would be receiving
data in burst.
I need to know how to read that burst of data, and then save it to a
file in the system.
This can be trivial or it can be complicated. There are two things:
1) Do you want to append each burst to a single file or have one file for
each burst?
2) If the answer to #1 is a separate file for each burst, how do you know
you've reached the end of the "burst" of data? A special character or EOF
indicator or some amount of idle time?
The easiest case is:
cat < /dev/tty# > file
This of course only works if data carrier detect (DCD) signal is present on
the serial port at all times or you are using a serial port option such as
force carrier or clocal.
There is a sample piece of C code from IBM that can be modified to open a
tty and read/write that may be useful:
http://publib.boulder.ibm.com/infocenter/pseries/v5r3/index.jsp?topic=/com.ibm.aix.doc/aixbman/commadmn/asyn_modems_setup.htm
Best regards,
Paul Laymon
http://www.laixsoft.com
.
- Follow-Ups:
- Re: Reading data from a tty
- From: ERICM76903
- Re: Reading data from a tty
- References:
- Reading data from a tty
- From: ERICM76903
- Reading data from a tty
- Prev by Date: Re: SCSI Reserve issue with HACMP 5.2 and new DS-8100
- Next by Date: Multiple processes; one file
- Previous by thread: Re: Reading data from a tty
- Next by thread: Re: Reading data from a tty
- Index(es):
Relevant Pages
|