Skip to content
Snippets Groups Projects
Commit 710669e7 authored by deuce's avatar deuce
Browse files

Only monitor DSR if it is asserted at the start.

parent 37152032
Branches
Tags
No related merge requests found
...@@ -22,8 +22,13 @@ void modem_input_thread(void *args) ...@@ -22,8 +22,13 @@ void modem_input_thread(void *args)
int rd; int rd;
int buffered; int buffered;
size_t buffer; size_t buffer;
BOOL monitor_dsr=TRUE;
conn_api.input_thread_running=1; conn_api.input_thread_running=1;
if(args != NULL) {
if((comGetModemStatus(com)&COM_DSR) == 0)
monitor_dsr=FALSE;
}
while(com != COM_HANDLE_INVALID && !conn_api.terminate) { while(com != COM_HANDLE_INVALID && !conn_api.terminate) {
rd=comReadBuf(com, conn_api.rd_buf, conn_api.rd_buf_size, NULL, 100); rd=comReadBuf(com, conn_api.rd_buf, conn_api.rd_buf_size, NULL, 100);
buffered=0; buffered=0;
...@@ -37,7 +42,7 @@ void modem_input_thread(void *args) ...@@ -37,7 +42,7 @@ void modem_input_thread(void *args)
if((comGetModemStatus(com)&COM_DCD) == 0) if((comGetModemStatus(com)&COM_DCD) == 0)
break; break;
} }
else { else if(monitor_dsr) {
if((comGetModemStatus(com)&COM_DSR) == 0) if((comGetModemStatus(com)&COM_DSR) == 0)
break; break;
} }
...@@ -52,8 +57,13 @@ void modem_output_thread(void *args) ...@@ -52,8 +57,13 @@ void modem_output_thread(void *args)
int wr; int wr;
int ret; int ret;
int sent; int sent;
BOOL monitor_dsr=TRUE;
conn_api.output_thread_running=1; conn_api.output_thread_running=1;
if(args != NULL) {
if((comGetModemStatus(com)&COM_DSR) == 0)
monitor_dsr=FALSE;
}
while(com != COM_HANDLE_INVALID && !conn_api.terminate) { while(com != COM_HANDLE_INVALID && !conn_api.terminate) {
pthread_mutex_lock(&(conn_outbuf.mutex)); pthread_mutex_lock(&(conn_outbuf.mutex));
wr=conn_buf_wait_bytes(&conn_outbuf, 1, 100); wr=conn_buf_wait_bytes(&conn_outbuf, 1, 100);
...@@ -76,7 +86,7 @@ void modem_output_thread(void *args) ...@@ -76,7 +86,7 @@ void modem_output_thread(void *args)
if((comGetModemStatus(com)&COM_DCD) == 0) if((comGetModemStatus(com)&COM_DCD) == 0)
break; break;
} }
else { else if(monitor_dsr) {
if((comGetModemStatus(com)&COM_DSR) == 0) if((comGetModemStatus(com)&COM_DSR) == 0)
break; break;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment