1. Serial I/O Problem: Reading/Writing the same Port
I am trying to do Serial I/O in C through the RS-232 port on an
HP 425t running HP-UX 8.0. I need to both read from and write
to this port. I have set up two file descriptors (read, write).
For each byte that is written to this port, an identical byte is to
be returned on the read channel. There is a dumb terminal (VT220)
connected to this port; when a sent character (sent using write())
is displayed on the terminal, a person hits that same key to simulate
the echo back to the workstation. This character is displayed on
the VT220 (which I assume means that it has been sent out on the
serial line), but a read() of size 1 does not terminate on
the workstation. Many many keys can be pressed and the read() does
not terminate until a <CR> is hit. Successive read() calls pick
up all the extra characters that were sent after the initial keystroke
and before the <CR> (i.e. *each* read() did not require its own <CR>
in order to see the character, just the first one).
I have read and re-read the man pages for open(), termio(), ioctl(), ...
and now need to ask for help.
I thought that read() did not buffer its input; I have two questions:
(1) Is it possible that the dumb terminal is not sending the
character until the <CR>? I always thought the definition of dumb
was that it did no thinking for you.
(2) Is it that the terminal line needs to be configured in such a way
to force the read() to terminate after each character is sent? And if so,
please don't tell me to read the termio() man page one more time!
Please comment on this method for testing the Serial I/O -- I will
be very grateful for any suggestions.
Thanks,
2. missing "Close" item onSWiM motif menu
3. Reading and writing to serial ports
4. Method for intrusion
5. serial port read/write error
6. K6 and Linux - are there problems ?
7. read/write to serial port
8. 19 inch monitor recommendations
9. read/write serial port
10. Setting serial port: read() and write()
11. How do you read/write serial port registers directly?
12. read/write serial port
13. Reading and writing to a serial port