kopia lustrzana https://github.com/Hamlib/Hamlib
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/307pull/345/head
rodzic
835caf34f9
commit
2c64ba9bba
|
@ -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
|
// appears we can lose sync if we don't clear things out
|
||||||
// shouldn't be anything for us now anyways
|
// shouldn't be anything for us now anyways
|
||||||
network_flush(&rig->state.rigport);
|
rig_flush(&rig->state.rigport);
|
||||||
|
|
||||||
while (try-- >= 0 && retval != RIG_OK)
|
while (try-- >= 0 && retval != RIG_OK)
|
||||||
{
|
{
|
||||||
|
|
|
@ -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);
|
rig_debug(RIG_DEBUG_VERBOSE, "%s: called len=%d\n", __func__, len);
|
||||||
|
|
||||||
/* flush anything in the read buffer before command is sent */
|
/* flush anything in the read buffer before command is sent */
|
||||||
if (rig->state.rigport.type.rig == RIG_PORT_NETWORK
|
rig_flush(&rig->state.rigport);
|
||||||
|| rig->state.rigport.type.rig == RIG_PORT_UDP_NETWORK)
|
|
||||||
{
|
|
||||||
network_flush(&rig->state.rigport);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
serial_flush(&rig->state.rigport);
|
|
||||||
}
|
|
||||||
|
|
||||||
ret = write_block(&rig->state.rigport, cmd, len);
|
ret = write_block(&rig->state.rigport, cmd, len);
|
||||||
|
|
||||||
|
|
|
@ -48,15 +48,7 @@ static int netrotctl_transaction(ROT *rot, char *cmd, int len, char *buf)
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
/* flush anything in the read buffer before command is sent */
|
/* flush anything in the read buffer before command is sent */
|
||||||
if (rot->state.rotport.type.rig == RIG_PORT_NETWORK
|
rig_flush(&rot->state.rotport);
|
||||||
|| rot->state.rotport.type.rig == RIG_PORT_UDP_NETWORK)
|
|
||||||
{
|
|
||||||
network_flush(&rot->state.rotport);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
serial_flush(&rot->state.rotport);
|
|
||||||
}
|
|
||||||
|
|
||||||
ret = write_block(&rot->state.rotport, cmd, len);
|
ret = write_block(&rot->state.rotport, cmd, len);
|
||||||
|
|
||||||
|
|
|
@ -2113,7 +2113,7 @@ extern HAMLIB_EXPORT(int) rig_open HAMLIB_PARAMS((RIG *rig));
|
||||||
*/
|
*/
|
||||||
|
|
||||||
extern HAMLIB_EXPORT(int)
|
extern HAMLIB_EXPORT(int)
|
||||||
rig_flush(RIG *rig);
|
rig_flush(hamlib_port_t *port);
|
||||||
|
|
||||||
extern HAMLIB_EXPORT(int)
|
extern HAMLIB_EXPORT(int)
|
||||||
rig_set_freq HAMLIB_PARAMS((RIG *rig,
|
rig_set_freq HAMLIB_PARAMS((RIG *rig,
|
||||||
|
|
16
src/misc.c
16
src/misc.c
|
@ -1480,17 +1480,21 @@ int HAMLIB_API parse_hoststr(char *hoststr, char host[256], char port[6])
|
||||||
return -1;
|
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_debug(RIG_DEBUG_TRACE, "%s: called for %s device\n", __func__,
|
||||||
|| rig->state.rigport.type.rig == RIG_PORT_UDP_NETWORK)
|
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 RIG_OK;
|
||||||
}
|
}
|
||||||
return serial_flush(&rig->state.rigport);
|
|
||||||
|
return serial_flush(port);
|
||||||
}
|
}
|
||||||
|
|
||||||
//! @endcond
|
//! @endcond
|
||||||
|
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
Ładowanie…
Reference in New Issue