Convert all of rigs/* except rigs/icom and rigs/yaesu

Also do some comments(false positives)
This commit is contained in:
George Baltz N3GB 2024-06-05 21:07:06 -04:00
parent 5b84c02b80
commit 53287de487
15 changed files with 148 additions and 148 deletions

View File

@ -289,7 +289,7 @@ struct rig_caps dx77_caps =
/*
* dx77_transaction
* We assume that rig!=NULL, rig->state!= NULL, data!=NULL, data_len!=NULL
* We assume that rig!=NULL, RIGPORT(rig)!= NULL, data!=NULL, data_len!=NULL
* Otherwise, you'll get a nice seg fault. You've been warned!
* TODO: error case handling
*/

View File

@ -223,7 +223,7 @@ struct rig_caps dxsr8_caps =
/*
* dxsr8_transaction
* We assume that rig!=NULL, rig->state!= NULL, data!=NULL, data_len!=NULL
* We assume that rig!=NULL, RIGPORT(rig)!= NULL, data!=NULL, data_len!=NULL
* Otherwise, you'll get a nice seg fault. You've been warned!
* TODO: error case handling
*/

View File

@ -176,7 +176,7 @@ struct rig_caps ar3000a_caps =
/*
* ar3k_transaction
* We assume that rig!=NULL, rig->state!= NULL
* We assume that rig!=NULL, RIGPORT(rig)!= NULL
* Otherwise, you'll get a nice seg fault. You've been warned!
* return value: RIG_OK if everything's fine, negative value otherwise
* TODO: error case handling

View File

@ -208,7 +208,7 @@ struct rig_caps ar3030_caps =
/*
* ar3030_transaction
* We assume that rig!=NULL, rig->state!= NULL
* We assume that rig!=NULL, RIGPORT(rig)!= NULL
* Otherwise, you'll get a nice seg fault. You've been warned!
* return value: RIG_OK if everything's fine, negative value otherwise
*/

View File

