Override port selection for SmartSDR since 4992 is always the port

pull/1557/head
Mike Black W9MDB 2024-05-22 11:32:26 -05:00
rodzic bcdaa9459a
commit b7adb19c7e
1 zmienionych plików z 16 dodań i 1 usunięć

Wyświetl plik

@ -256,7 +256,22 @@ static int frontend_set_conf(RIG *rig, hamlib_token_t token, const char *val)
{
case TOK_PATHNAME:
strncpy(rp->pathname, val, HAMLIB_FILPATHLEN - 1);
strncpy(rs->rigport_deprecated.pathname, val, HAMLIB_FILPATHLEN - 1);
if (strstr(rig->caps->model_name,"SmartSDR Slice"))
{
// override any port selection to prevent user errors/questions
char *val2 = strdup(val);
char *p = strchr(val2,':'); // port in here?
if (p) {
p = 0; // terminate it
rig_debug(RIG_DEBUG_WARN, "%s: overriding port and changing to 4992\n", __func__);
}
sprintf(rs->rigport_deprecated.pathname, "%s:%s", val2, "4992");
free(val2);
}
else
{
strncpy(rs->rigport_deprecated.pathname, val, HAMLIB_FILPATHLEN - 1);
}
break;
case TOK_WRITE_DELAY: