Path: utzoo!attcan!uunet!snorkelwacker!usc!ucsd!ucbvax!IBM.COM!RAH From: RAH@IBM.COM ("Russell A. Heise") Newsgroups: comp.unix.aix Subject: RTS/CTS flow control (AIX V3) Message-ID: <101090.091906.heise1@ibm.com> Date: 10 Oct 90 14:27:46 GMT Sender: daemon@ucbvax.BERKELEY.EDU Lines: 42 kevin@msa3b.UUCP (Kevin P. Kleinfelter) writes: > How does one enable/disable RTS/CTS flow control on a tty line using > AIX V3, from a C program? The only info provided by "info" is that > "stty add rts" can be issued from the shell level. > > I have issued "stty add rts" from the shell, then entered a C program that > puts the terminal in raw mode, and it appears that RTS/CTS flow control > is not enabled. That is to say, a line monitor shows that data is > received, RTS is not dropped, yet the last few bytes of the data are > not returned by a "read" in my code. An associate offers the following sample program: --- cut here #include #include #include #include #include #define MODEM_LINE "/dev/tty1" main() LB <== LB is left brace, RB is right brace int linefd; linefd = open (MODEM_LINE, O_RDWR); if (linefd == -1) printf ("Can't open line - errno %d\n", errno); else while (1) LB printf ("Drop RTS now\n"); ioctl (linefd, TIOCMBIC, TIOCM_RTS); sleep (2); printf ("Raise RTS now\n"); ioctl (linefd, TIOCMBIS, TIOCM_RTS); sleep (2); RB RB <== supposed to be a right brace --- end cut here Of course, this code is offered without warranty. Hope it helps. Russ Heise, AIX Technical Support, IBM