First round of rigs switched over to new rig_flush function

When done this will allow all rigs to use network connections and stil flush properly
https://github.com/Hamlib/Hamlib/issues/307
pull/345/head
Michael Black W9MDB 2020-06-23 08:27:45 -05:00
rodzic 835caf34f9
commit 2c64ba9bba
5 zmienionych plików z 14 dodań i 26 usunięć

Wyświetl plik

@ -494,7 +494,7 @@ static int write_transaction(RIG *rig, char *xml, int xml_len)
// appears we can lose sync if we don't clear things out
// shouldn't be anything for us now anyways
network_flush(&rig->state.rigport);
rig_flush(&rig->state.rigport);
while (try-- >= 0 && retval != RIG_OK)
{

Wyświetl plik

@ -68,15 +68,7 @@ static int netrigctl_transaction(RIG *rig, char *cmd, int len, char *buf)
rig_debug(RIG_DEBUG_VERBOSE, "%s: called len=%d\n", __func__, len);
/* flush anything in the read buffer before command is sent */
if (rig->state.rigport.type.rig == RIG_PORT_NETWORK
|| rig->state.rigport.type.rig == RIG_PORT_UDP_NETWORK)
{
network_flush(&rig->state.rigport);
}
else
{
serial_flush(&rig->state.rigport);
}
rig_flush(&rig->state.rigport);
ret = write_block(&rig->state.rigport, cmd, len);

Wyświetl plik

@ -48,15 +48,7 @@ static int netrotctl_transaction(ROT *rot, char *cmd, int len, char *buf)
int ret;
/* flush anything in the read buffer before command is sent */
if (rot->state.rotport.type.rig == RIG_PORT_NETWORK
|| rot->state.rotport.type.rig == RIG_PORT_UDP_NETWORK)
{
network_flush(&rot->state.rotport);
}
else
{
serial_flush(&rot->state.rotport);
}
rig_flush(&rot->state.rotport);
ret = write_block(&rot->state.rotport, cmd, len);

Wyświetl plik

@ -2113,7 +2113,7 @@ extern HAMLIB_EXPORT(int) rig_open HAMLIB_PARAMS((RIG *rig));
*/
extern HAMLIB_EXPORT(int)
rig_flush(RIG *rig);
rig_flush(hamlib_port_t *port);
extern HAMLIB_EXPORT(int)
rig_set_freq HAMLIB_PARAMS((RIG *rig,

Wyświetl plik

@ -1480,17 +1480,21 @@ int HAMLIB_API parse_hoststr(char *hoststr, char host[256], char port[6])
return -1;
}
int HAMLIB_API rig_flush(RIG *rig)
int HAMLIB_API rig_flush(hamlib_port_t *port)
{
if (rig->state.rigport.type.rig == RIG_PORT_NETWORK
|| rig->state.rigport.type.rig == RIG_PORT_UDP_NETWORK)
rig_debug(RIG_DEBUG_TRACE, "%s: called for %s device\n", __func__,
port->type.rig == RIG_PORT_SERIAL ? "serial" : "network");
if (port->type.rig == RIG_PORT_NETWORK
|| port->type.rig == RIG_PORT_UDP_NETWORK)
{
network_flush(&rig->state.rigport);
network_flush(port);
return RIG_OK;
}
return serial_flush(&rig->state.rigport);
return serial_flush(port);
}
//! @endcond
/** @} */
/** @} */