Problems with /dev/ser* (break interrupt, framing, overrun a

bridged with qdn.public.qnxrtp.porting
Post Reply
Margi

Problems with /dev/ser* (break interrupt, framing, overrun a

Post by Margi » Mon Jun 17, 2002 3:16 pm

Under QNX RTP I want to catch Break interrupt, Framing error, Overrun
error and Parity error. Is it possible and how?

David Gibbs

Re: Problems with /dev/ser* (break interrupt, framing, overr

Post by David Gibbs » Tue Jun 25, 2002 3:54 pm

Margi <margi_simeonov@yahoo.com> wrote:
Under QNX RTP I want to catch Break interrupt, Framing error, Overrun
error and Parity error. Is it possible and how?
It is completely possible. QNX does absolutely rock-solid standard
handling of these.

_Advanced Programming in the Unix Environment_ by W. Richard Stevens
has a good chapter on terminal handling that covers how to do this.
(And is an excellent general Unix book.)

You need to use tcgetattr() and tcsetattr() to control these.

You want to:

set: PARENB, INPCK, PARMRK,
clear: IGNBRK, BRKINT, IGNPAR
decide: CSIZE (bits/byte), CSTOPB (# stop bits) PARODD (odd/even parity)

I think that will get what you want -- error bytes marked in the input
stream as \377,\0,X for all the errors, and as \377,\0,\0 for break.

-David
--
QNX Training Services
http://www.qnx.com/support/training/
Please followup in this newsgroup if you have further questions.

Post Reply

Return to “qdn.public.qnxrtp.porting”