Merge pull request #1245 from mikaelnousiainen/icom-async-fixes

Fix issues with async I/O
pull/1246/head
Michael Black 2023-03-08 15:50:23 -06:00 zatwierdzone przez GitHub
commit 94b8e53be9
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
2 zmienionych plików z 12 dodań i 0 usunięć

Wyświetl plik

@ -530,6 +530,12 @@ static int read_icom_frame_generic(hamlib_port_t *p,
while ((read < rxbuffer_len) && (rxbuffer[read - 1] != FI)
&& (rxbuffer[read - 1] != COL));
// Check that we have a valid frame preamble (which might be just a single preable character)
if (rxbuffer[0] != PR)
{
return -RIG_EPROTO;
}
return (read);
}

Wyświetl plik

@ -2147,6 +2147,12 @@ int HAMLIB_API parse_hoststr(char *hoststr, int hoststr_len, char host[256],
//#define RIG_FLUSH_REMOVE
int HAMLIB_API rig_flush(hamlib_port_t *port)
{
// Data should never be flushed when using async I/O
if (port->asyncio)
{
return RIG_OK;
}
#ifndef RIG_FLUSH_REMOVE
rig_debug(RIG_DEBUG_TRACE, "%s: called for %s device\n", __func__,
port->type.rig == RIG_PORT_SERIAL ? "serial" : "network");