diff --git a/rigs/dummy/dummy.c b/rigs/dummy/dummy.c index 87a30bac1..4cb66af50 100644 --- a/rigs/dummy/dummy.c +++ b/rigs/dummy/dummy.c @@ -844,7 +844,8 @@ static int dummy_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq) ENTERFUNC; priv->curr->tx_freq = tx_freq; - rig_debug(RIG_DEBUG_VERBOSE, "%s: priv->curr->tx_freq = %.0f\n", __func__, priv->curr->tx_freq); + rig_debug(RIG_DEBUG_VERBOSE, "%s: priv->curr->tx_freq = %.0f\n", __func__, + priv->curr->tx_freq); RETURNFUNC(RIG_OK); } @@ -857,7 +858,8 @@ static int dummy_get_split_freq(RIG *rig, vfo_t vfo, freq_t *tx_freq) ENTERFUNC; *tx_freq = priv->curr->tx_freq; - rig_debug(RIG_DEBUG_VERBOSE, "%s: priv->curr->tx_freq = %.0f\n", __func__, priv->curr->tx_freq); + rig_debug(RIG_DEBUG_VERBOSE, "%s: priv->curr->tx_freq = %.0f\n", __func__, + priv->curr->tx_freq); RETURNFUNC(RIG_OK); } diff --git a/rigs/dummy/netrigctl.c b/rigs/dummy/netrigctl.c index bb85e9d05..79be25332 100644 --- a/rigs/dummy/netrigctl.c +++ b/rigs/dummy/netrigctl.c @@ -328,9 +328,11 @@ static int netrigctl_open(RIG *rig) { break; } - switch(i) + + switch (i) { } + rig->caps->tx_range_list1->startf = rs->tx_range_list[i].startf; rig->caps->tx_range_list1->endf = rs->tx_range_list[i].endf; rig->caps->tx_range_list1->modes = rs->tx_range_list[i].modes; @@ -626,7 +628,8 @@ static int netrigctl_open(RIG *rig) { // use the rig's timeout value pluse 200ms for potential network delays rig->caps->timeout = strtol(value, NULL, 0) + 200; - rig_debug(RIG_DEBUG_TRACE, "%s: timeout value = '%s', final timeout=%d\n", __func__, value, rig->caps->timeout); + rig_debug(RIG_DEBUG_TRACE, "%s: timeout value = '%s', final timeout=%d\n", + __func__, value, rig->caps->timeout); } else { diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 75ed7e381..3654039b9 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -2105,7 +2105,8 @@ int icom_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) // reason is we can't get width without swapping vfos -- yuck!! if (width != NULL) { - if (vfo & (RIG_VFO_A | RIG_VFO_MAIN | RIG_VFO_SUB_A | RIG_VFO_MAIN_A | RIG_VFO_CURR)) + if (vfo & (RIG_VFO_A | RIG_VFO_MAIN | RIG_VFO_SUB_A | RIG_VFO_MAIN_A | + RIG_VFO_CURR)) { // then we get our current vfo..i.e. VFOA if (rig->state.current_vfo != RIG_VFO_A) @@ -2137,7 +2138,9 @@ int icom_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) rig_set_vfo(rig, RIG_VFO_B); retval = icom_get_dsp_flt(rig, *mode); *width = retval; - if (*width == 0) *width = rig->state.cache.widthMainA; // we'll use VFOA's width + + if (*width == 0) { *width = rig->state.cache.widthMainA; } // we'll use VFOA's width + // dont' really care about cache time here // this is just to prevent vfo swapping while getting width rig->state.cache.widthMainB = retval; diff --git a/rigs/kenwood/flex6xxx.c b/rigs/kenwood/flex6xxx.c index 06d956005..387ada4b8 100644 --- a/rigs/kenwood/flex6xxx.c +++ b/rigs/kenwood/flex6xxx.c @@ -1219,7 +1219,7 @@ const struct rig_caps powersdr_caps = .serial_parity = RIG_PARITY_NONE, .serial_handshake = RIG_HANDSHAKE_NONE, .write_delay = 0, - .post_write_delay = 20, + .post_write_delay = 0, // The combination of timeout and retry is important // We need at least 3 seconds to do profile switches // Hitting the timeout is OK as long as we retry diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index 8e3d674f4..e6f4e062b 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -911,7 +911,8 @@ int kenwood_open(RIG *rig) int retval; split_t split; vfo_t tx_vfo; - rig_debug(RIG_DEBUG_VERBOSE, "%s: found the right driver for %s(%d)\n", __func__, rig->caps->model_name, rig->caps->rig_model); + rig_debug(RIG_DEBUG_VERBOSE, "%s: found the right driver for %s(%d)\n", + __func__, rig->caps->model_name, rig->caps->rig_model); /* get current AI state so it can be restored */ kenwood_get_trn(rig, &priv->trn_state); /* ignore errors */ diff --git a/rigs/prm80/prm80.c b/rigs/prm80/prm80.c index 10e6628ef..0ddb51746 100644 --- a/rigs/prm80/prm80.c +++ b/rigs/prm80/prm80.c @@ -796,7 +796,8 @@ int prm80_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only) chan->funcs |= (lock_byte & 0x05) ? RIG_FUNC_LOCK : 0; chan->funcs |= (lock_byte & 0x08) ? RIG_FUNC_MUTE : 0; - chan->freq = pll_value_to_rx_freq((hhtoi(statebuf + 12) << 8) + hhtoi(statebuf + 14)); + chan->freq = pll_value_to_rx_freq((hhtoi(statebuf + 12) << 8) + hhtoi( + statebuf + 14)); chan->tx_freq = ((hhtoi(statebuf + 16) << 8) + hhtoi(statebuf + 18)) * FREQ_DIV; if (chan->rptr_shift != RIG_RPT_SHIFT_NONE) diff --git a/src/rig.c b/src/rig.c index f7ad1a3c8..828f91f7d 100644 --- a/src/rig.c +++ b/src/rig.c @@ -1703,7 +1703,8 @@ int HAMLIB_API rig_set_freq(RIG *rig, vfo_t vfo, freq_t freq) if (rig->state.twiddle_state == TWIDDLE_ON) { // we keep skipping set_freq while the vfo knob is in motion - rig_debug(RIG_DEBUG_VERBOSE, "%s: Twiddle on so skipping this set_freq request one time\n", __func__); + rig_debug(RIG_DEBUG_VERBOSE, + "%s: Twiddle on so skipping this set_freq request one time\n", __func__); rig->state.twiddle_state = TWIDDLE_OFF; } @@ -2490,9 +2491,11 @@ int HAMLIB_API rig_set_vfo(RIG *rig, vfo_t vfo) ENTERFUNC; rig_debug(RIG_DEBUG_VERBOSE, "%s called vfo=%s\n", __func__, rig_strvfo(vfo)); + if (vfo == RIG_VFO_B || vfo == RIG_VFO_SUB) { - rig_debug(RIG_DEBUG_VERBOSE, "%s ********************** called vfo=%s\n", __func__, rig_strvfo(vfo)); + rig_debug(RIG_DEBUG_VERBOSE, "%s ********************** called vfo=%s\n", + __func__, rig_strvfo(vfo)); } if (CHECK_RIG_ARG(rig)) @@ -4094,7 +4097,7 @@ int HAMLIB_API rig_set_split_freq_mode(RIG *rig, // in split mode we alwasy use VFOB // in the future we may start using RIG_VFO_TX and let the backend figure out what VFO to use - vfo = vfo_fixup(rig,RIG_VFO_B); // in split mode we always use VFOB/Sub for TX + vfo = vfo_fixup(rig, RIG_VFO_B); // in split mode we always use VFOB/Sub for TX rig_debug(RIG_DEBUG_VERBOSE, "%s: vfo=%s, tx_freq=%.0f, tx_mode=%s, tx_width=%d\n", __func__, rig_strvfo(vfo), tx_freq, rig_strrmode(tx_mode), (int)tx_width); @@ -4347,7 +4350,8 @@ int HAMLIB_API rig_get_split_vfo(RIG *rig, if (!split || !tx_vfo) { - rig_debug(RIG_DEBUG_ERR, "%s: split or tx_vfo is null, split=%p, tx_vfo=%p\n", __func__, split, tx_vfo); + rig_debug(RIG_DEBUG_ERR, "%s: split or tx_vfo is null, split=%p, tx_vfo=%p\n", + __func__, split, tx_vfo); RETURNFUNC(-RIG_EINVAL); } @@ -4358,7 +4362,9 @@ int HAMLIB_API rig_get_split_vfo(RIG *rig, // if we can't get the vfo we will return whatever we have cached *split = rig->state.cache.split; *tx_vfo = rig->state.cache.split_vfo; - rig_debug(RIG_DEBUG_VERBOSE, "%s: no get_split_vfo so returning split=%d, tx_vfo=%s\n", __func__, *split, rig_strvfo(*tx_vfo)); + rig_debug(RIG_DEBUG_VERBOSE, + "%s: no get_split_vfo so returning split=%d, tx_vfo=%s\n", __func__, *split, + rig_strvfo(*tx_vfo)); RETURNFUNC(RIG_OK); } diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c index c99cfbfef..860586d70 100644 --- a/tests/rigctl_parse.c +++ b/tests/rigctl_parse.c @@ -1651,11 +1651,13 @@ int rigctl_parse(RIG *my_rig, FILE *fin, FILE *fout, char *argv[], int argc, } rig_debug(RIG_DEBUG_TRACE, "%s: vfo_opt=%d\n", __func__, *vfo_opt); + if (my_rig->state.comm_state == 0) { rig_debug(RIG_DEBUG_WARN, "%s: rig not open...trying to reopen\n", __func__); rig_open(my_rig); } + retcode = (*cmd_entry->rig_routine)(my_rig, fout, fin, diff --git a/tests/simicom.c b/tests/simicom.c index 49c37f4ca..559b6c1d7 100644 --- a/tests/simicom.c +++ b/tests/simicom.c @@ -103,6 +103,7 @@ void frameParse(int fd, unsigned char *frame, int len) frame[5] = modeB; frame[6] = widthB; } + frame[7] = 0xfd; write(fd, frame, 8); break; @@ -113,8 +114,9 @@ void frameParse(int fd, unsigned char *frame, int len) if (vfo_curr == RIG_VFO_A || vfo_curr == RIG_VFO_MAIN) { freqA = freq; } else { freqB = freq; } + // case 0x06: - + case 0x07: @@ -181,10 +183,12 @@ int openPort(char *comport) // doesn't matter for using pts devices { int fd; fd = open(comport, O_RDWR); + if (fd < 0) { perror(comport); } + return fd; } @@ -214,8 +218,10 @@ int openPort(char *comport) // doesn't matter for using pts devices void rigStatus() { - printf("VFOA: mode=%s width=%ld freq=%.0f\n", rig_strrmode(modeA), widthA, freqA); - printf("VFOB: mode=%s width=%ld freq=%.0f\n", rig_strrmode(modeB), widthB, freqB); + printf("VFOA: mode=%s width=%ld freq=%.0f\n", rig_strrmode(modeA), widthA, + freqA); + printf("VFOB: mode=%s width=%ld freq=%.0f\n", rig_strrmode(modeB), widthB, + freqB); } int main(int argc, char **argv) @@ -225,13 +231,16 @@ int main(int argc, char **argv) printf("%s: %s\n", argv[0], rig_version()); #if defined(WIN32) || defined(_WIN32) + if (argc != 2) { printf("Missing comport argument\n"); printf("%s [comport]\n", argv[0]); exit(1); } + #endif + while (1) { int len = frameGet(fd, buf);