From: acciai_g@csgrad.cs.vt.edu (Guy Acciai)
Subject: CTS/RTS Handshaking in OSF/1 V2.0?
Date: 19 Jun 1994 22:07:03 GMT [thread overview]
Message-ID: <2u2fi7$pf4@server.cs.vt.edu> (raw)
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 <errno.h>
#include <fcntl.h>
#include <termios.h>
#include <unistd.h>
#include <stdio.h>
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);
}
}
reply other threads:[~1994-06-19 22:07 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox