kopia lustrzana https://github.com/Hamlib/Hamlib
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
rodzic
912bfb4d5b
commit
8024fba14d
|
@ -3706,7 +3706,7 @@ DECLARE_PROBERIG_BACKEND(adat)
|
||||||
}
|
}
|
||||||
|
|
||||||
port->write_delay = port->post_write_delay = 10;
|
port->write_delay = port->post_write_delay = 10;
|
||||||
port->parm.serial.stop_bits = 0;
|
port->parm.serial.stop_bits = 2;
|
||||||
port->retry = 1;
|
port->retry = 1;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -134,7 +134,7 @@ DECLARE_PROBERIG_BACKEND(yaesu)
|
||||||
static const unsigned char cmd[YAESU_CMD_LENGTH] = { 0x00, 0x00, 0x00, 0x00, 0xfa};
|
static const unsigned char cmd[YAESU_CMD_LENGTH] = { 0x00, 0x00, 0x00, 0x00, 0xfa};
|
||||||
int id_len = -1, i, id1, id2;
|
int id_len = -1, i, id1, id2;
|
||||||
int retval = -1;
|
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;
|
int rates_idx;
|
||||||
|
|
||||||
if (!port)
|
if (!port)
|
||||||
|
@ -159,6 +159,7 @@ DECLARE_PROBERIG_BACKEND(yaesu)
|
||||||
port->parm.serial.rate = rates[rates_idx];
|
port->parm.serial.rate = rates[rates_idx];
|
||||||
port->timeout = 2 * 1000 / rates[rates_idx] + 50;
|
port->timeout = 2 * 1000 / rates[rates_idx] + 50;
|
||||||
|
|
||||||
|
printf("Yaesu trying rate = %d\n", rates[rates_idx]);
|
||||||
retval = serial_open(port);
|
retval = serial_open(port);
|
||||||
|
|
||||||
if (retval != RIG_OK)
|
if (retval != RIG_OK)
|
||||||
|
@ -172,9 +173,9 @@ DECLARE_PROBERIG_BACKEND(yaesu)
|
||||||
|
|
||||||
close(port->fd);
|
close(port->fd);
|
||||||
|
|
||||||
if (retval != RIG_OK || id_len < 0)
|
if (retval == RIG_OK && id_len > 0)
|
||||||
{
|
{
|
||||||
continue;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue