[Hamlib-commits] Hamlib -- Ham radio control libraries branch master updated. b61550bf6b53c0cef885e
Library to control radio transceivers and receivers
Brought to you by:
n0nb
From: n0nb <n0...@us...> - 2022-12-24 17:09:39
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Hamlib -- Ham radio control libraries". The branch, master has been updated via b61550bf6b53c0cef885ed1443967a6c9aa2fb78 (commit) via 4689a2ff11674da65c1a1245a204010c5f4b758e (commit) via bfa4bbd50da3f143074fa87b46b50b749d7d7948 (commit) via 70f38022b6da3375c4b321b810f417d20e29ac45 (commit) via 33b24561291db92010a851e2fda4660bb9fc3bb1 (commit) via 17f88dccbf97259f5ea1728ad39f57a08e96a0e7 (commit) via 267d07f708bea7a6734129b469dc55fdddb5a3b5 (commit) via f31e1b7ad9b9cc3f035a3942fc4dc303e53b1ac4 (commit) via cafc094788fcdd65e5fb936e5451a08b780c8ecd (commit) via b153bcd1e5604b55fd5c0d1b46389909f074c169 (commit) via f468fa3c1d93e93652cbdbfc8998546b6a79a422 (commit) via 31e911edb87e3eeec794cb4d26e8bcfea9cd6834 (commit) via 287fb9091b6479b06eaa55981da149c43145ce60 (commit) via 04b18c9d5be503a064c9198843408799d2c53e0f (commit) via ea29263f3512dda2f93ba3429189a20a6782a305 (commit) via b1828d951a2159e87b6208f6eb3aabdacc03b6aa (commit) via 9970a2767d2f49c427c51c6a0780a41010269b89 (commit) via 04f5195cfd68df95bdaaa185b577555390f1276c (commit) via 9508c45f00558bce22409c472b0de3d5d95f40c8 (commit) via 120c580de0b67a9da1deac2b53e4238fd3774d57 (commit) via 250a5b0211fd2e8000dcf02e943915940a2ff911 (commit) via f554c3a7ffb495cb0ad007d0b1cc86c183c78696 (commit) via 32b1ce161e5f2726be1f195b531eca14c196514a (commit) via 830bf5a94171847ff82ce9f22edcfd3a2a2fecf8 (commit) via 9eecfc3b2df1804f6ddccafea160fe6f9d80efc6 (commit) via 40066a6cfa0cc7d49d9e2a25edf5dcac46421e84 (commit) via b1ac588667e74af74e7eb32be3badfc4ad1e77d8 (commit) via 7fc23e59a337e853e292e8e89d39d6a2179498ea (commit) via 2a84386ae89989158d9bc628654188219138f9d5 (commit) via 57f2646daaeac87ee430ec485f0abc1c4c5f1d80 (commit) via e9192f5a8b19a609960d76506c189141ab25fe31 (commit) via a9497b295854d942b3605294622c9402b14c5245 (commit) via eb03592d002af78ff7755f463680ab75ac1bd972 (commit) via d1fffb7c84c3d9e2ade81ef6baeff66fe421155d (commit) via 368a07ad78b46ea8ed010a9bc039b5ea4cafebd4 (commit) via f224e71a5830eaabe1f751a5d172bdea3ce6f618 (commit) via 5b704d24fb4556be7e76603d7a3bcfdde76bee16 (commit) via 5c4c2f7748d05c390754e52c81bf017789999723 (commit) via df8b88072a74947ffc14d70e0902d43a5a2b2436 (commit) via 3a91446287b1ab3fe3630be108141e306d5caf2e (commit) via d977f3fbdb0131315c7a8c9395899a3ee09a8e64 (commit) via 294bdc7d2aa04909abc638fad877083dc1ac8cbd (commit) via d1dccffd6b01360c0bb72acd988a09d6a94fcf1c (commit) via fd245473865a22704941ca1ca92ce6a51e68daeb (commit) via 5339b431e4f47faaa380dc8f909d0de0efe4ee28 (commit) via 17ad0fcb90bbcc060c94f9bed6aa302a4789298f (commit) via 6331709fd6fd015dd8eb8aac8a0ebf3cc4411ca2 (commit) via ebdad6d736282756f59b365386b347b7ba5f5543 (commit) via 6ef7009f6c2302cc954efdf401fd9bf5edd28e37 (commit) via 2f7e5ab733c9b1ebb919959550b02cc9938c2871 (commit) via f359f32bc4075973ab6b8bbc570cbae56c973ec4 (commit) via 34ef939350ba0add7f1604e7377a65882e72c41e (commit) via f17a08fe85ebff5e6962b420a48cba51fb0d84ba (commit) via f4923723fb1ac46daf6e9beb5fb8b88acba0c49b (commit) via 05a8aaebe327ef0a738a2cd5743d57d2ef1a2510 (commit) via a5773f6f4e430dcff9de7beb0ac8a2da8f88f3e9 (commit) via 3f077a5cf5a179b2258d857cd5facda43649eb4b (commit) via 6008979708c64d27b1684ab278e1856dac5e37ec (commit) via 93c4c28d0627c490818a7750aecaa2512ab097d8 (commit) via 84fc3169df66aba2a5ce940c1f9ad162fa73f092 (commit) via b93551712fb0d77f0957275f6dc4005721dccec5 (commit) via 2f6b80d98d475c8cc4a7a3bf0ca8a771dee78d4b (commit) via 6de45dd331c289f21be597b9e4d49e3629eca73e (commit) via f7fe2912eca74a9edb8818c6e3fb6ac6ef53dd1d (commit) from 477c94c8fbf1ec4b82fb976d569c9d87357f7d1d (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit b61550bf6b53c0cef885ed1443967a6c9aa2fb78 Merge: 4689a2ff bfa4bbd5 Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Dec 23 23:40:11 2022 -0600 Merge branch 'master' of https://github.com/Hamlib/Hamlib commit 4689a2ff11674da65c1a1245a204010c5f4b758e Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Dec 23 23:39:20 2022 -0600 Add client_version for rigctld clients to report their version to rigctld This should allow for rigctld to report deprecation, compatibility, or alternatives https://github.com/Hamlib/Hamlib/issues/1153 diff --git a/NEWS b/NEWS index 77ccf2c2..23e9b44e 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 33e75464..d68fae78 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 d93e7986..eb3d9a0e 100644 --- a/include/hamlib/rig.h +++ b/include/hamlib/rig.h @@ -2589,6 +2589,7 @@ struct rig_state { int lock_mode; /*<! flag that prevents mode changes if ~= 0 -- see set/get_lock_mode */ powerstat_t powerstat; /*<! power status */ char *tuner_control_pathname; /*<! Path to external tuner control program that get 0/1 (Off/On) argument */ + char client_version[32]; /*<! Allow client to report version for compatility checks/capability */ }; //! @cond Doxygen_Suppress diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c index 1b356aac..c1aeb838 100644 --- a/tests/rigctl_parse.c +++ b/tests/rigctl_parse.c @@ -259,6 +259,7 @@ declare_proto_rig(get_separator); declare_proto_rig(set_lock_mode); declare_proto_rig(get_lock_mode); declare_proto_rig(send_raw); +declare_proto_rig(client_version); /* @@ -372,6 +373,7 @@ static struct test_table test_list[] = { 0xa2, "set_lock_mode", ACTION(set_lock_mode), ARG_IN | ARG_NOVFO, "Locked" }, { 0xa3, "get_lock_mode", ACTION(get_lock_mode), ARG_NOVFO, "Locked" }, { 0xa4, "send_raw", ACTION(send_raw), ARG_NOVFO | ARG_IN1 | ARG_IN2 | ARG_OUT3, "Terminator", "Command", "Send raw answer" }, + { 0xa5, "client_version", ACTION(client_version), ARG_NOVFO | ARG_IN1, "Version", "Client version" }, { 0x00, "", NULL }, }; @@ -674,6 +676,7 @@ int rigctl_parse(RIG *my_rig, FILE *fin, FILE *fout, char *argv[], int argc, char arg2[MAXARGSZ + 1], *p2 = NULL; char arg3[MAXARGSZ + 1], *p3 = NULL; vfo_t vfo = RIG_VFO_CURR; + char client_version[32]; rig_debug(RIG_DEBUG_TRACE, "%s: called, interactive=%d\n", __func__, interactive); @@ -1753,7 +1756,9 @@ readline_repeat: && cmd_entry->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) { commit bfa4bbd50da3f143074fa87b46b50b749d7d7948 Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Dec 23 17:44:44 2022 -0600 Full version info now available for Windows File/Properties/Details Will show git version until released https://github.com/Hamlib/Hamlib/issues/1168 diff --git a/src/Makefile.am b/src/Makefile.am index 90c34e42..47c8ec9b 100755 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -51,7 +51,7 @@ LTRCCOMPILE = $(LIBTOOL) --mode=compile --tag=RC $(RCCOMPILE) $(LTRCCOMPILE) -i "$<" -o "$@" .rc.o: - $(RCCOMPILE) -i "$<" -o "$@" + $(RCCOMPILE) -O coff -i "$<" -o "$@" .mc.rc: $(WINDMC) "$<" diff --git a/src/version_dll.rc b/src/version_dll.rc index 1abe9f54..329aefc6 100755 --- a/src/version_dll.rc +++ b/src/version_dll.rc @@ -1,20 +1,22 @@ #include <windows.h> #include <hamlibdatetime.h> +#include <config.h> -#define VERSIONINFO_1 1 +//#define HAMLIB_RC_FILEVERSION 4,6,0,0 -VERSIONINFO_1 VERSIONINFO +VS_VERSION_INFO VERSIONINFO +FILEVERSION ABI_VERSION,ABI_REVISION,ABI_AGE,0 +FILETYPE VFT_DLL +FILESUBTYPE VFT2_UNKNOWN { BLOCK "StringFileInfo" { BLOCK "040904E4" { VALUE "FileDescription", "Hamlib DLL" - VALUE "FileVersion", "4.6.0.0" - VALUE "ProductName", "Hamlib" + VALUE "ProductName", PACKAGE_STRING VALUE "ProductVersion", HAMLIBDATETIME - VALUE "InternalName", "sha256" - VALUE "LegalCopyright", "Copyright Hamlib Team 2022" + VALUE "LegalCopyright", "Copyright Hamlib Team 1991-2023" VALUE "OriginalFilename", "libhamlib-4.dll" } @@ -22,7 +24,6 @@ VERSIONINFO_1 VERSIONINFO BLOCK "VarFileInfo" { - VALUE "Translation", 0x409, 1200 + VALUE "Translation", 0x409, 20127 } - } commit 70f38022b6da3375c4b321b810f417d20e29ac45 Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Dec 23 16:53:18 2022 -0600 Update NEWS diff --git a/NEWS b/NEWS index 36502060..77ccf2c2 100644 --- a/NEWS +++ b/NEWS @@ -23,6 +23,7 @@ Version 4.6 * Fix FTDX3000 rig split Version 4.5.2 + * 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 commit 33b24561291db92010a851e2fda4660bb9fc3bb1 Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Dec 23 16:49:45 2022 -0600 Make FTDX5000 return to MIC input on closing https://github.com/Hamlib/Hamlib/issues/1193 diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index fda8aa01..9bff762a 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -662,6 +662,14 @@ int newcat_close(RIG *rig) priv->poweron = 0; } + if (is_ftdx5000) + { + // Ensure FT5000 is back to MIC input + SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "EX1030;"); + rig_debug(RIG_DEBUG_TRACE, "%s: cmd_str = %s\n", __func__, priv->cmd_str); + newcat_set_cmd(rig); // don't care about the return + } + RETURNFUNC(RIG_OK); } diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h index c45a4d9d..a0be7487 100644 --- a/rigs/yaesu/newcat.h +++ b/rigs/yaesu/newcat.h @@ -50,7 +50,7 @@ typedef char ncboolean; /* shared function version */ -#define NEWCAT_VER "20221211" +#define NEWCAT_VER "20221223" /* Hopefully large enough for future use, 128 chars plus '\0' */ #define NEWCAT_DATA_LEN 129 commit 17f88dccbf97259f5ea1728ad39f57a08e96a0e7 Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Dec 22 12:14:29 2022 -0600 Fix version_dll.c https://github.com/Hamlib/Hamlib/issues/1168 diff --git a/src/version_dll.rc b/src/version_dll.rc index a5703f90..1abe9f54 100755 --- a/src/version_dll.rc +++ b/src/version_dll.rc @@ -9,7 +9,6 @@ VERSIONINFO_1 VERSIONINFO { BLOCK "040904E4" { -<<<<<<< HEAD VALUE "FileDescription", "Hamlib DLL" VALUE "FileVersion", "4.6.0.0" VALUE "ProductName", "Hamlib" @@ -17,27 +16,13 @@ VERSIONINFO_1 VERSIONINFO VALUE "InternalName", "sha256" VALUE "LegalCopyright", "Copyright Hamlib Team 2022" VALUE "OriginalFilename", "libhamlib-4.dll" -======= - VALUE "CompanyName", "Hamlib Team\000" - VALUE "FileDescription", "Hamlib DLL\000" - VALUE "ProductName", "Hamlib\000" - VALUE "FileVersion", 4,6,0,0 - VALUE "ProductVersion", HAMLIBDATETIME - VALUE "InternalName", "sha256" - VALUE "LegalCopyright", "Copyright Hamlib Team 2022\000" - VALUE "OriginalFilename", "libhamlib-4.dll\000" ->>>>>>> cafc094788fcdd65e5fb936e5451a08b780c8ecd } } BLOCK "VarFileInfo" { -<<<<<<< HEAD VALUE "Translation", 0x409, 1200 -======= - VALUE "Translation", 0x409, 1252 ->>>>>>> cafc094788fcdd65e5fb936e5451a08b780c8ecd } } commit 267d07f708bea7a6734129b469dc55fdddb5a3b5 Merge: f31e1b7a cafc0947 Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Dec 22 11:58:13 2022 -0600 Merge branch 'master' of https://github.com/Hamlib/Hamlib diff --cc configure.ac index 394d2701,265279c9..d0938071 --- a/configure.ac +++ b/configure.ac @@@ -285,8 -284,8 +285,9 @@@ AS_CASE(["$host_os"] AC_SUBST([OSXLDFLAGS])], [mingw* | pw32* | cygwin*], [ + AM_CONDITIONAL([VERSIONDLL], true) WINLDFLAGS="-Wl,--output-def,libhamlib.def -Wl,--add-stdcall-alias" + VERSIONDLL="version_dll.rc" AC_SUBST([WINLDFLAGS]) # Enable ld's "auto import" for executables diff --cc src/Makefile.am index 94ed7462,25e4f7cd..90c34e42 mode 100755,100644..100755 --- a/src/Makefile.am +++ b/src/Makefile.am @@@ -10,15 -11,10 +10,15 @@@ RIGSRC = hamlibdatetime.h rig.c serial. network.c network.h cm108.c cm108.h gpio.c gpio.h idx_builtin.h token.h \ par_nt.h microham.c microham.h amplifier.c amp_reg.c amp_conf.c \ amp_conf.h amp_settings.c extamp.c sleep.c sleep.h sprintflst.c \ - sprintflst.h cache.c cache.h snapshot_data.c snapshot_data.h $(VERSIONDLL) + sprintflst.h cache.c cache.h snapshot_data.c snapshot_data.h + +if VERSIONDLL +RIGSRC += \ + version_dll.rc +endif lib_LTLIBRARIES = libhamlib.la - libhamlib_la_SOURCES = $(RIGSRC) + libhamlib_la_SOURCES = $(RIGSRC) $(VERSIONDLL) libhamlib_la_LDFLAGS = $(WINLDFLAGS) $(OSXLDFLAGS) -no-undefined -version-info $(ABI_VERSION):$(ABI_REVISION):$(ABI_AGE) libhamlib_la_LIBADD = $(top_builddir)/lib/libmisc.la $(top_builddir)/security/libsecurity.la \ diff --cc src/version_dll.rc index 1abe9f54,70e758ad..a5703f90 --- a/src/version_dll.rc +++ b/src/version_dll.rc @@@ -9,20 -9,21 +9,35 @@@ VERSIONINFO_1 VERSIONINF { BLOCK "040904E4" { ++<<<<<<< HEAD + VALUE "FileDescription", "Hamlib DLL" + VALUE "FileVersion", "4.6.0.0" + VALUE "ProductName", "Hamlib" + VALUE "ProductVersion", HAMLIBDATETIME + VALUE "InternalName", "sha256" + VALUE "LegalCopyright", "Copyright Hamlib Team 2022" + VALUE "OriginalFilename", "libhamlib-4.dll" ++======= + VALUE "CompanyName", "Hamlib Team\000" + VALUE "FileDescription", "Hamlib DLL\000" + VALUE "ProductName", "Hamlib\000" + VALUE "FileVersion", 4,6,0,0 + VALUE "ProductVersion", HAMLIBDATETIME + VALUE "InternalName", "sha256" + VALUE "LegalCopyright", "Copyright Hamlib Team 2022\000" + VALUE "OriginalFilename", "libhamlib-4.dll\000" ++>>>>>>> cafc094788fcdd65e5fb936e5451a08b780c8ecd } } BLOCK "VarFileInfo" { ++<<<<<<< HEAD + VALUE "Translation", 0x409, 1200 ++======= + VALUE "Translation", 0x409, 1252 ++>>>>>>> cafc094788fcdd65e5fb936e5451a08b780c8ecd } } commit f31e1b7ad9b9cc3f035a3942fc4dc303e53b1ac4 Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Dec 22 11:50:50 2022 -0600 File/Properties/Details on hamlib-X.dll now shows information except for File version (still to be fixed) https://github.com/Hamlib/Hamlib/issues/1168 diff --git a/configure.ac b/configure.ac index a8527b8e..394d2701 100644 --- a/configure.ac +++ b/configure.ac @@ -15,6 +15,8 @@ dnl however, the use of '~' should be fine as apt (others?) will treat dnl it as an earlier version than the actual release. TNX KA6MAL dnl PACKAGE_NAME + " " + PACKAGE_VERSION must not exceed 20 chars! AC_INIT([Hamlib],[4.6~git],[ham...@li...],[hamlib],[http://www.hamlib.org]) +#AC_INIT([PRODUCT_NAME], [Hamlib]) +#AC_DEFINE([Hamlib], [PRODUCT_VERSION_RESOURCE]) AC_CONFIG_SRCDIR([include/hamlib/rig.h]) AC_CONFIG_MACRO_DIR([macros]) @@ -260,6 +262,7 @@ LT_PREREQ([2.2.6b]) dnl N.B. LT_INIT([win32-dll]) does not work for older libtool dnl so require new enough version above. LT_INIT([win32-dll]) +LT_LANG([Windows Resource]) ## -------------------------- ## @@ -267,6 +270,7 @@ LT_INIT([win32-dll]) ## -------------------------- ## dnl The host_os variable is set by the AC_CANONICAL_HOST macro above. +AM_CONDITIONAL([VERSIONDLL], false) AS_CASE(["$host_os"], [freebsd*], [ AM_CPPFLAGS="-I/usr/local/include ${AM_CPPFLAGS}" @@ -281,6 +285,7 @@ AS_CASE(["$host_os"], AC_SUBST([OSXLDFLAGS])], [mingw* | pw32* | cygwin*], [ + AM_CONDITIONAL([VERSIONDLL], true) WINLDFLAGS="-Wl,--output-def,libhamlib.def -Wl,--add-stdcall-alias" AC_SUBST([WINLDFLAGS]) diff --git a/src/Makefile.am b/src/Makefile.am old mode 100644 new mode 100755 index fe4431de..94ed7462 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,4 +1,3 @@ -# src/Makefile.am BUILT_SOURCES = $(builddir)/hamlibdatetime.h @@ -11,7 +10,12 @@ RIGSRC = hamlibdatetime.h rig.c serial.c serial.h misc.c misc.h register.c regis network.c network.h cm108.c cm108.h gpio.c gpio.h idx_builtin.h token.h \ par_nt.h microham.c microham.h amplifier.c amp_reg.c amp_conf.c \ amp_conf.h amp_settings.c extamp.c sleep.c sleep.h sprintflst.c \ - sprintflst.h cache.c cache.h snapshot_data.c snapshot_data.h + sprintflst.h cache.c cache.h snapshot_data.c snapshot_data.h + +if VERSIONDLL +RIGSRC += \ + version_dll.rc +endif lib_LTLIBRARIES = libhamlib.la libhamlib_la_SOURCES = $(RIGSRC) @@ -20,7 +24,7 @@ libhamlib_la_LDFLAGS = $(WINLDFLAGS) $(OSXLDFLAGS) -no-undefined -version-info $ libhamlib_la_LIBADD = $(top_builddir)/lib/libmisc.la $(top_builddir)/security/libsecurity.la \ $(BACKENDEPS) $(RIG_BACKENDEPS) $(ROT_BACKENDEPS) $(AMP_BACKENDEPS) $(NET_LIBS) $(MATH_LIBS) $(LIBUSB_LIBS) $(INDI_LIBS) -libhamlib_la_DEPENDENCIES = $(top_builddir)/lib/libmisc.la $(top_builddir)/security/libsecurity.la $(BACKENDEPS) $(RIG_BACKENDEPS) $(ROT_BACKENDEPS) $(AMP_BACKENDEPS) +libhamlib_la_DEPENDENCIES = $(top_builddir)/lib/libmisc.la $(top_builddir)/security/libsecurity.la $(BACKENDEPS) $(RIG_BACKENDEPS) $(ROT_BACKENDEPS) $(AMP_BACKENDEPS) EXTRA_DIST = Android.mk hamlibdatetime.h.in @@ -32,13 +36,29 @@ EXTRA_DIST = Android.mk hamlibdatetime.h.in hamlibdatetime.h: FORCE @if test -x $(top_srcdir)/.git ; then \ echo "/* This date time is from the last non-merge commit to Hamlib. */" > $(builddir)/$(@F).tmp ;\ - echo "#define HAMLIBDATETIME "\"$$(TZ=UTC git --git-dir=$(top_srcdir)/.git log --no-merges --date='format-local:%a %b %d %H:%M:%S %Y %z SHA=' --format='%cd' -n 1)$$(git --git-dir=$(top_srcdir)/.git log --no-merges | grep commit | head -n 1 | cut -c8-13)\" >> $(builddir)/$(@F).tmp ;\ + echo "#define HAMLIBDATETIME "\"$$(TZ=UTC git --git-dir=$(top_srcdir)/.git log --no-merges --date='format-local:%b %d %H:%M:%SZ %Y SHA=' --format='%cd' -n 1)$$(git --git-dir=$(top_srcdir)/.git log --no-merges | grep commit | head -n 1 | cut -c8-13)\" >> $(builddir)/$(@F).tmp ;\ diff -qN $(builddir)/$(@F).tmp $(builddir)/$(@F) ; test $$? -eq 0 || { echo "Generating SCS header \"$(builddir)/$(@F)\"" ; mv -f $(builddir)/$(@F).tmp $(builddir)/$(@F) ; } ;\ rm -f $(builddir)/$(@F).tmp ;\ else \ test -f $(srcdir)/$(@F) || cp $(srcdir)/$(@F).in $(srcdir)/$(@F) ;\ fi +RCCOMPILE = $(RC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) + +LTRCCOMPILE = $(LIBTOOL) --mode=compile --tag=RC $(RCCOMPILE) + +.rc.lo: + $(LTRCCOMPILE) -i "$<" -o "$@" + +.rc.o: + $(RCCOMPILE) -i "$<" -o "$@" + +.mc.rc: + $(WINDMC) "$<" + +#version.la: version.rc +# windres $(srcdir)/version.rc -o $(builddir)/version.o + FORCE: # If we are making a distribution out-of-source and we have generated diff --git a/src/version_dll.rc b/src/version_dll.rc new file mode 100755 index 00000000..1abe9f54 --- /dev/null +++ b/src/version_dll.rc @@ -0,0 +1,28 @@ +#include <windows.h> +#include <hamlibdatetime.h> + +#define VERSIONINFO_1 1 + +VERSIONINFO_1 VERSIONINFO +{ + BLOCK "StringFileInfo" + { + BLOCK "040904E4" + { + VALUE "FileDescription", "Hamlib DLL" + VALUE "FileVersion", "4.6.0.0" + VALUE "ProductName", "Hamlib" + VALUE "ProductVersion", HAMLIBDATETIME + VALUE "InternalName", "sha256" + VALUE "LegalCopyright", "Copyright Hamlib Team 2022" + VALUE "OriginalFilename", "libhamlib-4.dll" + } + + } + + BLOCK "VarFileInfo" + { + VALUE "Translation", 0x409, 1200 + } + +} commit cafc094788fcdd65e5fb936e5451a08b780c8ecd Author: Mike Black W9MDB <mdb...@ya...> Date: Wed Dec 21 15:44:36 2022 -0600 Add version information for Windows file/Properties/Details https://github.com/Hamlib/Hamlib/issues/1168 diff --git a/configure.ac b/configure.ac index a8527b8e..265279c9 100644 --- a/configure.ac +++ b/configure.ac @@ -15,6 +15,8 @@ dnl however, the use of '~' should be fine as apt (others?) will treat dnl it as an earlier version than the actual release. TNX KA6MAL dnl PACKAGE_NAME + " " + PACKAGE_VERSION must not exceed 20 chars! AC_INIT([Hamlib],[4.6~git],[ham...@li...],[hamlib],[http://www.hamlib.org]) +#AC_INIT([PRODUCT_NAME], [Hamlib]) +#AC_DEFINE([Hamlib], [PRODUCT_VERSION_RESOURCE]) AC_CONFIG_SRCDIR([include/hamlib/rig.h]) AC_CONFIG_MACRO_DIR([macros]) @@ -260,6 +262,7 @@ LT_PREREQ([2.2.6b]) dnl N.B. LT_INIT([win32-dll]) does not work for older libtool dnl so require new enough version above. LT_INIT([win32-dll]) +LT_LANG([Windows Resource]) ## -------------------------- ## @@ -282,6 +285,7 @@ AS_CASE(["$host_os"], [mingw* | pw32* | cygwin*], [ WINLDFLAGS="-Wl,--output-def,libhamlib.def -Wl,--add-stdcall-alias" + VERSIONDLL="version_dll.rc" AC_SUBST([WINLDFLAGS]) # Enable ld's "auto import" for executables diff --git a/src/Makefile.am b/src/Makefile.am index fe4431de..25e4f7cd 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -11,16 +11,16 @@ RIGSRC = hamlibdatetime.h rig.c serial.c serial.h misc.c misc.h register.c regis network.c network.h cm108.c cm108.h gpio.c gpio.h idx_builtin.h token.h \ par_nt.h microham.c microham.h amplifier.c amp_reg.c amp_conf.c \ amp_conf.h amp_settings.c extamp.c sleep.c sleep.h sprintflst.c \ - sprintflst.h cache.c cache.h snapshot_data.c snapshot_data.h + sprintflst.h cache.c cache.h snapshot_data.c snapshot_data.h $(VERSIONDLL) lib_LTLIBRARIES = libhamlib.la -libhamlib_la_SOURCES = $(RIGSRC) +libhamlib_la_SOURCES = $(RIGSRC) $(VERSIONDLL) libhamlib_la_LDFLAGS = $(WINLDFLAGS) $(OSXLDFLAGS) -no-undefined -version-info $(ABI_VERSION):$(ABI_REVISION):$(ABI_AGE) libhamlib_la_LIBADD = $(top_builddir)/lib/libmisc.la $(top_builddir)/security/libsecurity.la \ $(BACKENDEPS) $(RIG_BACKENDEPS) $(ROT_BACKENDEPS) $(AMP_BACKENDEPS) $(NET_LIBS) $(MATH_LIBS) $(LIBUSB_LIBS) $(INDI_LIBS) -libhamlib_la_DEPENDENCIES = $(top_builddir)/lib/libmisc.la $(top_builddir)/security/libsecurity.la $(BACKENDEPS) $(RIG_BACKENDEPS) $(ROT_BACKENDEPS) $(AMP_BACKENDEPS) +libhamlib_la_DEPENDENCIES = $(top_builddir)/lib/libmisc.la $(top_builddir)/security/libsecurity.la $(BACKENDEPS) $(RIG_BACKENDEPS) $(ROT_BACKENDEPS) $(AMP_BACKENDEPS) EXTRA_DIST = Android.mk hamlibdatetime.h.in @@ -32,13 +32,29 @@ EXTRA_DIST = Android.mk hamlibdatetime.h.in hamlibdatetime.h: FORCE @if test -x $(top_srcdir)/.git ; then \ echo "/* This date time is from the last non-merge commit to Hamlib. */" > $(builddir)/$(@F).tmp ;\ - echo "#define HAMLIBDATETIME "\"$$(TZ=UTC git --git-dir=$(top_srcdir)/.git log --no-merges --date='format-local:%a %b %d %H:%M:%S %Y %z SHA=' --format='%cd' -n 1)$$(git --git-dir=$(top_srcdir)/.git log --no-merges | grep commit | head -n 1 | cut -c8-13)\" >> $(builddir)/$(@F).tmp ;\ + echo "#define HAMLIBDATETIME "\"$$(TZ=UTC git --git-dir=$(top_srcdir)/.git log --no-merges --date='format-local:%b %d %H:%M:%SZ %Y SHA=' --format='%cd' -n 1)$$(git --git-dir=$(top_srcdir)/.git log --no-merges | grep commit | head -n 1 | cut -c8-13)\" >> $(builddir)/$(@F).tmp ;\ diff -qN $(builddir)/$(@F).tmp $(builddir)/$(@F) ; test $$? -eq 0 || { echo "Generating SCS header \"$(builddir)/$(@F)\"" ; mv -f $(builddir)/$(@F).tmp $(builddir)/$(@F) ; } ;\ rm -f $(builddir)/$(@F).tmp ;\ else \ test -f $(srcdir)/$(@F) || cp $(srcdir)/$(@F).in $(srcdir)/$(@F) ;\ fi +RCCOMPILE = $(RC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) + +LTRCCOMPILE = $(LIBTOOL) --mode=compile --tag=RC $(RCCOMPILE) + +.rc.lo: + $(LTRCCOMPILE) -i "$<" -o "$@" + +.rc.o: + $(RCCOMPILE) -i "$<" -o "$@" + +.mc.rc: + $(WINDMC) "$<" + +#version.la: version.rc +# windres $(srcdir)/version.rc -o $(builddir)/version.o + FORCE: # If we are making a distribution out-of-source and we have generated diff --git a/src/version_dll.rc b/src/version_dll.rc new file mode 100755 index 00000000..70e758ad --- /dev/null +++ b/src/version_dll.rc @@ -0,0 +1,29 @@ +#include <windows.h> +#include <hamlibdatetime.h> + +#define VERSIONINFO_1 1 + +VERSIONINFO_1 VERSIONINFO +{ + BLOCK "StringFileInfo" + { + BLOCK "040904E4" + { + VALUE "CompanyName", "Hamlib Team\000" + VALUE "FileDescription", "Hamlib DLL\000" + VALUE "ProductName", "Hamlib\000" + VALUE "FileVersion", 4,6,0,0 + VALUE "ProductVersion", HAMLIBDATETIME + VALUE "InternalName", "sha256" + VALUE "LegalCopyright", "Copyright Hamlib Team 2022\000" + VALUE "OriginalFilename", "libhamlib-4.dll\000" + } + + } + + BLOCK "VarFileInfo" + { + VALUE "Translation", 0x409, 1252 + } + +} commit b153bcd1e5604b55fd5c0d1b46389909f074c169 Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Dec 20 08:29:12 2022 -0600 Change TX-500 to only have 9600 baud available https://github.com/Hamlib/Hamlib/issues/1188 diff --git a/rigs/kenwood/tx500.c b/rigs/kenwood/tx500.c index 0cb037ba..6edeffdc 100644 --- a/rigs/kenwood/tx500.c +++ b/rigs/kenwood/tx500.c @@ -127,15 +127,15 @@ const struct rig_caps tx500_caps = RIG_MODEL(RIG_MODEL_LAB599_TX500), .model_name = "TX-500", .mfg_name = "Lab599", - .version = BACKEND_VER ".2", + .version = BACKEND_VER ".3", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, .ptt_type = RIG_PTT_RIG, .dcd_type = RIG_DCD_RIG, .port_type = RIG_PORT_SERIAL, - .serial_rate_min = 1200, - .serial_rate_max = 57600, + .serial_rate_min = 9600, + .serial_rate_max = 9600, .serial_data_bits = 8, .serial_stop_bits = 1, .serial_parity = RIG_PARITY_NONE, commit f468fa3c1d93e93652cbdbfc8998546b6a79a422 Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Dec 19 16:58:44 2022 -0600 Allow POWERSDR to do commands when powered off diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c index 6cb82915..1b356aac 100644 --- a/tests/rigctl_parse.c +++ b/tests/rigctl_parse.c @@ -1752,7 +1752,8 @@ readline_repeat: && cmd_entry->cmd != '3' // dump_conf && cmd_entry->cmd != 0x8f // dump_state && cmd_entry->cmd != 0xf0 // chk_vfo - && cmd_entry->cmd != 0x87) // set_powerstat + && cmd_entry->cmd != 0x87 // set_powerstat + && 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__, commit 31e911edb87e3eeec794cb4d26e8bcfea9cd6834 Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Dec 19 14:55:14 2022 -0600 Remove powerstat from TX-500 -- was always responding PS0; https://github.com/Hamlib/Hamlib/issues/1188 diff --git a/rigs/kenwood/tx500.c b/rigs/kenwood/tx500.c index d5cb6398..0cb037ba 100644 --- a/rigs/kenwood/tx500.c +++ b/rigs/kenwood/tx500.c @@ -127,7 +127,7 @@ const struct rig_caps tx500_caps = RIG_MODEL(RIG_MODEL_LAB599_TX500), .model_name = "TX-500", .mfg_name = "Lab599", - .version = BACKEND_VER ".1", + .version = BACKEND_VER ".2", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -318,8 +318,8 @@ const struct rig_caps tx500_caps = .set_channel = ts2000_set_channel, .set_trn = kenwood_set_trn, .get_trn = kenwood_get_trn, - .set_powerstat = kenwood_set_powerstat, - .get_powerstat = kenwood_get_powerstat, + //.set_powerstat = kenwood_set_powerstat, + //.get_powerstat = kenwood_get_powerstat, .get_info = kenwood_get_info, .reset = kenwood_reset, .hamlib_check_rig_caps = HAMLIB_CHECK_RIG_CAPS commit 287fb9091b6479b06eaa55981da149c43145ce60 Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Dec 19 14:38:58 2022 -0600 Update info in hamlib_tuner_control https://github.com/Hamlib/Hamlib/issues/1192 diff --git a/tests/hamlib_tuner_control b/tests/hamlib_tuner_control index 4f5b923e..d8836c06 100755 --- a/tests/hamlib_tuner_control +++ b/tests/hamlib_tuner_control @@ -1,4 +1,9 @@ #!/bin/sh +# Put this script in /usr/local/bin +# --set-conf=tuner_contrl_pathname=/usr/local/bin/hamlib_tuner_control +# Or use a batch file in Windows for example in C:\Util\tuner.bat +# echo Tuner %1 +# --set-conf=C:/Util/tuner.bat if [ "$#" -eq 0 ] then echo "Expected arg 0 or 1...got nothing" commit 04b18c9d5be503a064c9198843408799d2c53e0f Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Dec 19 12:55:18 2022 -0600 Add --set-conf=tuner_control_pathname=hamlib_tuner_control Program will be passed 0 or 1 (Off or On) Example script in tests/hamlib_tuner_control https://github.com/Hamlib/Hamlib/issues/1192 diff --git a/NEWS b/NEWS index 730d3779..36502060 100644 --- a/NEWS +++ b/NEWS @@ -14,6 +14,10 @@ Version 5.x -- future Version 4.6 * 2023-11-XX -- Planned for Nov 2023 + * 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" + Default path is for current directory * Add MDS 4710/9710 rigs * Add FLIR PTU-D48, E46, D100, D300 rotors * Fix FTDX3000 rig split diff --git a/doc/man1/rigctl.1 b/doc/man1/rigctl.1 index 73bc1320..33e75464 100644 --- a/doc/man1/rigctl.1 +++ b/doc/man1/rigctl.1 @@ -187,8 +187,30 @@ above. Note the dummy device has no serial parameters. . .TP .BR \-C ", " \-\-set\-conf = \fIparm=val\fP [ \fI,parm=val\fP ] -Set radio configuration parameter(s), e.g. -.IR stop_bits=2 . +Set configuration parameter(s). Some common ones are: +.in +4n +.EX +.RB write_delay: "Delay in ms between each byte sent out" +.RB post_write_delay: "Delay in ms between each command sent out" +.RB timeout: "Timeout in ms" +.RB retry: "Max number of retry" +.RB ptt_type: "Push-To-Talk interface type override" +.RB ptt_pathname: "Path name to the device file of the Push-To-Talk" +.RB ptt_bitnum: "Push-To-Talk GPIO bit number" +.RB dcd_type: "Data Carrier Detect (or squelch) interface type override" +.RB dcd_pathname: "Path name to the device file of the Data Carrier Detect (or squelch)" +.RB lo_freq: "Frequency to add to the VFO frequency for use with a transverter" +.RB auto_power_on: "True enables compatible rigs to be powered up on open" +.RB auto_power_off: "True enables compatible rigs to be powered down on close" +.RB auto_disable_screensaver: "True enables compatible rigs to have their screen saver disabled on open" +.RB disable_yaesu_bandselect: "True disables the automatic band select on band change for Yaesu rigs" +.RB ptt_share: "True enables ptt port to be shared with other apps" +.RB twiddle_timeout: "For satellite ops when VFOB is twiddled will pause VFOB commands until timeout" +.RB twiddle_rit: "Suppress get_freq on VFOB for RIT tuning satellites" +.RB async: "True enables asynchronous data transfer for backends that support it. This allows use of transceive and spectrum data." +.RB tuner_control_pathname: "Path name to a script/program to control a tuner with 1 argument of 0/1 for Tuner Off/On" +.EE +.in .IP Use the .B -L diff --git a/doc/man1/rigctld.1 b/doc/man1/rigctld.1 index 391920a7..0e82f40d 100644 --- a/doc/man1/rigctld.1 +++ b/doc/man1/rigctld.1 @@ -293,8 +293,30 @@ above. . .TP .BR \-C ", " \-\-set\-conf = \fIparm=val\fP [ \fI,parm=val\fP ] -Set radio configuration parameter(s), e.g. -.IR stop_bits=2 . +Set configuration parameter(s). Some common ones are: +.in +4 +.EX +.RB write_delay: "Delay in ms between each byte sent out" +.RB post_write_delay: "Delay in ms between each command sent out" +.RB timeout: "Timeout in ms" +.RB retry: "Max number of retry" +.RB ptt_type: "Push-To-Talk interface type override" +.RB ptt_pathname: "Path name to the device file of the Push-To-Talk" +.RB ptt_bitnum: "Push-To-Talk GPIO bit number" +.RB dcd_type: "Data Carrier Detect (or squelch) interface type override" +.RB dcd_pathname: "Path name to the device file of the Data Carrier Detect (or squelch)" +.RB lo_freq: "Frequency to add to the VFO frequency for use with a transverter" +.RB auto_power_on: "True enables compatible rigs to be powered up on open" +.RB auto_power_off: "True enables compatible rigs to be powered down on close" +.RB auto_disable_screensaver: "True enables compatible rigs to have their screen saver disabled on open" +.RB disable_yaesu_bandselect: "True disables the automatic band select on band change for Yaesu rigs" +.RB ptt_share: "True enables ptt port to be shared with other apps" +.RB twiddle_timeout: "For satellite ops when VFOB is twiddled will pause VFOB commands until timeout" +.RB twiddle_rit: "Suppress get_freq on VFOB for RIT tuning satellites" +.RB async: "True enables asynchronous data transfer for backends that support it. This allows use of transceive and spectrum data." +.RB tuner_control_pathname: "Path name to a script/program to control a tuner with 1 argument of 0/1 for Tuner Off/On" +.EE +.in .IP Use the .B -L diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h index 6c768168..d93e7986 100644 --- a/include/hamlib/rig.h +++ b/include/hamlib/rig.h @@ -2588,6 +2588,7 @@ struct rig_state { int depth; /*<! a depth counter to use for debug indentation and such */ int lock_mode; /*<! flag that prevents mode changes if ~= 0 -- see set/get_lock_mode */ powerstat_t powerstat; /*<! power status */ + char *tuner_control_pathname; /*<! Path to external tuner control program that get 0/1 (Off/On) argument */ }; //! @cond Doxygen_Suppress diff --git a/src/conf.c b/src/conf.c index e2149692..92f067a3 100644 --- a/src/conf.c +++ b/src/conf.c @@ -170,6 +170,11 @@ static const struct confparams frontend_cfg_params[] = "True enables asynchronous data transfer for backends that support it. This allows use of transceive and spectrum data.", "0", RIG_CONF_CHECKBUTTON, { } }, + { + TOK_TUNER_CONTROL_PATHNAME, "tuner_control_pathname", "Tuner script/program path name", + "Path name to a script/program to control a tuner with 1 argument of 0/1 for Tuner Off/On", + "hamlib_tuner_control", RIG_CONF_STRING, + }, { RIG_CONF_END, NULL, } }; @@ -715,6 +720,11 @@ static int frontend_set_conf(RIG *rig, token_t token, const char *val) rs->async_data_enabled = val_i ? 1 : 0; break; + case TOK_TUNER_CONTROL_PATHNAME: + rs->tuner_control_pathname = strdup(val); // yeah -- need to free it + break; + + default: return -RIG_EINVAL; } diff --git a/src/rig.c b/src/rig.c index 52a7a393..87876dcb 100644 --- a/src/rig.c +++ b/src/rig.c @@ -143,6 +143,8 @@ const char hamlib_copyright[231] = /* hamlib 1.2 ABI specifies 231 bytes */ # define DEFAULT_CM108_PORT "/dev/hidraw0" #endif +#define DEFAULT_TUNER_CONTROL_PATHNAME "hamlib_tuner_control" + #if defined(WIN32) && !defined(__CYGWIN__) /* FIXME: Determine correct GPIO bit number for W32 using MinGW. */ # define DEFAULT_CM108_PTT_BITNUM 2 @@ -564,6 +566,8 @@ RIG *HAMLIB_API rig_init(rig_model_t rig_model) rs->rigport.asyncio = 0; #endif + rs->tuner_control_pathname = DEFAULT_TUNER_CONTROL_PATHNAME; + switch (caps->port_type) { case RIG_PORT_SERIAL: diff --git a/src/settings.c b/src/settings.c index 73d1fc98..33c24b76 100644 --- a/src/settings.c +++ b/src/settings.c @@ -39,6 +39,7 @@ #include <stdio.h> #include <stdlib.h> #include <errno.h> /* Error number definitions */ +#include <unistd.h> #include <hamlib/rig.h> #include "cal.h" @@ -488,11 +489,34 @@ int HAMLIB_API rig_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) caps = rig->caps; - if (caps->set_func == NULL || !rig_has_set_func(rig, func)) + if ((caps->set_func == NULL || !rig_has_set_func(rig, func)) + && access(rig->state.tuner_control_pathname, X_OK) == -1) { return -RIG_ENAVAIL; } + if (access(rig->state.tuner_control_pathname, X_OK) != -1) + { + char cmd[1024]; + snprintf(cmd, sizeof(cmd), "%s %d", rig->state.tuner_control_pathname, status); + rig_debug(RIG_DEBUG_TRACE, "%s: Calling external script '%s'\n", __func__, + rig->state.tuner_control_pathname); + retcode = system(cmd); + + if (retcode != 0) { rig_debug(RIG_DEBUG_ERR, "%s: executing %s failed\n", __func__, rig->state.tuner_control_pathname); } + + return (retcode == 0 ? RIG_OK : -RIG_ERJCTED); + } + else + { + if (strcmp(rig->state.tuner_control_pathname, "hamlib_tuner_control")) + { + rig_debug(RIG_DEBUG_ERR, "%s: unable to find '%s'\n", __func__, + rig->state.tuner_control_pathname); + return -RIG_EINVAL; + } + } + if ((caps->targetable_vfo & RIG_TARGETABLE_FUNC) || vfo == RIG_VFO_CURR || vfo == rig->state.current_vfo) diff --git a/src/token.h b/src/token.h index 46b80f19..186f9b1e 100644 --- a/src/token.h +++ b/src/token.h @@ -93,6 +93,8 @@ #define TOK_FLUSHX TOKEN_FRONTEND(36) /** \brief Asynchronous data transfer support */ #define TOK_ASYNC TOKEN_FRONTEND(37) +/** \brief Tuner external control pathname */ +#define TOK_TUNER_CONTROL_PATHNAME TOKEN_FRONTEND(38) /* * rig specific tokens diff --git a/tests/hamlib_tuner_control b/tests/hamlib_tuner_control new file mode 100755 index 00000000..4f5b923e --- /dev/null +++ b/tests/hamlib_tuner_control @@ -0,0 +1,8 @@ +#!/bin/sh +if [ "$#" -eq 0 ] +then +echo "Expected arg 0 or 1...got nothing" +exit 1 +fi +echo Tuner Control $1 +echo `date` " " Tuner Control $1 >>tuner_control.log commit ea29263f3512dda2f93ba3429189a20a6782a305 Author: Mike Black W9MDB <mdb...@ya...> Date: Sun Dec 18 09:01:27 2022 -0600 Fix unidirectional rig cached frequency (e.g. FT736R) https://github.com/Hamlib/Hamlib/issues/1187 diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h index e0d31a52..6c768168 100644 --- a/include/hamlib/rig.h +++ b/include/hamlib/rig.h @@ -3395,6 +3395,7 @@ extern HAMLIB_EXPORT(int) rig_set_vfo_opt(RIG *rig, int status); extern HAMLIB_EXPORT(int) rig_get_vfo_info(RIG *rig, vfo_t vfo, freq_t *freq, rmode_t *mode, pbwidth_t *width, split_t *split, int *satmode); extern HAMLIB_EXPORT(int) rig_get_rig_info(RIG *rig, char *response, int max_response_len); extern HAMLIB_EXPORT(int) rig_get_cache(RIG *rig, vfo_t vfo, freq_t *freq, int * cache_ms_freq, rmode_t *mode, int *cache_ms_mode, pbwidth_t *width, int *cache_ms_width); +extern HAMLIB_EXPORT(int) rig_get_cache_freq(RIG *rig, vfo_t vfo, freq_t *freq, int * cache_ms_freq); extern HAMLIB_EXPORT(int) rig_set_clock(RIG *rig, int year, int month, int day, int hour, int min, int sec, double msec, int utc_offset); extern HAMLIB_EXPORT(int) rig_get_clock(RIG *rig, int *year, int *month, int *day, int *hour, int *min, int *sec, double *msec, int *utc_offset); diff --git a/rigs/yaesu/ft736.c b/rigs/yaesu/ft736.c index 52cd85fc..8858512f 100644 --- a/rigs/yaesu/ft736.c +++ b/rigs/yaesu/ft736.c @@ -31,6 +31,7 @@ #include "misc.h" #include "yaesu.h" #include "tones.h" +#include "cache.h" @@ -99,7 +100,7 @@ const struct rig_caps ft736_caps = RIG_MODEL(RIG_MODEL_FT736R), .model_name = "FT-736R", .mfg_name = "Yaesu", - .version = "20221214.0", + .version = "20221218.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -270,6 +271,7 @@ int ft736_set_freq(RIG *rig, vfo_t vfo, freq_t freq) { unsigned char cmd[YAESU_CMD_LENGTH] = { 0x00, 0x00, 0x00, 0x00, 0x01}; struct ft736_priv_data *priv = (struct ft736_priv_data *)rig->state.priv; + int retval; // we will assume requesting to set VFOB is split mode if (vfo == RIG_VFO_B) { return rig_set_split_freq(rig, vfo, freq); } @@ -288,8 +290,11 @@ int ft736_set_freq(RIG *rig, vfo_t vfo, freq_t freq) cmd[0] = (cmd[0] & 0x0f) | 0xc0; } - /* Frequency set */ - return write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH); + retval = write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH); + + if (retval == RIG_OK) { rig_set_cache_freq(rig, vfo, freq); } + + return retval; } int ft736_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) @@ -297,7 +302,7 @@ int ft736_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) rig_debug(RIG_DEBUG_VERBOSE, "%s: called\n", __func__); if (vfo == RIG_VFO_A || vfo == RIG_VFO_MAIN) { *freq = rig->state.cache.freqMainA; } - else { *freq = rig->state.cache.freqMainB; } + else { rig_get_cache_freq(rig, vfo, freq, NULL); } return RIG_OK; } diff --git a/src/cache.c b/src/cache.c index 7bdafbfa..b912bdee 100644 --- a/src/cache.c +++ b/src/cache.c @@ -442,6 +442,41 @@ int rig_get_cache(RIG *rig, vfo_t vfo, freq_t *freq, int *cache_ms_freq, return RIG_OK; } +/** + * \brief get cached values for a VFO + * \param rig The rig handle + * \param vfo The VFO to get information from + * \param freq The frequency is stored here + * \param cache_ms_freq The age of the last frequency update in ms -- NULL if you don't want it + + * Use this to query the frequency cache and then determine to actually fetch data from + * the rig. + * + * \return RIG_OK if the operation has been successful, otherwise + * a negative value if an error occurred (in which case, cause is + * set appropriately). + * + */ +int rig_get_cache_freq(RIG *rig, vfo_t vfo, freq_t *freq, int *cache_ms_freq_p) +{ + rmode_t mode; + int cache_ms_freq; + int cache_ms_mode; + pbwidth_t width; + int cache_ms_width; + int retval; + retval = rig_get_cache(rig, vfo, freq, &cache_ms_freq, &mode, &cache_ms_mode, + &width, &cache_ms_width); + + if (retval == RIG_OK) + { + if (cache_ms_freq_p) { *cache_ms_freq_p = cache_ms_freq; } + } + + return retval; +} + + void rig_cache_show(RIG *rig, const char *func, int line) { rig_debug(RIG_DEBUG_CACHE, diff --git a/src/rig.c b/src/rig.c index 175bfd9c..52a7a393 100644 --- a/src/rig.c +++ b/src/rig.c @@ -1806,7 +1806,11 @@ int HAMLIB_API rig_set_freq(RIG *rig, vfo_t vfo, freq_t freq) if (retcode != RIG_OK) { RETURNFUNC(retcode); } - rig_set_cache_freq(rig, vfo, (freq_t)0); + // Unidirectional rigs do not reset cache + if (rig->caps->rig_model != RIG_MODEL_FT736R) + { + rig_set_cache_freq(rig, vfo, (freq_t)0); + } #if 0 // this verification seems to be causing bad behavior on some rigs commit b1828d951a2159e87b6208f6eb3aabdacc03b6aa Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Dec 17 17:23:52 2022 -0600 Ensure get_powerstat return RIG_OK when rig does not have get_powerstat https://github.com/Hamlib/Hamlib/issues/1189 diff --git a/src/rig.c b/src/rig.c index e5075d15..175bfd9c 100644 --- a/src/rig.c +++ b/src/rig.c @@ -6032,7 +6032,7 @@ int HAMLIB_API rig_get_powerstat(RIG *rig, powerstat_t *status) if (rig->caps->get_powerstat == NULL) { *status = RIG_POWER_ON; // default to power if not available - RETURNFUNC(-RIG_ENAVAIL); + RETURNFUNC(RIG_OK); } *status = RIG_POWER_OFF; // default now to power off until proven otherwise in get_powerstat commit 9970a2767d2f49c427c51c6a0780a41010269b89 Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Dec 17 10:35:56 2022 -0600 Reset rig->state.cache.split so it can be set again when rigctld reopens the rig https://github.com/Hamlib/Hamlib/issues/1187 diff --git a/src/rig.c b/src/rig.c index 71f32138..e5075d15 100644 --- a/src/rig.c +++ b/src/rig.c @@ -1518,6 +1518,8 @@ int HAMLIB_API rig_close(RIG *rig) remove_opened_rig(rig); + // zero split so it will allow it to be set again on open for rigctld + rig->state.cache.split = 0; rs->comm_state = 0; rig_debug(RIG_DEBUG_VERBOSE, "%s(%d): %p rs->comm_state==0?=%d\n", __func__, __LINE__, &rs->comm_state, commit 04f5195cfd68df95bdaaa185b577555390f1276c Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Dec 17 10:19:46 2022 -0600 Do not reset cache for unidirectional rigs https://github.com/Hamlib/Hamlib/issues/1187 diff --git a/src/rig.c b/src/rig.c index f5c792fd..71f32138 100644 --- a/src/rig.c +++ b/src/rig.c @@ -1895,7 +1895,12 @@ int HAMLIB_API rig_set_freq(RIG *rig, vfo_t vfo, freq_t freq) #endif ) { - rig_set_cache_freq(rig, RIG_VFO_ALL, (freq_t)0); + // Unidirectional rigs do not reset cache + if (rig->caps->rig_model != RIG_MODEL_FT736R) + { + rig_set_cache_freq(rig, RIG_VFO_ALL, (freq_t)0); + } + HAMLIB_TRACE; retcode = rig_get_freq(rig, vfo, &freq_new); commit 9508c45f00558bce22409c472b0de3d5d95f40c8 Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Dec 17 10:00:07 2022 -0600 Update NEWS diff --git a/NEWS b/NEWS index 3fadca9e..730d3779 100644 --- a/NEWS +++ b/NEWS @@ -19,6 +19,7 @@ Version 4.6 * Fix FTDX3000 rig split Version 4.5.2 + * 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 commit 120c580de0b67a9da1deac2b53e4238fd3774d57 Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Dec 17 09:59:04 2022 -0600 FT-736 did not have get_mode so only call get_mode when available https://github.com/Hamlib/Hamlib/issues/1187 diff --git a/src/rig.c b/src/rig.c index 477c5c74..f5c792fd 100644 --- a/src/rig.c +++ b/src/rig.c @@ -1344,14 +1344,18 @@ int HAMLIB_API rig_open(RIG *rig) rig_debug(RIG_DEBUG_VERBOSE, "%s(%d): Current split=%d, tx_vfo=%s\n", __func__, __LINE__, split, rig_strvfo(tx_vfo)); rmode_t mode; - pbwidth_t width; - rig_get_mode(rig, RIG_VFO_A, &mode, &width); + pbwidth_t width = 2400; // we'll use 2400Hz as default width - if (split) + if (rig->caps->get_mode) { - rig_debug(RIG_DEBUG_VERBOSE, "xxxsplit=%d\n", split); - HAMLIB_TRACE; - rig_get_mode(rig, RIG_VFO_B, &mode, &width); + rig_get_mode(rig, RIG_VFO_A, &mode, &width); + + if (split) + { + rig_debug(RIG_DEBUG_VERBOSE, "xxxsplit=%d\n", split); + HAMLIB_TRACE; + rig_get_mode(rig, RIG_VFO_B, &mode, &width); + } } } } @@ -2891,7 +2895,8 @@ int HAMLIB_API rig_get_vfo(RIG *rig, vfo_t *vfo) if (cache_ms < rig->state.cache.timeout_ms) { *vfo = rig->state.cache.vfo; - rig_debug(RIG_DEBUG_TRACE, "%s: cache hit age=%dms, vfo=%s\n", __func__, cache_ms, rig_strvfo(*vfo)); + rig_debug(RIG_DEBUG_TRACE, "%s: cache hit age=%dms, vfo=%s\n", __func__, + cache_ms, rig_strvfo(*vfo)); ELAPSED2; RETURNFUNC(RIG_OK); } @@ -4424,7 +4429,7 @@ int HAMLIB_API rig_set_split_mode(RIG *rig, if (tx_vfo == RIG_VFO_B || tx_vfo == RIG_VFO_SUB) { rx_vfo = RIG_VFO_A; } - if (vfo == RIG_VFO_CURR && tx_vfo == RIG_VFO_B) { rx_vfo = RIG_VFO_A; } + if (vfo == RIG_VFO_CURR && tx_vfo == RIG_VFO_B) { rx_vfo = RIG_VFO_A; } else if (vfo == RIG_VFO_CURR && tx_vfo == RIG_VFO_A) { rx_vfo = RIG_VFO_B; } else if (vfo == RIG_VFO_CURR && tx_vfo == RIG_VFO_MAIN) { rx_vfo = RIG_VFO_SUB; } else if (vfo == RIG_VFO_CURR && tx_vfo == RIG_VFO_SUB) { rx_vfo = RIG_VFO_MAIN; } commit 250a5b0211fd2e8000dcf02e943915940a2ff911 Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Dec 15 17:14:00 2022 -0600 Update NEWS diff --git a/NEWS b/NEWS index d2d0bb3c..3fadca9e 100644 --- a/NEWS +++ b/NEWS @@ -19,6 +19,7 @@ Version 4.6 * Fix FTDX3000 rig split Version 4.5.2 + * 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 commit f554c3a7ffb495cb0ad007d0b1cc86c183c78696 Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Dec 15 17:11:08 2022 -0600 Fix kenwood_ts890_get_level -- thanks to N3GB George Baltz diff --git a/rigs/kenwood/ts890s.c b/rigs/kenwood/ts890s.c index 9c23b131..dc2781b9 100644 --- a/rigs/kenwood/ts890s.c +++ b/rigs/kenwood/ts890s.c @@ -305,7 +305,7 @@ int kenwood_ts890_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) if (rig->caps->swr_cal.size) { - val->f = rig_raw2val_float(val->i, &rig->caps->swr_cal); + val->f = rig_raw2val_float(levelint, &rig->caps->swr_cal); } else { @@ -432,7 +432,7 @@ const struct rig_caps ts890s_caps = RIG_MODEL(RIG_MODEL_TS890S), .model_name = "TS-890S", .mfg_name = "Kenwood", - .version = BACKEND_VER ".9", + .version = BACKEND_VER ".10", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, commit 32b1ce161e5f2726be1f195b531eca14c196514a Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Dec 15 12:04:14 2022 -0600 Update NEWS diff --git a/NEWS b/NEWS index c665f25e..d2d0bb3c 100644 --- a/NEWS +++ b/NEWS @@ -19,6 +19,7 @@ Version 4.6 * Fix FTDX3000 rig split Version 4.5.2 + * 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 commit 830bf5a94171847ff82ce9f22edcfd3a2a2fecf8 Merge: 2a84386a 9eecfc3b Author: Michael Black <mdb...@ya...> Date: Thu Dec 15 11:42:53 2022 -0600 Merge pull request #1191 from PianetaRadio/master Rotator Prosistel elevation with azimuth logic commit 9eecfc3b2df1804f6ddccafea160fe6f9d80efc6 Author: PianetaRadio <789...@us...> Date: Thu Dec 15 18:24:55 2022 +0100 Update rotlist.h Add Elevation rotator with Control box responding to azimuth logic diff --git a/include/hamlib/rotlist.h b/include/hamlib/rotlist.h index 2ede3f89..2565d56a 100644 --- a/include/hamlib/rotlist.h +++ b/include/hamlib/rotlist.h @@ -557,6 +557,7 @@ #define ROT_MODEL_PROSISTEL_D_AZ ROT_MAKE_MODEL(ROT_PROSISTEL, 1) #define ROT_MODEL_PROSISTEL_D_EL ROT_MAKE_MODEL(ROT_PROSISTEL, 2) #define ROT_MODEL_PROSISTEL_COMBI_TRACK_AZEL ROT_MAKE_MODEL(ROT_PROSISTEL, 3) +#define ROT_MODEL_PROSISTEL_D_EL_CBOXAZ ROT_MAKE_MODEL(ROT_PROSISTEL, 4) /** commit 40066a6cfa0cc7d49d9e2a25edf5dcac46421e84 Author: PianetaRadio <789...@us...> Date: Thu Dec 15 18:21:23 2022 +0100 Update prosistel.c Add Elevation rotator with Control box responding to azimuth logic diff --git a/rotators/prosistel/prosistel.c b/rotators/prosistel/prosistel.c index 1ab58602..76a2a37f 100644 --- a/rotators/prosistel/prosistel.c +++ b/rotators/prosistel/prosistel.c @@ -379,6 +379,15 @@ static const struct prosistel_rot_priv_caps prosistel_rot_combitrack_priv_caps = }; +// Elevation rotator with Control box D using azimuth logic +static const struct prosistel_rot_priv_caps prosistel_rot_el_cboxaz = +{ + .angle_multiplier = 1.0f, + .stop_angle = 997, + .elevation_id = 'A', +}; + + /* * Prosistel rotator capabilities */ @@ -487,7 +496,7 @@ const struct rot_caps prosistel_combi_track_azel_rot_caps = }; -//Elevation rotator with ControlBox using azimuth logic +// Elevation rotator with Control box D using azimuth logic const struct rot_caps prosistel_d_el_cboxaz_rot_caps = { ROT_MODEL(ROT_MODEL_PROSISTEL_D_EL_CBOXAZ), commit b1ac588667e74af74e7eb32be3badfc4ad1e77d8 Author: PianetaRadio <789...@us...> Date: Thu Dec 15 18:12:32 2022 +0100 Update prosistel.h Add Elevation rotator with Control box responding to azimuth logic diff --git a/rotators/prosistel/prosistel.h b/rotators/prosistel/prosistel.h index ee7b3594..2b1b90c8 100644 --- a/rotators/prosistel/prosistel.h +++ b/rotators/prosistel/prosistel.h @@ -25,5 +25,6 @@ extern const struct rot_caps prosistel_d_az_rot_caps; extern const struct rot_caps prosistel_d_el_rot_caps; extern const struct rot_caps prosistel_combi_track_azel_rot_caps; +extern const struct rot_caps prosistel_d_el_cboxaz_rot_caps; #endif /* _ROT_PROSISTEL_H */ commit 7fc23e59a337e853e292e8e89d39d6a2179498ea Author: PianetaRadio <789...@us...> Date: Thu Dec 15 18:09:51 2022 +0100 Update prosistel.c Add Elevation rotator with Control box responding to azimuth logic diff --git a/rotators/prosistel/prosistel.c b/rotators/prosistel/prosistel.c index 511cde4a..1ab58602 100644 --- a/rotators/prosistel/prosistel.c +++ b/rotators/prosistel/prosistel.c @@ -486,6 +486,43 @@ const struct rot_caps prosistel_combi_track_azel_rot_caps = .get_position = prosistel_rot_get_position, }; + +//Elevation rotator with ControlBox using azimuth logic +const struct rot_caps prosistel_d_el_cboxaz_rot_caps = +{ + ROT_MODEL(ROT_MODEL_PROSISTEL_D_EL_CBOXAZ), + .model_name = "D elevation CBOX az", + .mfg_name = "Prosistel", + .version = "20221215.0", + .copyright = "LGPL", + .status = RIG_STATUS_STABLE, + .rot_type = ROT_TYPE_ELEVATION, + .port_type = RIG_PORT_SERIAL, + .serial_rate_min = 9600, + .serial_rate_max = 9600, + .serial_data_bits = 8, + .serial_stop_bits = 1, + .serial_parity = RIG_PARITY_NONE, + .serial_handshake = RIG_HANDSHAKE_NONE, + .write_delay = 0, + .post_write_delay = 0, + .timeout = 3000, + .retry = 3, + + .min_az = 0.0, + .max_az = 0.0, + .min_el = 0.0, + .max_el = 90.0, + + .priv = &prosistel_rot_el_cboxaz, + + .rot_open = prosistel_rot_open, + .stop = prosistel_rot_stop, + .set_position = prosistel_rot_set_position, + .get_position = prosistel_rot_get_position, +}; + + DECLARE_INITROT_BACKEND(prosistel) { rig_debug(RIG_DEBUG_VERBOSE, "%s: _init called\n", __func__); @@ -493,6 +530,7 @@ DECLARE_INITROT_BACKEND(prosistel) rot_register(&prosistel_d_az_rot_caps); rot_register(&prosistel_d_el_rot_caps); rot_register(&prosistel_combi_track_azel_rot_caps); + rot_register(&prosistel_d_el_cboxaz_rot_caps); return RIG_OK; } commit 2a84386ae89989158d9bc628654188219138f9d5 Author: Mike Black W9MDB <mdb...@ya...> Date: Wed Dec 14 22:59:46 2022 -0600 Add simft736.c and update others diff --git a/simulators/simft747gx.c b/simulators/simft736.c similarity index 70% copy from simulators/simft747gx.c copy to simulators/simft736.c index a0ce5cb8..da4e5c39 100644 --- a/simulators/simft747gx.c +++ b/simulators/simft736.c @@ -28,7 +28,7 @@ getmyline(int fd, unsigned char *buf) int n = 0; memset(buf, 0, BUFSIZE); - while (read(fd, &c, 1) > 0 && i < 5) + while (i < 5 && read(fd, &c, 1) > 0) { buf[i++] = c; n++; @@ -102,78 +102,63 @@ again: if (bytes != 5) { printf("Not 5 bytes? bytes=%d\n", bytes); + continue; } switch (buf[4]) { - case 0x01: - printf("SPLIT\n"); - break; - - case 0x02: - printf("MEMORY\n"); + case 0x00: + printf("CAT On\n"); break; - case 0x03: - printf("VFO_TO_M\n"); + case 0x80: + printf("CAT Off\n"); break; - case 0x04: - printf("DLOCK\n"); + case 0x01: + printf("FREQ_SET\n"); break; - case 0x05: - printf("A_BVFO\n"); + case 0x07: + printf("MODE_SET\n"); break; - case 0x06: - printf("M_TO_VFO\n"); + case 0x0e: + printf("Full Duplex On\n"); break; - case 0x07: - printf("UP500K\n"); + case 0x8e: + printf("Full Duplex Off\n"); break; case 0x08: - printf("DN500K\n"); + printf("Tx\n"); break; - case 0x09: - printf("CLAR\n"); + case 0x88: + printf("Rx\n"); break; - case 0x0a: - printf("FREQ_SET\n"); - break; - - case 0x0c: - ... [truncated message content] |