Fix serial_port DCD squelch

Hi,

I had trouble with CTS serial port squelch (on microHAM USB Interface III).
It seems there is a bug in the hamlib code and I think the similar thing
should be done as has been done for the pttport, i.e. if the dcdport is
the same as the rigport, do not reopen it. Otherwise the serial port will
be reset to its default and it will key the radio PTT forever (because
the RTS line is reset on the port reopen). Patch attached

73! Jaroslav, OK2JRQ
pull/1/head
Jaroslav Skarvada 2017-09-09 05:50:23 -04:00 zatwierdzone przez Nate Bargmann
rodzic 987bbf6e78
commit 9693cce0b3
1 zmienionych plików z 9 dodań i 2 usunięć

Wyświetl plik

@ -691,7 +691,12 @@ int HAMLIB_API rig_open(RIG *rig)
strcpy(rs->dcdport.pathname, rs->rigport.pathname);
}
rs->dcdport.fd = ser_open(&rs->dcdport);
if (strcmp(rs->dcdport.pathname, rs->rigport.pathname) == 0) {
rs->dcdport.fd = rs->rigport.fd;
}
else {
rs->dcdport.fd = ser_open(&rs->dcdport);
}
if (rs->dcdport.fd < 0) {
rig_debug(RIG_DEBUG_ERR,
@ -878,7 +883,9 @@ int HAMLIB_API rig_close(RIG *rig)
case RIG_DCD_SERIAL_DSR:
case RIG_DCD_SERIAL_CTS:
case RIG_DCD_SERIAL_CAR:
port_close(&rs->dcdport, RIG_PORT_SERIAL);
if (rs->dcdport.fd != rs->rigport.fd) {
port_close(&rs->dcdport, RIG_PORT_SERIAL);
}
break;
case RIG_DCD_PARALLEL: