Fix Icom echo off not working

https://github.com/Hamlib/Hamlib/issues/885
pull/891/head
Mike Black W9MDB 2021-12-12 13:18:24 -06:00
rodzic 5e15159c79
commit add666f891
2 zmienionych plików z 10 dodań i 6 usunięć

Wyświetl plik

@ -928,7 +928,7 @@ static vfo_t icom_current_vfo(RIG *rig)
int
icom_rig_open(RIG *rig)
{
int retval = RIG_OK;
int retval, retval_echo;
int satmode = 0;
struct rig_state *rs = &rig->state;
struct icom_priv_data *priv = (struct icom_priv_data *) rs->priv;
@ -941,9 +941,9 @@ icom_rig_open(RIG *rig)
rig_debug(RIG_DEBUG_VERBOSE, "%s: %s v%s\n", __func__, rig->caps->model_name,
rig->caps->version);
retry_open:
retval = icom_get_usb_echo_off(rig);
retval_echo = icom_get_usb_echo_off(rig);
if (retval == RIG_OK) // then echo is on so let's try freq now
if (retval_echo == 0 || retval_echo == 1) // then we know our echo status
{
rig->state.current_vfo = icom_current_vfo(rig);
// some rigs like the IC7100 still echo when in standby
@ -951,6 +951,10 @@ retry_open:
freq_t tfreq;
retval = rig_get_freq(rig, RIG_VFO_CURR, &tfreq);
}
else
{
retval = -RIG_EPROTO;
}
if (retval != RIG_OK && priv->poweron == 0 && rs->auto_power_on)
{
@ -971,9 +975,9 @@ retry_open:
}
// Now that we're powered up let's try again
retval = icom_get_usb_echo_off(rig);
retval_echo = icom_get_usb_echo_off(rig);
if (retval < 0)
if (retval_echo != 0 && retval_echo != 1)
{
rig_debug(RIG_DEBUG_ERR, "%s: Unable to determine USB echo status\n", __func__);
RETURNFUNC(retval);

Wyświetl plik

@ -30,7 +30,7 @@
#include <sys/time.h>
#endif
#define BACKEND_VER "20211120"
#define BACKEND_VER "20211212"
#define ICOM_IS_SECONDARY_VFO(vfo) ((vfo) & (RIG_VFO_B | RIG_VFO_SUB | RIG_VFO_SUB_B | RIG_VFO_MAIN_B))
#define ICOM_GET_VFO_NUMBER(vfo) (ICOM_IS_SECONDARY_VFO(vfo) ? 0x01 : 0x00)