Commits (1)
  • Rob Swindell's avatar
    Don't call com_setup() unless an alternate [COM:x] section is loaded · 32fa13dd
    Rob Swindell authored
    Apparently com_setup() (which just calls tcsetattr()) will cause an attached modem (with a caller) to disconnect the caller. So you can't do this with a live modem. Leave the hack in for Nelgin's null modem cable setup, but you can't (apparently) support both 8N1 and 7E1 "callers" with a real modem (not surprisingly, for multiple reasons).
    32fa13dd
......@@ -1392,8 +1392,10 @@ void parse_tcp_section(const char* section)
telnet = iniGetBool(ini,section,"Telnet", telnet);
}
void parse_com_section(const char* section)
BOOL parse_com_section(const char* section)
{
if(!iniSectionExists(ini, section))
return FALSE;
iniGetExistingWord(ini, section, "Device", NULL, com_dev);
com_baudrate = iniGetLongInt(ini, section, "BaudRate", com_baudrate);
com_parity = iniGetBool(ini, section, "Parity", com_parity);
......@@ -1406,6 +1408,7 @@ void parse_com_section(const char* section)
dcd_ignore = iniGetBool(ini, section, "IgnoreDCD", dcd_ignore);
dtr_delay = iniGetLongInt(ini, section, "DTRDelay", dtr_delay);
mdm_null = iniGetBool(ini, section, "NullModem", mdm_null);
return TRUE;
}
void parse_ini_file(const char* ini_fname)
......@@ -1643,11 +1646,11 @@ service_loop(int argc, char** argv)
SAFEPRINTF(str, "TCP:%c", ch);
parse_tcp_section(str);
SAFEPRINTF(str, "COM:%c", ch);
parse_com_section(str);
if(parse_com_section(str))
com_setup();
}
} else
lprintf(LOG_NOTICE, "Timeout (%d seconds) waiting for response to prompt", prompt_timeout);
com_setup();
}
if((sock=connect_socket(host, port)) == INVALID_SOCKET) {
comWriteString(com_handle,"\7\r\n!ERROR connecting to TCP port\r\n");
......