Installation guide

D
Differences Between DIGITAL UNIX and
ULTRIX Terminal Modem Control
This appendix contains three sample programs showing terminal (tty)
modem control: an ULTRIX program showing an outgoing phone call, a
DIGITAL UNIX program showing an outgoing phone call, and a DIGITAL
UNIX program showing an incoming phone call. The ULTRIX system uses
TIOCCAR, TIOCNAR, and TIOCWONLINE requests to the ioctl()
system call. These requests are not supported on a DIGITAL UNIX system.
See Section 7.8 for more information.
Example D–1 demonstrates how an ULTRIX application interacts with a
modem for outgoing calls. Error checking of the return values of the system
calls is purposely omitted to simplify the example.
Example D–1: Modem Control for Outgoing Calls (ULTRIX)
fd = open(dcname, O_RDWR|O_NDELAY); 1
ioctl(fd, TIOCMODEM, &temp); 2
ioctl(fd, TIOCNCAR); 3
.
.
.
/*
* Dial the phone number and negotiate with auto calling unit.
*/
.
.
.
ioctl(fd, TIOCCAR);
4
alarm(40);
ioctl(fd, TIOCWONLINE);
5
alarm(0);
1 Opens the line and does not wait for carrier.
2 Monitors the modem signals.
3 Allows read and write calls to succeed regardless of whether carrier is
present.
4 Allows read and write calls to succeed only if carrier is present.
5 Waits for carrier.
Differences Between DIGITAL UNIX and ULTRIX Terminal Modem Control D–1