Commits (1)
  • Rob Swindell's avatar
    Setting IgnoreDCD=true causes wait_for_call() to immediate return · 869e0ebd
    Rob Swindell authored
    For Nelgin's null modem setup, putty doesn't raise DTR?
    
    <nelgin> sexpots   1492                               root    3u      CHR               4,64        0t0         90 /dev/ttyS0
    <nelgin> Well, it's listening, but when I connect with putty I get nothing.
    <nelgin> DigitalMan, probably always assume a client is connected since I have my pc wired to my linux box.
    869e0ebd
...@@ -759,7 +759,7 @@ int modem_status(COM_HANDLE com_handle) ...@@ -759,7 +759,7 @@ int modem_status(COM_HANDLE com_handle)
/* Returns TRUE if DCD (Data Carrier Detect) is high */ /* Returns TRUE if DCD (Data Carrier Detect) is high */
BOOL carrier_detect(COM_HANDLE com_handle) BOOL carrier_detect(COM_HANDLE com_handle)
{ {
return (modem_status(com_handle)&COM_DCD) ? TRUE:FALSE; return (dcd_ignore || (modem_status(com_handle)&COM_DCD)) ? TRUE:FALSE;
} }
/****************************************************************************/ /****************************************************************************/
...@@ -779,7 +779,7 @@ BOOL wait_for_call(COM_HANDLE com_handle) ...@@ -779,7 +779,7 @@ BOOL wait_for_call(COM_HANDLE com_handle)
if(!comRaiseDTR(com_handle)) if(!comRaiseDTR(com_handle))
lprintf(LOG_ERR,"ERROR %u raising DTR", COM_ERROR_VALUE); lprintf(LOG_ERR,"ERROR %u raising DTR", COM_ERROR_VALUE);
if(com_alreadyconnected) if(com_alreadyconnected || dcd_ignore)
return TRUE; return TRUE;
if(!mdm_null) { if(!mdm_null) {
...@@ -1250,7 +1250,7 @@ BOOL handle_call(void) ...@@ -1250,7 +1250,7 @@ BOOL handle_call(void)
while(!terminated) { while(!terminated) {
if(!dcd_ignore && !carrier_detect(com_handle)) { if(!carrier_detect(com_handle)) {
lprintf(LOG_WARNING,"Loss of Carrier Detect (DCD) detected"); lprintf(LOG_WARNING,"Loss of Carrier Detect (DCD) detected");
break; break;
} }
...@@ -1322,7 +1322,7 @@ BOOL hangup_call(COM_HANDLE com_handle) ...@@ -1322,7 +1322,7 @@ BOOL hangup_call(COM_HANDLE com_handle)
int attempt; int attempt;
int mdm_status; int mdm_status;
if(!carrier_detect(com_handle))/* DCD already low */ if(dcd_ignore || !carrier_detect(com_handle))/* DCD already low */
return TRUE; return TRUE;
lprintf(LOG_DEBUG,"Waiting for transmit buffer to empty"); lprintf(LOG_DEBUG,"Waiting for transmit buffer to empty");
......