From dbcaee4b77cb5760da3dc1efd9dd1dafd9753ed8 Mon Sep 17 00:00:00 2001 From: Michael Black Date: Wed, 3 Apr 2019 09:13:08 -0500 Subject: [PATCH] Improved set_powerstat for icom & kenwood --- icom/icom.c | 13 +++++++------ icom/icom.h | 2 +- kenwood/kenwood.c | 9 +++++---- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/icom/icom.c b/icom/icom.c index b267952eb..98895a9e8 100644 --- a/icom/icom.c +++ b/icom/icom.c @@ -3273,7 +3273,7 @@ int icom_set_powerstat(RIG *rig, powerstat_t status) unsigned char fe_buf[200]; // for FE's to power up int fe_len = 0; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + rig_debug(RIG_DEBUG_VERBOSE, "%s called status=\n", __func__,status); switch (status) { case RIG_POWER_ON: pwr_sc = RIG_POWER_ON; @@ -3289,25 +3289,26 @@ int icom_set_powerstat(RIG *rig, powerstat_t status) } // we can ignore this retval - // sending more than enough 0xfe's to take up the rs232 + // sending more than enough 0xfe's to wake up the rs232 icom_transaction(rig, 0xfe, 0xfe, fe_buf, fe_len, ackbuf, &ack_len); retval = icom_transaction(rig, C_SET_PWR, pwr_sc, NULL, 0, ackbuf, &ack_len); rig_debug(RIG_DEBUG_VERBOSE, "%s #2 called retval=%d\n", __func__,retval); int i=0; + int retry = 3/rig->state.rigport.retry; if (status==RIG_POWER_ON) { // wait for wakeup only - for(i=0;i<15;++i) { // up to 15 seconds + for(i=0;i #endif -#define BACKEND_VER "0.8" +#define BACKEND_VER "0.9" /* * defines used by comp_cal_str in rig.c diff --git a/kenwood/kenwood.c b/kenwood/kenwood.c index c2cdc7969..3196af7fc 100644 --- a/kenwood/kenwood.c +++ b/kenwood/kenwood.c @@ -2791,7 +2791,7 @@ int kenwood_get_trn(RIG *rig, int *trn) */ int kenwood_set_powerstat(RIG *rig, powerstat_t status) { - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + rig_debug(RIG_DEBUG_VERBOSE, "%s called status=%d\n", __func__, status); if (!rig) return -RIG_EINVAL; @@ -2799,16 +2799,17 @@ int kenwood_set_powerstat(RIG *rig, powerstat_t status) int retval = kenwood_transaction(rig, (status == RIG_POWER_ON) ? "PS1" : "PS0", NULL, 0); int i=0; + int retry=3/rig->state.rigport.retry; if (status==RIG_POWER_ON) { // wait for wakeup only - for(i=0;i<15;++i) { // up to 15 seconds + for(i=0;i