/* Copyright (C) Magna Carta Software, Inc. 1990. All Rights Reserved. C COMMUNICATIONS TOOLKIT v1.0 RACAL.C -- ROUTINES FOR RACAL-VADIC MODEMS. */ #if (defined(CCTW) || defined(_WINDOWS)) #include #endif #include #if defined(__NDPC__) #include #else #include #include #endif #include #include #define RACAL_SO 1 #define RACAL_DSR 2 #define RACAL_CXR 3 #define RACAL_AA 4 #define RACAL_LC 5 #define RACAL_D 6 #define RACAL_BD 7 #define RACAL_CPD 8 #define RACAL_RMT 9 #define RACAL_CL 10 #define RACAL_DC 11 #define RACAL_OC 12 #define RACAL_CS 13 #define RACAL_SA 14 #define RACAL_AR 15 #define RACAL_SS 16 #define RACAL_FC 17 #define RACAL_SC 18 #define RACAL_EC 19 #define RACAL_ECP 20 #define RACAL_CTS 21 #define RACAL_DTR 22 #define RACAL_DTE 23 #define RACAL_AVD 24 #define RACAL_ATC 30 /* ISARACALVADIC -- Determine if the modem on the designated port supports the Racal-Vadic Modem Command Set. 0 -- Racal-Vadic modem found; EOF -- No Racal-Vadic modem found; */ short modem_is_racalvadic(COMM_PORT *p) { short ret; c_rxflush(p, 0); c_puts(p, "\x05\x0D"); ret = c_waits(p, "\n\rHELLO: I'M READY\n\r", 2000); if (!ret) { c_waitc(p, '*', 1000); c_puts(p, "i\x0D"); } return (ret); } /* Return Value: 0 -- success; EOF -- no response from modem; USER_CANCELLED -- user cancelled from keyboard; */ short racal_cmd(COMM_PORT *p, WORD opt, WORD val) { short ret; char ostr[8], sxlat[XLAT_SIZE]; save_xlat(p, sxlat); p->tx_xlat = ON; p->rx_xlat = ON; mspause(300); c_rxflush(p, 0); c_puts(p, "\x05\r"); ret = c_waits(p, "\n\rHELLO: I'M READY\n\r", 1500); if (!ret) { ret = c_waitc(p, '*', 2000); if (ret == '*') { c_puts(p, "o\r"); ret = c_waits(p, "\n\rOPTION NUMBER?\n\r", 1500); if (!ret) { c_puts(p, itoa(opt, ostr, 10)); c_putc_(p, CR); ret = c_waits(p, "*", 1000); ret = c_waits(p, "\n\r", 1000); if (!ret) { c_puts(p, itoa(val, ostr, 10)); c_putc(p, CR); ret = c_waits(p, "\n\rOPTION NUMBER?\n\r", 1500); if (!ret) { c_putc(p, CR); ret = c_waits(p, "*", 1000); } } } } } c_puts(p, "i\r"); rest_xlat(p, sxlat); return (ret); }