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
//&& !rig->state.cache.split
// seems some rigs are problematic
&& !(is_ftdx3000)
// && !(is_ftdx3000)
// some rigs can't do BS command on 60M
// && !(is_ftdx3000 && 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)
{
// then we need to change vfos, BS, and change back
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "VS1;BS%02d;VS0;",
newcat_band_index(freq));
if (vfo == RIG_VFO_A || vfo == RIG_VFO_MAIN)
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "VS0;BS%02d;VS1;",
newcat_band_index(freq));
int vfo1 = 1, vfo2 = 0;
if (vfo == RIG_VFO_A || vfo == RIG_VFO_MAIN) {
vfo1 = 0;
vfo2 = 1;
}
// we need to change vfos, BS, and change back
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
{
@ -936,9 +944,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__,
rigerror(err));
rig_debug(RIG_DEBUG_ERR, "%s: Unexpected error with BS command#2=%s\n",
__func__, rigerror(err));
}
#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)))
{
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__,
rigerror(err));
}

Wyświetl plik

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