[Hamlib-commits] Hamlib -- Ham radio control libraries branch master updated. 1affac778b2b902cc218e
Library to control radio transceivers and receivers
Brought to you by:
n0nb
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 |