From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,9bbd751573fd17df,start X-Google-Attributes: gidfee84,public X-Google-ArrivalTime: 1994-06-19 16:01:05 PST Path: nntp.gmd.de!xlink.net!howland.reston.ans.net!europa.eng.gtefsd.com!MathWorks.Com!solaris.cc.vt.edu!server.cs.vt.edu!csgrad.cs.vt.edu!acciai_g From: acciai_g@csgrad.cs.vt.edu (Guy Acciai) Newsgroups: comp.unix.osf.osf1 Subject: CTS/RTS Handshaking in OSF/1 V2.0? Date: 19 Jun 1994 22:07:03 GMT Organization: VPI&SU Computer Science Department, Blacksburg, VA Message-ID: <2u2fi7$pf4@server.cs.vt.edu> NNTP-Posting-Host: csgrad.cs.vt.edu I'm trying to get an DEC3000 Model 300 with OSF/1 V2.0 to speak to a rather primitive hardware device via the 25 pin RS232 aynsch port. Generally, things such as baud, parity, character size seem OK, but this device only supports CTS/RTS hardware flow control, not the normal XON/XOFF.. The physical wire checks out (it was used on a Sun) and following snipet of code also worked under Sun OS V4.1. Via some other tests (introducing dealys into the code to not overrun the slow device), I'm reasonably sure that most of the other serial port characteristics are OK.. But without manual pauses, I'm overruninng the slow device... From DEC hardware info, the pinouts on the serial port are correct & label pins 4 & 5 as RTS & CTS respective (sounds good so far). However, the man page on termios makes NO mention on the c_cflag option of CRTSCTS.. This is defined in the /usr/include/termios.h header so the below compiles, yet RTS/CTS doesn't seem to work?? Soooo, the question is, is the code below at fault for OSF & I just need to tweak the termios flags, or does alpha hardware not support CTS/RTS handshaking, or does OSF just tease you with the define, yet not really support CTS/RTS. Any help or insight would be greatly appreciated.... Thanks Much, Guy Acciai acciai_g@csgrad.cs.vt.edu --------The Offending Code -- Snip Me Here ---------------------- #include #include #include #include #include void setuptty() { int fd, flags; struct termios tbuf; flags = (O_NDELAY | O_NOCTTY | O_RDWR); if ((fd = open("/dev/tty00", flags)) < 0) { printf("Server: SetupTTY - Error opening MD Physical Device...\n"); exit(0); } if (tcgetattr(fd, &tbuf) < 0) { /* Get Current Attributes */ printf("Server: SetupTTY - Error getting MD Attributes %d\n",errno); exit(0); } else { /* Change Them To What We Want */ tbuf.c_iflag &= ~(INLCR | ICRNL | IUCLC | ISTRIP | IXON | IXOFF | BRKINT); tbuf.c_oflag &= ~(OPOST); tbuf.c_cflag &= ~(PARENB | CSIZE | CLOCAL); tbuf.c_cflag |= (CLOCAL | CSTOPB | CREAD | CS8 | CRTSCTS); tbuf.c_ispeed = B2400; tbuf.c_ospeed = B2400; tbuf.c_lflag &= ~(ICANON | ISIG | ECHO); tbuf.c_cc[VMIN] = 0; tbuf.c_cc[VTIME] = 10; } if (tcsetattr(fd, TCSANOW, &tbuf) < 0) { /* Go & Set the TTY Attributes */ printf("Server: SetupTTY - Error setting MD Attributes\n"); exit(0); } }