Use correct argument type for serial control line functions

The serial port  line control functions take a boolean  argument not a
ptt_t argument.   Changed usage in  rig_open() to use a  explicit zero
instead of RIG_PTT_OFF  value which only coincidentally  happens to be
zero.
Hamlib-3.0
Bill Somerville 2015-04-13 11:34:47 +01:00
rodzic 0a5b00c58d
commit ddb0a12403
1 zmienionych plików z 4 dodań i 4 usunięć

Wyświetl plik

@ -534,9 +534,9 @@ int HAMLIB_API rig_open(RIG *rig)
{ {
/* Needed on Linux because the kernel forces RTS/DTR at open */ /* Needed on Linux because the kernel forces RTS/DTR at open */
if (rs->pttport.type.ptt == RIG_PTT_SERIAL_DTR) if (rs->pttport.type.ptt == RIG_PTT_SERIAL_DTR)
status = ser_set_dtr(&rs->pttport, RIG_PTT_OFF); status = ser_set_dtr(&rs->pttport, 0);
else if (rs->pttport.type.ptt == RIG_PTT_SERIAL_RTS) else if (rs->pttport.type.ptt == RIG_PTT_SERIAL_RTS)
status = ser_set_rts(&rs->pttport, RIG_PTT_OFF); status = ser_set_rts(&rs->pttport, 0);
} }
break; break;
case RIG_PTT_PARALLEL: case RIG_PTT_PARALLEL:
@ -692,14 +692,14 @@ int HAMLIB_API rig_close(RIG *rig)
case RIG_PTT_RIG_MICDATA: case RIG_PTT_RIG_MICDATA:
break; break;
case RIG_PTT_SERIAL_RTS: case RIG_PTT_SERIAL_RTS:
ser_set_rts(&rs->pttport, RIG_PTT_OFF); ser_set_rts(&rs->pttport, 0);
if (rs->pttport.fd != rs->rigport.fd) if (rs->pttport.fd != rs->rigport.fd)
{ {
port_close(&rs->pttport, RIG_PORT_SERIAL); port_close(&rs->pttport, RIG_PORT_SERIAL);
} }
break; break;
case RIG_PTT_SERIAL_DTR: case RIG_PTT_SERIAL_DTR:
ser_set_dtr(&rs->pttport, RIG_PTT_OFF); ser_set_dtr(&rs->pttport, 0);
if (rs->pttport.fd != rs->rigport.fd) if (rs->pttport.fd != rs->rigport.fd)
{ {
port_close(&rs->pttport, RIG_PORT_SERIAL); port_close(&rs->pttport, RIG_PORT_SERIAL);