static char sccsid
[] = "@(#)va811.c 4.1 (Berkeley) %G%";
* Racal-Vadic VA811 dialer with 831 adaptor.
* A typical 300 baud L-devices entry is
* ACU /dev/tty10 unused 300 va811s
* where tty10 is the communication line (D_Line),
* and 300 is the line speed.
* This is almost identical to RVMACS except that we don't need to
* send addresses and modem types, and don't need the fork.
* Joe Kelsey, fluke!joe, vax4.1526, Apr 11 1984.
#define STX 02 /* Access Adaptor */
#define ETX 03 /* Transfer to Dialer */
#define SI 017 /* Buffer Empty (end of phone number) */
#define SOH 01 /* Abort */
char vabuf
[35]; /* STX, 31 phone digits, SI, ETX, NUL */
sprintf(dcname
, "/dev/%s", dev
->D_line
);
DEBUG(1, "timeout va811 open\n", 0);
logent("va811opn", "TIMEOUT");
DEBUG(4, "va811: STARTING CALL\n", 0);
signal(SIGALRM
, alarmtr
);
DEBUG(4, errno
== 4 ? "%s: no carrier\n" : "%s: can't open\n",
logent(dcname
, "CAN'T OPEN");
return(errno
== 4 ? CF_DIAL
: CF_NODEV
);
fixline(va
, dev
->D_speed
);
/* first, reset everything */
DEBUG(4, "wanted %c ", 'B');
DEBUG(4, "got %s\n", i
? "?" : "that");
DEBUG(4, "va811: NO RESPONSE\n", 0);
logent("va811 reset", "TIMEOUT");
sprintf(vabuf
, "%c%.31s%c%c\\c", STX
, ph
, SI
, SOH
);
DEBUG(4, "wanted %c ", 'B');
DEBUG(4, "got %s\n", i
? "?" : "that");
DEBUG(4, "va811: STORE NUMBER\n", 0);
logent("va811 STORE", _FAILED
);
for (tries
= 0; tries
< TRYCALLS
; tries
++) {
sprintf(vabuf
, "%c%c\\c", STX
, ETX
);
DEBUG(4, "DIALING...", CNULL
);
DEBUG(4, " %s\n", i
? _FAILED
: "SUCCEEDED");
DEBUG(4, "va811: RESETTING\n", CNULL
);
logent("va811 DIAL", _FAILED
);
DEBUG(4, "va811 ok\n", CNULL
);
DEBUG(2, "va811 close %d\n", fd
);
/* ioctl(fd, TIOCCDTR, NULL);*/