[Hamlib-commits] Hamlib -- Ham radio control libraries branch master updated. 7b60cb586dc6b1f76bd85
Library to control radio transceivers and receivers
Brought to you by:
n0nb
From: n0nb <n0...@us...> - 2025-06-07 13:01:29
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Hamlib -- Ham radio control libraries". The branch, master has been updated via 7b60cb586dc6b1f76bd85bceba42dac373159914 (commit) via 10180a6dc2433d525d4c3ba75c2f6519f0c55031 (commit) via 721b81d9bed4c23ce74d1140833968c55e6b4d1e (commit) via 72bde6e13171e1c2425e094413598ec88a8397a0 (commit) from ae9556462a2989b8b97af0d6e320558ffa0e1f3e (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 7b60cb586dc6b1f76bd85bceba42dac373159914 Merge: ae9556462 10180a6dc Author: Nate Bargmann <n0...@n0...> Date: Sat Jun 7 07:56:07 2025 -0500 Merge GitHub PR #1751 commit 10180a6dc2433d525d4c3ba75c2f6519f0c55031 Author: Daniele Forsi IU5HKX <iu...@gm...> Date: Tue May 27 20:15:34 2025 +0200 Fix sign of error return values All RIG_E* constants should be negated when returned or compared. Fixed with: perl -pe 's/return RIG_E/return -RIG_E/' -i $(grep -lEr "return RIG_E" --include=*.{c,h}) perl -pe 's/= RIG_E/= -RIG_E/g' -i $(grep -lEr "= RIG_E" --include=*.{c,h}) diff --git a/rigs/adat/adat.c b/rigs/adat/adat.c index ad08b58e4..e23002184 100644 --- a/rigs/adat/adat.c +++ b/rigs/adat/adat.c @@ -1565,9 +1565,9 @@ int adat_cmd_recover_from_error(RIG *pRig, int nError) // Recover from communication error - if ((nError == RIG_ETIMEOUT) - || (nError == RIG_EPROTO) - || (nError == RIG_EIO)) + if ((nError == -RIG_ETIMEOUT) + || (nError == -RIG_EPROTO) + || (nError == -RIG_EIO)) { rig_close(pRig); diff --git a/rigs/dummy/flrig.c b/rigs/dummy/flrig.c index a150e1bc9..4ee7b3de6 100644 --- a/rigs/dummy/flrig.c +++ b/rigs/dummy/flrig.c @@ -887,7 +887,7 @@ static int flrig_open(RIG *rig) /* see if get_modeA is available */ retval = flrig_transaction(rig, "rig.get_modeA", NULL, value, sizeof(value)); - if (retval == RIG_ENAVAIL) // must not have it + if (retval == -RIG_ENAVAIL) // must not have it { priv->has_get_modeA = 0; rig_debug(RIG_DEBUG_VERBOSE, "%s: getmodeA is not available=%s\n", __func__, @@ -902,7 +902,7 @@ static int flrig_open(RIG *rig) /* see if get_modeB is available */ retval = flrig_transaction(rig, "rig.get_modeB", NULL, value, sizeof(value)); - if (retval == RIG_ENAVAIL) // must not have it + if (retval == -RIG_ENAVAIL) // must not have it { priv->has_get_modeB = 0; rig_debug(RIG_DEBUG_VERBOSE, "%s: getmodeB is not available=%s\n", __func__, @@ -927,7 +927,7 @@ static int flrig_open(RIG *rig) retval = flrig_transaction(rig, "rig.get_bwA", NULL, value, sizeof(value)); int dummy; - if (retval == RIG_ENAVAIL || value[0] == 0 + if (retval == -RIG_ENAVAIL || value[0] == 0 || sscanf(value, "%d", &dummy) <= 0) // must not have it { priv->has_get_bwA = 0; @@ -946,7 +946,7 @@ static int flrig_open(RIG *rig) /* see if set_bwA is available */ retval = flrig_transaction(rig, "rig.set_bwA", NULL, value, sizeof(value)); - if (retval == RIG_ENAVAIL) // must not have it + if (retval == -RIG_ENAVAIL) // must not have it { priv->has_set_bwA = 0; priv->has_set_bwB = 0; @@ -964,7 +964,7 @@ static int flrig_open(RIG *rig) // see if get_bwB is available FLRig can return empty value too retval = flrig_transaction(rig, "rig.get_bwB", NULL, value, sizeof(value)); - if (retval == RIG_ENAVAIL || strlen(value) == 0) // must not have it + if (retval == -RIG_ENAVAIL || strlen(value) == 0) // must not have it { priv->has_get_bwB = 0; rig_debug(RIG_DEBUG_VERBOSE, "%s: get_bwB is not available=%s\n", __func__, @@ -979,7 +979,7 @@ static int flrig_open(RIG *rig) /* see if set_bwB is available */ retval = flrig_transaction(rig, "rig.set_bwB", NULL, value, sizeof(value)); - if (retval == RIG_ENAVAIL) // must not have it + if (retval == -RIG_ENAVAIL) // must not have it { priv->has_set_bwB = 0; rig_debug(RIG_DEBUG_VERBOSE, "%s: set_bwB is not available=%s\n", __func__, @@ -2383,7 +2383,7 @@ static int flrig_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) retval = flrig_transaction(rig, cmd, NULL, value, sizeof(value)); - if (retval == RIG_ENAVAIL && strcmp(cmd, "rig.get_SWR") == 0) + if (retval == -RIG_ENAVAIL && strcmp(cmd, "rig.get_SWR") == 0) { priv->get_SWR = 0; cmd = "rig.get_swrmeter"; // revert to old flrig method diff --git a/rigs/dummy/quisk.c b/rigs/dummy/quisk.c index 4f8007af8..c3fb30b0e 100644 --- a/rigs/dummy/quisk.c +++ b/rigs/dummy/quisk.c @@ -2070,7 +2070,7 @@ static int quisk_get_powerstat(RIG *rig, powerstat_t *status) // a return of 1 should indicate there is no powerstat command available // so we fake the ON status // also a problem with Flex 6xxx and Log4OM not working due to lack of PS command - if (ret != RIG_ETIMEOUT) + if (ret != -RIG_ETIMEOUT) { rig_debug(RIG_DEBUG_VERBOSE, "%s: PS command failed (ret=%d) so returning RIG_POWER_ON\n", __func__, ret); diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 38e12e82b..7cb8cf81a 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -1232,7 +1232,7 @@ retry_open: { // maybe we need power on? rig_debug(RIG_DEBUG_VERBOSE, "%s trying power on\n", __func__); - retval = abs(rig_set_powerstat(rig, 1)); + retval = rig_set_powerstat(rig, 1); // this is only a fatal error if powerstat is implemented // if not implemented than we're at an error here @@ -1243,7 +1243,7 @@ retry_open: rig_debug(RIG_DEBUG_ERR, "%s: rig_set_powerstat failed: %s\n", __func__, rigerror(retval)); - if (retval == RIG_ENIMPL || retval == RIG_ENAVAIL) + if (retval == -RIG_ENIMPL || retval == -RIG_ENAVAIL) { rig_debug(RIG_DEBUG_ERR, "%s: rig_set_powerstat not implemented for rig\n", __func__); @@ -1316,11 +1316,11 @@ int icom_rig_close(RIG *rig) { // maybe we need power off? rig_debug(RIG_DEBUG_VERBOSE, "%s trying power off\n", __func__); - int retval = abs(rig_set_powerstat(rig, 0)); + int retval = rig_set_powerstat(rig, 0); // this is only a fatal error if powerstat is implemented // if not implemented than we're at an error here - if (retval != RIG_OK && retval != RIG_ENIMPL && retval != RIG_ENAVAIL) + if (retval != RIG_OK && retval != -RIG_ENIMPL && retval != -RIG_ENAVAIL) { rig_debug(RIG_DEBUG_WARN, "%s: unexpected retval here: %s\n", __func__, rigerror(retval)); diff --git a/rigs/kenwood/ic10.c b/rigs/kenwood/ic10.c index ac57db4b8..c2c75e13a 100644 --- a/rigs/kenwood/ic10.c +++ b/rigs/kenwood/ic10.c @@ -152,7 +152,7 @@ static int get_ic10_if(RIG *rig, char *data) { const struct kenwood_priv_caps *priv = (struct kenwood_priv_caps *) rig->caps->priv; - int i, data_len, retval = RIG_EINVAL; + int i, data_len, retval = -RIG_EINVAL; rig_debug(RIG_DEBUG_TRACE, "%s: called\n", __func__); diff --git a/rigs/kenwood/k3.c b/rigs/kenwood/k3.c index 4f129a1a3..da0541059 100644 --- a/rigs/kenwood/k3.c +++ b/rigs/kenwood/k3.c @@ -2352,7 +2352,7 @@ int k3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) } else { - return RIG_EPROTO; + return -RIG_EPROTO; } // extended K22 format PCnnnx where 0=.1W units and 1=1W units diff --git a/rigs/pcr/pcr.c b/rigs/pcr/pcr.c index 12a8ae12d..f0c73f673 100644 --- a/rigs/pcr/pcr.c +++ b/rigs/pcr/pcr.c @@ -589,7 +589,7 @@ pcr_open(RIG *rig) rig_flush(rp); - /* return RIG_ERJCTED if power is off */ + /* return -RIG_ERJCTED if power is off */ err = pcr_transaction(rig, "H1?"); if (err != RIG_OK) @@ -1939,7 +1939,7 @@ int pcr_get_powerstat(RIG *rig, powerstat_t *status) struct pcr_priv_data *priv = (struct pcr_priv_data *) STATE(rig)->priv; int err; - /* return RIG_ERJCTED if power is off */ + /* return -RIG_ERJCTED if power is off */ err = pcr_transaction(rig, "H1?"); if (err != RIG_OK && err != -RIG_ERJCTED) diff --git a/rigs/tentec/orion.c b/rigs/tentec/orion.c index 2ad454553..d497eefe0 100644 --- a/rigs/tentec/orion.c +++ b/rigs/tentec/orion.c @@ -425,7 +425,7 @@ int tt565_set_freq(RIG *rig, vfo_t vfo, freq_t freq) * matches the VFO A/B setting. c.f. rig_get_range(). * Recall VFOA = ham only, VFOB = gen coverage for Hamlib. * (We assume VFOA = Main RXTX and VFOB = Sub RX.) - * If outside range, return RIG_ERJECTED for compatibility vs icom.c etc. + * If outside range, return -RIG_ERJECTED for compatibility vs icom.c etc. */ in_range = FALSE; diff --git a/rigs/yaesu/ft757gx.c b/rigs/yaesu/ft757gx.c index d7bdf5518..4189e8bc7 100644 --- a/rigs/yaesu/ft757gx.c +++ b/rigs/yaesu/ft757gx.c @@ -508,7 +508,7 @@ static int ft757gx_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) return RIG_OK; } - return RIG_ENAVAIL; + return -RIG_ENAVAIL; } /* diff --git a/rotators/grbltrk/grbltrk.c b/rotators/grbltrk/grbltrk.c index 9227206fb..abf398765 100644 --- a/rotators/grbltrk/grbltrk.c +++ b/rotators/grbltrk/grbltrk.c @@ -133,7 +133,7 @@ grbl_request(ROT *rot, char *request, uint32_t req_size, char *response, rot_debug(RIG_DEBUG_ERR, "%s write_block fail!\n", __func__); //exit(-1); fail_count++; - //return RIG_EIO; + //return -RIG_EIO; } else { @@ -150,7 +150,7 @@ grbl_request(ROT *rot, char *request, uint32_t req_size, char *response, rot_debug(RIG_DEBUG_ERR, "%s read_string fail! (%d) \n", __func__, retval); //exit(-1); fail_count++; - //return RIG_EIO; + //return -RIG_EIO; } else { @@ -205,7 +205,7 @@ grbl_init(ROT *rot) if (retval != RIG_OK) { rot_debug(RIG_DEBUG_ERR, "grbl_request [%s] fail\n", grbl_init_list[i]); - return RIG_EIO; + return -RIG_EIO; } } @@ -447,7 +447,7 @@ grbltrk_rot_set_conf(ROT *rot, hamlib_token_t token, const char *val) if (retval < 0) { rot_debug(RIG_DEBUG_ERR, "grbl_request [%s] fail\n", val); - return RIG_EIO; + return -RIG_EIO; } } diff --git a/rotators/meade/meade.c b/rotators/meade/meade.c index e36a075fd..997ec24cc 100644 --- a/rotators/meade/meade.c +++ b/rotators/meade/meade.c @@ -310,7 +310,7 @@ static int meade_set_position(ROT *rot, azimuth_t az, elevation_t el) { rig_debug(RIG_DEBUG_VERBOSE, "%s: expected 110, got %s\n", __func__, return_str); - return RIG_EINVAL; + return -RIG_EINVAL; } } diff --git a/rotators/skywatcher/skywatcher.c b/rotators/skywatcher/skywatcher.c index 4cd6e6da6..43a38a54a 100644 --- a/rotators/skywatcher/skywatcher.c +++ b/rotators/skywatcher/skywatcher.c @@ -93,7 +93,7 @@ static int skywatcher_cmd(ROT *rot, const char *cmd, char *response, rig_debug(RIG_DEBUG_ERR, "Error response: '%s'\n", response); } - return RIG_EPROTO; + return -RIG_EPROTO; } // remove leading '=' @@ -204,7 +204,7 @@ int skywatcher_set_motor_position(ROT *rot, int motor_index, float angle) if (status & 0b10) { rig_debug(RIG_DEBUG_ERR, "%s: motor is blocked\n", __func__); - return RIG_EPROTO; + return -RIG_EPROTO; } if (status & 0b1) @@ -221,7 +221,7 @@ int skywatcher_set_motor_position(ROT *rot, int motor_index, float angle) if (!stopped) { - return RIG_EPROTO; + return -RIG_EPROTO; } SNPRINTF(req, sizeof(req), ":G%d00\r", motor_index); diff --git a/src/rig.c b/src/rig.c index e479f0c46..5d83546eb 100644 --- a/src/rig.c +++ b/src/rig.c @@ -7448,7 +7448,7 @@ int HAMLIB_API rig_send_morse(RIG *rig, vfo_t vfo, const char *msg) { const struct rig_caps *caps; struct rig_state *rs; - int retcode = RIG_EINTERNAL, rc2; + int retcode = -RIG_EINTERNAL, rc2; vfo_t curr_vfo; if (CHECK_RIG_ARG(rig)) diff --git a/tests/ampctl_parse.c b/tests/ampctl_parse.c index 62e3ac080..66499bd40 100644 --- a/tests/ampctl_parse.c +++ b/tests/ampctl_parse.c @@ -1393,7 +1393,7 @@ int ampctl_parse(AMP *my_amp, FILE *fin, FILE *fout, char *argv[], int argc) pthread_mutex_unlock(&_mutex); #endif - if (retcode == RIG_EIO) { return retcode; } + if (retcode == -RIG_EIO) { return retcode; } if (retcode != RIG_OK) { @@ -1608,7 +1608,7 @@ int set_conf(AMP *my_amp, char *conf_parms) if (!q) { - return RIG_EINVAL; + return -RIG_EINVAL; } *q++ = '\0'; diff --git a/tests/rigmem.c b/tests/rigmem.c index 54de7fbdb..8bc44abc8 100644 --- a/tests/rigmem.c +++ b/tests/rigmem.c @@ -421,7 +421,7 @@ static int set_conf(RIG *rig, char *conf_parms) if (!q) { - return RIG_EINVAL; + return -RIG_EINVAL; } *q++ = '\0'; diff --git a/tests/rigsmtr.c b/tests/rigsmtr.c index 26132d3b8..21533f6de 100644 --- a/tests/rigsmtr.c +++ b/tests/rigsmtr.c @@ -394,7 +394,7 @@ int set_conf_rig(RIG *rig, char *conf_parms) if (!q) { - return RIG_EINVAL; + return -RIG_EINVAL; *q++ = '\0'; n = strchr(q, ','); diff --git a/tests/rigswr.c b/tests/rigswr.c index af0a186f9..a3f0a592a 100644 --- a/tests/rigswr.c +++ b/tests/rigswr.c @@ -346,7 +346,7 @@ static int set_conf(RIG *rig, char *conf_parms) if (!q) { - return RIG_EINVAL; + return -RIG_EINVAL; } *q++ = '\0'; diff --git a/tests/rotctl_parse.c b/tests/rotctl_parse.c index c47457645..5b843f03a 100644 --- a/tests/rotctl_parse.c +++ b/tests/rotctl_parse.c @@ -1472,7 +1472,7 @@ int rotctl_parse(ROT *my_rot, FILE *fin, FILE *fout, const char *argv[], pthread_mutex_unlock(&rot_mutex); #endif - if (retcode == RIG_EIO) { return retcode; } + if (retcode == -RIG_EIO) { return retcode; } if (retcode != RIG_OK) { commit 721b81d9bed4c23ce74d1140833968c55e6b4d1e Author: Daniele Forsi IU5HKX <iu...@gm...> Date: Fri May 30 23:03:03 2025 +0200 Fix sign of return values Doxygen comments All RIG_E* constants are negated when returned. Fied with: perl -pe 's/return RIG_E/return -RIG_E/' -i src/vent.c perl -pe 's/retval RIG_E/retval -RIG_E/g' -i $(grep -lEr "retval RIG_E" --include=*.{c,h}) diff --git a/src/amp_conf.c b/src/amp_conf.c index 14f53d62c..22738866a 100644 --- a/src/amp_conf.c +++ b/src/amp_conf.c @@ -102,7 +102,7 @@ static const struct confparams ampfrontend_serial_cfg_params[] = * \return RIG_OK or a **negative value** error. * * \retval RIG_OK TOK_... value set successfully. - * \retval RIG_EINVAL TOK_.. value not set. + * \retval -RIG_EINVAL TOK_.. value not set. * * \sa frontamp_get_conf() */ @@ -365,7 +365,7 @@ int frontamp_set_conf(AMP *amp, hamlib_token_t token, const char *val) * \return RIG_OK or a **negative value** on error. * * \retval RIG_OK TOK_... value queried successfully. - * \retval RIG_EINVAL TOK_.. value not queried. + * \retval -RIG_EINVAL TOK_.. value not queried. * * \sa frontamp_set_conf() */ @@ -517,7 +517,7 @@ int frontamp_get_conf2(AMP *amp, hamlib_token_t token, char *val, int val_len) * value** if an error occurred (in which case, cause is set appropriately). * * \retval RIG_OK The \a cfunc action completed successfully. - * \retval RIG_EINVAL \a amp is NULL or inconsistent or \a cfunc is NULL. + * \retval -RIG_EINVAL \a amp is NULL or inconsistent or \a cfunc is NULL. */ int HAMLIB_API amp_token_foreach(AMP *amp, int (*cfunc)(const struct confparams *, @@ -673,8 +673,8 @@ hamlib_token_t HAMLIB_API amp_token_lookup(AMP *amp, const char *name) * value** if an error occurred (in which case, cause is set appropriately). * * \retval RIG_OK The parameter was set successfully. - * \retval RIG_EINVAL \a amp is NULL or inconsistent or \a token is invalid. - * \retval RIG_ENAVAIL amp_caps#set_conf() capability is not available. + * \retval -RIG_EINVAL \a amp is NULL or inconsistent or \a token is invalid. + * \retval -RIG_ENAVAIL amp_caps#set_conf() capability is not available. * * \sa amp_get_conf() */ @@ -729,8 +729,8 @@ int HAMLIB_API amp_set_conf(AMP *amp, hamlib_token_t token, const char *val) * value** if an error occurred (in which case, cause is set appropriately). * * \retval RIG_OK Querying the parameter was successful. - * \retval RIG_EINVAL \a amp is NULL or inconsistent. - * \retval RIG_ENAVAIL amp_caps#get_conf() capability is not available. + * \retval -RIG_EINVAL \a amp is NULL or inconsistent. + * \retval -RIG_ENAVAIL amp_caps#get_conf() capability is not available. * * \sa amp_set_conf() */ diff --git a/src/amplifier.c b/src/amplifier.c index b34a1d617..9be99e0e0 100644 --- a/src/amplifier.c +++ b/src/amplifier.c @@ -304,7 +304,7 @@ AMP *HAMLIB_API amp_init(amp_model_t amp_model) * value** if an error occurred (in which case, cause is set appropriately). * * \retval RIG_OK Communication channel successfully opened. - * \retval RIG_EINVAL \a amp is NULL or inconsistent. + * \retval -RIG_EINVAL \a amp is NULL or inconsistent. * * \sa amp_init(), amp_close() */ @@ -463,7 +463,7 @@ int HAMLIB_API amp_open(AMP *amp) * value** if an error occurred (in which case, cause is set appropriately). * * \retval RIG_OK Communication channel successfully closed. - * \retval RIG_EINVAL \a amp is NULL or inconsistent. + * \retval -RIG_EINVAL \a amp is NULL or inconsistent. * * \sa amp_cleanup(), amp_open() */ @@ -555,7 +555,7 @@ int HAMLIB_API amp_close(AMP *amp) * value** if an error occurred (in which case, cause is set appropriately). * * \retval RIG_OK #AMP handle successfully released. - * \retval RIG_EINVAL \a amp is NULL or inconsistent. + * \retval -RIG_EINVAL \a amp is NULL or inconsistent. * * \sa amp_init(), amp_close() */ @@ -602,8 +602,8 @@ int HAMLIB_API amp_cleanup(AMP *amp) * value** if an error occurred (in which case, cause is set appropriately). * * \retval RIG_OK The reset command was successful. - * \retval RIG_EINVAL \a amp is NULL or inconsistent. - * \retval RIG_ENAVAIL amp_caps#reset() capability is not available. + * \retval -RIG_EINVAL \a amp is NULL or inconsistent. + * \retval -RIG_ENAVAIL amp_caps#reset() capability is not available. */ int HAMLIB_API amp_reset(AMP *amp, amp_reset_t reset) { @@ -639,8 +639,8 @@ int HAMLIB_API amp_reset(AMP *amp, amp_reset_t reset) * value** if an error occurred (in which case, cause is set appropriately). * * \retval RIG_OK The query was successful. - * \retval RIG_EINVAL \a amp is NULL or inconsistent. - * \retval RIG_ENAVAIL amp_caps#get_freq() capability is not available. + * \retval -RIG_EINVAL \a amp is NULL or inconsistent. + * \retval -RIG_ENAVAIL amp_caps#get_freq() capability is not available. * * \sa amp_set_freq() */ @@ -679,8 +679,8 @@ int HAMLIB_API amp_get_freq(AMP *amp, freq_t *freq) * value** if an error occurred (in which case, cause is set appropriately). * * \retval RIG_OK Setting the frequency was successful. - * \retval RIG_EINVAL \a amp is NULL or inconsistent. - * \retval RIG_ENAVAIL amp_caps#set_freq() capability is not available. + * \retval -RIG_EINVAL \a amp is NULL or inconsistent. + * \retval -RIG_ENAVAIL amp_caps#set_freq() capability is not available. * * \sa amp_get_freq() */ @@ -752,8 +752,8 @@ const char *HAMLIB_API amp_get_info(AMP *amp) * value** if an error occurred (in which case, cause is set appropriately). * * \retval RIG_OK The query was successful. - * \retval RIG_EINVAL \a amp is NULL or inconsistent. - * \retval RIG_ENAVAIL amp_caps#get_level() capability is not available. + * \retval -RIG_EINVAL \a amp is NULL or inconsistent. + * \retval -RIG_ENAVAIL amp_caps#get_level() capability is not available. * * \sa amp_set_ext_level() */ @@ -789,8 +789,8 @@ int HAMLIB_API amp_set_level(AMP *amp, setting_t level, value_t val) * value** if an error occurred (in which case, cause is set appropriately). * * \retval RIG_OK The query was successful. - * \retval RIG_EINVAL \a amp is NULL or inconsistent. - * \retval RIG_ENAVAIL amp_caps#get_level() capability is not available. + * \retval -RIG_EINVAL \a amp is NULL or inconsistent. + * \retval -RIG_ENAVAIL amp_caps#get_level() capability is not available. * * \sa amp_get_ext_level() */ @@ -825,8 +825,8 @@ int HAMLIB_API amp_get_level(AMP *amp, setting_t level, value_t *val) * value** if an error occurred (in which case, cause is set appropriately). * * \retval RIG_OK The query was successful. - * \retval RIG_EINVAL \a amp is NULL or inconsistent. - * \retval RIG_ENAVAIL amp_caps#set_ext_level() capability is not available. + * \retval -RIG_EINVAL \a amp is NULL or inconsistent. + * \retval -RIG_ENAVAIL amp_caps#set_ext_level() capability is not available. * * \sa amp_set_level() */ @@ -860,8 +860,8 @@ int HAMLIB_API amp_set_ext_level(AMP *amp, hamlib_token_t level, value_t val) * value** if an error occurred (in which case, cause is set appropriately). * * \retval RIG_OK The query was successful. - * \retval RIG_EINVAL \a amp is NULL or inconsistent. - * \retval RIG_ENAVAIL amp_caps#get_ext_level() capability is not available. + * \retval -RIG_EINVAL \a amp is NULL or inconsistent. + * \retval -RIG_ENAVAIL amp_caps#get_ext_level() capability is not available. * * \sa amp_get_level() */ @@ -898,8 +898,8 @@ int HAMLIB_API amp_get_ext_level(AMP *amp, hamlib_token_t level, value_t *val) * value** if an error occurred (in which case, cause is set appropriately). * * \retval RIG_OK The requested power/standby state was successful. - * \retval RIG_EINVAL \a amp is NULL or inconsistent. - * \retval RIG_ENAVAIL amp_caps#set_powerstat() capability is not available. + * \retval -RIG_EINVAL \a amp is NULL or inconsistent. + * \retval -RIG_ENAVAIL amp_caps#set_powerstat() capability is not available. * * \sa amp_get_powerstat() */ @@ -935,8 +935,8 @@ int HAMLIB_API amp_set_powerstat(AMP *amp, powerstat_t status) * if an error occurred (in which case, cause is set appropriately). * * \retval RIG_OK Querying the power/standby state was successful. - * \retval RIG_EINVAL \a amp is NULL or inconsistent. - * \retval RIG_ENAVAIL amp_caps#get_powerstat() capability is not available. + * \retval -RIG_EINVAL \a amp is NULL or inconsistent. + * \retval -RIG_ENAVAIL amp_caps#get_powerstat() capability is not available. * * \sa amp_set_powerstat() */ diff --git a/src/cm108.c b/src/cm108.c index 340282eeb..9fd36c1e3 100644 --- a/src/cm108.c +++ b/src/cm108.c @@ -165,8 +165,8 @@ const char *get_usb_device_class_string(int device_class) * \return File descriptor, otherwise a **negative value** if an error * occurred (in which case, cause is set appropriately). * - * \retval RIG_EINVAL The port pathname is empty or no CM108 device detected. - * \retval RIG_EIO The `open`(2) system call returned a **negative value**. + * \retval -RIG_EINVAL The port pathname is empty or no CM108 device detected. + * \retval -RIG_EIO The `open`(2) system call returned a **negative value**. */ int cm108_open(hamlib_port_t *port) { @@ -263,9 +263,9 @@ int cm108_close(hamlib_port_t *port) * occurred (in which case, cause is set appropriately). * * \retval RIG_OK Setting or unsetting the PTT was successful. - * \retval RIG_EINVAL The file descriptor is invalid or the PTT type is + * \retval -RIG_EINVAL The file descriptor is invalid or the PTT type is * unsupported. - * \retval RIG_EIO The `write`(2) system call returned a **negative value**. + * \retval -RIG_EIO The `write`(2) system call returned a **negative value**. */ int cm108_ptt_set(hamlib_port_t *p, ptt_t pttx) { @@ -347,8 +347,8 @@ int cm108_ptt_set(hamlib_port_t *p, ptt_t pttx) * occurred (in which case, cause is set appropriately). * * \retval RIG_OK Getting the PTT state was successful. - * \retval RIG_ENIMPL Getting the state is not yet implemented. - * \retval RIG_ENAVAIL Getting the state is not available for this PTT type. + * \retval -RIG_ENIMPL Getting the state is not yet implemented. + * \retval -RIG_ENAVAIL Getting the state is not available for this PTT type. */ int cm108_ptt_get(hamlib_port_t *p, ptt_t *pttx) { diff --git a/src/event.c b/src/event.c index 10a47ff88..84b4d2649 100644 --- a/src/event.c +++ b/src/event.c @@ -577,7 +577,7 @@ int HAMLIB_API rig_set_spectrum_callback(RIG *rig, spectrum_cb_t cb, * \sa rig_get_trn() * * \deprecated This functionality has never worked correctly and it is now disabled in favor of new async data handling capabilities. - * The command will always return RIG_EDEPRECATED until the command will be removed eventually. + * The command will always return -RIG_EDEPRECATED until the command will be removed eventually. */ int HAMLIB_API rig_set_trn(RIG *rig, int trn) { @@ -601,7 +601,7 @@ int HAMLIB_API rig_set_trn(RIG *rig, int trn) * \sa rig_set_trn() * * \deprecated This functionality has never worked correctly and it is now disabled in favor of new async data handling capabilities. - * The command will always return RIG_EDEPRECATED until the command will be removed eventually. + * The command will always return -RIG_EDEPRECATED until the command will be removed eventually. */ int HAMLIB_API rig_get_trn(RIG *rig, int *trn) { diff --git a/src/extamp.c b/src/extamp.c index 278e308bf..0fda44911 100644 --- a/src/extamp.c +++ b/src/extamp.c @@ -66,7 +66,7 @@ * **negative value** which means an abnormal end, * * \retval RIG_OK All extension levels elements successfully processed. - * \retval RIG_EINVAL \a amp or \a cfunc is NULL or inconsistent. + * \retval -RIG_EINVAL \a amp or \a cfunc is NULL or inconsistent. */ int HAMLIB_API amp_ext_level_foreach(AMP *amp, int (*cfunc)(AMP *, @@ -117,7 +117,7 @@ int HAMLIB_API amp_ext_level_foreach(AMP *amp, * **negative value** which means an abnormal end. * * \retval RIG_OK All extension parameters elements successfully processed. - * \retval RIG_EINVAL \a amp or \a cfunc is NULL or inconsistent. + * \retval -RIG_EINVAL \a amp or \a cfunc is NULL or inconsistent. */ int HAMLIB_API amp_ext_parm_foreach(AMP *amp, int (*cfunc)(AMP *, diff --git a/src/locator.c b/src/locator.c index 0fc9aaa5f..652ca007b 100644 --- a/src/locator.c +++ b/src/locator.c @@ -290,7 +290,7 @@ double HAMLIB_API dmmm2dec(int degrees, double minutes, double seconds, int sw) * value** if an error occurred (in which case, cause is set appropriately). * * \retval RIG_OK The conversion was successful. - * \retval RIG_EINVAL Either of the pointers are NULL. + * \retval -RIG_EINVAL Either of the pointers are NULL. * * \sa dms2dec() */ @@ -388,7 +388,7 @@ int HAMLIB_API dec2dms(double dec, * value** if an error occurred (in which case, cause is set appropriately). * * \retval RIG_OK The conversion was successful. - * \retval RIG_EINVAL Either of the pointers are NULL. + * \retval -RIG_EINVAL Either of the pointers are NULL. * * \sa dmmm2dec() */ @@ -438,7 +438,7 @@ int HAMLIB_API dec2dmmm(double dec, int *degrees, double *minutes, int *sw) * value** if an error occurred (in which case, cause is set appropriately). * * \retval RIG_OK The conversion was successful. - * \retval RIG_EINVAL The QRA locator exceeds RR99xx99xx99 or exceeds length + * \retval -RIG_EINVAL The QRA locator exceeds RR99xx99xx99 or exceeds length * limit--currently 1 to 6 lon/lat pairs--or is otherwise malformed. * * \bug The fifth pair ranges from aa to xx, there is another convention @@ -531,7 +531,7 @@ int HAMLIB_API locator2longlat(double *longitude, * value** if an error occurred (in which case, cause is set appropriately). * * \retval RIG_OK The conversion was successful. - * \retval RIG_EINVAL if \a locator is NULL or \a pair_count exceeds length + * \retval -RIG_EINVAL if \a locator is NULL or \a pair_count exceeds length * limit. Currently 1 to 6 lon/lat pairs. * * \bug \a locator is not tested for overflow. @@ -611,7 +611,7 @@ int HAMLIB_API longlat2locator(double longitude, * value** if an error occurred (in which case, cause is set appropriately). * * \retval RIG_OK The calculations were successful. - * \retval RIG_EINVAL If a NULL pointer passed or \a lat and \a lon values + * \retval -RIG_EINVAL If a NULL pointer passed or \a lat and \a lon values * exceed -90 to 90 or -180 to 180. * * \sa distance_long_path(), azimuth_long_path() diff --git a/src/rig.c b/src/rig.c index 5fff46aae..e479f0c46 100644 --- a/src/rig.c +++ b/src/rig.c @@ -984,8 +984,8 @@ RIG *HAMLIB_API rig_init(rig_model_t rig_model) * a negative value if an error occurred (in which case, cause is * set appropriately). * - * \retval RIG_EINVAL \a rig is NULL or inconsistent. - * \retval RIG_ENIMPL port type communication is not implemented yet. + * \retval -RIG_EINVAL \a rig is NULL or inconsistent. + * \retval -RIG_ENIMPL port type communication is not implemented yet. * * \sa rig_init(), rig_close() */ diff --git a/src/rot_conf.c b/src/rot_conf.c index 6e5cc7ec4..44e2f467e 100644 --- a/src/rot_conf.c +++ b/src/rot_conf.c @@ -133,7 +133,7 @@ static const struct confparams rotfrontend_serial_cfg_params[] = * \return RIG_OK or a **negative value** on error. * * \retval RIG_OK TOK_... value set successfully. - * \retval RIG_EINVAL TOK_.. value not set. + * \retval -RIG_EINVAL TOK_.. value not set. * * \sa frontrot_get_conf() */ @@ -402,7 +402,7 @@ int frontrot_set_conf(ROT *rot, hamlib_token_t token, const char *val) * \return RIG_OK or a **negative value** on error. * * \retval RIG_OK TOK_... value queried successfully. - * \retval RIG_EINVAL TOK_.. value not queried. + * \retval -RIG_EINVAL TOK_.. value not queried. * * \sa frontrot_set_conf() */ @@ -577,7 +577,7 @@ int frontrot_get_conf(ROT *rot, hamlib_token_t token, char *val, int val_len) * value** if an error occurred (in which case, cause is set appropriately). * * \retval RIG_OK The \a cfunc action completed successfully. - * \retval RIG_EINVAL \a rot is NULL or inconsistent or \a cfunc is NULL. + * \retval -RIG_EINVAL \a rot is NULL or inconsistent or \a cfunc is NULL. */ int HAMLIB_API rot_token_foreach(ROT *rot, int (*cfunc)(const struct confparams *, @@ -738,8 +738,8 @@ hamlib_token_t HAMLIB_API rot_token_lookup(ROT *rot, const char *name) * value** if an error occurred (in which case, cause is set appropriately). * * \retval RIG_OK The parameter was set successfully. - * \retval RIG_EINVAL \a rot is NULL or inconsistent or \a token is invalid. - * \retval RIG_ENAVAIL rot_caps#set_conf() capability is not available. + * \retval -RIG_EINVAL \a rot is NULL or inconsistent or \a token is invalid. + * \retval -RIG_ENAVAIL rot_caps#set_conf() capability is not available. * * \sa rot_get_conf() */ @@ -794,8 +794,8 @@ int HAMLIB_API rot_set_conf(ROT *rot, hamlib_token_t token, const char *val) * value** if an error occurred (in which case, cause is set appropriately). * * \retval RIG_OK Querying the parameter was successful. - * \retval RIG_EINVAL \a rot is NULL or inconsistent. - * \retval RIG_ENAVAIL rot_caps#get_conf() capability is not available. + * \retval -RIG_EINVAL \a rot is NULL or inconsistent. + * \retval -RIG_ENAVAIL rot_caps#get_conf() capability is not available. * * \sa rot_set_conf() */ diff --git a/src/rot_ext.c b/src/rot_ext.c index 63915b7ed..c6bbd9538 100644 --- a/src/rot_ext.c +++ b/src/rot_ext.c @@ -87,7 +87,7 @@ static int rot_has_ext_token(ROT *rot, hamlib_token_t token) * value** which means an abnormal end. * * \retval RIG_OK All extension functions elements successfully processed. - * \retval RIG_EINVAL \a rot or \a cfunc is NULL or inconsistent. + * \retval -RIG_EINVAL \a rot or \a cfunc is NULL or inconsistent. */ int HAMLIB_API rot_ext_func_foreach(ROT *rot, int (*cfunc)(ROT *, @@ -143,7 +143,7 @@ int HAMLIB_API rot_ext_func_foreach(ROT *rot, * **negative value** which means an abnormal end. * * \retval RIG_OK All extension levels elements successfully processed. - * \retval RIG_EINVAL \a rot or \a cfunc is NULL or inconsistent. + * \retval -RIG_EINVAL \a rot or \a cfunc is NULL or inconsistent. */ int HAMLIB_API rot_ext_level_foreach(ROT *rot, int (*cfunc)(ROT *, @@ -199,7 +199,7 @@ int HAMLIB_API rot_ext_level_foreach(ROT *rot, * **negative value** which means an abnormal end. * * \retval RIG_OK All extension parameters elements successfully processed. - * \retval RIG_EINVAL \a rot or \a cfunc is NULL or inconsistent. + * \retval -RIG_EINVAL \a rot or \a cfunc is NULL or inconsistent. */ int HAMLIB_API rot_ext_parm_foreach(ROT *rot, int (*cfunc)(ROT *, diff --git a/src/rot_settings.c b/src/rot_settings.c index bee4a8f29..ed366401e 100644 --- a/src/rot_settings.c +++ b/src/rot_settings.c @@ -69,8 +69,8 @@ * value** if an error occurred (in which case, cause is set appropriately). * * \retval RIG_OK Setting the level was successful. - * \retval RIG_EINVAL \a rot is NULL or inconsistent. - * \retval RIG_ENAVAIL rot_caps#set_level() capability is not available. + * \retval -RIG_EINVAL \a rot is NULL or inconsistent. + * \retval -RIG_ENAVAIL rot_caps#set_level() capability is not available. * * \sa rot_has_set_level(), rot_get_level() */ @@ -113,8 +113,8 @@ int HAMLIB_API rot_set_level(ROT *rot, setting_t level, value_t val) * value** if an error occurred (in which case, cause is set appropriately). * * \retval RIG_OK The query was successful. - * \retval RIG_EINVAL \a rot is NULL or inconsistent. - * \retval RIG_ENAVAIL rot_caps#get_level() capability is not available. + * \retval -RIG_EINVAL \a rot is NULL or inconsistent. + * \retval -RIG_ENAVAIL rot_caps#get_level() capability is not available. * * \sa rot_has_get_level(), rot_set_level() */ @@ -158,8 +158,8 @@ int HAMLIB_API rot_get_level(ROT *rot, setting_t level, value_t *val) * value** if an error occurred (in which case, cause is set appropriately). * * \retval RIG_OK The parameter was set successfully. - * \retval RIG_EINVAL \a rot is NULL or inconsistent. - * \retval RIG_ENAVAIL rot_caps#set_parm() capability is not available. + * \retval -RIG_EINVAL \a rot is NULL or inconsistent. + * \retval -RIG_ENAVAIL rot_caps#set_parm() capability is not available. * * \sa rot_has_set_parm(), rot_get_parm() */ @@ -198,8 +198,8 @@ int HAMLIB_API rot_set_parm(ROT *rot, setting_t parm, value_t val) * value** if an error occurred (in which case, cause is set appropriately). * * \retval RIG_OK The parameter was queried successfully. - * \retval RIG_EINVAL \a rot is NULL or inconsistent. - * \retval RIG_ENAVAIL rot_caps#get_parm() capability is not available. + * \retval -RIG_EINVAL \a rot is NULL or inconsistent. + * \retval -RIG_ENAVAIL rot_caps#get_parm() capability is not available. * * \sa rot_has_get_parm(), rot_set_parm() */ @@ -461,8 +461,8 @@ setting_t HAMLIB_API rot_has_set_func(ROT *rot, setting_t func) * value** if an error occurred (in which case, cause is set appropriately). * * \retval RIG_OK The function was activated or deactivated successfully. - * \retval RIG_EINVAL \a rot is NULL or inconsistent. - * \retval RIG_ENAVAIL rot_caps#set_func() capability is not available or + * \retval -RIG_EINVAL \a rot is NULL or inconsistent. + * \retval -RIG_ENAVAIL rot_caps#set_func() capability is not available or * \a func is not supported. * * \sa rot_get_func() @@ -505,8 +505,8 @@ int HAMLIB_API rot_set_func(ROT *rot, setting_t func, int status) * value** if an error occurred (in which case, cause is set appropriately). * * \retval RIG_OK The function status was queried successfully. - * \retval RIG_EINVAL \a rot is NULL or inconsistent. - * \retval RIG_ENAVAIL rot_caps#get_func() capability is not available or + * \retval -RIG_EINVAL \a rot is NULL or inconsistent. + * \retval -RIG_ENAVAIL rot_caps#get_func() capability is not available or * \a func is not supported. * * \sa rot_set_func() @@ -549,8 +549,8 @@ int HAMLIB_API rot_get_func(ROT *rot, setting_t func, int *status) * value** if an error occurred (in which case, cause is set appropriately). * * \retval RIG_OK The extension level was set successfully. - * \retval RIG_EINVAL \a rot is NULL or inconsistent. - * \retval RIG_ENAVAIL rot_caps#set_ext_level() capability is not available. + * \retval -RIG_EINVAL \a rot is NULL or inconsistent. + * \retval -RIG_ENAVAIL rot_caps#set_ext_level() capability is not available. * * \sa rot_get_ext_level() */ @@ -589,8 +589,8 @@ int HAMLIB_API rot_set_ext_level(ROT *rot, hamlib_token_t token, value_t val) * value** if an error occurred (in which case, cause is set appropriately). * * \retval RIG_OK The extension level was queried successfully. - * \retval RIG_EINVAL \a rot is NULL or inconsistent. - * \retval RIG_ENAVAIL rot_caps#get_ext_level() capability is not available. + * \retval -RIG_EINVAL \a rot is NULL or inconsistent. + * \retval -RIG_ENAVAIL rot_caps#get_ext_level() capability is not available. * * \sa rot_set_ext_level() */ @@ -633,8 +633,8 @@ int HAMLIB_API rot_get_ext_level(ROT *rot, hamlib_token_t token, value_t *val) * value** if an error occurred (in which case, cause is set appropriately). * * \retval RIG_OK The extension function status was set successfully. - * \retval RIG_EINVAL \a rot is NULL or inconsistent. - * \retval RIG_ENAVAIL rot_caps#get_ext_func() capability is not available. + * \retval -RIG_EINVAL \a rot is NULL or inconsistent. + * \retval -RIG_ENAVAIL rot_caps#get_ext_func() capability is not available. * * \sa rot_get_ext_func() */ @@ -676,8 +676,8 @@ int HAMLIB_API rot_set_ext_func(ROT *rot, hamlib_token_t token, int status) * value** if an error occurred (in which case, cause is set appropriately). * * \retval RIG_OK The extension function status was queried successfully. - * \retval RIG_EINVAL \a rot is NULL or inconsistent. - * \retval RIG_ENAVAIL rot_caps#get_ext_func() capability is not available or + * \retval -RIG_EINVAL \a rot is NULL or inconsistent. + * \retval -RIG_ENAVAIL rot_caps#get_ext_func() capability is not available or * \a token is not supported. * * \sa rot_set_ext_func() @@ -719,8 +719,8 @@ int HAMLIB_API rot_get_ext_func(ROT *rot, hamlib_token_t token, int *status) * value** if an error occurred (in which case, cause is set appropriately). * * \retval RIG_OK The extension parameter was set successfully. - * \retval RIG_EINVAL \a rot is NULL or inconsistent. - * \retval RIG_ENAVAIL rot_caps#set_ext_parm() capability is not available. + * \retval -RIG_EINVAL \a rot is NULL or inconsistent. + * \retval -RIG_ENAVAIL rot_caps#set_ext_parm() capability is not available. * * \sa rot_get_ext_parm() */ @@ -757,8 +757,8 @@ int HAMLIB_API rot_set_ext_parm(ROT *rot, hamlib_token_t token, value_t val) * value** if an error occurred (in which case, cause is set appropriately). * * \retval RIG_OK The extension parameter was queried successfully. - * \retval RIG_EINVAL \a rot is NULL or inconsistent. - * \retval RIG_ENAVAIL rot_caps#get_ext_parm() capability is not available. + * \retval -RIG_EINVAL \a rot is NULL or inconsistent. + * \retval -RIG_ENAVAIL rot_caps#get_ext_parm() capability is not available. * * \sa rot_set_ext_parm() */ diff --git a/src/rotator.c b/src/rotator.c index f92695d6e..d09606f66 100644 --- a/src/rotator.c +++ b/src/rotator.c @@ -364,8 +364,8 @@ ROT *HAMLIB_API rot_init(rot_model_t rot_model) * value** if an error occurred (in which case, cause is set appropriately). * * \retval RIG_OK Communication channel successfully opened. - * \retval RIG_EINVAL \a rot is NULL or inconsistent. - * \retval RIG_ENIMPL Communication port type is not implemented yet. + * \retval -RIG_EINVAL \a rot is NULL or inconsistent. + * \retval -RIG_ENIMPL Communication port type is not implemented yet. * * \sa rot_init(), rot_close() */ @@ -603,7 +603,7 @@ int HAMLIB_API rot_open(ROT *rot) * value** if an error occurred (in which case, cause is set appropriately). * * \retval RIG_OK Communication channel successfully closed. - * \retval RIG_EINVAL \a rot is NULL or inconsistent. + * \retval -RIG_EINVAL \a rot is NULL or inconsistent. * * \sa rot_cleanup(), rot_open() */ @@ -692,7 +692,7 @@ int HAMLIB_API rot_close(ROT *rot) * value** if an error occurred (in which case, cause is set appropriately). * * \retval RIG_OK #ROT handle successfully released. - * \retval RIG_EINVAL \a rot is NULL or inconsistent. + * \retval -RIG_EINVAL \a rot is NULL or inconsistent. * * \sa rot_init(), rot_close() */ @@ -746,9 +746,9 @@ int HAMLIB_API rot_cleanup(ROT *rot) * value** if an error occurred (in which case, cause is set appropriately). * * \retval RIG_OK Either or both parameters set successfully. - * \retval RIG_EINVAL \a rot is NULL or inconsistent \b or either \a azimuth + * \retval -RIG_EINVAL \a rot is NULL or inconsistent \b or either \a azimuth * or \a elevation is out of range for this rotator. - * \retval RIG_ENAVAIL rot_caps#set_position() capability is not available. + * \retval -RIG_ENAVAIL rot_caps#set_position() capability is not available. * * \sa rot_get_position() */ @@ -819,8 +819,8 @@ int HAMLIB_API rot_set_position(ROT *rot, * value** if an error occurred (in which case, cause is set appropriately). * * \retval RIG_OK Either or both parameters queried and stored successfully. - * \retval RIG_EINVAL \a rot is NULL or inconsistent. - * \retval RIG_ENAVAIL rot_caps#get_position() capability is not available. + * \retval -RIG_EINVAL \a rot is NULL or inconsistent. + * \retval -RIG_ENAVAIL rot_caps#get_position() capability is not available. * * \sa rot_set_position() */ @@ -880,8 +880,8 @@ int HAMLIB_API rot_get_position(ROT *rot, * value** if an error occurred (in which case, cause is set appropriately). * * \retval RIG_OK The rotator was parked successfully. - * \retval RIG_EINVAL \a rot is NULL or inconsistent. - * \retval RIG_ENAVAIL rot_caps#park() capability is not available. + * \retval -RIG_EINVAL \a rot is NULL or inconsistent. + * \retval -RIG_ENAVAIL rot_caps#park() capability is not available. * */ int HAMLIB_API rot_park(ROT *rot) @@ -917,8 +917,8 @@ int HAMLIB_API rot_park(ROT *rot) * value** if an error occurred (in which case, cause is set appropriately). * * \retval RIG_OK The rotator was stopped successfully. - * \retval RIG_EINVAL \a rot is NULL or inconsistent. - * \retval RIG_ENAVAIL rot_caps#stop() capability is not available. + * \retval -RIG_EINVAL \a rot is NULL or inconsistent. + * \retval -RIG_ENAVAIL rot_caps#stop() capability is not available. * * \sa rot_move() */ @@ -956,8 +956,8 @@ int HAMLIB_API rot_stop(ROT *rot) * value** if an error occurred (in which case, cause is set appropriately). * * \retval RIG_OK The rotator was reset successfully. - * \retval RIG_EINVAL \a rot is NULL or inconsistent. - * \retval RIG_ENAVAIL rot_caps#reset() capability is not available. + * \retval -RIG_EINVAL \a rot is NULL or inconsistent. + * \retval -RIG_ENAVAIL rot_caps#reset() capability is not available. */ int HAMLIB_API rot_reset(ROT *rot, rot_reset_t reset) { @@ -995,8 +995,8 @@ int HAMLIB_API rot_reset(ROT *rot, rot_reset_t reset) * The \a speed is a value between 1 and 100 or #ROT_SPEED_NOCHANGE. * * \retval RIG_OK The rotator move was successful. - * \retval RIG_EINVAL \a rot is NULL or inconsistent. - * \retval RIG_ENAVAIL rot_caps#move() capability is not available. + * \retval -RIG_EINVAL \a rot is NULL or inconsistent. + * \retval -RIG_ENAVAIL rot_caps#move() capability is not available. * * \sa rot_stop() */ @@ -1065,8 +1065,8 @@ const char *HAMLIB_API rot_get_info(ROT *rot) * value** if an error occurred (in which case, cause is set appropriately). * * \retval RIG_OK The query was successful. - * \retval RIG_EINVAL \a rot is NULL or inconsistent. - * \retval RIG_ENAVAIL rot_caps#get_status() capability is not available. + * \retval -RIG_EINVAL \a rot is NULL or inconsistent. + * \retval -RIG_ENAVAIL rot_caps#get_status() capability is not available. */ int HAMLIB_API rot_get_status(ROT *rot, rot_status_t *status) { commit 72bde6e13171e1c2425e094413598ec88a8397a0 Author: Daniele Forsi IU5HKX <iu...@gm...> Date: Fri May 30 22:56:37 2025 +0200 Fix sign of error return values All RIG_E* constants should be negated when returned or compared. Change the usages of RIG_IS_SOFT_ERRCODE() for consistency. diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h index 6656c5aeb..8f6326d01 100644 --- a/include/hamlib/rig.h +++ b/include/hamlib/rig.h @@ -222,10 +222,10 @@ enum rig_errcode_e { * Soft errors are caused by invalid parameters and software/hardware features * and cannot be fixed by retries or by re-initializing hardware. */ -#define RIG_IS_SOFT_ERRCODE(errcode) (errcode == RIG_EINVAL || errcode == RIG_ENIMPL || errcode == RIG_ERJCTED \ - || errcode == RIG_ETRUNC || errcode == RIG_ENAVAIL || errcode == RIG_ENTARGET \ - || errcode == RIG_EVFO || errcode == RIG_EDOM || errcode == RIG_EDEPRECATED \ - || errcode == RIG_ESECURITY || errcode == RIG_EPOWER) +#define RIG_IS_SOFT_ERRCODE(errcode) (errcode == -RIG_EINVAL || errcode == -RIG_ENIMPL || errcode == -RIG_ERJCTED \ + || errcode == -RIG_ETRUNC || errcode == -RIG_ENAVAIL || errcode == -RIG_ENTARGET \ + || errcode == -RIG_EVFO || errcode == -RIG_EDOM || errcode == -RIG_EDEPRECATED \ + || errcode == -RIG_ESECURITY || errcode == -RIG_EPOWER) /** * \brief Token in the netrigctl protocol for returning error code diff --git a/tests/rigctl.c b/tests/rigctl.c index a262d32f3..e04ff7e8f 100644 --- a/tests/rigctl.c +++ b/tests/rigctl.c @@ -816,7 +816,7 @@ int main(int argc, char *argv[]) // if we get a hard error we try to reopen the rig again // this should cover short dropouts that can occur - if (retcode < 0 && !RIG_IS_SOFT_ERRCODE(-retcode)) + if (retcode < 0 && !RIG_IS_SOFT_ERRCODE(retcode)) { int retry = 3; rig_debug(RIG_DEBUG_ERR, "%s: i/o error\n", __func__); @@ -833,7 +833,7 @@ int main(int argc, char *argv[]) while (retry-- > 0 && retcode != RIG_OK); } } - while (!ctrl_c && (retcode == RIG_OK || RIG_IS_SOFT_ERRCODE(-retcode))); + while (!ctrl_c && (retcode == RIG_OK || RIG_IS_SOFT_ERRCODE(retcode))); if (interactive && prompt) { diff --git a/tests/rigctld.c b/tests/rigctld.c index 9ffb01a6f..4435c26ca 100644 --- a/tests/rigctld.c +++ b/tests/rigctld.c @@ -1282,7 +1282,7 @@ void *handle_socket(void *arg) // if we get a hard error we try to reopen the rig again // this should cover short dropouts that can occur - if (retcode < 0 && !RIG_IS_SOFT_ERRCODE(-retcode)) + if (retcode < 0 && !RIG_IS_SOFT_ERRCODE(retcode)) { int retry = 3; rig_debug(RIG_DEBUG_ERR, "%s: i/o error\n", __func__); @@ -1312,7 +1312,7 @@ void *handle_socket(void *arg) while (!ctrl_c && !rig_opened && retry-- > 0 && retcode != RIG_OK); } } - while (!ctrl_c && (retcode == RIG_OK || RIG_IS_SOFT_ERRCODE(-retcode))); + while (!ctrl_c && (retcode == RIG_OK || RIG_IS_SOFT_ERRCODE(retcode))); #if defined(HAVE_PTHREAD) diff --git a/tests/rigctltcp.c b/tests/rigctltcp.c index a9eaa9dc7..17d40be6e 100644 --- a/tests/rigctltcp.c +++ b/tests/rigctltcp.c @@ -1283,7 +1283,7 @@ void *handle_socket(void *arg) // if we get a hard error we try to reopen the rig again // this should cover short dropouts that can occur - if (retcode < 0 && !RIG_IS_SOFT_ERRCODE(-retcode)) + if (retcode < 0 && !RIG_IS_SOFT_ERRCODE(retcode)) { int retry = 3; rig_debug(RIG_DEBUG_ERR, "%s: i/o error\n", __func__); @@ -1313,7 +1313,7 @@ void *handle_socket(void *arg) while (!ctrl_c && !rig_opened && retry-- > 0 && retcode != RIG_OK); } } - while (!ctrl_c && (retcode == RIG_OK || RIG_IS_SOFT_ERRCODE(-retcode))); + while (!ctrl_c && (retcode == RIG_OK || RIG_IS_SOFT_ERRCODE(retcode))); client_done: ----------------------------------------------------------------------- Summary of changes: include/hamlib/rig.h | 8 +++---- rigs/adat/adat.c | 6 ++--- rigs/dummy/flrig.c | 14 ++++++------ rigs/dummy/quisk.c | 2 +- rigs/icom/icom.c | 8 +++---- rigs/kenwood/ic10.c | 2 +- rigs/kenwood/k3.c | 2 +- rigs/pcr/pcr.c | 4 ++-- rigs/tentec/orion.c | 2 +- rigs/yaesu/ft757gx.c | 2 +- rotators/grbltrk/grbltrk.c | 8 +++---- rotators/meade/meade.c | 2 +- rotators/skywatcher/skywatcher.c | 6 ++--- src/amp_conf.c | 14 ++++++------ src/amplifier.c | 42 +++++++++++++++++------------------ src/cm108.c | 12 +++++----- src/event.c | 4 ++-- src/extamp.c | 4 ++-- src/locator.c | 10 ++++----- src/rig.c | 6 ++--- src/rot_conf.c | 14 ++++++------ src/rot_ext.c | 6 ++--- src/rot_settings.c | 48 ++++++++++++++++++++-------------------- src/rotator.c | 36 +++++++++++++++--------------- tests/ampctl_parse.c | 4 ++-- tests/rigctl.c | 4 ++-- tests/rigctld.c | 4 ++-- tests/rigctltcp.c | 4 ++-- tests/rigmem.c | 2 +- tests/rigsmtr.c | 2 +- tests/rigswr.c | 2 +- tests/rotctl_parse.c | 2 +- 32 files changed, 143 insertions(+), 143 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |