Fix bug yaesu and adat probe:

Yaesu probe code never left the loop, even if it did find something.
Adat tried stop_bits 0, which serial_setup rightfully refused.
THIS IS UNTESTED.
pull/805/head
Wouter van Gulik 2021-09-20 23:06:25 +02:00
rodzic 912bfb4d5b
commit 8024fba14d
2 zmienionych plików z 5 dodań i 4 usunięć

Wyświetl plik

@ -3706,7 +3706,7 @@ DECLARE_PROBERIG_BACKEND(adat)
}
port->write_delay = port->post_write_delay = 10;
port->parm.serial.stop_bits = 0;
port->parm.serial.stop_bits = 2;
port->retry = 1;

Wyświetl plik

@ -134,7 +134,7 @@ DECLARE_PROBERIG_BACKEND(yaesu)
static const unsigned char cmd[YAESU_CMD_LENGTH] = { 0x00, 0x00, 0x00, 0x00, 0xfa};
int id_len = -1, i, id1, id2;
int retval = -1;
int rates[] = { 4800, 57600, 9600, 38400, 0 }; /* possible baud rates */
static const int rates[] = { 4800, 57600, 9600, 38400, 0 }; /* possible baud rates */
int rates_idx;
if (!port)
@ -159,6 +159,7 @@ DECLARE_PROBERIG_BACKEND(yaesu)
port->parm.serial.rate = rates[rates_idx];
port->timeout = 2 * 1000 / rates[rates_idx] + 50;
printf("Yaesu trying rate = %d\n", rates[rates_idx]);
retval = serial_open(port);
if (retval != RIG_OK)
@ -172,9 +173,9 @@ DECLARE_PROBERIG_BACKEND(yaesu)
close(port->fd);
if (retval != RIG_OK || id_len < 0)
if (retval == RIG_OK && id_len > 0)
{
continue;
break;
}
}