@ -265,7 +265,7 @@ struct rig_caps sr2200_caps =
/*
* sr2200_transaction
* We assume that rig!=NULL, rig->state!= NULL, data!=NULL, data_len!=NULL
* We assume that rig!=NULL, RIGPORT(rig)!= NULL, data!=NULL, data_len!=NULL
* Otherwise, you'll get a nice seg fault. You've been warned!
* return value: RIG_OK if everything's fine, negative value otherwise
* TODO: error case handling
@ -593,7 +593,7 @@ int sr2200_get_vfo(RIG *rig, vfo_t *vfo)
/*
* sr2200_set_level
* Assumes rig!=NULL, rig->state.priv!=NULL
* Assumes rig!=NULL, STATE(rig)->priv!=NULL
*/
int sr2200_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
{
@ -677,7 +677,7 @@ int sr2200_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
/*
* sr2200_get_level
* Assumes rig!=NULL, rig->state.priv!=NULL, val!=NULL
* Assumes rig!=NULL, STATE(rig)->priv!=NULL, val!=NULL
*/
int sr2200_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
{

View File

@ -56,10 +56,10 @@ DECLARE_INITRIG_BACKEND(barrett)
void barrett_flush(RIG *rig)
{
hamlib_port_t *rp = RIGPORT(rig);
int timesave = rig->state.timeout;
rig->state.timeout = 0;
int timesave = STATE(rig)->timeout;
STATE(rig)->timeout = 0;
rig_flush(rp);
rig->state.timeout = timesave;
STATE(rig)->timeout = timesave;
}

View File

@ -53,7 +53,7 @@
/*
* drake_transaction
* We assume that rig!=NULL, rig->state!= NULL, data!=NULL, data_len!=NULL
* We assume that rig!=NULL, STATE(rig)!= NULL, data!=NULL, data_len!=NULL
*/
int drake_transaction(RIG *rig, const char *cmd, int cmd_len, char *data,
int *data_len)

View File

@ -321,15 +321,15 @@ static int aclog_init(RIG *rig)
ENTERFUNC;
rig_debug(RIG_DEBUG_TRACE, "%s version %s\n", __func__, rig->caps->version);
rig->state.priv = (struct aclog_priv_data *)calloc(1, sizeof(
STATE(rig)->priv = (struct aclog_priv_data *)calloc(1, sizeof(
struct aclog_priv_data));
if (!rig->state.priv)
if (!STATE(rig)->priv)
{
RETURNFUNC(-RIG_ENOMEM);
}
priv = rig->state.priv;
priv = STATE(rig)->priv;
memset(priv, 0, sizeof(struct aclog_priv_data));
memset(priv->parms, 0, RIG_SETTING_MAX * sizeof(value_t));
@ -337,7 +337,7 @@ static int aclog_init(RIG *rig)
/*
* set arbitrary initial status
*/
rig->state.current_vfo = RIG_VFO_A;
STATE(rig)->current_vfo = RIG_VFO_A;
priv->split = 0;
priv->ptt = 0;
priv->curr_modeA = -1;
@ -418,12 +418,12 @@ static rmode_t modeMapGetHamlib(const char *modeACLog)
/*
* aclog_get_freq
* Assumes rig!=NULL, rig->state.priv!=NULL, freq!=NULL
* Assumes rig!=NULL, STATE(rig)->priv!=NULL, freq!=NULL
*/
static int aclog_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
{
char value[MAXARGLEN];
struct aclog_priv_data *priv = (struct aclog_priv_data *) rig->state.priv;
struct aclog_priv_data *priv = (struct aclog_priv_data *) STATE(rig)->priv;
ENTERFUNC;
rig_debug(RIG_DEBUG_TRACE, "%s: vfo=%s\n", __func__,
@ -439,7 +439,7 @@ static int aclog_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
if (vfo == RIG_VFO_CURR)
{
vfo = rig->state.current_vfo;
vfo = STATE(rig)->current_vfo;
rig_debug(RIG_DEBUG_TRACE, "%s: get_freq2 vfo=%s\n",
__func__, rig_strvfo(vfo));
}
@ -488,14 +488,14 @@ static int aclog_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
/*
* aclog_get_mode
* Assumes rig!=NULL, rig->state.priv!=NULL, mode!=NULL
* Assumes rig!=NULL, STATE(rig)->priv!=NULL, mode!=NULL
*/
static int aclog_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
{
int retval;
char value[MAXCMDLEN];
char *cmdp;
struct aclog_priv_data *priv = (struct aclog_priv_data *) rig->state.priv;
struct aclog_priv_data *priv = (struct aclog_priv_data *) STATE(rig)->priv;
ENTERFUNC;
rig_debug(RIG_DEBUG_TRACE, "%s: vfo=%s\n", __func__,
@ -555,7 +555,7 @@ static int aclog_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
}
/*
* aclog_open
* Assumes rig!=NULL, rig->state.priv!=NULL
* Assumes rig!=NULL, STATE(rig)->priv!=NULL
*/
static int aclog_open(RIG *rig)
{
@ -563,7 +563,7 @@ static int aclog_open(RIG *rig)
char value[MAXARGLEN];
char *p;
//;struct aclog_priv_data *priv = (struct aclog_priv_data *) rig->state.priv;
//;struct aclog_priv_data *priv = (struct aclog_priv_data *) STATE(rig)->priv;
ENTERFUNC;
rig_debug(RIG_DEBUG_VERBOSE, "%s version %s\n", __func__, rig->caps->version);
@ -618,9 +618,9 @@ static int aclog_open(RIG *rig)
RETURNFUNC(RIG_EPROTO);
}
rig->state.current_vfo = RIG_VFO_A;
STATE(rig)->current_vfo = RIG_VFO_A;
rig_debug(RIG_DEBUG_TRACE, "%s: currvfo=%s value=%s\n", __func__,
rig_strvfo(rig->state.current_vfo), value);
rig_strvfo(STATE(rig)->current_vfo), value);
RETURNFUNC(retval);
}
@ -638,7 +638,7 @@ static int aclog_close(RIG *rig)
/*
* aclog_cleanup
* Assumes rig!=NULL, rig->state.priv!=NULL
* Assumes rig!=NULL, STATE(rig)->priv!=NULL
*/
static int aclog_cleanup(RIG *rig)
{
@ -651,12 +651,12 @@ static int aclog_cleanup(RIG *rig)
RETURNFUNC2(-RIG_EINVAL);
}
priv = (struct aclog_priv_data *)rig->state.priv;
priv = (struct aclog_priv_data *)STATE(rig)->priv;
free(priv->ext_parms);
free(rig->state.priv);
free(STATE(rig)->priv);
rig->state.priv = NULL;
STATE(rig)->priv = NULL;
// we really don't need to free this up as it's only done once
// was causing problem when cleanup was followed by rig_open
@ -684,7 +684,7 @@ static int aclog_cleanup(RIG *rig)
/*
* aclog_set_freq
* assumes rig!=NULL, rig->state.priv!=NULL
* assumes rig!=NULL, STATE(rig)->priv!=NULL
*/
static int aclog_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
{
@ -692,7 +692,7 @@ static int aclog_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
char cmd[MAXARGLEN];
char value[1024];
//struct aclog_priv_data *priv = (struct aclog_priv_data *) rig->state.priv;
//struct aclog_priv_data *priv = (struct aclog_priv_data *) STATE(rig)->priv;
rig_debug(RIG_DEBUG_TRACE, "%s\n", __func__);
rig_debug(RIG_DEBUG_TRACE, "%s: vfo=%s freq=%.0f\n", __func__,
@ -709,7 +709,7 @@ static int aclog_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
if (vfo == RIG_VFO_CURR)
{
vfo = rig->state.current_vfo;
vfo = STATE(rig)->current_vfo;
}
#endif
@ -740,7 +740,7 @@ static int aclog_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
char *p;
char *pttmode;
char *ttmode = NULL;
struct aclog_priv_data *priv = (struct aclog_priv_data *) rig->state.priv;
struct aclog_priv_data *priv = (struct aclog_priv_data *) STATE(rig)->priv;
ENTERFUNC;
rig_debug(RIG_DEBUG_TRACE, "%s: vfo=%s mode=%s width=%d\n",
@ -757,7 +757,7 @@ static int aclog_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
if (vfo == RIG_VFO_CURR)
{
vfo = rig->state.current_vfo;
vfo = STATE(rig)->current_vfo;
}
if (check_vfo(vfo) == FALSE)
@ -776,7 +776,7 @@ static int aclog_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
// Switch to VFOB if appropriate since we can't set mode directly
// MDB
rig_debug(RIG_DEBUG_TRACE, "%s: curr_vfo = %s\n", __func__,
rig_strvfo(rig->state.current_vfo));
rig_strvfo(STATE(rig)->current_vfo));
// Set the mode
if (strstr(modeMapGet(mode), "ERROR") == NULL)
@ -858,7 +858,7 @@ static int aclog_get_vfo(RIG *rig, vfo_t *vfo)
*/
static const char *aclog_get_info(RIG *rig)
{
const struct aclog_priv_data *priv = (struct aclog_priv_data *) rig->state.priv;
const struct aclog_priv_data *priv = (struct aclog_priv_data *) STATE(rig)->priv;
return (priv->info);
}
@ -866,7 +866,7 @@ static const char *aclog_get_info(RIG *rig)
static int aclog_power2mW(RIG *rig, unsigned int *mwpower, float power,
freq_t freq, rmode_t mode)
{
const struct aclog_priv_data *priv = (struct aclog_priv_data *) rig->state.priv;
const struct aclog_priv_data *priv = (struct aclog_priv_data *) STATE(rig)->priv;
ENTERFUNC;
rig_debug(RIG_DEBUG_TRACE, "%s: passed power = %f\n", __func__, power);
rig_debug(RIG_DEBUG_TRACE, "%s: passed freq = %"PRIfreq" Hz\n", __func__, freq);
@ -902,7 +902,7 @@ static int aclog_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt)
{
int retval;
char cmd[MAXCMDLEN];
struct aclog_priv_data *priv = (struct aclog_priv_data *) rig->state.priv;
struct aclog_priv_data *priv = (struct aclog_priv_data *) STATE(rig)->priv;
ENTERFUNC;
rig_debug(RIG_DEBUG_TRACE, "%s: ptt=%d\n", __func__, ptt);

View File

@ -52,15 +52,15 @@ static int dummy_amp_init(AMP *amp)
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
amp->state.priv = (struct dummy_amp_priv_data *)
AMPSTATE(amp)->priv = (struct dummy_amp_priv_data *)
calloc(1, sizeof(struct dummy_amp_priv_data));
if (!amp->state.priv)
if (!AMPSTATE(amp)->priv)
{
return -RIG_ENOMEM;
}
priv = amp->state.priv;
priv = AMPSTATE(amp)->priv;
AMPPORT(amp)->type.rig = RIG_PORT_NONE;
@ -73,12 +73,12 @@ static int dummy_amp_cleanup(AMP *amp)
{
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
if (amp->state.priv)
if (AMPSTATE(amp)->priv)
{
free(amp->state.priv);
free(AMPSTATE(amp)->priv);
}
amp->state.priv = NULL;
AMPSTATE(amp)->priv = NULL;
return RIG_OK;
}
@ -143,7 +143,7 @@ Also a way to display faults (there are commands)
static int dummy_amp_get_freq(AMP *amp, freq_t *freq)
{
const struct dummy_amp_priv_data *priv = (struct dummy_amp_priv_data *)
amp->state.priv;
AMPSTATE(amp)->priv;
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
*freq = priv->freq;
return RIG_OK;
@ -152,7 +152,7 @@ static int dummy_amp_get_freq(AMP *amp, freq_t *freq)
static int dummy_amp_set_freq(AMP *amp, freq_t freq)
{
struct dummy_amp_priv_data *priv = (struct dummy_amp_priv_data *)
amp->state.priv;
AMPSTATE(amp)->priv;
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
priv->freq = freq;
return RIG_OK;
@ -227,7 +227,7 @@ static int dummy_amp_get_level(AMP *amp, setting_t level, value_t *val)
static int dummy_amp_set_powerstat(AMP *amp, powerstat_t status)
{
struct dummy_amp_priv_data *priv = (struct dummy_amp_priv_data *)
amp->state.priv;
AMPSTATE(amp)->priv;
switch (status)
{
@ -267,7 +267,7 @@ static int dummy_amp_set_powerstat(AMP *amp, powerstat_t status)
static int dummy_amp_get_powerstat(AMP *amp, powerstat_t *status)
{
const struct dummy_amp_priv_data *priv = (struct dummy_amp_priv_data *)
amp->state.priv;
AMPSTATE(amp)->priv;
*status = priv->powerstat;
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
@ -279,7 +279,7 @@ static int dummy_amp_get_powerstat(AMP *amp, powerstat_t *status)
static int dummy_amp_get_ext_level(AMP *amp, hamlib_token_t token, value_t *val)
{
struct dummy_amp_priv_data *priv = (struct dummy_amp_priv_data *)
amp->state.priv;
AMPSTATE(amp)->priv;
const struct confparams *cfp;
struct ext_list *elp;

View File

@ -62,7 +62,7 @@ static int netampctl_transaction(AMP *amp, char *cmd, int len, char *buf)
static int netampctl_open(AMP *amp)
{
int ret;
//struct amp_state *rs = &amp->state;
//struct amp_state *rs = AMPSTATE(amp);
hamlib_port_t *ampp = AMPPORT(amp);
int pamp_ver;
char cmd[CMD_MAX];

View File

@ -48,7 +48,7 @@ struct netrigctl_priv_data
int netrigctl_get_vfo_mode(RIG *rig)
{
struct netrigctl_priv_data *priv;
priv = (struct netrigctl_priv_data *)rig->state.priv;
priv = (struct netrigctl_priv_data *)STATE(rig)->priv;
return priv->rigctld_vfo_mode;
}
@ -105,7 +105,7 @@ static int netrigctl_vfostr(RIG *rig, char *vfostr, int len, vfo_t vfo)
vfostr[0] = 0;
priv = (struct netrigctl_priv_data *)rig->state.priv;
priv = (struct netrigctl_priv_data *)STATE(rig)->priv;
if (vfo == RIG_VFO_CURR)
{
@ -118,9 +118,9 @@ static int netrigctl_vfostr(RIG *rig, char *vfostr, int len, vfo_t vfo)
else if (vfo == RIG_VFO_RX) { vfo = priv->rx_vfo; }
else if (vfo == RIG_VFO_TX) { vfo = priv->tx_vfo; }
rig_debug(RIG_DEBUG_TRACE, "%s: vfo_opt=%d\n", __func__, rig->state.vfo_opt);
rig_debug(RIG_DEBUG_TRACE, "%s: vfo_opt=%d\n", __func__, STATE(rig)->vfo_opt);
if (rig->state.vfo_opt || priv->rigctld_vfo_mode)
if (STATE(rig)->vfo_opt || priv->rigctld_vfo_mode)
{
rig_debug(RIG_DEBUG_TRACE, "%s: vfo_opt vfo=%u\n", __func__, vfo);
char *myvfo;
@ -164,15 +164,15 @@ static int netrigctl_init(RIG *rig)
return -RIG_EINVAL;
}
rig->state.priv = (struct netrigctl_priv_data *)calloc(1, sizeof(
STATE(rig)->priv = (struct netrigctl_priv_data *)calloc(1, sizeof(
struct netrigctl_priv_data));
if (!rig->state.priv)
if (!STATE(rig)->priv)
{
return -RIG_ENOMEM;
}
priv = rig->state.priv;
priv = STATE(rig)->priv;
memset(priv, 0, sizeof(struct netrigctl_priv_data));
rig_debug(RIG_DEBUG_TRACE, "%s version %s\n", __func__, rig->caps->version);
@ -189,9 +189,9 @@ static int netrigctl_init(RIG *rig)
static int netrigctl_cleanup(RIG *rig)
{
if (rig->state.priv) { free(rig->state.priv); }
if (STATE(rig)->priv) { free(STATE(rig)->priv); }
rig->state.priv = NULL;
STATE(rig)->priv = NULL;
return RIG_OK;
}
@ -247,7 +247,7 @@ int parse_array_double(const char *s, const char *delim, double *array,
static int netrigctl_open(RIG *rig)
{
int ret, i;
struct rig_state *rs = &rig->state;
struct rig_state *rs = STATE(rig);
hamlib_port_t *rp = RIGPORT(rig);
int prot_ver;
char cmd[CMD_MAX];
@ -257,7 +257,7 @@ static int netrigctl_open(RIG *rig)
ENTERFUNC;
priv = (struct netrigctl_priv_data *)rig->state.priv;
priv = (struct netrigctl_priv_data *)STATE(rig)->priv;
priv->rx_vfo = RIG_VFO_A;
priv->tx_vfo = RIG_VFO_B;
@ -266,7 +266,7 @@ static int netrigctl_open(RIG *rig)
if (sscanf(buf, "%d", &priv->rigctld_vfo_mode) == 1)
{
rig->state.vfo_opt = priv->rigctld_vfo_mode;
STATE(rig)->vfo_opt = priv->rigctld_vfo_mode;
rig_debug(RIG_DEBUG_TRACE, "%s: chkvfo=%d\n", __func__, priv->rigctld_vfo_mode);
}
else if (ret == 2)
@ -647,7 +647,7 @@ static int netrigctl_open(RIG *rig)
{
if (strcmp(setting, "vfo_ops") == 0)
{
rig->caps->vfo_ops = rig->state.vfo_ops = strtoll(value, NULL, 0);
rig->caps->vfo_ops = STATE(rig)->vfo_ops = strtoll(value, NULL, 0);
rig_debug(RIG_DEBUG_TRACE, "%s: %s set to %d\n", __func__, setting,
rig->caps->vfo_ops);
}
@ -665,7 +665,7 @@ static int netrigctl_open(RIG *rig)
* locally overridden it
*/
pttp->type.ptt = RIG_PTT_RIG_MICDATA;
rig->caps->ptt_type = rig->state.ptt_type = RIG_PTT_RIG_MICDATA;
rig->caps->ptt_type = STATE(rig)->ptt_type = RIG_PTT_RIG_MICDATA;
rig_debug(RIG_DEBUG_TRACE, "%s: %s set to %d\n", __func__, setting,
pttp->type.ptt);
}
@ -673,13 +673,13 @@ static int netrigctl_open(RIG *rig)
{
rig_debug(RIG_DEBUG_VERBOSE, "%s: ptt_type= %d\n", __func__, temp);
pttp->type.ptt = temp;
rig->caps->ptt_type = rig->state.ptt_type = temp;
rig->caps->ptt_type = STATE(rig)->ptt_type = temp;
}
}
else if (strcmp(setting, "targetable_vfo") == 0)
{
rig->caps->targetable_vfo = rig->state.targetable_vfo = strtol(value, NULL, 0);
rig->caps->targetable_vfo = STATE(rig)->targetable_vfo = strtol(value, NULL, 0);
rig_debug(RIG_DEBUG_VERBOSE, "%s: targetable_vfo=0x%2x\n", __func__,
rig->caps->targetable_vfo);
}
@ -922,7 +922,7 @@ static int netrigctl_open(RIG *rig)
static int netrigctl_close(RIG *rig)
{
const struct rig_state *rs = &rig->state;
const struct rig_state *rs = STATE(rig);
int ret;
char buf[BUF_MAX];
@ -1105,7 +1105,7 @@ static int netrigctl_set_vfo(RIG *rig, vfo_t vfo)
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
priv = (struct netrigctl_priv_data *)rig->state.priv;
priv = (struct netrigctl_priv_data *)STATE(rig)->priv;
SNPRINTF(cmd, sizeof(cmd), "V %s\n", rig_strvfo(vfo));
rig_debug(RIG_DEBUG_VERBOSE, "%s: cmd='%s'\n", __func__, cmd);
@ -1117,7 +1117,7 @@ static int netrigctl_set_vfo(RIG *rig, vfo_t vfo)
}
priv->vfo_curr = vfo; // remember our vfo
rig->state.current_vfo = vfo;
STATE(rig)->current_vfo = vfo;
return ret;
}
@ -1131,7 +1131,7 @@ static int netrigctl_get_vfo(RIG *rig, vfo_t *vfo)
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
priv = (struct netrigctl_priv_data *)rig->state.priv;
priv = (struct netrigctl_priv_data *)STATE(rig)->priv;
SNPRINTF(cmd, sizeof(cmd), "v\n");
@ -2651,7 +2651,7 @@ static int netrigctl_set_vfo_opt(RIG *rig, int status)
return -RIG_EPROTO;
}
rig->state.vfo_opt = status;
STATE(rig)->vfo_opt = status;
return RIG_OK;
}

View File

@ -66,7 +66,7 @@ static int netrotctl_transaction(ROT *rot, char *cmd, int len, char *buf)
static int netrotctl_open(ROT *rot)
{
int ret;
struct rot_state *rs = &rot->state;
struct rot_state *rs = ROTSTATE(rot);
hamlib_port_t *rotp = ROTPORT(rot);
int prot_ver;
char cmd[CMD_MAX];

View File

@ -120,15 +120,15 @@ static int dummy_rot_init(ROT *rot)
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
rot->state.priv = (struct dummy_rot_priv_data *)
ROTSTATE(rot)->priv = (struct dummy_rot_priv_data *)
calloc(1, sizeof(struct dummy_rot_priv_data));
if (!rot->state.priv)
if (!ROTSTATE(rot)->priv)
{
return -RIG_ENOMEM;
}
priv = rot->state.priv;
priv = ROTSTATE(rot)->priv;
priv->ext_funcs = alloc_init_ext(dummy_ext_funcs);
@ -165,7 +165,7 @@ static int dummy_rot_init(ROT *rot)
static int dummy_rot_cleanup(ROT *rot)
{
struct dummy_rot_priv_data *priv = (struct dummy_rot_priv_data *)
rot->state.priv;
ROTSTATE(rot)->priv;
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
@ -173,9 +173,9 @@ static int dummy_rot_cleanup(ROT *rot)
free(priv->ext_levels);
free(priv->ext_parms);
free(priv->magic_conf);
free(rot->state.priv);
free(ROTSTATE(rot)->priv);
rot->state.priv = NULL;
ROTSTATE(rot)->priv = NULL;
return RIG_OK;
}
@ -205,7 +205,7 @@ static int dummy_set_conf(ROT *rot, hamlib_token_t token, const char *val)
{
struct dummy_rot_priv_data *priv;
priv = (struct dummy_rot_priv_data *)rot->state.priv;
priv = (struct dummy_rot_priv_data *)ROTSTATE(rot)->priv;
switch (token)
{
@ -230,7 +230,7 @@ static int dummy_get_conf2(ROT *rot, hamlib_token_t token, char *val, int val_le
{
struct dummy_rot_priv_data *priv;
priv = (struct dummy_rot_priv_data *)rot->state.priv;
priv = (struct dummy_rot_priv_data *)ROTSTATE(rot)->priv;
switch (token)
{
@ -255,7 +255,7 @@ static int dummy_get_conf(ROT *rot, hamlib_token_t token, char *val)
static int dummy_rot_set_position(ROT *rot, azimuth_t az, elevation_t el)
{
struct dummy_rot_priv_data *priv = (struct dummy_rot_priv_data *)
rot->state.priv;
ROTSTATE(rot)->priv;
rig_debug(RIG_DEBUG_VERBOSE, "%s called: %.2f %.2f\n", __func__,
az, el);
@ -279,7 +279,7 @@ static int dummy_rot_set_position(ROT *rot, azimuth_t az, elevation_t el)
static void dummy_rot_simulate_rotation(ROT *rot)
{
struct dummy_rot_priv_data *priv = (struct dummy_rot_priv_data *)
rot->state.priv;
ROTSTATE(rot)->priv;
struct timeval tv;
unsigned elapsed; /* ms */
@ -354,7 +354,7 @@ static void dummy_rot_simulate_rotation(ROT *rot)
static int dummy_rot_get_position(ROT *rot, azimuth_t *az, elevation_t *el)
{
const struct dummy_rot_priv_data *priv = (struct dummy_rot_priv_data *)
rot->state.priv;
ROTSTATE(rot)->priv;
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
@ -381,7 +381,7 @@ static int dummy_rot_get_position(ROT *rot, azimuth_t *az, elevation_t *el)
static int dummy_rot_stop(ROT *rot)
{
struct dummy_rot_priv_data *priv = (struct dummy_rot_priv_data *)
rot->state.priv;
ROTSTATE(rot)->priv;
azimuth_t az;
elevation_t el;
@ -416,7 +416,7 @@ static int dummy_rot_reset(ROT *rot, rot_reset_t reset)
static int dummy_rot_move(ROT *rot, int direction, int speed)
{
const struct dummy_rot_priv_data *priv = (struct dummy_rot_priv_data *)
rot->state.priv;
ROTSTATE(rot)->priv;
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
rig_debug(RIG_DEBUG_TRACE, "%s: Direction = %d, Speed = %d\n", __func__,
@ -469,7 +469,7 @@ static const char *dummy_rot_get_info(ROT *rot)
static int dummy_set_func(ROT *rot, setting_t func, int status)
{
struct dummy_rot_priv_data *priv = (struct dummy_rot_priv_data *)
rot->state.priv;
ROTSTATE(rot)->priv;
rig_debug(RIG_DEBUG_VERBOSE, "%s called: %s %d\n", __func__,
rot_strfunc(func), status);
@ -490,7 +490,7 @@ static int dummy_set_func(ROT *rot, setting_t func, int status)
static int dummy_get_func(ROT *rot, setting_t func, int *status)
{
const struct dummy_rot_priv_data *priv = (struct dummy_rot_priv_data *)
rot->state.priv;
ROTSTATE(rot)->priv;
*status = (priv->funcs & func) ? 1 : 0;
@ -504,7 +504,7 @@ static int dummy_get_func(ROT *rot, setting_t func, int *status)
static int dummy_set_level(ROT *rot, setting_t level, value_t val)
{
struct dummy_rot_priv_data *priv = (struct dummy_rot_priv_data *)
rot->state.priv;
ROTSTATE(rot)->priv;
int idx;
char lstr[32];
@ -536,7 +536,7 @@ static int dummy_set_level(ROT *rot, setting_t level, value_t val)
static int dummy_get_level(ROT *rot, setting_t level, value_t *val)
{
struct dummy_rot_priv_data *priv = (struct dummy_rot_priv_data *)
rot->state.priv;
ROTSTATE(rot)->priv;
int idx;
idx = rig_setting2idx(level);
@ -557,7 +557,7 @@ static int dummy_get_level(ROT *rot, setting_t level, value_t *val)
static int dummy_set_ext_level(ROT *rot, hamlib_token_t token, value_t val)
{
struct dummy_rot_priv_data *priv = (struct dummy_rot_priv_data *)
rot->state.priv;
ROTSTATE(rot)->priv;
char lstr[64];
const struct confparams *cfp;
struct ext_list *elp;
@ -626,7 +626,7 @@ static int dummy_set_ext_level(ROT *rot, hamlib_token_t token, value_t val)
static int dummy_get_ext_level(ROT *rot, hamlib_token_t token, value_t *val)
{
struct dummy_rot_priv_data *priv = (struct dummy_rot_priv_data *)
rot->state.priv;
ROTSTATE(rot)->priv;
const struct confparams *cfp;
struct ext_list *elp;
@ -669,7 +669,7 @@ static int dummy_get_ext_level(ROT *rot, hamlib_token_t token, value_t *val)
static int dummy_set_ext_func(ROT *rot, hamlib_token_t token, int status)
{
struct dummy_rot_priv_data *priv = (struct dummy_rot_priv_data *)
rot->state.priv;
ROTSTATE(rot)->priv;
const struct confparams *cfp;
struct ext_list *elp;
@ -721,7 +721,7 @@ static int dummy_set_ext_func(ROT *rot, hamlib_token_t token, int status)
static int dummy_get_ext_func(ROT *rot, hamlib_token_t token, int *status)
{
struct dummy_rot_priv_data *priv = (struct dummy_rot_priv_data *)
rot->state.priv;
ROTSTATE(rot)->priv;
const struct confparams *cfp;
struct ext_list *elp;
@ -761,7 +761,7 @@ static int dummy_get_ext_func(ROT *rot, hamlib_token_t token, int *status)
static int dummy_set_parm(ROT *rot, setting_t parm, value_t val)
{
struct dummy_rot_priv_data *priv = (struct dummy_rot_priv_data *)
rot->state.priv;
ROTSTATE(rot)->priv;
int idx;
char pstr[32];
@ -793,7 +793,7 @@ static int dummy_set_parm(ROT *rot, setting_t parm, value_t val)
static int dummy_get_parm(ROT *rot, setting_t parm, value_t *val)
{
struct dummy_rot_priv_data *priv = (struct dummy_rot_priv_data *)
rot->state.priv;
ROTSTATE(rot)->priv;
int idx;
idx = rig_setting2idx(parm);
@ -814,7 +814,7 @@ static int dummy_get_parm(ROT *rot, setting_t parm, value_t *val)
static int dummy_set_ext_parm(ROT *rot, hamlib_token_t token, value_t val)
{
struct dummy_rot_priv_data *priv = (struct dummy_rot_priv_data *)
rot->state.priv;
ROTSTATE(rot)->priv;
char lstr[64];
const struct confparams *cfp;
struct ext_list *epp;
@ -880,7 +880,7 @@ static int dummy_set_ext_parm(ROT *rot, hamlib_token_t token, value_t val)
static int dummy_get_ext_parm(ROT *rot, hamlib_token_t token, value_t *val)
{
struct dummy_rot_priv_data *priv = (struct dummy_rot_priv_data *)
rot->state.priv;
ROTSTATE(rot)->priv;
const struct confparams *cfp;
struct ext_list *epp;
@ -920,7 +920,7 @@ static int dummy_get_ext_parm(ROT *rot, hamlib_token_t token, value_t *val)
static int dummy_rot_get_status(ROT *rot, rot_status_t *status)
{
const struct dummy_rot_priv_data *priv = (struct dummy_rot_priv_data *)
rot->state.priv;
ROTSTATE(rot)->priv;
if (simulating)
{

View File

@ -424,15 +424,15 @@ static int tci1x_init(RIG *rig)
ENTERFUNC;
rig_debug(RIG_DEBUG_TRACE, "%s version %s\n", __func__, rig->caps->version);
rig->state.priv = (struct tci1x_priv_data *)calloc(1, sizeof(
STATE(rig)->priv = (struct tci1x_priv_data *)calloc(1, sizeof(
struct tci1x_priv_data));
if (!rig->state.priv)
if (!STATE(rig)->priv)
{
RETURNFUNC(-RIG_ENOMEM);
}
priv = rig->state.priv;
priv = STATE(rig)->priv;
memset(priv, 0, sizeof(struct tci1x_priv_data));
memset(priv->parms, 0, RIG_SETTING_MAX * sizeof(value_t));
@ -440,7 +440,7 @@ static int tci1x_init(RIG *rig)
/*
* set arbitrary initial status
*/
rig->state.current_vfo = RIG_VFO_A;
STATE(rig)->current_vfo = RIG_VFO_A;
priv->split = 0;
priv->ptt = 0;
priv->curr_modeA = -1;
@ -583,7 +583,7 @@ static void modeMapAdd(rmode_t *modes, rmode_t mode_hamlib, char *mode_tci1x)
/*
* tci1x_open
* Assumes rig!=NULL, rig->state.priv!=NULL
* Assumes rig!=NULL, STATE(rig)->priv!=NULL
*/
static int tci1x_open(RIG *rig)
{
@ -594,7 +594,7 @@ static int tci1x_open(RIG *rig)
rmode_t modes;
char *p;
char *pr;
//struct tci1x_priv_data *priv = (struct tci1x_priv_data *) rig->state.priv;
//struct tci1x_priv_data *priv = (struct tci1x_priv_data *) STATE(rig)->priv;
arg[0] = '?';
arg[1] = 0;
@ -657,9 +657,9 @@ static int tci1x_open(RIG *rig)
rig_debug(RIG_DEBUG_ERR, "%s: tci1x_get_freq not working!!\n", __func__);
}
rig->state.current_vfo = RIG_VFO_A;
STATE(rig)->current_vfo = RIG_VFO_A;
rig_debug(RIG_DEBUG_TRACE, "%s: currvfo=%s value=%s\n", __func__,
rig_strvfo(rig->state.current_vfo), value);
rig_strvfo(STATE(rig)->current_vfo), value);
//tci1x_get_split_vfo(rig, vfo, &priv->split, &vfo_tx);
RETURNFUNC2(RIG_OK);
@ -784,7 +784,7 @@ static int tci1x_open(RIG *rig)
else { rig_debug(RIG_DEBUG_ERR, "%s: Unknown mode (new?) for this rig='%s'\n", __func__, p); }
}
rig->state.mode_list = modes;
STATE(rig)->mode_list = modes;
retval = rig_strrmodes(modes, value, sizeof(value));
@ -811,7 +811,7 @@ static int tci1x_close(RIG *rig)
/*
* tci1x_cleanup
* Assumes rig!=NULL, rig->state.priv!=NULL
* Assumes rig!=NULL, STATE(rig)->priv!=NULL
*/
static int tci1x_cleanup(RIG *rig)
{
@ -819,24 +819,24 @@ static int tci1x_cleanup(RIG *rig)
ENTERFUNC;
priv = (struct tci1x_priv_data *)rig->state.priv;
priv = (struct tci1x_priv_data *)STATE(rig)->priv;
free(priv->ext_parms);
free(rig->state.priv);
free(STATE(rig)->priv);
rig->state.priv = NULL;
STATE(rig)->priv = NULL;
RETURNFUNC(RIG_OK);
}
/*
* tci1x_get_freq
* Assumes rig!=NULL, rig->state.priv!=NULL, freq!=NULL
* Assumes rig!=NULL, STATE(rig)->priv!=NULL, freq!=NULL
*/
static int tci1x_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
{
char value[MAXARGLEN];
struct tci1x_priv_data *priv = (struct tci1x_priv_data *) rig->state.priv;
struct tci1x_priv_data *priv = (struct tci1x_priv_data *) STATE(rig)->priv;
ENTERFUNC;
rig_debug(RIG_DEBUG_TRACE, "%s: vfo=%s\n", __func__,
@ -852,7 +852,7 @@ static int tci1x_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
if (vfo == RIG_VFO_CURR)
{
vfo = rig->state.current_vfo;
vfo = STATE(rig)->current_vfo;
rig_debug(RIG_DEBUG_TRACE, "%s: get_freq2 vfo=%s\n",
__func__, rig_strvfo(vfo));
}
@ -899,14 +899,14 @@ static int tci1x_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
/*
* tci1x_set_freq
* assumes rig!=NULL, rig->state.priv!=NULL
* assumes rig!=NULL, STATE(rig)->priv!=NULL
*/
static int tci1x_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
{
int retval;
char cmd_arg[MAXARGLEN];
char *cmd;
struct tci1x_priv_data *priv = (struct tci1x_priv_data *) rig->state.priv;
struct tci1x_priv_data *priv = (struct tci1x_priv_data *) STATE(rig)->priv;
ENTERFUNC;
rig_debug(RIG_DEBUG_TRACE, "%s: vfo=%s freq=%.0f\n", __func__,
@ -921,7 +921,7 @@ static int tci1x_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
if (vfo == RIG_VFO_CURR)
{
vfo = rig->state.current_vfo;
vfo = STATE(rig)->current_vfo;
}
else if (vfo == RIG_VFO_TX && priv->split)
{
@ -972,7 +972,7 @@ static int tci1x_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt)
{
int retval;
char cmd_arg[MAXARGLEN];
struct tci1x_priv_data *priv = (struct tci1x_priv_data *) rig->state.priv;
struct tci1x_priv_data *priv = (struct tci1x_priv_data *) STATE(rig)->priv;
ENTERFUNC;
rig_debug(RIG_DEBUG_TRACE, "%s: ptt=%d\n", __func__, ptt);
@ -1015,7 +1015,7 @@ static int tci1x_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt)
static int tci1x_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt)
{
char value[MAXCMDLEN];
struct tci1x_priv_data *priv = (struct tci1x_priv_data *) rig->state.priv;
struct tci1x_priv_data *priv = (struct tci1x_priv_data *) STATE(rig)->priv;
ENTERFUNC;
rig_debug(RIG_DEBUG_TRACE, "%s: vfo=%s\n", __func__,
@ -1046,7 +1046,7 @@ static int tci1x_set_split_mode(RIG *rig, vfo_t vfo, rmode_t mode,
pbwidth_t width)
{
int retval;
struct tci1x_priv_data *priv = (struct tci1x_priv_data *) rig->state.priv;
struct tci1x_priv_data *priv = (struct tci1x_priv_data *) STATE(rig)->priv;
ENTERFUNC;
rig_debug(RIG_DEBUG_TRACE, "%s: vfo=%s mode=%s width=%d\n",
@ -1055,7 +1055,7 @@ static int tci1x_set_split_mode(RIG *rig, vfo_t vfo, rmode_t mode,
switch (vfo)
{
case RIG_VFO_CURR:
vfo = rig->state.current_vfo;
vfo = STATE(rig)->current_vfo;
break;
case RIG_VFO_TX:
@ -1094,7 +1094,7 @@ static int tci1x_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
char *p;
char *pttmode;
char *ttmode = NULL;
struct tci1x_priv_data *priv = (struct tci1x_priv_data *) rig->state.priv;
struct tci1x_priv_data *priv = (struct tci1x_priv_data *) STATE(rig)->priv;
ENTERFUNC;
rig_debug(RIG_DEBUG_TRACE, "%s: vfo=%s mode=%s width=%d\n",
@ -1111,7 +1111,7 @@ static int tci1x_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
if (vfo == RIG_VFO_CURR)
{
vfo = rig->state.current_vfo;
vfo = STATE(rig)->current_vfo;
}
if (check_vfo(vfo) == FALSE)
@ -1131,11 +1131,11 @@ static int tci1x_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
// MDB
vfoSwitched = 0;
rig_debug(RIG_DEBUG_TRACE, "%s: curr_vfo = %s\n", __func__,
rig_strvfo(rig->state.current_vfo));
rig_strvfo(STATE(rig)->current_vfo));
// If we don't have the get_bwA call we have to switch VFOs ourself
if (!priv->has_get_bwA && vfo == RIG_VFO_B
&& rig->state.current_vfo != RIG_VFO_B)
&& STATE(rig)->current_vfo != RIG_VFO_B)
{
vfoSwitched = 1;
rig_debug(RIG_DEBUG_TRACE, "%s: switch to VFOB = %d\n", __func__,
@ -1289,7 +1289,7 @@ static int tci1x_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
/*
* tci1x_get_mode
* Assumes rig!=NULL, rig->state.priv!=NULL, mode!=NULL
* Assumes rig!=NULL, STATE(rig)->priv!=NULL, mode!=NULL
*/
static int tci1x_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
{
@ -1299,7 +1299,7 @@ static int tci1x_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
char *cmdp;
vfo_t curr_vfo;
rmode_t my_mode;
struct tci1x_priv_data *priv = (struct tci1x_priv_data *) rig->state.priv;
struct tci1x_priv_data *priv = (struct tci1x_priv_data *) STATE(rig)->priv;
ENTERFUNC;
rig_debug(RIG_DEBUG_TRACE, "%s: vfo=%s\n", __func__,
@ -1312,11 +1312,11 @@ static int tci1x_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
RETURNFUNC(-RIG_EINVAL);
}
curr_vfo = rig->state.current_vfo;
curr_vfo = STATE(rig)->current_vfo;
if (vfo == RIG_VFO_CURR)
{
vfo = rig->state.current_vfo;
vfo = STATE(rig)->current_vfo;
}
rig_debug(RIG_DEBUG_TRACE, "%s: using vfo=%s\n", __func__,
@ -1454,8 +1454,8 @@ static int tci1x_set_vfo(RIG *rig, vfo_t vfo)
{
int retval;
char cmd_arg[MAXBUFLEN];
struct rig_state *rs = &rig->state;
const struct tci1x_priv_data *priv = (struct tci1x_priv_data *) rig->state.priv;
struct rig_state *rs = STATE(rig);
const struct tci1x_priv_data *priv = (struct tci1x_priv_data *) STATE(rig)->priv;
ENTERFUNC;
rig_debug(RIG_DEBUG_TRACE, "%s: vfo=%s\n", __func__,
@ -1477,7 +1477,7 @@ static int tci1x_set_vfo(RIG *rig, vfo_t vfo)
if (vfo == RIG_VFO_CURR)
{
vfo = rig->state.current_vfo;
vfo = STATE(rig)->current_vfo;
}
SNPRINTF(cmd_arg, sizeof(cmd_arg),
@ -1492,7 +1492,7 @@ static int tci1x_set_vfo(RIG *rig, vfo_t vfo)
RETURNFUNC(retval);
}
rig->state.current_vfo = vfo;
STATE(rig)->current_vfo = vfo;
rs->tx_vfo = RIG_VFO_B; // always VFOB
/* for some rigs TCI turns off split when VFOA is selected */
@ -1556,7 +1556,7 @@ static int tci1x_get_vfo(RIG *rig, vfo_t *vfo)
RETURNFUNC(-RIG_EINVAL);
}
rig->state.current_vfo = *vfo;
STATE(rig)->current_vfo = *vfo;
rig_debug(RIG_DEBUG_TRACE, "%s: vfo=%s\n", __func__,
rig_strvfo(*vfo));
@ -1573,7 +1573,7 @@ static int tci1x_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq)
int retval;
char cmd_arg[MAXBUFLEN];
freq_t qtx_freq;
struct tci1x_priv_data *priv = (struct tci1x_priv_data *) rig->state.priv;
struct tci1x_priv_data *priv = (struct tci1x_priv_data *) STATE(rig)->priv;
ENTERFUNC;
rig_debug(RIG_DEBUG_TRACE, "%s: vfo=%s freq=%.1f\n", __func__,
@ -1615,7 +1615,7 @@ static int tci1x_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq)
static int tci1x_get_split_freq(RIG *rig, vfo_t vfo, freq_t *tx_freq)
{
int retval;
struct tci1x_priv_data *priv = (struct tci1x_priv_data *) rig->state.priv;
struct tci1x_priv_data *priv = (struct tci1x_priv_data *) STATE(rig)->priv;
ENTERFUNC;
rig_debug(RIG_DEBUG_TRACE, "%s: vfo=%s\n", __func__,
@ -1635,7 +1635,7 @@ static int tci1x_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo)
int retval;
vfo_t qtx_vfo;
split_t qsplit;
struct tci1x_priv_data *priv = (struct tci1x_priv_data *) rig->state.priv;
struct tci1x_priv_data *priv = (struct tci1x_priv_data *) STATE(rig)->priv;
char cmd_arg[MAXBUFLEN];
ENTERFUNC;
@ -1677,7 +1677,7 @@ static int tci1x_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split,
vfo_t *tx_vfo)
{
char value[MAXCMDLEN];
struct tci1x_priv_data *priv = (struct tci1x_priv_data *) rig->state.priv;
struct tci1x_priv_data *priv = (struct tci1x_priv_data *) STATE(rig)->priv;
ENTERFUNC;
@ -1707,7 +1707,7 @@ static int tci1x_set_split_freq_mode(RIG *rig, vfo_t vfo, freq_t freq,
int retval;
rmode_t qmode;
pbwidth_t qwidth;
struct tci1x_priv_data *priv = (struct tci1x_priv_data *) rig->state.priv;
struct tci1x_priv_data *priv = (struct tci1x_priv_data *) STATE(rig)->priv;
ENTERFUNC;
@ -1823,14 +1823,14 @@ static int tci1x_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
/*
* tci1x_get_level
* Assumes rig!=NULL, rig->state.priv!=NULL, val!=NULL
* Assumes rig!=NULL, STATE(rig)->priv!=NULL, val!=NULL
*/
static int tci1x_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
{
char value[MAXARGLEN];
char *cmd;
int retval;
const struct tci1x_priv_data *priv = (struct tci1x_priv_data *) rig->state.priv;
const struct tci1x_priv_data *priv = (struct tci1x_priv_data *) STATE(rig)->priv;
ENTERFUNC;
rig_debug(RIG_DEBUG_TRACE, "%s: vfo=%s\n", __func__,
@ -1906,7 +1906,7 @@ static int tci1x_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
*/
static const char *tci1x_get_info(RIG *rig)
{
const struct tci1x_priv_data *priv = (struct tci1x_priv_data *) rig->state.priv;
const struct tci1x_priv_data *priv = (struct tci1x_priv_data *) STATE(rig)->priv;
return (priv->info);
}
@ -1914,7 +1914,7 @@ static const char *tci1x_get_info(RIG *rig)
static int tci1x_power2mW(RIG *rig, unsigned int *mwpower, float power,
freq_t freq, rmode_t mode)
{
const struct tci1x_priv_data *priv = (struct tci1x_priv_data *) rig->state.priv;
const struct tci1x_priv_data *priv = (struct tci1x_priv_data *) STATE(rig)->priv;
ENTERFUNC;
rig_debug(RIG_DEBUG_TRACE, "%s: passed power = %f\n", __func__, power);
rig_debug(RIG_DEBUG_TRACE, "%s: passed freq = %"PRIfreq" Hz\n", __func__, freq);
@ -1945,7 +1945,7 @@ static int tci1x_mW2power(RIG *rig, float *power, unsigned int mwpower,
#ifdef XXNOTIMPLEMENTED
static int tci1x_set_ext_parm(RIG *rig, hamlib_token_t token, value_t val)
{
struct tci1x_priv_data *priv = (struct tci1x_priv_data *)rig->state.priv;
struct tci1x_priv_data *priv = (struct tci1x_priv_data *)STATE(rig)->priv;
char lstr[64];
const struct confparams *cfp;
struct ext_list *epp;
@ -2022,7 +2022,7 @@ static int tci1x_set_ext_parm(RIG *rig, hamlib_token_t token, value_t val)
static int tci1x_get_ext_parm(RIG *rig, hamlib_token_t token, value_t *val)
{
struct tci1x_priv_data *priv = (struct tci1x_priv_data *)rig->state.priv;
struct tci1x_priv_data *priv = (struct tci1x_priv_data *)STATE(rig)->priv;
const struct confparams *cfp;
struct ext_list *epp;
@ -2065,7 +2065,7 @@ static int tci1x_get_ext_parm(RIG *rig, hamlib_token_t token, value_t *val)
static int tci1x_set_ext_parm(RIG *rig, setting_t parm, value_t val)
{
struct tci1x_priv_data *priv = (struct tci1x_priv_data *)rig->state.priv;
struct tci1x_priv_data *priv = (struct tci1x_priv_data *)STATE(rig)->priv;
int idx;
char pstr[32];
@ -2095,7 +2095,7 @@ static int tci1x_set_ext_parm(RIG *rig, setting_t parm, value_t val)
static int tci1x_get_ext_parm(RIG *rig, setting_t parm, value_t *val)
{
struct tci1x_priv_data *priv = (struct tci1x_priv_data *)rig->state.priv;
struct tci1x_priv_data *priv = (struct tci1x_priv_data *)STATE(rig)->priv;
int idx;
ENTERFUNC;

View File

@ -941,7 +941,7 @@ int tt565_get_xit(RIG *rig, vfo_t vfo, shortfreq_t *xit)
*/
int tt565_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt)
{
struct tt565_priv_data *priv = (struct tt565_priv_data *)rig->state.priv;
struct tt565_priv_data *priv = (struct tt565_priv_data *)STATE(rig)->priv;
int retval = write_block(RIGPORT(rig),
(unsigned char *)(ptt == RIG_PTT_ON ? "*TK" EOM : "*TU" EOM), 4);
if (retval == RIG_OK)
@ -958,7 +958,7 @@ int tt565_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt)
*/
int tt565_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt)
{
struct tt565_priv_data *priv = (struct tt565_priv_data *)rig->state.priv;
struct tt565_priv_data *priv = (struct tt565_priv_data *)STATE(rig)->priv;
*ptt = priv->ptt;