1. Can the 3B2 control its outgoing DTR signal?
2. Can a tty port be opened without the incoming CD signal
being high?
--
Edward C. Bennett
UUCP: ihnp4!cbosgd!ukma!ukecc!edward
Kentucky: The state that is being dragged, kicking and screaming,
into the 20th century.
"Goodnight M.A."
Quoted from <4...@ukecc.UUCP> ["Re: 3B2/300 uucp ports & Permissions"], by edw...@ukecc.UUCP (Edward C. Bennett)...
+---------------
| All this raises the more useful question:
|
| 1. Can the 3B2 control its outgoing DTR signal?
+---------------
$ stty 0 > /dev/ttyxx # turn off DTR
$ # turning it on is more difficult, you have to open the port without
$ # DCD and ioctl() the baud rate to non-zero (see below)
+---------------
| 2. Can a tty port be opened without the incoming CD signal
| being high?
+---------------
#include <fcntl.h>
#include <termio.h>
#include <sys/ioctl.h>
#define TTY "/dev/ttyxx"
main() {
int fd;
struct termio ttydat;
if ((fd = open(TTY, O_RDONLY|O_NDELAY)) < 0)
exit(1);
ioctl(fd, TCGETA, &ttydat);
ttydat.c_cflag &= ~CBAUD;
ttydat.c_cflag |= Bmybaud; /* substitute your baud rate */
ioctl(fd, TCSETA, &ttydat);
exit(0);
}
The above program uses the fact that you can open for O_NDELAY a tty despite
neither DTR nor DCD being asserted; you can't read or write, but you CAN
ioctl. These are tested under System III (I have a much more complex version
of the above C program, run as ``dtr +tty22'' or similar, ``+'' for on, ``-''
for off), but should work under sys5 because the tty structure and code hasn't
changed (modulo sxt's).
If you want my ``dtr'' program, let me know.
--Brandon
--
decvax!cwruecmp!ncoast!allbery ncoast!all...@Case.CSNET ncoast!tdi2!brandon
(ncoast!tdi2!root for business) 6615 Center St. #A1-105, Mentor, OH 44060-4101
Phone: +01 216 974 9210 CIS 74106,1032 MCI MAIL BALLBERY (part-time)
PC UNIX/UNIX PC - which do you like best? See <11...@ncoast.UUCP> in net.unix.
Let's see if I can get this right-
The open raises it, setting BAUD to 0 lowers DTR. It can't be
made to go high again without a close and successive open.
>
> 2. Can a tty port be opened without the incoming CD signal
> being high?
I think the flag NODELAY (spelling), for the open does this.
--
Ron Thompson AT&T Information Systems Customer Programming
(404) 982-4217 Atlanta, Georgia Services Center
..{ihnp4,akgua}!cpsc53!rt (Opinions expressed are mine alone.)