kopia lustrzana https://github.com/Hamlib/Hamlib
Add -R option to rigctld to close the rig when no clients are connected
The FT-736 has to lock the rig for CAT control so this allows it to unlock when rigctld is idle https://github.com/Hamlib/Hamlib/issues/1117pull/1119/head
rodzic
4985d9ab26
commit
b1d132dd27
|
@ -372,6 +372,10 @@ option as it generates no output on its own.
|
||||||
Sets password on rigctld which requires hamlib to use rig_set_password and rigctl to use \\password to access rigctld. A 32-char shared secret will be displayed to be used on the client side.
|
Sets password on rigctld which requires hamlib to use rig_set_password and rigctl to use \\password to access rigctld. A 32-char shared secret will be displayed to be used on the client side.
|
||||||
.
|
.
|
||||||
.TP
|
.TP
|
||||||
|
.BR \-R ", " \-\-rigctld_idle
|
||||||
|
Will make rigctld close the rig when no clients are connected. Normally remains connected to speed up connects.
|
||||||
|
.
|
||||||
|
.TP
|
||||||
.BR \-h ", " \-\-help
|
.BR \-h ", " \-\-help
|
||||||
Show a summary of these options and exit.
|
Show a summary of these options and exit.
|
||||||
.
|
.
|
||||||
|
|
|
@ -83,7 +83,7 @@
|
||||||
* keep up to date SHORT_OPTIONS, usage()'s output and man page. thanks.
|
* keep up to date SHORT_OPTIONS, usage()'s output and man page. thanks.
|
||||||
* TODO: add an option to read from a file
|
* TODO: add an option to read from a file
|
||||||
*/
|
*/
|
||||||
#define SHORT_OPTIONS "m:r:p:d:P:D:s:S:c:T:t:C:W:w:x:z:lLuovhVZMA:n:"
|
#define SHORT_OPTIONS "m:r:R:p:d:P:D:s:S:c:T:t:C:W:w:x:z:lLuovhVZMA:n:"
|
||||||
static struct option long_options[] =
|
static struct option long_options[] =
|
||||||
{
|
{
|
||||||
{"model", 1, 0, 'm'},
|
{"model", 1, 0, 'm'},
|
||||||
|
@ -112,6 +112,7 @@ static struct option long_options[] =
|
||||||
{"multicast-addr", 1, 0, 'M'},
|
{"multicast-addr", 1, 0, 'M'},
|
||||||
{"multicast-port", 1, 0, 'n'},
|
{"multicast-port", 1, 0, 'n'},
|
||||||
{"password", 1, 0, 'A'},
|
{"password", 1, 0, 'A'},
|
||||||
|
{"rigctld-idle", 0, 0, 'R'},
|
||||||
{0, 0, 0, 0}
|
{0, 0, 0, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -261,6 +262,7 @@ int main(int argc, char *argv[])
|
||||||
int twiddle_timeout = 0;
|
int twiddle_timeout = 0;
|
||||||
int twiddle_rit = 0;
|
int twiddle_rit = 0;
|
||||||
int uplink = 0;
|
int uplink = 0;
|
||||||
|
int rigctld_idle = 0; // if true then rig will close when no clients are connected
|
||||||
char host[NI_MAXHOST];
|
char host[NI_MAXHOST];
|
||||||
char serv[NI_MAXSERV];
|
char serv[NI_MAXSERV];
|
||||||
char rigstartup[1024];
|
char rigstartup[1024];
|
||||||
|
@ -306,6 +308,10 @@ int main(int argc, char *argv[])
|
||||||
printf("rigctl %s\n", hamlib_version2);
|
printf("rigctl %s\n", hamlib_version2);
|
||||||
exit(0);
|
exit(0);
|
||||||
|
|
||||||
|
case 'R':
|
||||||
|
rigctld_idle = 1;
|
||||||
|
break;
|
||||||
|
|
||||||
case 'A':
|
case 'A':
|
||||||
strncpy(rigctld_password, optarg, sizeof(rigctld_password) - 1);
|
strncpy(rigctld_password, optarg, sizeof(rigctld_password) - 1);
|
||||||
//char *md5 = rig_make_m d5(rigctld_password);
|
//char *md5 = rig_make_m d5(rigctld_password);
|
||||||
|
@ -762,7 +768,11 @@ int main(int argc, char *argv[])
|
||||||
rig_debug(RIG_DEBUG_VERBOSE, "Backend version: %s, Status: %s\n",
|
rig_debug(RIG_DEBUG_VERBOSE, "Backend version: %s, Status: %s\n",
|
||||||
my_rig->caps->version, rig_strstatus(my_rig->caps->status));
|
my_rig->caps->version, rig_strstatus(my_rig->caps->status));
|
||||||
|
|
||||||
#if 0
|
// Normally we keep the rig open to speed up the 1st client connect
|
||||||
|
// But some rigs like the FT-736 have to lock the rig for CAT control
|
||||||
|
// So they need to release the rig when no clients are connected
|
||||||
|
if (rigctld_idle)
|
||||||
|
{
|
||||||
rig_close(my_rig); /* we will reopen for clients */
|
rig_close(my_rig); /* we will reopen for clients */
|
||||||
|
|
||||||
if (verbose > RIG_DEBUG_ERR)
|
if (verbose > RIG_DEBUG_ERR)
|
||||||
|
@ -771,8 +781,7 @@ int main(int argc, char *argv[])
|
||||||
my_rig->caps->rig_model,
|
my_rig->caps->rig_model,
|
||||||
my_rig->caps->model_name);
|
my_rig->caps->model_name);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __MINGW32__
|
#ifdef __MINGW32__
|
||||||
# ifndef SO_OPENTYPE
|
# ifndef SO_OPENTYPE
|
||||||
|
@ -1405,6 +1414,7 @@ void usage(void)
|
||||||
" -M, --multicast-addr=addr set multicast UDP address, default 0.0.0.0 (off), recommend 224.0.1.1\n"
|
" -M, --multicast-addr=addr set multicast UDP address, default 0.0.0.0 (off), recommend 224.0.1.1\n"
|
||||||
" -n, --multicast-port=port set multicast UDP port, default 4532\n"
|
" -n, --multicast-port=port set multicast UDP port, default 4532\n"
|
||||||
" -A, --password set password for rigctld access\n"
|
" -A, --password set password for rigctld access\n"
|
||||||
|
" -R, --rigctld-idle make rigctld close the rig when no clients are connected\n"
|
||||||
" -h, --help display this help and exit\n"
|
" -h, --help display this help and exit\n"
|
||||||
" -V, --version output version information and exit\n\n",
|
" -V, --version output version information and exit\n\n",
|
||||||
portno);
|
portno);
|
||||||
|
|
Ładowanie…
Reference in New Issue