diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h index 2a7adc02f..b6d1a8d8f 100644 --- a/include/hamlib/rig.h +++ b/include/hamlib/rig.h @@ -2028,8 +2028,8 @@ struct rig_state { int twiddle_timeout; /*!< timeout to resume from twiddling */ struct rig_cache cache; int vfo_opt; /*!< Is -o switch turned on? */ - int auto_pwr_on_off; /*!< Allow Hamlib to power rig on and - off automatically if supported */ + int auto_power_on; /*!< Allow Hamlib to power rig + automatically if supported */ int auto_disable_screensaver; /*!< Allow Hamlib to disable the rig's screen saver automatically if supported */ diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 5f8b39a16..5f3ec0875 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -727,7 +727,7 @@ icom_rig_open(RIG *rig) rig->caps->version); retval = icom_get_usb_echo_off(rig); - if (retval != RIG_OK && priv->poweron == 0 && rs->auto_pwr_on_off) + if (retval != RIG_OK && priv->poweron == 0 && rs->auto_power_on) { // maybe we need power on? rig_debug(RIG_DEBUG_VERBOSE, "%s trying power on\n", __func__); diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index 40669d866..c5fbc4731 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -725,7 +725,7 @@ int kenwood_open(RIG *rig) rig_debug(RIG_DEBUG_TRACE, "%s: got ID so try PS\n", __func__); err = rig_get_powerstat(rig, &powerstat); - if (err == RIG_OK && powerstat == 0 && priv->poweron == 0 && rig->state.auto_pwr_on_off) + if (err == RIG_OK && powerstat == 0 && priv->poweron == 0 && rig->state.auto_power_on) { rig_debug(RIG_DEBUG_TRACE, "%s: got PS0 so powerup\n", __func__); rig_set_powerstat(rig, 1); @@ -735,7 +735,7 @@ int kenwood_open(RIG *rig) err = RIG_OK; // reset our err back to OK for later checks } - if (err == -RIG_ETIMEOUT && rig->state.auto_pwr_on_off) + if (err == -RIG_ETIMEOUT && rig->state.auto_power_on) { // Ensure rig is on rig_set_powerstat(rig, 1); diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 08a00f427..cd1337037 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -366,7 +366,7 @@ int newcat_open(RIG *rig) __func__, rig_s->rigport.post_write_delay); /* Ensure rig is powered on */ - if (priv->poweron == 0 && rig_s->auto_pwr_on_off) + if (priv->poweron == 0 && rig_s->auto_power_on) { rig_set_powerstat(rig, 1); priv->poweron = 1; diff --git a/src/conf.c b/src/conf.c index c650ba2a1..dd7a95726 100644 --- a/src/conf.c +++ b/src/conf.c @@ -129,12 +129,12 @@ static const struct confparams frontend_cfg_params[] = "500", RIG_CONF_NUMERIC, { .n = {0, 5000, 1}} }, { - TOK_AUTO_PWR_ON_OFF, "auto_pwr_on_off", "Auto power on/off", + TOK_AUTO_POWER_ON, "auto_power_on", "Auto power on", "True enables compatible rigs to be powered up on open", "0", RIG_CONF_CHECKBUTTON, { } }, { - TOK_AUTO_PWR_ON_OFF, "auto_disable_screensaver", "Auto disable screen saver", + TOK_AUTO_DISABLE_SCREENSAVER, "auto_disable_screensaver", "Auto disable screen saver", "True enables compatible rigs to have their screen saver disabled on open", "0", RIG_CONF_CHECKBUTTON, { } }, @@ -562,12 +562,12 @@ static int frontend_set_conf(RIG *rig, token_t token, const char *val) rig_set_cache_timeout_ms(rig, HAMLIB_CACHE_ALL, atol(val)); break; - case TOK_AUTO_PWR_ON_OFF: + case TOK_AUTO_POWER_ON: if (1 != sscanf(val, "%d", &val_i)) { return -RIG_EINVAL; //value format error } - rs->auto_pwr_on_off = val_i ? 1 : 0; + rs->auto_power_on = val_i ? 1 : 0; break; case TOK_AUTO_DISABLE_SCREENSAVER: @@ -890,8 +890,8 @@ static int frontend_get_conf(RIG *rig, token_t token, char *val) sprintf(val, "%d", rig_get_cache_timeout_ms(rig, HAMLIB_CACHE_ALL)); break; - case TOK_AUTO_PWR_ON_OFF: - sprintf(val, "%d", rs->auto_pwr_on_off); + case TOK_AUTO_POWER_ON: + sprintf(val, "%d", rs->auto_power_on); break; case TOK_AUTO_DISABLE_SCREENSAVER: diff --git a/src/token.h b/src/token.h index cfcc5ae19..8e5fdd9bb 100644 --- a/src/token.h +++ b/src/token.h @@ -104,8 +104,8 @@ #define TOK_RANGE_NAME TOKEN_FRONTEND(122) /** \brief rig: Cache timeout */ #define TOK_CACHE_TIMEOUT TOKEN_FRONTEND(123) -/** \brief rig: Auto power on/off */ -#define TOK_AUTO_PWR_ON_OFF TOKEN_FRONTEND(124) +/** \brief rig: Auto power on rig_open when supported */ +#define TOK_AUTO_POWER_ON TOKEN_FRONTEND(124) /** \brief rig: Auto disable screensaver */ #define TOK_AUTO_DISABLE_SCREENSAVER TOKEN_FRONTEND(125) /*