12-22-05 01:49 AM
>I am porting a program from win32 that makes use of rs-232 hardware.
>One of the things this program does is to look for UART report comms
>errors
(these come in on the UART line status register).
You say that like there is One True Serial Port with One True
Set of Hardware. This is unlikely to be true. What bits go
with what register is going to be chipset-dependent.
>I have read
>"Serial programming Guide for POSIX Operating Systems" and there found
>out that the modem status register
No, there isn't "THE modem status register" (which is sorta like
THE key on the keyboard), but you can control some of the RS-232
lines which may or may not exist on a serial port.
>can be polled using ioctl but there
>is no mention of the line status register.
>Does that mean that the
>information in the line status register is not available through the
>standard driver or is there other information that I have not yet
>found?
What information do you think that is?
>This information is important to my program because things like serial
>framing errors and overrun errors are reported through this register.
These are also associated with a particular character and
that information is likely to be erased when the driver accepts
the next character.
>My application uses these things to report errors to the user and also
>to help determine if the wrong baud rate is selected.
The termios(4) interface lets you set a number of modes, including:
INPCK - enable checking of parity errors
PARMRK - mark parity and framing errors
A character X with a framing or parity error is received as
three characters, 0377, 0000, and X. Assuming you don't have
ISTRIP set, a valid 0377 character is received as two 0377
characters, making it impossible for a real data sequence to
look like a parity error. A BREAK sequence looks like a received
0 byte with a framing error.
Gordon L. Burditt
[ Post a follow-up to this message ]
|