On a 2nd rig_open call it would fail since port was still open.

We now force close the port during rig_open.
This should prevent the invalid configuration error WSJT-X sees on rig_open
pull/314/head
Michael Black W9MDB 2020-06-19 23:26:59 -05:00
rodzic bbc67d598e
commit 3b3c2abb00
1 zmienionych plików z 8 dodań i 7 usunięć

Wyświetl plik

@ -570,13 +570,6 @@ int HAMLIB_API rig_open(RIG *rig)
caps = rig->caps;
rs = &rig->state;
if (rs->comm_state)
{
return -RIG_EINVAL;
}
rs->rigport.fd = -1;
// determine if we have a network address
//
is_network |= sscanf(rs->rigport.pathname, "%u.%u.%u.%u:%u", &net1, &net2,
@ -608,6 +601,14 @@ int HAMLIB_API rig_open(RIG *rig)
rs->rigport.type.rig = RIG_PORT_NETWORK;
}
if (rs->comm_state)
{
port_close(&rs->rigport, rs->rigport.type.rig);
return -RIG_EINVAL;
}
rs->rigport.fd = -1;
if (rs->rigport.type.rig == RIG_PORT_SERIAL)
{
if (rs->rigport.parm.serial.rts_state != RIG_SIGNAL_UNSET