|
I want to block on an open serial port and
return
either when there is a character to read
(RD) or DCD is raised.
For application reasons I need to use CLOCAL on
the
file descriptor, i.e., I open a port and I
want
blocking_until_rd_or_dcd(fd,...)
where the fd is opened with the CLOCAL
flag.
Win32 has a WaitForCommEvent which
can block on RD and/or any combination of the
modem lines
(DSR/CTS/DCD/RI) - I want something similar for
Linux.
ioctl(fd, TIOCMIWAIT,...) almost does what I
want but it
seems to block on any
combination of the modem lines except for RD.
Thank you.
Richard Chan
DSO Nat'l Labs, Singapore
|
