From c5c60f0f430a0a254f527e196aa542f83dcddffd Mon Sep 17 00:00:00 2001 From: Michael Black W9MDB Date: Sun, 17 Jan 2021 07:25:28 -0600 Subject: [PATCH] First phase of improving debug messages --- rigs/yaesu/newcat.c | 856 ++++++++++++++++++++++--------------------- src/misc.c | 7 + src/misc.h | 5 +- src/rig.c | 871 ++++++++++++++++++++++---------------------- 4 files changed, 884 insertions(+), 855 deletions(-) mode change 100644 => 100755 src/rig.c diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 0aec7db70..79e8529e3 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -354,13 +354,6 @@ static const yaesu_newcat_commands_t valid_commands[] = int valid_commands_count = sizeof(valid_commands) / sizeof( yaesu_newcat_commands_t); -static void errmsg(int err, const char *func, const char *file, int line, - char *s) -{ - rig_debug(RIG_DEBUG_ERR, "%s(%s:%d): %s: %s\b", __func__, file, line, s, - rigerror(err)); -} - /* * configuration Tokens * @@ -430,7 +423,7 @@ static int newcat_band_index(freq_t freq) else if (freq >= MHz(0.5) && freq < MHz(1.705)) { band = 12; } // MW Medium Wave rig_debug(RIG_DEBUG_TRACE, "%s: freq=%g, band=%d\n", __func__, freq, band); - return band; + RETURNFUNC(band); } /* @@ -450,14 +443,14 @@ int newcat_init(RIG *rig) { struct newcat_priv_data *priv; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; rig->state.priv = (struct newcat_priv_data *) calloc(1, sizeof(struct newcat_priv_data)); if (!rig->state.priv) /* whoops! memory shortage! */ { - return -RIG_ENOMEM; + RETURNFUNC(-RIG_ENOMEM); } priv = rig->state.priv; @@ -474,7 +467,7 @@ int newcat_init(RIG *rig) priv->current_mem = NC_MEM_CHANNEL_NONE; priv->fast_set_commands = FALSE; - return RIG_OK; + RETURNFUNC(RIG_OK); } @@ -488,7 +481,7 @@ int newcat_init(RIG *rig) int newcat_cleanup(RIG *rig) { - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; if (rig->state.priv) { @@ -497,7 +490,7 @@ int newcat_cleanup(RIG *rig) rig->state.priv = NULL; - return RIG_OK; + RETURNFUNC(RIG_OK); } @@ -513,7 +506,7 @@ int newcat_open(RIG *rig) struct newcat_priv_data *priv = rig->state.priv; struct rig_state *rig_s = &rig->state; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; rig_debug(RIG_DEBUG_TRACE, "%s: write_delay = %i msec\n", __func__, rig_s->rigport.write_delay); @@ -573,8 +566,7 @@ int newcat_open(RIG *rig) #endif - rig_debug(RIG_DEBUG_VERBOSE, "%s: returning RIG_OK\n", __func__); - return RIG_OK; + RETURNFUNC(RIG_OK); } @@ -588,7 +580,7 @@ int newcat_close(RIG *rig) struct newcat_priv_data *priv = rig->state.priv; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; if (!no_restore_ai && priv->trn_state >= 0) { @@ -598,7 +590,7 @@ int newcat_close(RIG *rig) supported */ } - return RIG_OK; + RETURNFUNC(RIG_OK); } @@ -613,11 +605,13 @@ int newcat_set_conf(RIG *rig, token_t token, const char *val) int ret = RIG_OK; struct newcat_priv_data *priv; + ENTERFUNC; + priv = (struct newcat_priv_data *)rig->state.priv; if (priv == NULL) { - return -RIG_EINTERNAL; + RETURNFUNC(-RIG_EINTERNAL); } switch (token) @@ -631,7 +625,7 @@ int newcat_set_conf(RIG *rig, token_t token, const char *val) if (end == val) { - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } if ((value == 0) || (value == 1)) @@ -640,7 +634,7 @@ int newcat_set_conf(RIG *rig, token_t token, const char *val) } else { - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } break; @@ -649,7 +643,7 @@ int newcat_set_conf(RIG *rig, token_t token, const char *val) ret = -RIG_EINVAL; } - return ret; + RETURNFUNC(ret); } @@ -664,11 +658,13 @@ int newcat_get_conf(RIG *rig, token_t token, char *val) int ret = RIG_OK; struct newcat_priv_data *priv; + ENTERFUNC; + priv = (struct newcat_priv_data *)rig->state.priv; if (priv == NULL) { - return -RIG_EINTERNAL; + RETURNFUNC(-RIG_EINTERNAL); } switch (token) @@ -676,7 +672,7 @@ int newcat_get_conf(RIG *rig, token_t token, char *val) case TOK_FAST_SET_CMD: if (sizeof(val) < 2) { - return -RIG_ENOMEM; + RETURNFUNC(-RIG_ENOMEM); } sprintf(val, "%d", priv->fast_set_commands); @@ -686,7 +682,7 @@ int newcat_get_conf(RIG *rig, token_t token, char *val) ret = -RIG_EINVAL; } - return ret; + RETURNFUNC(ret); } @@ -710,16 +706,16 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) struct newcat_priv_data *priv; int special_60m = 0; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; if (!newcat_valid_command(rig, "FA")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } if (!newcat_valid_command(rig, "FB")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } priv = (struct newcat_priv_data *)rig->state.priv; @@ -733,7 +729,7 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) if (err < 0) { - errmsg(err, __func__, __FILE__, __LINE__, "newcat_set_vfo_from_alias"); + ERRMSG(err, "newcat_set_vfo_from_alias"); return err; } @@ -761,7 +757,7 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) { rig_debug(RIG_DEBUG_TRACE, "%s: 60M VFO_MEM exception, no freq change done\n", __func__); - return RIG_OK; /* make it look like we changed */ + RETURNFUNC(RIG_OK); /* make it look like we changed */ } c = 'A'; @@ -783,7 +779,7 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) if (RIG_OK != (err = newcat_get_cmd(rig))) { - errmsg(err, __func__, __FILE__, __LINE__, "newcat_get_cmd"); + ERRMSG(err, "newcat_get_cmd"); return err; } @@ -794,7 +790,7 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) if (RIG_OK != (err = newcat_set_cmd(rig))) { - errmsg(err, __func__, __FILE__, __LINE__, "newcat_set_cmd failed"); + ERRMSG(err,"newcat_set_cmd failed"); return err; } } @@ -922,7 +918,7 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) { rig_debug(RIG_DEBUG_VERBOSE, "%s: freq after band select already set to %"PRIfreq"\n", __func__, freq); - return RIG_OK; // we're done then!! + RETURNFUNC(RIG_OK); // we're done then!! } } @@ -960,7 +956,7 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) } } - return RIG_OK; + RETURNFUNC(RIG_OK); } @@ -979,17 +975,17 @@ int newcat_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) char c; int err; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; rig_debug(RIG_DEBUG_TRACE, "%s: passed vfo = %s\n", __func__, rig_strvfo(vfo)); if (!newcat_valid_command(rig, "FA")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } if (!newcat_valid_command(rig, "FB")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } err = newcat_set_vfo_from_alias(rig, &vfo); @@ -1017,7 +1013,7 @@ int newcat_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) default: rig_debug(RIG_DEBUG_ERR, "%s: unsupported vfo=%s\n", __func__, rig_strvfo(vfo)); - return -RIG_EINVAL; /* sorry, unsupported VFO */ + RETURNFUNC(-RIG_EINVAL); /* sorry, unsupported VFO */ } /* Build the command string */ @@ -1025,7 +1021,7 @@ int newcat_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) if (!newcat_valid_command(rig, command)) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%c", command, cat_term); @@ -1044,7 +1040,7 @@ int newcat_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) rig_debug(RIG_DEBUG_TRACE, "%s: freq = %"PRIfreq" Hz for vfo %s\n", __func__, *freq, rig_strvfo(vfo)); - return RIG_OK; + RETURNFUNC(RIG_OK); } @@ -1056,11 +1052,11 @@ int newcat_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) priv = (struct newcat_priv_data *)rig->state.priv; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; if (!newcat_valid_command(rig, "MD")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } @@ -1088,7 +1084,7 @@ int newcat_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) if (priv->cmd_str[3] == '0') { - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } err = newcat_set_cmd(rig); @@ -1135,11 +1131,11 @@ int newcat_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) int err; char main_sub_vfo = '0'; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; if (!newcat_valid_command(rig, "MD")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } err = newcat_set_vfo_from_alias(rig, &vfo); @@ -1214,12 +1210,13 @@ int newcat_set_vfo(RIG *rig, vfo_t vfo) priv->cache_start.tv_sec = 0; // invalidate the cache - rig_debug(RIG_DEBUG_TRACE, "%s: called, passed vfo = %s\n", __func__, + ENTERFUNC; + rig_debug(RIG_DEBUG_TRACE, "%s: passed vfo = %s\n", __func__, rig_strvfo(vfo)); if (!newcat_valid_command(rig, command)) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } err = newcat_set_vfo_from_alias(rig, @@ -1293,7 +1290,7 @@ int newcat_set_vfo(RIG *rig, vfo_t vfo) /* Set current_vfo now */ state->current_vfo = vfo; - return RIG_OK; + RETURNFUNC(RIG_OK); default: return -RIG_ENIMPL; /* sorry, VFO not implemented */ @@ -1316,7 +1313,7 @@ int newcat_set_vfo(RIG *rig, vfo_t vfo) rig_debug(RIG_DEBUG_TRACE, "%s: rig->state.current_vfo = %s\n", __func__, rig_strvfo(vfo)); - return RIG_OK; + RETURNFUNC(RIG_OK); } // Either returns a valid RIG_VFO* or if < 0 an error code @@ -1324,6 +1321,7 @@ static vfo_t newcat_set_vfo_if_needed(RIG *rig, vfo_t vfo) { vfo_t oldvfo = rig->state.current_vfo; + ENTERFUNC; rig_debug(RIG_DEBUG_TRACE, "%s: vfo=%s, oldvfo=%s\n", __func__, rig_strvfo(vfo), rig_strvfo(oldvfo)); @@ -1336,7 +1334,7 @@ static vfo_t newcat_set_vfo_if_needed(RIG *rig, vfo_t vfo) { rig_debug(RIG_DEBUG_ERR, "%s: error setting vfo=%s\n", __func__, rig_strvfo(vfo)); - return ret; + RETURNFUNC(ret); } } @@ -1360,17 +1358,17 @@ int newcat_get_vfo(RIG *rig, vfo_t *vfo) vfo_t vfo_mode; char const *command = "VS"; + ENTERFUNC; + if (!vfo) { - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); - /* Build the command string */ if (!newcat_valid_command(rig, command)) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s;", command); @@ -1422,7 +1420,7 @@ int newcat_get_vfo(RIG *rig, vfo_t *vfo) rig_debug(RIG_DEBUG_TRACE, "%s: rig->state.current_vfo = %s\n", __func__, rig_strvfo(state->current_vfo)); - return RIG_OK; + RETURNFUNC(RIG_OK); } @@ -1433,11 +1431,13 @@ int newcat_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) char txon[] = "TX1;"; char txoff[] = "TX0;"; + ENTERFUNC; + priv->cache_start.tv_sec = 0; // invalidate the cache if (!newcat_valid_command(rig, "TX")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } switch (ptt) @@ -1464,7 +1464,7 @@ int newcat_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) break; default: - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } return err; @@ -1477,9 +1477,11 @@ int newcat_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt) char c; int err; + ENTERFUNC; + if (!newcat_valid_command(rig, "TX")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%c", "TX", cat_term); @@ -1510,15 +1512,15 @@ int newcat_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt) return -RIG_EPROTO; } - return RIG_OK; + RETURNFUNC(RIG_OK); } int newcat_get_dcd(RIG *rig, vfo_t vfo, dcd_t *dcd) { - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } @@ -1530,9 +1532,11 @@ int newcat_set_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t rptr_shift) char command[] = "OS"; char main_sub_vfo = '0'; + ENTERFUNC; + if (!newcat_valid_command(rig, command)) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } /* Main or SUB vfo */ @@ -1563,7 +1567,7 @@ int newcat_set_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t rptr_shift) break; default: - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } @@ -1581,11 +1585,11 @@ int newcat_get_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t *rptr_shift) char command[] = "OS"; char main_sub_vfo = '0'; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; if (!newcat_valid_command(rig, command)) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } /* Set Main or SUB vfo */ @@ -1627,10 +1631,10 @@ int newcat_get_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t *rptr_shift) break; default: - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } - return RIG_OK; + RETURNFUNC(RIG_OK); } @@ -1641,7 +1645,7 @@ int newcat_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t offs) char command[32]; freq_t freq = 0; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; err = newcat_get_freq(rig, vfo, &freq); // Need to get freq to determine band @@ -1673,7 +1677,7 @@ int newcat_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t offs) else { // only valid on 10m and 6m bands - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } // Step size is 1 kHz @@ -1695,7 +1699,7 @@ int newcat_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t offs) else { // only valid on 10m and 6m bands - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } // Step size is 1 kHz @@ -1717,7 +1721,7 @@ int newcat_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t offs) else { // only valid on 10m and 6m bands - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } // Step size is 1 kHz @@ -1747,7 +1751,7 @@ int newcat_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t offs) else { // only valid on 10m to 70cm bands - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } // Step size is 1 kHz @@ -1769,7 +1773,7 @@ int newcat_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t offs) else { // only valid on 10m and 6m bands - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } // Step size is 1 kHz @@ -1791,7 +1795,7 @@ int newcat_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t offs) else { // only valid on 10m and 6m bands - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } // Step size is 1 kHz @@ -1813,7 +1817,7 @@ int newcat_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t offs) else { // only valid on 10m and 6m bands - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } // Step size is 1 kHz @@ -1839,7 +1843,7 @@ int newcat_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t offs) else { // only valid on 10m and 6m bands - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } // Step size is 1 kHz @@ -1850,7 +1854,7 @@ int newcat_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t offs) } else { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } return newcat_set_cmd(rig); @@ -1866,7 +1870,7 @@ int newcat_get_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t *offs) freq_t freq = 0; int step; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; err = newcat_get_freq(rig, vfo, &freq); // Need to get freq to determine band @@ -1896,7 +1900,7 @@ int newcat_get_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t *offs) { // only valid on 10m and 6m bands *offs = 0; - return RIG_OK; + RETURNFUNC(RIG_OK); } // Step size is 1 kHz @@ -1916,7 +1920,7 @@ int newcat_get_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t *offs) { // only valid on 10m and 6m bands *offs = 0; - return RIG_OK; + RETURNFUNC(RIG_OK); } // Step size is 1 kHz @@ -1936,7 +1940,7 @@ int newcat_get_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t *offs) { // only valid on 10m and 6m bands *offs = 0; - return RIG_OK; + RETURNFUNC(RIG_OK); } // Step size is 1 kHz @@ -1964,7 +1968,7 @@ int newcat_get_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t *offs) { // only valid on 10m to 70cm bands *offs = 0; - return RIG_OK; + RETURNFUNC(RIG_OK); } // Step size is 1 kHz @@ -1984,7 +1988,7 @@ int newcat_get_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t *offs) { // only valid on 10m and 6m bands *offs = 0; - return RIG_OK; + RETURNFUNC(RIG_OK); } // Step size is 1 kHz @@ -2004,7 +2008,7 @@ int newcat_get_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t *offs) { // only valid on 10m and 6m bands *offs = 0; - return RIG_OK; + RETURNFUNC(RIG_OK); } // Step size is 1 kHz @@ -2024,7 +2028,7 @@ int newcat_get_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t *offs) { // only valid on 10m and 6m bands *offs = 0; - return RIG_OK; + RETURNFUNC(RIG_OK); } // Step size is 1 kHz @@ -2052,7 +2056,7 @@ int newcat_get_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t *offs) { // only valid on 10m and 6m bands *offs = 0; - return RIG_OK; + RETURNFUNC(RIG_OK); } // Step size is 1 kHz @@ -2060,7 +2064,7 @@ int newcat_get_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t *offs) } else { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } err = newcat_get_cmd(rig); @@ -2079,41 +2083,41 @@ int newcat_get_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t *offs) *offs = atoi(retoffs) * step; - return RIG_OK; + RETURNFUNC(RIG_OK); } int newcat_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq) { - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } int newcat_get_split_freq(RIG *rig, vfo_t vfo, freq_t *tx_freq) { - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } int newcat_set_split_mode(RIG *rig, vfo_t vfo, rmode_t tx_mode, pbwidth_t tx_width) { - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } int newcat_get_split_mode(RIG *rig, vfo_t vfo, rmode_t *tx_mode, pbwidth_t *tx_width) { - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } @@ -2122,7 +2126,7 @@ int newcat_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo) int err; vfo_t rx_vfo; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; err = newcat_set_vfo_from_alias(rig, &vfo); @@ -2194,10 +2198,10 @@ int newcat_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo) break; default: - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } - return RIG_OK; + RETURNFUNC(RIG_OK); } @@ -2205,7 +2209,7 @@ int newcat_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo) { int err; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; err = newcat_set_vfo_from_alias(rig, &vfo); @@ -2235,7 +2239,7 @@ int newcat_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo) rig_strvfo(vfo), rig_strvfo(*tx_vfo)); - return RIG_OK; + RETURNFUNC(RIG_OK); } int newcat_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit) @@ -2244,9 +2248,11 @@ int newcat_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit) vfo_t oldvfo; int ret; + ENTERFUNC; + if (!newcat_valid_command(rig, "RT")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } oldvfo = newcat_set_vfo_if_needed(rig, vfo); @@ -2284,7 +2290,7 @@ int newcat_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit) if (oldvfo < 0) { return oldvfo; } - return ret; + RETURNFUNC(ret); } @@ -2296,6 +2302,8 @@ int newcat_get_rit(RIG *rig, vfo_t vfo, shortfreq_t *rit) int offset = 0; char *cmd = "IF"; + ENTERFUNC; + if (vfo == RIG_VFO_B || vfo == RIG_VFO_SUB) { cmd = "OI"; @@ -2303,13 +2311,11 @@ int newcat_get_rit(RIG *rig, vfo_t vfo, shortfreq_t *rit) if (!newcat_valid_command(rig, cmd)) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } *rit = 0; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); - snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%c", cmd, cat_term); rig_debug(RIG_DEBUG_TRACE, "%s: cmd_str = %s\n", __func__, priv->cmd_str); @@ -2346,7 +2352,7 @@ int newcat_get_rit(RIG *rig, vfo_t vfo, shortfreq_t *rit) // return the current offset even if turned off *rit = (shortfreq_t) atoi(retval); - return RIG_OK; + RETURNFUNC(RIG_OK); } @@ -2356,9 +2362,11 @@ int newcat_set_xit(RIG *rig, vfo_t vfo, shortfreq_t xit) vfo_t oldvfo; int ret; + ENTERFUNC; + if (!newcat_valid_command(rig, "XT")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } oldvfo = newcat_set_vfo_if_needed(rig, vfo); @@ -2397,7 +2405,7 @@ int newcat_set_xit(RIG *rig, vfo_t vfo, shortfreq_t xit) if (oldvfo < 0) { return oldvfo; } - return ret; + RETURNFUNC(ret); } @@ -2409,6 +2417,8 @@ int newcat_get_xit(RIG *rig, vfo_t vfo, shortfreq_t *xit) int offset = 0; char *cmd = "IF"; + ENTERFUNC; + if (vfo == RIG_VFO_B || vfo == RIG_VFO_SUB) { cmd = "OI"; @@ -2416,13 +2426,11 @@ int newcat_get_xit(RIG *rig, vfo_t vfo, shortfreq_t *xit) if (!newcat_valid_command(rig, cmd)) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } *xit = 0; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); - snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%c", cmd, cat_term); rig_debug(RIG_DEBUG_TRACE, "%s: cmd_str = %s\n", __func__, priv->cmd_str); @@ -2459,7 +2467,7 @@ int newcat_get_xit(RIG *rig, vfo_t vfo, shortfreq_t *xit) // return the offset even when turned off *xit = (shortfreq_t) atoi(retval); - return RIG_OK; + RETURNFUNC(RIG_OK); } @@ -2470,7 +2478,7 @@ int newcat_set_ts(RIG *rig, vfo_t vfo, shortfreq_t ts) rmode_t mode; ncboolean ts_match; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; err = newcat_get_mode(rig, vfo, &mode, &width); @@ -2507,11 +2515,11 @@ int newcat_set_ts(RIG *rig, vfo_t vfo, shortfreq_t ts) if (ts_match) { - return RIG_OK; + RETURNFUNC(RIG_OK); } else { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } } @@ -2524,7 +2532,8 @@ int newcat_get_ts(RIG *rig, vfo_t vfo, shortfreq_t *ts) ncboolean ts_match; ncboolean fast_step = FALSE; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + + ENTERFUNC; err = newcat_get_mode(rig, vfo, &mode, &width); @@ -2563,44 +2572,44 @@ int newcat_get_ts(RIG *rig, vfo_t vfo, shortfreq_t *ts) if (ts_match) { - return RIG_OK; + RETURNFUNC(RIG_OK); } else { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } } int newcat_set_dcs_code(RIG *rig, vfo_t vfo, tone_t code) { - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } int newcat_get_dcs_code(RIG *rig, vfo_t vfo, tone_t *code) { - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } int newcat_set_tone(RIG *rig, vfo_t vfo, tone_t tone) { - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } int newcat_get_tone(RIG *rig, vfo_t vfo, tone_t *tone) { - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } @@ -2612,16 +2621,16 @@ int newcat_set_ctcss_tone(RIG *rig, vfo_t vfo, tone_t tone) ncboolean tone_match; char main_sub_vfo = '0'; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; if (!newcat_valid_command(rig, "CN")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } if (!newcat_valid_command(rig, "CT")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } err = newcat_set_vfo_from_alias(rig, &vfo); @@ -2648,7 +2657,7 @@ int newcat_set_ctcss_tone(RIG *rig, vfo_t vfo, tone_t tone) if (tone_match == FALSE && tone != 0) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } if (tone == 0) /* turn off ctcss */ @@ -2684,11 +2693,11 @@ int newcat_get_ctcss_tone(RIG *rig, vfo_t vfo, tone_t *tone) char cmd[] = "CN"; char main_sub_vfo = '0'; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; if (!newcat_valid_command(rig, cmd)) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } err = newcat_set_vfo_from_alias(rig, &vfo); @@ -2731,44 +2740,44 @@ int newcat_get_ctcss_tone(RIG *rig, vfo_t vfo, tone_t *tone) if (t < 0 || t > 49) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } *tone = rig->caps->ctcss_list[t]; - return RIG_OK; + RETURNFUNC(RIG_OK); } int newcat_set_dcs_sql(RIG *rig, vfo_t vfo, tone_t code) { - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } int newcat_get_dcs_sql(RIG *rig, vfo_t vfo, tone_t *code) { - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } int newcat_set_tone_sql(RIG *rig, vfo_t vfo, tone_t tone) { - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } int newcat_get_tone_sql(RIG *rig, vfo_t vfo, tone_t *tone) { - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } @@ -2776,7 +2785,7 @@ int newcat_set_ctcss_sql(RIG *rig, vfo_t vfo, tone_t tone) { int err; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; err = newcat_set_ctcss_tone(rig, vfo, tone); @@ -2796,7 +2805,7 @@ int newcat_set_ctcss_sql(RIG *rig, vfo_t vfo, tone_t tone) } } - return RIG_OK; + RETURNFUNC(RIG_OK); } @@ -2804,7 +2813,7 @@ int newcat_get_ctcss_sql(RIG *rig, vfo_t vfo, tone_t *tone) { int err; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; err = newcat_get_ctcss_tone(rig, vfo, tone); @@ -2817,9 +2826,9 @@ int newcat_power2mW(RIG *rig, unsigned int *mwpower, float power, freq_t freq, { int rig_id; - rig_id = newcat_get_rigid(rig); + ENTERFUNC; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + rig_id = newcat_get_rigid(rig); switch (rig_id) { @@ -2895,7 +2904,7 @@ int newcat_power2mW(RIG *rig, unsigned int *mwpower, float power, freq_t freq, *mwpower); } - return RIG_OK; + RETURNFUNC(RIG_OK); } @@ -2904,9 +2913,9 @@ int newcat_mW2power(RIG *rig, float *power, unsigned int mwpower, freq_t freq, { int rig_id; - rig_id = newcat_get_rigid(rig); + ENTERFUNC; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + rig_id = newcat_get_rigid(rig); switch (rig_id) { @@ -2981,7 +2990,7 @@ int newcat_mW2power(RIG *rig, float *power, unsigned int mwpower, freq_t freq, *power); } - return RIG_OK; + RETURNFUNC(RIG_OK); } @@ -2994,11 +3003,11 @@ int newcat_set_powerstat(RIG *rig, powerstat_t status) int retry_save; char ps; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; if (!newcat_valid_command(rig, "PS")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } switch (status) @@ -3017,7 +3026,7 @@ int newcat_set_powerstat(RIG *rig, powerstat_t status) break; default: - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } snprintf(priv->cmd_str, sizeof(priv->cmd_str), "PS%c%c", ps, cat_term); @@ -3038,7 +3047,7 @@ int newcat_set_powerstat(RIG *rig, powerstat_t status) if (retval == RIG_OK) { rig->state.rigport.retry = retry_save; - return retval; + RETURNFUNC(retval); } rig_debug(RIG_DEBUG_TRACE, "%s: Wait #%d for power up\n", __func__, i + 1); @@ -3055,7 +3064,7 @@ int newcat_set_powerstat(RIG *rig, powerstat_t status) retval = -RIG_ETIMEOUT; } - return retval; + RETURNFUNC(retval); } @@ -3069,13 +3078,13 @@ int newcat_get_powerstat(RIG *rig, powerstat_t *status) char ps; char command[] = "PS"; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; *status = RIG_POWER_OFF; if (!newcat_valid_command(rig, command)) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%c", command, cat_term); @@ -3099,18 +3108,18 @@ int newcat_get_powerstat(RIG *rig, powerstat_t *status) break; default: - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } - return RIG_OK; + RETURNFUNC(RIG_OK); } int newcat_reset(RIG *rig, reset_t reset) { - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } @@ -3122,9 +3131,11 @@ int newcat_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option) char command[] = "AN"; char main_sub_vfo = '0'; + ENTERFUNC; + if (!newcat_valid_command(rig, command)) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } /* Main or SUB vfo */ @@ -3153,12 +3164,12 @@ int newcat_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option) case RIG_ANT_3: if (newcat_is_rig(rig, RIG_MODEL_FT950)) { - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } if (newcat_is_rig(rig, RIG_MODEL_FTDX1200)) { - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } which_ant = '3'; @@ -3167,12 +3178,12 @@ int newcat_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option) case RIG_ANT_4: if (newcat_is_rig(rig, RIG_MODEL_FT950)) { - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } if (newcat_is_rig(rig, RIG_MODEL_FTDX1200)) { - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } which_ant = '4'; @@ -3181,12 +3192,12 @@ int newcat_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option) case RIG_ANT_5: if (newcat_is_rig(rig, RIG_MODEL_FT950)) { - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } if (newcat_is_rig(rig, RIG_MODEL_FTDX1200)) { - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } /* RX only, on FT-2000/FT-5000/FT-9000 */ @@ -3194,7 +3205,7 @@ int newcat_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option) break; default: - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%c%c%c", command, @@ -3212,11 +3223,11 @@ int newcat_get_ant(RIG *rig, vfo_t vfo, ant_t dummy, value_t *option, char command[] = "AN"; char main_sub_vfo = '0'; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; if (!newcat_valid_command(rig, command)) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } /* Set Main or SUB vfo */ @@ -3270,7 +3281,7 @@ int newcat_get_ant(RIG *rig, vfo_t vfo, ant_t dummy, value_t *option, return -RIG_EPROTO; } - return RIG_OK; + RETURNFUNC(RIG_OK); } @@ -3285,7 +3296,7 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) char main_sub_vfo = '0'; char *format; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; /* Set Main or SUB vfo */ err = newcat_set_vfo_from_alias(rig, &vfo); @@ -3305,7 +3316,7 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) case RIG_LEVEL_RFPOWER: if (!newcat_valid_command(rig, "PC")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } if (is_ft950 || is_ftdx1200 || is_ftdx3000 || is_ft891 || is_ft991 @@ -3339,7 +3350,7 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) case RIG_LEVEL_AF: if (!newcat_valid_command(rig, "AG")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } fpf = newcat_scale_float(255, val.f); @@ -3350,7 +3361,7 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) case RIG_LEVEL_AGC: if (!newcat_valid_command(rig, "GT")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } switch (val.i) @@ -3376,7 +3387,7 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) break; default: - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } if (rig->caps->targetable_vfo & RIG_TARGETABLE_MODE) @@ -3393,7 +3404,7 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) if (!newcat_valid_command(rig, "IS")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } if (is_ft991 || is_ftdx5000 || is_ftdx101) @@ -3456,7 +3467,7 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) if (!newcat_valid_command(rig, "KP")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } if (val.i < 300) @@ -3489,7 +3500,7 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) case RIG_LEVEL_KEYSPD: if (!newcat_valid_command(rig, "KS")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } snprintf(priv->cmd_str, sizeof(priv->cmd_str), "KS%03d%c", val.i, cat_term); @@ -3502,7 +3513,7 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) if (!newcat_valid_command(rig, "MG")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } if (is_ft991 || is_ftdx5000 || is_ftdx101) @@ -3537,7 +3548,7 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) case RIG_LEVEL_METER: if (!newcat_valid_command(rig, "MS")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } if (is_ftdx101) // new format for the command with VFO selection @@ -3564,7 +3575,7 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) case RIG_METER_PO: if (newcat_is_rig(rig, RIG_MODEL_FT950)) { - return RIG_OK; + RETURNFUNC(RIG_OK); } else { @@ -3587,7 +3598,7 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) rig_debug(RIG_DEBUG_ERR, "%s: unknown val.i=%d\n", __func__, val.i); - default: return -RIG_EINVAL; + default: RETURNFUNC(-RIG_EINVAL); } break; @@ -3595,7 +3606,7 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) case RIG_LEVEL_PREAMP: if (!newcat_valid_command(rig, "PA")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } if (val.i == 0) @@ -3623,7 +3634,7 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) if (strlen(priv->cmd_str) == 0) { - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } if (rig->caps->targetable_vfo & RIG_TARGETABLE_MODE) @@ -3636,7 +3647,7 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) case RIG_LEVEL_ATT: if (!newcat_valid_command(rig, "RA")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } if (val.i == 0) @@ -3664,7 +3675,7 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) if (strlen(priv->cmd_str) == 0) { - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } if (rig->caps->targetable_vfo & RIG_TARGETABLE_MODE) @@ -3677,7 +3688,7 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) case RIG_LEVEL_RF: if (!newcat_valid_command(rig, "RG")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } if (is_ft891) @@ -3697,7 +3708,7 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) case RIG_LEVEL_NR: if (!newcat_valid_command(rig, "RL")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } if (newcat_is_rig(rig, RIG_MODEL_FT450)) @@ -3743,7 +3754,7 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) case RIG_LEVEL_COMP: if (!newcat_valid_command(rig, "PL")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } if (is_ft2000 || is_ftdx9000 || is_ftdx5000) @@ -3766,7 +3777,7 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) if (!newcat_valid_command(rig, "SD")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } // Convert 10/ths of dots to milliseconds using the current key speed @@ -3859,7 +3870,7 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) case RIG_LEVEL_SQL: if (!newcat_valid_command(rig, "SQ")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } if (is_ft891 || is_ft991 || is_ftdx101 || is_ftdx10) @@ -3879,7 +3890,7 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) case RIG_LEVEL_VOXDELAY: if (!newcat_valid_command(rig, "VD")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } /* VOX delay, api int (tenth of seconds), ms for rig */ @@ -3939,7 +3950,7 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) case RIG_LEVEL_VOXGAIN: if (!newcat_valid_command(rig, "VG")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } if (is_ft2000 || is_ftdx9000 || is_ftdx5000) @@ -3993,7 +4004,7 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) } else { - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } break; @@ -4001,7 +4012,7 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) case RIG_LEVEL_NOTCHF: if (!newcat_valid_command(rig, "BP")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } val.i = val.i / 10; @@ -4060,7 +4071,7 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) case RIG_LEVEL_MONITOR_GAIN: if (!newcat_valid_command(rig, "ML")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } if (is_ftdx1200 || is_ftdx3000 || is_ft891 || is_ft991 || is_ftdx101 @@ -4085,7 +4096,7 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) break; default: - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } err = newcat_set_cmd(rig); @@ -4109,7 +4120,7 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) char main_sub_vfo = '0'; int i; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; /* Set Main or SUB vfo */ err = newcat_set_vfo_from_alias(rig, &vfo); @@ -4129,7 +4140,7 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) case RIG_LEVEL_RFPOWER: if (!newcat_valid_command(rig, "PC")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } snprintf(priv->cmd_str, sizeof(priv->cmd_str), "PC%c", cat_term); @@ -4138,7 +4149,7 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) case RIG_LEVEL_PREAMP: if (!newcat_valid_command(rig, "PA")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } snprintf(priv->cmd_str, sizeof(priv->cmd_str), "PA0%c", cat_term); @@ -4153,7 +4164,7 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) case RIG_LEVEL_AF: if (!newcat_valid_command(rig, "AG")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } snprintf(priv->cmd_str, sizeof(priv->cmd_str), "AG%c%c", main_sub_vfo, @@ -4163,7 +4174,7 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) case RIG_LEVEL_AGC: if (!newcat_valid_command(rig, "GT")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } snprintf(priv->cmd_str, sizeof(priv->cmd_str), "GT%c%c", main_sub_vfo, @@ -4177,7 +4188,7 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) if (!newcat_valid_command(rig, "IS")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } if (is_ft991 || is_ftdx5000 || is_ftdx101) @@ -4209,7 +4220,7 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) case RIG_LEVEL_CWPITCH: if (!newcat_valid_command(rig, "KP")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } snprintf(priv->cmd_str, sizeof(priv->cmd_str), "KP%c", cat_term); @@ -4218,7 +4229,7 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) case RIG_LEVEL_KEYSPD: if (!newcat_valid_command(rig, "KS")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } snprintf(priv->cmd_str, sizeof(priv->cmd_str), "KS%c", cat_term); @@ -4231,7 +4242,7 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) if (!newcat_valid_command(rig, "MG")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } if (is_ft991 || is_ftdx5000 || is_ftdx101) @@ -4256,7 +4267,7 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) case RIG_LEVEL_METER: if (!newcat_valid_command(rig, "MS")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } snprintf(priv->cmd_str, sizeof(priv->cmd_str), "MS%c", cat_term); @@ -4265,7 +4276,7 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) case RIG_LEVEL_ATT: if (!newcat_valid_command(rig, "RA")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } snprintf(priv->cmd_str, sizeof(priv->cmd_str), "RA0%c", cat_term); @@ -4280,7 +4291,7 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) case RIG_LEVEL_RF: if (!newcat_valid_command(rig, "RG")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } snprintf(priv->cmd_str, sizeof(priv->cmd_str), "RG%c%c", main_sub_vfo, @@ -4290,7 +4301,7 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) case RIG_LEVEL_COMP: if (!newcat_valid_command(rig, "PL")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } snprintf(priv->cmd_str, sizeof(priv->cmd_str), "PL%c", cat_term); @@ -4299,7 +4310,7 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) case RIG_LEVEL_NR: if (!newcat_valid_command(rig, "RL")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } snprintf(priv->cmd_str, sizeof(priv->cmd_str), "RL0%c", cat_term); @@ -4314,7 +4325,7 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) case RIG_LEVEL_BKINDL: if (!newcat_valid_command(rig, "SD")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SD%c", cat_term); @@ -4323,7 +4334,7 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) case RIG_LEVEL_SQL: if (!newcat_valid_command(rig, "SQ")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SQ%c%c", main_sub_vfo, @@ -4335,7 +4346,7 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) /* VOX delay, arg int (tenth of seconds) */ if (!newcat_valid_command(rig, "VD")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } snprintf(priv->cmd_str, sizeof(priv->cmd_str), "VD%c", cat_term); @@ -4344,7 +4355,7 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) case RIG_LEVEL_VOXGAIN: if (!newcat_valid_command(rig, "VG")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } snprintf(priv->cmd_str, sizeof(priv->cmd_str), "VG%c", cat_term); @@ -4357,7 +4368,7 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) case RIG_LEVEL_RAWSTR: if (!newcat_valid_command(rig, "SM")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SM%c%c", main_sub_vfo, @@ -4367,7 +4378,7 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) case RIG_LEVEL_SWR: if (!newcat_valid_command(rig, "RM")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } snprintf(priv->cmd_str, sizeof(priv->cmd_str), "RM6%c", cat_term); @@ -4376,7 +4387,7 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) case RIG_LEVEL_ALC: if (!newcat_valid_command(rig, "RM")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } snprintf(priv->cmd_str, sizeof(priv->cmd_str), "RM4%c", cat_term); @@ -4386,7 +4397,7 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) case RIG_LEVEL_RFPOWER_METER_WATTS: if (!newcat_valid_command(rig, "RM")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } if (is_ftdx9000) @@ -4403,7 +4414,7 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) case RIG_LEVEL_COMP_METER: if (!newcat_valid_command(rig, "RM")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } snprintf(priv->cmd_str, sizeof(priv->cmd_str), "RM3%c", cat_term); @@ -4412,7 +4423,7 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) case RIG_LEVEL_VD_METER: if (!newcat_valid_command(rig, "RM")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } snprintf(priv->cmd_str, sizeof(priv->cmd_str), "RM8%c", cat_term); @@ -4421,7 +4432,7 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) case RIG_LEVEL_ID_METER: if (!newcat_valid_command(rig, "RM")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } snprintf(priv->cmd_str, sizeof(priv->cmd_str), "RM7%c", cat_term); @@ -4462,7 +4473,7 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) } else { - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } break; @@ -4470,7 +4481,7 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) case RIG_LEVEL_NOTCHF: if (!newcat_valid_command(rig, "BP")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } snprintf(priv->cmd_str, sizeof(priv->cmd_str), "BP01%c", cat_term); @@ -4489,7 +4500,7 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) case RIG_LEVEL_MONITOR_GAIN: if (!newcat_valid_command(rig, "ML")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } if (is_ftdx9000) @@ -4504,7 +4515,7 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) break; default: - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } err = newcat_get_cmd(rig); @@ -5024,10 +5035,10 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) break; default: - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } - return RIG_OK; + RETURNFUNC(RIG_OK); } @@ -5037,7 +5048,7 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) int err; char main_sub_vfo = '0'; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; /* Set Main or SUB vfo */ err = newcat_set_vfo_from_alias(rig, &vfo); @@ -5061,7 +5072,7 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) if (!newcat_valid_command(rig, "BC")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } if (is_ft991 || is_ftdx5000 || is_ftdx101) @@ -5096,7 +5107,7 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) if (!newcat_valid_command(rig, "BP")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } if (is_ft991 || is_ftdx5000 || is_ftdx101) @@ -5127,7 +5138,7 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) case RIG_FUNC_FBKIN: if (!newcat_valid_command(rig, "BI")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } snprintf(priv->cmd_str, sizeof(priv->cmd_str), "BI%d%c", status ? 1 : 0, @@ -5137,7 +5148,7 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) case RIG_FUNC_TONE: if (!newcat_valid_command(rig, "CT")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } snprintf(priv->cmd_str, sizeof(priv->cmd_str), "CT0%d%c", status ? 2 : 0, @@ -5153,7 +5164,7 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) case RIG_FUNC_TSQL: if (!newcat_valid_command(rig, "CT")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } snprintf(priv->cmd_str, sizeof(priv->cmd_str), "CT0%d%c", status ? 1 : 0, @@ -5169,7 +5180,7 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) case RIG_FUNC_LOCK: if (!newcat_valid_command(rig, "LK")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } if (is_ftdx1200 || is_ftdx3000 || is_ftdx5000 || is_ftdx101) @@ -5189,7 +5200,7 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) case RIG_FUNC_MON: if (!newcat_valid_command(rig, "ML")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } snprintf(priv->cmd_str, sizeof(priv->cmd_str), "ML0%03d%c", status ? 1 : 0, @@ -5199,7 +5210,7 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) case RIG_FUNC_NB: if (!newcat_valid_command(rig, "NB")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } snprintf(priv->cmd_str, sizeof(priv->cmd_str), "NB0%d%c", status ? 1 : 0, @@ -5219,7 +5230,7 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) if (!newcat_valid_command(rig, "NR")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } if (is_ft991 || is_ftdx5000 || is_ftdx101) @@ -5254,7 +5265,7 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) if (!newcat_valid_command(rig, "PR")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } if (is_ft991 || is_ftdx5000 || is_ftdx101) @@ -5291,7 +5302,7 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) case RIG_FUNC_VOX: if (!newcat_valid_command(rig, "VX")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } snprintf(priv->cmd_str, sizeof(priv->cmd_str), "VX%d%c", status ? 1 : 0, @@ -5301,7 +5312,7 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) case RIG_FUNC_TUNER: if (!newcat_valid_command(rig, "AC")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } snprintf(priv->cmd_str, sizeof(priv->cmd_str), "AC00%d%c", @@ -5312,7 +5323,7 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) case RIG_FUNC_RIT: if (!newcat_valid_command(rig, "RT")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } snprintf(priv->cmd_str, sizeof(priv->cmd_str), "RT%d%c", status ? 1 : 0, @@ -5322,7 +5333,7 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) case RIG_FUNC_XIT: if (!newcat_valid_command(rig, "XT")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } snprintf(priv->cmd_str, sizeof(priv->cmd_str), "XT%d%c", status ? 1 : 0, @@ -5330,7 +5341,7 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) break; default: - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } err = newcat_set_cmd(rig); @@ -5351,7 +5362,7 @@ int newcat_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status) char *retfunc; char main_sub_vfo = '0'; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; if (rig->caps->targetable_vfo & (RIG_TARGETABLE_MODE | RIG_TARGETABLE_TONE)) { @@ -5367,7 +5378,7 @@ int newcat_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status) if (!newcat_valid_command(rig, "BC")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } if (is_ft991 || is_ftdx5000 || is_ftdx101) @@ -5397,7 +5408,7 @@ int newcat_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status) case RIG_FUNC_MN: if (!newcat_valid_command(rig, "BP")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } snprintf(priv->cmd_str, sizeof(priv->cmd_str), "BP00%c", cat_term); @@ -5412,7 +5423,7 @@ int newcat_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status) case RIG_FUNC_FBKIN: if (!newcat_valid_command(rig, "BI")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } snprintf(priv->cmd_str, sizeof(priv->cmd_str), "BI%c", cat_term); @@ -5421,7 +5432,7 @@ int newcat_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status) case RIG_FUNC_TONE: if (!newcat_valid_command(rig, "CT")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } snprintf(priv->cmd_str, sizeof(priv->cmd_str), "CT0%c", cat_term); @@ -5436,7 +5447,7 @@ int newcat_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status) case RIG_FUNC_TSQL: if (!newcat_valid_command(rig, "CT")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } snprintf(priv->cmd_str, sizeof(priv->cmd_str), "CT0%c", cat_term); @@ -5451,7 +5462,7 @@ int newcat_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status) case RIG_FUNC_LOCK: if (!newcat_valid_command(rig, "LK")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } snprintf(priv->cmd_str, sizeof(priv->cmd_str), "LK%c", cat_term); @@ -5460,7 +5471,7 @@ int newcat_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status) case RIG_FUNC_MON: if (!newcat_valid_command(rig, "ML")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } snprintf(priv->cmd_str, sizeof(priv->cmd_str), "ML0%c", cat_term); @@ -5469,7 +5480,7 @@ int newcat_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status) case RIG_FUNC_NB: if (!newcat_valid_command(rig, "NB")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } snprintf(priv->cmd_str, sizeof(priv->cmd_str), "NB0%c", cat_term); @@ -5484,7 +5495,7 @@ int newcat_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status) case RIG_FUNC_NR: if (!newcat_valid_command(rig, "NR")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } snprintf(priv->cmd_str, sizeof(priv->cmd_str), "NR0%c", cat_term); @@ -5499,7 +5510,7 @@ int newcat_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status) case RIG_FUNC_COMP: if (!newcat_valid_command(rig, "PR")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } if (is_ftdx1200 || is_ftdx3000 || is_ft891 || is_ft991 || is_ftdx101) @@ -5516,7 +5527,7 @@ int newcat_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status) case RIG_FUNC_VOX: if (!newcat_valid_command(rig, "VX")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } snprintf(priv->cmd_str, sizeof(priv->cmd_str), "VX%c", cat_term); @@ -5525,7 +5536,7 @@ int newcat_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status) case RIG_FUNC_TUNER: if (!newcat_valid_command(rig, "AC")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } snprintf(priv->cmd_str, sizeof(priv->cmd_str), "AC%c", cat_term); @@ -5534,7 +5545,7 @@ int newcat_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status) case RIG_FUNC_RIT: if (!newcat_valid_command(rig, "RT")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } snprintf(priv->cmd_str, sizeof(priv->cmd_str), "RT%c", cat_term); @@ -5543,14 +5554,14 @@ int newcat_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status) case RIG_FUNC_XIT: if (!newcat_valid_command(rig, "XT")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } snprintf(priv->cmd_str, sizeof(priv->cmd_str), "XT%c", cat_term); break; default: - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } err = newcat_get_cmd(rig); @@ -5631,32 +5642,32 @@ int newcat_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status) break; default: - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } - return RIG_OK; + RETURNFUNC(RIG_OK); } int newcat_set_parm(RIG *rig, setting_t parm, value_t val) { - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } int newcat_get_parm(RIG *rig, setting_t parm, value_t *val) { - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } int newcat_set_ext_level(RIG *rig, vfo_t vfo, token_t token, value_t val) { - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; switch (token) { @@ -5666,7 +5677,7 @@ int newcat_set_ext_level(RIG *rig, vfo_t vfo, token_t token, value_t val) default: rig_debug(RIG_DEBUG_ERR, "%s: Unsupported ext level %s\n", __func__, rig_strlevel(token)); - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } } @@ -5674,7 +5685,7 @@ int newcat_get_ext_level(RIG *rig, vfo_t vfo, token_t token, value_t *val) { int retval; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; switch (token) { @@ -5685,7 +5696,7 @@ int newcat_get_ext_level(RIG *rig, vfo_t vfo, token_t token, value_t *val) if (retval != RIG_OK) { - return retval; + RETURNFUNC(retval); } val->i = roofing_filter->index; @@ -5695,57 +5706,57 @@ int newcat_get_ext_level(RIG *rig, vfo_t vfo, token_t token, value_t *val) default: rig_debug(RIG_DEBUG_ERR, "%s: Unsupported ext level %s\n", __func__, rig_strlevel(token)); - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } - return RIG_OK; + RETURNFUNC(RIG_OK); } int newcat_set_ext_parm(RIG *rig, token_t token, value_t val) { - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } int newcat_get_ext_parm(RIG *rig, token_t token, value_t *val) { - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } int newcat_send_dtmf(RIG *rig, vfo_t vfo, const char *digits) { - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } int newcat_recv_dtmf(RIG *rig, vfo_t vfo, char *digits, int *length) { - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } int newcat_send_morse(RIG *rig, vfo_t vfo, const char *msg) { - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } int newcat_set_bank(RIG *rig, vfo_t vfo, int bank) { - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } @@ -5758,11 +5769,11 @@ int newcat_set_mem(RIG *rig, vfo_t vfo, int ch) channel_t valid_chan; channel_cap_t *mem_caps = NULL; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; if (!newcat_valid_command(rig, "MC")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } chan_list = rig->caps->chan_list; @@ -5798,7 +5809,7 @@ int newcat_set_mem(RIG *rig, vfo_t vfo, int ch) /* Out of Range, or empty */ if (!mem_caps) { - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } /* set to usable vfo if needed */ @@ -5857,7 +5868,7 @@ int newcat_set_mem(RIG *rig, vfo_t vfo, int ch) } } - return RIG_OK; + RETURNFUNC(RIG_OK); } @@ -5866,11 +5877,11 @@ int newcat_get_mem(RIG *rig, vfo_t vfo, int *ch) struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; int err; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; if (!newcat_valid_command(rig, "MC")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } snprintf(priv->cmd_str, sizeof(priv->cmd_str), "MC%c", cat_term); @@ -5885,7 +5896,7 @@ int newcat_get_mem(RIG *rig, vfo_t vfo, int *ch) *ch = atoi(priv->ret_data + 2); - return RIG_OK; + RETURNFUNC(RIG_OK); } int newcat_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op) @@ -5894,7 +5905,7 @@ int newcat_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op) int err; char main_sub_vfo = '0'; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; /* Set Main or SUB vfo */ err = newcat_set_vfo_from_alias(rig, &vfo); @@ -5975,7 +5986,7 @@ int newcat_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op) break; default: - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } return newcat_set_cmd(rig); @@ -5984,9 +5995,9 @@ int newcat_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op) int newcat_scan(RIG *rig, vfo_t vfo, scan_t scan, int ch) { - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } @@ -5995,11 +6006,11 @@ int newcat_set_trn(RIG *rig, int trn) struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; char c; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; if (!newcat_valid_command(rig, "AI")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } if (trn == RIG_TRN_OFF) @@ -6026,11 +6037,11 @@ int newcat_get_trn(RIG *rig, int *trn) char c; char command[] = "AI"; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; if (!newcat_valid_command(rig, command)) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%c", command, cat_term); @@ -6052,15 +6063,15 @@ int newcat_get_trn(RIG *rig, int *trn) *trn = RIG_TRN_RIG; } - return RIG_OK; + RETURNFUNC(RIG_OK); } int newcat_decode_event(RIG *rig) { - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } @@ -6076,12 +6087,12 @@ int newcat_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan) chan_t *chan_list; channel_cap_t *mem_caps = NULL; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; if (!newcat_valid_command(rig, "MW")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } chan_list = rig->caps->chan_list; @@ -6102,7 +6113,7 @@ int newcat_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan) /* Out of Range */ if (!mem_caps) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } /* Set Restore to VFO or leave in memory mode */ @@ -6218,7 +6229,7 @@ int newcat_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan) return err; } - return RIG_OK; + RETURNFUNC(RIG_OK); } @@ -6231,11 +6242,11 @@ int newcat_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only) chan_t *chan_list; channel_cap_t *mem_caps = NULL; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; if (!newcat_valid_command(rig, "MR")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } chan_list = rig->caps->chan_list; @@ -6253,7 +6264,7 @@ int newcat_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only) /* Out of Range */ if (!mem_caps) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } rig_debug(RIG_DEBUG_TRACE, "sizeof(channel_t) = %d\n", (int)sizeof(channel_t)); @@ -6278,7 +6289,7 @@ int newcat_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only) /* Invalid channel, has not been set up, make sure freq is 0 to indicate empty channel */ chan->freq = 0.; - return RIG_OK; + RETURNFUNC(RIG_OK); } return err; @@ -6384,7 +6395,7 @@ int newcat_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only) return -RIG_ENIMPL; } - return RIG_OK; + RETURNFUNC(RIG_OK); } @@ -6393,7 +6404,7 @@ const char *newcat_get_info(RIG *rig) struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; static char idbuf[129]; /* extra large static string array */ - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; /* Build the command string */ snprintf(priv->cmd_str, sizeof(priv->cmd_str), "ID;"); @@ -6428,7 +6439,7 @@ ncboolean newcat_valid_command(RIG *rig, char const *const command) int search_high; int search_low; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; rig_debug(RIG_DEBUG_TRACE, "%s %s\n", __func__, command); caps = rig->caps; @@ -6557,6 +6568,8 @@ ncboolean newcat_is_rig(RIG *rig, rig_model_t model) { ncboolean is_rig; + //a bit too verbose so TRACE level here + rig_debug(RIG_DEBUG_TRACE, "%s(%d):%s called\n", __FILE__, __LINE__, __func__); is_rig = (model == rig->caps->rig_model) ? TRUE : FALSE; return is_rig; @@ -6573,11 +6586,11 @@ int newcat_set_tx_vfo(RIG *rig, vfo_t tx_vfo) char p1; char *command = "FT"; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; if (!newcat_valid_command(rig, "FT")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } err = newcat_set_vfo_from_alias(rig, &tx_vfo); @@ -6604,7 +6617,7 @@ int newcat_set_tx_vfo(RIG *rig, vfo_t tx_vfo) /* VFO A */ if (priv->current_mem == NC_MEM_CHANNEL_NONE) { - return RIG_OK; + RETURNFUNC(RIG_OK); } else /* Memory Channel mode */ { @@ -6614,7 +6627,7 @@ int newcat_set_tx_vfo(RIG *rig, vfo_t tx_vfo) break; default: - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } /* TODO: G4WJS - FT-450 only has toggle command so not sure how to @@ -6657,6 +6670,8 @@ int newcat_get_tx_vfo(RIG *rig, vfo_t *tx_vfo) vfo_t vfo_mode; char const *command = "FT"; + ENTERFUNC; + if (is_ftdx101) { // what other Yaeus rigs should be using this? @@ -6664,11 +6679,9 @@ int newcat_get_tx_vfo(RIG *rig, vfo_t *tx_vfo) command = "ST"; } - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); - if (!newcat_valid_command(rig, command)) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%c", command, cat_term); @@ -6718,13 +6731,14 @@ int newcat_get_tx_vfo(RIG *rig, vfo_t *tx_vfo) rig_debug(RIG_DEBUG_TRACE, "%s: tx_vfo = %s\n", __func__, rig_strvfo(*tx_vfo)); - return RIG_OK; + RETURNFUNC(RIG_OK); } int newcat_set_vfo_from_alias(RIG *rig, vfo_t *vfo) { + ENTERFUNC; rig_debug(RIG_DEBUG_TRACE, "%s: alias vfo = %s\n", __func__, rig_strvfo(*vfo)); switch (*vfo) @@ -6764,10 +6778,10 @@ int newcat_set_vfo_from_alias(RIG *rig, vfo_t *vfo) default: rig_debug(RIG_DEBUG_TRACE, "Unrecognized. vfo= %s\n", rig_strvfo(*vfo)); - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } - return RIG_OK; + RETURNFUNC(RIG_OK); } /* @@ -6806,11 +6820,11 @@ int newcat_set_narrow(RIG *rig, vfo_t vfo, ncboolean narrow) char c; char main_sub_vfo = '0'; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; if (!newcat_valid_command(rig, "NA")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } err = newcat_set_vfo_from_alias(rig, &vfo); @@ -6851,11 +6865,11 @@ int newcat_get_narrow(RIG *rig, vfo_t vfo, ncboolean *narrow) char command[] = "NA"; char main_sub_vfo = '0'; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; if (!newcat_valid_command(rig, command)) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } err = newcat_set_vfo_from_alias(rig, &vfo); @@ -6890,7 +6904,7 @@ int newcat_get_narrow(RIG *rig, vfo_t vfo, ncboolean *narrow) *narrow = FALSE; } - return RIG_OK; + RETURNFUNC(RIG_OK); } // returns 1 if in narrow mode 0 if not, < 0 if error @@ -6901,6 +6915,7 @@ static int get_narrow(RIG *rig, vfo_t vfo) int narrow = 0; int err; + ENTERFUNC; // find out if we're in narrow or wide mode snprintf(priv->cmd_str, sizeof(priv->cmd_str), "NA%c%c", @@ -6928,13 +6943,13 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) int w; char main_sub_vfo = '0'; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; rig_debug(RIG_DEBUG_TRACE, "%s vfo=%s, mode=%s, width=%d\n", __func__, rig_strvfo(vfo), rig_strrmode(mode), (int)width); if (!newcat_valid_command(rig, "SH")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } err = newcat_set_vfo_from_alias(rig, &vfo); @@ -7026,7 +7041,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) break; default: - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } // end switch(mode) if ((err = set_roofing_filter_for_width(rig, vfo, width)) != RIG_OK) @@ -7051,7 +7066,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) return err; case RIG_MODE_FMN: - return RIG_OK; + RETURNFUNC(RIG_OK); } } // end is_ft950 */ else if (is_ft891) @@ -7146,7 +7161,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) break; default: - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } // end switch(mode) } // end is_ft891 else if (is_ft991) @@ -7266,7 +7281,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) } else { - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } return err; @@ -7284,7 +7299,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) return err; default: - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } // end switch(mode) } // end is_ft991 else if (is_ftdx1200 || is_ftdx3000) @@ -7374,7 +7389,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) break; default: - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } // end switch(mode) if ((err = set_roofing_filter_for_width(rig, vfo, width)) != RIG_OK) @@ -7486,7 +7501,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) break; default: - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } // end switch(mode) if ((err = set_roofing_filter_for_width(rig, vfo, width)) != RIG_OK) @@ -7583,7 +7598,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) break; default: - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } // end switch(mode) if ((err = set_roofing_filter_for_width(rig, vfo, width)) != RIG_OK) @@ -7609,7 +7624,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) case RIG_MODE_AMN: case RIG_MODE_FMN: - return RIG_OK; + RETURNFUNC(RIG_OK); } } // end is_ftdx101 else if (is_ft2000) @@ -7674,10 +7689,10 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) case RIG_MODE_PKTFM: case RIG_MODE_AMN: case RIG_MODE_FMN: - return RIG_OK; + RETURNFUNC(RIG_OK); default: - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } if ((err = set_roofing_filter_for_width(rig, vfo, width)) != RIG_OK) @@ -7747,10 +7762,10 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) return err; case RIG_MODE_FMN: - return RIG_OK; + RETURNFUNC(RIG_OK); default: - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } /* end switch(mode) */ } /* end else */ @@ -7787,11 +7802,11 @@ static int set_roofing_filter(RIG *rig, vfo_t vfo, int index) int err; int i; - rig_debug(RIG_DEBUG_TRACE, "%s: called\n", __func__); + ENTERFUNC; if (priv_caps == NULL) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } roofing_filters = priv_caps->roofing_filters; @@ -7803,7 +7818,7 @@ static int set_roofing_filter(RIG *rig, vfo_t vfo, int index) if (!newcat_valid_command(rig, "RF")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } for (i = 0; roofing_filters[i].index >= 0; i++) @@ -7826,7 +7841,7 @@ static int set_roofing_filter(RIG *rig, vfo_t vfo, int index) if (roofing_filter_choice == 0) { - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } snprintf(priv->cmd_str, sizeof(priv->cmd_str), "RF%c%c%c", main_sub_vfo, @@ -7841,7 +7856,7 @@ static int set_roofing_filter(RIG *rig, vfo_t vfo, int index) return err; } - return RIG_OK; + RETURNFUNC(RIG_OK); } static int set_roofing_filter_for_width(RIG *rig, vfo_t vfo, int width) @@ -7850,11 +7865,11 @@ static int set_roofing_filter_for_width(RIG *rig, vfo_t vfo, int width) int index = 0; int i; - rig_debug(RIG_DEBUG_TRACE, "%s: called\n", __func__); + ENTERFUNC; if (priv_caps == NULL) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } for (i = 0; i < priv_caps->roofing_filter_count; i++) @@ -7893,11 +7908,11 @@ static int get_roofing_filter(RIG *rig, vfo_t vfo, int n; int i; - rig_debug(RIG_DEBUG_TRACE, "%s: called\n", __func__); + ENTERFUNC; if (priv_caps == NULL) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } roofing_filters = priv_caps->roofing_filters; @@ -7932,7 +7947,7 @@ static int get_roofing_filter(RIG *rig, vfo_t vfo, if (current_filter->get_value == roofing_filter_choice) { *roofing_filter = current_filter; - return RIG_OK; + RETURNFUNC(RIG_OK); } } @@ -7953,12 +7968,13 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) char cmd[] = "SH"; char main_sub_vfo = '0'; - rig_debug(RIG_DEBUG_VERBOSE, "%s called, vfo=%s, mode=%s\n", __func__, + ENTERFUNC; + rig_debug(RIG_DEBUG_TRACE, "%s vfo=%s, mode=%s\n", __func__, rig_strvfo(vfo), rig_strrmode(mode)); if (!newcat_valid_command(rig, cmd)) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } err = newcat_set_vfo_from_alias(rig, &vfo); @@ -8104,7 +8120,7 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) case 13: *width = 2400; break; - default: return -RIG_EINVAL; + default: RETURNFUNC(-RIG_EINVAL); } break; @@ -8158,7 +8174,7 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) case 20: *width = 3000; break; default: - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } break; @@ -8178,7 +8194,7 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) default: rig_debug(RIG_DEBUG_ERR, "%s: unknown mode=%s\n", __func__, rig_strrmode(mode)); - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } /* end switch(mode) */ } /* end if is_ft950 */ @@ -8248,7 +8264,7 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) default: rig_debug(RIG_DEBUG_ERR, "%s: unknown w=%d\n", __func__, w); - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } break; @@ -8303,7 +8319,7 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) default: rig_debug(RIG_DEBUG_ERR, "%s: unknown mode=%s\n", __func__, rig_strrmode(mode)); - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } break; @@ -8324,7 +8340,7 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) default: rig_debug(RIG_DEBUG_ERR, "%s: unknown mode=%s\n", __func__, rig_strrmode(mode)); - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } /* end switch(mode) */ } /* end if is_ft891 */ @@ -8391,7 +8407,7 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) case 17: *width = 3000; break; - default: return -RIG_EINVAL; + default: RETURNFUNC(-RIG_EINVAL); } break; @@ -8444,7 +8460,7 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) case 21: *width = 3200; break; - default: return -RIG_EINVAL; + default: RETURNFUNC(-RIG_EINVAL); } break; @@ -8465,7 +8481,7 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) break; default: - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } /* end switch(mode) */ } /* end if is_ft991 */ @@ -8522,7 +8538,7 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) case 16: *width = 2400; break; - default: return -RIG_EINVAL; + default: RETURNFUNC(-RIG_EINVAL); } break; @@ -8585,7 +8601,7 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) case 25: *width = 4000; break; - default: return -RIG_EINVAL; + default: RETURNFUNC(-RIG_EINVAL); } break; @@ -8608,7 +8624,7 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) break; default: - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } /* end switch(mode) */ } /* end if is_ftdx1200 or is_ftdx3000 */ @@ -8665,7 +8681,7 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) case 16: *width = 2400; break; - default: return -RIG_EINVAL; + default: RETURNFUNC(-RIG_EINVAL); } break; @@ -8729,7 +8745,7 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) case 25: *width = 4000; break; - default: return -RIG_EINVAL; + default: RETURNFUNC(-RIG_EINVAL); } break; @@ -8752,7 +8768,7 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) break; default: - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } /* end switch(mode) */ } /* end if is_ftdx5000 */ @@ -8820,7 +8836,7 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) case 18: *width = 3000; break; - default: return -RIG_EINVAL; + default: RETURNFUNC(-RIG_EINVAL); } break; @@ -8879,7 +8895,7 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) default: rig_debug(RIG_DEBUG_ERR, "%s: unknown width=%d\n", __func__, w); - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } break; @@ -8901,7 +8917,7 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) default: rig_debug(RIG_DEBUG_TRACE, "%s: bad mode\n", __func__); - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } /* end switch(mode) */ rig_debug(RIG_DEBUG_TRACE, "%s: end if FTDX101D\n", __func__); @@ -9009,7 +9025,7 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) break; default: - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } /* end switch (mode) */ } /* end if is_ft2000 */ else @@ -9058,12 +9074,12 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) break; default: - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } /* end switch (mode) */ } /* end else */ - rig_debug(RIG_DEBUG_TRACE, "%s: return RIG_OK\n", __func__); - return RIG_OK; + rig_debug(RIG_DEBUG_TRACE, "%s: RETURNFUNC(RIG_OK)\n", __func__); + RETURNFUNC(RIG_OK); } @@ -9072,11 +9088,11 @@ int newcat_set_faststep(RIG *rig, ncboolean fast_step) struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; char c; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; if (!newcat_valid_command(rig, "FS")) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } if (fast_step == TRUE) @@ -9103,11 +9119,11 @@ int newcat_get_faststep(RIG *rig, ncboolean *fast_step) char c; char command[] = "FS"; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; if (!newcat_valid_command(rig, command)) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%c", command, cat_term); @@ -9129,7 +9145,7 @@ int newcat_get_faststep(RIG *rig, ncboolean *fast_step) *fast_step = FALSE; } - return RIG_OK; + RETURNFUNC(RIG_OK); } @@ -9138,7 +9154,7 @@ int newcat_get_rigid(RIG *rig) struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; const char *s = NULL; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; /* if first valid get */ if (priv->rig_id == NC_RIGID_NONE) @@ -9172,11 +9188,11 @@ int newcat_get_vfo_mode(RIG *rig, vfo_t *vfo_mode) int offset = 0; char command[] = "IF"; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; if (!newcat_valid_command(rig, command)) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } /* Get VFO A Information ****************** */ @@ -9238,11 +9254,11 @@ int newcat_vfomem_toggle(RIG *rig) struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; char command[] = "VM"; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; if (!newcat_valid_command(rig, command)) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } /* copy set command */ @@ -9272,6 +9288,7 @@ int newcat_get_cmd(RIG *rig) int rc = -RIG_EPROTO; int is_read_cmd = 0; + ENTERFUNC; // try to cache rapid repeats of the IF command // this is for WSJT-X/JTDX sequence of v/f/m/t // should allow rapid repeat of any call using the IF; cmd @@ -9286,7 +9303,7 @@ int newcat_get_cmd(RIG *rig) { rig_debug(RIG_DEBUG_TRACE, "%s: cache hit, age=%dms\n", __func__, cache_age_ms); strcpy(priv->ret_data, priv->last_if_response); - return RIG_OK; + RETURNFUNC(RIG_OK); } // we drop through and do the real IF command @@ -9367,7 +9384,7 @@ int newcat_get_cmd(RIG *rig) if (RIG_OK != (rc = write_block(&state->rigport, priv->cmd_str, strlen(priv->cmd_str)))) { - return rc; + RETURNFUNC(rc); } } @@ -9409,7 +9426,7 @@ int newcat_get_cmd(RIG *rig) case 'N': /* Command recognized by rig but invalid data entered. */ rig_debug(RIG_DEBUG_VERBOSE, "%s: NegAck for '%s'\n", __func__, priv->cmd_str); - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); case 'O': /* Too many characters sent without a carriage return */ @@ -9450,7 +9467,7 @@ int newcat_get_cmd(RIG *rig) rig_debug(RIG_DEBUG_ERR, "%s: Command rejected by the rig (get): '%s'\n", __func__, priv->cmd_str); - return -RIG_ERJCTED; + RETURNFUNC(-RIG_ERJCTED); } rig_debug(RIG_DEBUG_WARN, "%s: Rig busy - retrying %d of %d: '%s'\n", __func__, @@ -9488,7 +9505,7 @@ int newcat_get_cmd(RIG *rig) strcpy(priv->last_if_response, priv->ret_data); } - return rc; + RETURNFUNC(rc); } /* @@ -9505,6 +9522,7 @@ int newcat_set_cmd_validate(RIG *rig) int sleepms = 50; int rc = -RIG_EPROTO; + ENTERFUNC; rig_debug(RIG_DEBUG_TRACE, "%s: priv->cmd_str=%s\n", __func__, priv->cmd_str); if ((strncmp(priv->cmd_str, "FA", 2) == 0) && (strlen(priv->cmd_str) > 3)) @@ -9560,24 +9578,24 @@ int newcat_set_cmd_validate(RIG *rig) && strncmp(priv->ret_data, "FT", 2) == 0) { // FT command does not echo what's sent so we just check the basic command - return RIG_OK; + RETURNFUNC(RIG_OK); } if (strncmp(priv->cmd_str, "TX", 2) == 0 && strncmp(priv->ret_data, "TX", 2) == 0) { // TX command does not echo what's sent so we just check the basic command - return RIG_OK; + RETURNFUNC(RIG_OK); } if (bytes > 0) { // if they match we are validated - if (strcmp(priv->cmd_str, priv->ret_data) == 0) { return RIG_OK; } + if (strcmp(priv->cmd_str, priv->ret_data) == 0) { RETURNFUNC(RIG_OK); } else { rc = -RIG_EPROTO; } } - rig_debug(RIG_DEBUG_ERR, "%s: cmd validation failed, '%s'!='%s', try#%d\n", + rig_debug(RIG_DEBUG_WARN, "%s: cmd validation failed, '%s'!='%s', try#%d\n", __func__, priv->cmd_str, priv->ret_data, retry); hl_usleep(sleepms * 1000); } @@ -9601,6 +9619,7 @@ int newcat_set_cmd(RIG *rig) int retry_count = 0; int rc = -RIG_EPROTO; + ENTERFUNC; /* pick a basic quick query command for verification */ char const *const verify_cmd = RIG_MODEL_FT9000 == rig->caps->rig_model ? "AI;" : "ID;"; @@ -9616,12 +9635,12 @@ int newcat_set_cmd(RIG *rig) if (rc == RIG_OK) { rig_debug(RIG_DEBUG_TRACE, "%s: cmd_validate OK\n", __func__); - return RIG_OK; + RETURNFUNC(RIG_OK); } else if (rc == -RIG_EPROTO) { rig_debug(RIG_DEBUG_TRACE, "%s: set_cmd_validate failed\n", __func__); - return rc; + RETURNFUNC(rc); } rig_debug(RIG_DEBUG_TRACE, @@ -9630,13 +9649,13 @@ int newcat_set_cmd(RIG *rig) if (RIG_OK != (rc = write_block(&state->rigport, priv->cmd_str, strlen(priv->cmd_str)))) { - return rc; + RETURNFUNC(rc); } /* skip validation if high throughput is needed */ if (priv->fast_set_commands == TRUE) { - return RIG_OK; + RETURNFUNC(RIG_OK); } if (strncmp(priv->cmd_str, "BS", 2) == 0) @@ -9652,7 +9671,7 @@ int newcat_set_cmd(RIG *rig) if (RIG_OK != (rc = write_block(&state->rigport, verify_cmd, strlen(verify_cmd)))) { - return rc; + RETURNFUNC(rc); } /* read the reply */ @@ -9679,7 +9698,7 @@ int newcat_set_cmd(RIG *rig) case 'N': /* Command recognized by rig but invalid data entered. */ rig_debug(RIG_DEBUG_VERBOSE, "%s: NegAck for '%s'\n", __func__, priv->cmd_str); - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); case 'O': /* Too many characters sent without a carriage return */ @@ -9718,7 +9737,7 @@ int newcat_set_cmd(RIG *rig) rig_debug(RIG_DEBUG_ERR, "%s: Command rejected by the rig (set): '%s'\n", __func__, priv->cmd_str); - return -RIG_ERJCTED; + RETURNFUNC(-RIG_ERJCTED); } /* Rig busy wait please */ @@ -9754,7 +9773,7 @@ int newcat_set_cmd(RIG *rig) } } - return rc; + RETURNFUNC(rc); } struct @@ -9785,7 +9804,7 @@ rmode_t newcat_rmode(char mode) { int i; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; for (i = 0; i < sizeof(newcat_mode_conv) / sizeof(newcat_mode_conv[0]); i++) { @@ -9793,18 +9812,18 @@ rmode_t newcat_rmode(char mode) { rig_debug(RIG_DEBUG_TRACE, "%s: %s for %c\n", __func__, rig_strrmode(newcat_mode_conv[i].mode), mode); - return (newcat_mode_conv[i].mode); + RETURNFUNC (newcat_mode_conv[i].mode); } } - return (RIG_MODE_NONE); + RETURNFUNC (RIG_MODE_NONE); } char newcat_modechar(rmode_t rmode) { int i; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; for (i = 0; i < sizeof(newcat_mode_conv) / sizeof(newcat_mode_conv[0]); i++) { @@ -9812,18 +9831,19 @@ char newcat_modechar(rmode_t rmode) { rig_debug(RIG_DEBUG_TRACE, "%s: return %c for %s\n", __func__, newcat_mode_conv[i].modechar, rig_strrmode(rmode)); - return (newcat_mode_conv[i].modechar); + RETURNFUNC (newcat_mode_conv[i].modechar); } } - return ('0'); + RETURNFUNC ('0'); } rmode_t newcat_rmode_width(RIG *rig, vfo_t vfo, char mode, pbwidth_t *width) { ncboolean narrow; int i; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + + ENTERFUNC; if (width != NULL) { @@ -9846,7 +9866,7 @@ rmode_t newcat_rmode_width(RIG *rig, vfo_t vfo, char mode, pbwidth_t *width) { if (newcat_get_narrow(rig, vfo, &narrow) != RIG_OK) { - return (newcat_mode_conv[i].mode); + RETURNFUNC (newcat_mode_conv[i].mode); } if (narrow == TRUE) @@ -9860,12 +9880,12 @@ rmode_t newcat_rmode_width(RIG *rig, vfo_t vfo, char mode, pbwidth_t *width) } } - return (newcat_mode_conv[i].mode); + RETURNFUNC (newcat_mode_conv[i].mode); } } rig_debug(RIG_DEBUG_VERBOSE, "%s fell out the bottom %c %s\n", __func__, mode, rig_strrmode(mode)); - return ('0'); + RETURNFUNC ('0'); } diff --git a/src/misc.c b/src/misc.c index 41ac15025..caa02e98e 100644 --- a/src/misc.c +++ b/src/misc.c @@ -2132,6 +2132,13 @@ const char *rig_get_caps_cptr(rig_model_t rig_model, } } +void errmsg(int err, char *s, const char *func, const char *file, int line) +{ + rig_debug(RIG_DEBUG_ERR, "%s(%s:%d): %s: %s\b", __func__, file, line, s, + rigerror(err)); +} + + //! @endcond /** @} */ diff --git a/src/misc.h b/src/misc.h index de88ec683..e3b803c3e 100644 --- a/src/misc.h +++ b/src/misc.h @@ -138,7 +138,10 @@ extern HAMLIB_EXPORT(int) parse_hoststr(char *host, char hoststr[256], char port # endif #endif - +void errmsg(int err, char *s, const char *func, const char *file, int line); +#define ERRMSG(err, s) errmsg(err, s, __func__, __FILE__, __LINE__) +#define ENTERFUNC rig_debug(RIG_DEBUG_VERBOSE, "%s(%d):%s entered\n", __FILE__, __LINE__, __func__) +#define RETURNFUNC(rc) rig_debug(RIG_DEBUG_VERBOSE, "%s(%d):%s return\n", __FILE__, __LINE__, __func__);return rc __END_DECLS diff --git a/src/rig.c b/src/rig.c old mode 100644 new mode 100755 index edd87fd2f..38cf56673 --- a/src/rig.c +++ b/src/rig.c @@ -201,14 +201,14 @@ static int add_opened_rig(RIG *rig) if (!p) { - return -RIG_ENOMEM; + RETURNFUNC(-RIG_ENOMEM); } p->rig = rig; p->next = opened_rig_list; opened_rig_list = p; - return RIG_OK; + RETURNFUNC(RIG_OK); } @@ -231,13 +231,13 @@ static int remove_opened_rig(RIG *rig) } free(p); - return RIG_OK; + RETURNFUNC(RIG_OK); } q = p; } - return -RIG_EINVAL; /* Not found in list ! */ + RETURNFUNC(-RIG_EINVAL); /* Not found in list ! */ } @@ -267,11 +267,11 @@ int foreach_opened_rig(int (*cfunc)(RIG *, rig_ptr_t), rig_ptr_t data) { if ((*cfunc)(p->rig, data) == 0) { - return RIG_OK; + RETURNFUNC(RIG_OK); } } - return RIG_OK; + RETURNFUNC(RIG_OK); } #endif /* !DOC_HIDDEN */ @@ -321,7 +321,7 @@ RIG *HAMLIB_API rig_init(rig_model_t rig_model) struct rig_state *rs; int i; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; rig_check_backend(rig_model); @@ -329,7 +329,7 @@ RIG *HAMLIB_API rig_init(rig_model_t rig_model) if (!caps) { - return NULL; + RETURNFUNC(NULL); } /* @@ -344,7 +344,7 @@ RIG *HAMLIB_API rig_init(rig_model_t rig_model) * FIXME: how can the caller know it's a memory shortage, * and not "rig not found" ? */ - return NULL; + RETURNFUNC(NULL); } /* caps is const, so we need to tell compiler @@ -439,7 +439,7 @@ RIG *HAMLIB_API rig_init(rig_model_t rig_model) if (rs->tx_range_list == NULL) { rig_debug(RIG_DEBUG_ERR, "%s: rig does not have rx_range!!\n", __func__); - return NULL; + RETURNFUNC(NULL); } #if 0 // this is no longer applicable -- replace it with something? @@ -567,11 +567,11 @@ RIG *HAMLIB_API rig_init(rig_model_t rig_model) __func__); /* cleanup and exit */ free(rig); - return NULL; + RETURNFUNC(NULL); } } - return rig; + RETURNFUNC(rig); } @@ -582,7 +582,7 @@ RIG *HAMLIB_API rig_init(rig_model_t rig_model) * Opens communication to a radio which \a RIG handle has been passed * by argument. * - * \return RIG_OK if the operation has been successful, otherwise + * \RETURNFUNC(RIG_OK) if the operation has been successful, otherwise * a negative value if an error occurred (in which case, cause is * set appropriately). * @@ -600,11 +600,11 @@ int HAMLIB_API rig_open(RIG *rig) //unsigned int net1, net2, net3, net4, net5, net6, net7, net8, port; int is_network = 0; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; if (!rig || !rig->caps) { - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } caps = rig->caps; @@ -656,7 +656,7 @@ int HAMLIB_API rig_open(RIG *rig) { port_close(&rs->rigport, rs->rigport.type.rig); rs->comm_state = 0; - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } rs->rigport.fd = -1; @@ -670,7 +670,7 @@ int HAMLIB_API rig_open(RIG *rig) "%s: cannot set RTS with hardware handshake \"%s\"\n", __func__, rs->rigport.pathname); - return -RIG_ECONF; + RETURNFUNC(-RIG_ECONF); } if ('\0' == rs->pttport.pathname[0] @@ -684,7 +684,7 @@ int HAMLIB_API rig_open(RIG *rig) "%s: cannot set RTS with PTT by RTS \"%s\"\n", __func__, rs->rigport.pathname); - return -RIG_ECONF; + RETURNFUNC(-RIG_ECONF); } if (rs->rigport.parm.serial.dtr_state != RIG_SIGNAL_UNSET @@ -694,7 +694,7 @@ int HAMLIB_API rig_open(RIG *rig) "%s: cannot set DTR with PTT by DTR \"%s\"\n", __func__, rs->rigport.pathname); - return -RIG_ECONF; + RETURNFUNC(-RIG_ECONF); } } } @@ -703,7 +703,7 @@ int HAMLIB_API rig_open(RIG *rig) if (status < 0) { - return status; + RETURNFUNC(status); } switch (rs->pttport.type.ptt) @@ -913,7 +913,7 @@ int HAMLIB_API rig_open(RIG *rig) if (status < 0) { port_close(&rs->rigport, rs->rigport.type.rig); - return status; + RETURNFUNC(status); } add_opened_rig(rig); @@ -930,7 +930,7 @@ int HAMLIB_API rig_open(RIG *rig) if (status != RIG_OK) { - return status; + RETURNFUNC(status); } } @@ -991,7 +991,7 @@ int HAMLIB_API rig_open(RIG *rig) } #endif - return RIG_OK; + RETURNFUNC(RIG_OK); } @@ -1002,7 +1002,7 @@ int HAMLIB_API rig_open(RIG *rig) * Closes communication to a radio which \a RIG handle has been passed * by argument that was previously open with rig_open(). * - * \return RIG_OK if the operation has been successful, otherwise + * \RETURNFUNC(RIG_OK) if the operation has been successful, otherwise * a negative value if an error occurred (in which case, cause is * set appropriately). * @@ -1013,11 +1013,11 @@ int HAMLIB_API rig_close(RIG *rig) const struct rig_caps *caps; struct rig_state *rs; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; if (!rig || !rig->caps) { - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } caps = rig->caps; @@ -1025,7 +1025,7 @@ int HAMLIB_API rig_close(RIG *rig) if (!rs->comm_state) { - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } if (rs->transceive != RIG_TRN_OFF) @@ -1146,7 +1146,7 @@ int HAMLIB_API rig_close(RIG *rig) rs->comm_state = 0; - return RIG_OK; + RETURNFUNC(RIG_OK); } @@ -1157,7 +1157,7 @@ int HAMLIB_API rig_close(RIG *rig) * Releases a rig struct which port has eventually been closed already * with rig_close(). * - * \return RIG_OK if the operation has been successful, otherwise + * \RETURNFUNC(RIG_OK) if the operation has been successful, otherwise * a negative value if an error occurred (in which case, cause is * set appropriately). * @@ -1165,11 +1165,11 @@ int HAMLIB_API rig_close(RIG *rig) */ int HAMLIB_API rig_cleanup(RIG *rig) { - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; if (!rig || !rig->caps) { - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } /* @@ -1190,7 +1190,7 @@ int HAMLIB_API rig_cleanup(RIG *rig) free(rig); - return RIG_OK; + RETURNFUNC(RIG_OK); } /** @@ -1201,7 +1201,7 @@ int HAMLIB_API rig_cleanup(RIG *rig) * timeout seconds to stop rigctld when VFO is manually changed * turns on/off the radio. * - * \return RIG_OK if the operation has been successful, otherwise + * \RETURNFUNC(RIG_OK) if the operation has been successful, otherwise * a negative value if an error occurred (in which case, cause is * set appropriately). * @@ -1209,16 +1209,16 @@ int HAMLIB_API rig_cleanup(RIG *rig) */ int HAMLIB_API rig_set_twiddle(RIG *rig, int seconds) { - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; if (CHECK_RIG_ARG(rig)) { - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } rig->state.twiddle_timeout = seconds; - return RIG_OK; + RETURNFUNC(RIG_OK); } /** @@ -1226,7 +1226,7 @@ int HAMLIB_API rig_set_twiddle(RIG *rig, int seconds) * \param rig The rig handle * \param seconds 1=Ignore Sub, 2=Ignore Main * - * \return RIG_OK if the operation has been successful, otherwise + * \RETURNFUNC(RIG_OK) if the operation has been successful, otherwise * a negative value if an error occurred (in which case, cause is * set appropriately). * @@ -1234,16 +1234,16 @@ int HAMLIB_API rig_set_twiddle(RIG *rig, int seconds) */ int HAMLIB_API rig_set_uplink(RIG *rig, int val) { - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; if (CHECK_RIG_ARG(rig)) { - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } rig->state.uplink = val; - return RIG_OK; + RETURNFUNC(RIG_OK); } @@ -1252,7 +1252,7 @@ int HAMLIB_API rig_set_uplink(RIG *rig, int val) * \param rig The rig handle * \param seconds The timeout value * - * \return RIG_OK if the operation has been successful, otherwise + * \RETURNFUNC(RIG_OK) if the operation has been successful, otherwise * a negative value if an error occurred (in which case, cause is * set appropriately). * @@ -1260,15 +1260,15 @@ int HAMLIB_API rig_set_uplink(RIG *rig, int val) */ int HAMLIB_API rig_get_twiddle(RIG *rig, int *seconds) { - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; if (CHECK_RIG_ARG(rig) || !seconds) { - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } *seconds = rig->state.twiddle_timeout; - return RIG_OK; + RETURNFUNC(RIG_OK); } // detect if somebody is twiddling the VFO @@ -1299,7 +1299,7 @@ int twiddling(RIG *rig) if (rig->state.current_freq == 0) { rig->state.current_freq = curr_freq; - return 0; // not twiddling as first time freq is being set + RETURNFUNC(0); // not twiddling as first time freq is being set } rig->state.twiddle_time = time(NULL); // update last twiddle time @@ -1312,11 +1312,11 @@ int twiddling(RIG *rig) { rig_debug(RIG_DEBUG_TRACE, "%s: Twiddle elapsed < 3, elapsed=%d\n", __func__, elapsed); - return 1; // would be better as error but other software won't handle it + RETURNFUNC(1); // would be better as error but other software won't handle it } } - return 0; // + RETURNFUNC(0); } /* caching prototype to be fully implemented in 4.1 */ @@ -1361,10 +1361,10 @@ static int set_cache_freq(RIG *rig, vfo_t vfo, freq_t freq) default: rig_debug(RIG_DEBUG_ERR, "%s: unknown vfo?, vfo=%s\n", __func__, rig_strvfo(vfo)); - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } - return RIG_OK; + RETURNFUNC(RIG_OK); } /* caching prototype to be fully implemented in 4.1 */ @@ -1399,12 +1399,12 @@ static int get_cache_freq(RIG *rig, vfo_t vfo, freq_t *freq, int *cache_ms) default: rig_debug(RIG_DEBUG_ERR, "%s: unknown vfo?, vfo=%s\n", __func__, rig_strvfo(vfo)); - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } rig_debug(RIG_DEBUG_TRACE, "%s: vfo=%s, freq=%g\n", __func__, rig_strvfo(vfo), (double)*freq); - return RIG_OK; + RETURNFUNC(RIG_OK); } /** @@ -1415,7 +1415,7 @@ static int get_cache_freq(RIG *rig, vfo_t vfo, freq_t *freq, int *cache_ms) * * Sets the frequency of the target VFO. * - * \return RIG_OK if the operation has been successful, otherwise + * \RETURNFUNC(RIG_OK) if the operation has been successful, otherwise * a negative value if an error occurred (in which case, cause is * set appropriately). * @@ -1432,7 +1432,7 @@ int HAMLIB_API rig_set_freq(RIG *rig, vfo_t vfo, freq_t freq) if (CHECK_RIG_ARG(rig)) { - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } caps = rig->caps; @@ -1452,7 +1452,7 @@ int HAMLIB_API rig_set_freq(RIG *rig, vfo_t vfo, freq_t freq) if (caps->set_freq == NULL) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } if ((caps->targetable_vfo & RIG_TARGETABLE_FREQ) @@ -1462,7 +1462,7 @@ int HAMLIB_API rig_set_freq(RIG *rig, vfo_t vfo, freq_t freq) { rig_debug(RIG_DEBUG_TRACE, "%s: Ignoring set_freq due to VFO twiddling\n", __func__); - return RIG_OK; // would be better as error but other software won't handle errors + RETURNFUNC(RIG_OK); // would be better as error but other software won't handle errors } rig_debug(RIG_DEBUG_TRACE, "%s: TARGETABLE_FREQ vfo=%s\n", __func__, @@ -1478,14 +1478,14 @@ int HAMLIB_API rig_set_freq(RIG *rig, vfo_t vfo, freq_t freq) if (!caps->set_vfo) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } if (twiddling(rig)) { rig_debug(RIG_DEBUG_TRACE, "%s: Ignoring set_freq due to VFO twiddling\n", __func__); - return RIG_OK; // would be better as error but other software won't handle errors + RETURNFUNC(RIG_OK); // would be better as error but other software won't handle errors } curr_vfo = rig->state.current_vfo; @@ -1497,7 +1497,7 @@ int HAMLIB_API rig_set_freq(RIG *rig, vfo_t vfo, freq_t freq) if (retcode != RIG_OK) { rig_debug(RIG_DEBUG_ERR, "%s: set_vfo err %s\n", __func__, rigerror(retcode)); - return retcode; + RETURNFUNC(retcode); } @@ -1530,7 +1530,7 @@ int HAMLIB_API rig_set_freq(RIG *rig, vfo_t vfo, freq_t freq) elapsed_ms(&rig->state.cache.time_freq, HAMLIB_ELAPSED_INVALIDATE); retcode = rig_get_freq(rig, vfo, &freq_new); - if (retcode != RIG_OK) { return retcode; } + if (retcode != RIG_OK) { RETURNFUNC(retcode); } } if (freq_new != freq) @@ -1551,7 +1551,7 @@ int HAMLIB_API rig_set_freq(RIG *rig, vfo_t vfo, freq_t freq) set_cache_freq(rig, vfo, freq_new); rig->state.cache.vfo_freq = vfo; - return retcode; + RETURNFUNC(retcode); } @@ -1565,7 +1565,7 @@ int HAMLIB_API rig_set_freq(RIG *rig, vfo_t vfo, freq_t freq) * The value stored at \a freq location equals RIG_FREQ_NONE when the current * frequency of the VFO is not defined (e.g. blank memory). * - * \return RIG_OK if the operation has been successful, otherwise + * \RETURNFUNC(RIG_OK) if the operation has been successful, otherwise * a negative value if an error occurred (in which case, cause is * set appropriately). * @@ -1583,7 +1583,7 @@ int HAMLIB_API rig_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) if (CHECK_RIG_ARG(rig) || !freq) { rig_debug(RIG_DEBUG_TRACE, "%s: rig or freq ptr invalid\n", __func__); - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } curr_vfo = rig->state.current_vfo; // save vfo for restore later @@ -1601,7 +1601,7 @@ int HAMLIB_API rig_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) rig_strvfo(rig->state.tx_vfo)); // always return the cached freq for this clause get_cache_freq(rig, vfo, freq, &cache_ms); - return RIG_OK; + RETURNFUNC(RIG_OK); } // there are some rigs that can't get VFOA freq while VFOB is transmitting @@ -1617,7 +1617,7 @@ int HAMLIB_API rig_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) if (retcode != RIG_OK) { - return retcode; + RETURNFUNC(retcode); } if (ptt) @@ -1626,7 +1626,7 @@ int HAMLIB_API rig_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) "%s: split is on so returning VFOA last known freq\n", __func__); *freq = rig->state.cache.freqMainA; - return RIG_OK; + RETURNFUNC(RIG_OK); } } @@ -1642,7 +1642,7 @@ int HAMLIB_API rig_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) *freq = rig->state.cache.freq; rig_debug(RIG_DEBUG_TRACE, "%s: %s cache hit age=%dms, freq=%.0f\n", __func__, rig_strvfo(vfo), cache_ms, *freq); - return RIG_OK; + RETURNFUNC(RIG_OK); } else { @@ -1655,7 +1655,7 @@ int HAMLIB_API rig_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) if (caps->get_freq == NULL) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } // If we're in vfo_mode then rigctld will do any VFO swapping we need @@ -1687,14 +1687,14 @@ int HAMLIB_API rig_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) if (!caps->set_vfo) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } retcode = caps->set_vfo(rig, vfo); if (retcode != RIG_OK) { - return retcode; + RETURNFUNC(retcode); } retcode = caps->get_freq(rig, vfo, freq); @@ -1741,7 +1741,7 @@ int HAMLIB_API rig_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) set_cache_freq(rig, vfo, *freq); rig->state.cache.vfo_freq = vfo; - return retcode; + RETURNFUNC(retcode); } @@ -1758,7 +1758,7 @@ int HAMLIB_API rig_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) * unchanged from the current value or default for the mode determined * by the rig. * - * \return RIG_OK if the operation has been successful, otherwise + * \RETURNFUNC(RIG_OK) if the operation has been successful, otherwise * a negative value if an error occurred (in which case, cause is * set appropriately). * @@ -1774,14 +1774,14 @@ int HAMLIB_API rig_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) if (CHECK_RIG_ARG(rig)) { - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } caps = rig->caps; if (caps->set_mode == NULL) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } if ((caps->targetable_vfo & RIG_TARGETABLE_MODE) @@ -1799,7 +1799,7 @@ int HAMLIB_API rig_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) if (!caps->set_vfo) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } curr_vfo = rig->state.current_vfo; @@ -1807,7 +1807,7 @@ int HAMLIB_API rig_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) if (retcode != RIG_OK) { - return retcode; + RETURNFUNC(retcode); } retcode = caps->set_mode(rig, vfo, mode, width); @@ -1832,7 +1832,7 @@ int HAMLIB_API rig_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) rig->state.cache.vfo_mode = vfo; elapsed_ms(&rig->state.cache.time_mode, HAMLIB_ELAPSED_SET); - return retcode; + RETURNFUNC(retcode); } @@ -1849,7 +1849,7 @@ int HAMLIB_API rig_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) * The value stored at \a mode location equals RIG_MODE_NONE when the current * mode of the VFO is not defined (e.g. blank memory). * - * \return RIG_OK if the operation has been successful, otherwise + * \RETURNFUNC(RIG_OK) if the operation has been successful, otherwise * a negative value if an error occurred (in which case, cause is * set appropriately). * @@ -1864,18 +1864,18 @@ int HAMLIB_API rig_get_mode(RIG *rig, int retcode; int cache_ms; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; if (CHECK_RIG_ARG(rig) || !mode || !width) { - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } caps = rig->caps; if (caps->get_mode == NULL) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } cache_ms = elapsed_ms(&rig->state.cache.time_mode, HAMLIB_ELAPSED_GET); @@ -1886,7 +1886,7 @@ int HAMLIB_API rig_get_mode(RIG *rig, rig_debug(RIG_DEBUG_TRACE, "%s: cache hit age=%dms\n", __func__, cache_ms); *mode = rig->state.cache.mode; *width = rig->state.cache.width; - return RIG_OK; + RETURNFUNC(RIG_OK); } else { @@ -1909,7 +1909,7 @@ int HAMLIB_API rig_get_mode(RIG *rig, if (!caps->set_vfo) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } curr_vfo = rig->state.current_vfo; @@ -1917,7 +1917,7 @@ int HAMLIB_API rig_get_mode(RIG *rig, if (retcode != RIG_OK) { - return retcode; + RETURNFUNC(retcode); } retcode = caps->get_mode(rig, vfo, mode, width); @@ -1950,7 +1950,7 @@ int HAMLIB_API rig_get_mode(RIG *rig, rig->state.cache.vfo_mode = vfo; cache_ms = elapsed_ms(&rig->state.cache.time_mode, HAMLIB_ELAPSED_SET); - return retcode; + RETURNFUNC(retcode); } @@ -1971,11 +1971,11 @@ pbwidth_t HAMLIB_API rig_passband_normal(RIG *rig, rmode_t mode) const struct rig_state *rs; int i; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; if (!rig) { - return RIG_PASSBAND_NORMAL; /* huhu! */ + RETURNFUNC(RIG_PASSBAND_NORMAL); /* huhu! */ } rs = &rig->state; @@ -1986,14 +1986,14 @@ pbwidth_t HAMLIB_API rig_passband_normal(RIG *rig, rmode_t mode) { rig_debug(RIG_DEBUG_VERBOSE, "%s: return filter#%d, width=%d\n", __func__, i, (int)rs->filters[i].width); - return rs->filters[i].width; + RETURNFUNC(rs->filters[i].width); } } rig_debug(RIG_DEBUG_VERBOSE, "%s: filter not found...return RIG_PASSBAND_NORMAL=%d\n", __func__, (int)RIG_PASSBAND_NORMAL); - return RIG_PASSBAND_NORMAL; + RETURNFUNC(RIG_PASSBAND_NORMAL); } @@ -2017,11 +2017,11 @@ pbwidth_t HAMLIB_API rig_passband_narrow(RIG *rig, rmode_t mode) pbwidth_t normal; int i; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; if (!rig) { - return 0; /* huhu! */ + RETURNFUNC(0); /* huhu! */ } rs = &rig->state; @@ -2037,15 +2037,15 @@ pbwidth_t HAMLIB_API rig_passband_narrow(RIG *rig, rmode_t mode) if ((rs->filters[i].modes & mode) && (rs->filters[i].width < normal)) { - return rs->filters[i].width; + RETURNFUNC(rs->filters[i].width); } } - return 0; + RETURNFUNC(0); } } - return 0; + RETURNFUNC(0); } @@ -2069,11 +2069,11 @@ pbwidth_t HAMLIB_API rig_passband_wide(RIG *rig, rmode_t mode) pbwidth_t normal; int i; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; if (!rig) { - return 0; /* huhu! */ + RETURNFUNC(0); /* huhu! */ } rs = &rig->state; @@ -2089,15 +2089,15 @@ pbwidth_t HAMLIB_API rig_passband_wide(RIG *rig, rmode_t mode) if ((rs->filters[i].modes & mode) && (rs->filters[i].width > normal)) { - return rs->filters[i].width; + RETURNFUNC(rs->filters[i].width); } } - return 0; + RETURNFUNC(0); } } - return 0; + RETURNFUNC(0); } @@ -2110,7 +2110,7 @@ pbwidth_t HAMLIB_API rig_passband_wide(RIG *rig, rmode_t mode) * for VFOA, VFOB, VFOC respectively or RIG_VFO_MEM for Memory mode. * Supported VFOs depends on rig capabilities. * - * \return RIG_OK if the operation has been successful, otherwise + * \RETURNFUNC(RIG_OK) if the operation has been successful, otherwise * a negative value if an error occurred (in which case, cause is * set appropriately). * @@ -2122,28 +2122,29 @@ int HAMLIB_API rig_set_vfo(RIG *rig, vfo_t vfo) int retcode; freq_t curr_freq; + ENTER; rig_debug(RIG_DEBUG_VERBOSE, "%s called vfo=%s\n", __func__, rig_strvfo(vfo)); if (CHECK_RIG_ARG(rig)) { - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } - if (vfo == RIG_VFO_CURR) { return RIG_OK; } + if (vfo == RIG_VFO_CURR) { RETURNFUNC(RIG_OK); } // make sure we are asking for a VFO that the rig actually has if ((vfo == RIG_VFO_A || vfo == RIG_VFO_B) && !VFO_HAS_A_B) { rig_debug(RIG_DEBUG_ERR, "%s: rig does not have %s\n", __func__, rig_strvfo(vfo)); - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } if ((vfo == RIG_VFO_MAIN || vfo == RIG_VFO_SUB) && !VFO_HAS_MAIN_SUB) { rig_debug(RIG_DEBUG_ERR, "%s: rig does not have %s\n", __func__, rig_strvfo(vfo)); - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } vfo = vfo_fixup(rig, vfo); @@ -2152,14 +2153,14 @@ int HAMLIB_API rig_set_vfo(RIG *rig, vfo_t vfo) if (caps->set_vfo == NULL) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } if (twiddling(rig)) { rig_debug(RIG_DEBUG_TRACE, "%s: Ignoring set_vfo due to VFO twiddling\n", __func__); - return RIG_OK; // would be better as error but other software won't handle errors + RETURNFUNC(RIG_OK); // would be better as error but other software won't handle errors } retcode = caps->set_vfo(rig, vfo); @@ -2196,7 +2197,7 @@ int HAMLIB_API rig_set_vfo(RIG *rig, vfo_t vfo) rig_debug(RIG_DEBUG_TRACE, "%s: return %d, vfo=%s\n", __func__, retcode, rig_strvfo(vfo)); - return retcode; + RETURNFUNC(retcode); } @@ -2209,7 +2210,7 @@ int HAMLIB_API rig_set_vfo(RIG *rig, vfo_t vfo) * for VFOA, VFOB, VFOC respectively or RIG_VFO_MEM for Memory mode. * Supported VFOs depends on rig capabilities. * - * \return RIG_OK if the operation has been successful, otherwise + * \RETURNFUNC(RIG_OK) if the operation has been successful, otherwise * a negative value if an error occurred (in which case, cause is * set appropriately). * @@ -2221,13 +2222,13 @@ int HAMLIB_API rig_get_vfo(RIG *rig, vfo_t *vfo) int retcode; int cache_ms; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; if (CHECK_RIG_ARG(rig) || !vfo) { rig_debug(RIG_DEBUG_ERR, "%s: no rig and/or vfo? rig=%p, vfo=%p\n", __func__, rig, vfo); - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } caps = rig->caps; @@ -2235,7 +2236,7 @@ int HAMLIB_API rig_get_vfo(RIG *rig, vfo_t *vfo) if (caps->get_vfo == NULL) { rig_debug(RIG_DEBUG_ERR, "%s: no get_vfo\n", __func__); - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } cache_ms = elapsed_ms(&rig->state.cache.time_vfo, HAMLIB_ELAPSED_GET); @@ -2245,7 +2246,7 @@ int HAMLIB_API rig_get_vfo(RIG *rig, vfo_t *vfo) { rig_debug(RIG_DEBUG_TRACE, "%s: cache hit age=%dms\n", __func__, cache_ms); *vfo = rig->state.cache.vfo; - return RIG_OK; + RETURNFUNC(RIG_OK); } else { @@ -2271,7 +2272,7 @@ int HAMLIB_API rig_get_vfo(RIG *rig, vfo_t *vfo) rigerror(retcode)); } - return retcode; + RETURNFUNC(retcode); } @@ -2283,7 +2284,7 @@ int HAMLIB_API rig_get_vfo(RIG *rig, vfo_t *vfo) * * Sets "Push-To-Talk" on/off. * - * \return RIG_OK if the operation has been successful, otherwise + * \RETURNFUNC(RIG_OK) if the operation has been successful, otherwise * a negative value if an error occurred (in which case, cause is * set appropriately). * @@ -2295,11 +2296,11 @@ int HAMLIB_API rig_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) struct rig_state *rs = &rig->state; int retcode = RIG_OK; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; if (CHECK_RIG_ARG(rig)) { - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } caps = rig->caps; @@ -2316,7 +2317,7 @@ int HAMLIB_API rig_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) case RIG_PTT_RIG_MICDATA: if (caps->set_ptt == NULL) { - return -RIG_ENIMPL; + RETURNFUNC(-RIG_ENIMPL); } if ((caps->targetable_vfo & RIG_TARGETABLE_PTT) @@ -2332,7 +2333,7 @@ int HAMLIB_API rig_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) if (!caps->set_vfo) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } curr_vfo = rig->state.current_vfo; @@ -2374,7 +2375,7 @@ int HAMLIB_API rig_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) "%s: cannot open PTT device \"%s\"\n", __func__, rs->pttport.pathname); - return -RIG_EIO; + RETURNFUNC(-RIG_EIO); } /* Needed on Linux because the serial port driver sets RTS/DTR @@ -2384,7 +2385,7 @@ int HAMLIB_API rig_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) if (RIG_OK != retcode) { - return retcode; + RETURNFUNC(retcode); } } @@ -2420,7 +2421,7 @@ int HAMLIB_API rig_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) "%s: cannot open PTT device \"%s\"\n", __func__, rs->pttport.pathname); - return -RIG_EIO; + RETURNFUNC(-RIG_EIO); } /* Needed on Linux because the serial port driver sets RTS/DTR @@ -2431,7 +2432,7 @@ int HAMLIB_API rig_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) if (RIG_OK != retcode) { rig_debug(RIG_DEBUG_ERR, "%s: ser_set_dtr retcode=%d\n", __func__, retcode); - return retcode; + RETURNFUNC(retcode); } } @@ -2461,7 +2462,7 @@ int HAMLIB_API rig_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) break; default: - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } if (RIG_OK == retcode) @@ -2474,7 +2475,7 @@ int HAMLIB_API rig_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) if (retcode != RIG_OK) { rig_debug(RIG_DEBUG_ERR, "%s: return code=%d\n", __func__, retcode); } - return retcode; + RETURNFUNC(retcode); } @@ -2486,7 +2487,7 @@ int HAMLIB_API rig_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) * * Retrieves the status of PTT (are we on the air?). * - * \return RIG_OK if the operation has been successful, otherwise + * \RETURNFUNC(RIG_OK) if the operation has been successful, otherwise * a negative value if an error occurred (in which case, cause is * set appropriately). * @@ -2501,11 +2502,11 @@ int HAMLIB_API rig_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt) vfo_t curr_vfo; int cache_ms; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; if (CHECK_RIG_ARG(rig) || !ptt) { - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } cache_ms = elapsed_ms(&rig->state.cache.time_ptt, HAMLIB_ELAPSED_GET); @@ -2515,7 +2516,7 @@ int HAMLIB_API rig_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt) { rig_debug(RIG_DEBUG_TRACE, "%s: cache hit age=%dms\n", __func__, cache_ms); *ptt = rig->state.cache.ptt; - return RIG_OK; + RETURNFUNC(RIG_OK); } else { @@ -2531,7 +2532,7 @@ int HAMLIB_API rig_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt) if (!caps->get_ptt) { *ptt = rs->transmit ? RIG_PTT_ON : RIG_PTT_OFF; - return RIG_OK; + RETURNFUNC(RIG_OK); } if ((caps->targetable_vfo & RIG_TARGETABLE_PTT) @@ -2546,12 +2547,12 @@ int HAMLIB_API rig_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt) elapsed_ms(&rig->state.cache.time_ptt, HAMLIB_ELAPSED_SET); } - return retcode; + RETURNFUNC(retcode); } if (!caps->set_vfo) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } curr_vfo = rig->state.current_vfo; @@ -2559,7 +2560,7 @@ int HAMLIB_API rig_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt) if (retcode != RIG_OK) { - return retcode; + RETURNFUNC(retcode); } retcode = caps->get_ptt(rig, vfo, ptt); @@ -2574,7 +2575,7 @@ int HAMLIB_API rig_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt) elapsed_ms(&rig->state.cache.time_ptt, HAMLIB_ELAPSED_SET); } - return retcode; + RETURNFUNC(retcode); case RIG_PTT_SERIAL_RTS: if (caps->get_ptt) @@ -2587,7 +2588,7 @@ int HAMLIB_API rig_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt) rig->state.cache.ptt = *ptt; } - return retcode; + RETURNFUNC(retcode); } if (strcmp(rs->pttport.pathname, rs->rigport.pathname) @@ -2605,7 +2606,7 @@ int HAMLIB_API rig_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt) rig->state.cache.ptt = *ptt; elapsed_ms(&rig->state.cache.time_ptt, HAMLIB_ELAPSED_SET); - return retcode; + RETURNFUNC(retcode); case RIG_PTT_SERIAL_DTR: if (caps->get_ptt) @@ -2618,7 +2619,7 @@ int HAMLIB_API rig_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt) rig->state.cache.ptt = *ptt; } - return retcode; + RETURNFUNC(retcode); } if (strcmp(rs->pttport.pathname, rs->rigport.pathname) @@ -2636,7 +2637,7 @@ int HAMLIB_API rig_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt) rig->state.cache.ptt = *ptt; elapsed_ms(&rig->state.cache.time_ptt, HAMLIB_ELAPSED_SET); - return retcode; + RETURNFUNC(retcode); case RIG_PTT_PARALLEL: if (caps->get_ptt) @@ -2649,7 +2650,7 @@ int HAMLIB_API rig_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt) rig->state.cache.ptt = *ptt; } - return retcode; + RETURNFUNC(retcode); } retcode = par_ptt_get(&rig->state.pttport, ptt); @@ -2660,7 +2661,7 @@ int HAMLIB_API rig_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt) rig->state.cache.ptt = *ptt; } - return retcode; + RETURNFUNC(retcode); case RIG_PTT_CM108: if (caps->get_ptt) @@ -2673,7 +2674,7 @@ int HAMLIB_API rig_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt) rig->state.cache.ptt = *ptt; } - return retcode; + RETURNFUNC(retcode); } retcode = cm108_ptt_get(&rig->state.pttport, ptt); @@ -2684,7 +2685,7 @@ int HAMLIB_API rig_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt) rig->state.cache.ptt = *ptt; } - return retcode; + RETURNFUNC(retcode); case RIG_PTT_GPIO: case RIG_PTT_GPION: @@ -2698,21 +2699,21 @@ int HAMLIB_API rig_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt) rig->state.cache.ptt = *ptt; } - return retcode; + RETURNFUNC(retcode); } elapsed_ms(&rig->state.cache.time_ptt, HAMLIB_ELAPSED_SET); - return gpio_ptt_get(&rig->state.pttport, ptt); + RETURNFUNC(gpio_ptt_get(&rig->state.pttport, ptt)); case RIG_PTT_NONE: - return -RIG_ENAVAIL; /* not available */ + RETURNFUNC(-RIG_ENAVAIL); /* not available */ default: - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } elapsed_ms(&rig->state.cache.time_ptt, HAMLIB_ELAPSED_SET); - return RIG_OK; + RETURNFUNC(RIG_OK); } @@ -2724,7 +2725,7 @@ int HAMLIB_API rig_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt) * * Retrieves the status of DCD (is squelch open?). * - * \return RIG_OK if the operation has been successful, otherwise + * \RETURNFUNC(RIG_OK) if the operation has been successful, otherwise * a negative value if an error occurred (in which case, cause is * set appropriately). * @@ -2735,11 +2736,11 @@ int HAMLIB_API rig_get_dcd(RIG *rig, vfo_t vfo, dcd_t *dcd) int retcode, rc2, status; vfo_t curr_vfo; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; if (CHECK_RIG_ARG(rig) || !dcd) { - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } caps = rig->caps; @@ -2749,19 +2750,19 @@ int HAMLIB_API rig_get_dcd(RIG *rig, vfo_t vfo, dcd_t *dcd) case RIG_DCD_RIG: if (caps->get_dcd == NULL) { - return -RIG_ENIMPL; + RETURNFUNC(-RIG_ENIMPL); } if ((caps->targetable_vfo & RIG_TARGETABLE_PURE) || vfo == RIG_VFO_CURR || vfo == rig->state.current_vfo) { - return caps->get_dcd(rig, vfo, dcd); + RETURNFUNC(caps->get_dcd(rig, vfo, dcd)); } if (!caps->set_vfo) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } curr_vfo = rig->state.current_vfo; @@ -2769,7 +2770,7 @@ int HAMLIB_API rig_get_dcd(RIG *rig, vfo_t vfo, dcd_t *dcd) if (retcode != RIG_OK) { - return retcode; + RETURNFUNC(retcode); } retcode = caps->get_dcd(rig, vfo, dcd); @@ -2782,41 +2783,41 @@ int HAMLIB_API rig_get_dcd(RIG *rig, vfo_t vfo, dcd_t *dcd) retcode = rc2; } - return retcode; + RETURNFUNC(retcode); break; case RIG_DCD_SERIAL_CTS: retcode = ser_get_cts(&rig->state.dcdport, &status); *dcd = status ? RIG_DCD_ON : RIG_DCD_OFF; - return retcode; + RETURNFUNC(retcode); case RIG_DCD_SERIAL_DSR: retcode = ser_get_dsr(&rig->state.dcdport, &status); *dcd = status ? RIG_DCD_ON : RIG_DCD_OFF; - return retcode; + RETURNFUNC(retcode); case RIG_DCD_SERIAL_CAR: retcode = ser_get_car(&rig->state.dcdport, &status); *dcd = status ? RIG_DCD_ON : RIG_DCD_OFF; - return retcode; + RETURNFUNC(retcode); case RIG_DCD_PARALLEL: - return par_dcd_get(&rig->state.dcdport, dcd); + RETURNFUNC(par_dcd_get(&rig->state.dcdport, dcd)); case RIG_DCD_GPIO: case RIG_DCD_GPION: - return gpio_dcd_get(&rig->state.dcdport, dcd); + RETURNFUNC(gpio_dcd_get(&rig->state.dcdport, dcd)); case RIG_DCD_NONE: - return -RIG_ENAVAIL; /* not available */ + RETURNFUNC(-RIG_ENAVAIL); /* not available */ default: - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } - return RIG_OK; + RETURNFUNC(RIG_OK); } @@ -2828,7 +2829,7 @@ int HAMLIB_API rig_get_dcd(RIG *rig, vfo_t vfo, dcd_t *dcd) * * Sets the current repeater shift. * - * \return RIG_OK if the operation has been successful, otherwise + * \RETURNFUNC(RIG_OK) if the operation has been successful, otherwise * a negative value if an error occurred (in which case, cause is * set appropriately). * @@ -2840,30 +2841,30 @@ int HAMLIB_API rig_set_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t rptr_shift) int retcode, rc2; vfo_t curr_vfo; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; if (CHECK_RIG_ARG(rig)) { - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } caps = rig->caps; if (caps->set_rptr_shift == NULL) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } if ((caps->targetable_vfo & RIG_TARGETABLE_PURE) || vfo == RIG_VFO_CURR || vfo == rig->state.current_vfo) { - return caps->set_rptr_shift(rig, vfo, rptr_shift); + RETURNFUNC(caps->set_rptr_shift(rig, vfo, rptr_shift)); } if (!caps->set_vfo) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } curr_vfo = rig->state.current_vfo; @@ -2871,7 +2872,7 @@ int HAMLIB_API rig_set_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t rptr_shift) if (retcode != RIG_OK) { - return retcode; + RETURNFUNC(retcode); } retcode = caps->set_rptr_shift(rig, vfo, rptr_shift); @@ -2884,7 +2885,7 @@ int HAMLIB_API rig_set_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t rptr_shift) retcode = rc2; } - return retcode; + RETURNFUNC(retcode); } @@ -2896,7 +2897,7 @@ int HAMLIB_API rig_set_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t rptr_shift) * * Retrieves the current repeater shift. * - * \return RIG_OK if the operation has been successful, otherwise + * \RETURNFUNC(RIG_OK) if the operation has been successful, otherwise * a negative value if an error occurred (in which case, cause is * set appropriately). * @@ -2908,30 +2909,30 @@ int HAMLIB_API rig_get_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t *rptr_shift) int retcode, rc2; vfo_t curr_vfo; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; if (CHECK_RIG_ARG(rig) || !rptr_shift) { - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } caps = rig->caps; if (caps->get_rptr_shift == NULL) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } if ((caps->targetable_vfo & RIG_TARGETABLE_PURE) || vfo == RIG_VFO_CURR || vfo == rig->state.current_vfo) { - return caps->get_rptr_shift(rig, vfo, rptr_shift); + RETURNFUNC(caps->get_rptr_shift(rig, vfo, rptr_shift)); } if (!caps->set_vfo) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } curr_vfo = rig->state.current_vfo; @@ -2939,7 +2940,7 @@ int HAMLIB_API rig_get_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t *rptr_shift) if (retcode != RIG_OK) { - return retcode; + RETURNFUNC(retcode); } retcode = caps->get_rptr_shift(rig, vfo, rptr_shift); @@ -2952,7 +2953,7 @@ int HAMLIB_API rig_get_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t *rptr_shift) retcode = rc2; } - return retcode; + RETURNFUNC(retcode); } @@ -2964,7 +2965,7 @@ int HAMLIB_API rig_get_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t *rptr_shift) * * Sets the current repeater offset. * - * \return RIG_OK if the operation has been successful, otherwise + * \RETURNFUNC(RIG_OK) if the operation has been successful, otherwise * a negative value if an error occurred (in which case, cause is * set appropriately). * @@ -2976,30 +2977,30 @@ int HAMLIB_API rig_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t rptr_offs) int retcode, rc2; vfo_t curr_vfo; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; if (CHECK_RIG_ARG(rig)) { - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } caps = rig->caps; if (caps->set_rptr_offs == NULL) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } if ((caps->targetable_vfo & RIG_TARGETABLE_PURE) || vfo == RIG_VFO_CURR || vfo == rig->state.current_vfo) { - return caps->set_rptr_offs(rig, vfo, rptr_offs); + RETURNFUNC(caps->set_rptr_offs(rig, vfo, rptr_offs)); } if (!caps->set_vfo) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } curr_vfo = rig->state.current_vfo; @@ -3007,7 +3008,7 @@ int HAMLIB_API rig_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t rptr_offs) if (retcode != RIG_OK) { - return retcode; + RETURNFUNC(retcode); } retcode = caps->set_rptr_offs(rig, vfo, rptr_offs); @@ -3020,7 +3021,7 @@ int HAMLIB_API rig_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t rptr_offs) retcode = rc2; } - return retcode; + RETURNFUNC(retcode); } @@ -3032,7 +3033,7 @@ int HAMLIB_API rig_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t rptr_offs) * * Retrieves the current repeater offset. * - * \return RIG_OK if the operation has been successful, otherwise + * \RETURNFUNC(RIG_OK) if the operation has been successful, otherwise * a negative value if an error occurred (in which case, cause is * set appropriately). * @@ -3044,30 +3045,30 @@ int HAMLIB_API rig_get_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t *rptr_offs) int retcode, rc2; vfo_t curr_vfo; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; if (CHECK_RIG_ARG(rig) || !rptr_offs) { - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } caps = rig->caps; if (caps->get_rptr_offs == NULL) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } if ((caps->targetable_vfo & RIG_TARGETABLE_PURE) || vfo == RIG_VFO_CURR || vfo == rig->state.current_vfo) { - return caps->get_rptr_offs(rig, vfo, rptr_offs); + RETURNFUNC(caps->get_rptr_offs(rig, vfo, rptr_offs)); } if (!caps->set_vfo) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } curr_vfo = rig->state.current_vfo; @@ -3075,7 +3076,7 @@ int HAMLIB_API rig_get_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t *rptr_offs) if (retcode != RIG_OK) { - return retcode; + RETURNFUNC(retcode); } retcode = caps->get_rptr_offs(rig, vfo, rptr_offs); @@ -3088,7 +3089,7 @@ int HAMLIB_API rig_get_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t *rptr_offs) retcode = rc2; } - return retcode; + RETURNFUNC(retcode); } @@ -3100,7 +3101,7 @@ int HAMLIB_API rig_get_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t *rptr_offs) * * Sets the split(TX) frequency. * - * \return RIG_OK if the operation has been successful, otherwise + * \RETURNFUNC(RIG_OK) if the operation has been successful, otherwise * a negative value if an error occurred (in which case, cause is * set appropriately). * @@ -3114,7 +3115,7 @@ int HAMLIB_API rig_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq) if (CHECK_RIG_ARG(rig)) { - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } rig_debug(RIG_DEBUG_VERBOSE, "%s called vfo=%s, curr_vfo=%s\n", __func__, @@ -3128,7 +3129,7 @@ int HAMLIB_API rig_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq) || vfo == RIG_VFO_TX || vfo == rig->state.current_vfo)) { - return caps->set_split_freq(rig, vfo, tx_freq); + RETURNFUNC(caps->set_split_freq(rig, vfo, tx_freq)); } vfo = vfo_fixup(rig, vfo); @@ -3149,7 +3150,7 @@ int HAMLIB_API rig_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq) if (caps->set_freq && (caps->targetable_vfo & RIG_TARGETABLE_FREQ)) { - return caps->set_freq(rig, tx_vfo, tx_freq); + RETURNFUNC(caps->set_freq(rig, tx_vfo, tx_freq)); } @@ -3163,12 +3164,12 @@ int HAMLIB_API rig_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq) } else { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } if (retcode != RIG_OK) { - return retcode; + RETURNFUNC(retcode); } if (caps->set_split_freq) @@ -3196,7 +3197,7 @@ int HAMLIB_API rig_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq) retcode = rc2; } - return retcode; + RETURNFUNC(retcode); } @@ -3208,7 +3209,7 @@ int HAMLIB_API rig_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq) * * Retrieves the current split(TX) frequency. * - * \return RIG_OK if the operation has been successful, otherwise + * \RETURNFUNC(RIG_OK) if the operation has been successful, otherwise * a negative value if an error occurred (in which case, cause is * set appropriately). * @@ -3220,11 +3221,11 @@ int HAMLIB_API rig_get_split_freq(RIG *rig, vfo_t vfo, freq_t *tx_freq) int retcode = -RIG_EPROTO, rc2; vfo_t save_vfo, tx_vfo; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; if (CHECK_RIG_ARG(rig) || !tx_freq) { - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } vfo = vfo_fixup(rig, vfo); @@ -3237,7 +3238,7 @@ int HAMLIB_API rig_get_split_freq(RIG *rig, vfo_t vfo, freq_t *tx_freq) || vfo == RIG_VFO_TX || vfo == rig->state.current_vfo)) { - return caps->get_split_freq(rig, vfo, tx_freq); + RETURNFUNC(caps->get_split_freq(rig, vfo, tx_freq)); } /* Assisted mode */ @@ -3255,7 +3256,7 @@ int HAMLIB_API rig_get_split_freq(RIG *rig, vfo_t vfo, freq_t *tx_freq) if (caps->get_freq && (caps->targetable_vfo & RIG_TARGETABLE_FREQ)) { - return caps->get_freq(rig, tx_vfo, tx_freq); + RETURNFUNC(caps->get_freq(rig, tx_vfo, tx_freq)); } @@ -3266,7 +3267,7 @@ int HAMLIB_API rig_get_split_freq(RIG *rig, vfo_t vfo, freq_t *tx_freq) { retcode = caps->set_vfo(rig, tx_vfo); - if (retcode != RIG_OK) { return retcode; } + if (retcode != RIG_OK) { RETURNFUNC(retcode); } } retcode = RIG_OK; @@ -3277,12 +3278,12 @@ int HAMLIB_API rig_get_split_freq(RIG *rig, vfo_t vfo, freq_t *tx_freq) } else { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } if (retcode != RIG_OK) { - return retcode; + RETURNFUNC(retcode); } if (caps->get_split_freq) @@ -3320,7 +3321,7 @@ int HAMLIB_API rig_get_split_freq(RIG *rig, vfo_t vfo, freq_t *tx_freq) rig_debug(RIG_DEBUG_TRACE, "%s: tx_freq=%.0f\n", __func__, *tx_freq); - return retcode; + RETURNFUNC(retcode); } @@ -3336,7 +3337,7 @@ int HAMLIB_API rig_get_split_freq(RIG *rig, vfo_t vfo, freq_t *tx_freq) * * Sets the split(TX) mode. * - * \return RIG_OK if the operation has been successful, otherwise + * \RETURNFUNC(RIG_OK) if the operation has been successful, otherwise * a negative value if an error occurred (in which case, cause is * set appropriately). * @@ -3351,11 +3352,11 @@ int HAMLIB_API rig_set_split_mode(RIG *rig, int retcode, rc2; vfo_t curr_vfo, tx_vfo; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; if (CHECK_RIG_ARG(rig)) { - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } caps = rig->caps; @@ -3366,7 +3367,7 @@ int HAMLIB_API rig_set_split_mode(RIG *rig, || vfo == RIG_VFO_TX || vfo == rig->state.current_vfo)) { - return caps->set_split_mode(rig, vfo, tx_mode, tx_width); + RETURNFUNC(caps->set_split_mode(rig, vfo, tx_mode, tx_width)); } /* Assisted mode */ @@ -3384,7 +3385,7 @@ int HAMLIB_API rig_set_split_mode(RIG *rig, if (caps->set_mode && (caps->targetable_vfo & RIG_TARGETABLE_MODE)) { - return caps->set_mode(rig, tx_vfo, tx_mode, tx_width); + RETURNFUNC(caps->set_mode(rig, tx_vfo, tx_mode, tx_width)); } @@ -3398,12 +3399,12 @@ int HAMLIB_API rig_set_split_mode(RIG *rig, } else { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } if (retcode != RIG_OK) { - return retcode; + RETURNFUNC(retcode); } if (caps->set_split_mode) @@ -3431,7 +3432,7 @@ int HAMLIB_API rig_set_split_mode(RIG *rig, retcode = rc2; } - return retcode; + RETURNFUNC(retcode); } @@ -3448,7 +3449,7 @@ int HAMLIB_API rig_set_split_mode(RIG *rig, * The value stored at \a tx_mode location equals RIG_MODE_NONE * when the current mode of the VFO is not defined (e.g. blank memory). * - * \return RIG_OK if the operation has been successful, otherwise + * \RETURNFUNC(RIG_OK) if the operation has been successful, otherwise * a negative value if an error occurred (in which case, cause is * set appropriately). * @@ -3461,11 +3462,11 @@ int HAMLIB_API rig_get_split_mode(RIG *rig, vfo_t vfo, rmode_t *tx_mode, int retcode, rc2; vfo_t curr_vfo, tx_vfo; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; if (CHECK_RIG_ARG(rig) || !tx_mode || !tx_width) { - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } caps = rig->caps; @@ -3476,7 +3477,7 @@ int HAMLIB_API rig_get_split_mode(RIG *rig, vfo_t vfo, rmode_t *tx_mode, || vfo == RIG_VFO_TX || vfo == rig->state.current_vfo)) { - return caps->get_split_mode(rig, vfo, tx_mode, tx_width); + RETURNFUNC(caps->get_split_mode(rig, vfo, tx_mode, tx_width)); } /* Assisted mode */ @@ -3494,7 +3495,7 @@ int HAMLIB_API rig_get_split_mode(RIG *rig, vfo_t vfo, rmode_t *tx_mode, if (caps->get_mode && (caps->targetable_vfo & RIG_TARGETABLE_MODE)) { - return caps->get_mode(rig, tx_vfo, tx_mode, tx_width); + RETURNFUNC(caps->get_mode(rig, tx_vfo, tx_mode, tx_width)); } @@ -3508,12 +3509,12 @@ int HAMLIB_API rig_get_split_mode(RIG *rig, vfo_t vfo, rmode_t *tx_mode, } else { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } if (retcode != RIG_OK) { - return retcode; + RETURNFUNC(retcode); } if (caps->get_split_mode) @@ -3546,7 +3547,7 @@ int HAMLIB_API rig_get_split_mode(RIG *rig, vfo_t vfo, rmode_t *tx_mode, *tx_width = rig_passband_normal(rig, *tx_mode); } - return retcode; + RETURNFUNC(retcode); } @@ -3568,7 +3569,7 @@ int HAMLIB_API rig_get_split_mode(RIG *rig, vfo_t vfo, rmode_t *tx_mode, * the rig VFOs have to be exchanged or swapped to complete this * combined function. * - * \return RIG_OK if the operation has been successful, otherwise + * \RETURNFUNC(RIG_OK) if the operation has been successful, otherwise * a negative value if an error occurred (in which case, cause is * set appropriately). * @@ -3583,18 +3584,18 @@ int HAMLIB_API rig_set_split_freq_mode(RIG *rig, const struct rig_caps *caps; int retcode; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; if (CHECK_RIG_ARG(rig)) { - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } caps = rig->caps; if (caps->set_split_freq_mode) { - return caps->set_split_freq_mode(rig, vfo, tx_freq, tx_mode, tx_width); + RETURNFUNC(caps->set_split_freq_mode(rig, vfo, tx_freq, tx_mode, tx_width)); } retcode = rig_set_split_freq(rig, vfo, tx_freq); @@ -3604,7 +3605,7 @@ int HAMLIB_API rig_set_split_freq_mode(RIG *rig, retcode = rig_set_split_mode(rig, vfo, tx_mode, tx_width); } - return retcode; + RETURNFUNC(retcode); } @@ -3627,7 +3628,7 @@ int HAMLIB_API rig_set_split_freq_mode(RIG *rig, * the rig VFOs have to be exchanged or swapped to complete this * combined function. * - * \return RIG_OK if the operation has been successful, otherwise + * \RETURNFUNC(RIG_OK) if the operation has been successful, otherwise * a negative value if an error occurred (in which case, cause is * set appropriately). * @@ -3642,18 +3643,18 @@ int HAMLIB_API rig_get_split_freq_mode(RIG *rig, const struct rig_caps *caps; int retcode; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; if (CHECK_RIG_ARG(rig) || !tx_freq || !tx_mode || !tx_width) { - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } caps = rig->caps; if (caps->get_split_freq_mode) { - return caps->get_split_freq_mode(rig, vfo, tx_freq, tx_mode, tx_width); + RETURNFUNC(caps->get_split_freq_mode(rig, vfo, tx_freq, tx_mode, tx_width)); } retcode = rig_get_split_freq(rig, vfo, tx_freq); @@ -3663,7 +3664,7 @@ int HAMLIB_API rig_get_split_freq_mode(RIG *rig, retcode = rig_get_split_mode(rig, vfo, tx_mode, tx_width); } - return retcode; + RETURNFUNC(retcode); } @@ -3676,7 +3677,7 @@ int HAMLIB_API rig_get_split_freq_mode(RIG *rig, * * Sets the current split mode. * - * \return RIG_OK if the operation has been successful, otherwise + * \RETURNFUNC(RIG_OK) if the operation has been successful, otherwise * a negative value if an error occurred (in which case, cause is * set appropriately). * @@ -3691,18 +3692,18 @@ int HAMLIB_API rig_set_split_vfo(RIG *rig, int retcode, rc2; vfo_t curr_vfo; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; if (CHECK_RIG_ARG(rig)) { - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } caps = rig->caps; if (caps->set_split_vfo == NULL) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } vfo = vfo_fixup(rig, vfo); @@ -3721,12 +3722,12 @@ int HAMLIB_API rig_set_split_vfo(RIG *rig, rig->state.cache.split = split; rig->state.cache.split_vfo = tx_vfo; elapsed_ms(&rig->state.cache.time_split, HAMLIB_ELAPSED_SET); - return retcode; + RETURNFUNC(retcode); } if (!caps->set_vfo) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } curr_vfo = rig->state.current_vfo; @@ -3734,7 +3735,7 @@ int HAMLIB_API rig_set_split_vfo(RIG *rig, if (retcode != RIG_OK) { - return retcode; + RETURNFUNC(retcode); } retcode = caps->set_split_vfo(rig, vfo, split, tx_vfo); @@ -3756,7 +3757,7 @@ int HAMLIB_API rig_set_split_vfo(RIG *rig, rig->state.cache.split = split; rig->state.cache.split_vfo = tx_vfo; elapsed_ms(&rig->state.cache.time_split, HAMLIB_ELAPSED_SET); - return retcode; + RETURNFUNC(retcode); } @@ -3769,7 +3770,7 @@ int HAMLIB_API rig_set_split_vfo(RIG *rig, * * Retrieves the current split mode. * - * \return RIG_OK if the operation has been successful, otherwise + * \RETURNFUNC(RIG_OK) if the operation has been successful, otherwise * a negative value if an error occurred (in which case, cause is * set appropriately). * @@ -3791,18 +3792,18 @@ int HAMLIB_API rig_get_split_vfo(RIG *rig, #endif int cache_ms; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; if (CHECK_RIG_ARG(rig) || !split || !tx_vfo) { - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } caps = rig->caps; if (caps->get_split_vfo == NULL) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } cache_ms = elapsed_ms(&rig->state.cache.time_split, HAMLIB_ELAPSED_GET); @@ -3813,7 +3814,7 @@ int HAMLIB_API rig_get_split_vfo(RIG *rig, rig_debug(RIG_DEBUG_TRACE, "%s: cache hit age=%dms\n", __func__, cache_ms); *split = rig->state.cache.split; *tx_vfo = rig->state.cache.split_vfo; - return RIG_OK; + RETURNFUNC(RIG_OK); } else { @@ -3831,12 +3832,12 @@ int HAMLIB_API rig_get_split_vfo(RIG *rig, rig->state.cache.split = *split; rig->state.cache.split_vfo = *tx_vfo; elapsed_ms(&rig->state.cache.time_split, HAMLIB_ELAPSED_SET); - return retcode; + RETURNFUNC(retcode); } if (!caps->set_vfo) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } #if 0 // why were we doing this? Shouldn't need to set_vfo to figure out tx_vfo @@ -3845,7 +3846,7 @@ int HAMLIB_API rig_get_split_vfo(RIG *rig, if (retcode != RIG_OK) { - return retcode; + RETURNFUNC(retcode); } #endif @@ -3870,7 +3871,7 @@ int HAMLIB_API rig_get_split_vfo(RIG *rig, elapsed_ms(&rig->state.cache.time_split, HAMLIB_ELAPSED_SET); } - return retcode; + RETURNFUNC(retcode); } @@ -3882,7 +3883,7 @@ int HAMLIB_API rig_get_split_vfo(RIG *rig, * * Sets the current RIT offset. A value of 0 for \a rit disables RIT. * - * \return RIG_OK if the operation has been successful, otherwise + * \RETURNFUNC(RIG_OK) if the operation has been successful, otherwise * a negative value if an error occurred (in which case, cause is * set appropriately). * @@ -3894,30 +3895,30 @@ int HAMLIB_API rig_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit) int retcode, rc2; vfo_t curr_vfo; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; if (CHECK_RIG_ARG(rig)) { - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } caps = rig->caps; if (caps->set_rit == NULL) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } if ((caps->targetable_vfo & RIG_TARGETABLE_RITXIT) || vfo == RIG_VFO_CURR || vfo == rig->state.current_vfo) { - return caps->set_rit(rig, vfo, rit); + RETURNFUNC(caps->set_rit(rig, vfo, rit)); } if (!caps->set_vfo) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } curr_vfo = rig->state.current_vfo; @@ -3925,7 +3926,7 @@ int HAMLIB_API rig_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit) if (retcode != RIG_OK) { - return retcode; + RETURNFUNC(retcode); } retcode = caps->set_rit(rig, vfo, rit); @@ -3938,7 +3939,7 @@ int HAMLIB_API rig_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit) retcode = rc2; } - return retcode; + RETURNFUNC(retcode); } @@ -3950,7 +3951,7 @@ int HAMLIB_API rig_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit) * * Retrieves the current RIT offset. * - * \return RIG_OK if the operation has been successful, otherwise + * \RETURNFUNC(RIG_OK) if the operation has been successful, otherwise * a negative value if an error occurred (in which case, cause is * set appropriately). * @@ -3962,30 +3963,30 @@ int HAMLIB_API rig_get_rit(RIG *rig, vfo_t vfo, shortfreq_t *rit) int retcode, rc2; vfo_t curr_vfo; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; if (CHECK_RIG_ARG(rig) || !rit) { - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } caps = rig->caps; if (caps->get_rit == NULL) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } if ((caps->targetable_vfo & RIG_TARGETABLE_RITXIT) || vfo == RIG_VFO_CURR || vfo == rig->state.current_vfo) { - return caps->get_rit(rig, vfo, rit); + RETURNFUNC(caps->get_rit(rig, vfo, rit)); } if (!caps->set_vfo) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } curr_vfo = rig->state.current_vfo; @@ -3993,7 +3994,7 @@ int HAMLIB_API rig_get_rit(RIG *rig, vfo_t vfo, shortfreq_t *rit) if (retcode != RIG_OK) { - return retcode; + RETURNFUNC(retcode); } retcode = caps->get_rit(rig, vfo, rit); @@ -4006,7 +4007,7 @@ int HAMLIB_API rig_get_rit(RIG *rig, vfo_t vfo, shortfreq_t *rit) retcode = rc2; } - return retcode; + RETURNFUNC(retcode); } @@ -4018,7 +4019,7 @@ int HAMLIB_API rig_get_rit(RIG *rig, vfo_t vfo, shortfreq_t *rit) * * Sets the current XIT offset. A value of 0 for \a xit disables XIT. * - * \return RIG_OK if the operation has been successful, otherwise + * \RETURNFUNC(RIG_OK) if the operation has been successful, otherwise * a negative value if an error occurred (in which case, cause is * set appropriately). * @@ -4030,30 +4031,30 @@ int HAMLIB_API rig_set_xit(RIG *rig, vfo_t vfo, shortfreq_t xit) int retcode, rc2; vfo_t curr_vfo; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; if (CHECK_RIG_ARG(rig)) { - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } caps = rig->caps; if (caps->set_xit == NULL) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } if ((caps->targetable_vfo & RIG_TARGETABLE_RITXIT) || vfo == RIG_VFO_CURR || vfo == rig->state.current_vfo) { - return caps->set_xit(rig, vfo, xit); + RETURNFUNC(caps->set_xit(rig, vfo, xit)); } if (!caps->set_vfo) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } curr_vfo = rig->state.current_vfo; @@ -4061,7 +4062,7 @@ int HAMLIB_API rig_set_xit(RIG *rig, vfo_t vfo, shortfreq_t xit) if (retcode != RIG_OK) { - return retcode; + RETURNFUNC(retcode); } retcode = caps->set_xit(rig, vfo, xit); @@ -4074,7 +4075,7 @@ int HAMLIB_API rig_set_xit(RIG *rig, vfo_t vfo, shortfreq_t xit) retcode = rc2; } - return retcode; + RETURNFUNC(retcode); } @@ -4086,7 +4087,7 @@ int HAMLIB_API rig_set_xit(RIG *rig, vfo_t vfo, shortfreq_t xit) * * Retrieves the current XIT offset. * - * \return RIG_OK if the operation has been successful, otherwise + * \RETURNFUNC(RIG_OK) if the operation has been successful, otherwise * a negative value if an error occurred (in which case, cause is * set appropriately). * @@ -4098,30 +4099,30 @@ int HAMLIB_API rig_get_xit(RIG *rig, vfo_t vfo, shortfreq_t *xit) int retcode, rc2; vfo_t curr_vfo; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; if (CHECK_RIG_ARG(rig) || !xit) { - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } caps = rig->caps; if (caps->get_xit == NULL) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } if ((caps->targetable_vfo & RIG_TARGETABLE_RITXIT) || vfo == RIG_VFO_CURR || vfo == rig->state.current_vfo) { - return caps->get_xit(rig, vfo, xit); + RETURNFUNC(caps->get_xit(rig, vfo, xit)); } if (!caps->set_vfo) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } curr_vfo = rig->state.current_vfo; @@ -4129,7 +4130,7 @@ int HAMLIB_API rig_get_xit(RIG *rig, vfo_t vfo, shortfreq_t *xit) if (retcode != RIG_OK) { - return retcode; + RETURNFUNC(retcode); } retcode = caps->get_xit(rig, vfo, xit); @@ -4142,7 +4143,7 @@ int HAMLIB_API rig_get_xit(RIG *rig, vfo_t vfo, shortfreq_t *xit) retcode = rc2; } - return retcode; + RETURNFUNC(retcode); } @@ -4154,7 +4155,7 @@ int HAMLIB_API rig_get_xit(RIG *rig, vfo_t vfo, shortfreq_t *xit) * * Sets the Tuning Step. * - * \return RIG_OK if the operation has been successful, otherwise + * \RETURNFUNC(RIG_OK) if the operation has been successful, otherwise * a negative value if an error occurred (in which case, cause is * set appropriately). * @@ -4166,30 +4167,30 @@ int HAMLIB_API rig_set_ts(RIG *rig, vfo_t vfo, shortfreq_t ts) int retcode, rc2; vfo_t curr_vfo; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; if (CHECK_RIG_ARG(rig)) { - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } caps = rig->caps; if (caps->set_ts == NULL) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } if ((caps->targetable_vfo & RIG_TARGETABLE_PURE) || vfo == RIG_VFO_CURR || vfo == rig->state.current_vfo) { - return caps->set_ts(rig, vfo, ts); + RETURNFUNC(caps->set_ts(rig, vfo, ts)); } if (!caps->set_vfo) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } curr_vfo = rig->state.current_vfo; @@ -4197,7 +4198,7 @@ int HAMLIB_API rig_set_ts(RIG *rig, vfo_t vfo, shortfreq_t ts) if (retcode != RIG_OK) { - return retcode; + RETURNFUNC(retcode); } retcode = caps->set_ts(rig, vfo, ts); @@ -4210,7 +4211,7 @@ int HAMLIB_API rig_set_ts(RIG *rig, vfo_t vfo, shortfreq_t ts) retcode = rc2; } - return retcode; + RETURNFUNC(retcode); } @@ -4222,7 +4223,7 @@ int HAMLIB_API rig_set_ts(RIG *rig, vfo_t vfo, shortfreq_t ts) * * Retrieves the current tuning step. * - * \return RIG_OK if the operation has been successful, otherwise + * \RETURNFUNC(RIG_OK) if the operation has been successful, otherwise * a negative value if an error occurred (in which case, cause is * set appropriately). * @@ -4234,30 +4235,30 @@ int HAMLIB_API rig_get_ts(RIG *rig, vfo_t vfo, shortfreq_t *ts) int retcode, rc2; vfo_t curr_vfo; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; if (CHECK_RIG_ARG(rig) || !ts) { - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } caps = rig->caps; if (caps->get_ts == NULL) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } if ((caps->targetable_vfo & RIG_TARGETABLE_PURE) || vfo == RIG_VFO_CURR || vfo == rig->state.current_vfo) { - return caps->get_ts(rig, vfo, ts); + RETURNFUNC(caps->get_ts(rig, vfo, ts)); } if (!caps->set_vfo) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } curr_vfo = rig->state.current_vfo; @@ -4265,7 +4266,7 @@ int HAMLIB_API rig_get_ts(RIG *rig, vfo_t vfo, shortfreq_t *ts) if (retcode != RIG_OK) { - return retcode; + RETURNFUNC(retcode); } retcode = caps->get_ts(rig, vfo, ts); @@ -4278,7 +4279,7 @@ int HAMLIB_API rig_get_ts(RIG *rig, vfo_t vfo, shortfreq_t *ts) retcode = rc2; } - return retcode; + RETURNFUNC(retcode); } @@ -4295,7 +4296,7 @@ int HAMLIB_API rig_get_ts(RIG *rig, vfo_t vfo, shortfreq_t *ts) rig_set_ant(rig, RIG_VFO_RX, RIG_ANT_2); \endcode * - * \return RIG_OK if the operation has been successful, otherwise + * \RETURNFUNC(RIG_OK) if the operation has been successful, otherwise * a negative value if an error occurred (in which case, cause is * set appropriately). * @@ -4307,30 +4308,30 @@ int HAMLIB_API rig_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option) int retcode, rc2; vfo_t curr_vfo; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; if (CHECK_RIG_ARG(rig)) { - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } caps = rig->caps; if (caps->set_ant == NULL) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } if ((caps->targetable_vfo & RIG_TARGETABLE_ANT) || vfo == RIG_VFO_CURR || vfo == rig->state.current_vfo) { - return caps->set_ant(rig, vfo, ant, option); + RETURNFUNC(caps->set_ant(rig, vfo, ant, option)); } if (!caps->set_vfo) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } curr_vfo = rig->state.current_vfo; @@ -4338,7 +4339,7 @@ int HAMLIB_API rig_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option) if (retcode != RIG_OK) { - return retcode; + RETURNFUNC(retcode); } retcode = caps->set_ant(rig, vfo, ant, option); @@ -4351,7 +4352,7 @@ int HAMLIB_API rig_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option) retcode = rc2; } - return retcode; + RETURNFUNC(retcode); } @@ -4367,7 +4368,7 @@ int HAMLIB_API rig_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option) * * Retrieves the current antenna. * - * \return RIG_OK if the operation has been successful, otherwise + * \RETURNFUNC(RIG_OK) if the operation has been successful, otherwise * a negative value if an error occurred (in which case, cause is * set appropriately). * @@ -4380,32 +4381,32 @@ int HAMLIB_API rig_get_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t *option, int retcode, rc2; vfo_t curr_vfo; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; *ant_tx = *ant_rx = RIG_ANT_UNKNOWN; if (CHECK_RIG_ARG(rig) || !ant_curr) { - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } caps = rig->caps; if (caps->get_ant == NULL) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } if ((caps->targetable_vfo & RIG_TARGETABLE_ANT) || vfo == RIG_VFO_CURR || vfo == rig->state.current_vfo) { - return caps->get_ant(rig, vfo, ant, option, ant_curr, ant_tx, ant_rx); + RETURNFUNC(caps->get_ant(rig, vfo, ant, option, ant_curr, ant_tx, ant_rx)); } if (!caps->set_vfo) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } curr_vfo = rig->state.current_vfo; @@ -4413,7 +4414,7 @@ int HAMLIB_API rig_get_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t *option, if (retcode != RIG_OK) { - return retcode; + RETURNFUNC(retcode); } retcode = caps->get_ant(rig, vfo, ant, option, ant_curr, ant_tx, ant_rx); @@ -4426,7 +4427,7 @@ int HAMLIB_API rig_get_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t *option, retcode = rc2; } - return retcode; + RETURNFUNC(retcode); } @@ -4444,7 +4445,7 @@ int HAMLIB_API rig_get_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t *option, * also provided since the relative power is peculiar to a specific * freq and mode range of the radio. * - * \return RIG_OK if the operation has been successful, otherwise + * \RETURNFUNC(RIG_OK) if the operation has been successful, otherwise * a negative value if an error occurred (in which case, cause is * set appropriately). * @@ -4458,16 +4459,16 @@ int HAMLIB_API rig_power2mW(RIG *rig, { const freq_range_t *txrange; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; if (!rig || !rig->caps || !mwpower || power < 0.0 || power > 1.0) { - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } if (rig->caps->power2mW != NULL) { - return rig->caps->power2mW(rig, mwpower, power, freq, mode); + RETURNFUNC(rig->caps->power2mW(rig, mwpower, power, freq, mode)); } txrange = rig_get_range(rig->state.tx_range_list, freq, mode); @@ -4477,12 +4478,12 @@ int HAMLIB_API rig_power2mW(RIG *rig, /* * freq is not on the tx range! */ - return -RIG_ECONF; /* could be RIG_EINVAL ? */ + RETURNFUNC(-RIG_ECONF); /* could be RIG_EINVAL ? */ } *mwpower = (unsigned int)(power * txrange->high_power); - return RIG_OK; + RETURNFUNC(RIG_OK); } @@ -4500,7 +4501,7 @@ int HAMLIB_API rig_power2mW(RIG *rig, * also provided since the relative power is peculiar to a specific * freq and mode range of the radio. * - * \return RIG_OK if the operation has been successful, otherwise + * \RETURNFUNC(RIG_OK) if the operation has been successful, otherwise * a negative value if an error occurred (in which case, cause is * set appropriately). * @@ -4514,16 +4515,16 @@ int HAMLIB_API rig_mW2power(RIG *rig, { const freq_range_t *txrange; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; if (!rig || !rig->caps || !power || mwpower == 0) { - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } if (rig->caps->mW2power != NULL) { - return rig->caps->mW2power(rig, power, mwpower, freq, mode); + RETURNFUNC(rig->caps->mW2power(rig, power, mwpower, freq, mode)); } txrange = rig_get_range(rig->state.tx_range_list, freq, mode); @@ -4533,13 +4534,13 @@ int HAMLIB_API rig_mW2power(RIG *rig, /* * freq is not on the tx range! */ - return -RIG_ECONF; /* could be RIG_EINVAL ? */ + RETURNFUNC(-RIG_ECONF); /* could be RIG_EINVAL ? */ } if (txrange->high_power == 0) { *power = 0.0; - return RIG_OK; + RETURNFUNC(RIG_OK); } *power = (float)mwpower / txrange->high_power; @@ -4549,7 +4550,7 @@ int HAMLIB_API rig_mW2power(RIG *rig, *power = 1.0; } - return (mwpower > txrange->high_power ? RIG_OK : -RIG_ETRUNC); + RETURNFUNC (mwpower > txrange->high_power ? RIG_OK : -RIG_ETRUNC); } @@ -4569,11 +4570,11 @@ shortfreq_t HAMLIB_API rig_get_resolution(RIG *rig, rmode_t mode) const struct rig_state *rs; int i; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; if (!rig || !rig->caps || !mode) { - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } rs = &rig->state; @@ -4582,11 +4583,11 @@ shortfreq_t HAMLIB_API rig_get_resolution(RIG *rig, rmode_t mode) { if (rs->tuning_steps[i].modes & mode) { - return rs->tuning_steps[i].ts; + RETURNFUNC(rs->tuning_steps[i].ts); } } - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } @@ -4599,7 +4600,7 @@ shortfreq_t HAMLIB_API rig_get_resolution(RIG *rig, rmode_t mode) * See #RIG_POWER_ON, #RIG_POWER_OFF and #RIG_POWER_STANDBY defines * for the \a status. * - * \return RIG_OK if the operation has been successful, ortherwise + * \RETURNFUNC(RIG_OK) if the operation has been successful, ortherwise * a negative value if an error occurred (in which case, cause is * set appropriately). * @@ -4607,20 +4608,20 @@ shortfreq_t HAMLIB_API rig_get_resolution(RIG *rig, rmode_t mode) */ int HAMLIB_API rig_set_powerstat(RIG *rig, powerstat_t status) { - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; if (CHECK_RIG_ARG(rig)) { - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } if (rig->caps->set_powerstat == NULL) { rig_debug(RIG_DEBUG_WARN, "%s set_powerstat not implemented\n", __func__); - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } - return rig->caps->set_powerstat(rig, status); + RETURNFUNC(rig->caps->set_powerstat(rig, status)); } @@ -4632,7 +4633,7 @@ int HAMLIB_API rig_set_powerstat(RIG *rig, powerstat_t status) * Retrieve the status of the radio. See RIG_POWER_ON, RIG_POWER_OFF and * RIG_POWER_STANDBY defines for the \a status. * - * \return RIG_OK if the operation has been successful, otherwise + * \RETURNFUNC(RIG_OK) if the operation has been successful, otherwise * a negative value if an error occurred (in which case, cause is * set appropriately). * @@ -4640,19 +4641,19 @@ int HAMLIB_API rig_set_powerstat(RIG *rig, powerstat_t status) */ int HAMLIB_API rig_get_powerstat(RIG *rig, powerstat_t *status) { - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; if (CHECK_RIG_ARG(rig) || !status) { - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } if (rig->caps->get_powerstat == NULL) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } - return rig->caps->get_powerstat(rig, status); + RETURNFUNC(rig->caps->get_powerstat(rig, status)); } @@ -4665,26 +4666,26 @@ int HAMLIB_API rig_get_powerstat(RIG *rig, powerstat_t *status) * See RIG_RESET_NONE, RIG_RESET_SOFT and RIG_RESET_MCALL defines * for the \a reset. * - * \return RIG_OK if the operation has been successful, otherwise + * \RETURNFUNC(RIG_OK) if the operation has been successful, otherwise * a negative value if an error occurred (in which case, cause is * set appropriately). * */ int HAMLIB_API rig_reset(RIG *rig, reset_t reset) { - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; if (CHECK_RIG_ARG(rig)) { - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } if (rig->caps->reset == NULL) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } - return rig->caps->reset(rig, reset); + RETURNFUNC(rig->caps->reset(rig, reset)); } @@ -4713,11 +4714,11 @@ extern int rig_probe_all_backends(hamlib_port_t *p, */ rig_model_t HAMLIB_API rig_probe(hamlib_port_t *port) { - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; if (!port) { - return RIG_MODEL_NONE; + RETURNFUNC(RIG_MODEL_NONE); } return rig_probe_first(port); @@ -4737,7 +4738,7 @@ rig_model_t HAMLIB_API rig_probe(hamlib_port_t *port) * \warning this is really Experimental, It has been tested only * with IC-706MkIIG. any feedback welcome! --SF * - * \return RIG_OK if the operation has been successful, otherwise + * \RETURNFUNC(RIG_OK) if the operation has been successful, otherwise * a negative value if an error occurred (in which case, cause is * set appropriately). */ @@ -4745,11 +4746,11 @@ int HAMLIB_API rig_probe_all(hamlib_port_t *port, rig_probe_func_t cfunc, rig_ptr_t data) { - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; if (!port) { - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } return rig_probe_all_backends(port, cfunc, data); @@ -4774,14 +4775,14 @@ int HAMLIB_API rig_probe_all(hamlib_port_t *port, */ vfo_op_t HAMLIB_API rig_has_vfo_op(RIG *rig, vfo_op_t op) { - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; if (!rig || !rig->caps) { - return 0; + RETURNFUNC(0); } - return (rig->caps->vfo_ops & op); + RETURNFUNC (rig->caps->vfo_ops & op); } @@ -4794,7 +4795,7 @@ vfo_op_t HAMLIB_API rig_has_vfo_op(RIG *rig, vfo_op_t op) * Performs Memory/VFO operation. * See #vfo_op_t for more information. * - * \return RIG_OK if the operation has been successful, otherwise + * \RETURNFUNC(RIG_OK) if the operation has been successful, otherwise * a negative value if an error occurred (in which case, cause is * set appropriately). * @@ -4806,30 +4807,30 @@ int HAMLIB_API rig_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op) int retcode, rc2; vfo_t curr_vfo; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; if (CHECK_RIG_ARG(rig)) { - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } caps = rig->caps; if (caps->vfo_op == NULL || !rig_has_vfo_op(rig, op)) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } if ((caps->targetable_vfo & RIG_TARGETABLE_PURE) || vfo == RIG_VFO_CURR || vfo == rig->state.current_vfo) { - return caps->vfo_op(rig, vfo, op); + RETURNFUNC(caps->vfo_op(rig, vfo, op)); } if (!caps->set_vfo) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } curr_vfo = rig->state.current_vfo; @@ -4837,7 +4838,7 @@ int HAMLIB_API rig_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op) if (retcode != RIG_OK) { - return retcode; + RETURNFUNC(retcode); } retcode = caps->vfo_op(rig, vfo, op); @@ -4850,7 +4851,7 @@ int HAMLIB_API rig_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op) retcode = rc2; } - return retcode; + RETURNFUNC(retcode); } @@ -4872,14 +4873,14 @@ int HAMLIB_API rig_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op) */ scan_t HAMLIB_API rig_has_scan(RIG *rig, scan_t scan) { - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; if (!rig || !rig->caps) { - return 0; + RETURNFUNC(0); } - return (rig->caps->scan_ops & scan); + RETURNFUNC (rig->caps->scan_ops & scan); } @@ -4893,7 +4894,7 @@ scan_t HAMLIB_API rig_has_scan(RIG *rig, scan_t scan) * Performs scanning operation. * See #scan_t for more information. * - * \return RIG_OK if the operation has been successful, otherwise + * \RETURNFUNC(RIG_OK) if the operation has been successful, otherwise * a negative value if an error occurred (in which case, cause is * set appropriately). * @@ -4905,11 +4906,11 @@ int HAMLIB_API rig_scan(RIG *rig, vfo_t vfo, scan_t scan, int ch) int retcode, rc2; vfo_t curr_vfo; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; if (CHECK_RIG_ARG(rig)) { - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } caps = rig->caps; @@ -4917,19 +4918,19 @@ int HAMLIB_API rig_scan(RIG *rig, vfo_t vfo, scan_t scan, int ch) if (caps->scan == NULL || (scan != RIG_SCAN_STOP && !rig_has_scan(rig, scan))) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } if ((caps->targetable_vfo & RIG_TARGETABLE_PURE) || vfo == RIG_VFO_CURR || vfo == rig->state.current_vfo) { - return caps->scan(rig, vfo, scan, ch); + RETURNFUNC(caps->scan(rig, vfo, scan, ch)); } if (!caps->set_vfo) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } curr_vfo = rig->state.current_vfo; @@ -4937,7 +4938,7 @@ int HAMLIB_API rig_scan(RIG *rig, vfo_t vfo, scan_t scan, int ch) if (retcode != RIG_OK) { - return retcode; + RETURNFUNC(retcode); } retcode = caps->scan(rig, vfo, scan, ch); @@ -4950,7 +4951,7 @@ int HAMLIB_API rig_scan(RIG *rig, vfo_t vfo, scan_t scan, int ch) retcode = rc2; } - return retcode; + RETURNFUNC(retcode); } @@ -4963,7 +4964,7 @@ int HAMLIB_API rig_scan(RIG *rig, vfo_t vfo, scan_t scan, int ch) * Sends DTMF digits. * See DTMF change speed, etc. (TODO). * - * \return RIG_OK if the operation has been successful, otherwise + * \RETURNFUNC(RIG_OK) if the operation has been successful, otherwise * a negative value if an error occurred (in which case, cause is * set appropriately). * @@ -4974,30 +4975,30 @@ int HAMLIB_API rig_send_dtmf(RIG *rig, vfo_t vfo, const char *digits) int retcode, rc2; vfo_t curr_vfo; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; if (CHECK_RIG_ARG(rig) || !digits) { - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } caps = rig->caps; if (caps->send_dtmf == NULL) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } if ((caps->targetable_vfo & RIG_TARGETABLE_PURE) || vfo == RIG_VFO_CURR || vfo == rig->state.current_vfo) { - return caps->send_dtmf(rig, vfo, digits); + RETURNFUNC(caps->send_dtmf(rig, vfo, digits)); } if (!caps->set_vfo) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } curr_vfo = rig->state.current_vfo; @@ -5005,7 +5006,7 @@ int HAMLIB_API rig_send_dtmf(RIG *rig, vfo_t vfo, const char *digits) if (retcode != RIG_OK) { - return retcode; + RETURNFUNC(retcode); } retcode = caps->send_dtmf(rig, vfo, digits); @@ -5018,7 +5019,7 @@ int HAMLIB_API rig_send_dtmf(RIG *rig, vfo_t vfo, const char *digits) retcode = rc2; } - return retcode; + RETURNFUNC(retcode); } @@ -5032,7 +5033,7 @@ int HAMLIB_API rig_send_dtmf(RIG *rig, vfo_t vfo, const char *digits) * Receives DTMF digits (not blocking). * See DTMF change speed, etc. (TODO). * - * \return RIG_OK if the operation has been successful, otherwise + * \RETURNFUNC(RIG_OK) if the operation has been successful, otherwise * a negative value if an error occurred (in which case, cause is * set appropriately). * @@ -5043,30 +5044,30 @@ int HAMLIB_API rig_recv_dtmf(RIG *rig, vfo_t vfo, char *digits, int *length) int retcode, rc2; vfo_t curr_vfo; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; if (CHECK_RIG_ARG(rig) || !digits || !length) { - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } caps = rig->caps; if (caps->recv_dtmf == NULL) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } if ((caps->targetable_vfo & RIG_TARGETABLE_PURE) || vfo == RIG_VFO_CURR || vfo == rig->state.current_vfo) { - return caps->recv_dtmf(rig, vfo, digits, length); + RETURNFUNC(caps->recv_dtmf(rig, vfo, digits, length)); } if (!caps->set_vfo) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } curr_vfo = rig->state.current_vfo; @@ -5074,7 +5075,7 @@ int HAMLIB_API rig_recv_dtmf(RIG *rig, vfo_t vfo, char *digits, int *length) if (retcode != RIG_OK) { - return retcode; + RETURNFUNC(retcode); } retcode = caps->recv_dtmf(rig, vfo, digits, length); @@ -5087,7 +5088,7 @@ int HAMLIB_API rig_recv_dtmf(RIG *rig, vfo_t vfo, char *digits, int *length) retcode = rc2; } - return retcode; + RETURNFUNC(retcode); } @@ -5100,7 +5101,7 @@ int HAMLIB_API rig_recv_dtmf(RIG *rig, vfo_t vfo, char *digits, int *length) * Sends morse message. * See keyer change speed, etc. (TODO). * - * \return RIG_OK if the operation has been successful, otherwise + * \RETURNFUNC(RIG_OK) if the operation has been successful, otherwise * a negative value if an error occurred (in which case, cause is * set appropriately). * @@ -5111,30 +5112,30 @@ int HAMLIB_API rig_send_morse(RIG *rig, vfo_t vfo, const char *msg) int retcode, rc2; vfo_t curr_vfo; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; if (CHECK_RIG_ARG(rig) || !msg) { - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } caps = rig->caps; if (caps->send_morse == NULL) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } if ((caps->targetable_vfo & RIG_TARGETABLE_PURE) || vfo == RIG_VFO_CURR || vfo == rig->state.current_vfo) { - return caps->send_morse(rig, vfo, msg); + RETURNFUNC(caps->send_morse(rig, vfo, msg)); } if (!caps->set_vfo) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } curr_vfo = rig->state.current_vfo; @@ -5142,7 +5143,7 @@ int HAMLIB_API rig_send_morse(RIG *rig, vfo_t vfo, const char *msg) if (retcode != RIG_OK) { - return retcode; + RETURNFUNC(retcode); } retcode = caps->send_morse(rig, vfo, msg); @@ -5155,7 +5156,7 @@ int HAMLIB_API rig_send_morse(RIG *rig, vfo_t vfo, const char *msg) retcode = rc2; } - return retcode; + RETURNFUNC(retcode); } /** @@ -5165,7 +5166,7 @@ int HAMLIB_API rig_send_morse(RIG *rig, vfo_t vfo, const char *msg) * * Stops the send morse message. * - * \return RIG_OK if the operation has been successful, otherwise + * \RETURNFUNC(RIG_OK) if the operation has been successful, otherwise * a negative value if an error occurred (in which case, cause is * set appropriately). * @@ -5176,24 +5177,24 @@ int HAMLIB_API rig_stop_morse(RIG *rig, vfo_t vfo) int retcode, rc2; vfo_t curr_vfo; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; caps = rig->caps; if (caps->stop_morse == NULL) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } if ((caps->targetable_vfo & RIG_TARGETABLE_PURE) || vfo == RIG_VFO_CURR || vfo == rig->state.current_vfo) { - return caps->stop_morse(rig, vfo); + RETURNFUNC(caps->stop_morse(rig, vfo)); } if (!caps->set_vfo) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } curr_vfo = rig->state.current_vfo; @@ -5201,7 +5202,7 @@ int HAMLIB_API rig_stop_morse(RIG *rig, vfo_t vfo) if (retcode != RIG_OK) { - return retcode; + RETURNFUNC(retcode); } retcode = caps->stop_morse(rig, vfo); @@ -5214,7 +5215,7 @@ int HAMLIB_API rig_stop_morse(RIG *rig, vfo_t vfo) retcode = rc2; } - return retcode; + RETURNFUNC(retcode); } /* @@ -5228,7 +5229,7 @@ static int wait_morse_ptt(RIG *rig, vfo_t vfo) ptt_t pttStatus = RIG_PTT_OFF; int loops = 0; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; hl_usleep(200 * 1000); // give little time for CW to start PTT @@ -5242,7 +5243,7 @@ static int wait_morse_ptt(RIG *rig, vfo_t vfo) if (retval != RIG_OK) { - return retval; + RETURNFUNC(retval); } // every 25ms should be short enough @@ -5251,7 +5252,7 @@ static int wait_morse_ptt(RIG *rig, vfo_t vfo) } while (pttStatus == RIG_PTT_ON && loops <= 600); - return RIG_OK; + RETURNFUNC(RIG_OK); } /** @@ -5261,7 +5262,7 @@ static int wait_morse_ptt(RIG *rig, vfo_t vfo) * * waits for the end of the morse message to be sent. * - * \return RIG_OK if the operation has been successful, otherwise + * \RETURNFUNC(RIG_OK) if the operation has been successful, otherwise * a negative value if an error occurred (in which case, cause is * set appropriately). * @@ -5272,19 +5273,19 @@ int HAMLIB_API rig_wait_morse(RIG *rig, vfo_t vfo) int retcode, rc2; vfo_t curr_vfo; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; caps = rig->caps; if ((caps->targetable_vfo & RIG_TARGETABLE_PURE) || vfo == RIG_VFO_CURR || vfo == rig->state.current_vfo) { - return wait_morse_ptt(rig, vfo); + RETURNFUNC(wait_morse_ptt(rig, vfo)); } if (!caps->set_vfo) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } curr_vfo = rig->state.current_vfo; @@ -5292,7 +5293,7 @@ int HAMLIB_API rig_wait_morse(RIG *rig, vfo_t vfo) if (retcode != RIG_OK) { - return retcode; + RETURNFUNC(retcode); } retcode = wait_morse_ptt(rig, vfo); @@ -5305,7 +5306,7 @@ int HAMLIB_API rig_wait_morse(RIG *rig, vfo_t vfo) retcode = rc2; } - return retcode; + RETURNFUNC(retcode); } @@ -5317,7 +5318,7 @@ int HAMLIB_API rig_wait_morse(RIG *rig, vfo_t vfo) * * Sends voice memory content. * - * \return RIG_OK if the operation has been successful, otherwise + * \RETURNFUNC(RIG_OK) if the operation has been successful, otherwise * a negative value if an error occurred (in which case, cause is * set appropriately). * @@ -5329,30 +5330,30 @@ int HAMLIB_API rig_send_voice_mem(RIG *rig, vfo_t vfo, int ch) int retcode, rc2; vfo_t curr_vfo; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; if CHECK_RIG_ARG(rig) { - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } caps = rig->caps; if (caps->send_voice_mem == NULL) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } if ((caps->targetable_vfo & RIG_TARGETABLE_PURE) || vfo == RIG_VFO_CURR || vfo == rig->state.current_vfo) { - return caps->send_voice_mem(rig, vfo, ch); + RETURNFUNC(caps->send_voice_mem(rig, vfo, ch)); } if (!caps->set_vfo) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } curr_vfo = rig->state.current_vfo; @@ -5360,7 +5361,7 @@ int HAMLIB_API rig_send_voice_mem(RIG *rig, vfo_t vfo, int ch) if (retcode != RIG_OK) { - return retcode; + RETURNFUNC(retcode); } retcode = caps->send_voice_mem(rig, vfo, ch); @@ -5373,7 +5374,7 @@ int HAMLIB_API rig_send_voice_mem(RIG *rig, vfo_t vfo, int ch) retcode = rc2; } - return retcode; + RETURNFUNC(retcode); } @@ -5396,24 +5397,24 @@ const freq_range_t *HAMLIB_API rig_get_range(const freq_range_t *range_list, { int i; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; for (i = 0; i < FRQRANGESIZ; i++) { if (range_list[i].startf == 0 && range_list[i].endf == 0) { - return NULL; + RETURNFUNC(NULL); } if (freq >= range_list[i].startf && freq <= range_list[i].endf && (range_list[i].modes & mode)) { const freq_range_t *f = &range_list[i]; - return f; + RETURNFUNC(f); } } - return NULL; + RETURNFUNC(NULL); } /** @@ -5422,19 +5423,17 @@ const freq_range_t *HAMLIB_API rig_get_range(const freq_range_t *range_list, * * Returns RIG_OK or -RIG_EPROTO; * - * \return RIG_OK or -RIG_EPROTO; - * */ int HAMLIB_API rig_set_vfo_opt(RIG *rig, int status) { - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; if (rig->caps->set_vfo_opt == NULL) { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } - return rig->caps->set_vfo_opt(rig, status); + RETURNFUNC(rig->caps->set_vfo_opt(rig, status)); } /** @@ -5450,19 +5449,19 @@ int HAMLIB_API rig_set_vfo_opt(RIG *rig, int status) */ const char *HAMLIB_API rig_get_info(RIG *rig) { - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; if (CHECK_RIG_ARG(rig)) { - return NULL; + RETURNFUNC(NULL); } if (rig->caps->get_info == NULL) { - return NULL; + RETURNFUNC(NULL); } - return rig->caps->get_info(rig); + RETURNFUNC(rig->caps->get_info(rig)); }