Add detection of set_bwA to flrig.c

pull/1022/head
Mike Black W9MDB 2022-05-04 17:46:40 -05:00
rodzic 24c7a0042a
commit 5259102cf1
1 zmienionych plików z 21 dodań i 13 usunięć

Wyświetl plik

@ -781,7 +781,7 @@ static int flrig_open(RIG *rig)
{ {
int retval; int retval;
char value[MAXXMLLEN]; char value[MAXXMLLEN];
char arg[MAXXMLLEN]; //char arg[MAXXMLLEN];
rmode_t modes; rmode_t modes;
char *p; char *p;
char *pr; char *pr;
@ -818,13 +818,6 @@ static int flrig_open(RIG *rig)
rig_debug(RIG_DEBUG_VERBOSE, "%s: set_vfoA/ptt is available\n", rig_debug(RIG_DEBUG_VERBOSE, "%s: set_vfoA/ptt is available\n",
__func__); __func__);
} }
priv->has_set_bwA = 0;
if (iversion >= 1004005012) // 1.4.5.12 or greater
{
priv->has_set_bwA = 1;
rig_debug(RIG_DEBUG_VERBOSE, "%s: set_bwA/bwB is available\n",
__func__);
}
rig_debug(RIG_DEBUG_VERBOSE, "%s FlRig version %s\n", __func__, value); rig_debug(RIG_DEBUG_VERBOSE, "%s FlRig version %s\n", __func__, value);
@ -876,16 +869,31 @@ static int flrig_open(RIG *rig)
/* see if get_bwA is available */ /* see if get_bwA is available */
retval = flrig_transaction(rig, "rig.get_bwA", NULL, value, sizeof(value)); retval = flrig_transaction(rig, "rig.get_bwA", NULL, value, sizeof(value));
priv->has_get_bwA = 1;
if (retval == RIG_ENAVAIL) // must not have it if (retval == RIG_ENAVAIL) // must not have it
{ {
priv->has_get_bwA = 0; priv->has_get_bwA = 0;
rig_debug(RIG_DEBUG_VERBOSE, "%s: get_bwA is not available=%s\n", __func__, rig_debug(RIG_DEBUG_VERBOSE, "%s: get_bwA is not available=%s\n", __func__, value);
value); }
else
{
priv->has_get_bwA = 1;
rig_debug(RIG_DEBUG_VERBOSE, "%s: get_bwA is available=%s\n", __func__, value);
} }
strcpy(arg, value); /* see if set_bwA is available */
retval = flrig_transaction(rig, "rig.get_AB", arg, value, sizeof(value)); retval = flrig_transaction(rig, "rig.set_bwA", NULL, value, sizeof(value));
if (retval == RIG_ENAVAIL) // must not have it
{
priv->has_set_bwA = 0;
rig_debug(RIG_DEBUG_VERBOSE, "%s: set_bwA is not available=%s\n", __func__, value);
}
else
{
priv->has_set_bwA = 1;
rig_debug(RIG_DEBUG_VERBOSE, "%s: set_bwA is available=%s\n", __func__, value);
}
retval = flrig_transaction(rig, "rig.get_AB", NULL, value, sizeof(value));
if (retval != RIG_OK) { RETURNFUNC(retval); } if (retval != RIG_OK) { RETURNFUNC(retval); }