Line Discipline or Termios lacks ?
osv at topconrd.ru
Fri Sep 19 09:27:52 UTC 2003
Joel Sherrill <joel.sherrill at OARcorp.com> writes:
> Sergei Organov wrote:
> > Brett Swimley <brett.swimley at aedinc.net> writes:
> >>Joel Sherrill wrote:
> > [...]
> >>>Also I have searched a bit and not managaed to find a standard
> >>>way of doing this function. If there is a way on *BSD or Linux
> >>>to do this, it would be nice to use those names for the IOCTLS
> >>>and possibly add them to the standard list.
> >>I researched this a ways back and think I discarded my notes. I just did a
> >>quick search and found that Linux accomplishes this through the TIOCMGET and
> >>TIOCMSET ioctls. IIRC, this is what I found way back when. Don't know if *BSD
> >>has similar functionality.
> > I believe it does. Solaris does as well. In addition, there are often
> > forgotten TIOCSBRK/TIOCCBRK ioctls to manage TxD line (very handy when one
> > needs to emulate synchronous protocol with UART;) ).
> Are those primitive versions of tcsendbreak()?
No. The primitive version of tcsendbreak() is TCSBRKP (at least in Linux)
where 'P' stands for "POSIX" that sets TxD and then clears it after some
(rather long) time passed as third ioctl argument thus generating statndard
'break' condition. There is also TCSBRK that slightly differs in handling of
its 'time' argument. In fact, TCSBRK[P] (and thus tcsendbreak()) could be
implemented internally in terms of TIOCSBRK/TIOCCBRK if hardware does support
raw setting/clearing of TxD line (all UARTS I've seen so far do support it).
More information about the users