v3451.c revision 8d489c7a815fcac696803219572e95aa01532b0f
/*
* Copyright 2000 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* Copyright (c) 1983 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* Routines for calling up on a Vadic 3451 Modem
*/
#include "tip.h"
static int expect(char *);
static int notin(char *, char *);
static int prefix(char *, char *);
static void vawrite(char *, int);
static void alarmtr(void);
static sigjmp_buf Sjbuf;
/* ARGSUSED */
int
{
int ok;
char phone[50];
#ifdef ACULOG
char line[80];
#endif
/*
* Get in synch
*/
if (!expect("READY")) {
(void) printf("can't synchronize with vadic 3451\n");
#ifdef ACULOG
#endif
return (0);
}
(void) sleep(1);
if (!expect("NUMBER?")) {
(void) printf("Vadic will not accept dial command\n");
#ifdef ACULOG
#endif
return (0);
}
(void) printf("Vadic will not accept phone number\n");
#ifdef ACULOG
#endif
return (0);
}
/*
* You cannot interrupt the Vadic when its dialing;
* even dropping DTR does not work (definitely a
* brain damaged design).
*/
if (!expect("DIALING:")) {
(void) printf("Vadic failed to dial\n");
#ifdef ACULOG
#endif
return (0);
}
(void) printf("\ndialing...");
if (!ok) {
(void) printf("call failed\n");
#ifdef ACULOG
#endif
return (0);
}
return (1);
}
void
v3451_disconnect(void)
{
}
void
v3451_abort(void)
{
}
static void
{
}
static int
{
char buf[300];
return (1);
*rp = 0;
/*
* If we are waiting for the Vadic to complete
* dialing and get a connection, allow more time
* Unfortunately, the Vadic times out 24 seconds after
* the last digit is dialed
*/
if (online)
return (0);
return (0);
(void) alarm(0);
return (0);
}
if (*rp &= 0177)
rp++;
*rp = '\0';
}
(void) alarm(0);
return (1);
}
static void
alarmtr(void)
{
}
static int
{
return (0);
return (1);
}
static int
{
char c;
if (c == '\0')
return (1);
return (c == '\0');
}