lkml.org 
[lkml]   [1998]   [Mar]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: Warning, cua2 opened, ...
Date
Hi,

Alan Cox wrote:
> > >It doesnt however seem to guarantee they wont get hung up on instantly
> > >before they can issue a tcsetattr() ?
> > IIRC, the hangup is only generated on a DCD *drop*, not on DCD being
> > already low.
>
> Thats fine. If you are using a serial port which has a remote adapter that
> is running on a high speed RS485 network where DCD is raised and lowered
> as packets go past

Huh? Strange device...

> perhaps you'd care to tell me how to handle it without
> /dev/cua devices - and portably.

struct termios termios;
int fd;

fd = open( "/dev/ttyS0", O_RDWR | O_NDELAY );
tcgetattr( fd, &termios );
termio.c_cflag |= CLOCAL;
tcsetattr( fd, TCSANOW, &termios);
fcntl( fd, F_SETFL, O_RDWR );

/* work with non-blocking, non-carrier-sensitive file descriptor */


Alternatively, you could play with TIOCSSOFTCAR ("soft carrier"), though I
don't know off my head whether that's a SunOS invention or also present in
Linux.

gert

--
USENET is *not* the non-clickable part of WWW!
//www.muc.de/~gert/
Gert Doering - Munich, Germany gert@greenie.muc.de
fax: +49-89-35655025 gert.doering@physik.tu-muenchen.de

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu

\
 
 \ /
  Last update: 2005-03-22 13:41    [W:0.066 / U:0.868 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site