hamlib-cvs-digest Mailing List for Ham Radio Control Libraries (Page 21)
Library to control radio transceivers and receivers
Brought to you by:
n0nb
You can subscribe to this list here.
2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(57) |
Nov
(27) |
Dec
(25) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(41) |
Feb
(101) |
Mar
(60) |
Apr
(32) |
May
(32) |
Jun
(198) |
Jul
(95) |
Aug
(60) |
Sep
(48) |
Oct
(96) |
Nov
(27) |
Dec
(222) |
2002 |
Jan
(180) |
Feb
(46) |
Mar
(68) |
Apr
(11) |
May
(36) |
Jun
(34) |
Jul
(113) |
Aug
(42) |
Sep
(71) |
Oct
(65) |
Nov
(116) |
Dec
(40) |
2003 |
Jan
(32) |
Feb
(92) |
Mar
(29) |
Apr
(102) |
May
(21) |
Jun
(34) |
Jul
(3) |
Aug
(60) |
Sep
(30) |
Oct
(62) |
Nov
(57) |
Dec
(33) |
2004 |
Jan
(28) |
Feb
(46) |
Mar
(16) |
Apr
(14) |
May
(31) |
Jun
(21) |
Jul
(10) |
Aug
(80) |
Sep
(42) |
Oct
(11) |
Nov
(28) |
Dec
(13) |
2005 |
Jan
(35) |
Feb
(26) |
Mar
(20) |
Apr
(118) |
May
(2) |
Jun
(5) |
Jul
|
Aug
|
Sep
(5) |
Oct
(1) |
Nov
(13) |
Dec
(1) |
2006 |
Jan
(9) |
Feb
(25) |
Mar
(22) |
Apr
(6) |
May
|
Jun
|
Jul
(2) |
Aug
(1) |
Sep
(3) |
Oct
(46) |
Nov
(13) |
Dec
(7) |
2007 |
Jan
(9) |
Feb
(14) |
Mar
(3) |
Apr
|
May
(6) |
Jun
(1) |
Jul
|
Aug
(11) |
Sep
(7) |
Oct
(8) |
Nov
(41) |
Dec
(3) |
2008 |
Jan
(27) |
Feb
(16) |
Mar
(13) |
Apr
(23) |
May
(39) |
Jun
(4) |
Jul
(7) |
Aug
(1) |
Sep
(13) |
Oct
(52) |
Nov
(44) |
Dec
(55) |
2009 |
Jan
(72) |
Feb
(69) |
Mar
|
Apr
|
May
|
Jun
(13) |
Jul
(1) |
Aug
(6) |
Sep
(15) |
Oct
(11) |
Nov
(31) |
Dec
(20) |
2010 |
Jan
(24) |
Feb
(21) |
Mar
(22) |
Apr
(40) |
May
(38) |
Jun
(4) |
Jul
(2) |
Aug
(22) |
Sep
(19) |
Oct
(14) |
Nov
(5) |
Dec
(8) |
2011 |
Jan
(14) |
Feb
(36) |
Mar
(6) |
Apr
|
May
|
Jun
(23) |
Jul
(13) |
Aug
(8) |
Sep
(7) |
Oct
|
Nov
(3) |
Dec
(9) |
2012 |
Jan
(17) |
Feb
(13) |
Mar
(10) |
Apr
|
May
(1) |
Jun
(14) |
Jul
(4) |
Aug
(12) |
Sep
(2) |
Oct
(24) |
Nov
(14) |
Dec
(2) |
2013 |
Jan
(4) |
Feb
(3) |
Mar
(3) |
Apr
(3) |
May
(10) |
Jun
(4) |
Jul
(7) |
Aug
|
Sep
(15) |
Oct
(5) |
Nov
(1) |
Dec
(2) |
2014 |
Jan
|
Feb
(8) |
Mar
(1) |
Apr
(3) |
May
(1) |
Jun
|
Jul
|
Aug
(1) |
Sep
(3) |
Oct
(7) |
Nov
(6) |
Dec
(3) |
2015 |
Jan
(4) |
Feb
(5) |
Mar
(8) |
Apr
(8) |
May
(2) |
Jun
|
Jul
(4) |
Aug
(7) |
Sep
(8) |
Oct
|
Nov
(6) |
Dec
(4) |
2016 |
Jan
(6) |
Feb
(26) |
Mar
(3) |
Apr
(10) |
May
(6) |
Jun
(5) |
Jul
(1) |
Aug
(4) |
Sep
(3) |
Oct
(4) |
Nov
(3) |
Dec
(10) |
2017 |
Jan
(11) |
Feb
(11) |
Mar
(2) |
Apr
(1) |
May
(7) |
Jun
(2) |
Jul
(11) |
Aug
(9) |
Sep
(5) |
Oct
(5) |
Nov
(1) |
Dec
(2) |
2018 |
Jan
(5) |
Feb
(2) |
Mar
(19) |
Apr
(7) |
May
(11) |
Jun
(3) |
Jul
(4) |
Aug
(10) |
Sep
(2) |
Oct
(8) |
Nov
(6) |
Dec
(9) |
2019 |
Jan
(9) |
Feb
(6) |
Mar
(2) |
Apr
(4) |
May
(6) |
Jun
(9) |
Jul
(6) |
Aug
(3) |
Sep
(5) |
Oct
(2) |
Nov
(8) |
Dec
(9) |
2020 |
Jan
(15) |
Feb
(1) |
Mar
(18) |
Apr
(33) |
May
(43) |
Jun
(87) |
Jul
(45) |
Aug
(8) |
Sep
(43) |
Oct
(3) |
Nov
(5) |
Dec
(42) |
2021 |
Jan
(116) |
Feb
(40) |
Mar
(58) |
Apr
(48) |
May
(29) |
Jun
(2) |
Jul
|
Aug
(22) |
Sep
(18) |
Oct
(1) |
Nov
|
Dec
(3) |
2022 |
Jan
(1) |
Feb
(1) |
Mar
|
Apr
(1) |
May
(2) |
Jun
(1) |
Jul
|
Aug
(1) |
Sep
|
Oct
(6) |
Nov
(2) |
Dec
(9) |
2023 |
Jan
(10) |
Feb
|
Mar
|
Apr
(10) |
May
(3) |
Jun
(1) |
Jul
(2) |
Aug
(4) |
Sep
(1) |
Oct
|
Nov
(2) |
Dec
(3) |
2024 |
Jan
(4) |
Feb
(1) |
Mar
(2) |
Apr
(2) |
May
(5) |
Jun
(3) |
Jul
(1) |
Aug
(2) |
Sep
|
Oct
(2) |
Nov
(3) |
Dec
(9) |
2025 |
Jan
(5) |
Feb
(5) |
Mar
|
Apr
(10) |
May
(20) |
Jun
(43) |
Jul
(24) |
Aug
(20) |
Sep
|
Oct
|
Nov
|
Dec
|
From: Michael B. <mdb...@us...> - 2021-01-17 17:34:03
|
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 6e25cdd6b9b6e09b8649231757bc8ad129725192 (commit) via 65970cab0e4ed52108548cb32aa9b11def785ed1 (commit) from a0ee23b178f4a33dd35d67669f56ede32c9d8a58 (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 6e25cdd6b9b6e09b8649231757bc8ad129725192 Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Jan 17 11:33:36 2021 -0600 Update debug in newcat.c diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index b876746f..d8607a5b 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -560,7 +560,7 @@ int newcat_open(RIG *rig) if (RIG_OK != (err = newcat_set_cmd(rig))) { - return err; + RETURNFUNC(err); } } @@ -730,7 +730,7 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) if (err < 0) { ERRMSG(err, "newcat_set_vfo_from_alias"); - return err; + RETURNFUNC(err); } /* vfo should now be modified to a valid VFO constant. */ @@ -764,7 +764,7 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) break; default: - return -RIG_ENIMPL; /* Only VFO_A or VFO_B are valid */ + RETURNFUNC(-RIG_ENIMPL); /* Only VFO_A or VFO_B are valid */ } target_vfo = 'A' == c ? '0' : '1'; @@ -780,7 +780,7 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) if (RIG_OK != (err = newcat_get_cmd(rig))) { ERRMSG(err, "newcat_get_cmd"); - return err; + RETURNFUNC(err); } if (priv->ret_data[2] != target_vfo) @@ -791,7 +791,7 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) if (RIG_OK != (err = newcat_set_cmd(rig))) { ERRMSG(err, "newcat_set_cmd failed"); - return err; + RETURNFUNC(err); } } } @@ -877,7 +877,7 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) freq_t freqtmp; err = rig_get_vfo(rig, &vfotmp); - if (err != RIG_OK) { return err; } + if (err != RIG_OK) { RETURNFUNC(err); } if (rig->state.vfo_list & RIG_VFO_MAIN) { @@ -888,11 +888,11 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) err = rig_set_vfo(rig, vfotmp == RIG_VFO_A ? RIG_VFO_B : RIG_VFO_A); } - if (err != RIG_OK) { return err; } + if (err != RIG_OK) { RETURNFUNC(err); } rig_get_freq(rig, RIG_VFO_CURR, &freqtmp); - if (err != RIG_OK) { return err; } + if (err != RIG_OK) { RETURNFUNC(err); } // Cross band should work too // If the BS works on both VFOs then VFOB will have the band select answer @@ -926,7 +926,7 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) { rig_debug(RIG_DEBUG_ERR, "%s: rig_set_vfo failed: %s\n", __func__, rigerror(err)); - return err; + RETURNFUNC(err); } // after band select re-read things -- may not have to change anything @@ -961,7 +961,7 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) { rig_debug(RIG_DEBUG_VERBOSE, "%s:%d command err = %d\n", __func__, __LINE__, err); - return err; + RETURNFUNC(err); } rig_debug(RIG_DEBUG_TRACE, "%s: band changing? old=%d, new=%d\n", __func__, @@ -977,7 +977,7 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) { rig_debug(RIG_DEBUG_VERBOSE, "%s:%d command err = %d\n", __func__, __LINE__, err); - return err; + RETURNFUNC(err); } } @@ -1017,7 +1017,7 @@ int newcat_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) if (err < 0) { - return err; + RETURNFUNC(err); } switch (vfo) @@ -1056,7 +1056,7 @@ int newcat_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) /* get freq */ if (RIG_OK != (err = newcat_get_cmd(rig))) { - return err; + RETURNFUNC(err); } /* convert the read frequency string into freq_t and store in *freq */ @@ -1089,7 +1089,7 @@ int newcat_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) if (err < 0) { - return err; + RETURNFUNC(err); } snprintf(priv->cmd_str, sizeof(priv->cmd_str), "MD0x%c", cat_term); @@ -1116,10 +1116,10 @@ int newcat_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) if (err != RIG_OK) { - return err; + RETURNFUNC(err); } - if (RIG_PASSBAND_NOCHANGE == width) { return err; } + if (RIG_PASSBAND_NOCHANGE == width) { RETURNFUNC(err); } if (RIG_PASSBAND_NORMAL == width) { @@ -1145,7 +1145,7 @@ int newcat_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) } } - return err; + RETURNFUNC(err); } @@ -1167,7 +1167,7 @@ int newcat_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) if (err < 0) { - return err; + RETURNFUNC(err); } if (rig->caps->targetable_vfo & RIG_TARGETABLE_MODE) @@ -1184,7 +1184,7 @@ int newcat_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) /* Get MODE */ if (RIG_OK != (err = newcat_get_cmd(rig))) { - return err; + RETURNFUNC(err); } /* @@ -1201,7 +1201,7 @@ int newcat_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) if (*mode == '0') { rig_debug(RIG_DEBUG_ERR, "%s: *mode = '0'??\n", __func__); - return -RIG_EPROTO; + RETURNFUNC(-RIG_EPROTO); } if (RIG_PASSBAND_NORMAL == *width) @@ -1210,7 +1210,7 @@ int newcat_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) } rig_debug(RIG_DEBUG_TRACE, "%s: returning newcat_get_rx_bandwidth\n", __func__); - return newcat_get_rx_bandwidth(rig, vfo, *mode, width); + RETURNFUNC(newcat_get_rx_bandwidth(rig, vfo, *mode, width)); } /* @@ -1249,7 +1249,7 @@ int newcat_set_vfo(RIG *rig, vfo_t vfo) if (err < 0) { - return err; + RETURNFUNC(err); } switch (vfo) @@ -1271,7 +1271,7 @@ int newcat_set_vfo(RIG *rig, vfo_t vfo) if (err != RIG_OK) { - return err; + RETURNFUNC(err); } if (vfo_mode == RIG_VFO_MEM) @@ -1279,7 +1279,7 @@ int newcat_set_vfo(RIG *rig, vfo_t vfo) priv->current_mem = NC_MEM_CHANNEL_NONE; state->current_vfo = RIG_VFO_A; err = newcat_vfomem_toggle(rig); - return err; + RETURNFUNC(err); } break; @@ -1290,7 +1290,7 @@ int newcat_set_vfo(RIG *rig, vfo_t vfo) /* Only works correctly for VFO A */ if (state->current_vfo != RIG_VFO_A && state->current_vfo != RIG_VFO_MAIN) { - return -RIG_ENTARGET; + RETURNFUNC(-RIG_ENTARGET); } /* get current memory channel */ @@ -1298,7 +1298,7 @@ int newcat_set_vfo(RIG *rig, vfo_t vfo) if (err != RIG_OK) { - return err; + RETURNFUNC(err); } /* turn on memory channel */ @@ -1306,7 +1306,7 @@ int newcat_set_vfo(RIG *rig, vfo_t vfo) if (err != RIG_OK) { - return err; + RETURNFUNC(err); } /* Set current_mem now */ @@ -1318,7 +1318,7 @@ int newcat_set_vfo(RIG *rig, vfo_t vfo) RETURNFUNC(RIG_OK); default: - return -RIG_ENIMPL; /* sorry, VFO not implemented */ + RETURNFUNC(-RIG_ENIMPL); /* sorry, VFO not implemented */ } /* Build the command string */ @@ -1330,7 +1330,7 @@ int newcat_set_vfo(RIG *rig, vfo_t vfo) if (err != RIG_OK) { - return err; + RETURNFUNC(err); } state->current_vfo = vfo; /* if set_vfo worked, set current_vfo */ @@ -1363,7 +1363,7 @@ static vfo_t newcat_set_vfo_if_needed(RIG *rig, vfo_t vfo) } } - return oldvfo; + RETURNFUNC(oldvfo); } /* @@ -1402,7 +1402,7 @@ int newcat_get_vfo(RIG *rig, vfo_t *vfo) /* Get VFO */ if (RIG_OK != (err = newcat_get_cmd(rig))) { - return err; + RETURNFUNC(err); } /* @@ -1424,7 +1424,7 @@ int newcat_get_vfo(RIG *rig, vfo_t *vfo) break; default: - return -RIG_EPROTO; /* sorry, wrong current VFO */ + RETURNFUNC(-RIG_EPROTO); /* sorry, wrong current VFO */ } /* Check to see if RIG is in MEM mode */ @@ -1432,7 +1432,7 @@ int newcat_get_vfo(RIG *rig, vfo_t *vfo) if (err != RIG_OK) { - return err; + RETURNFUNC(err); } if (vfo_mode == RIG_VFO_MEM) @@ -1492,7 +1492,7 @@ int newcat_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) RETURNFUNC(-RIG_EINVAL); } - return err; + RETURNFUNC(err); } @@ -1516,7 +1516,7 @@ int newcat_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt) /* Get PTT */ if (RIG_OK != (err = newcat_get_cmd(rig))) { - return err; + RETURNFUNC(err); } c = priv->ret_data[2]; @@ -1534,7 +1534,7 @@ int newcat_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt) break; default: - return -RIG_EPROTO; + RETURNFUNC(-RIG_EPROTO); } RETURNFUNC(RIG_OK); @@ -1569,7 +1569,7 @@ int newcat_set_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t rptr_shift) if (err < 0) { - return err; + RETURNFUNC(err); } if (rig->caps->targetable_vfo & RIG_TARGETABLE_MODE) @@ -1598,7 +1598,7 @@ int newcat_set_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t rptr_shift) snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%c%c%c", command, main_sub_vfo, c, cat_term); - return newcat_set_cmd(rig); + RETURNFUNC(newcat_set_cmd(rig)); } @@ -1622,7 +1622,7 @@ int newcat_get_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t *rptr_shift) if (err < 0) { - return err; + RETURNFUNC(err); } if (rig->caps->targetable_vfo & RIG_TARGETABLE_MODE) @@ -1636,7 +1636,7 @@ int newcat_get_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t *rptr_shift) /* Get Rptr Shift */ if (RIG_OK != (err = newcat_get_cmd(rig))) { - return err; + RETURNFUNC(err); } c = priv->ret_data[3]; @@ -1676,7 +1676,7 @@ int newcat_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t offs) if (err < 0) { - return err; + RETURNFUNC(err); } if (is_ft450) @@ -1882,7 +1882,7 @@ int newcat_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t offs) RETURNFUNC(-RIG_ENAVAIL); } - return newcat_set_cmd(rig); + RETURNFUNC(newcat_set_cmd(rig)); } @@ -1901,7 +1901,7 @@ int newcat_get_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t *offs) if (err < 0) { - return err; + RETURNFUNC(err); } if (is_ft450) @@ -2096,7 +2096,7 @@ int newcat_get_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t *offs) if (err != RIG_OK) { - return err; + RETURNFUNC(err); } ret_data_len = strlen(priv->ret_data); @@ -2157,7 +2157,7 @@ int newcat_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo) if (err < 0) { - return err; + RETURNFUNC(err); } if (is_ft991) @@ -2176,7 +2176,7 @@ int newcat_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo) if (err != RIG_OK) { - return err; + RETURNFUNC(err); } } @@ -2187,7 +2187,7 @@ int newcat_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo) if (err != RIG_OK) { - return err; + RETURNFUNC(err); } if (rx_vfo != vfo && newcat_valid_command(rig, "VS")) @@ -2196,7 +2196,7 @@ int newcat_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo) if (err != RIG_OK) { - return err; + RETURNFUNC(err); } } @@ -2207,7 +2207,7 @@ int newcat_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo) if (err != RIG_OK) { - return err; + RETURNFUNC(err); } if (rx_vfo != vfo) @@ -2216,7 +2216,7 @@ int newcat_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo) if (err != RIG_OK && err != -RIG_ENAVAIL) { - return err; + RETURNFUNC(err); } } @@ -2240,14 +2240,14 @@ int newcat_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo) if (err != RIG_OK) { - return err; + RETURNFUNC(err); } err = newcat_get_tx_vfo(rig, tx_vfo); if (err != RIG_OK) { - return err; + RETURNFUNC(err); } // we assume split is always on VFO_B @@ -2348,7 +2348,7 @@ int newcat_get_rit(RIG *rig, vfo_t vfo, shortfreq_t *rit) /* Get RIT */ if (RIG_OK != (err = newcat_get_cmd(rig))) { - return err; + RETURNFUNC(err); } // e.g. FT450 has 27 byte IF response, FT991 has 28 byte if response (one more byte for P2 VFO A Freq) @@ -2368,7 +2368,7 @@ int newcat_get_rit(RIG *rig, vfo_t vfo, shortfreq_t *rit) rig_debug(RIG_DEBUG_ERR, "%s: incorrect length of IF response, expected 27 or 28, got %du", __func__, (int)strlen(priv->ret_data)); - return -RIG_EPROTO; + RETURNFUNC(-RIG_EPROTO); } retval = priv->ret_data + offset; @@ -2463,7 +2463,7 @@ int newcat_get_xit(RIG *rig, vfo_t vfo, shortfreq_t *xit) /* Get XIT */ if (RIG_OK != (err = newcat_get_cmd(rig))) { - return err; + RETURNFUNC(err); } // e.g. FT450 has 27 byte IF response, FT991 has 28 byte if response (one more byte for P2 VFO A Freq) @@ -2483,7 +2483,7 @@ int newcat_get_xit(RIG *rig, vfo_t vfo, shortfreq_t *xit) rig_debug(RIG_DEBUG_ERR, "%s: incorrect length of IF response, expected 27 or 28, got %du", __func__, (int)strlen(priv->ret_data)); - return -RIG_EPROTO; + RETURNFUNC(-RIG_EPROTO); } retval = priv->ret_data + offset; @@ -2509,7 +2509,7 @@ int newcat_set_ts(RIG *rig, vfo_t vfo, shortfreq_t ts) if (err < 0) { - return err; + RETURNFUNC(err); } /* assume 2 tuning steps per mode */ @@ -2528,7 +2528,7 @@ int newcat_set_ts(RIG *rig, vfo_t vfo, shortfreq_t ts) if (err != RIG_OK) { - return err; + RETURNFUNC(err); } ts_match = TRUE; @@ -2564,14 +2564,14 @@ int newcat_get_ts(RIG *rig, vfo_t vfo, shortfreq_t *ts) if (err < 0) { - return err; + RETURNFUNC(err); } err = newcat_get_faststep(rig, &fast_step); if (err < 0) { - return err; + RETURNFUNC(err); } /* assume 2 tuning steps per mode */ @@ -2662,7 +2662,7 @@ int newcat_set_ctcss_tone(RIG *rig, vfo_t vfo, tone_t tone) if (err < 0) { - return err; + RETURNFUNC(err); } if (rig->caps->targetable_vfo & RIG_TARGETABLE_MODE) @@ -2704,7 +2704,7 @@ int newcat_set_ctcss_tone(RIG *rig, vfo_t vfo, tone_t tone) } } - return newcat_set_cmd(rig); + RETURNFUNC(newcat_set_cmd(rig)); } @@ -2729,7 +2729,7 @@ int newcat_get_ctcss_tone(RIG *rig, vfo_t vfo, tone_t *tone) if (err < 0) { - return err; + RETURNFUNC(err); } if (rig->caps->targetable_vfo & RIG_TARGETABLE_MODE) @@ -2751,7 +2751,7 @@ int newcat_get_ctcss_tone(RIG *rig, vfo_t vfo, tone_t *tone) /* Get CTCSS TONE */ if (RIG_OK != (err = newcat_get_cmd(rig))) { - return err; + RETURNFUNC(err); } ret_data_len = strlen(priv->ret_data); @@ -2816,7 +2816,7 @@ int newcat_set_ctcss_sql(RIG *rig, vfo_t vfo, tone_t tone) if (err != RIG_OK) { - return err; + RETURNFUNC(err); } /* Change to sql */ @@ -2826,7 +2826,7 @@ int newcat_set_ctcss_sql(RIG *rig, vfo_t vfo, tone_t tone) if (err != RIG_OK) { - return err; + RETURNFUNC(err); } } @@ -2842,7 +2842,7 @@ int newcat_get_ctcss_sql(RIG *rig, vfo_t vfo, tone_t *tone) err = newcat_get_ctcss_tone(rig, vfo, tone); - return err; + RETURNFUNC(err); } @@ -3117,7 +3117,7 @@ int newcat_get_powerstat(RIG *rig, powerstat_t *status) /* Get Power status */ if (RIG_OK != (err = newcat_get_cmd(rig))) { - return err; + RETURNFUNC(err); } ps = priv->ret_data[2]; @@ -3168,7 +3168,7 @@ int newcat_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option) if (err < 0) { - return err; + RETURNFUNC(err); } if ((rig->caps->targetable_vfo & RIG_TARGETABLE_ANT)) @@ -3235,7 +3235,7 @@ int newcat_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option) snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%c%c%c", command, main_sub_vfo, which_ant, cat_term); - return newcat_set_cmd(rig); + RETURNFUNC(newcat_set_cmd(rig)); } @@ -3260,7 +3260,7 @@ int newcat_get_ant(RIG *rig, vfo_t vfo, ant_t dummy, value_t *option, if (err < 0) { - return err; + RETURNFUNC(err); } if ((rig->caps->targetable_vfo & RIG_TARGETABLE_MODE) && !is_ft2000) @@ -3274,7 +3274,7 @@ int newcat_get_ant(RIG *rig, vfo_t vfo, ant_t dummy, value_t *option, /* Get ANT */ if (RIG_OK != (err = newcat_get_cmd(rig))) { - return err; + RETURNFUNC(err); } c = priv->ret_data[3]; @@ -3303,7 +3303,7 @@ int newcat_get_ant(RIG *rig, vfo_t vfo, ant_t dummy, value_t *option, default: *ant_curr = RIG_ANT_UNKNOWN; - return -RIG_EPROTO; + RETURNFUNC(-RIG_EPROTO); } RETURNFUNC(RIG_OK); @@ -3328,7 +3328,7 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) if (err < 0) { - return err; + RETURNFUNC(err); } if (rig->caps->targetable_vfo & RIG_TARGETABLE_LEVEL) @@ -3810,7 +3810,7 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) if (err != RIG_OK) { - return err; + RETURNFUNC(err); } millis = dot10ths_to_millis(val.i, keyspd.i); @@ -4129,7 +4129,7 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) // Clear flag after executing command priv->question_mark_response_means_rejected = 0; - return err; + RETURNFUNC(err); } @@ -4152,7 +4152,7 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) if (err < 0) { - return err; + RETURNFUNC(err); } if (rig->caps->targetable_vfo & RIG_TARGETABLE_LEVEL) @@ -4550,7 +4550,7 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) if (err != RIG_OK) { - return err; + RETURNFUNC(err); } ret_data_len = strlen(priv->ret_data); @@ -4817,7 +4817,7 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) if (err != RIG_OK) { - return err; + RETURNFUNC(err); } val->i = millis_to_dot10ths(millis, keyspd.i); @@ -4929,7 +4929,7 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) if (retlvl[0] < '0' || retlvl[0] > '9') { - return -RIG_EPROTO; + RETURNFUNC(-RIG_EPROTO); } preamp = retlvl[0] - '0'; @@ -4957,7 +4957,7 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) if (retlvl[0] < '0' || retlvl[0] > '9') { - return -RIG_EPROTO; + RETURNFUNC(-RIG_EPROTO); } att = retlvl[0] - '0'; @@ -5004,7 +5004,7 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) val->i = RIG_AGC_AUTO; break; default: - return -RIG_EPROTO; + RETURNFUNC(-RIG_EPROTO); } break; @@ -5037,7 +5037,7 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) case '5': val->i = RIG_METER_VDD; break; /* Final Amp Voltage */ - default: return -RIG_EPROTO; + default: RETURNFUNC(-RIG_EPROTO); } break; @@ -5080,7 +5080,7 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) if (err < 0) { - return err; + RETURNFUNC(err); } if (rig->caps->targetable_vfo & (RIG_TARGETABLE_MODE | RIG_TARGETABLE_TONE)) @@ -5374,7 +5374,7 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) // Clear flag after executing command priv->question_mark_response_means_rejected = 0; - return err; + RETURNFUNC(err); } @@ -5596,7 +5596,7 @@ int newcat_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status) if (err != RIG_OK) { - return err; + RETURNFUNC(err); } ret_data_len = strlen(priv->ret_data); @@ -5697,7 +5697,7 @@ int newcat_set_ext_level(RIG *rig, vfo_t vfo, token_t token, value_t val) switch (token) { case TOK_ROOFING_FILTER: - return set_roofing_filter(rig, vfo, val.i); + RETURNFUNC(set_roofing_filter(rig, vfo, val.i)); default: rig_debug(RIG_DEBUG_ERR, "%s: Unsupported ext level %s\n", __func__, @@ -5820,7 +5820,7 @@ int newcat_set_mem(RIG *rig, vfo_t vfo, int ch) if (err < 0) { - return err; + RETURNFUNC(err); } if (valid_chan.freq <= 1.0) @@ -5842,7 +5842,7 @@ int newcat_set_mem(RIG *rig, vfo_t vfo, int ch) if (err < 0) { - return err; + RETURNFUNC(err); } /* Restore to VFO mode or leave in Memory Mode */ @@ -5863,7 +5863,7 @@ int newcat_set_mem(RIG *rig, vfo_t vfo, int ch) case RIG_VFO_SUB: default: /* Only works with VFO A */ - return -RIG_ENTARGET; + RETURNFUNC(-RIG_ENTARGET); } /* Set Memory Channel Number ************** */ @@ -5879,7 +5879,7 @@ int newcat_set_mem(RIG *rig, vfo_t vfo, int ch) if (err != RIG_OK) { - return err; + RETURNFUNC(err); } /* Restore VFO even if setting to blank memory channel */ @@ -5889,7 +5889,7 @@ int newcat_set_mem(RIG *rig, vfo_t vfo, int ch) if (err != RIG_OK) { - return err; + RETURNFUNC(err); } } @@ -5916,7 +5916,7 @@ int newcat_get_mem(RIG *rig, vfo_t vfo, int *ch) /* Get Memory Channel Number */ if (RIG_OK != (err = newcat_get_cmd(rig))) { - return err; + RETURNFUNC(err); } *ch = atoi(priv->ret_data + 2); @@ -5937,7 +5937,7 @@ int newcat_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op) if (err < 0) { - return err; + RETURNFUNC(err); } if (rig->caps->targetable_vfo & RIG_TARGETABLE_MODE) @@ -6014,7 +6014,7 @@ int newcat_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op) RETURNFUNC(-RIG_EINVAL); } - return newcat_set_cmd(rig); + RETURNFUNC(newcat_set_cmd(rig)); } @@ -6051,7 +6051,7 @@ int newcat_set_trn(RIG *rig, int trn) rig_debug(RIG_DEBUG_TRACE, "cmd_str = %s\n", priv->cmd_str); - return newcat_set_cmd(rig); + RETURNFUNC(newcat_set_cmd(rig)); } @@ -6074,7 +6074,7 @@ int newcat_get_trn(RIG *rig, int *trn) /* Get Auto Information */ if (RIG_OK != (err = newcat_get_cmd(rig))) { - return err; + RETURNFUNC(err); } c = priv->ret_data[2]; @@ -6158,7 +6158,7 @@ int newcat_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan) case RIG_VFO_SUB: default: /* Only works with VFO Main */ - return -RIG_ENTARGET; + RETURNFUNC(-RIG_ENTARGET); } /* Write Memory Channel ************************* */ @@ -6244,14 +6244,14 @@ int newcat_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan) if (err != RIG_OK) { - return err; + RETURNFUNC(err); } /* Restore VFO ********************************** */ if (restore_vfo) { err = newcat_vfomem_toggle(rig); - return err; + RETURNFUNC(err); } RETURNFUNC(RIG_OK); @@ -6317,7 +6317,7 @@ int newcat_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only) RETURNFUNC(RIG_OK); } - return err; + RETURNFUNC(err); } /* ret_data string to channel_t struct :: this will destroy ret_data */ @@ -6417,7 +6417,7 @@ int newcat_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only) "%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; + RETURNFUNC(-RIG_ENIMPL); } RETURNFUNC(RIG_OK); @@ -6439,13 +6439,13 @@ const char *newcat_get_info(RIG *rig) /* Get Identification Channel */ if (RIG_OK != newcat_get_cmd(rig)) { - return NULL; + RETURNFUNC(NULL); } priv->ret_data[6] = '\0'; snprintf(idbuf, sizeof(idbuf), "%s", priv->ret_data); - return idbuf; + RETURNFUNC(idbuf); } @@ -6472,7 +6472,7 @@ ncboolean newcat_valid_command(RIG *rig, char const *const command) if (!caps) { rig_debug(RIG_DEBUG_ERR, "%s: Rig capabilities not valid\n", __func__); - return FALSE; + RETURNFUNC(FALSE); } /* @@ -6498,7 +6498,7 @@ ncboolean newcat_valid_command(RIG *rig, char const *const command) && !is_ftdx10) { rig_debug(RIG_DEBUG_ERR, "%s: '%s' is unknown\n", __func__, caps->model_name); - return FALSE; + RETURNFUNC(FALSE); } /* @@ -6532,60 +6532,60 @@ ncboolean newcat_valid_command(RIG *rig, char const *const command) */ if (is_ft450 && valid_commands[search_index].ft450) { - return TRUE; + RETURNFUNC(TRUE); } else if (is_ft891 && valid_commands[search_index].ft891) { - return TRUE; + RETURNFUNC(TRUE); } else if (is_ft950 && valid_commands[search_index].ft950) { - return TRUE; + RETURNFUNC(TRUE); } else if (is_ft991 && valid_commands[search_index].ft991) { - return TRUE; + RETURNFUNC(TRUE); } else if (is_ft2000 && valid_commands[search_index].ft2000) { - return TRUE; + RETURNFUNC(TRUE); } else if (is_ftdx5000 && valid_commands[search_index].ft5000) { - return TRUE; + RETURNFUNC(TRUE); } else if (is_ftdx9000 && valid_commands[search_index].ft9000) { - return TRUE; + RETURNFUNC(TRUE); } else if (is_ftdx1200 && valid_commands[search_index].ft1200) { - return TRUE; + RETURNFUNC(TRUE); } else if (is_ftdx3000 && valid_commands[search_index].ft3000) { - return TRUE; + RETURNFUNC(TRUE); } else if (is_ftdx101 && valid_commands[search_index].ft101) { - return TRUE; + RETURNFUNC(TRUE); } else if (is_ftdx10 && valid_commands[search_index].ft10) { - return TRUE; + RETURNFUNC(TRUE); } else { rig_debug(RIG_DEBUG_TRACE, "%s: '%s' command '%s' not supported\n", __func__, caps->model_name, command); - return FALSE; + RETURNFUNC(FALSE); } } } rig_debug(RIG_DEBUG_TRACE, "%s: '%s' command '%s' not valid\n", __func__, caps->model_name, command); - return FALSE; + RETURNFUNC(FALSE); } @@ -6597,7 +6597,7 @@ ncboolean newcat_is_rig(RIG *rig, rig_model_t model) //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; + return(is_rig); } @@ -6622,7 +6622,7 @@ int newcat_set_tx_vfo(RIG *rig, vfo_t tx_vfo) if (err < 0) { - return err; + RETURNFUNC(err); } switch (tx_vfo) @@ -6680,7 +6680,7 @@ int newcat_set_tx_vfo(RIG *rig, vfo_t tx_vfo) rig_debug(RIG_DEBUG_TRACE, "cmd_str = %s\n", priv->cmd_str); /* Set TX VFO */ - return newcat_set_cmd(rig); + RETURNFUNC(newcat_set_cmd(rig)); } @@ -6714,7 +6714,7 @@ int newcat_get_tx_vfo(RIG *rig, vfo_t *tx_vfo) /* Get TX VFO */ if (RIG_OK != (err = newcat_get_cmd(rig))) { - return err; + RETURNFUNC(err); } c = priv->ret_data[2]; @@ -6738,7 +6738,7 @@ int newcat_get_tx_vfo(RIG *rig, vfo_t *tx_vfo) default: rig_debug(RIG_DEBUG_ERR, "%s: Unknown tx_vfo=%c from index 2 of %s\n", __func__, c, priv->ret_data); - return -RIG_EPROTO; + RETURNFUNC(-RIG_EPROTO); } /* Check to see if RIG is in MEM mode */ @@ -6746,7 +6746,7 @@ int newcat_get_tx_vfo(RIG *rig, vfo_t *tx_vfo) if (err != RIG_OK) { - return err; + RETURNFUNC(err); } if (vfo_mode == RIG_VFO_MEM && *tx_vfo == RIG_VFO_A) @@ -6856,7 +6856,7 @@ int newcat_set_narrow(RIG *rig, vfo_t vfo, ncboolean narrow) if (err < 0) { - return err; + RETURNFUNC(err); } if (rig->caps->targetable_vfo & RIG_TARGETABLE_MODE) @@ -6878,7 +6878,7 @@ int newcat_set_narrow(RIG *rig, vfo_t vfo, ncboolean narrow) rig_debug(RIG_DEBUG_TRACE, "cmd_str = %s\n", priv->cmd_str); - return newcat_set_cmd(rig); + RETURNFUNC(newcat_set_cmd(rig)); } @@ -6901,7 +6901,7 @@ int newcat_get_narrow(RIG *rig, vfo_t vfo, ncboolean *narrow) if (err < 0) { - return err; + RETURNFUNC(err); } if (rig->caps->targetable_vfo & RIG_TARGETABLE_MODE) @@ -6915,7 +6915,7 @@ int newcat_get_narrow(RIG *rig, vfo_t vfo, ncboolean *narrow) /* Get NAR */ if (RIG_OK != (err = newcat_get_cmd(rig))) { - return err; + RETURNFUNC(err); } c = priv->ret_data[3]; @@ -6948,17 +6948,17 @@ static int get_narrow(RIG *rig, vfo_t vfo) if (RIG_OK != (err = newcat_get_cmd(rig))) { - return err; + RETURNFUNC(err); } if (sscanf(priv->ret_data, "NA%*1d%3d", &narrow) != 1) { rig_debug(RIG_DEBUG_ERR, "%s: unable to parse width from '%s'\n", __func__, priv->ret_data); - return -RIG_EPROTO; + RETURNFUNC(-RIG_EPROTO); } - return narrow; + RETURNFUNC(narrow); } int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) @@ -6981,7 +6981,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) if (err < 0) { - return err; + RETURNFUNC(err); } if (rig->caps->targetable_vfo & RIG_TARGETABLE_MODE) @@ -7006,7 +7006,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) if (err != RIG_OK) { - return err; + RETURNFUNC(err); } if (width == RIG_PASSBAND_NORMAL) { w = 0; } @@ -7031,7 +7031,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) if (err != RIG_OK) { - return err; + RETURNFUNC(err); } if (width == RIG_PASSBAND_NORMAL) { w = 0; } @@ -7071,7 +7071,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) if ((err = set_roofing_filter_for_width(rig, vfo, width)) != RIG_OK) { - return err; + RETURNFUNC(err); } switch (mode) @@ -7088,7 +7088,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) err = newcat_set_narrow(rig, vfo, FALSE); } - return err; + RETURNFUNC(err); case RIG_MODE_FMN: RETURNFUNC(RIG_OK); @@ -7109,7 +7109,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) if (err != RIG_OK) { - return err; + RETURNFUNC(err); } if (width == RIG_PASSBAND_NORMAL) { w = 0; } @@ -7140,7 +7140,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) if (err != RIG_OK) { - return err; + RETURNFUNC(err); } if (width == RIG_PASSBAND_NORMAL) { w = 0; } @@ -7180,7 +7180,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) err = newcat_set_narrow(rig, vfo, FALSE); } - return err; + RETURNFUNC(err); case RIG_MODE_FMN: break; @@ -7204,7 +7204,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) if (err != RIG_OK) { - return err; + RETURNFUNC(err); } if (width == RIG_PASSBAND_NORMAL) { w = 0; } @@ -7235,7 +7235,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) if (err != RIG_OK) { - return err; + RETURNFUNC(err); } if (width == RIG_PASSBAND_NORMAL) { w = 0; } @@ -7269,7 +7269,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) err = newcat_set_narrow(rig, vfo, FALSE); } - return err; + RETURNFUNC(err); case RIG_MODE_AMN: if (width == RIG_PASSBAND_NORMAL || width == 6000) @@ -7277,7 +7277,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) err = newcat_set_narrow(rig, vfo, TRUE); } - return err; + RETURNFUNC(err); case RIG_MODE_FM: // Only 1 passband each for FM or FMN if (width == RIG_PASSBAND_NORMAL || width == 16000) @@ -7285,7 +7285,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) err = newcat_set_narrow(rig, vfo, FALSE); } - return err; + RETURNFUNC(err); case RIG_MODE_FMN: if (width == RIG_PASSBAND_NORMAL || width == 9000) @@ -7293,7 +7293,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) err = newcat_set_narrow(rig, vfo, TRUE); } - return err; + RETURNFUNC(err); case RIG_MODE_C4FM: if (width == RIG_PASSBAND_NORMAL || width == 16000) @@ -7309,7 +7309,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) RETURNFUNC(-RIG_EINVAL); } - return err; + RETURNFUNC(err); case RIG_MODE_PKTFM: if (width > 0 && width < rig_passband_normal(rig, mode)) @@ -7321,7 +7321,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) err = newcat_set_narrow(rig, vfo, FALSE); } - return err; + RETURNFUNC(err); default: RETURNFUNC(-RIG_EINVAL); @@ -7343,7 +7343,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) if (err != RIG_OK) { - return err; + RETURNFUNC(err); } if (width == RIG_PASSBAND_NORMAL) { w = 0; } @@ -7373,7 +7373,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) if (err != RIG_OK) { - return err; + RETURNFUNC(err); } if (width == RIG_PASSBAND_NORMAL) { w = 0; } @@ -7419,7 +7419,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) if ((err = set_roofing_filter_for_width(rig, vfo, width)) != RIG_OK) { - return err; + RETURNFUNC(err); } switch (mode) @@ -7438,7 +7438,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) err = newcat_set_narrow(rig, vfo, FALSE); } - return err; + RETURNFUNC(err); } } // end is_ftdx1200 and is_ftdx3000 else if (is_ftdx5000) @@ -7456,7 +7456,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) if (err != RIG_OK) { - return err; + RETURNFUNC(err); } if (width == RIG_PASSBAND_NORMAL) { w = 0; } @@ -7486,7 +7486,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) if (err != RIG_OK) { - return err; + RETURNFUNC(err); } if (width == RIG_PASSBAND_NORMAL) { w = 0; } @@ -7531,7 +7531,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) if ((err = set_roofing_filter_for_width(rig, vfo, width)) != RIG_OK) { - return err; + RETURNFUNC(err); } switch (mode) @@ -7550,7 +7550,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) err = newcat_set_narrow(rig, vfo, FALSE); } - return err; + RETURNFUNC(err); } } // end is_ftdx5000 else if (is_ftdx101 || is_ftdx10) @@ -7628,7 +7628,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) if ((err = set_roofing_filter_for_width(rig, vfo, width)) != RIG_OK) { - return err; + RETURNFUNC(err); } switch (mode) @@ -7645,7 +7645,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) err = newcat_set_narrow(rig, vfo, FALSE); } - return err; + RETURNFUNC(err); case RIG_MODE_AMN: case RIG_MODE_FMN: @@ -7722,7 +7722,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) if ((err = set_roofing_filter_for_width(rig, vfo, width)) != RIG_OK) { - return err; + RETURNFUNC(err); } switch (mode) @@ -7741,7 +7741,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) err = newcat_set_narrow(rig, vfo, FALSE); } - return err; + RETURNFUNC(err); } } else @@ -7784,7 +7784,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) err = newcat_set_narrow(rig, vfo, FALSE); } - return err; + RETURNFUNC(err); case RIG_MODE_FMN: RETURNFUNC(RIG_OK); @@ -7814,7 +7814,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) rig_debug(RIG_DEBUG_TRACE, "%s: cmd_str = %s\n", __func__, priv->cmd_str); /* Set RX Bandwidth */ - return newcat_set_cmd(rig); + RETURNFUNC(newcat_set_cmd(rig)); } static int set_roofing_filter(RIG *rig, vfo_t vfo, int index) @@ -7878,7 +7878,7 @@ static int set_roofing_filter(RIG *rig, vfo_t vfo, int index) if (RIG_OK != err) { - return err; + RETURNFUNC(err); } RETURNFUNC(RIG_OK); @@ -7917,7 +7917,7 @@ static int set_roofing_filter_for_width(RIG *rig, vfo_t vfo, int width) index = current_filter->index; } - return set_roofing_filter(rig, vfo, index); + RETURNFUNC(set_roofing_filter(rig, vfo, index)); } static int get_roofing_filter(RIG *rig, vfo_t vfo, @@ -7952,7 +7952,7 @@ static int get_roofing_filter(RIG *rig, vfo_t vfo, if (RIG_OK != (err = newcat_get_cmd(rig))) { - return err; + RETURNFUNC(err); } n = sscanf(priv->ret_data, "RF%c%c", &rf_vfo, &roofing_filter_choice); @@ -7962,7 +7962,7 @@ static int get_roofing_filter(RIG *rig, vfo_t vfo, rig_debug(RIG_DEBUG_ERR, "%s: error parsing '%s' for vfo and roofing filter, got %d parsed\n", __func__, priv->ret_data, n); - return -RIG_EPROTO; + RETURNFUNC(-RIG_EPROTO); } for (i = 0; i < priv_caps->roofing_filter_count; i++) @@ -7980,7 +7980,7 @@ static int get_roofing_filter(RIG *rig, vfo_t vfo, "%s: Expected a valid roofing filter but got %c from '%s'\n", __func__, roofing_filter_choice, priv->ret_data); - return RIG_EPROTO; + RETURNFUNC(RIG_EPROTO); } int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) @@ -8006,7 +8006,7 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) if (err < 0) { - return err; + RETURNFUNC(err); } if (is_ft950 || is_ftdx5000) @@ -8046,7 +8046,7 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) if (err != RIG_OK) { - return err; + RETURNFUNC(err); } @@ -8093,7 +8093,7 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) { rig_debug(RIG_DEBUG_ERR, "%s: unable to parse width from '%s'\n", __func__, priv->ret_data); - return -RIG_EPROTO; + RETURNFUNC(-RIG_EPROTO); } } else @@ -8106,7 +8106,7 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) { if ((narrow = get_narrow(rig, RIG_VFO_MAIN)) < 0) { - return -RIG_EPROTO; + RETURNFUNC(-RIG_EPROTO); } switch (mode) @@ -8228,7 +8228,7 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) if ((narrow = get_narrow(rig, vfo)) < 0) { rig_debug(RIG_DEBUG_ERR, "%s: error narrow < 0, narrow=%d\n", __func__, narrow); - return -RIG_EPROTO; + RETURNFUNC(-RIG_EPROTO); } switch (mode) @@ -8373,7 +8373,7 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) { if ((narrow = get_narrow(rig, vfo)) < 0) { - return -RIG_EPROTO; + RETURNFUNC(-RIG_EPROTO); } switch (mode) @@ -8514,7 +8514,7 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) { if ((narrow = get_narrow(rig, RIG_VFO_MAIN)) < 0) { - return -RIG_EPROTO; + RETURNFUNC(-RIG_EPROTO); } switch (mode) @@ -8657,7 +8657,7 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) { if ((narrow = get_narrow(rig, RIG_VFO_MAIN)) < 0) { - return -RIG_EPROTO; + RETURNFUNC(-RIG_EPROTO); } switch (mode) @@ -8951,7 +8951,7 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) { if ((narrow = get_narrow(rig, RIG_VFO_MAIN)) < 0) { - return -RIG_EPROTO; + RETURNFUNC(-RIG_EPROTO); } switch (mode) @@ -9156,7 +9156,7 @@ int newcat_get_faststep(RIG *rig, ncboolean *fast_step) /* Get Fast Step */ if (RIG_OK != (err = newcat_get_cmd(rig))) { - return err; + RETURNFUNC(err); } c = priv->ret_data[2]; @@ -9225,7 +9225,7 @@ int newcat_get_vfo_mode(RIG *rig, vfo_t *vfo_mode) if (RIG_OK != (err = newcat_get_cmd(rig))) { - return err; + RETURNFUNC(err); } /* vfo, mem, P7 ************************** */ @@ -9241,7 +9241,7 @@ int newcat_get_vfo_mode(RIG *rig, vfo_t *vfo_mode) rig_debug(RIG_DEBUG_ERR, "%s: incorrect length of IF response, expected 27 or 28, got %d", __func__, (int)strlen(priv->ret_data)); - return -RIG_EPROTO; + RETURNFUNC(-RIG_EPROTO); } rig_debug(RIG_DEBUG_TRACE, "%s: offset=%d, width_frequency=%d\n", __func__, @@ -9262,7 +9262,7 @@ int newcat_get_vfo_mode(RIG *rig, vfo_t *vfo_mode) rig_debug(RIG_DEBUG_TRACE, "%s: vfo mode = %s\n", __func__, rig_strvfo(*vfo_mode)); - return err; + RETURNFUNC(err); } @@ -9584,7 +9584,7 @@ int newcat_set_cmd_validate(RIG *rig) else { rig_debug(RIG_DEBUG_ERR, "%s: %s not implemented\n", __func__, priv->cmd_str); - return -RIG_ENIMPL; + RETURNFUNC(-RIG_ENIMPL); } while (rc != RIG_OK && retry++ < retries) @@ -9595,7 +9595,7 @@ int newcat_set_cmd_validate(RIG *rig) snprintf(cmd, sizeof(cmd), "%s%s", priv->cmd_str, valcmd); rc = write_block(&state->rigport, cmd, strlen(cmd)); - if (rc != RIG_OK) { return -RIG_EIO; } + if (rc != RIG_OK) { RETURNFUNC(-RIG_EIO); } bytes = read_string(&state->rigport, priv->ret_data, sizeof(priv->ret_data), &cat_term, sizeof(cat_term)); @@ -9626,7 +9626,7 @@ int newcat_set_cmd_validate(RIG *rig) hl_usleep(sleepms * 1000); } - return -RIG_EPROTO; + RETURNFUNC(-RIG_EPROTO); } /* * Writes a null terminated command string from priv->cmd_str to the commit 65970cab0e4ed52108548cb32aa9b11def785ed1 Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Jan 17 11:21:46 2021 -0600 Try to get vfo detection working in newcat_set_cmd_validate diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 0ea60efb..b876746f 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -814,7 +814,8 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) // And only when not in split mode (note this check has been removed for testing) int changing; - if (rig->state.current_vfo == RIG_VFO_A || rig->state.current_vfo == RIG_VFO_MAIN) + rig_debug(RIG_DEBUG_TRACE, "%s: rig->state.current_vfo=%s\n", __func__, rig_strvfo(rig->state.current_vfo)); + if (target_vfo == 0) { if (rig->state.cache.freqMainA == 0) { ----------------------------------------------------------------------- Summary of changes: rigs/yaesu/newcat.c | 369 ++++++++++++++++++++++++++-------------------------- 1 file changed, 185 insertions(+), 184 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-01-17 16:47:26
|
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 a0ee23b178f4a33dd35d67669f56ede32c9d8a58 (commit) via 10bc7d50df70da3b7bb5191cf8573db2482dc3c7 (commit) from 66af5ea4c0f52ef99997afe60109270fed5cbd20 (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 a0ee23b178f4a33dd35d67669f56ede32c9d8a58 Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Jan 17 10:46:42 2021 -0600 Fix VFO detection in new_set_cmd_validate diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 18157f96..0ea60efb 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -814,7 +814,7 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) // And only when not in split mode (note this check has been removed for testing) int changing; - if (vfo == RIG_VFO_A || vfo == RIG_VFO_MAIN) + if (rig->state.current_vfo == RIG_VFO_A || rig->state.current_vfo == RIG_VFO_MAIN) { if (rig->state.cache.freqMainA == 0) { @@ -6592,8 +6592,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__); + //a bit too verbose so disable this unless needed + //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; commit 10bc7d50df70da3b7bb5191cf8573db2482dc3c7 Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Jan 17 10:16:53 2021 -0600 Add debug to prm80.c diff --git a/rigs/prm80/prm80.c b/rigs/prm80/prm80.c index 49dbfe77..5c69a462 100644 --- a/rigs/prm80/prm80.c +++ b/rigs/prm80/prm80.c @@ -371,6 +371,7 @@ int prm80_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only) if (statebuf_len < 20) { + rig_debug(RIG_DEBUG_ERR, "%s: statebuf_len < 20, statebuf='%s'\n", __func__, statebuf); RETURNFUNC(-RIG_EPROTO); } ----------------------------------------------------------------------- Summary of changes: rigs/prm80/prm80.c | 1 + rigs/yaesu/newcat.c | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-01-17 15:59:10
|
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 66af5ea4c0f52ef99997afe60109270fed5cbd20 (commit) from 86c4bfb4237337950e5e66ac5efacd3d4d3ff050 (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 66af5ea4c0f52ef99997afe60109270fed5cbd20 Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Jan 17 09:58:51 2021 -0600 Enable get_channel for prm80.c diff --git a/rigs/prm80/prm80.c b/rigs/prm80/prm80.c index d1f97d17..49dbfe77 100644 --- a/rigs/prm80/prm80.c +++ b/rigs/prm80/prm80.c @@ -406,7 +406,7 @@ int prm80_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only) "%s: please contact hamlib mailing list to implement this, rxfreq=%.0f, txfreq=%.0f\n", __func__, chan->freq, chan->tx_freq); rig_debug(RIG_DEBUG_ERR, "%s: need to know if rig updates when channel read or not\n", __func__); - return -RIG_ENIMPL; + //return -RIG_ENIMPL; } return RIG_OK; ----------------------------------------------------------------------- Summary of changes: rigs/prm80/prm80.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-01-17 15:09:33
|
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 86c4bfb4237337950e5e66ac5efacd3d4d3ff050 (commit) from ebeb23e49d8096c117c54d846a2bb0709fa704fd (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 86c4bfb4237337950e5e66ac5efacd3d4d3ff050 Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Jan 17 09:08:55 2021 -0600 Allow > 100MHz band select in newcat.c diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 063eeb63..18157f96 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -893,8 +893,11 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) if (err != RIG_OK) { return err; } - // we'll ignore UHF/VHF frequencies -- need to see the behavior - if (newcat_band_index(freqtmp) != newcat_band_index(freq) && freq < 100e6) + // Cross band should work too + // If the BS works on both VFOs then VFOB will have the band select answer + // so now change needed + // If the BS is by VFO then we'll need to do BS for the other VFO too + if (newcat_band_index(freqtmp) != newcat_band_index(freq)) { snprintf(priv->cmd_str, sizeof(priv->cmd_str), "BS%02d%c", ----------------------------------------------------------------------- Summary of changes: rigs/yaesu/newcat.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-01-17 14:55:02
|
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 ebeb23e49d8096c117c54d846a2bb0709fa704fd (commit) via a8d841182b3daa2d1947b61db22b5f6b88bc5237 (commit) from 9db79eb8412b10a0b6bd49d7655f8378c59e938d (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 ebeb23e49d8096c117c54d846a2bb0709fa704fd Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Jan 17 08:54:40 2021 -0600 Avoid newcat BS command when VFO freq is not changing diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 79e8529e..063eeb63 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -790,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,"newcat_set_cmd failed"); + ERRMSG(err, "newcat_set_cmd failed"); return err; } } @@ -816,12 +816,24 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) if (vfo == RIG_VFO_A || vfo == RIG_VFO_MAIN) { + if (rig->state.cache.freqMainA == 0) + { + freq_t freqtmp; + err = rig_get_freq(rig,RIG_VFO_CURR,&freqtmp); + if (err != RIG_OK) RETURNFUNC(err); + } changing = newcat_band_index(freq) != newcat_band_index( rig->state.cache.freqMainA); rig_debug(RIG_DEBUG_TRACE, "%s: VFO_A freq changing=%d\n", __func__, changing); } else { + if (rig->state.cache.freqMainB == 0) + { + freq_t freqtmp; + err = rig_get_freq(rig,RIG_VFO_CURR,&freqtmp); + if (err != RIG_OK) RETURNFUNC(err); + } changing = newcat_band_index(freq) != newcat_band_index( rig->state.cache.freqMainB); rig_debug(RIG_DEBUG_TRACE, "%s: VFO_B freq changing=%d\n", __func__, changing); @@ -861,6 +873,7 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) // Also need to do this for the other VFO on some Yaesu rigs // is redundant for rigs where band stack includes both vfos vfo_t vfotmp; + freq_t freqtmp; err = rig_get_vfo(rig, &vfotmp); if (err != RIG_OK) { return err; } @@ -874,17 +887,25 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) err = rig_set_vfo(rig, vfotmp == RIG_VFO_A ? RIG_VFO_B : RIG_VFO_A); } - if (err != RIG_OK) { return err; } - snprintf(priv->cmd_str, sizeof(priv->cmd_str), "BS%02d%c", - newcat_band_index(freq), cat_term); + rig_get_freq(rig, RIG_VFO_CURR, &freqtmp); - if (RIG_OK != (err = newcat_set_cmd(rig))) + if (err != RIG_OK) { return err; } + + // we'll ignore UHF/VHF frequencies -- need to see the behavior + if (newcat_band_index(freqtmp) != newcat_band_index(freq) && freq < 100e6) { - rig_debug(RIG_DEBUG_ERR, "%s: Unexpected error with BS command#2=%s\n", - __func__, - rigerror(err)); + + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "BS%02d%c", + newcat_band_index(freq), cat_term); + + if (RIG_OK != (err = newcat_set_cmd(rig))) + { + rig_debug(RIG_DEBUG_ERR, "%s: Unexpected error with BS command#2=%s\n", + __func__, + rigerror(err)); + } } // switch back to the starting vfo @@ -9289,6 +9310,7 @@ int newcat_get_cmd(RIG *rig) 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 @@ -9812,11 +9834,11 @@ 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); - RETURNFUNC (newcat_mode_conv[i].mode); + RETURNFUNC(newcat_mode_conv[i].mode); } } - RETURNFUNC (RIG_MODE_NONE); + RETURNFUNC(RIG_MODE_NONE); } char newcat_modechar(rmode_t rmode) @@ -9831,11 +9853,11 @@ 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)); - RETURNFUNC (newcat_mode_conv[i].modechar); + RETURNFUNC(newcat_mode_conv[i].modechar); } } - RETURNFUNC ('0'); + RETURNFUNC('0'); } rmode_t newcat_rmode_width(RIG *rig, vfo_t vfo, char mode, pbwidth_t *width) @@ -9866,7 +9888,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) { - RETURNFUNC (newcat_mode_conv[i].mode); + RETURNFUNC(newcat_mode_conv[i].mode); } if (narrow == TRUE) @@ -9880,12 +9902,12 @@ rmode_t newcat_rmode_width(RIG *rig, vfo_t vfo, char mode, pbwidth_t *width) } } - RETURNFUNC (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)); - RETURNFUNC ('0'); + RETURNFUNC('0'); } diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h index dfa3bdb5..ea6a6c22 100644 --- a/rigs/yaesu/newcat.h +++ b/rigs/yaesu/newcat.h @@ -50,7 +50,7 @@ typedef char ncboolean; /* shared function version */ -#define NEWCAT_VER "20210116" +#define NEWCAT_VER "20210117" /* Hopefully large enough for future use, 128 chars plus '\0' */ #define NEWCAT_DATA_LEN 129 commit a8d841182b3daa2d1947b61db22b5f6b88bc5237 Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Jan 17 08:22:07 2021 -0600 Improve comments in misc.c diff --git a/src/misc.c b/src/misc.c index 9dfdbe46..445c8492 100644 --- a/src/misc.c +++ b/src/misc.c @@ -1634,6 +1634,7 @@ int HAMLIB_API parse_hoststr(char *hoststr, char host[256], char port[6]) port[0] = 0; dummy[0] = 0; + // Exclude any names that aren't a host:port format // Handle device names 1st if (strstr(hoststr, "/dev")) { return -1; } @@ -1644,6 +1645,7 @@ int HAMLIB_API parse_hoststr(char *hoststr, char host[256], char port[6]) // escaped COM port like \\.\COM3 if (strstr(hoststr, "\\\\.\\")) { return -1; } + // Now let's try and parse a host:port thing // bracketed IPV6 with optional port int n = sscanf(hoststr, "[%255[^]]]:%5s", host, port); ----------------------------------------------------------------------- Summary of changes: rigs/yaesu/newcat.c | 52 +++++++++++++++++++++++++++++++++++++--------------- rigs/yaesu/newcat.h | 2 +- src/misc.c | 2 ++ 3 files changed, 40 insertions(+), 16 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-01-17 14:19:31
|
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 9db79eb8412b10a0b6bd49d7655f8378c59e938d (commit) from 70f27a0a03481ba607e1caad4d92c32373a1b6e1 (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 9db79eb8412b10a0b6bd49d7655f8378c59e938d Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Jan 17 08:19:12 2021 -0600 Reduce debug level diff --git a/src/network.c b/src/network.c index 7273606d..07741a5b 100644 --- a/src/network.c +++ b/src/network.c @@ -139,7 +139,7 @@ int network_open(hamlib_port_t *rp, int default_port) struct in6_addr serveraddr; char hoststr[256], portstr[6] = ""; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; rig_debug(RIG_DEBUG_VERBOSE, "%s version 1.0\n", __func__); #ifdef __MINGW32__ @@ -183,7 +183,7 @@ int network_open(hamlib_port_t *rp, int default_port) if (status != RIG_OK) { return status; } - rig_debug(RIG_DEBUG_ERR, "%s: hoststr=%s, portstr=%s\n", __func__, hoststr, + rig_debug(RIG_DEBUG_TRACE, "%s: hoststr=%s, portstr=%s\n", __func__, hoststr, portstr); } ----------------------------------------------------------------------- Summary of changes: src/network.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-01-17 14:09:51
|
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 70f27a0a03481ba607e1caad4d92c32373a1b6e1 (commit) via 00a48edf5d52c45ce7a28e8880720bcd0ddf1216 (commit) via 6e28ec4ec42da96bfb03dd070a5ed3f689961c82 (commit) via 544777f935074cc3e8da7903d55bd29a34b50b36 (commit) via c5c60f0f430a0a254f527e196aa542f83dcddffd (commit) via 4b9ea6b1d436ab97d9141a230b744ebe488db6a6 (commit) via 460e748742135825d93e15f7154c66827b86b916 (commit) from a5ca77a66f8066cc734a5e077ae078dccf1c9870 (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 70f27a0a03481ba607e1caad4d92c32373a1b6e1 Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Jan 17 08:09:06 2021 -0600 Improve comment in misc.c diff --git a/src/misc.c b/src/misc.c index caa02e98..9dfdbe46 100644 --- a/src/misc.c +++ b/src/misc.c @@ -1637,7 +1637,7 @@ int HAMLIB_API parse_hoststr(char *hoststr, char host[256], char port[6]) // Handle device names 1st if (strstr(hoststr, "/dev")) { return -1; } - if (strstr(hoststr, "/")) { return -1; } // posible path -- no hostname starts with / + if (strstr(hoststr, "/")) { return -1; } // probably a path so not a hoststr if (strncasecmp(hoststr, "com", 3) == 0) { return -1; } commit 00a48edf5d52c45ce7a28e8880720bcd0ddf1216 Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Jan 17 08:08:34 2021 -0600 Increase retries and timeout on flrig.c diff --git a/rigs/dummy/flrig.h b/rigs/dummy/flrig.h index b9a876e9..10f2dda1 100644 --- a/rigs/dummy/flrig.h +++ b/rigs/dummy/flrig.h @@ -28,7 +28,7 @@ #include <sys/time.h> #endif -#define BACKEND_VER "20210116" +#define BACKEND_VER "20210117" #define EOM "\r" #define TRUE 1 commit 6e28ec4ec42da96bfb03dd070a5ed3f689961c82 Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Jan 17 08:08:14 2021 -0600 Increase retries and timeout on flrig.c diff --git a/rigs/dummy/flrig.c b/rigs/dummy/flrig.c index 4f50ecac..41f09cbb 100644 --- a/rigs/dummy/flrig.c +++ b/rigs/dummy/flrig.c @@ -125,7 +125,7 @@ const struct rig_caps flrig_caps = .port_type = RIG_PORT_NETWORK, .write_delay = 0, .post_write_delay = 0, - .timeout = 2000, + .timeout = 5000, .retry = 5, .has_get_func = RIG_FUNC_NONE, @@ -518,7 +518,7 @@ static int flrig_transaction(RIG *rig, char *cmd, char *cmd_arg, char *value, int value_len) { char xml[MAXXMLLEN]; - int retry = 2; + int retry = 5; if (value) { commit 544777f935074cc3e8da7903d55bd29a34b50b36 Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Jan 17 07:32:42 2021 -0600 Fixed ENTER func error diff --git a/src/rig.c b/src/rig.c index 38cf5667..a9fbd91e 100755 --- a/src/rig.c +++ b/src/rig.c @@ -2122,7 +2122,7 @@ int HAMLIB_API rig_set_vfo(RIG *rig, vfo_t vfo) int retcode; freq_t curr_freq; - ENTER; + ENTERFUNC; rig_debug(RIG_DEBUG_VERBOSE, "%s called vfo=%s\n", __func__, rig_strvfo(vfo)); if (CHECK_RIG_ARG(rig)) commit c5c60f0f430a0a254f527e196aa542f83dcddffd Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Jan 17 07:25:28 2021 -0600 First phase of improving debug messages diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 0aec7db7..79e8529e 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 ... [truncated message content] |
From: Michael B. <mdb...@us...> - 2021-01-17 04:47:38
|
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 a5ca77a66f8066cc734a5e077ae078dccf1c9870 (commit) from 8595c244e4cd3705212a652bfad0b2a2a49cf178 (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 a5ca77a66f8066cc734a5e077ae078dccf1c9870 Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Jan 16 22:45:17 2021 -0600 Change all Yaeus rigs to 2 stop bits https://github.com/Hamlib/Hamlib/issues/511 diff --git a/rigs/yaesu/ft2000.c b/rigs/yaesu/ft2000.c index c4428cf0..c8b35020 100644 --- a/rigs/yaesu/ft2000.c +++ b/rigs/yaesu/ft2000.c @@ -101,7 +101,7 @@ const struct rig_caps ft2000_caps = .serial_rate_min = 4800, /* Default rate per manual */ .serial_rate_max = 38400, .serial_data_bits = 8, - .serial_stop_bits = 1, /* Assumed since manual makes no mention */ + .serial_stop_bits = 2, /* Assumed since manual makes no mention */ .serial_parity = RIG_PARITY_NONE, .serial_handshake = RIG_HANDSHAKE_HARDWARE, .write_delay = FT2000_WRITE_DELAY, diff --git a/rigs/yaesu/ft3000.c b/rigs/yaesu/ft3000.c index c06274b6..1b0197e6 100644 --- a/rigs/yaesu/ft3000.c +++ b/rigs/yaesu/ft3000.c @@ -104,7 +104,7 @@ const struct rig_caps ftdx3000_caps = .serial_rate_min = 4800, /* Default rate per manual */ .serial_rate_max = 38400, .serial_data_bits = 8, - .serial_stop_bits = 1, /* Assumed since manual makes no mention */ + .serial_stop_bits = 2, /* Assumed since manual makes no mention */ .serial_parity = RIG_PARITY_NONE, .serial_handshake = RIG_HANDSHAKE_HARDWARE, .write_delay = FTDX5000_WRITE_DELAY, diff --git a/rigs/yaesu/ft450.c b/rigs/yaesu/ft450.c index 7bd00548..f3ac27d3 100644 --- a/rigs/yaesu/ft450.c +++ b/rigs/yaesu/ft450.c @@ -54,7 +54,7 @@ const struct rig_caps ft450_caps = .serial_rate_min = 4800, /* Default rate per manual */ .serial_rate_max = 38400, .serial_data_bits = 8, - .serial_stop_bits = 1, /* Assumed since manual makes no mention */ + .serial_stop_bits = 2, /* Assumed since manual makes no mention */ .serial_parity = RIG_PARITY_NONE, .serial_handshake = RIG_HANDSHAKE_HARDWARE, .write_delay = FT450_WRITE_DELAY, diff --git a/rigs/yaesu/ft5000.c b/rigs/yaesu/ft5000.c index 58c0327e..4baeecb3 100644 --- a/rigs/yaesu/ft5000.c +++ b/rigs/yaesu/ft5000.c @@ -98,7 +98,7 @@ const struct rig_caps ftdx5000_caps = .serial_rate_min = 4800, /* Default rate per manual */ .serial_rate_max = 38400, .serial_data_bits = 8, - .serial_stop_bits = 1, /* Assumed since manual makes no mention */ + .serial_stop_bits = 2, /* Assumed since manual makes no mention */ .serial_parity = RIG_PARITY_NONE, .serial_handshake = RIG_HANDSHAKE_HARDWARE, .write_delay = FTDX5000_WRITE_DELAY, diff --git a/rigs/yaesu/ft891.c b/rigs/yaesu/ft891.c index adc5efa4..1e99e713 100644 --- a/rigs/yaesu/ft891.c +++ b/rigs/yaesu/ft891.c @@ -60,7 +60,7 @@ const struct rig_caps ft891_caps = .serial_rate_min = 4800, /* Default rate per manual */ .serial_rate_max = 38400, .serial_data_bits = 8, - .serial_stop_bits = 1, /* Assumed since manual makes no mention */ + .serial_stop_bits = 2, /* Assumed since manual makes no mention */ .serial_parity = RIG_PARITY_NONE, .serial_handshake = RIG_HANDSHAKE_HARDWARE, .write_delay = FT891_WRITE_DELAY, diff --git a/rigs/yaesu/ft9000.c b/rigs/yaesu/ft9000.c index 746225c7..04d623d8 100644 --- a/rigs/yaesu/ft9000.c +++ b/rigs/yaesu/ft9000.c @@ -61,7 +61,7 @@ const struct rig_caps ft9000_caps = .serial_rate_min = 4800, /* Default rate per manual */ .serial_rate_max = 38400, .serial_data_bits = 8, - .serial_stop_bits = 1, /* Assumed since manual makes no mention */ + .serial_stop_bits = 2, /* Assumed since manual makes no mention */ .serial_parity = RIG_PARITY_NONE, .serial_handshake = RIG_HANDSHAKE_HARDWARE, .write_delay = FT9000_WRITE_DELAY, diff --git a/rigs/yaesu/ft950.c b/rigs/yaesu/ft950.c index 2d59ac14..54cff564 100644 --- a/rigs/yaesu/ft950.c +++ b/rigs/yaesu/ft950.c @@ -99,7 +99,7 @@ const struct rig_caps ft950_caps = .serial_rate_min = 4800, /* Default rate per manual */ .serial_rate_max = 38400, .serial_data_bits = 8, - .serial_stop_bits = 1, /* Assumed since manual makes no mention */ + .serial_stop_bits = 2, /* Assumed since manual makes no mention */ .serial_parity = RIG_PARITY_NONE, .serial_handshake = RIG_HANDSHAKE_HARDWARE, .write_delay = FT950_WRITE_DELAY, diff --git a/rigs/yaesu/ft991.c b/rigs/yaesu/ft991.c index ecf67299..89fd2014 100644 --- a/rigs/yaesu/ft991.c +++ b/rigs/yaesu/ft991.c @@ -59,7 +59,7 @@ const struct rig_caps ft991_caps = .serial_rate_min = 4800, /* Default rate per manual */ .serial_rate_max = 38400, .serial_data_bits = 8, - .serial_stop_bits = 1, /* Assumed since manual makes no mention */ + .serial_stop_bits = 2, /* Assumed since manual makes no mention */ .serial_parity = RIG_PARITY_NONE, .serial_handshake = RIG_HANDSHAKE_HARDWARE, .write_delay = FT991_WRITE_DELAY, diff --git a/rigs/yaesu/ftdx10.c b/rigs/yaesu/ftdx10.c index 40498068..4a911768 100644 --- a/rigs/yaesu/ftdx10.c +++ b/rigs/yaesu/ftdx10.c @@ -86,7 +86,7 @@ const struct rig_caps ftdx10_caps = .serial_rate_min = 4800, .serial_rate_max = 38400, .serial_data_bits = 8, - .serial_stop_bits = 1, + .serial_stop_bits = 2, .serial_parity = RIG_PARITY_NONE, .serial_handshake = RIG_HANDSHAKE_HARDWARE, .write_delay = FTDX10_WRITE_DELAY, ----------------------------------------------------------------------- Summary of changes: rigs/yaesu/ft2000.c | 2 +- rigs/yaesu/ft3000.c | 2 +- rigs/yaesu/ft450.c | 2 +- rigs/yaesu/ft5000.c | 2 +- rigs/yaesu/ft891.c | 2 +- rigs/yaesu/ft9000.c | 2 +- rigs/yaesu/ft950.c | 2 +- rigs/yaesu/ft991.c | 2 +- rigs/yaesu/ftdx10.c | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-01-16 18:33:14
|
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 8595c244e4cd3705212a652bfad0b2a2a49cf178 (commit) from 1affac778b2b902cc218ec664b9716a1410dfb4d (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 8595c244e4cd3705212a652bfad0b2a2a49cf178 Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Jan 16 12:32:18 2021 -0600 Add retries to flrig.c for set commands Was getting some timeouts on these set commands diff --git a/rigs/dummy/flrig.c b/rigs/dummy/flrig.c index 9711509f..4f50ecac 100644 --- a/rigs/dummy/flrig.c +++ b/rigs/dummy/flrig.c @@ -517,6 +517,7 @@ static int write_transaction(RIG *rig, char *xml, int xml_len) static int flrig_transaction(RIG *rig, char *cmd, char *cmd_arg, char *value, int value_len) { + char xml[MAXXMLLEN]; int retry = 2; if (value) @@ -526,7 +527,6 @@ static int flrig_transaction(RIG *rig, char *cmd, char *cmd_arg, char *value, do { - char xml[MAXXMLLEN]; char *pxml; int retval; @@ -551,7 +551,7 @@ static int flrig_transaction(RIG *rig, char *cmd, char *cmd_arg, char *value, xml_parse(xml, value, value_len); } } - while (value && strlen(value) == 0 && retry--); // we'll do retries if needed + while (((value && strlen(value) == 0) || (strlen(xml)==0)) && retry--); // we'll do retries if needed if (value && strlen(value) == 0) { return RIG_EPROTO; } diff --git a/rigs/dummy/flrig.h b/rigs/dummy/flrig.h index 4c6633b3..b9a876e9 100644 --- a/rigs/dummy/flrig.h +++ b/rigs/dummy/flrig.h @@ -28,7 +28,7 @@ #include <sys/time.h> #endif -#define BACKEND_VER "20210112" +#define BACKEND_VER "20210116" #define EOM "\r" #define TRUE 1 ----------------------------------------------------------------------- Summary of changes: rigs/dummy/flrig.c | 4 ++-- rigs/dummy/flrig.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-01-16 18:19:53
|
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 1affac778b2b902cc218ec664b9716a1410dfb4d (commit) via 50a46431b2d5f263778c6cd09c7a416be4428d4b (commit) from 4b2d63f9f0c713a1c6fcd67a6f23739338545663 (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 1affac778b2b902cc218ec664b9716a1410dfb4d Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Jan 16 12:14:30 2021 -0600 Change ft1200 stop bits to 2. Found by Bill Sommerville with remote serial port testing. Were getting many ?; responses with stopbits=1 diff --git a/rigs/yaesu/ft1200.c b/rigs/yaesu/ft1200.c index 1a2da5d5..28b5eb92 100644 --- a/rigs/yaesu/ft1200.c +++ b/rigs/yaesu/ft1200.c @@ -89,7 +89,7 @@ const struct rig_caps ftdx1200_caps = RIG_MODEL(RIG_MODEL_FTDX1200), .model_name = "FTDX-1200", .mfg_name = "Yaesu", - .version = NEWCAT_VER ".0", + .version = NEWCAT_VER ".1", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -99,7 +99,7 @@ const struct rig_caps ftdx1200_caps = .serial_rate_min = 4800, /* Default rate per manual */ .serial_rate_max = 38400, .serial_data_bits = 8, - .serial_stop_bits = 1, /* Assumed since manual makes no mention */ + .serial_stop_bits = 2, /* found by testing with remote serial port */ .serial_parity = RIG_PARITY_NONE, .serial_handshake = RIG_HANDSHAKE_HARDWARE, .write_delay = FTDX1200_WRITE_DELAY, commit 50a46431b2d5f263778c6cd09c7a416be4428d4b Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Jan 16 09:31:15 2021 -0600 Make newcat_set_cmd_validate change VFOs when needed for band select https://github.com/Hamlib/Hamlib/issues/510 diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 875f9342..0aec7db7 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -352,11 +352,13 @@ static const yaesu_newcat_commands_t valid_commands[] = }; int valid_commands_count = sizeof(valid_commands) / sizeof( - yaesu_newcat_commands_t); + yaesu_newcat_commands_t); -static void errmsg(int err, const char *func, const char *file, int line, char *s) +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)); + rig_debug(RIG_DEBUG_ERR, "%s(%s:%d): %s: %s\b", __func__, file, line, s, + rigerror(err)); } /* @@ -792,7 +794,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, __func__, __FILE__, __LINE__, "newcat_set_cmd failed"); return err; } } @@ -818,12 +820,14 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) if (vfo == RIG_VFO_A || vfo == RIG_VFO_MAIN) { - changing = newcat_band_index(freq) != newcat_band_index(rig->state.cache.freqMainA); + changing = newcat_band_index(freq) != newcat_band_index( + rig->state.cache.freqMainA); rig_debug(RIG_DEBUG_TRACE, "%s: VFO_A freq changing=%d\n", __func__, changing); } else { - changing = newcat_band_index(freq) != newcat_band_index(rig->state.cache.freqMainB); + changing = newcat_band_index(freq) != newcat_band_index( + rig->state.cache.freqMainB); rig_debug(RIG_DEBUG_TRACE, "%s: VFO_B freq changing=%d\n", __func__, changing); } @@ -831,10 +835,24 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) // remove the split check here -- hopefully works OK //&& !rig->state.cache.split && !is_ft891 // 891 does not remember bandwidth so don't do this - && rig->caps->get_vfo!=NULL && rig->caps->set_vfo!=NULL) // gotta' have get_vfo too + && rig->caps->get_vfo != NULL + && rig->caps->set_vfo != NULL) // gotta' have get_vfo too { - snprintf(priv->cmd_str, sizeof(priv->cmd_str), "BS%02d%c", - newcat_band_index(freq), cat_term); + if (rig->state.current_vfo != vfo) + { + // then we need to change vfos, BS, and change back + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "VS1;BS%02d%c;VS0;", + newcat_band_index(freq), cat_term); + + if (vfo == RIG_VFO_A || vfo == RIG_VFO_MAIN) + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "VS0;BS%02d%c;VS1;", + newcat_band_index(freq), cat_term); + } + else + { + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "BS%02d%c", + newcat_band_index(freq), cat_term); + } if (RIG_OK != (err = newcat_set_cmd(rig))) { @@ -883,9 +901,11 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) err = rig_set_vfo(rig, vfotmp == RIG_VFO_A ? RIG_VFO_A : RIG_VFO_B); } - if (err != RIG_OK) { - rig_debug(RIG_DEBUG_ERR, "%s: rig_set_vfo failed: %s\n", __func__, rigerror(err)); - return err; + if (err != RIG_OK) + { + rig_debug(RIG_DEBUG_ERR, "%s: rig_set_vfo failed: %s\n", __func__, + rigerror(err)); + return err; } // after band select re-read things -- may not have to change anything ----------------------------------------------------------------------- Summary of changes: rigs/yaesu/ft1200.c | 4 ++-- rigs/yaesu/newcat.c | 44 ++++++++++++++++++++++++++++++++------------ 2 files changed, 34 insertions(+), 14 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-01-16 14:53:37
|
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 4b2d63f9f0c713a1c6fcd67a6f23739338545663 (commit) from 174d4118977de3c461aaaedc929843b0e491b5ba (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 4b2d63f9f0c713a1c6fcd67a6f23739338545663 Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Jan 16 08:50:54 2021 -0600 Fix newcat_set_cmd_validate band change checking https://github.com/Hamlib/Hamlib/issues/510 diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 5c2ba260..875f9342 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -352,7 +352,12 @@ static const yaesu_newcat_commands_t valid_commands[] = }; int valid_commands_count = sizeof(valid_commands) / sizeof( - yaesu_newcat_commands_t); + 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 @@ -726,6 +731,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"); return err; } @@ -775,6 +781,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"); return err; } @@ -785,6 +792,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"); return err; } } @@ -810,12 +818,12 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) if (vfo == RIG_VFO_A || vfo == RIG_VFO_MAIN) { - changing = newcat_band_index(freq) != rig->state.cache.freqMainA; + changing = newcat_band_index(freq) != newcat_band_index(rig->state.cache.freqMainA); rig_debug(RIG_DEBUG_TRACE, "%s: VFO_A freq changing=%d\n", __func__, changing); } else { - changing = newcat_band_index(freq) != rig->state.cache.freqMainB; + changing = newcat_band_index(freq) != newcat_band_index(rig->state.cache.freqMainB); rig_debug(RIG_DEBUG_TRACE, "%s: VFO_B freq changing=%d\n", __func__, changing); } ----------------------------------------------------------------------- Summary of changes: rigs/yaesu/newcat.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-01-16 13:39:45
|
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 174d4118977de3c461aaaedc929843b0e491b5ba (commit) from f2b8096529a0a659a49337d0188fcc19883282b5 (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 174d4118977de3c461aaaedc929843b0e491b5ba Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Jan 16 07:38:22 2021 -0600 Restrict newcat_set_cmd_validate BS to only rigs with get_vfo and set_vfo https://github.com/Hamlib/Hamlib/issues/510 diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index e236403f..5c2ba260 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -822,7 +822,8 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) if (newcat_valid_command(rig, "BS") && changing // remove the split check here -- hopefully works OK //&& !rig->state.cache.split - && !is_ft891) // 891 does not remember bandwidth so don't do this + && !is_ft891 // 891 does not remember bandwidth so don't do this + && rig->caps->get_vfo!=NULL && rig->caps->set_vfo!=NULL) // gotta' have get_vfo too { snprintf(priv->cmd_str, sizeof(priv->cmd_str), "BS%02d%c", newcat_band_index(freq), cat_term); @@ -874,7 +875,10 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) err = rig_set_vfo(rig, vfotmp == RIG_VFO_A ? RIG_VFO_A : RIG_VFO_B); } - if (err != RIG_OK) { return err; } + if (err != RIG_OK) { + rig_debug(RIG_DEBUG_ERR, "%s: rig_set_vfo failed: %s\n", __func__, rigerror(err)); + return err; + } // after band select re-read things -- may not have to change anything freq_t tmp_freqA, tmp_freqB; diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h index 3033e920..dfa3bdb5 100644 --- a/rigs/yaesu/newcat.h +++ b/rigs/yaesu/newcat.h @@ -50,7 +50,7 @@ typedef char ncboolean; /* shared function version */ -#define NEWCAT_VER "20210115" +#define NEWCAT_VER "20210116" /* Hopefully large enough for future use, 128 chars plus '\0' */ #define NEWCAT_DATA_LEN 129 ----------------------------------------------------------------------- Summary of changes: rigs/yaesu/newcat.c | 8 ++++++-- rigs/yaesu/newcat.h | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-01-16 04:31:58
|
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 f2b8096529a0a659a49337d0188fcc19883282b5 (commit) from 14493d4df5a26d606d3a145462eca7a759da1aee (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 f2b8096529a0a659a49337d0188fcc19883282b5 Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Jan 15 22:29:46 2021 -0600 Fix 2nd BS call in newcat.c https://github.com/Hamlib/Hamlib/issues/510 diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index ded0e20e..e236403f 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -854,6 +854,9 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) if (err != RIG_OK) { return err; } + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "BS%02d%c", + newcat_band_index(freq), cat_term); + if (RIG_OK != (err = newcat_set_cmd(rig))) { rig_debug(RIG_DEBUG_ERR, "%s: Unexpected error with BS command#2=%s\n", ----------------------------------------------------------------------- Summary of changes: rigs/yaesu/newcat.c | 3 +++ 1 file changed, 3 insertions(+) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-01-15 23:41:14
|
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 14493d4df5a26d606d3a145462eca7a759da1aee (commit) from a7b9620f910e2270caca7a2381d200615560bbcc (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 14493d4df5a26d606d3a145462eca7a759da1aee Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Jan 15 17:39:37 2021 -0600 newcat.c make band_index vfo check work for both VFOS https://github.com/Hamlib/Hamlib/issues/510 diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 38116954..ded0e20e 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -842,7 +842,15 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) if (err != RIG_OK) { return err; } - err = rig_set_vfo(rig, vfotmp == RIG_VFO_MAIN ? RIG_VFO_SUB : RIG_VFO_MAIN); + if (rig->state.vfo_list & RIG_VFO_MAIN) + { + err = rig_set_vfo(rig, vfotmp == RIG_VFO_MAIN ? RIG_VFO_SUB : RIG_VFO_MAIN); + } + else + { + err = rig_set_vfo(rig, vfotmp == RIG_VFO_A ? RIG_VFO_B : RIG_VFO_A); + } + if (err != RIG_OK) { return err; } @@ -854,7 +862,14 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) } // switch back to the starting vfo - err = rig_set_vfo(rig, vfotmp == RIG_VFO_MAIN ? RIG_VFO_MAIN : RIG_VFO_SUB); + if (rig->state.vfo_list & RIG_VFO_MAIN) + { + err = rig_set_vfo(rig, vfotmp == RIG_VFO_MAIN ? RIG_VFO_MAIN : RIG_VFO_SUB); + } + else + { + err = rig_set_vfo(rig, vfotmp == RIG_VFO_A ? RIG_VFO_A : RIG_VFO_B); + } if (err != RIG_OK) { return err; } ----------------------------------------------------------------------- Summary of changes: rigs/yaesu/newcat.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-01-15 23:29:40
|
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 a7b9620f910e2270caca7a2381d200615560bbcc (commit) from 598b105e79f8adda2d3844b712028871e8265d6d (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 a7b9620f910e2270caca7a2381d200615560bbcc Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Jan 15 17:29:02 2021 -0600 Make band_index detect change by VFO https://github.com/Hamlib/Hamlib/issues/510 diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index ef520dd7..38116954 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -806,8 +806,20 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) // // Restore band memory if we can and band is changing -- we do it before we set the frequency // And only when not in split mode (note this check has been removed for testing) - if (newcat_valid_command(rig, "BS") - && newcat_band_index(freq) != newcat_band_index(rig->state.current_freq) + int changing; + + if (vfo == RIG_VFO_A || vfo == RIG_VFO_MAIN) + { + changing = newcat_band_index(freq) != rig->state.cache.freqMainA; + rig_debug(RIG_DEBUG_TRACE, "%s: VFO_A freq changing=%d\n", __func__, changing); + } + else + { + changing = newcat_band_index(freq) != rig->state.cache.freqMainB; + rig_debug(RIG_DEBUG_TRACE, "%s: VFO_B freq changing=%d\n", __func__, changing); + } + + if (newcat_valid_command(rig, "BS") && changing // remove the split check here -- hopefully works OK //&& !rig->state.cache.split && !is_ft891) // 891 does not remember bandwidth so don't do this ----------------------------------------------------------------------- Summary of changes: rigs/yaesu/newcat.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-01-15 22:49:18
|
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 598b105e79f8adda2d3844b712028871e8265d6d (commit) via 28c7ee7f88959eee3968958578790fe7818ee73f (commit) from 1cd433b0d4d338bc2058b636b1d98d372d46fc02 (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 598b105e79f8adda2d3844b712028871e8265d6d Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Jan 15 16:48:32 2021 -0600 astyle files prepping for 4.1 release diff --git a/rigs/dummy/flrig.c b/rigs/dummy/flrig.c index 46eea2de..9711509f 100644 --- a/rigs/dummy/flrig.c +++ b/rigs/dummy/flrig.c @@ -1883,7 +1883,7 @@ static int flrig_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) int retval; char cmd_arg[MAXARGLEN]; char *cmd; - char *param_type="i4"; + char *param_type = "i4"; rig_debug(RIG_DEBUG_TRACE, "%s: vfo=%s level=%d, val=%f\n", __func__, rig_strvfo(vfo), (int)level, val.f); @@ -1897,13 +1897,13 @@ static int flrig_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) switch (level) { - case RIG_LEVEL_RF: cmd = "rig.set_rfgain"; val.f*= 100; break; + case RIG_LEVEL_RF: cmd = "rig.set_rfgain"; val.f *= 100; break; - case RIG_LEVEL_AF: cmd = "rig.set_volume"; val.f*= 100; break; + case RIG_LEVEL_AF: cmd = "rig.set_volume"; val.f *= 100; break; - case RIG_LEVEL_MICGAIN: cmd = "rig.set_micgain"; val.f*= 100; break; + case RIG_LEVEL_MICGAIN: cmd = "rig.set_micgain"; val.f *= 100; break; - case RIG_LEVEL_RFPOWER: cmd = "rig.set_power"; val.f*= 100; break; + case RIG_LEVEL_RFPOWER: cmd = "rig.set_power"; val.f *= 100; break; default: rig_debug(RIG_DEBUG_ERR, "%s: invalid level=%d\n", __func__, (int)level); @@ -1949,7 +1949,7 @@ static int flrig_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) case RIG_LEVEL_MICGAIN: cmd = "rig.get_micgain"; break; case RIG_LEVEL_STRENGTH: cmd = "rig.get_smeter"; break; - + case RIG_LEVEL_RFPOWER: cmd = "rig.get_power"; break; case RIG_LEVEL_RFPOWER_METER_WATTS: diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index d11f7087..8d9739eb 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -715,7 +715,7 @@ int icom_get_usb_echo_off(RIG *rig) rig_debug(RIG_DEBUG_VERBOSE, "%s: ack_len=%d\n", __func__, ack_len); - if (retval == -RIG_ETIMEOUT) return retval; + if (retval == -RIG_ETIMEOUT) { return retval; } if (retval == RIG_OK) { diff --git a/rigs/kit/dwt.c b/rigs/kit/dwt.c index 65252db5..787aba17 100644 --- a/rigs/kit/dwt.c +++ b/rigs/kit/dwt.c @@ -342,7 +342,7 @@ int dwtdll_cleanup(RIG *rig) struct dwtdll_priv_data *priv = (struct dwtdll_priv_data *)rig->state.priv; /* Clean up the dll access */ - if (priv) FreeLibrary(priv->dll); + if (priv) { FreeLibrary(priv->dll); } if (rig->state.priv) { diff --git a/rigs/kit/elektor507.c b/rigs/kit/elektor507.c index fcca4a2f..5ecc4687 100644 --- a/rigs/kit/elektor507.c +++ b/rigs/kit/elektor507.c @@ -345,7 +345,7 @@ int elektor507_cleanup(RIG *rig) rig->state.priv; /* Clean up the dll access */ - if (priv) FreeLibrary(priv->extra_priv.dll); + if (priv) { FreeLibrary(priv->extra_priv.dll); } if (rig->state.priv) { diff --git a/rigs/winradio/g303.c b/rigs/winradio/g303.c index dda2c5cc..0858449d 100644 --- a/rigs/winradio/g303.c +++ b/rigs/winradio/g303.c @@ -272,7 +272,7 @@ int g3_cleanup(RIG *rig) struct g3_priv_data *priv = (struct g3_priv_data *)rig->state.priv; /* Clean up the dll access */ - if (priv) FreeLibrary(priv->dll); + if (priv) { FreeLibrary(priv->dll); } if (rig->state.priv) { diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index bc182efb..ef520dd7 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -540,9 +540,10 @@ int newcat_open(RIG *rig) rig_debug(RIG_DEBUG_VERBOSE, "%s: rig_id=%d\n", __func__, priv->rig_id); #if 0 // possible future enhancement? + // some rigs have a CAT TOT timeout that defaults to 10ms // so we'll increase CAT timeout to 100ms - if (priv->rig_id == NC_RIGID_FT2000 + if (priv->rig_id == NC_RIGID_FT2000 || priv->rig_id == NC_RIGID_FT2000D || priv->rig_id == NC_RIGID_FT891 || priv->rig_id == NC_RIGID_FT991 @@ -550,9 +551,11 @@ int newcat_open(RIG *rig) { int err; char *cmd = "EX0291%c"; - if (priv->rig_id == NC_RIGID_FT950) cmd = "EX0271%c"; - else if (priv->rig_id == NC_RIGID_FT891) cmd = "EX05071c"; - else if (priv->rig_id == NC_RIGID_FT991) cmd = "EX0321c"; + + if (priv->rig_id == NC_RIGID_FT950) { cmd = "EX0271%c"; } + else if (priv->rig_id == NC_RIGID_FT891) { cmd = "EX05071c"; } + else if (priv->rig_id == NC_RIGID_FT991) { cmd = "EX0321c"; } + snprintf(priv->cmd_str, sizeof(priv->cmd_str), cmd, cat_term); if (RIG_OK != (err = newcat_set_cmd(rig))) @@ -560,6 +563,7 @@ int newcat_open(RIG *rig) return err; } } + #endif rig_debug(RIG_DEBUG_VERBOSE, "%s: returning RIG_OK\n", __func__); @@ -804,7 +808,7 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) // And only when not in split mode (note this check has been removed for testing) if (newcat_valid_command(rig, "BS") && newcat_band_index(freq) != newcat_band_index(rig->state.current_freq) - // remove the split check here -- hopefully works OK + // remove the split check here -- hopefully works OK //&& !rig->state.cache.split && !is_ft891) // 891 does not remember bandwidth so don't do this { @@ -813,7 +817,8 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) if (RIG_OK != (err = newcat_set_cmd(rig))) { - rig_debug(RIG_DEBUG_ERR, "%s: Unexpected error with BS command#1=%s\n", __func__, + rig_debug(RIG_DEBUG_ERR, "%s: Unexpected error with BS command#1=%s\n", + __func__, rigerror(err)); } else @@ -821,18 +826,26 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) // Also need to do this for the other VFO on some Yaesu rigs // is redundant for rigs where band stack includes both vfos vfo_t vfotmp; - err = rig_get_vfo(rig, &vfotmp); - if (err != RIG_OK) return err; - err = rig_set_vfo(rig, vfotmp==RIG_VFO_MAIN?RIG_VFO_SUB:RIG_VFO_MAIN); - if (err != RIG_OK) return err; + err = rig_get_vfo(rig, &vfotmp); + + if (err != RIG_OK) { return err; } + + err = rig_set_vfo(rig, vfotmp == RIG_VFO_MAIN ? RIG_VFO_SUB : RIG_VFO_MAIN); + + if (err != RIG_OK) { return err; } + if (RIG_OK != (err = newcat_set_cmd(rig))) { - rig_debug(RIG_DEBUG_ERR, "%s: Unexpected error with BS command#2=%s\n", __func__, - rigerror(err)); + rig_debug(RIG_DEBUG_ERR, "%s: Unexpected error with BS command#2=%s\n", + __func__, + rigerror(err)); } + // switch back to the starting vfo - err = rig_set_vfo(rig, vfotmp==RIG_VFO_MAIN?RIG_VFO_MAIN:RIG_VFO_SUB); - if (err != RIG_OK) return err; + err = rig_set_vfo(rig, vfotmp == RIG_VFO_MAIN ? RIG_VFO_MAIN : RIG_VFO_SUB); + + if (err != RIG_OK) { return err; } + // after band select re-read things -- may not have to change anything freq_t tmp_freqA, tmp_freqB; rmode_t tmp_mode; @@ -841,10 +854,12 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) rig_get_freq(rig, RIG_VFO_SUB, &tmp_freqB); rig_get_mode(rig, RIG_VFO_MAIN, &tmp_mode, &tmp_width); rig_get_mode(rig, RIG_VFO_SUB, &tmp_mode, &tmp_width); + if ((target_vfo == 0 && tmp_freqA == freq) - || (target_vfo == 1 && tmp_freqB == freq)) + || (target_vfo == 1 && tmp_freqB == freq)) { - rig_debug(RIG_DEBUG_VERBOSE, "%s: freq after band select already set to %"PRIfreq"\n", __func__, 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!! } } @@ -2577,7 +2592,7 @@ int newcat_set_ctcss_tone(RIG *rig, vfo_t vfo, tone_t tone) if (tone == 0) /* turn off ctcss */ { snprintf(priv->cmd_str, sizeof(priv->cmd_str), "CT%c0%c", main_sub_vfo, - cat_term); + cat_term); } else { @@ -3309,7 +3324,8 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) break; - case RIG_LEVEL_IF: { + case RIG_LEVEL_IF: + { pbwidth_t width; rmode_t mode = 0; @@ -3362,11 +3378,13 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) // Some Yaesu rigs reject this command in AM/FM modes if (is_ft991 || is_ftdx5000 || is_ftdx101) { - if (mode & RIG_MODE_AM || mode & RIG_MODE_FM || mode & RIG_MODE_AMN || mode & RIG_MODE_FMN) + if (mode & RIG_MODE_AM || mode & RIG_MODE_FM || mode & RIG_MODE_AMN + || mode & RIG_MODE_FMN) { priv->question_mark_response_means_rejected = 1; } } + break; } @@ -3415,7 +3433,8 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) snprintf(priv->cmd_str, sizeof(priv->cmd_str), "KS%03d%c", val.i, cat_term); break; - case RIG_LEVEL_MICGAIN: { + case RIG_LEVEL_MICGAIN: + { pbwidth_t width; rmode_t mode = 0; @@ -3449,6 +3468,7 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) priv->question_mark_response_means_rejected = 1; } } + break; } @@ -3655,6 +3675,7 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) priv->cmd_str[2] = main_sub_vfo; } } + break; case RIG_LEVEL_COMP: @@ -4087,7 +4108,8 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) cat_term); break; - case RIG_LEVEL_IF: { + case RIG_LEVEL_IF: + { pbwidth_t width; rmode_t mode = 0; @@ -4112,11 +4134,13 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) // Some Yaesu rigs reject this command in AM/FM modes if (is_ft991 || is_ftdx5000 || is_ftdx101) { - if (mode & RIG_MODE_AM || mode & RIG_MODE_FM || mode & RIG_MODE_AMN || mode & RIG_MODE_FMN) + if (mode & RIG_MODE_AM || mode & RIG_MODE_FM || mode & RIG_MODE_AMN + || mode & RIG_MODE_FMN) { priv->question_mark_response_means_rejected = 1; } } + break; } @@ -4138,7 +4162,8 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) snprintf(priv->cmd_str, sizeof(priv->cmd_str), "KS%c", cat_term); break; - case RIG_LEVEL_MICGAIN: { + case RIG_LEVEL_MICGAIN: + { pbwidth_t width; rmode_t mode = 0; @@ -4162,6 +4187,7 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) priv->question_mark_response_means_rejected = 1; } } + break; } @@ -4966,7 +4992,8 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) switch (func) { - case RIG_FUNC_ANF: { + case RIG_FUNC_ANF: + { pbwidth_t width; rmode_t mode = 0; @@ -4996,10 +5023,12 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) priv->question_mark_response_means_rejected = 1; } } + break; - } + } - case RIG_FUNC_MN: { + case RIG_FUNC_MN: + { pbwidth_t width; rmode_t mode = 0; @@ -5029,6 +5058,7 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) priv->question_mark_response_means_rejected = 1; } } + break; } @@ -5120,7 +5150,8 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) break; - case RIG_FUNC_NR: { + case RIG_FUNC_NR: + { pbwidth_t width; rmode_t mode = 0; @@ -5150,10 +5181,12 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) priv->question_mark_response_means_rejected = 1; } } + break; } - case RIG_FUNC_COMP: { + case RIG_FUNC_COMP: + { pbwidth_t width; rmode_t mode = 0; @@ -5182,12 +5215,14 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) // Some Yaesu rigs reject this command in AM/FM/RTTY modes if (is_ft991 || is_ftdx5000 || is_ftdx101) { - if (mode & RIG_MODE_AM || mode & RIG_MODE_FM || mode & RIG_MODE_AMN || mode & RIG_MODE_FMN || + if (mode & RIG_MODE_AM || mode & RIG_MODE_FM || mode & RIG_MODE_AMN + || mode & RIG_MODE_FMN || mode & RIG_MODE_RTTY || mode & RIG_MODE_RTTYR) { priv->question_mark_response_means_rejected = 1; } } + break; } @@ -5263,7 +5298,8 @@ int newcat_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status) switch (func) { - case RIG_FUNC_ANF: { + case RIG_FUNC_ANF: + { pbwidth_t width; rmode_t mode = 0; @@ -5292,6 +5328,7 @@ int newcat_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status) priv->question_mark_response_means_rejected = 1; } } + break; } @@ -9259,6 +9296,7 @@ int newcat_get_cmd(RIG *rig) while (rc != RIG_OK && retry_count++ <= state->rigport.retry) { rig_flush(&state->rigport); /* discard any unsolicited data */ + if (rc != -RIG_BUSBUSY) { /* send the command */ @@ -9326,6 +9364,7 @@ int newcat_get_cmd(RIG *rig) break; /* retry */ case '?': + /* The ? response is ambiguous and undocumented by Yaesu, but for get commands it seems to * indicate that the rig rejected the command because the state of the rig is not valid for the command * or that the command parameter is invalid. Retrying the command does not fix the issue, @@ -9346,13 +9385,14 @@ int newcat_get_cmd(RIG *rig) */ if (priv->question_mark_response_means_rejected) { - rig_debug(RIG_DEBUG_ERR, "%s: Command rejected by the rig (get): '%s'\n", __func__, - priv->cmd_str); + rig_debug(RIG_DEBUG_ERR, "%s: Command rejected by the rig (get): '%s'\n", + __func__, + priv->cmd_str); return -RIG_ERJCTED; } rig_debug(RIG_DEBUG_WARN, "%s: Rig busy - retrying %d of %d: '%s'\n", __func__, - retry_count, state->rigport.retry, priv->cmd_str); + retry_count, state->rigport.retry, priv->cmd_str); rc = -RIG_ERJCTED; /* retry */ break; @@ -9398,76 +9438,88 @@ int newcat_set_cmd_validate(RIG *rig) struct rig_state *state = &rig->state; struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; char valcmd[16]; - int retries=8; - int retry=0; + int retries = 8; + int retry = 0; int sleepms = 50; int rc = -RIG_EPROTO; 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)) + + if ((strncmp(priv->cmd_str, "FA", 2) == 0) && (strlen(priv->cmd_str) > 3)) { - strcpy(valcmd,"FA;"); + strcpy(valcmd, "FA;"); } - else if ((strncmp(priv->cmd_str,"FB",2)==0) && (strlen(priv->cmd_str)>3)) + else if ((strncmp(priv->cmd_str, "FB", 2) == 0) && (strlen(priv->cmd_str) > 3)) { - strcpy(valcmd,"FB;"); + strcpy(valcmd, "FB;"); } - else if ((strncmp(priv->cmd_str,"MD",2)==0) && (strlen(priv->cmd_str)>3)) + else if ((strncmp(priv->cmd_str, "MD", 2) == 0) && (strlen(priv->cmd_str) > 3)) { - strcpy(valcmd,priv->cmd_str); // pull the needed part of the cmd - valcmd[3]=';'; - valcmd[4]=0; + strcpy(valcmd, priv->cmd_str); // pull the needed part of the cmd + valcmd[3] = ';'; + valcmd[4] = 0; } - else if ((strncmp(priv->cmd_str,"TX",2)==0) && (strlen(priv->cmd_str)>3)) + else if ((strncmp(priv->cmd_str, "TX", 2) == 0) && (strlen(priv->cmd_str) > 3)) { - strcpy(valcmd,"TX;"); + strcpy(valcmd, "TX;"); } - else if ((strncmp(priv->cmd_str,"FT",2)==0) && (strlen(priv->cmd_str)>3)) + else if ((strncmp(priv->cmd_str, "FT", 2) == 0) && (strlen(priv->cmd_str) > 3)) { - strcpy(valcmd,"FT;"); + strcpy(valcmd, "FT;"); } - else if ((strncmp(priv->cmd_str,"AI",2)==0) && (strlen(priv->cmd_str)>3)) + else if ((strncmp(priv->cmd_str, "AI", 2) == 0) && (strlen(priv->cmd_str) > 3)) { - strcpy(valcmd,"AI;"); + strcpy(valcmd, "AI;"); } - else if ((strncmp(priv->cmd_str,"VS",2)==0) && (strlen(priv->cmd_str)>3)) + else if ((strncmp(priv->cmd_str, "VS", 2) == 0) && (strlen(priv->cmd_str) > 3)) { - strcpy(valcmd,"VS;"); + strcpy(valcmd, "VS;"); } else { rig_debug(RIG_DEBUG_ERR, "%s: %s not implemented\n", __func__, priv->cmd_str); return -RIG_ENIMPL; } + while (rc != RIG_OK && retry++ < retries) { int bytes; char cmd[256]; // big enough rig_flush(&state->rigport); /* discard any unsolicited data */ - snprintf(cmd,sizeof(cmd),"%s%s",priv->cmd_str,valcmd); + snprintf(cmd, sizeof(cmd), "%s%s", priv->cmd_str, valcmd); rc = write_block(&state->rigport, cmd, strlen(cmd)); - if (rc != RIG_OK) return -RIG_EIO; + + if (rc != RIG_OK) { return -RIG_EIO; } + bytes = read_string(&state->rigport, priv->ret_data, sizeof(priv->ret_data), - &cat_term, sizeof(cat_term)); - if (strncmp(priv->cmd_str,"FT",2)==0 && strncmp(priv->ret_data,"FT",2)==0) + &cat_term, sizeof(cat_term)); + + if (strncmp(priv->cmd_str, "FT", 2) == 0 + && 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; } - if (strncmp(priv->cmd_str,"TX",2)==0 && strncmp(priv->ret_data,"TX",2)==0) + + 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; } + if (bytes > 0) { // if they match we are validated - if (strcmp(priv->cmd_str, priv->ret_data)==0) return RIG_OK; - else rc = -RIG_EPROTO; + if (strcmp(priv->cmd_str, priv->ret_data) == 0) { return RIG_OK; } + else { rc = -RIG_EPROTO; } } - rig_debug(RIG_DEBUG_ERR, "%s: cmd validation failed, '%s'!='%s', try#%d\n", __func__, priv->cmd_str, priv->ret_data, retry); - hl_usleep(sleepms*1000); - } + + rig_debug(RIG_DEBUG_ERR, "%s: cmd validation failed, '%s'!='%s', try#%d\n", + __func__, priv->cmd_str, priv->ret_data, retry); + hl_usleep(sleepms * 1000); + } + return -RIG_EPROTO; } /* @@ -9498,7 +9550,9 @@ int newcat_set_cmd(RIG *rig) rig_debug(RIG_DEBUG_TRACE, "cmd_str = %s\n", priv->cmd_str); rc = newcat_set_cmd_validate(rig); - if (rc==RIG_OK) { + + if (rc == RIG_OK) + { rig_debug(RIG_DEBUG_TRACE, "%s: cmd_validate OK\n", __func__); return RIG_OK; } @@ -9507,7 +9561,9 @@ int newcat_set_cmd(RIG *rig) rig_debug(RIG_DEBUG_TRACE, "%s: set_cmd_validate failed\n", __func__); return rc; } - rig_debug(RIG_DEBUG_TRACE, "%s: newcat_set_cmd_validate not implemented...continuing\n", __func__); + + rig_debug(RIG_DEBUG_TRACE, + "%s: newcat_set_cmd_validate not implemented...continuing\n", __func__); if (RIG_OK != (rc = write_block(&state->rigport, priv->cmd_str, strlen(priv->cmd_str)))) @@ -9521,9 +9577,10 @@ int newcat_set_cmd(RIG *rig) return RIG_OK; } - if (strncmp(priv->cmd_str,"BS",2)==0) - { // the BS command needs time to do it's thing - hl_usleep(200*1000); + if (strncmp(priv->cmd_str, "BS", 2) == 0) + { + // the BS command needs time to do it's thing + hl_usleep(200 * 1000); priv->cache_start.tv_sec = 0; // invalidate the cache } @@ -9596,14 +9653,15 @@ int newcat_set_cmd(RIG *rig) */ if (priv->question_mark_response_means_rejected) { - rig_debug(RIG_DEBUG_ERR, "%s: Command rejected by the rig (set): '%s'\n", __func__, + rig_debug(RIG_DEBUG_ERR, "%s: Command rejected by the rig (set): '%s'\n", + __func__, priv->cmd_str); return -RIG_ERJCTED; } /* Rig busy wait please */ rig_debug(RIG_DEBUG_WARN, "%s: Rig busy - retrying: '%s'\n", __func__, - priv->cmd_str); + priv->cmd_str); /* read/flush the verify command reply which should still be there */ if ((rc = read_string(&state->rigport, priv->ret_data, sizeof(priv->ret_data), diff --git a/src/misc.c b/src/misc.c index bfe5d2ad..41ac1502 100644 --- a/src/misc.c +++ b/src/misc.c @@ -1636,6 +1636,7 @@ int HAMLIB_API parse_hoststr(char *hoststr, char host[256], char port[6]) // Handle device names 1st if (strstr(hoststr, "/dev")) { return -1; } + if (strstr(hoststr, "/")) { return -1; } // posible path -- no hostname starts with / if (strncasecmp(hoststr, "com", 3) == 0) { return -1; } diff --git a/src/rig.c b/src/rig.c index 06b29be1..edd87fd2 100644 --- a/src/rig.c +++ b/src/rig.c @@ -428,7 +428,8 @@ RIG *HAMLIB_API rig_init(rig_model_t rig_model) // if we don't have list1 we'll try list2 if (rs->rx_range_list == NULL) { - rig_debug(RIG_DEBUG_TRACE, "%s: rx_range_list1 is empty, using rx_range_list2\n", __func__); + rig_debug(RIG_DEBUG_TRACE, + "%s: rx_range_list1 is empty, using rx_range_list2\n", __func__); memcpy(rs->tx_range_list, caps->rx_range_list2, sizeof(struct freq_range_list)*FRQRANGESIZ); memcpy(rs->rx_range_list, caps->tx_range_list2, commit 28c7ee7f88959eee3968958578790fe7818ee73f Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Jan 15 16:36:07 2021 -0600 Add BS command for "other" VFO for Yaesu rigs This should be redundant for rigs where the bandstack includes both VFOs https://github.com/Hamlib/Hamlib/issues/510 diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 6e85d0d2..bc182efb 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -813,19 +813,34 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) if (RIG_OK != (err = newcat_set_cmd(rig))) { - rig_debug(RIG_DEBUG_ERR, "%s: Unexpected error with BS command=%s\n", __func__, + rig_debug(RIG_DEBUG_ERR, "%s: Unexpected error with BS command#1=%s\n", __func__, rigerror(err)); } else { + // Also need to do this for the other VFO on some Yaesu rigs + // is redundant for rigs where band stack includes both vfos + vfo_t vfotmp; + err = rig_get_vfo(rig, &vfotmp); + if (err != RIG_OK) return err; + err = rig_set_vfo(rig, vfotmp==RIG_VFO_MAIN?RIG_VFO_SUB:RIG_VFO_MAIN); + if (err != RIG_OK) return err; + if (RIG_OK != (err = newcat_set_cmd(rig))) + { + rig_debug(RIG_DEBUG_ERR, "%s: Unexpected error with BS command#2=%s\n", __func__, + rigerror(err)); + } + // switch back to the starting vfo + err = rig_set_vfo(rig, vfotmp==RIG_VFO_MAIN?RIG_VFO_MAIN:RIG_VFO_SUB); + if (err != RIG_OK) return err; // after band select re-read things -- may not have to change anything freq_t tmp_freqA, tmp_freqB; rmode_t tmp_mode; pbwidth_t tmp_width; - rig_get_freq(rig, RIG_VFO_A, &tmp_freqA); - rig_get_freq(rig, RIG_VFO_B, &tmp_freqB); - rig_get_mode(rig, RIG_VFO_A, &tmp_mode, &tmp_width); - rig_get_mode(rig, RIG_VFO_B, &tmp_mode, &tmp_width); + rig_get_freq(rig, RIG_VFO_MAIN, &tmp_freqA); + rig_get_freq(rig, RIG_VFO_SUB, &tmp_freqB); + rig_get_mode(rig, RIG_VFO_MAIN, &tmp_mode, &tmp_width); + rig_get_mode(rig, RIG_VFO_SUB, &tmp_mode, &tmp_width); if ((target_vfo == 0 && tmp_freqA == freq) || (target_vfo == 1 && tmp_freqB == freq)) { @@ -9415,6 +9430,10 @@ int newcat_set_cmd_validate(RIG *rig) { strcpy(valcmd,"AI;"); } + else if ((strncmp(priv->cmd_str,"VS",2)==0) && (strlen(priv->cmd_str)>3)) + { + strcpy(valcmd,"VS;"); + } else { rig_debug(RIG_DEBUG_ERR, "%s: %s not implemented\n", __func__, priv->cmd_str); ----------------------------------------------------------------------- Summary of changes: rigs/dummy/flrig.c | 12 +-- rigs/icom/icom.c | 2 +- rigs/kit/dwt.c | 2 +- rigs/kit/elektor507.c | 2 +- rigs/winradio/g303.c | 2 +- rigs/yaesu/newcat.c | 201 ++++++++++++++++++++++++++++++++++---------------- src/misc.c | 1 + src/rig.c | 3 +- 8 files changed, 152 insertions(+), 73 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-01-15 20:18:27
|
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 1cd433b0d4d338bc2058b636b1d98d372d46fc02 (commit) from fb026f7fafe5cda6f4dd9e8ac44591fe831e41c8 (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 1cd433b0d4d338bc2058b636b1d98d372d46fc02 Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Jan 15 14:17:35 2021 -0600 Increase newcat_set_cmd_validate retries to 8 https://github.com/Hamlib/Hamlib/issues/505 diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 16d6f433..6e85d0d2 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -9383,7 +9383,7 @@ int newcat_set_cmd_validate(RIG *rig) struct rig_state *state = &rig->state; struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; char valcmd[16]; - int retries=5; + int retries=8; int retry=0; int sleepms = 50; int rc = -RIG_EPROTO; ----------------------------------------------------------------------- Summary of changes: rigs/yaesu/newcat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-01-15 18:28:10
|
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 fb026f7fafe5cda6f4dd9e8ac44591fe831e41c8 (commit) via c7a5ae3e347df4d5e1b9648854d6b1327784d0c8 (commit) via c3ac828cdb5c98e13a64a1d9c8a0af38badb1a8a (commit) from 59df7ccc23ce36b735fd118cf61b87a296028e20 (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 fb026f7fafe5cda6f4dd9e8ac44591fe831e41c8 Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Jan 15 12:27:04 2021 -0600 Remove BS from newcat_cmd_set_validate as there is no read capability https://github.com/Hamlib/Hamlib/issues/505 diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 95ee5b5e..16d6f433 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -9411,10 +9411,6 @@ int newcat_set_cmd_validate(RIG *rig) { strcpy(valcmd,"FT;"); } - else if ((strncmp(priv->cmd_str,"BS",2)==0) && (strlen(priv->cmd_str)>3)) - { - strcpy(valcmd,"BS;"); - } else if ((strncmp(priv->cmd_str,"AI",2)==0) && (strlen(priv->cmd_str)>3)) { strcpy(valcmd,"AI;"); commit c7a5ae3e347df4d5e1b9648854d6b1327784d0c8 Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Jan 15 12:02:58 2021 -0600 Fix boo boo https://github.com/Hamlib/Hamlib/issues/505 diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 7ae231fc..95ee5b5e 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -9429,7 +9429,7 @@ int newcat_set_cmd_validate(RIG *rig) int bytes; char cmd[256]; // big enough rig_flush(&state->rigport); /* discard any unsolicited data */ - snprintf(cmd,sizeof(cmd),"%s%s",priv->cmd_str,priv->valcmd); + snprintf(cmd,sizeof(cmd),"%s%s",priv->cmd_str,valcmd); rc = write_block(&state->rigport, cmd, strlen(cmd)); if (rc != RIG_OK) return -RIG_EIO; bytes = read_string(&state->rigport, priv->ret_data, sizeof(priv->ret_data), commit c3ac828cdb5c98e13a64a1d9c8a0af38badb1a8a Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Jan 15 12:01:06 2021 -0600 Combine writes in newcat_set_cmd_validate to speed up timing https://github.com/Hamlib/Hamlib/issues/505 diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index d1f95695..7ae231fc 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -9427,10 +9427,10 @@ int newcat_set_cmd_validate(RIG *rig) while (rc != RIG_OK && retry++ < retries) { int bytes; + char cmd[256]; // big enough rig_flush(&state->rigport); /* discard any unsolicited data */ - rc = write_block(&state->rigport, priv->cmd_str, strlen(priv->cmd_str)); - if (rc != RIG_OK) return -RIG_EIO; - rc = write_block(&state->rigport, valcmd, strlen(valcmd)); + snprintf(cmd,sizeof(cmd),"%s%s",priv->cmd_str,priv->valcmd); + rc = write_block(&state->rigport, cmd, strlen(cmd)); if (rc != RIG_OK) return -RIG_EIO; bytes = read_string(&state->rigport, priv->ret_data, sizeof(priv->ret_data), &cat_term, sizeof(cat_term)); ----------------------------------------------------------------------- Summary of changes: rigs/yaesu/newcat.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-01-15 17:51:07
|
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 59df7ccc23ce36b735fd118cf61b87a296028e20 (commit) from a2c43875431414beac4cfd99e569ee5d89df0c58 (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 59df7ccc23ce36b735fd118cf61b87a296028e20 Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Jan 15 11:44:50 2021 -0600 Fix newcat_set_cmd_validate TX command https://github.com/Hamlib/Hamlib/issues/505 diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index a357fbe1..d1f95695 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -9439,6 +9439,11 @@ int newcat_set_cmd_validate(RIG *rig) // FT command does not echo what's sent so we just check the basic command return 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; + } if (bytes > 0) { // if they match we are validated ----------------------------------------------------------------------- Summary of changes: rigs/yaesu/newcat.c | 5 +++++ 1 file changed, 5 insertions(+) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-01-15 17:18:02
|
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 a2c43875431414beac4cfd99e569ee5d89df0c58 (commit) from ad2c20f611ba1d2511d021edddef67d9b9ed7480 (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 a2c43875431414beac4cfd99e569ee5d89df0c58 Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Jan 15 11:17:23 2021 -0600 Fit newcat_set_command_validate FT comparison https://github.com/Hamlib/Hamlib/issues/505 diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 990de8ef..a357fbe1 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -9434,6 +9434,11 @@ int newcat_set_cmd_validate(RIG *rig) if (rc != RIG_OK) return -RIG_EIO; bytes = read_string(&state->rigport, priv->ret_data, sizeof(priv->ret_data), &cat_term, sizeof(cat_term)); + if (strncmp(priv->cmd_str,"FT",2)==0 && 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; + } if (bytes > 0) { // if they match we are validated ----------------------------------------------------------------------- Summary of changes: rigs/yaesu/newcat.c | 5 +++++ 1 file changed, 5 insertions(+) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-01-15 16:59:28
|
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 ad2c20f611ba1d2511d021edddef67d9b9ed7480 (commit) via ea9a70674366640b42a3d0949251f3606e88d15c (commit) from 517fb87b8bded5478510bc903e52347715503591 (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 ad2c20f611ba1d2511d021edddef67d9b9ed7480 Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Jan 15 10:58:47 2021 -0600 Fix newcat_set_cmd_validate read_string check https://github.com/Hamlib/Hamlib/issues/505 diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 893ba768..990de8ef 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -9426,14 +9426,15 @@ int newcat_set_cmd_validate(RIG *rig) } while (rc != RIG_OK && retry++ < retries) { + int bytes; rig_flush(&state->rigport); /* discard any unsolicited data */ rc = write_block(&state->rigport, priv->cmd_str, strlen(priv->cmd_str)); if (rc != RIG_OK) return -RIG_EIO; rc = write_block(&state->rigport, valcmd, strlen(valcmd)); if (rc != RIG_OK) return -RIG_EIO; - rc = read_string(&state->rigport, priv->ret_data, sizeof(priv->ret_data), + bytes = read_string(&state->rigport, priv->ret_data, sizeof(priv->ret_data), &cat_term, sizeof(cat_term)); - if (rc == RIG_OK) + if (bytes > 0) { // if they match we are validated if (strcmp(priv->cmd_str, priv->ret_data)==0) return RIG_OK; commit ea9a70674366640b42a3d0949251f3606e88d15c Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Jan 15 10:56:27 2021 -0600 Add debug for newcat_set_cmd_validate https://github.com/Hamlib/Hamlib/issues/505 diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index b1336f6e..893ba768 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -9439,9 +9439,9 @@ int newcat_set_cmd_validate(RIG *rig) if (strcmp(priv->cmd_str, priv->ret_data)==0) return RIG_OK; else rc = -RIG_EPROTO; } - rig_debug(RIG_DEBUG_ERR, "%s: cmd validation failed, try#%d\n", __func__, retry); + rig_debug(RIG_DEBUG_ERR, "%s: cmd validation failed, '%s'!='%s', try#%d\n", __func__, priv->cmd_str, priv->ret_data, retry); hl_usleep(sleepms*1000); - } while(--retry > 0); + } return -RIG_EPROTO; } /* diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h index 3ad84a0d..3033e920 100644 --- a/rigs/yaesu/newcat.h +++ b/rigs/yaesu/newcat.h @@ -50,7 +50,7 @@ typedef char ncboolean; /* shared function version */ -#define NEWCAT_VER "20210114" +#define NEWCAT_VER "20210115" /* Hopefully large enough for future use, 128 chars plus '\0' */ #define NEWCAT_DATA_LEN 129 ----------------------------------------------------------------------- Summary of changes: rigs/yaesu/newcat.c | 9 +++++---- rigs/yaesu/newcat.h | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-01-14 23:26:22
|
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 517fb87b8bded5478510bc903e52347715503591 (commit) from 6f4ce3a7878cf5d2416a1b0f63e329433c6987e3 (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 517fb87b8bded5478510bc903e52347715503591 Author: Michael Black W9MDB <mdb...@ya...> Date: Thu Jan 14 17:25:39 2021 -0600 Fix MD command in newcat_set_cmd_validate https://github.com/Hamlib/Hamlib/issues/505 diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 8cb7072e..b1336f6e 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -9382,7 +9382,7 @@ int newcat_set_cmd_validate(RIG *rig) { struct rig_state *state = &rig->state; struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; - char *valcmd; + char valcmd[16]; int retries=5; int retry=0; int sleepms = 50; @@ -9391,31 +9391,33 @@ int newcat_set_cmd_validate(RIG *rig) 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)) { - valcmd = "FA;"; + strcpy(valcmd,"FA;"); } else if ((strncmp(priv->cmd_str,"FB",2)==0) && (strlen(priv->cmd_str)>3)) { - valcmd = "FB;"; + strcpy(valcmd,"FB;"); } else if ((strncmp(priv->cmd_str,"MD",2)==0) && (strlen(priv->cmd_str)>3)) { - valcmd = "MD;"; + strcpy(valcmd,priv->cmd_str); // pull the needed part of the cmd + valcmd[3]=';'; + valcmd[4]=0; } else if ((strncmp(priv->cmd_str,"TX",2)==0) && (strlen(priv->cmd_str)>3)) { - valcmd = "TX;"; + strcpy(valcmd,"TX;"); } else if ((strncmp(priv->cmd_str,"FT",2)==0) && (strlen(priv->cmd_str)>3)) { - valcmd = "FT;"; + strcpy(valcmd,"FT;"); } else if ((strncmp(priv->cmd_str,"BS",2)==0) && (strlen(priv->cmd_str)>3)) { - valcmd = "BS;"; + strcpy(valcmd,"BS;"); } else if ((strncmp(priv->cmd_str,"AI",2)==0) && (strlen(priv->cmd_str)>3)) { - valcmd = "AI;"; + strcpy(valcmd,"AI;"); } else { ----------------------------------------------------------------------- Summary of changes: rigs/yaesu/newcat.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-01-14 22:56:09
|
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 6f4ce3a7878cf5d2416a1b0f63e329433c6987e3 (commit) from 6779d04581b8c6dba61e6097c936c8c1ea471fd3 (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 6f4ce3a7878cf5d2416a1b0f63e329433c6987e3 Author: Michael Black W9MDB <mdb...@ya...> Date: Thu Jan 14 16:55:12 2021 -0600 Have EPROTO return when newcat_set_cmd_validate fails that way ENIMPL will fall through https://github.com/Hamlib/Hamlib/issues/505 diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index e8765a44..8cb7072e 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -9469,11 +9469,17 @@ int newcat_set_cmd(RIG *rig) /* send the command */ rig_debug(RIG_DEBUG_TRACE, "cmd_str = %s\n", priv->cmd_str); - if (newcat_set_cmd_validate(rig)==RIG_OK) { + rc = newcat_set_cmd_validate(rig); + if (rc==RIG_OK) { rig_debug(RIG_DEBUG_TRACE, "%s: cmd_validate OK\n", __func__); return RIG_OK; } - rig_debug(RIG_DEBUG_TRACE, "%s: cmd_validate not OK...continuing\n", __func__); + else if (rc == -RIG_EPROTO) + { + rig_debug(RIG_DEBUG_TRACE, "%s: set_cmd_validate failed\n", __func__); + return rc; + } + rig_debug(RIG_DEBUG_TRACE, "%s: newcat_set_cmd_validate not implemented...continuing\n", __func__); if (RIG_OK != (rc = write_block(&state->rigport, priv->cmd_str, strlen(priv->cmd_str)))) ----------------------------------------------------------------------- Summary of changes: rigs/yaesu/newcat.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-01-14 22:39:06
|
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 6779d04581b8c6dba61e6097c936c8c1ea471fd3 (commit) via 30c2d34d87076d2d3ad85da45df95ef4d7397155 (commit) from 32d5f2b49e69ad00e91acd6f0f3030f9923f3878 (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 6779d04581b8c6dba61e6097c936c8c1ea471fd3 Author: Michael Black W9MDB <mdb...@ya...> Date: Thu Jan 14 16:38:31 2021 -0600 Add rig_flush to newcat_set_cmd_validate diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 78e3cde3..e8765a44 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -9424,6 +9424,7 @@ int newcat_set_cmd_validate(RIG *rig) } while (rc != RIG_OK && retry++ < retries) { + rig_flush(&state->rigport); /* discard any unsolicited data */ rc = write_block(&state->rigport, priv->cmd_str, strlen(priv->cmd_str)); if (rc != RIG_OK) return -RIG_EIO; rc = write_block(&state->rigport, valcmd, strlen(valcmd)); commit 30c2d34d87076d2d3ad85da45df95ef4d7397155 Author: Michael Black W9MDB <mdb...@ya...> Date: Thu Jan 14 16:32:55 2021 -0600 Implemented new Yaesu retry mechanism using command validation technique Cmds that are implemented are verified and 5 tries are made if answer != request https://github.com/Hamlib/Hamlib/issues/505 diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index b7fe8f39..78e3cde3 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -9374,6 +9374,73 @@ int newcat_get_cmd(RIG *rig) return rc; } +/* + * This tries to set and read to validate the set command actually worked + * returns RIG_OK if set, -RIG_EIMPL if not implemented yet, or -RIG_EPROTO if unsuccesful + */ +int newcat_set_cmd_validate(RIG *rig) +{ + struct rig_state *state = &rig->state; + struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; + char *valcmd; + int retries=5; + int retry=0; + int sleepms = 50; + int rc = -RIG_EPROTO; + + 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)) + { + valcmd = "FA;"; + } + else if ((strncmp(priv->cmd_str,"FB",2)==0) && (strlen(priv->cmd_str)>3)) + { + valcmd = "FB;"; + } + else if ((strncmp(priv->cmd_str,"MD",2)==0) && (strlen(priv->cmd_str)>3)) + { + valcmd = "MD;"; + } + else if ((strncmp(priv->cmd_str,"TX",2)==0) && (strlen(priv->cmd_str)>3)) + { + valcmd = "TX;"; + } + else if ((strncmp(priv->cmd_str,"FT",2)==0) && (strlen(priv->cmd_str)>3)) + { + valcmd = "FT;"; + } + else if ((strncmp(priv->cmd_str,"BS",2)==0) && (strlen(priv->cmd_str)>3)) + { + valcmd = "BS;"; + } + else if ((strncmp(priv->cmd_str,"AI",2)==0) && (strlen(priv->cmd_str)>3)) + { + valcmd = "AI;"; + } + else + { + rig_debug(RIG_DEBUG_ERR, "%s: %s not implemented\n", __func__, priv->cmd_str); + return -RIG_ENIMPL; + } + while (rc != RIG_OK && retry++ < retries) + { + rc = write_block(&state->rigport, priv->cmd_str, strlen(priv->cmd_str)); + if (rc != RIG_OK) return -RIG_EIO; + rc = write_block(&state->rigport, valcmd, strlen(valcmd)); + if (rc != RIG_OK) return -RIG_EIO; + rc = read_string(&state->rigport, priv->ret_data, sizeof(priv->ret_data), + &cat_term, sizeof(cat_term)); + if (rc == RIG_OK) + { + // if they match we are validated + if (strcmp(priv->cmd_str, priv->ret_data)==0) return RIG_OK; + else rc = -RIG_EPROTO; + } + rig_debug(RIG_DEBUG_ERR, "%s: cmd validation failed, try#%d\n", __func__, retry); + hl_usleep(sleepms*1000); + } while(--retry > 0); + return -RIG_EPROTO; +} /* * Writes a null terminated command string from priv->cmd_str to the * CAT port that is not expected to have a response. @@ -9401,6 +9468,12 @@ int newcat_set_cmd(RIG *rig) /* send the command */ rig_debug(RIG_DEBUG_TRACE, "cmd_str = %s\n", priv->cmd_str); + if (newcat_set_cmd_validate(rig)==RIG_OK) { + rig_debug(RIG_DEBUG_TRACE, "%s: cmd_validate OK\n", __func__); + return RIG_OK; + } + rig_debug(RIG_DEBUG_TRACE, "%s: cmd_validate not OK...continuing\n", __func__); + if (RIG_OK != (rc = write_block(&state->rigport, priv->cmd_str, strlen(priv->cmd_str)))) { diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h index 452cb283..3ad84a0d 100644 --- a/rigs/yaesu/newcat.h +++ b/rigs/yaesu/newcat.h @@ -50,7 +50,7 @@ typedef char ncboolean; /* shared function version */ -#define NEWCAT_VER "20210113" +#define NEWCAT_VER "20210114" /* Hopefully large enough for future use, 128 chars plus '\0' */ #define NEWCAT_DATA_LEN 129 ----------------------------------------------------------------------- Summary of changes: rigs/yaesu/newcat.c | 74 +++++++++++++++++++++++++++++++++++++++++++++++++++++ rigs/yaesu/newcat.h | 2 +- 2 files changed, 75 insertions(+), 1 deletion(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-01-13 21:39:28
|
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 32d5f2b49e69ad00e91acd6f0f3030f9923f3878 (commit) via 65d45a07be19e4db6c2bc21f29ff412c03719ca9 (commit) from 8024ffb93731de1b658cc156e8ce158e0341efea (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 32d5f2b49e69ad00e91acd6f0f3030f9923f3878 Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Jan 13 15:38:20 2021 -0600 In newcat.c give the BS command 200ms to do it's thing Allow BS command when in split mode We now re-read freq/mode after BS and just return if frequency is already set correctly https://github.com/Hamlib/Hamlib/issues/505 diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index d4ce36e8..b7fe8f39 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -801,13 +801,13 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) // // Restore band memory if we can and band is changing -- we do it before we set the frequency - // And only when not in split mode + // And only when not in split mode (note this check has been removed for testing) if (newcat_valid_command(rig, "BS") && newcat_band_index(freq) != newcat_band_index(rig->state.current_freq) - && !rig->state.cache.split + // remove the split check here -- hopefully works OK + //&& !rig->state.cache.split && !is_ft891) // 891 does not remember bandwidth so don't do this { - hl_usleep(200*1000); // seems we need some time before doing band select 200ms enough? snprintf(priv->cmd_str, sizeof(priv->cmd_str), "BS%02d%c", newcat_band_index(freq), cat_term); @@ -816,6 +816,23 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) rig_debug(RIG_DEBUG_ERR, "%s: Unexpected error with BS command=%s\n", __func__, rigerror(err)); } + else + { + // after band select re-read things -- may not have to change anything + freq_t tmp_freqA, tmp_freqB; + rmode_t tmp_mode; + pbwidth_t tmp_width; + rig_get_freq(rig, RIG_VFO_A, &tmp_freqA); + rig_get_freq(rig, RIG_VFO_B, &tmp_freqB); + rig_get_mode(rig, RIG_VFO_A, &tmp_mode, &tmp_width); + rig_get_mode(rig, RIG_VFO_B, &tmp_mode, &tmp_width); + if ((target_vfo == 0 && tmp_freqA == freq) + || (target_vfo == 1 && tmp_freqB == 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!! + } + } // just drop through } @@ -9396,7 +9413,12 @@ int newcat_set_cmd(RIG *rig) return RIG_OK; } - hl_usleep(11*1000); // some Yaeus rigs have 10ms timeout -- does this fix the ?; reponse problem? + if (strncmp(priv->cmd_str,"BS",2)==0) + { // the BS command needs time to do it's thing + hl_usleep(200*1000); + priv->cache_start.tv_sec = 0; // invalidate the cache + } + /* send the verification command */ rig_debug(RIG_DEBUG_TRACE, "cmd_str = %s\n", verify_cmd); commit 65d45a07be19e4db6c2bc21f29ff412c03719ca9 Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Jan 13 15:08:40 2021 -0600 Add cmd list to prm80.c diff --git a/rigs/prm80/prm80.c b/rigs/prm80/prm80.c index 580f8a3f..63f720fd 100644 --- a/rigs/prm80/prm80.c +++ b/rigs/prm80/prm80.c @@ -45,6 +45,75 @@ #define BUFSZ 64 +/* V3 commands + * retrieved from https://sourceforge.net/projects/prm80/ +MessageVersion: DB "PRM8060 V3.0", 0 + +MessageAide: DB "H",0Dh,0Ah + DB " Commandes disponibles :",0Dh,0Ah + DB " [0] = Reset.",0Dh,0Ah + DB " [1] a [5] = Show 80c552 port state P1 to P5.",0Dh,0Ah + DB " [A] = Set serial communication to 1200 bps.",0Dh,0Ah + DB " [B] = Set serial communication to 4800 bps.",0Dh,0Ah + DB " [C] = Print channels list.",0Dh,0Ah + DB " [D] = Set system byte.",0Dh,0Ah + DB " [E] = Show system state (Mode-Chan-Chanstate-Sql-Vol-Lock-RX freq-TX freq).",0Dh,0Ah + DB " [F] = Set squelch.",0Dh,0Ah + DB " [H] = Print this help page.",0Dh,0Ah + DB " [I] = Erase and init RAM and EEPROM.",0Dh,0Ah + DB " [K] = Set lock byte.",0Dh,0Ah + DB " [L] = Print latch state.",0Dh,0Ah + DB " [M] = Edit external RAM manualy.",0Dh,0Ah + DB " [N] = Set current channel.",0Dh,0Ah + DB " [O] = Set volume.",0Dh,0Ah + DB " [P] = Edit/Add channel.",0Dh,0Ah + DB " [Q] = Set channels number.",0Dh,0Ah + DB " [R] = Set synthetiser frequencies.",0Dh,0Ah + DB " [U] = Print 80c552 internal RAM.",0Dh,0Ah + DB " [S] = Copy EEPROM to external RAM.",0Dh,0Ah + DB " [T] = Set current channel state.",0Dh,0Ah + DB " [V] = Print firmware version.",0Dh,0Ah + DB " [X] = Copy external RAM to EEPROM.",0Dh,0Ah + DB " [Y] = Print first 2 kb from the EEPROM I2C 24c16.",0Dh,0Ah + DB " [Z] = Print external RAM ($0000 to $07FF).",0Dh,0Ah,0 +*/ + +/* V4 commands + * retrieved from https://sourceforge.net/projects/prm80/ + * +MessageVersion: +IF TARGET EQ 8060 + DB "PRM8060 V4.0" +ELSEIF TARGET EQ 8070 + DB "PRM8070 V4.0" +ENDIF + +MessageAide: DB "H",0Dh,0Ah + DB " Commandes disponibles :",0Dh,0Ah + DB " [0] = Reset.",0Dh,0Ah + DB " [1] a [5] = Show 80c552 port state P1 to P5.",0Dh,0Ah + DB " [C] = Print channels list.",0Dh,0Ah + DB " [D] = Set system byte.",0Dh,0Ah + DB " [E] = Show system state (Mode-Chan-Chanstate-Sql-Vol-Lock-RX freq-TX freq).",0Dh,0Ah + DB " [F] = Set squelch.",0Dh,0Ah + DB " [H] = Print this help page.",0Dh,0Ah + DB " [I] = Erase and init RAM and EEPROM.",0Dh,0Ah + DB " [K] = Set lock byte.",0Dh,0Ah + DB " [L] = Print latch state.",0Dh,0Ah + DB " [M] = Edit external RAM manualy.",0Dh,0Ah + DB " [N] = Set current channel.",0Dh,0Ah + DB " [O] = Set volume.",0Dh,0Ah + DB " [P] = Edit/Add channel.",0Dh,0Ah + DB " [Q] = Set channels number.",0Dh,0Ah + DB " [R] = Set synthetiser frequencies.",0Dh,0Ah + DB " [U] = Print 80c552 internal RAM.",0Dh,0Ah + DB " [S] = Copy EEPROM to external RAM.",0Dh,0Ah + DB " [T] = Set current channel state.",0Dh,0Ah + DB " [V] = Print firmware version.",0Dh,0Ah + DB " [X] = Copy external RAM to EEPROM.",0Dh,0Ah + DB " [Y] = Print first 2 kb from the EEPROM I2C 24c16.",0Dh,0Ah + DB " [Z] = Print external RAM ($0000 to $07FF).",0Dh,0Ah,0 +*/ /* [0] = Reset. [C] = Print channels list. ----------------------------------------------------------------------- Summary of changes: rigs/prm80/prm80.c | 69 +++++++++++++++++++++++++++++++++++++++++++++++++++++ rigs/yaesu/newcat.c | 30 +++++++++++++++++++---- 2 files changed, 95 insertions(+), 4 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |