kopia lustrzana https://github.com/Hamlib/Hamlib
Fix netrotctl.c to flush network/serial before every transaction
https://github.com/Hamlib/Hamlib/issues/259pull/281/head
rodzic
4599322ea5
commit
e214bfe486
|
@ -32,6 +32,8 @@
|
|||
#include "hamlib/rotator.h"
|
||||
#include "iofunc.h"
|
||||
#include "misc.h"
|
||||
#include "network.h"
|
||||
#include "serial.h"
|
||||
|
||||
#include "rot_dummy.h"
|
||||
|
||||
|
@ -45,6 +47,17 @@ 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);
|
||||
}
|
||||
|
||||
ret = write_block(&rot->state.rotport, cmd, len);
|
||||
|
||||
if (ret != RIG_OK)
|
||||
|
|
Ładowanie…
Reference in New Issue