Add twiddle_timeout and twiddle_rit --set-conf options

rigctld --set-conf=twiddle_timeout=5,twiddle_rit=1
This will set the twiddle timeout to 5 seconds and turn on twiddle_rit
For twiddle timeout VFOB will not be poller for 5 seconds after VFO twiddling is detected.  For RIT VFOB get_freq is suppressed and returns the cached value only (set_freq on VFOB still works).
rigctld --twiddle is deprecated and will be removed in 5.0
https://github.com/Hamlib/Hamlib/issues/444
pull/552/head
Michael Black W9MDB 2021-02-18 11:15:02 -06:00
rodzic 636d64d114
commit 185a938a76
3 zmienionych plików z 42 dodań i 10 usunięć

Wyświetl plik

@ -153,6 +153,16 @@ static const struct confparams frontend_cfg_params[] =
"True enables flushing serial port with read instead of TCFLUSH -- MicroHam",
"0", RIG_CONF_CHECKBUTTON, { }
},
{
TOK_TWIDDLE_TIMEOUT, "twiddle_timeout", "Timeout(secs) to resume VFO polling when twiddling VFO",
"For satellite ops when VFOB is twiddled will pause VFOB commands until timeout",
"Unset", RIG_CONF_COMBO, { .c = {{ "Unset", "ON", "OFF", NULL }} }
},
{
TOK_TWIDDLE_RIT, "twiddle_rit", "RIT twiddle",
"Suppress get_freq on VFOB for RIT tuning satellites",
"Unset", RIG_CONF_COMBO, { .c = {{ "Unset", "ON", "OFF", NULL }} }
},
{ RIG_CONF_END, NULL, }
};
@ -622,6 +632,22 @@ static int frontend_set_conf(RIG *rig, token_t token, const char *val)
rs->rigport.flushx = val_i ? 1 : 0;
break;
case TOK_TWIDDLE_TIMEOUT:
if (1 != sscanf(val, "%d", &val_i))
{
return -RIG_EINVAL; //value format error
}
rs->twiddle_timeout = val_i;
break;
case TOK_TWIDDLE_RIT:
if (1 != sscanf(val, "%d", &val_i))
{
return -RIG_EINVAL; //value format error
}
rs->twiddle_rit = val_i ? 1: 0;
break;
default:
return -RIG_EINVAL;
}
@ -954,6 +980,14 @@ static int frontend_get_conf(RIG *rig, token_t token, char *val)
sprintf(val, "%d", rs->disable_yaesu_bandselect);
break;
case TOK_TWIDDLE_TIMEOUT:
sprintf(val, "%d", rs->twiddle_timeout);
break;
case TOK_TWIDDLE_RIT:
sprintf(val, "%d", rs->twiddle_rit);
break;
default:
return -RIG_EINVAL;

Wyświetl plik

@ -114,6 +114,10 @@
#define TOK_AUTO_DISABLE_SCREENSAVER TOKEN_FRONTEND(125)
/** \brief rig: Disable Yaesu band select logic */
#define TOK_DISABLE_YAESU_BANDSELECT TOKEN_FRONTEND(126)
/** \brief rig: Supporess get_freq on VFOB for satellite RIT tuning */
#define TOK_TWIDDLE_TIMEOUT TOKEN_FRONTEND(127)
/** \brief rig: Supporess get_freq on VFOB for satellite RIT tuning */
#define TOK_TWIDDLE_RIT TOKEN_FRONTEND(128)
/*
* rotator specific tokens
* (strictly, should be documented as rotator_internal)

Wyświetl plik

@ -107,7 +107,6 @@ static struct option long_options[] =
{"help", 0, 0, 'h'},
{"version", 0, 0, 'V'},
{"twiddle_timeout", 1, 0, 'W'},
{"twiddle_rit" , 0, 0, 'Y'},
{"uplink", 1, 0, 'x'},
{"debug-time-stamps", 0, 0, 'Z'},
{0, 0, 0, 0}
@ -248,8 +247,7 @@ int main(int argc, char *argv[])
struct addrinfo hints, *result, *saved_result;
int sock_listen;
int reuseaddr = 1;
int twiddle = 0;
int twiddle_rit = 0;
int twiddle_timeout = 0;
int uplink = 0;
char host[NI_MAXHOST];
char serv[NI_MAXSERV];
@ -524,11 +522,8 @@ int main(int argc, char *argv[])
exit(1);
}
twiddle = atoi(optarg);
break;
case 'Y':
twiddle_rit=1;
twiddle_timeout = atoi(optarg);
fprintf(stderr,"twiddle_timeout is deprecated...use e.g. --set-conf=twiddle_timeout=5\n");
break;
case 'x':
@ -590,8 +585,7 @@ int main(int argc, char *argv[])
strncpy(my_rig->state.rigport.pathname, rig_file, FILPATHLEN - 1);
}
my_rig->state.twiddle_timeout = twiddle;
my_rig->state.twiddle_rit = twiddle_rit;
my_rig->state.twiddle_timeout = twiddle_timeout;
my_rig->state.uplink = uplink;
rig_debug(RIG_DEBUG_TRACE, "%s: twiddle=%d, uplink=%d, twiddle_rit=%d\n", __func__,
my_rig->state.twiddle_timeout, my_rig->state.uplink, my_rig->state.twiddle_rit);