diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 09cd2b4c2..4e00d6ea6 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -2885,7 +2885,10 @@ int newcat_set_powerstat(RIG *rig, powerstat_t status) hl_usleep(1000000); retval = rig_get_freq(rig, RIG_VFO_A, &freq); - if (retval == RIG_OK) { return retval; } + if (retval == RIG_OK) { + rig->state.rigport.retry = retry_save; + return retval; + } rig_debug(RIG_DEBUG_TRACE, "%s: Wait #%d for power up\n", __func__, i + 1); } @@ -7622,11 +7625,14 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) return err; } - if (sscanf(priv->ret_data, "SH%3d;", &w) != 1 && - sscanf(priv->ret_data, "SH0%3d;", &w) != 1) + if (sscanf(priv->ret_data, "SH0%3d;", &w) != 1) { - err = -RIG_EPROTO; + if (sscanf(priv->ret_data, "SH%3d;", &w) != 1) + { + err = -RIG_EPROTO; + } } + rig_debug(RIG_DEBUG_TRACE, "%s: w=%d\n", __func__, w); if (err != RIG_OK) { @@ -7634,8 +7640,6 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) priv->ret_data); return -RIG_EPROTO; } - - rig_debug(RIG_DEBUG_TRACE, "%s: w=%d\n", __func__, w); } else { @@ -8929,6 +8933,7 @@ int newcat_get_cmd(RIG *rig) { if (rc != -RIG_BUSBUSY) { + rig_flush(&state->rigport); /* discard any unsolicited data */ /* send the command */ rig_debug(RIG_DEBUG_TRACE, "cmd_str = %s\n", priv->cmd_str);