From 2813f0ef6387962a490b0834bbb97783d6ff8df1 Mon Sep 17 00:00:00 2001 From: Michael Black W9MDB Date: Mon, 11 May 2020 22:39:10 -0500 Subject: [PATCH] astyle files --- rigs/aor/aor.c | 6 +- rigs/aor/ar3030.c | 6 +- rigs/aor/ar7030p.c | 6 +- rigs/icom/ic746.c | 6 +- rigs/icom/ic910.c | 9 +-- rigs/icom/icom.c | 145 +++++++++++++++++++++++++---------------- rigs/icom/icr75.c | 6 +- rigs/kenwood/ic10.c | 6 +- rigs/kenwood/kenwood.c | 7 +- rigs/kenwood/pihpsdr.c | 6 +- rigs/kenwood/th.c | 6 +- rigs/kenwood/thd72.c | 6 +- rigs/kenwood/thd74.c | 6 +- rigs/kenwood/tmd710.c | 6 +- rigs/kenwood/tmv7.c | 6 +- rigs/kenwood/ts2000.c | 6 +- rigs/prm80/prm80.c | 6 +- rigs/uniden/uniden.c | 6 +- rigs/yaesu/ft1000d.c | 6 +- rigs/yaesu/ft990.c | 6 +- rigs/yaesu/ft991.c | 2 +- rigs/yaesu/newcat.c | 6 +- src/rig.c | 8 ++- tests/memcsv.c | 5 +- tests/rigctlcom.c | 3 +- 25 files changed, 186 insertions(+), 101 deletions(-) diff --git a/rigs/aor/aor.c b/rigs/aor/aor.c index 89d17dc74..c9f7b4079 100644 --- a/rigs/aor/aor.c +++ b/rigs/aor/aor.c @@ -1333,8 +1333,10 @@ int aor_get_channel(RIG *rig, channel_t *chan, int read_only) if (!read_only) { // Set rig to channel values - rig_debug(RIG_DEBUG_ERR, "%s: please contact hamlib mailing list to implement this\n", __func__); - rig_debug(RIG_DEBUG_ERR, "%s: need to know if rig updates when channel read or not\n", __func__); + rig_debug(RIG_DEBUG_ERR, + "%s: please contact hamlib mailing list to implement this\n", __func__); + rig_debug(RIG_DEBUG_ERR, + "%s: need to know if rig updates when channel read or not\n", __func__); return -RIG_ENIMPL; } diff --git a/rigs/aor/ar3030.c b/rigs/aor/ar3030.c index d65963d22..4f836e288 100644 --- a/rigs/aor/ar3030.c +++ b/rigs/aor/ar3030.c @@ -808,8 +808,10 @@ int ar3030_get_channel(RIG *rig, channel_t *chan, int read_only) if (!read_only) { // Set rig to channel values - rig_debug(RIG_DEBUG_ERR, "%s: please contact hamlib mailing list to implement this\n", __func__); - rig_debug(RIG_DEBUG_ERR, "%s: need to know if rig updates when channel read or not\n", __func__); + rig_debug(RIG_DEBUG_ERR, + "%s: please contact hamlib mailing list to implement this\n", __func__); + rig_debug(RIG_DEBUG_ERR, + "%s: need to know if rig updates when channel read or not\n", __func__); return -RIG_ENIMPL; } diff --git a/rigs/aor/ar7030p.c b/rigs/aor/ar7030p.c index 5c50ae76b..4e16c58f0 100644 --- a/rigs/aor/ar7030p.c +++ b/rigs/aor/ar7030p.c @@ -1757,8 +1757,10 @@ static int ar7030p_get_channel(RIG *rig, channel_t *chan, int read_only) if (!read_only) { // Set rig to channel values - rig_debug(RIG_DEBUG_ERR, "%s: please contact hamlib mailing list to implement this\n", __func__); - rig_debug(RIG_DEBUG_ERR, "%s: need to know if rig updates when channel read or not\n", __func__); + rig_debug(RIG_DEBUG_ERR, + "%s: please contact hamlib mailing list to implement this\n", __func__); + rig_debug(RIG_DEBUG_ERR, + "%s: need to know if rig updates when channel read or not\n", __func__); return -RIG_ENIMPL; } diff --git a/rigs/icom/ic746.c b/rigs/icom/ic746.c index 434578c3e..63b8b1fe0 100644 --- a/rigs/icom/ic746.c +++ b/rigs/icom/ic746.c @@ -1056,8 +1056,10 @@ int ic746pro_get_channel(RIG *rig, channel_t *chan, int read_only) if (!read_only) { // Set rig to channel values - rig_debug(RIG_DEBUG_ERR, "%s: please contact hamlib mailing list to implement this\n", __func__); - rig_debug(RIG_DEBUG_ERR, "%s: need to know if rig updates when channel read or not\n", __func__); + rig_debug(RIG_DEBUG_ERR, + "%s: please contact hamlib mailing list to implement this\n", __func__); + rig_debug(RIG_DEBUG_ERR, + "%s: need to know if rig updates when channel read or not\n", __func__); return -RIG_ENIMPL; } diff --git a/rigs/icom/ic910.c b/rigs/icom/ic910.c index b5d91ab3b..016a57414 100644 --- a/rigs/icom/ic910.c +++ b/rigs/icom/ic910.c @@ -270,16 +270,17 @@ static int ic910_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) /* start off by reading the current VFO frequency */ if ((retval = icom_get_freq(rig, RIG_VFO_CURR, &origfreq)) != RIG_OK) { return retval; } + vfo_save = rig->state.current_vfo; rig_debug(RIG_DEBUG_TRACE, "%s: vfo=%s\n", __func__, rig_strvfo(vfo)); if (RIG_VFO_A == vfo || RIG_VFO_B == vfo) { /* switch to desired VFO and read its frequency */ - if (vfo_save != vfo) - { - if ((retval = icom_set_vfo(rig, vfo)) != RIG_OK) { return retval; } - } + if (vfo_save != vfo) + { + if ((retval = icom_set_vfo(rig, vfo)) != RIG_OK) { return retval; } + } if ((retval = icom_get_freq(rig, vfo, freq)) != RIG_OK) { return retval; } diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 315906d27..4ad5879b3 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -973,11 +973,12 @@ int icom_set_freq(RIG *rig, vfo_t vfo, freq_t freq) { if (RIG_OK != (retval = icom_vfo_op(rig, vfo, RIG_OP_XCHG))) { - rig_debug(RIG_DEBUG_ERR, "%s: vfo_op XCHG failed: %s\n", __func__, rigerror(retval)); + rig_debug(RIG_DEBUG_ERR, "%s: vfo_op XCHG failed: %s\n", __func__, + rigerror(retval)); return retval; } - // Try the command again + // Try the command again retval = icom_transaction(rig, cmd, subcmd, freqbuf, freq_len, ackbuf, &ack_len); @@ -985,12 +986,16 @@ int icom_set_freq(RIG *rig, vfo_t vfo, freq_t freq) if (retval != RIG_OK) { int retval2; - rig_debug(RIG_DEBUG_ERR, "%s: 2nd set freq failed: %s\n", __func__, rigerror(retval)); + rig_debug(RIG_DEBUG_ERR, "%s: 2nd set freq failed: %s\n", __func__, + rigerror(retval)); + if (RIG_OK != (retval2 = icom_vfo_op(rig, vfo, RIG_OP_XCHG))) { - rig_debug(RIG_DEBUG_ERR, "%s: 2nd vfo_op XCHG failed: %s\n", __func__, rigerror(retval)); + rig_debug(RIG_DEBUG_ERR, "%s: 2nd vfo_op XCHG failed: %s\n", __func__, + rigerror(retval)); return retval2; } + return retval; } } @@ -998,7 +1003,8 @@ int icom_set_freq(RIG *rig, vfo_t vfo, freq_t freq) if (retval != RIG_OK) { - rig_debug(RIG_DEBUG_ERR, "%s: set freq failed: %s\n", __func__, rigerror(retval)); + rig_debug(RIG_DEBUG_ERR, "%s: set freq failed: %s\n", __func__, + rigerror(retval)); return retval; } } @@ -1021,14 +1027,19 @@ int icom_set_freq(RIG *rig, vfo_t vfo, freq_t freq) priv->curr_freq = freq; - switch(vfo) + switch (vfo) { - case RIG_VFO_A: priv->vfoa_freq = freq;break; - case RIG_VFO_B: priv->vfob_freq = freq;break; - case RIG_VFO_MAIN: priv->sub_freq = freq;break; - case RIG_VFO_SUB: priv->main_freq = freq;break; - default: - rig_debug(RIG_DEBUG_ERR,"%s: unknown VFO? VFO=%s\n", __func__, rig_strvfo(vfo)); + case RIG_VFO_A: priv->vfoa_freq = freq; break; + + case RIG_VFO_B: priv->vfob_freq = freq; break; + + case RIG_VFO_MAIN: priv->sub_freq = freq; break; + + case RIG_VFO_SUB: priv->main_freq = freq; break; + + default: + rig_debug(RIG_DEBUG_ERR, "%s: unknown VFO? VFO=%s\n", __func__, + rig_strvfo(vfo)); } return RIG_OK; @@ -1057,16 +1068,21 @@ int icom_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) if (rig->caps->rig_model == RIG_MODEL_IC910) { - ptt_t ptt; - retval = rig_get_ptt(rig,RIG_VFO_CURR,&ptt); - if (retval != RIG_OK) { - return retval; - } - if (ptt) { - rig_debug(RIG_DEBUG_TRACE, "%s: split is on so returning last known freq\n", __func__); - *freq = priv->vfoa_freq; - return RIG_OK; - } + ptt_t ptt; + retval = rig_get_ptt(rig, RIG_VFO_CURR, &ptt); + + if (retval != RIG_OK) + { + return retval; + } + + if (ptt) + { + rig_debug(RIG_DEBUG_TRACE, "%s: split is on so returning last known freq\n", + __func__); + *freq = priv->vfoa_freq; + return RIG_OK; + } } #if 0 // disabled to test if IC9700 satmode/gpredict still works OK @@ -1121,10 +1137,11 @@ int icom_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) } } - if (vfo == RIG_VFO_CURR) + if (vfo == RIG_VFO_CURR) { - vfo = priv->curr_vfo; - rig_debug(RIG_DEBUG_VERBOSE, "%s: CurrVFO changed to %s\n", __func__, rig_strvfo(vfo)); + vfo = priv->curr_vfo; + rig_debug(RIG_DEBUG_VERBOSE, "%s: CurrVFO changed to %s\n", __func__, + rig_strvfo(vfo)); } @@ -1144,13 +1161,16 @@ int icom_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) rig_debug(RIG_DEBUG_TRACE, "%s: VFO_RX requested, new vfo=%s\n", __func__, rig_strvfo(vfo)); } - else if (vfo == RIG_VFO_TX) { - if (rig->state.vfo_list == VFO_HAS_MAIN_SUB_A_B_ONLY) - { - vfo = RIG_VFO_A; - if (priv->split_on) vfo = RIG_VFO_B; - else if (priv->satmode) vfo = RIG_VFO_SUB; - } + else if (vfo == RIG_VFO_TX) + { + if (rig->state.vfo_list == VFO_HAS_MAIN_SUB_A_B_ONLY) + { + vfo = RIG_VFO_A; + + if (priv->split_on) { vfo = RIG_VFO_B; } + else if (priv->satmode) { vfo = RIG_VFO_SUB; } + } + rig_debug(RIG_DEBUG_TRACE, "%s: VFO_TX requested, new vfo=%s\n", __func__, rig_strvfo(vfo)); } @@ -1218,14 +1238,19 @@ int icom_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) if (vfo == RIG_VFO_MEM && civ_731_mode) { priv->civ_731_mode = 1; } - switch(vfo) + switch (vfo) { - case RIG_VFO_A: priv->vfoa_freq = *freq;break; - case RIG_VFO_B: priv->vfob_freq = *freq;break; - case RIG_VFO_MAIN: priv->sub_freq = *freq;break; - case RIG_VFO_SUB: priv->main_freq = *freq;break; - default: - rig_debug(RIG_DEBUG_ERR,"%s: unknown VFO? VFO=%s\n", __func__, rig_strvfo(vfo)); + case RIG_VFO_A: priv->vfoa_freq = *freq; break; + + case RIG_VFO_B: priv->vfob_freq = *freq; break; + + case RIG_VFO_MAIN: priv->sub_freq = *freq; break; + + case RIG_VFO_SUB: priv->main_freq = *freq; break; + + default: + rig_debug(RIG_DEBUG_ERR, "%s: unknown VFO? VFO=%s\n", __func__, + rig_strvfo(vfo)); } return RIG_OK; @@ -1996,7 +2021,8 @@ int icom_set_vfo(RIG *rig, vfo_t vfo) case RIG_VFO_TX: icvfo = priv->split_on ? S_VFOB : S_VFOA; vfo = priv->split_on ? RIG_VFO_B : RIG_VFO_A; - rig_debug(RIG_DEBUG_TRACE,"%s: RIG_VFO_TX changing vfo to %s\n", __func__, rig_strvfo(vfo)); + rig_debug(RIG_DEBUG_TRACE, "%s: RIG_VFO_TX changing vfo to %s\n", __func__, + rig_strvfo(vfo)); break; case RIG_VFO_VFO: @@ -3709,7 +3735,7 @@ int icom_get_split_vfos(const RIG *rig, vfo_t *rx_vfo, vfo_t *tx_vfo) // e.g. IC9700 split on Main/Sub does not work // only Main VFOA/B and SubRx/MainTx split works rig_get_func((RIG *)rig, RIG_VFO_CURR, RIG_FUNC_SATMODE, &satmode); - priv->satmode = satmode; + priv->satmode = satmode; // don't care about retval here...only care about satmode=1 if (satmode) @@ -3790,7 +3816,7 @@ int icom_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq) int satmode = 0; // retval not important here...only satmode=1 means anything rig_get_func(rig, RIG_VFO_CURR, RIG_FUNC_SATMODE, &satmode); - priv->satmode = satmode; + priv->satmode = satmode; rig_debug(RIG_DEBUG_VERBOSE, "%s: satmode=%d\n", __func__, satmode); if (satmode == 0) // only worth trying if not in satmode @@ -3947,19 +3973,25 @@ int icom_get_split_freq(RIG *rig, vfo_t vfo, freq_t *tx_freq) rs = &rig->state; priv = (struct icom_priv_data *) rs->priv; rig_debug(RIG_DEBUG_VERBOSE, "%s: ic910#1\n", __func__); + if (rig->caps->rig_model == RIG_MODEL_IC910) { - ptt_t ptt; - rig_debug(RIG_DEBUG_VERBOSE, "%s: ic910#2\n", __func__); - retval = rig_get_ptt(rig,RIG_VFO_CURR,&ptt); - if (retval != RIG_OK) { - return retval; - } - if (ptt) { - rig_debug(RIG_DEBUG_TRACE, "%s: split is on so returning last known freq\n", __func__); - *tx_freq = priv->vfob_freq; - return RIG_OK; - } + ptt_t ptt; + rig_debug(RIG_DEBUG_VERBOSE, "%s: ic910#2\n", __func__); + retval = rig_get_ptt(rig, RIG_VFO_CURR, &ptt); + + if (retval != RIG_OK) + { + return retval; + } + + if (ptt) + { + rig_debug(RIG_DEBUG_TRACE, "%s: split is on so returning last known freq\n", + __func__); + *tx_freq = priv->vfob_freq; + return RIG_OK; + } } rig_debug(RIG_DEBUG_VERBOSE, "%s curr_vfo=%s\n", __func__, @@ -3979,7 +4011,7 @@ int icom_get_split_freq(RIG *rig, vfo_t vfo, freq_t *tx_freq) int satmode = 0; // don't care about the retval here..only satmode=1 is important rig_get_func(rig, RIG_VFO_CURR, RIG_FUNC_SATMODE, &satmode); - priv->satmode = satmode; + priv->satmode = satmode; rig_debug(RIG_DEBUG_VERBOSE, "%s: satmode=%d\n", __func__, satmode); if (satmode == 0) // only worth trying if not in satmode @@ -4035,7 +4067,9 @@ int icom_get_split_freq(RIG *rig, vfo_t vfo, freq_t *tx_freq) { return retval; } + priv->vfob_freq = *tx_freq; + if (RIG_OK != (retval = icom_vfo_op(rig, vfo, RIG_OP_XCHG))) { return retval; @@ -4637,7 +4671,8 @@ int icom_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo) if (VFO_HAS_A_B && (tx_vfo == RIG_VFO_A || tx_vfo == RIG_VFO_B)) { rig_debug(RIG_DEBUG_TRACE, "%s: vfo clause 2\n", __func__); - rig_debug(RIG_DEBUG_TRACE, "%s: rx_vfo to VFO_A, tx_vfo to VFO_B because tx_vfo=%s\n", __func__, + rig_debug(RIG_DEBUG_TRACE, + "%s: rx_vfo to VFO_A, tx_vfo to VFO_B because tx_vfo=%s\n", __func__, rig_strvfo(tx_vfo)); priv->tx_vfo = RIG_VFO_B; diff --git a/rigs/icom/icr75.c b/rigs/icom/icr75.c index 7ace3afeb..955a7ab5b 100644 --- a/rigs/icom/icr75.c +++ b/rigs/icom/icr75.c @@ -419,8 +419,10 @@ int icr75_get_channel(RIG *rig, channel_t *chan, int read_only) if (!read_only) { // Set rig to channel values - rig_debug(RIG_DEBUG_ERR, "%s: please contact hamlib mailing list to implement this\n", __func__); - rig_debug(RIG_DEBUG_ERR, "%s: need to know if rig updates when channel read or not\n", __func__); + rig_debug(RIG_DEBUG_ERR, + "%s: please contact hamlib mailing list to implement this\n", __func__); + rig_debug(RIG_DEBUG_ERR, + "%s: need to know if rig updates when channel read or not\n", __func__); return -RIG_ENIMPL; } diff --git a/rigs/kenwood/ic10.c b/rigs/kenwood/ic10.c index 25a454edb..e1618184b 100644 --- a/rigs/kenwood/ic10.c +++ b/rigs/kenwood/ic10.c @@ -720,8 +720,10 @@ int ic10_get_channel(RIG *rig, channel_t *chan, int read_only) if (!read_only) { // Set rig to channel values - rig_debug(RIG_DEBUG_ERR, "%s: please contact hamlib mailing list to implement this\n", __func__); - rig_debug(RIG_DEBUG_ERR, "%s: need to know if rig updates when channel read or not\n", __func__); + rig_debug(RIG_DEBUG_ERR, + "%s: please contact hamlib mailing list to implement this\n", __func__); + rig_debug(RIG_DEBUG_ERR, + "%s: need to know if rig updates when channel read or not\n", __func__); return -RIG_ENIMPL; } diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index a94250f32..8a8c7112d 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -717,6 +717,7 @@ int kenwood_open(RIG *rig) rig_debug(RIG_DEBUG_TRACE, "%s: got PS0 so powerup\n", __func__); rig_set_powerstat(rig, 1); } + err = RIG_OK; // reset our err back to OK for later checks } @@ -3921,8 +3922,10 @@ int kenwood_get_channel(RIG *rig, channel_t *chan, int read_only) if (!read_only) { // Set rig to channel values - rig_debug(RIG_DEBUG_ERR, "%s: please contact hamlib mailing list to implement this\n", __func__); - rig_debug(RIG_DEBUG_ERR, "%s: need to know if rig updates when channel read or not\n", __func__); + rig_debug(RIG_DEBUG_ERR, + "%s: please contact hamlib mailing list to implement this\n", __func__); + rig_debug(RIG_DEBUG_ERR, + "%s: need to know if rig updates when channel read or not\n", __func__); return -RIG_ENIMPL; } diff --git a/rigs/kenwood/pihpsdr.c b/rigs/kenwood/pihpsdr.c index eefeea76e..c308301a9 100644 --- a/rigs/kenwood/pihpsdr.c +++ b/rigs/kenwood/pihpsdr.c @@ -569,8 +569,10 @@ int pihspdr_get_channel(RIG *rig, channel_t *chan, int read_only) if (!read_only) { // Set rig to channel values - rig_debug(RIG_DEBUG_ERR, "%s: please contact hamlib mailing list to implement this\n", __func__); - rig_debug(RIG_DEBUG_ERR, "%s: need to know if rig updates when channel read or not\n", __func__); + rig_debug(RIG_DEBUG_ERR, + "%s: please contact hamlib mailing list to implement this\n", __func__); + rig_debug(RIG_DEBUG_ERR, + "%s: need to know if rig updates when channel read or not\n", __func__); return -RIG_ENIMPL; } diff --git a/rigs/kenwood/th.c b/rigs/kenwood/th.c index 875f6445c..a6e6e1ac0 100644 --- a/rigs/kenwood/th.c +++ b/rigs/kenwood/th.c @@ -2229,8 +2229,10 @@ int th_get_channel(RIG *rig, channel_t *chan, int read_only) if (!read_only) { // Set rig to channel values - rig_debug(RIG_DEBUG_ERR, "%s: please contact hamlib mailing list to implement this\n", __func__); - rig_debug(RIG_DEBUG_ERR, "%s: need to know if rig updates when channel read or not\n", __func__); + rig_debug(RIG_DEBUG_ERR, + "%s: please contact hamlib mailing list to implement this\n", __func__); + rig_debug(RIG_DEBUG_ERR, + "%s: need to know if rig updates when channel read or not\n", __func__); return -RIG_ENIMPL; } diff --git a/rigs/kenwood/thd72.c b/rigs/kenwood/thd72.c index 538f1d93a..0385c30ed 100644 --- a/rigs/kenwood/thd72.c +++ b/rigs/kenwood/thd72.c @@ -1410,8 +1410,10 @@ static int thd72_get_channel(RIG *rig, channel_t *chan, int read_only) if (!read_only) { // Set rig to channel values - rig_debug(RIG_DEBUG_ERR, "%s: please contact hamlib mailing list to implement this\n", __func__); - rig_debug(RIG_DEBUG_ERR, "%s: need to know if rig updates when channel read or not\n", __func__); + rig_debug(RIG_DEBUG_ERR, + "%s: please contact hamlib mailing list to implement this\n", __func__); + rig_debug(RIG_DEBUG_ERR, + "%s: need to know if rig updates when channel read or not\n", __func__); return -RIG_ENIMPL; } diff --git a/rigs/kenwood/thd74.c b/rigs/kenwood/thd74.c index 79bf35673..69ecbded9 100644 --- a/rigs/kenwood/thd74.c +++ b/rigs/kenwood/thd74.c @@ -1327,8 +1327,10 @@ static int thd74_get_channel(RIG *rig, channel_t *chan, int read_only) if (!read_only) { // Set rig to channel values - rig_debug(RIG_DEBUG_ERR, "%s: please contact hamlib mailing list to implement this\n", __func__); - rig_debug(RIG_DEBUG_ERR, "%s: need to know if rig updates when channel read or not\n", __func__); + rig_debug(RIG_DEBUG_ERR, + "%s: please contact hamlib mailing list to implement this\n", __func__); + rig_debug(RIG_DEBUG_ERR, + "%s: need to know if rig updates when channel read or not\n", __func__); return -RIG_ENIMPL; } diff --git a/rigs/kenwood/tmd710.c b/rigs/kenwood/tmd710.c index 44d805fcc..c9c6516c8 100644 --- a/rigs/kenwood/tmd710.c +++ b/rigs/kenwood/tmd710.c @@ -1936,8 +1936,10 @@ int tmd710_get_channel(RIG *rig, channel_t *chan, int read_only) if (!read_only) { // Set rig to channel values - rig_debug(RIG_DEBUG_ERR, "%s: please contact hamlib mailing list to implement this\n", __func__); - rig_debug(RIG_DEBUG_ERR, "%s: need to know if rig updates when channel read or not\n", __func__); + rig_debug(RIG_DEBUG_ERR, + "%s: please contact hamlib mailing list to implement this\n", __func__); + rig_debug(RIG_DEBUG_ERR, + "%s: need to know if rig updates when channel read or not\n", __func__); return -RIG_ENIMPL; } diff --git a/rigs/kenwood/tmv7.c b/rigs/kenwood/tmv7.c index 3de10936a..29f58db51 100644 --- a/rigs/kenwood/tmv7.c +++ b/rigs/kenwood/tmv7.c @@ -652,8 +652,10 @@ int tmv7_get_channel(RIG *rig, channel_t *chan, int read_only) if (!read_only) { // Set rig to channel values - rig_debug(RIG_DEBUG_ERR, "%s: please contact hamlib mailing list to implement this\n", __func__); - rig_debug(RIG_DEBUG_ERR, "%s: need to know if rig updates when channel read or not\n", __func__); + rig_debug(RIG_DEBUG_ERR, + "%s: please contact hamlib mailing list to implement this\n", __func__); + rig_debug(RIG_DEBUG_ERR, + "%s: need to know if rig updates when channel read or not\n", __func__); return -RIG_ENIMPL; } diff --git a/rigs/kenwood/ts2000.c b/rigs/kenwood/ts2000.c index d4766df07..1be085de9 100644 --- a/rigs/kenwood/ts2000.c +++ b/rigs/kenwood/ts2000.c @@ -596,8 +596,10 @@ int ts2000_get_channel(RIG *rig, channel_t *chan, int read_only) if (!read_only) { // Set rig to channel values - rig_debug(RIG_DEBUG_ERR, "%s: please contact hamlib mailing list to implement this\n", __func__); - rig_debug(RIG_DEBUG_ERR, "%s: need to know if rig updates when channel read or not\n", __func__); + rig_debug(RIG_DEBUG_ERR, + "%s: please contact hamlib mailing list to implement this\n", __func__); + rig_debug(RIG_DEBUG_ERR, + "%s: need to know if rig updates when channel read or not\n", __func__); return -RIG_ENIMPL; } diff --git a/rigs/prm80/prm80.c b/rigs/prm80/prm80.c index 683da29c3..77a1c31f3 100644 --- a/rigs/prm80/prm80.c +++ b/rigs/prm80/prm80.c @@ -332,8 +332,10 @@ int prm80_get_channel(RIG *rig, channel_t *chan, int read_only) if (!read_only) { // Set rig to channel values - rig_debug(RIG_DEBUG_ERR, "%s: please contact hamlib mailing list to implement this\n", __func__); - rig_debug(RIG_DEBUG_ERR, "%s: need to know if rig updates when channel read or not\n", __func__); + rig_debug(RIG_DEBUG_ERR, + "%s: please contact hamlib mailing list to implement this\n", __func__); + rig_debug(RIG_DEBUG_ERR, + "%s: need to know if rig updates when channel read or not\n", __func__); return -RIG_ENIMPL; } diff --git a/rigs/uniden/uniden.c b/rigs/uniden/uniden.c index 5a30cadb1..3e6b64793 100644 --- a/rigs/uniden/uniden.c +++ b/rigs/uniden/uniden.c @@ -644,8 +644,10 @@ int uniden_get_channel(RIG *rig, channel_t *chan, int read_only) if (!read_only) { // Set rig to channel values - rig_debug(RIG_DEBUG_ERR, "%s: please contact hamlib mailing list to implement this\n", __func__); - rig_debug(RIG_DEBUG_ERR, "%s: need to know if rig updates when channel read or not\n", __func__); + rig_debug(RIG_DEBUG_ERR, + "%s: please contact hamlib mailing list to implement this\n", __func__); + rig_debug(RIG_DEBUG_ERR, + "%s: need to know if rig updates when channel read or not\n", __func__); return -RIG_ENIMPL; } diff --git a/rigs/yaesu/ft1000d.c b/rigs/yaesu/ft1000d.c index ced2a14ef..4621c0c16 100644 --- a/rigs/yaesu/ft1000d.c +++ b/rigs/yaesu/ft1000d.c @@ -3171,8 +3171,10 @@ int ft1000d_get_channel(RIG *rig, channel_t *chan, int read_only) if (!read_only) { // Set rig to channel values - rig_debug(RIG_DEBUG_ERR, "%s: please contact hamlib mailing list to implement this\n", __func__); - rig_debug(RIG_DEBUG_ERR, "%s: need to know if rig updates when channel read or not\n", __func__); + rig_debug(RIG_DEBUG_ERR, + "%s: please contact hamlib mailing list to implement this\n", __func__); + rig_debug(RIG_DEBUG_ERR, + "%s: need to know if rig updates when channel read or not\n", __func__); return -RIG_ENIMPL; } diff --git a/rigs/yaesu/ft990.c b/rigs/yaesu/ft990.c index 0b7968862..bc6949a17 100644 --- a/rigs/yaesu/ft990.c +++ b/rigs/yaesu/ft990.c @@ -3118,8 +3118,10 @@ int ft990_get_channel(RIG *rig, channel_t *chan, int read_only) if (!read_only) { // Set rig to channel values - rig_debug(RIG_DEBUG_ERR, "%s: please contact hamlib mailing list to implement this\n", __func__); - rig_debug(RIG_DEBUG_ERR, "%s: need to know if rig updates when channel read or not\n", __func__); + rig_debug(RIG_DEBUG_ERR, + "%s: please contact hamlib mailing list to implement this\n", __func__); + rig_debug(RIG_DEBUG_ERR, + "%s: need to know if rig updates when channel read or not\n", __func__); return -RIG_ENIMPL; } diff --git a/rigs/yaesu/ft991.c b/rigs/yaesu/ft991.c index be3a9f7be..7949aa27a 100644 --- a/rigs/yaesu/ft991.c +++ b/rigs/yaesu/ft991.c @@ -212,7 +212,7 @@ const struct rig_caps ft991_caps = .set_rptr_shift = newcat_set_rptr_shift, .get_rptr_shift = newcat_get_rptr_shift, .set_rptr_offs = newcat_set_rptr_offs, /*ve9gj */ - .get_rptr_offs = newcat_get_rptr_offs, /*ve9gj */ + .get_rptr_offs = newcat_get_rptr_offs, /*ve9gj */ .set_ctcss_tone = newcat_set_ctcss_tone, .get_ctcss_tone = newcat_get_ctcss_tone, .set_ctcss_sql = newcat_set_ctcss_sql, diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index ba0ad3a3f..e87cc8279 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -1262,6 +1262,7 @@ int newcat_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t offs) freq_t freq; rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + if (newcat_is_rig(rig, RIG_MODEL_FT991)) { freq = 0; @@ -1294,9 +1295,11 @@ int newcat_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t offs) return RIG_OK; } - snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%04li%c", command, offs, cat_term); + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%04li%c", command, offs, + cat_term); return newcat_set_cmd(rig); } + return -RIG_ENAVAIL; } @@ -1360,6 +1363,7 @@ int newcat_get_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t *offs) { return -RIG_ENAVAIL; } + return RIG_OK; } diff --git a/src/rig.c b/src/rig.c index c3499f925..0076f4ff5 100644 --- a/src/rig.c +++ b/src/rig.c @@ -1191,6 +1191,7 @@ static int twiddling(RIG *rig) return 1; // would be better as error but other software won't handle it } } + return 0; // } @@ -1364,7 +1365,9 @@ int HAMLIB_API rig_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) || vfo == RIG_VFO_CURR || vfo == rig->state.current_vfo) { retcode = caps->get_freq(rig, vfo, freq); - if (retcode == RIG_OK) { + + if (retcode == RIG_OK) + { rig->state.cache.freq = *freq; rig->state.cache.vfo_freq = vfo; } @@ -1820,7 +1823,8 @@ int HAMLIB_API rig_set_vfo(RIG *rig, vfo_t vfo) } else { - rig_debug(RIG_DEBUG_ERR, "%s: set_vfo %s failed with '%s'\n", __func__, rig_strvfo(vfo), rigerror(retcode)); + rig_debug(RIG_DEBUG_ERR, "%s: set_vfo %s failed with '%s'\n", __func__, + rig_strvfo(vfo), rigerror(retcode)); } // we need to update our internal freq to avoid getting detected as twiddling diff --git a/tests/memcsv.c b/tests/memcsv.c index 907a5d07e..fe14ddd1d 100644 --- a/tests/memcsv.c +++ b/tests/memcsv.c @@ -761,9 +761,12 @@ int set_channel_data(RIG *rig, break; } } - if (j == CHANLSTSIZ) { + + if (j == CHANLSTSIZ) + { return -RIG_EINVAL; } + printf("Requested channel number %d, list number %d\n", n, j); mem_caps = &rig->state.chan_list[j].mem_caps; diff --git a/tests/rigctlcom.c b/tests/rigctlcom.c index 23a696985..928ab2d64 100644 --- a/tests/rigctlcom.c +++ b/tests/rigctlcom.c @@ -736,7 +736,8 @@ static int handle_ts2000(void *arg) int retval = rig_get_freq(my_rig, RIG_VFO_A, &freq); char response[64]; // cppcheck-suppress * - char *fmt = "IF%011"PRIll"%04d+%05d%1d%1d%1d%02d%1d%1"PRIll"%1d%1d%1d%1d%02d%1d;"; + char *fmt = + "IF%011"PRIll"%04d+%05d%1d%1d%1d%02d%1d%1"PRIll"%1d%1d%1d%1d%02d%1d;"; if (retval != RIG_OK) {