Fix FT101DX FUNC_COMP since it now has a different format than other Yaesu's

Presumably this is the future format
https://github.com/Hamlib/Hamlib/issues/417
pull/420/head
Michael Black W9MDB 2020-10-13 16:55:32 -05:00
rodzic 4faad82da7
commit ef34c699c0
2 zmienionych plików z 26 dodań i 4 usunięć

Wyświetl plik

@ -3862,8 +3862,16 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status)
return -RIG_ENAVAIL;
}
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "PR%d%c", status ? 1 : 0,
if (is_ft101)
{
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "PR0%d%c", status ? 1 : 0,
cat_term);
}
else
{
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "PR%d%c", status ? 1 : 0,
cat_term);
}
break;
case RIG_FUNC_VOX:
@ -4056,7 +4064,14 @@ int newcat_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status)
return -RIG_ENAVAIL;
}
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "PR%c", cat_term);
if (is_ft101)
{
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "PR0%c", cat_term);
}
else
{
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "PR%c", cat_term);
}
break;
case RIG_FUNC_VOX:
@ -4117,13 +4132,20 @@ int newcat_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status)
*status = (retfunc[2] == '0') ? 0 : 1;
break;
case RIG_FUNC_COMP:
// future Yaesu's may use the new command format
// so we do this check here instead of the back end
// only need to add the "|| is_XXX" here
if (is_ft101) *status = (retfunc[1] == '0') ? 0 : 1;
else *status = (retfunc[0] == '0') ? 0 : 1;
break;
case RIG_FUNC_ANF:
case RIG_FUNC_FBKIN:
case RIG_FUNC_LOCK:
case RIG_FUNC_MON:
case RIG_FUNC_NB:
case RIG_FUNC_NR:
case RIG_FUNC_COMP:
case RIG_FUNC_VOX:
*status = (retfunc[0] == '0') ? 0 : 1;
break;

Wyświetl plik

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