modem.7 (2010 09)

m
modem(7) modem(7)
telephone switching equipment. If this period is not long enough, the telephone connection may not be
broken and a succeeding open() may complete with the old connection.
HP-UX Modem Ioctls
Several
ioctl() system calls apply to manipulation of modem lines. They use the following information
defined in <sys/modem.h>
:
#define NMTIMER 6
typedef unsigned long mflag;
struct mtimer {
unsigned short m_timers[NMTIMER];
};
Each bit of the mflag long corresponds to one of the modem lines as follows:
MRTS Request to Send outbound
MCTS Clear to Send inbound
MDSR Data Set Ready inbound
MDCD Data Carrier Detect inbound
MDTR Data Terminal Ready outbound
MRI Ring Indicator inbound
MDRS Data Rate Select outbound
The timer values are defined in the array
m_timers. The relative position of the timer and default ini-
tial values and units for each timer are as follows:
0 MTCONNECT 25 s
1 MTCARRIER 400 ms
2 MTNOACTIVITY 0 min
3 MTHANGUP 250 ms
4 Reserved
5 Reserved
A value of zero for any timer will disable that timer.
The modem line
ioctl() system calls have the form:
int ioctl(int fildes, int command, mflag *arg);
The commands using this form are:
MCGETA Get the current state of both inbound and outbound modem lines and store in the mflag
long referenced by arg. A raised line will be indicated by a one bit in the appropriate
position.
MCSETA Set the outbound modem lines from the mflag long referenced by arg. Setting an out-
bound bit to one causes that line to be raised and zero to be lowered. Setting bits for
inbound lines has no effect. Setting any bits while in CCITT mode has no effect. The
change to the modem lines is immediate and using this form while characters are still
being output may cause unpredictable results.
MCSETAW Wait for the output to drain and set the new parameters as described above.
MCSETAF Wait for the output to drain, then flush the input queue and set the new parameters as
described above.
The timer value
ioctl() system calls have the form:
int ioctl(int fildes, int command, mtimer *arg);
The commands using this form are:
MCGETT Get the current timer value settings and store in the mtimer structure referenced by
arg.
MCSETT Set the timer values from the structure referenced by arg.
For any timer, setting the timer value to its previous value has no effect.
SVID3 Modem Ioctls
System V Interface Definition, Third Edition (SVID3) specifies additional ioctl() system calls to mani-
pulate the modem lines. They use information defined in <termios.h>.
4 Hewlett-Packard Company 4 HP-UX 11i Version 3: September 2010