Balance RETURNFUNC

pull/969/head
Mike Black W9MDB 2022-02-19 16:29:31 -06:00
rodzic f0a9832669
commit 8b40735752
2 zmienionych plików z 28 dodań i 2 usunięć

Wyświetl plik

@ -2056,7 +2056,7 @@ static int dummy_set_trn(RIG *rig, int trn)
priv->trn = trn;
RETURNFUNC(RIG_OK);
RETURNFUNC2(RIG_OK);
}

Wyświetl plik

@ -2630,6 +2630,31 @@ static int netrigctl_power2mW(RIG *rig, unsigned int *mwpower, float power,
RETURNFUNC(RIG_OK);
}
/* key1 is the 1st key generated when -A/--password is requested in rigctld
* key2 is generated by the client using key1
* key2 is decodes using key1 and should match key1 by key1's length
* random data can be appended to key2 to make it variable on each call
*/
static int netrigctl_password(RIG *rig, unsigned char *key1, unsigned char *key2)
{
char cmdbuf[64];
char buf[BUF_MAX];
int ret;
SNPRINTF(cmdbuf, sizeof(cmdbuf), "\\password %s\n", key2);
ret = netrigctl_transaction(rig, cmdbuf, strlen(cmdbuf), buf);
if (ret <= 0)
{
return -RIG_EINVAL;
}
ENTERFUNC;
RETURNFUNC(RIG_OK);
}
/*
@ -2641,7 +2666,7 @@ struct rig_caps netrigctl_caps =
RIG_MODEL(RIG_MODEL_NETRIGCTL),
.model_name = "NET rigctl",
.mfg_name = "Hamlib",
.version = "20211123.0",
.version = "20220218.0",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_OTHER,
@ -2746,6 +2771,7 @@ struct rig_caps netrigctl_caps =
//.get_trn = netrigctl_get_trn,
.power2mW = netrigctl_power2mW,
.mW2power = netrigctl_mW2power,
.password = netrigctl_password,
.hamlib_check_rig_caps = HAMLIB_CHECK_RIG_CAPS
};