diff --git a/NEWS b/NEWS index 77ccf2c2b..23e9b44eb 100644 --- a/NEWS +++ b/NEWS @@ -14,6 +14,7 @@ Version 5.x -- future Version 4.6 * 2023-11-XX -- Planned for Nov 2023 + * Add client_version to rigctld so client can report it's version for future use/compatility/alternatives * Add --set-conf=tuner_control_pathname=hamlib_tuner_control (default) If file exists then it will be called with 0/1 (Off/On) argument with 'U TUNER 0' or 'U TUNER 1" @@ -23,11 +24,13 @@ Version 4.6 * Fix FTDX3000 rig split Version 4.5.2 + * 2022-12-23 + * Fix PowerSDR ability to do commands while powered off + * Fix TX-500 operations * Fix FTDX5000 to return to MIC input on closing * Fix rig.c calling rig_get_mode when backend does not have get_mode * Fix kenwood_ts890_get_level * Add Prosistel D elevation CBOX az to fix problem with azimuth control - * 2022-12-XX -- Planned for Dec 2022 * Fix FT736R gpredict usage by adding cached get_freq * Fix get_powerstat problem with Log4OM/Flex and others * Fix -R option to not need argument diff --git a/doc/man1/rigctl.1 b/doc/man1/rigctl.1 index 33e75464f..d68fae783 100644 --- a/doc/man1/rigctl.1 +++ b/doc/man1/rigctl.1 @@ -1321,6 +1321,11 @@ Examples: send_raw -1 0xFE;0xFE;0x94;0x03;0xFD send_raw 14 0xFE;0xFE;0x94;0x03;0xFD . +.TP +.BR client_version " \(aq" \fIString\fP "\(aq +.EX + Client can send it's version to rigctld and get feedback on compatibility, deprecation, and alternatives +. .SH READLINE . If diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h index d93e7986f..eb3d9a0e9 100644 --- a/include/hamlib/rig.h +++ b/include/hamlib/rig.h @@ -2589,6 +2589,7 @@ struct rig_state { int lock_mode; /*cmd != 0x8f // dump_state && cmd_entry->cmd != 0xf0 // chk_vfo && cmd_entry->cmd != 0x87 // set_powerstat - && my_rig->caps->rig_model != RIG_MODEL_POWERSDR) // some rigs can do stuff when powered off + && cmd_entry->cmd != 0xa5 // client_version + && my_rig->caps->rig_model != + RIG_MODEL_POWERSDR) // some rigs can do stuff when powered off { rig_debug(RIG_DEBUG_WARN, "%s: command %s not allowed when rig is powered off\n", __func__, @@ -1778,6 +1783,10 @@ readline_repeat: p2 ? p2 : "", p3 ? p3 : ""); } + + // we need to copy client_version to our thread in case there are multiple client versions + // client_version is used to determine any backward compatiblity requirements or problems + strncpy(client_version, my_rig->state.client_version, sizeof(client_version)); } @@ -1855,6 +1864,20 @@ void version() printf("%s\n", hamlib_copyright); } +declare_proto_rig(client_version) +{ + if ((interactive && prompt) || (interactive && !prompt && ext_resp)) + { + fprintf(fout, "%s: ", cmd->arg1); + } + + fprintf(fout, "%s%c", arg1, resp_sep); + strncpy(rig->state.client_version, arg1, sizeof(rig->state.client_version) - 1); + rig_debug(RIG_DEBUG_VERBOSE, "%s: client_version=%s\n", __func__, + rig->state.client_version); + return RIG_OK; +} + void usage_rig(FILE *fout) {