1. tcsetattr differences between AIX 3.2.5 and AIX 4.1.4
Gang,
I am using the piece of code shown below to hang up a modem. The
general
idea is to use tcgetattr() to save the current tty attributes, set the
baud rate to
zero, then restore the previous settings. I use this (fairly standard)
technique
to hang up modems under SCO Unix, SCO Xenix, AT&T System V, and AIX
3.2.5. It works under AIX 4.1.4 as well, except for one annoying
detail... when
the previous settings get restored, AIX doesn't bring the modem lines
(like
DTR) back up. (Which of course then prevents any further communication
from the modem...) Yes, if worse comes to worse, I can set the modems to
pretend
that DTR is always present, but due to the number of installations and the
distance across which they are scattered, this is a less than optimal
solution.
For what it's worth, I'm using gcc 2.7.2 to compile user AIX 3.2.5,
and then
move the executable to AIX 4.1.4.
If anyone's been down this road before, I'd really appreciate your
insight.
-Doug
--------------------------------------------------------------------------
----------------------------------------
void hangup()
{
struct timeval oneSecDelay = {1, 0};
struct termios currentSettings;
/* Get the current terminal attributes */
tcgetattr(portfd, ¤tSettings);
/* Save the input and output baudrates */
speed_t currentispeed=cfgetispeed(¤tSettings);
speed_t currentospeed=cfgetospeed(¤tSettings);
/* Set the baudrates to zero (to force tcsetattr to hangup) */
cfsetospeed(¤tSettings, B0);
cfsetispeed(¤tSettings, B0);
/* Turn off modem signals (hangup) */
tcsetattr(portfd, TCSAFLUSH, ¤tSettings);
/* Delay for 1 second */
select(1, NULL, NULL, NULL, &oneSecDelay);
/* Restore our previously saved baudrates */
cfsetospeed(¤tSettings, currentospeed);
cfsetispeed(¤tSettings, currentispeed);
/* Inform the serialport of our changes */
tcsetattr(portfd, TCSANOW, ¤tSettings);
2. DOCs about listserv
3. Difference beetwen Aix V3 and Aix V4
4. makefile
5. Matrox Mystique ands X.
6. Cannot establish NFS service over /dev/tcp
7. major differences among UNIX, Solaris, AIX, Linux??
8. how and why? newbie question
9. AIX /usr/bin/pwd and getcwd() method differences
10. Difference between AIX and Sun Solaris?
11. Differences between AIX and Linux
12. What difference between AIX versions?
13. AIX -> Solaris command/option differences