Fix FTDX3000 antenna switching

https://github.com/Hamlib/Hamlib/issues/756
pull/769/head
Mike Black W9MDB 2021-08-05 22:29:56 -05:00
rodzic e57774cfde
commit 24a9fdcc94
2 zmienionych plików z 20 dodań i 13 usunięć

Wyświetl plik

@ -909,7 +909,7 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
// remove the split check here -- hopefully works OK // remove the split check here -- hopefully works OK
//&& !rig->state.cache.split //&& !rig->state.cache.split
// seems some rigs are problematic // seems some rigs are problematic
&& !(is_ftdx3000) // && !(is_ftdx3000)
// some rigs can't do BS command on 60M // some rigs can't do BS command on 60M
// && !(is_ftdx3000 && newcat_band_index(freq) == 2) // && !(is_ftdx3000 && newcat_band_index(freq) == 2)
&& !(is_ft2000 && newcat_band_index(freq) == 2) && !(is_ft2000 && newcat_band_index(freq) == 2)
@ -920,13 +920,21 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
{ {
if (rig->state.current_vfo != vfo) if (rig->state.current_vfo != vfo)
{ {
// then we need to change vfos, BS, and change back int vfo1 = 1, vfo2 = 0;
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "VS1;BS%02d;VS0;", if (vfo == RIG_VFO_A || vfo == RIG_VFO_MAIN) {
newcat_band_index(freq)); vfo1 = 0;
vfo2 = 1;
if (vfo == RIG_VFO_A || vfo == RIG_VFO_MAIN) }
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "VS0;BS%02d;VS1;", // we need to change vfos, BS, and change back
newcat_band_index(freq)); snprintf(priv->cmd_str, sizeof(priv->cmd_str), "VS%d;BS%02d",
vfo1, newcat_band_index(freq));
if (RIG_OK != (err = newcat_set_cmd(rig)))
{
rig_debug(RIG_DEBUG_ERR, "%s: Unexpected error with BS command#1=%s\n",
__func__, rigerror(err));
}
hl_usleep(50*1000); // wait for BS to do it's thing and swap back
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "VS%d;", vfo2);
} }
else else
{ {
@ -936,9 +944,8 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
if (RIG_OK != (err = newcat_set_cmd(rig))) if (RIG_OK != (err = newcat_set_cmd(rig)))
{ {
rig_debug(RIG_DEBUG_ERR, "%s: Unexpected error with BS command#1=%s\n", rig_debug(RIG_DEBUG_ERR, "%s: Unexpected error with BS command#2=%s\n",
__func__, __func__, rigerror(err));
rigerror(err));
} }
#if 0 // disable for testing #if 0 // disable for testing
@ -979,7 +986,7 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
if (RIG_OK != (err = newcat_set_cmd(rig))) if (RIG_OK != (err = newcat_set_cmd(rig)))
{ {
rig_debug(RIG_DEBUG_ERR, "%s: Unexpected error with BS command#2=%s\n", rig_debug(RIG_DEBUG_ERR, "%s: Unexpected error with BS command#3=%s\n",
__func__, __func__,
rigerror(err)); rigerror(err));
} }

Wyświetl plik

@ -50,7 +50,7 @@
typedef char ncboolean; typedef char ncboolean;
/* shared function version */ /* shared function version */
#define NEWCAT_VER "20210802" #define NEWCAT_VER "20210805"
/* Hopefully large enough for future use, 128 chars plus '\0' */ /* Hopefully large enough for future use, 128 chars plus '\0' */
#define NEWCAT_DATA_LEN 129 #define NEWCAT_DATA_LEN 129