Revert "Fix rotorez set_conf in both rotctl and rotctld -- since it needs to be done after rot_open"

This reverts commit 1557ad70f7.
pull/1568/head
George Baltz N3GB 2024-06-13 15:17:29 -04:00
rodzic 5fc4e0b5d0
commit 341a205bd7
2 zmienionych plików z 2 dodań i 61 usunięć

Wyświetl plik

@ -341,8 +341,7 @@ int main(int argc, char *argv[])
char *token = strtok(conf_parms, ",");
// ROTOREZ set_conf needs to be done after rot_open
while (token && my_rot->caps->rot_model != ROT_MODEL_ROTOREZ)
while (token)
{
char mytoken[100], myvalue[100];
hamlib_token_t lookup;
@ -407,34 +406,6 @@ int main(int argc, char *argv[])
exit(2);
}
// ROTOREZ set_conf needs to be done after rot_open
while (token && my_rot->caps->rot_model == ROT_MODEL_ROTOREZ)
{
char mytoken[100], myvalue[100];
hamlib_token_t lookup;
sscanf(token, "%99[^=]=%99s", mytoken, myvalue);
//printf("mytoken=%s,myvalue=%s\n",mytoken, myvalue);
lookup = rot_token_lookup(my_rot, mytoken);
if (lookup == 0)
{
rig_debug(RIG_DEBUG_ERR, "%s: no such token as '%s', use -L switch to see\n",
__func__, mytoken);
token = strtok(NULL, ",");
continue;
}
retcode = rot_set_conf(my_rot, rot_token_lookup(my_rot, mytoken), myvalue);
if (retcode != RIG_OK)
{
fprintf(stderr, "Config parameter error: %s\n", rigerror(retcode));
exit(2);
}
token = strtok(NULL, ",");
}
/*
* Print out capabilities, and exits immediately as we may be interested
* only in caps, and rig_open may fail.

Wyświetl plik

@ -347,8 +347,7 @@ int main(int argc, char *argv[])
char *token = strtok(conf_parms, ",");
// ROTOREZ set_conf needs to be done after rot_open
while (token && my_rot->caps->rot_model != ROT_MODEL_ROTOREZ)
while (token)
{
char mytoken[100], myvalue[100];
hamlib_token_t lookup;
@ -418,35 +417,6 @@ int main(int argc, char *argv[])
exit(2);
}
// ROTOREZ set_conf needs to be done after rot_open
while (token && my_rot->caps->rot_model == ROT_MODEL_ROTOREZ)
{
char mytoken[100], myvalue[100];
hamlib_token_t lookup;
sscanf(token, "%99[^=]=%99s", mytoken, myvalue);
//printf("mytoken=%s,myvalue=%s\n",mytoken, myvalue);
lookup = rot_token_lookup(my_rot, mytoken);
if (lookup == 0)
{
rig_debug(RIG_DEBUG_ERR, "%s: no such token as '%s', use -L switch to see\n",
__func__, mytoken);
token = strtok(NULL, ",");
continue;
}
retcode = rot_set_conf(my_rot, rot_token_lookup(my_rot, mytoken), myvalue);
if (retcode != RIG_OK)
{
fprintf(stderr, "Config parameter error: %s\n", rigerror(retcode));
exit(2);
}
token = strtok(NULL, ",");
}
my_rot->state.az_offset = az_offset;
my_rot->state.el_offset = el_offset;