Add detection of echo for rc2800 -- seems some versions do echo

https://github.com/Hamlib/Hamlib/issues/451
Hamlib-4.1
Michael Black W9MDB 2021-01-29 08:20:56 -06:00
rodzic 0575f9defd
commit f228bda1a2
1 zmienionych plików z 9 dodań i 19 usunięć

Wyświetl plik

@ -202,27 +202,17 @@ transaction_write:
data_len = BUFSZ;
}
#if 0 // manual says no echos
/* first reply is an echo */
memset(data, 0, data_len);
retval = read_string(&rs->rotport, data, data_len, CR, strlen(CR));
if (retval < 0)
{
if (retry_read++ < rot->state.rotport.retry)
{
goto transaction_write;
}
goto transaction_quit;
}
#endif
/* then comes the answer */
memset(data, 0, data_len);
retval = read_string(&rs->rotport, data, data_len, CR, strlen(CR));
// some models seem to echo -- so we'll check and read again if echoed
if (strcmp(data_len, cmdstr)==0)
{
memset(data, 0, data_len);
retval = read_string(&rs->rotport, data, data_len, CR, strlen(CR));
}
if (retval < 0)
{
if (retry_read++ < rot->state.rotport.retry)
@ -413,9 +403,9 @@ const struct rot_caps rc2800_rot_caps =
ROT_MODEL(ROT_MODEL_RC2800),
.model_name = "RC2800",
.mfg_name = "M2",
.version = "20201130",
.version = "20210129",
.copyright = "LGPL",
.status = RIG_STATUS_BETA,
.status = RIG_STATUS_STABLE,
.rot_type = ROT_TYPE_AZEL,
.port_type = RIG_PORT_SERIAL,
.serial_rate_min = 9600,