static char sccsid
[] = "@(#)vmacs.c 4.3 (Berkeley) 10/10/85";
* Racal-Vadic 'RV811' MACS system with 831 adaptor.
* A typical 300 baud L-devices entry is
* ACU /dev/tty10 /dev/tty11,48,1200 300 vmacs
* where tty10 is the communication line (D_Line),
* tty11 is the dialer line (D_calldev),
* the '4' is the dialer address + modem type (viz. dialer 0, Bell 103),
* and the '8' is the communication port
* (Note: Based on RVMACS version for 820 dialer. This version
* developed by Doug Kingston @ BRL, 13 December 83.)
#define SOH 01 /* Abort */
#define STX 02 /* Access Adaptor */
#define ETX 03 /* Transfer to Dialer */
#define SI 017 /* Buffer Empty (end of phone number) */
register int va
, i
, child
;
char c
, acu
[20], com
[20];
/* create child to open comm line */
sprintf(com
, "/dev/%s", dev
->D_line
);
if ((child
= fork()) == 0) {
DEBUG(5, "%s Opened.", com
);
if ((p
= index(dev
->D_calldev
, ',')) == NULL
) {
DEBUG(2, "No dialer/modem specification\n", 0);
if (*p
< '0' || *p
> '7') {
logent(p
, "Bad dialer address/modem type");
if (*p
< '0' || *p
> '>') {
logent(p
, "Bad modem address");
dialspeed
= dev
->D_speed
;
logent("vmacsopn", "TIMEOUT");
DEBUG(4, "STARTING CALL\n", 0);
sprintf(acu
, "/dev/%s", dev
->D_calldev
);
signal(SIGALRM
, alarmtr
);
if ((va
= open(acu
, 2)) < 0) {
logent(acu
, "CAN'T OPEN");
DEBUG(5, "ACU %s opened.\n", acu
);
write(va
, &c_SOH
, 1); /* abort, reset the dialer */
if (read (va
, &c
, 1) != 1) {
logent ("MACS initialization", _FAILED
);
} while ((c
&0177) != 'B');
DEBUG(5, "ACU initialized\n", 0);
write(va
, &c_STX
, 1); /* start text, access adaptor */
write(va
, &dialer
, 1); /* send dialer address digit */
write(va
, &modem
, 1); /* send modem address digit */
if (*p
== '=' || (*p
>= '0' && *p
<= '9'))
write(va
, &c_SI
, 1); /* send buffer empty */
write(va
, &c_ETX
, 1); /* end of text, initiate call */
if (read(va
, &c
, 1) != 1) {
logent("ACU READ", _FAILED
);
DEBUG(5, "Call connected\n", 0);
DEBUG(2, "Dialer Timeout or Abort\n", 0);
DEBUG(2, "Dialer format error\n", 0);
DEBUG(2, "Dialer parity error\n", 0);
DEBUG(2, "Phone number too long\n", 0);
DEBUG(2, "Busy signal\n", 0);
DEBUG(2, "Unknown MACS return code '%c'\n", i
);
* open line - will return on carrier
if ((i
= open(com
, 2)) < 0) {
logent("carrier", "LOST");
logent("dialup open", _FAILED
);
fixline(i
, dev
->D_speed
);
DEBUG(2, "MACS close %d\n", fd
);
/* ioctl(fd, TIOCCDTR, NULL);*/