/*
Copyright (C) Magna Carta Software, Inc. 1990. All Rights Reserved.
C COMMUNICATIONS TOOLKIT v1.0
MODEM.C -- MODEM INTERFACE ROUTINES
*/
#if (defined(CCTW) || defined(_WINDOWS))
#include <windows.h>
#endif
#include <string.h>
#include <comm.h>
#include <modem.h>
char *a_uds_v32_rc[][3] = {
{ "\r\nCONNECT 9600\r\n", "\r18\r", "18\r"},
{ "\r\nCONNECT 4800\r\n", "\r15\r", "15\r"},
{ NULL, NULL, NULL },
};
#if 0
/*
CONFIG_UDS_9600 -- Configure the UDS v.3224/v.3225.
*/
short config_uds_9600(COMM_PORT *p)
{
MODEM *m = p->modem;
m->max_speed = 9600;
#if 0
strcpy(m->bell, "B1"); /* support Bell std. */
strcpy(m->info, "I1");
strcpy(m->loudness, "L1"); /* software skr. control */
strcpy(m->xresult, "X4");
strcpy(m->yspace, "Y0"); /* long space disconnect */
strcpy(m->firmdcd, "&C1"); /* firmware DCD config. */
strcpy(m->firmdtr, "&D2"); /* firmware DTR config. */
strcpy(m->factory, "&F0"); /* get factory config. */
strcpy(m->guard_tone, "&G0"); /* guard tone */
strcpy(m->mode, "&M0"); /* sync or async */
strcpy(m->make_break, "&P0"); /* make/break pulse ratio */
strcpy(m->rts_state, "&R0"); /* CTS always true? */
strcpy(m->dsr_state, "&S0"); /* DSR not always true? */
strcpy(m->viewEEPROM, "&V"); /* view EEPROM parms */
strcpy(m->writeEEPROM, "&W"); /* write EEPROM parms */
strcpy(m->ygetEEPROM, "&Y0"); /* load user profile */
strcpy(m->zwrite_num, "&Z"); /* store number cmd. */
#endif
strcat(m->okalpha, "!/@WS"); /* new dial modifiers */
strcat(m->sec_config, m->firmdtr);
strcat(m->sec_config, m->firmdcd);
strcat(m->sec_config, m->xresult); /* init. result codes */
strcat(m->sec_config, m->loudness);
return (0);
}
#endif
/*
ISAUDS -- Recognize the UDS v.3224/v.3225 modems.
*/
short isauds(COMM_PORT *p)
{
char *s;
short save_dtr;
short ret = 0;
if ((save_dtr = get_dtr(p)) == LOW) set_dtr(p, HIGH);
if ((s = modem_scmd(p, "I3", MODEM_REPLY_LEN)) == NULL) ret = FALSE;
else if (strstr(s, "V3225 VERSION") != NULL) ret = UDS_V3225;
else if (strstr(s, "V3224 VERSION") != NULL) ret = UDS_V3224;
if (save_dtr == LOW) set_dtr(p, LOW);
return (ret);
}