Accessing RS-232 Line Status Register using ioctl()?
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix Programming > Accessing RS-232 Line Status Register using ioctl()?




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Accessing RS-232 Line Status Register using ioctl()?  
JH Trauntvein


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
12-21-05 10:57 PM

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).  I have read
"Serial programming Guide for POSIX Operating Systems" and there found
out that the modem status register 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?

This information is important to my program because things like serial
framing errors and overrun errors are reported through this register.
My application uses these things to report errors to the user and also
to help determine if the wrong baud rate is selected.

Regards,

Jon Trauntvein






[ Post a follow-up to this message ]



    Re: Accessing RS-232 Line Status Register using ioctl()?  
Gordon Burditt


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
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 ]



    Sponsored Links  




 





   All times are GMT. The time now is 05:23 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register