Make sure FT5000 is in data mode for PTT request -- returns to MIC mode on shutdown

https://github.com/Hamlib/Hamlib/issues/1193
pull/1215/head
Mike Black W9MDB 2022-12-28 14:11:25 -06:00
rodzic 606aea1552
commit 2306ee4f1d
2 zmienionych plików z 19 dodań i 12 usunięć

Wyświetl plik

@ -1741,7 +1741,7 @@ int newcat_get_vfo(RIG *rig, vfo_t *vfo)
int newcat_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) int newcat_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt)
{ {
struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
int err; int err = -RIG_EPROTO;
char txon[] = "TX1;"; char txon[] = "TX1;";
char txoff[] = "TX0;"; char txoff[] = "TX0;";
@ -1756,24 +1756,31 @@ int newcat_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt)
switch (ptt) switch (ptt)
{ {
// the FTDX5000 uses menu 103 for front/rear audio in USB mode
case RIG_PTT_ON_MIC: case RIG_PTT_ON_MIC:
SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "EX1030;");
rig_debug(RIG_DEBUG_TRACE, "%s: cmd_str = %s\n", __func__, priv->cmd_str);
err = newcat_set_cmd(rig);
break; break;
case RIG_PTT_ON_DATA: case RIG_PTT_ON_DATA:
SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "EX1031;");
rig_debug(RIG_DEBUG_TRACE, "%s: cmd_str = %s\n", __func__, priv->cmd_str);
err = newcat_set_cmd(rig);
break; break;
case RIG_PTT_ON: case RIG_PTT_ON:
/* Build the command string */ /* Build the command string */
SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "%s", txon); // the FTDX5000 uses menu 103 for front/rear audio in USB mode
rig_debug(RIG_DEBUG_TRACE, "%s: cmd_str = %s\n", __func__, priv->cmd_str); if (is_ftdx5000)
err = newcat_set_cmd(rig); {
// Ensure FT5000 is back to MIC input
SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "EX1031;%s", txon);
rig_debug(RIG_DEBUG_TRACE, "%s: cmd_str = %s\n", __func__, priv->cmd_str);
newcat_set_cmd(rig); // don't care about the return
}
else
{
SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "%s", txon);
rig_debug(RIG_DEBUG_TRACE, "%s: cmd_str = %s\n", __func__, priv->cmd_str);
err = newcat_set_cmd(rig);
}
break; break;
case RIG_PTT_OFF: case RIG_PTT_OFF:

Wyświetl plik

@ -50,7 +50,7 @@
typedef char ncboolean; typedef char ncboolean;
/* shared function version */ /* shared function version */
#define NEWCAT_VER "20221223" #define NEWCAT_VER "20221228"
/* 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