[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: off topic: 9 bit serial communication

On Friday 04 October 2002 13.27, Pieter Grimmerink wrote:
> Hello all,
> I know this is not etrax related at all, but I'm posing this question here
> anyway;
> How is one supposed to use 9bit serial communication? CS9 is not defined,
> and I can't even work out how to use mark/space parity for this, since I
> don't know how to get parity error information back to userspace.
> Can someone maybe point me into the right direction?
> Best regards,
> Pieter

Although ETRAX support MARK/SPACE parity I haven't found a 
standard Linux way to configure that, so I guess you have to use
ODD/EVEN depending on what you send unless you tweak that.

You can configure the tty to "mark" parity errors using the PARMRK flag,
see "man termios".
The tty layer will then escape errors like this:
0xFF 0x00 char
(and if char = 0xFF it will be received as 0xFF 0xFF)

However if char = 0x00 you can't distingish that from a break condition
since Linux (and others I guess) don't use the byte after 0xFF to 
anything useful in the escape sequence.