mirror of
https://github.com/Hamlib/Hamlib.git
synced 2024-09-21 18:37:18 +00:00
Move swr from rig_cache to priv value until we get rig_cache fixed to be expandable
https://github.com/Hamlib/Hamlib/issues/1419
This commit is contained in:
parent
62341a657e
commit
f1a9823bdd
@ -2478,6 +2478,7 @@ typedef enum {
|
||||
* \brief Rig cache data
|
||||
*
|
||||
* This struct contains all the items we cache at the highest level
|
||||
* DO NOT MODIFY THIS STRUCTURE AT ALL -- we need a new cache that is a pointer rather than a structure
|
||||
*/
|
||||
struct rig_cache {
|
||||
int timeout_ms; // the cache timeout for invalidating itself
|
||||
@ -2551,7 +2552,6 @@ struct rig_cache {
|
||||
struct timespec time_ptt;
|
||||
struct timespec time_split;
|
||||
int satmode; // if rig is in satellite mode
|
||||
double swr; // keep swr
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -94,7 +94,8 @@ static struct kenwood_priv_caps powersdr_priv_caps =
|
||||
{
|
||||
.cmdtrm = EOM_KEN,
|
||||
.mode_table = powersdr_mode_table,
|
||||
.if_len = 37
|
||||
.if_len = 37,
|
||||
.swr = 0
|
||||
};
|
||||
|
||||
#define DSP_BW_NUM 8
|
||||
@ -839,16 +840,17 @@ int powersdr_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
||||
|
||||
case RIG_LEVEL_SWR:
|
||||
{
|
||||
struct kenwood_priv_caps *priv = kenwood_caps(rig);
|
||||
ptt_t ptt = 0;
|
||||
rig_get_ptt(rig, RIG_VFO_CURR, &ptt);
|
||||
if (ptt == RIG_PTT_OFF) { val->f = rig->state.cache.swr; return RIG_OK;}
|
||||
if (ptt == RIG_PTT_OFF) { val->f = priv->swr; return RIG_OK;}
|
||||
cmd = "ZZRM8"; // get SWR
|
||||
len = 5;
|
||||
ans = 8;
|
||||
retval = kenwood_transaction(rig, cmd, lvlbuf, sizeof(lvlbuf));
|
||||
if (retval != RIG_OK) { val->f = rig->state.cache.swr; return RIG_OK;};
|
||||
sscanf(lvlbuf,"ZZRM8%lg", &rig->state.cache.swr);
|
||||
val->f = rig->state.cache.swr;
|
||||
if (retval != RIG_OK) { val->f = priv->swr; return RIG_OK;};
|
||||
sscanf(lvlbuf,"ZZRM8%lg", &priv->swr);
|
||||
val->f = priv->swr;
|
||||
rig_debug(RIG_DEBUG_ERR, "%s(%d) swr=%.1f\n", __func__, __LINE__, val->f);
|
||||
return RIG_OK;
|
||||
}
|
||||
|
@ -135,6 +135,7 @@ struct kenwood_priv_caps
|
||||
struct kenwood_filter_width *filter_width; /* Last entry should have value == -1 and width_hz == -1 */
|
||||
struct kenwood_slope_filter *slope_filter_high; /* Last entry should have value == -1 and frequency_hz == -1 */
|
||||
struct kenwood_slope_filter *slope_filter_low; /* Last entry should have value == -1 and frequency_hz == -1 */
|
||||
double swr;
|
||||
};
|
||||
|
||||
struct kenwood_priv_data
|
||||
|
Loading…
Reference in New Issue
Block a user