diff --git a/NEWS b/NEWS index ee183c43f..4d61293e6 100644 --- a/NEWS +++ b/NEWS @@ -10,11 +10,14 @@ Please send Hamlib bug reports to hamlib-developer@lists.sourceforge.net Version 5.x -- future * rig_get_conf deprecated and replaced by rig_get_conf2 * rot_get_conf deprecated and replaced by rot_get_conf2 - * Asynchronous rig data output handling to support transceive and spectrum data. Mikael, OH3BHX - * Multicast UDP packet output for asynchronous data. Mikael, OH3BHX - * Rig state poll routine to serve commonly used data like frequency and mode from cache. Mikael, OH3BHX Version 4.5 + * 2022-03-XX + * Add password capability to rigctld via -A switch. rigctl uses \password, hamlib uses rig_set_password + * Asynchronous rig data output handling to support transceive and spectrum data. Mikael, OH3BHX + * See new set_conf option async for some Icom rigs + * Multicast UDP packet output for asynchronous data. Mikael, OH3BHX + * Rig state poll routine to serve commonly used data like frequency and mode from cache. Mikael, OH3BHX * deprecated hamlib_port_t at front of rig_state structure -- new one at end of structure * New RIG_LEVEL_BAND_SELECT for Yaesu rigs * 202?-??-?? diff --git a/doc/man1/rigctld.1 b/doc/man1/rigctld.1 index 9213e27a7..17458b674 100644 --- a/doc/man1/rigctld.1 +++ b/doc/man1/rigctld.1 @@ -358,6 +358,10 @@ Use only in combination with the option as it generates no output on its own. . .TP +.BR \-A ", " \-\-password +Sets password on rigcltd which requires hamlib to use rig_set_paswword and rigctl to use \\password to access rigctld +. +.TP .BR \-h ", " \-\-help Show a summary of these options and exit. . diff --git a/rigs/dummy/netrigctl.c b/rigs/dummy/netrigctl.c index 1454d4162..3cdfd2327 100644 --- a/rigs/dummy/netrigctl.c +++ b/rigs/dummy/netrigctl.c @@ -2633,14 +2633,17 @@ static int netrigctl_power2mW(RIG *rig, unsigned int *mwpower, float power, int netrigctl_password(RIG *rig, const unsigned char *key1, const unsigned char *key2) { char cmdbuf[256]; - char buf[256]; + char buf[BUF_MAX]; int retval; ENTERFUNC; rig_debug(RIG_DEBUG_VERBOSE, "%s: key1=%s, key2=%s\n", __func__, key1, key2); SNPRINTF(cmdbuf, sizeof(cmdbuf), "\\password %s\n", key1); retval = netrigctl_transaction(rig, cmdbuf, strlen(cmdbuf), buf); + return RIG_OK; +#if 0 RETURNFUNC(retval); +#endif } /* diff --git a/src/rig.c b/src/rig.c index a85076c4d..ad390a7e2 100644 --- a/src/rig.c +++ b/src/rig.c @@ -7106,6 +7106,7 @@ HAMLIB_EXPORT(int) rig_password(RIG *rig, const unsigned char *key1, const unsig if (rig->caps->password != NULL) { retval = rig->caps->password(rig,key1,key2); + //retval = RIG_OK; } RETURNFUNC(retval); } diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c index 9579cb4eb..5cecf2804 100644 --- a/tests/rigctl_parse.c +++ b/tests/rigctl_parse.c @@ -1695,6 +1695,7 @@ readline_repeat: { if (strcmp(cmd_entry->arg1,"ChkVFO")==0) preCmd = 1; else if (strcmp(cmd_entry->arg1,"VFO")==0) preCmd = 1; + else if (strcmp(cmd_entry->arg1,"Password")==0) preCmd = 1; } if (use_password && !is_passwordOK && (cmd_entry->arg1 != NULL) && !preCmd) { @@ -4952,7 +4953,13 @@ declare_proto_rig(password) ENTERFUNC; if (is_rigctld) { - retval = rigctld_password_check(rig, (unsigned char*)passwd, NULL); + retval = rigctld_password_check(rig, (unsigned char*)passwd, "key2"); + } + else + { + retval = rig_password(rig, (unsigned char*) passwd, (unsigned char*)"key2"); + //retval = RIG_OK; + } if (retval == RIG_OK) { @@ -4964,11 +4971,6 @@ declare_proto_rig(password) rig_debug(RIG_DEBUG_ERR, "%s: password error, '%s'!='%s'\n", __func__, passwd, rigctld_password); } - } - else - { - rig_debug(RIG_DEBUG_ERR, "%s: not implemente\n", __func__); - } RETURNFUNC(retval); }