mirror of
https://github.com/Hamlib/Hamlib.git
synced 2024-09-21 02:17:21 +00:00
Balance ENTERFUNC/RETURNFUNC usage
Still some unbalanced RETURNFUNC2 usage, but doesn't affect any rig data.
This commit is contained in:
parent
cd135de590
commit
06301679d3
@ -582,13 +582,15 @@ int elecraft_get_vfo_tq(RIG *rig, vfo_t *vfo)
|
||||
char cmdbuf[10];
|
||||
char splitbuf[12];
|
||||
|
||||
ENTERFUNC2;
|
||||
|
||||
memset(splitbuf, 0, sizeof(splitbuf));
|
||||
SNPRINTF(cmdbuf, sizeof(cmdbuf), "FR;");
|
||||
retval = kenwood_safe_transaction(rig, cmdbuf, splitbuf, 12, 3);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
RETURNFUNC(retval);
|
||||
RETURNFUNC2(retval);
|
||||
}
|
||||
|
||||
if (sscanf(splitbuf, "FR%1d", &fr) != 1)
|
||||
@ -601,7 +603,7 @@ int elecraft_get_vfo_tq(RIG *rig, vfo_t *vfo)
|
||||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
RETURNFUNC(retval);
|
||||
RETURNFUNC2(retval);
|
||||
}
|
||||
|
||||
if (sscanf(splitbuf, "FT%1d", &ft) != 1)
|
||||
@ -614,7 +616,7 @@ int elecraft_get_vfo_tq(RIG *rig, vfo_t *vfo)
|
||||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
RETURNFUNC(retval);
|
||||
RETURNFUNC2(retval);
|
||||
}
|
||||
|
||||
if (sscanf(splitbuf, "TQ%1d", &tq) != 1)
|
||||
|
@ -463,7 +463,7 @@ static int ts590_set_func(RIG *rig, vfo_t vfo, setting_t func, int status)
|
||||
{
|
||||
char buf[20];
|
||||
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s called\n", __func__);
|
||||
ENTERFUNC;
|
||||
|
||||
switch (func)
|
||||
{
|
||||
@ -481,7 +481,7 @@ static int ts590_set_func(RIG *rig, vfo_t vfo, setting_t func, int status)
|
||||
RETURNFUNC(kenwood_transaction(rig, buf, NULL, 0));
|
||||
|
||||
default:
|
||||
return kenwood_set_func(rig, vfo, func, status);
|
||||
RETURNFUNC(kenwood_set_func(rig, vfo, func, status));
|
||||
}
|
||||
}
|
||||
|
||||
@ -547,7 +547,7 @@ static int ts590_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
|
||||
int result;
|
||||
int cmd;
|
||||
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s called\n", __func__);
|
||||
ENTERFUNC;
|
||||
|
||||
switch (level)
|
||||
{
|
||||
@ -575,7 +575,7 @@ static int ts590_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
|
||||
break;
|
||||
|
||||
case RIG_LEVEL_AF:
|
||||
return kenwood_set_level(rig, vfo, level, val);
|
||||
RETURNFUNC(kenwood_set_level(rig, vfo, level, val));
|
||||
|
||||
case RIG_LEVEL_SQL:
|
||||
kenwood_val = val.f * 255;
|
||||
@ -758,7 +758,7 @@ static int ts590_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
||||
val->f = roundl(levelint * 10 / 10.0 + .04) / 10.0;
|
||||
}
|
||||
|
||||
return retval;
|
||||
RETURNFUNC(retval);
|
||||
|
||||
case RIG_LEVEL_USB_AF_INPUT:
|
||||
cmd = 64; // TS-590S
|
||||
@ -779,30 +779,30 @@ static int ts590_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
||||
return retval;
|
||||
|
||||
case RIG_LEVEL_AF:
|
||||
return kenwood_get_level(rig, vfo, level, val);
|
||||
RETURNFUNC(kenwood_get_level(rig, vfo, level, val));
|
||||
|
||||
case RIG_LEVEL_RF:
|
||||
retval = kenwood_transaction(rig, "RG", ackbuf, sizeof(ackbuf));
|
||||
|
||||
if (RIG_OK != retval)
|
||||
{
|
||||
return retval;
|
||||
RETURNFUNC(retval);
|
||||
}
|
||||
|
||||
ack_len = strlen(ackbuf);
|
||||
|
||||
if (5 != ack_len)
|
||||
{
|
||||
return -RIG_EPROTO;
|
||||
RETURNFUNC(-RIG_EPROTO);
|
||||
}
|
||||
|
||||
if (1 != sscanf(&ackbuf[2], "%d", &levelint))
|
||||
{
|
||||
return -RIG_EPROTO;
|
||||
RETURNFUNC(-RIG_EPROTO);
|
||||
}
|
||||
|
||||
val->f = levelint / (float) 255;
|
||||
return RIG_OK;
|
||||
RETURNFUNC(RIG_OK);
|
||||
|
||||
case RIG_LEVEL_SQL:
|
||||
retval = kenwood_transaction(rig, "SQ0", ackbuf, sizeof(ackbuf));
|
||||
@ -810,23 +810,23 @@ static int ts590_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
||||
|
||||
if (RIG_OK != retval)
|
||||
{
|
||||
return retval;
|
||||
RETURNFUNC(retval);
|
||||
}
|
||||
|
||||
ack_len = strlen(ackbuf);
|
||||
|
||||
if (ack_len != ack_len_expected)
|
||||
{
|
||||
return -RIG_EPROTO;
|
||||
RETURNFUNC(-RIG_EPROTO);
|
||||
}
|
||||
|
||||
if (1 != sscanf(&ackbuf[ack_len_expected - 3], "%d", &levelint))
|
||||
{
|
||||
return -RIG_EPROTO;
|
||||
RETURNFUNC(-RIG_EPROTO);
|
||||
}
|
||||
|
||||
val->f = (float) levelint / 255.;
|
||||
return RIG_OK;
|
||||
RETURNFUNC(RIG_OK);
|
||||
|
||||
case RIG_LEVEL_AGC:
|
||||
priv->question_mark_response_means_rejected = 1;
|
||||
@ -836,19 +836,19 @@ static int ts590_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
||||
|
||||
if (RIG_OK != retval)
|
||||
{
|
||||
return retval;
|
||||
RETURNFUNC(retval);
|
||||
}
|
||||
|
||||
ack_len = strlen(ackbuf);
|
||||
|
||||
if (ack_len != ack_len_expected)
|
||||
{
|
||||
return -RIG_EPROTO;
|
||||
RETURNFUNC(-RIG_EPROTO);
|
||||
}
|
||||
|
||||
if (1 != sscanf(&ackbuf[ack_len_expected - 2], "%d", &levelint))
|
||||
{
|
||||
return -RIG_EPROTO;
|
||||
RETURNFUNC(-RIG_EPROTO);
|
||||
}
|
||||
|
||||
if (levelint == 0)
|
||||
@ -872,7 +872,7 @@ static int ts590_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
||||
val->i = RIG_AGC_SLOW;
|
||||
}
|
||||
|
||||
return RIG_OK;
|
||||
RETURNFUNC(RIG_OK);
|
||||
|
||||
case RIG_LEVEL_STRENGTH:
|
||||
if (CACHE(rig)->ptt != RIG_PTT_OFF)
|
||||
@ -881,7 +881,7 @@ static int ts590_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
||||
break;
|
||||
}
|
||||
|
||||
return kenwood_get_level(rig, vfo, level, val);
|
||||
RETURNFUNC(kenwood_get_level(rig, vfo, level, val));
|
||||
|
||||
case RIG_LEVEL_MONITOR_GAIN:
|
||||
{
|
||||
@ -1067,7 +1067,7 @@ static int ts590_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
||||
}
|
||||
|
||||
default:
|
||||
return kenwood_get_level(rig, vfo, level, val);
|
||||
RETURNFUNC(kenwood_get_level(rig, vfo, level, val));
|
||||
}
|
||||
|
||||
RETURNFUNC(RIG_OK);
|
||||
|
@ -808,7 +808,6 @@ int funcube_hid_cmd(RIG *rig, unsigned char *au8BufOut, unsigned char *au8BufIn,
|
||||
|
||||
int funcubepro_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
|
||||
{
|
||||
ENTERFUNC;
|
||||
int ret;
|
||||
unsigned char au8BufOut[64] = { 0 }; // endpoint size
|
||||
unsigned char au8BufIn[64] = { 0 }; // endpoint size
|
||||
@ -869,7 +868,6 @@ int funcubepro_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
|
||||
|
||||
int funcubepro_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
||||
{
|
||||
ENTERFUNC;
|
||||
int ret;
|
||||
int gain_state;
|
||||
unsigned char au8BufOut[64] = { 0 }; // endpoint size
|
||||
|
@ -897,7 +897,7 @@ int prm80_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan)
|
||||
|
||||
if (ret < 0)
|
||||
{
|
||||
RETURNFUNC(ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (ret == 3 && buf[2] == 'T')
|
||||
@ -908,7 +908,7 @@ int prm80_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan)
|
||||
|
||||
if (ret < 0)
|
||||
{
|
||||
RETURNFUNC(ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
// Read extra space
|
||||
@ -916,7 +916,7 @@ int prm80_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan)
|
||||
|
||||
if (ret < 0)
|
||||
{
|
||||
RETURNFUNC(ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
// Send confirmation
|
||||
@ -924,7 +924,7 @@ int prm80_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan)
|
||||
|
||||
if (ret < 0)
|
||||
{
|
||||
RETURNFUNC(ret);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3827,7 +3827,7 @@ static int ft1000d_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq)
|
||||
|
||||
err = rig_set_split_vfo(rig, vfo, RIG_SPLIT_ON, RIG_VFO_B);
|
||||
|
||||
if (err != RIG_OK) { RETURNFUNC(err); }
|
||||
if (err != RIG_OK) { return err; }
|
||||
|
||||
// priv = (struct ft1000d_priv_data *)STATE(rig)->priv;
|
||||
|
||||
|
@ -391,7 +391,7 @@ int ft736_set_split_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
||||
|
||||
int retval = rig_set_split_vfo(rig, RIG_VFO_A, RIG_SPLIT_ON, RIG_VFO_B);
|
||||
|
||||
if (retval != RIG_OK) { RETURNFUNC(retval); }
|
||||
if (retval != RIG_OK) { return retval; }
|
||||
|
||||
/* store bcd format in cmd (MSB) */
|
||||
to_bcd_be(cmd, freq / 10, 8);
|
||||
|
@ -837,7 +837,7 @@ int ft767_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq)
|
||||
|
||||
retval = rig_set_split_vfo(rig, RIG_VFO_A, RIG_SPLIT_ON, RIG_VFO_B);
|
||||
|
||||
if (retval != RIG_OK) { RETURNFUNC(retval); }
|
||||
if (retval != RIG_OK) { return retval; }
|
||||
|
||||
/* This appears to always pass in VFO_CURR as the vfo */
|
||||
/* My decision is to only update the xmit VFO if we're in split mode */
|
||||
|
@ -1042,7 +1042,7 @@ int ft857_set_split_freq_mode(RIG *rig, vfo_t vfo, freq_t freq, rmode_t mode,
|
||||
|
||||
retcode = rig_set_split_vfo(rig, RIG_VFO_A, RIG_SPLIT_ON, RIG_VFO_B);
|
||||
|
||||
if (retcode != RIG_OK) { RETURNFUNC(retcode); }
|
||||
if (retcode != RIG_OK) { return retcode; }
|
||||
|
||||
|
||||
retcode = ft857_send_cmd(rig, FT857_NATIVE_CAT_SET_VFOAB);
|
||||
|
@ -1715,7 +1715,7 @@ static int ft920_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq)
|
||||
|
||||
err = rig_set_split_vfo(rig, RIG_VFO_A, RIG_SPLIT_ON, RIG_VFO_B);
|
||||
|
||||
if (err != RIG_OK) { RETURNFUNC(err); }
|
||||
if (err != RIG_OK) { return err; }
|
||||
|
||||
priv = (struct ft920_priv_data *)STATE(rig)->priv;
|
||||
|
||||
|
@ -812,7 +812,7 @@ static int vx1700_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq)
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: freq=%f\n", __func__, tx_freq);
|
||||
int err = rig_set_split_vfo(rig, RIG_VFO_A, RIG_SPLIT_ON, RIG_VFO_B);
|
||||
|
||||
if (err != RIG_OK) { RETURNFUNC(err); }
|
||||
if (err != RIG_OK) { return err; }
|
||||
|
||||
return vx1700_do_freq_cmd(rig, VX1700_NATIVE_TX_FREQ_SET, tx_freq);
|
||||
}
|
||||
|
@ -230,7 +230,6 @@ int HAMLIB_API rig_register(struct rig_caps *caps)
|
||||
p->next = rig_hash_table[hval];
|
||||
rig_hash_table[hval] = p;
|
||||
|
||||
//RETURNFUNC(RIG_OK);
|
||||
return RIG_OK;
|
||||
}
|
||||
//! @endcond
|
||||
|
@ -3521,7 +3521,7 @@ declare_proto_rig(get_level)
|
||||
RETURNFUNC2(-RIG_EINVAL);
|
||||
}
|
||||
|
||||
RETURNFUNC(RIG_OK);
|
||||
RETURNFUNC2(RIG_OK);
|
||||
}
|
||||
|
||||
|
||||
@ -5095,7 +5095,7 @@ declare_proto_rig(send_cmd)
|
||||
flrig_cat_string2(rig, arg1, (char*)buf, sizeof(buf));
|
||||
fwrite(cmd->arg2, 1, strlen(cmd->arg2), fout); /* i.e. "Frequency" */
|
||||
fprintf(fout, ": %s\n", buf);
|
||||
RETURNFUNC(RIG_OK);
|
||||
RETURNFUNC2(RIG_OK);
|
||||
}
|
||||
|
||||
// need to move the eom_buf to rig-specifc backends
|
||||
|
Loading…
Reference in New Issue
Block a user