Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package hamlib for openSUSE:Factory checked in at 2023-01-14 00:02:38 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/hamlib (Old) and /work/SRC/openSUSE:Factory/.hamlib.new.32243 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "hamlib" Sat Jan 14 00:02:38 2023 rev:16 rq:1058086 version:4.5.4 Changes: -------- --- /work/SRC/openSUSE:Factory/hamlib/hamlib.changes 2023-01-02 15:01:57.193278402 +0100 +++ /work/SRC/openSUSE:Factory/.hamlib.new.32243/hamlib.changes 2023-01-14 00:03:03.729656527 +0100 @@ -1,0 +2,20 @@ +Thu Jan 12 23:04:06 UTC 2023 - Wojciech Kazubski <w...@ire.pw.edu.pl> + +- Update to version 4.5.4 (2023-01-10) + * Fix CM108 ptt setting for non-default usage + * Fix power on/off for Icom rigs with rigctld power_on=0 + * Fix get_powerstat status return for non-PS kenwood rigs + * Fix FT-710, FTDX10, FTDX101D/MP usage on 60M + * Fix timing on NRD-535D + * Fix AGC levels with rigctld + * Fix FTDX3000 EX039 error + * Fix Elecraft power2mW operation + * Fix rig_power2mW so it checks all ranges + * Allow rigctld to start with autopower_on=0 to avoid startup + timeouts when rig is powered off + * Fix dummy device to work with grig by disallowing empty "u" call + * Fix ID5100 and promote to stable and hopefully ID4100 too + * Remove get_powerstat from Icom ID-5100,ID-4100,ID-31,ID-51 and + fix get/set freq in all + +------------------------------------------------------------------- Old: ---- Hamlib-4.5.3.tar.gz New: ---- Hamlib-4.5.4.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ hamlib.spec ++++++ --- /var/tmp/diff_new_pack.bLblH0/_old 2023-01-14 00:03:04.341660092 +0100 +++ /var/tmp/diff_new_pack.bLblH0/_new 2023-01-14 00:03:04.345660115 +0100 @@ -18,7 +18,7 @@ %define sover 4 Name: hamlib -Version: 4.5.3 +Version: 4.5.4 Release: 0 Summary: Run-time library to control radio transcievers and receivers License: LGPL-2.1-only ++++++ Hamlib-4.5.3.tar.gz -> Hamlib-4.5.4.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Hamlib-4.5.3/NEWS new/Hamlib-4.5.4/NEWS --- old/Hamlib-4.5.3/NEWS 2022-12-31 21:46:26.000000000 +0100 +++ new/Hamlib-4.5.4/NEWS 2023-01-10 02:31:41.000000000 +0100 @@ -14,6 +14,8 @@ Version 4.6 * 2023-11-XX -- Planned for Nov 2023 + * Add Apex Shared Loop rotator -- unidirectional only so far + * 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" @@ -22,6 +24,22 @@ * Add FLIR PTU-D48, E46, D100, D300 rotors * Fix FTDX3000 rig split +Version 4.5.4 + * 2023-01-10 + * Fix CM108 ptt setting for non-default usage + * Fix power on/off for Icom rigs with rigctld power_on=0 + * Fix get_powerstat status return for non-PS kenwood rigs + * Fix FT-710, FTDX10, FTDX101D/MP usage on 60M + * Fix timing on NRD-535D + * Fix AGC levels with rigctld + * Fix FTDX3000 EX039 error + * Fix Elecraft power2mW operation + * Fix rig_power2mW so it checks all ranges + * Allow rigctld to start with autopower_on=0 to avoid startup timeouts when rig is powered off + * Fix dummy device to work with grig by disallowing empty "u" call + * Fix ID5100 and promote to stable and hopefully ID4100 too + * Remove get_powerstat from Icom ID-5100,ID-4100,ID-31,ID-51 and fix get/set freq in all + Version 4.5.3 * 2022-12-31 * Fix serial.c for hardware flow control on Linux and MacOSy diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Hamlib-4.5.3/configure.ac new/Hamlib-4.5.4/configure.ac --- old/Hamlib-4.5.3/configure.ac 2022-12-31 21:46:26.000000000 +0100 +++ new/Hamlib-4.5.4/configure.ac 2023-01-10 02:31:41.000000000 +0100 @@ -14,7 +14,7 @@ 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.5.3],[hamlib-develo...@lists.sourceforge.net],[hamlib],[http://www.hamlib.org]) +AC_INIT([Hamlib],[4.5.4],[hamlib-develo...@lists.sourceforge.net],[hamlib],[http://www.hamlib.org]) AC_CONFIG_SRCDIR([include/hamlib/rig.h]) AC_CONFIG_MACRO_DIR([macros]) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Hamlib-4.5.3/doc/man1/rigctl.1 new/Hamlib-4.5.4/doc/man1/rigctl.1 --- old/Hamlib-4.5.3/doc/man1/rigctl.1 2022-12-31 21:46:26.000000000 +0100 +++ new/Hamlib-4.5.4/doc/man1/rigctl.1 2023-01-10 02:31:41.000000000 +0100 @@ -351,12 +351,12 @@ .B Hamlib operations have a .BR set " and a " get -method, an upper case letter will often be used for a +method, a single upper case letter will often be used for a .B set -method whereas the corresponding lower case letter refers to the +method whereas the corresponding single lower case letter refers to the .B get method. Each operation also has a long name; in interactive mode, prepend a -backslash, \(oq\\\(cq, to enter a long command name. +backslash, \(oq\\\(cq, to enter a long command name all lower case. . .PP Example: Use \(lq\\dump_caps\(rq to see what capabilities this radio and diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Hamlib-4.5.3/doc/man1/rigctld.1 new/Hamlib-4.5.4/doc/man1/rigctld.1 --- old/Hamlib-4.5.3/doc/man1/rigctld.1 2022-12-31 21:46:26.000000000 +0100 +++ new/Hamlib-4.5.4/doc/man1/rigctld.1 2023-01-10 02:31:41.000000000 +0100 @@ -414,12 +414,12 @@ .B Hamlib operations have a .BR set " and a " get -method, an upper case letter will be used for +method, a single pper case letter will be used for .B set -methods whereas the corresponding lower case letter refers to the +methods whereas the corresponding single lower case letter refers to the .B get method. Each operation also has a long name; prepend a backslash, \(oq\\\(cq, -to send a long command name. +to send a long command name all in lower case. . .PP Example (Perl): \(lqprint $socket "\\\\dump_caps\\n";\(rq to see what the diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Hamlib-4.5.3/include/hamlib/rig.h new/Hamlib-4.5.4/include/hamlib/rig.h --- old/Hamlib-4.5.3/include/hamlib/rig.h 2022-12-31 21:46:26.000000000 +0100 +++ new/Hamlib-4.5.4/include/hamlib/rig.h 2023-01-10 02:31:41.000000000 +0100 @@ -333,7 +333,7 @@ */ /* TODO: kill me, and replace by real AGC delay */ enum agc_level_e { - RIG_AGC_OFF = 0, + RIG_AGC_OFF = 0, RIG_AGC_SUPERFAST, RIG_AGC_FAST, RIG_AGC_SLOW, @@ -341,7 +341,8 @@ RIG_AGC_MEDIUM, RIG_AGC_AUTO, RIG_AGC_LONG, - RIG_AGC_ON /*< Turns AGC ON -- Kenwood -- restores last level set */ + RIG_AGC_ON, /*< Turns AGC ON -- Kenwood -- restores last level set */ + RIG_AGC_NONE /*< Rig does not have CAT AGC control */ }; @@ -3427,6 +3428,8 @@ extern HAMLIB_EXPORT(int) rig_set_lock_mode(RIG *rig, int lock); extern HAMLIB_EXPORT(int) rig_get_lock_mode(RIG *rig, int *lock); +extern HAMLIB_EXPORT(int) rig_is_model(RIG *rig, rig_model_t model); + //! @endcond diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Hamlib-4.5.3/rigs/dummy/netrigctl.c new/Hamlib-4.5.4/rigs/dummy/netrigctl.c --- old/Hamlib-4.5.3/rigs/dummy/netrigctl.c 2022-12-31 21:46:26.000000000 +0100 +++ new/Hamlib-4.5.4/rigs/dummy/netrigctl.c 2023-01-10 02:31:41.000000000 +0100 @@ -812,9 +812,10 @@ } else if (strcmp(setting, "agc_levels") == 0) { - int i = 1; + int i = 0; char *p = strtok(value, " "); - rig->caps->agc_levels[0] = RIG_AGC_OFF; + rig->caps->agc_levels[0] = RIG_AGC_NONE; // default value gets overwritten + rig->caps->agc_level_count = 1; while (p) { @@ -825,6 +826,7 @@ if (n == 2) { rig->caps->agc_levels[i++] = agc_code; + rig->caps->agc_level_count++; rig_debug(RIG_DEBUG_VERBOSE, "%s: rig has agc code=%d, level=%s\n", __func__, agc_code, agc_string); } @@ -836,8 +838,6 @@ rig_debug(RIG_DEBUG_VERBOSE, "%d=%s\n", agc_code, agc_string); p = strtok(NULL, " "); } - - rig->caps->agc_level_count = i; } else { @@ -1925,6 +1925,8 @@ if (ret != RIG_OK) { return ret; } + if (strlen(rig_strfunc(func)) == 0) { return -RIG_ENAVAIL; } + SNPRINTF(cmd, sizeof(cmd), "u%s %s\n", vfostr, rig_strfunc(func)); ret = netrigctl_transaction(rig, cmd, strlen(cmd), buf); @@ -2734,7 +2736,7 @@ RIG_MODEL(RIG_MODEL_NETRIGCTL), .model_name = "NET rigctl", .mfg_name = "Hamlib", - .version = "20221214.0", + .version = "20230106.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_OTHER, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Hamlib-4.5.3/rigs/icom/icom.c new/Hamlib-4.5.4/rigs/icom/icom.c --- old/Hamlib-4.5.3/rigs/icom/icom.c 2022-12-31 21:46:26.000000000 +0100 +++ new/Hamlib-4.5.4/rigs/icom/icom.c 2023-01-10 02:31:41.000000000 +0100 @@ -1325,6 +1325,7 @@ } freq_len = priv->civ_731_mode ? 4 : 5; + /* * to_bcd requires nibble len */ @@ -1363,8 +1364,21 @@ { cmd = C_SET_FREQ; subcmd = -1; - retval = icom_transaction(rig, cmd, subcmd, freqbuf, freq_len, ackbuf, - &ack_len); + + if (ICOM_IS_ID5100 || ICOM_IS_ID4100 || ICOM_IS_ID31 || ICOM_IS_ID51) + { + // for these rigs 0x00 is setting the freq and 0x03 is just for reading + cmd = 0x00; + // temporary fix for ID5100 not giving ACK/NAK on 0x00 freq on E8 firmware + retval = icom_transaction(rig, cmd, subcmd, freqbuf, freq_len, NULL, + NULL); + return RIG_OK; + } + else + { + retval = icom_transaction(rig, cmd, subcmd, freqbuf, freq_len, ackbuf, + &ack_len); + } } hl_usleep(50 * 1000); // pause for transceive message and we'll flush it @@ -1688,7 +1702,13 @@ RETURNFUNC(RIG_OK); } - if (freq_len != 4 && freq_len != 5) + if (freq_len == 3 && (ICOM_IS_ID5100 || ICOM_IS_ID4100 || ICOM_IS_ID31 + || ICOM_IS_ID51)) + { + rig_debug(RIG_DEBUG_ERR, + "%s: 3-byte ID5100/4100 length - turn off XONXOFF flow control\n", __func__); + } + else if (freq_len != 4 && freq_len != 5) { rig_debug(RIG_DEBUG_ERR, "%s: wrong frame len=%d\n", __func__, freq_len); @@ -1698,7 +1718,7 @@ RETURNFUNC(-RIG_ERJCTED); } - if (freq_len != (priv->civ_731_mode ? 4 : 5)) + if (freq_len != 3 && freq_len != (priv->civ_731_mode ? 4 : 5)) { rig_debug(RIG_DEBUG_WARN, "%s: freq len (%d) differs from expected\n", __func__, freq_len); @@ -1709,6 +1729,8 @@ */ *freq = from_bcd(freqbuf + freqbuf_offset, freq_len * 2); + if (freq_len == 3) { *freq *= 10000; } // 3-byte freq for ID5100 is in 10000Hz units so convert to Hz + if (vfo == RIG_VFO_MEM && civ_731_mode) { priv->civ_731_mode = 1; } switch (vfo) @@ -7955,6 +7977,11 @@ memset(fe_buf, 0xfe, fe_max); // sending more than enough 0xfe's to wake up the rs232 write_block(&rs->rigport, fe_buf, fe_max); + // close and re-open the rig + // on linux the USB gets reset during power on + rig_close(rig); + sleep(1); // let serial bus idle for a while + rig_open(rig); // we'll try 0x18 0x01 now -- should work on STBY rigs too pwr_sc = S_PWR_ON; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Hamlib-4.5.3/rigs/icom/icom.h new/Hamlib-4.5.4/rigs/icom/icom.h --- old/Hamlib-4.5.3/rigs/icom/icom.h 2022-12-31 21:46:26.000000000 +0100 +++ new/Hamlib-4.5.4/rigs/icom/icom.h 2023-01-10 02:31:41.000000000 +0100 @@ -31,7 +31,12 @@ #include <sys/time.h> #endif -#define BACKEND_VER "20221120" +#define BACKEND_VER "20230109" + +#define ICOM_IS_ID31 rig_is_model(rig, RIG_MODEL_ID31) +#define ICOM_IS_ID51 rig_is_model(rig, RIG_MODEL_ID51) +#define ICOM_IS_ID4100 rig_is_model(rig, RIG_MODEL_ID4100) +#define ICOM_IS_ID5100 rig_is_model(rig, RIG_MODEL_ID5100) #define ICOM_IS_SECONDARY_VFO(vfo) ((vfo) & (RIG_VFO_B | RIG_VFO_SUB | RIG_VFO_SUB_B | RIG_VFO_MAIN_B)) #define ICOM_GET_VFO_NUMBER(vfo) (ICOM_IS_SECONDARY_VFO(vfo) ? 0x01 : 0x00) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Hamlib-4.5.3/rigs/icom/id31.c new/Hamlib-4.5.4/rigs/icom/id31.c --- old/Hamlib-4.5.3/rigs/icom/id31.c 2022-12-31 21:46:26.000000000 +0100 +++ new/Hamlib-4.5.4/rigs/icom/id31.c 2023-01-10 02:31:41.000000000 +0100 @@ -82,7 +82,7 @@ RIG_MODEL(RIG_MODEL_ID31), .model_name = "ID-31", .mfg_name = "Icom", - .version = BACKEND_VER ".0", + .version = BACKEND_VER ".1", .copyright = "LGPL", .status = RIG_STATUS_ALPHA, .rig_type = RIG_TYPE_HANDHELD, @@ -179,7 +179,7 @@ .get_mode = icom_get_mode, .set_powerstat = icom_set_powerstat, - .get_powerstat = icom_get_powerstat, +// .get_powerstat = icom_get_powerstat, // not capable .decode_event = icom_decode_event, .set_func = icom_set_func, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Hamlib-4.5.3/rigs/icom/id4100.c new/Hamlib-4.5.4/rigs/icom/id4100.c --- old/Hamlib-4.5.3/rigs/icom/id4100.c 2022-12-31 21:46:26.000000000 +0100 +++ new/Hamlib-4.5.4/rigs/icom/id4100.c 2023-01-10 02:31:41.000000000 +0100 @@ -86,9 +86,9 @@ RIG_MODEL(RIG_MODEL_ID4100), .model_name = "ID-4100", .mfg_name = "Icom", - .version = BACKEND_VER ".0", + .version = BACKEND_VER ".1", .copyright = "LGPL", - .status = RIG_STATUS_ALPHA, + .status = RIG_STATUS_BETA, .rig_type = RIG_TYPE_MOBILE, .ptt_type = RIG_PTT_RIG, .dcd_type = RIG_DCD_RIG, @@ -187,7 +187,7 @@ .get_mode = icom_get_mode, .set_vfo = icom_set_vfo, - .set_powerstat = icom_set_powerstat, + //.set_powerstat = icom_set_powerstat, // ID-4100 does cannot query power .get_powerstat = icom_get_powerstat, .decode_event = icom_decode_event, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Hamlib-4.5.3/rigs/icom/id51.c new/Hamlib-4.5.4/rigs/icom/id51.c --- old/Hamlib-4.5.3/rigs/icom/id51.c 2022-12-31 21:46:26.000000000 +0100 +++ new/Hamlib-4.5.4/rigs/icom/id51.c 2023-01-10 02:31:41.000000000 +0100 @@ -90,7 +90,7 @@ RIG_MODEL(RIG_MODEL_ID51), .model_name = "ID-51", .mfg_name = "Icom", - .version = BACKEND_VER ".0", + .version = BACKEND_VER ".1", .copyright = "LGPL", .status = RIG_STATUS_ALPHA, .rig_type = RIG_TYPE_HANDHELD, @@ -186,7 +186,7 @@ .rig_open = icom_rig_open, .rig_close = icom_rig_close, .set_powerstat = icom_set_powerstat, - .get_powerstat = icom_get_powerstat, +// .get_powerstat = icom_get_powerstat, // not capable .set_freq = icom_set_freq, .get_freq = icom_get_freq, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Hamlib-4.5.3/rigs/icom/id5100.c new/Hamlib-4.5.4/rigs/icom/id5100.c --- old/Hamlib-4.5.3/rigs/icom/id5100.c 2022-12-31 21:46:26.000000000 +0100 +++ new/Hamlib-4.5.4/rigs/icom/id5100.c 2023-01-10 02:31:41.000000000 +0100 @@ -26,6 +26,8 @@ #include "hamlib/rig.h" #include "idx_builtin.h" #include "icom.h" +#include "icom_defs.h" +#include "frame.h" /* * Specs and protocol details comes from the chapter 13 of ID-5100_Full-Inst_Manual.pdf @@ -39,7 +41,7 @@ * - Single/dual watch (RIG_LEVEL_BALANCE) */ -#define ID5100_MODES (RIG_MODE_FM|RIG_MODE_DSTAR) +#define ID5100_MODES (RIG_MODE_AM|RIG_MODE_AMN|RIG_MODE_FM|RIG_MODE_FMN|RIG_MODE_DSTAR) #define ID5100_ALL_RX_MODES (RIG_MODE_AM|ID5100_MODES) #define ID5100_VFO_ALL (RIG_VFO_MAIN|RIG_VFO_SUB) @@ -70,7 +72,70 @@ */ #define ID5100_STR_CAL UNKNOWN_IC_STR_CAL +int id5100_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) +{ + int retval; + unsigned char modebuf; + unsigned char ackbuf[MAXFRAMELEN]; + int icmode = 2; + int ack_len = sizeof(ackbuf); + + switch (mode) + { + case RIG_MODE_AM: icmode = 2; modebuf = 1; break; + + case RIG_MODE_AMN: icmode = 2; modebuf = 2; break; + + case RIG_MODE_FM: icmode = 5; modebuf = 1; break; + + case RIG_MODE_FMN: icmode = 5; modebuf = 2; break; + + case RIG_MODE_DSTAR: icmode = 0x17; modebuf = 1; break; + + default: + rig_debug(RIG_DEBUG_ERR, "%s: Unknown mode=%s\n", __func__, rig_strrmode(mode)); + return -RIG_EINVAL; + } + + rig_debug(RIG_DEBUG_VERBOSE, "%s: mode=%d, modebuf=%c\n", __func__, icmode, + modebuf); + + retval = icom_transaction(rig, C_SET_MODE, icmode, &modebuf, 1, ackbuf, + &ack_len); + + return retval; +} + +int id5100_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) +{ + int retval; + int mode_len; + unsigned char modebuf[4]; + + retval = icom_transaction(rig, C_RD_MODE, -1, NULL, 0, modebuf, &mode_len); + + if (retval != RIG_OK) + { + return retval; + } + + switch (modebuf[1]) + { + case 2: + *mode = modebuf[2] == 1 ? RIG_MODE_AM : RIG_MODE_AMN; + *width = modebuf[2] == 1 ? 12000 : 6000; break; + + case 5: + *mode = modebuf[2] == 1 ? RIG_MODE_FM : RIG_MODE_FMN; + *width = modebuf[2] == 1 ? 10000 : 5000; break; + + case 0x17: + *mode = RIG_MODE_DSTAR; + *width = 6000; break; + } + return RIG_OK; +} /* */ @@ -86,9 +151,9 @@ RIG_MODEL(RIG_MODEL_ID5100), .model_name = "ID-5100", .mfg_name = "Icom", - .version = BACKEND_VER ".1", + .version = BACKEND_VER ".2", .copyright = "LGPL", - .status = RIG_STATUS_BETA, + .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_MOBILE, .ptt_type = RIG_PTT_RIG, .dcd_type = RIG_DCD_RIG, @@ -98,11 +163,11 @@ .serial_data_bits = 8, .serial_stop_bits = 1, .serial_parity = RIG_PARITY_NONE, - .serial_handshake = RIG_HANDSHAKE_XONXOFF, + .serial_handshake = RIG_HANDSHAKE_NONE, .write_delay = 0, .post_write_delay = 0, .timeout = 1000, - .retry = 3, + .retry = 0, .has_get_func = ID5100_FUNC_ALL, .has_set_func = ID5100_FUNC_ALL, .has_get_level = ID5100_LEVEL_ALL, @@ -184,12 +249,12 @@ .set_freq = icom_set_freq, .get_freq = icom_get_freq, - .set_mode = icom_set_mode, - .get_mode = icom_get_mode, + .set_mode = id5100_set_mode, + .get_mode = id5100_get_mode, .set_vfo = icom_set_vfo, .set_powerstat = icom_set_powerstat, - .get_powerstat = icom_get_powerstat, + //.get_powerstat = icom_get_powerstat, // ID-5100 cannot get power status .decode_event = icom_decode_event, .set_func = icom_set_func, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Hamlib-4.5.3/rigs/jrc/nrd535.c new/Hamlib-4.5.4/rigs/jrc/nrd535.c --- old/Hamlib-4.5.3/rigs/jrc/nrd535.c 2022-12-31 21:46:26.000000000 +0100 +++ new/Hamlib-4.5.4/rigs/jrc/nrd535.c 2023-01-10 02:31:41.000000000 +0100 @@ -96,7 +96,7 @@ RIG_MODEL(RIG_MODEL_NRD535), .model_name = "NRD-535D", .mfg_name = "JRC", - .version = BACKEND_VER ".0", + .version = BACKEND_VER ".1", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_RECEIVER, @@ -110,8 +110,8 @@ .serial_parity = RIG_PARITY_NONE, .serial_handshake = RIG_HANDSHAKE_NONE, .write_delay = 0, - .post_write_delay = 20, - .timeout = 200, + .post_write_delay = 21, + .timeout = 250, .retry = 3, .has_get_func = NRD535_FUNC, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Hamlib-4.5.3/rigs/kenwood/elecraft.c new/Hamlib-4.5.4/rigs/kenwood/elecraft.c --- old/Hamlib-4.5.3/rigs/kenwood/elecraft.c 2022-12-31 21:46:26.000000000 +0100 +++ new/Hamlib-4.5.4/rigs/kenwood/elecraft.c 2023-01-10 02:31:41.000000000 +0100 @@ -165,6 +165,18 @@ } } + if (rig->caps->rig_model != RIG_MODEL_XG3) // XG3 doesn't have extended + { + // turn on k2 extended to get PC values in more resolution + err = kenwood_transaction(rig, "K22;", NULL, 0); + + if (err != RIG_OK) + { + rig_debug(RIG_DEBUG_ERR, "%s: error setting K22='%s'...continuing\n", __func__, + rigerror(err)); + } + } + switch (rig->caps->rig_model) { case RIG_MODEL_K2: @@ -310,8 +322,8 @@ kenwood_get_trn(rig, &priv->trn_state); /* ignore errors */ /* Currently we cannot cope with AI mode so turn it off in case last client left it on */ - kenwood_set_trn(rig, RIG_TRN_OFF); /* ignore status in case - it's not supported */ + kenwood_set_trn(rig, + RIG_TRN_OFF); /* ignore status in case it's not supported */ } // For rigs like K3X vfo emulation need to set VFO_A to start diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Hamlib-4.5.3/rigs/kenwood/k3.c new/Hamlib-4.5.4/rigs/kenwood/k3.c --- old/Hamlib-4.5.3/rigs/kenwood/k3.c 2022-12-31 21:46:26.000000000 +0100 +++ new/Hamlib-4.5.4/rigs/kenwood/k3.c 2023-01-10 02:31:41.000000000 +0100 @@ -160,6 +160,8 @@ int kx3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val); int k3_set_func(RIG *rig, vfo_t vfo, setting_t func, int status); int k3_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status); +int k3_power2mW(RIG *rig, unsigned int *mwpower, float power, freq_t freq, + rmode_t mode); /* Private helper functions */ int set_rit_xit(RIG *rig, shortfreq_t rit); @@ -188,7 +190,7 @@ RIG_MODEL(RIG_MODEL_K3), .model_name = "K3", .mfg_name = "Elecraft", - .version = BACKEND_VER ".24", + .version = BACKEND_VER ".25", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -331,6 +333,7 @@ .get_ant = kenwood_get_ant, .send_morse = kenwood_send_morse, .wait_morse = rig_wait_morse, + .power2mW = k3_power2mW, .hamlib_check_rig_caps = HAMLIB_CHECK_RIG_CAPS }; @@ -340,7 +343,7 @@ RIG_MODEL(RIG_MODEL_K3S), .model_name = "K3S", .mfg_name = "Elecraft", - .version = BACKEND_VER ".18", + .version = BACKEND_VER ".19", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -482,6 +485,7 @@ .get_ant = kenwood_get_ant, .send_morse = kenwood_send_morse, .wait_morse = rig_wait_morse, + .power2mW = k3_power2mW, .hamlib_check_rig_caps = HAMLIB_CHECK_RIG_CAPS }; @@ -491,7 +495,7 @@ RIG_MODEL(RIG_MODEL_K4), .model_name = "K4", .mfg_name = "Elecraft", - .version = BACKEND_VER ".24", + .version = BACKEND_VER ".25", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -633,6 +637,7 @@ .get_ant = kenwood_get_ant, .send_morse = kenwood_send_morse, .wait_morse = rig_wait_morse, + .power2mW = k3_power2mW, .hamlib_check_rig_caps = HAMLIB_CHECK_RIG_CAPS }; @@ -641,7 +646,7 @@ RIG_MODEL(RIG_MODEL_KX3), .model_name = "KX3", .mfg_name = "Elecraft", - .version = BACKEND_VER ".17", + .version = BACKEND_VER ".18", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -783,6 +788,7 @@ .get_ant = kenwood_get_ant, .send_morse = kenwood_send_morse, .wait_morse = rig_wait_morse, + .power2mW = k3_power2mW, .hamlib_check_rig_caps = HAMLIB_CHECK_RIG_CAPS }; @@ -791,7 +797,7 @@ RIG_MODEL(RIG_MODEL_KX2), .model_name = "KX2", .mfg_name = "Elecraft", - .version = BACKEND_VER ".16", + .version = BACKEND_VER ".17", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -840,8 +846,8 @@ RIG_FRNG_END, }, /* rx range */ .tx_range_list1 = { - FRQ_RNG_HF(1, K3_MODES, mW(10), W(10), K3_VFO, K3_ANTS), - FRQ_RNG_6m(1, K3_MODES, mW(10), W(10), K3_VFO, K3_ANTS), + FRQ_RNG_HF(1, K3_MODES, mW(10), W(12), K3_VFO, K3_ANTS), + FRQ_RNG_6m(1, K3_MODES, mW(10), W(12), K3_VFO, K3_ANTS), RIG_FRNG_END, }, /* tx range */ @@ -851,8 +857,8 @@ RIG_FRNG_END, }, /* rx range */ .tx_range_list2 = { - FRQ_RNG_HF(2, K3_MODES, mW(10), W(10), K3_VFO, K3_ANTS), - FRQ_RNG_6m(2, K3_MODES, mW(10), W(10), K3_VFO, K3_ANTS), + FRQ_RNG_HF(2, K3_MODES, mW(10), W(12), K3_VFO, K3_ANTS), + FRQ_RNG_6m(2, K3_MODES, mW(10), W(12), K3_VFO, K3_ANTS), RIG_FRNG_END, }, /* tx range */ .tuning_steps = { @@ -933,6 +939,7 @@ .get_ant = kenwood_get_ant, .send_morse = kenwood_send_morse, .wait_morse = rig_wait_morse, + .power2mW = k3_power2mW, .hamlib_check_rig_caps = HAMLIB_CHECK_RIG_CAPS }; @@ -1768,17 +1775,20 @@ static int k3_get_maxpower(RIG *rig) { - int retval; - int maxpower = 12; // K3 default power level - char levelbuf[KENWOOD_MAX_BUF_LEN]; + //int retval; + int maxpower = 15; // K3 default power level + //char levelbuf[KENWOOD_MAX_BUF_LEN]; struct kenwood_priv_data *priv = rig->state.priv; - // default range is 0-12 if there is no KPA3 installed + // default range is 0-15 if there is no KPA3 installed if (priv->has_kpa3 || priv->has_kpa100) { maxpower = 110; } +// Elecraft makes max power pretty variable +// So we will stick with 15W or 110W and scale everything to that +#if 0 else if (RIG_IS_KX2 || RIG_IS_KX3) { @@ -1817,10 +1827,22 @@ } } +#endif + rig_debug(RIG_DEBUG_TRACE, "%s: maxpower=%d\n", __func__, maxpower); return maxpower; } +int k3_power2mW(RIG *rig, + unsigned int *mwpower, + float power, + freq_t freq, + rmode_t mode) +{ + *mwpower = power * k3_get_maxpower(rig) * 1000; + return RIG_OK; +} + int k3_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) { char levelbuf[16]; @@ -1924,8 +1946,9 @@ break; case RIG_LEVEL_RFPOWER: - SNPRINTF(levelbuf, sizeof(levelbuf), "PC%03d", - (int)(val.f * k3_get_maxpower(rig))); + kenwood_val = (int)(val.f * k3_get_maxpower(rig)); + SNPRINTF(levelbuf, sizeof(levelbuf), "PC%03d%s", kenwood_val, + kenwood_val > 15 ? "1" : "0"); break; default: @@ -2220,20 +2243,22 @@ if (len == 5 || len == 6) { - sscanf(levelbuf + 2, "%d", &lvl); - - if (len == 6) - { - // K2 extended reply - lvl /= 10; - } + sscanf(levelbuf + 2, "%3d", &lvl); } else { return RIG_EPROTO; } - val->f = (float) lvl / k3_get_maxpower(rig); + // extended K22 format PCnnnx where 0=.1W units and 1=1W units + if (len == 6 && levelbuf[5] == '0') + { + val->f = (float) lvl / 10.0 / k3_get_maxpower(rig); + } + else + { + val->f = (float) lvl / k3_get_maxpower(rig); + } break; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Hamlib-4.5.3/rigs/kenwood/kenwood.c new/Hamlib-4.5.4/rigs/kenwood/kenwood.c --- old/Hamlib-4.5.3/rigs/kenwood/kenwood.c 2022-12-31 21:46:26.000000000 +0100 +++ new/Hamlib-4.5.4/rigs/kenwood/kenwood.c 2023-01-10 02:31:41.000000000 +0100 @@ -4878,6 +4878,7 @@ if (!priv->has_ps) { + *status = RIG_POWER_ON; RETURNFUNC(RIG_OK); // fake the OK return for these rigs } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Hamlib-4.5.3/rigs/kenwood/kenwood.h new/Hamlib-4.5.4/rigs/kenwood/kenwood.h --- old/Hamlib-4.5.3/rigs/kenwood/kenwood.h 2022-12-31 21:46:26.000000000 +0100 +++ new/Hamlib-4.5.4/rigs/kenwood/kenwood.h 2023-01-10 02:31:41.000000000 +0100 @@ -29,7 +29,7 @@ #include "misc.h" #include "idx_builtin.h" -#define BACKEND_VER "20221230" +#define BACKEND_VER "20230109" #define EOM_KEN ';' #define EOM_TH '\r' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Hamlib-4.5.3/rigs/yaesu/ft1000mp.c new/Hamlib-4.5.4/rigs/yaesu/ft1000mp.c --- old/Hamlib-4.5.3/rigs/yaesu/ft1000mp.c 2022-12-31 21:46:26.000000000 +0100 +++ new/Hamlib-4.5.4/rigs/yaesu/ft1000mp.c 2023-01-10 02:31:41.000000000 +0100 @@ -317,7 +317,7 @@ RIG_MODEL(RIG_MODEL_FT1000MP), .model_name = "FT-1000MP", .mfg_name = "Yaesu", - .version = "20220421.0", + .version = "20230104.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -460,7 +460,7 @@ RIG_MODEL(RIG_MODEL_FT1000MPMKV), .model_name = "MARK-V FT-1000MP", .mfg_name = "Yaesu", - .version = "20220421.0", + .version = "20230104.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -603,7 +603,7 @@ RIG_MODEL(RIG_MODEL_FT1000MPMKVFLD), .model_name = "MARK-V Field FT-1000MP", .mfg_name = "Yaesu", - .version = "20220421.0", + .version = "20230104.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -1046,6 +1046,7 @@ break; + case RIG_MODE_PKTUSB: case RIG_MODE_RTTYR: cmd_index = FT1000MP_NATIVE_MODE_SET_RTTY_USB; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Hamlib-4.5.3/rigs/yaesu/newcat.c new/Hamlib-4.5.4/rigs/yaesu/newcat.c --- old/Hamlib-4.5.3/rigs/yaesu/newcat.c 2022-12-31 21:46:26.000000000 +0100 +++ new/Hamlib-4.5.4/rigs/yaesu/newcat.c 2023-01-10 02:31:41.000000000 +0100 @@ -546,6 +546,7 @@ struct rig_state *rig_s = &rig->state; const char *handshake[3] = {"None", "Xon/Xoff", "Hardware"}; int err; + int set_only = 0; ENTERFUNC; @@ -611,15 +612,24 @@ else if (priv->rig_id == NC_RIGID_FT991A || rig->caps->rig_model == RIG_MODEL_FT991) { cmd = "EX0321;EX032;"; } else if (priv->rig_id == NC_RIGID_FTDX3000 - || rig->caps->rig_model == RIG_MODEL_FTDX3000) { cmd = "EX0391;EX039;"; } + || rig->caps->rig_model == RIG_MODEL_FTDX3000) { cmd = "EX0391;"; set_only = 1; } else if (priv->rig_id == NC_RIGID_FTDX3000DM - || rig->caps->rig_model == RIG_MODEL_FTDX3000) { cmd = "EX0391;EX039;"; } + || rig->caps->rig_model == RIG_MODEL_FTDX3000) { cmd = "EX0391;"; set_only = 1; } else if (priv->rig_id == NC_RIGID_FTDX5000 || rig->caps->rig_model == RIG_MODEL_FTDX5000) { cmd = "EX0331;EX033"; } SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "%s", cmd); - if (RIG_OK != (err = newcat_get_cmd(rig))) + if (set_only) + { + err = newcat_set_cmd(rig); + } + else + { + err = newcat_get_cmd(rig); + } + + if (err != RIG_OK) { RETURNFUNC(err); } @@ -636,9 +646,17 @@ // Remember EX103 status SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "EX103;"); rig_debug(RIG_DEBUG_TRACE, "%s: cmd_str = %s\n", __func__, priv->cmd_str); - err = newcat_get_cmd(rig); - if (RIG_OK != (err = newcat_get_cmd(rig))) + if (set_only) + { + err = newcat_set_cmd(rig); + } + else + { + err = newcat_get_cmd(rig); + } + + if (err != RIG_OK) { RETURNFUNC(err); } @@ -781,8 +799,89 @@ RETURNFUNC(ret); } +static int freq_60m[] = { 5332000, 5348000, 5358500, 5373000, 5405000 }; + +/* returns 0 if no exeption or 1 if rig needs special handling */ +int newcat_60m_exception(RIG *rig, freq_t freq, mode_t mode) +{ + struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; + int err; + int channel = -1; + int i; + rmode_t tmode; + pbwidth_t twidth; + + if (!(freq > 5.2 && freq < 5.5)) // we're not on 60M + { + return 0; + } + + if (mode != RIG_MODE_CW && mode != RIG_MODE_USB && mode != RIG_MODE_PKTUSB + && mode != RIG_MODE_RTTYR) + { + rig_debug(RIG_DEBUG_ERR, + "%s: only USB, PKTUSB, RTTYR, and CW allowed for 60M operations\n", __func__); + return -RIG_EINVAL; + } + + if (!is_ftdx10 && !is_ft710 && !is_ftdx101d && !is_ftdx101mp) { return 0; } + + rig_debug(RIG_DEBUG_VERBOSE, "%s: 60M exception ignoring freq/mode commands\n", + __func__); + // If US mode we need to use memory channels + SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "EX0301%c", cat_term); + + if ((err = newcat_get_cmd(rig)) != RIG_OK) + { + RETURNFUNC2(err); + } + + // 01 is the only exception so far -- others may be like UK and have full control too + if (strncmp(&priv->ret_data[6], "01", 2) != 0) { return 0; } // no exception + // so now we should have a rig that has fixed memory channels 501-510 in USB/CW-U mode + // toggle vfo mode if we need to + + rig_debug(RIG_DEBUG_VERBOSE, "%s: 60M exception ignoring freq/mode commands\n", + __func__); + + rig_get_mode(rig, RIG_VFO_A, &tmode, &twidth); + if (tmode != RIG_VFO_MEM) + { + err = newcat_vfomem_toggle(rig); + if (err != RIG_OK) + { + rig_debug(RIG_DEBUG_ERR, "%s: Error toggling VFO_MEM\n", __func__); + return -err; + } + } + // find the nearest slot below what is requested + for (i = 0; i < 5; ++i) + { + if ((long)freq == freq_60m[i]) { channel = i; } + } + + if (channel < 0) + { + rig_debug(RIG_DEBUG_ERR, + "%s: 60M allowed frequencies are 5.332, 5.348, 5.3585, 5.373,5.405, got %g\n", + __func__, freq / 1000); + return -RIG_EINVAL; + } + + if (mode == RIG_MODE_CW) { channel += 5; } + + SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "MC%3d%c", channel + 501, + cat_term); + + if ((err = newcat_set_cmd(rig)) != RIG_OK) + { + RETURNFUNC2(err); + } + + return 1; +} /* * newcat_set_freq @@ -792,20 +891,6 @@ * Does not SET priv->current_vfo * */ - -int newcat_60m_exception(RIG *rig, freq_t freq) -{ - // can we improve this to set memory mode and pick the memory slot? - if (is_ftdx10 && freq > 5.2 && freq < 5.5) - { - rig_debug(RIG_DEBUG_VERBOSE, "%s: 60M exception ignoring freq/mode commands\n", - __func__); - return 1; - } - - return 0; -} - int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) { char c; @@ -814,10 +899,12 @@ const struct rig_caps *caps; struct newcat_priv_data *priv; int special_60m = 0; + rmode_t tmode; + pbwidth_t twidth; ENTERFUNC; - if (newcat_60m_exception(rig, freq)) + if (newcat_60m_exception(rig, freq, rig->state.cache.modeMainA)) { // we don't try to set freq on 60m for some rigs since we must be in memory mode // and we can't run split mode on 60M memory mode either @@ -842,6 +929,13 @@ priv = (struct newcat_priv_data *)rig->state.priv; caps = rig->caps; + rig_get_mode(rig, RIG_VFO_A, &tmode, &twidth); + if (tmode == RIG_VFO_MEM) + { + // then we need to toggle back to VFO mode + newcat_vfomem_toggle(rig); + } + rig_debug(RIG_DEBUG_TRACE, "%s: passed vfo = %s\n", __func__, rig_strvfo(vfo)); // rig_debug(RIG_DEBUG_TRACE, "%s: translated vfo = %s\n", __func__, rig_strvfo(tvfo)); rig_debug(RIG_DEBUG_TRACE, "%s: passed freq = %"PRIfreq" Hz\n", __func__, freq); @@ -1346,7 +1440,7 @@ ENTERFUNC; - if (newcat_60m_exception(rig, rig->state.cache.freqMainA)) { RETURNFUNC(RIG_OK); } // we don't set mode in this case + if (newcat_60m_exception(rig, rig->state.cache.freqMainA, mode)) { RETURNFUNC(RIG_OK); } // we don't set mode in this case if (!newcat_valid_command(rig, "MD")) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Hamlib-4.5.3/rigs/yaesu/newcat.h new/Hamlib-4.5.4/rigs/yaesu/newcat.h --- old/Hamlib-4.5.3/rigs/yaesu/newcat.h 2022-12-31 21:46:26.000000000 +0100 +++ new/Hamlib-4.5.4/rigs/yaesu/newcat.h 2023-01-10 02:31:41.000000000 +0100 @@ -50,7 +50,7 @@ typedef char ncboolean; /* shared function version */ -#define NEWCAT_VER "20221228" +#define NEWCAT_VER "20230109" /* Hopefully large enough for future use, 128 chars plus '\0' */ #define NEWCAT_DATA_LEN 129 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Hamlib-4.5.3/simulators/Makefile.am new/Hamlib-4.5.4/simulators/Makefile.am --- old/Hamlib-4.5.3/simulators/Makefile.am 2022-12-31 21:46:26.000000000 +0100 +++ new/Hamlib-4.5.4/simulators/Makefile.am 2023-01-10 02:31:41.000000000 +0100 @@ -8,12 +8,13 @@ bin_PROGRAMS = -check_PROGRAMS = simelecraft simicom simkenwood simyaesu simicom9700 +check_PROGRAMS = simelecraft simicom simkenwood simyaesu simicom9700 simft991 simftdx1200 simftdx3000 simjupiter simpowersdr simelecraft_SOURCES = simelecraft.c simicom_SOURCES = simicom.c simkenwood_SOURCES = simkenwood.c simyaesu_SOURCES = simyaesu.c +simid5100_SOURCES = simid5100.c # include generated include files ahead of any in sources #rigctl_CPPFLAGS = -I$(top_builddir)/tests -I$(top_builddir)/src -I$(srcdir) $(AM_CPPFLAGS) @@ -25,17 +26,20 @@ simicom_CFLAGS = $(AM_CFLAGS) $(PTHREAD_CFLAGS) -I$(top_builddir)/src simkenwood_CFLAGS = $(AM_CFLAGS) $(PTHREAD_CFLAGS) -I$(top_builddir)/src simyaesu_CFLAGS = $(AM_CFLAGS) $(PTHREAD_CFLAGS) -I$(top_builddir)/src +simid5100_CFLAGS = $(AM_CFLAGS) $(PTHREAD_CFLAGS) -I$(top_builddir)/src simelecraft_LDADD = $(PTHREAD_LIBS) $(READLINE_LIBS) $(LDADD) simicom_LDADD = $(NET_LIBS) $(PTHREAD_LIBS) $(LDADD) $(READLINE_LIBS) simkenwood_LDADD = $(PTHREAD_LIBS) $(LDADD) $(READLINE_LIBS) simyaesu_LDADD = $(NET_LIBS) $(PTHREAD_LIBS) $(LDADD) $(READLINE_LIBS) +simid5100_LDADD = $(NET_LIBS) $(PTHREAD_LIBS) $(LDADD) $(READLINE_LIBS) # Linker options simelecraft_LDFLAGS = $(WINEXELDFLAGS) simicom_LDFLAGS = $(WINEXELDFLAGS) simkenwood_LDFLAGS = $(WINEXELDFLAGS) simyaesu_LDFLAGS = $(WINEXELDFLAGS) +simid5100_LDFLAGS = $(WINEXELDFLAGS) EXTRA_DIST = diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Hamlib-4.5.3/simulators/simelecraft.c new/Hamlib-4.5.4/simulators/simelecraft.c --- old/Hamlib-4.5.3/simulators/simelecraft.c 2022-12-31 21:46:26.000000000 +0100 +++ new/Hamlib-4.5.4/simulators/simelecraft.c 2023-01-10 02:31:41.000000000 +0100 @@ -132,7 +132,8 @@ { printf("%s\n", buf); usleep(50 * 1000); - pbuf = "IF059014200000+000000700000;"; + //pbuf = "IF059014200000+000000700000;"; + pbuf = "IF00007230000 -000000 0001000001 ;" ; n = write(fd, pbuf, strlen(pbuf)); printf("n=%d\n", n); @@ -262,6 +263,11 @@ SNPRINTF(buf, sizeof(buf), "TQ0;"); write(fd, buf, strlen(buf)); } + else if (strncmp(buf, "PC;", 3) == 0) + { + SNPRINTF(buf, sizeof(buf), "PC0150;"); + n = write(fd, buf, strlen(buf)); + } else if (strlen(buf) > 0) { fprintf(stderr, "Unknown command: %s\n", buf); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Hamlib-4.5.3/simulators/simft991.c new/Hamlib-4.5.4/simulators/simft991.c --- old/Hamlib-4.5.3/simulators/simft991.c 2022-12-31 21:46:26.000000000 +0100 +++ new/Hamlib-4.5.4/simulators/simft991.c 2023-01-10 02:31:41.000000000 +0100 @@ -12,6 +12,10 @@ float freqA = 14074000; float freqB = 14074500; +char tx_vfo = '0'; +char rx_vfo = '0'; +char modeA = '0'; +char modeB = '0'; // ID 0310 == 310, Must drop leading zero typedef enum nc_rigid_e @@ -104,7 +108,7 @@ { printf("Cmd:%s\n", buf); } - else { return 0; } + else { continue; } if (strcmp(buf, "RM5;") == 0) { @@ -137,6 +141,24 @@ if (n <= 0) { perror("IF"); } } + else if (strcmp(buf, "FA;") == 0) + { + SNPRINTF(buf, sizeof(buf), "FA%08.0f;", freqA); + n = write(fd, buf, strlen(buf)); + } + else if (strncmp(buf, "FA", 2) == 0) + { + sscanf(buf, "FA%f", &freqA); + } + else if (strcmp(buf, "FB;") == 0) + { + SNPRINTF(buf, sizeof(buf), "FB%08.0f;", freqB); + n = write(fd, buf, strlen(buf)); + } + else if (strncmp(buf, "FB", 2) == 0) + { + sscanf(buf, "FB%f", &freqB); + } else if (strcmp(buf, "ID;") == 0) { printf("%s\n", buf); @@ -148,6 +170,11 @@ if (n <= 0) { perror("ID"); } } + else if (strcmp(buf, "PS;") == 0) + { + SNPRINTF(buf, sizeof(buf), "PS1;"); + n = write(fd, buf, strlen(buf)); + } else if (strcmp(buf, "AI;") == 0) { printf("%s\n", buf); @@ -158,6 +185,54 @@ if (n <= 0) { perror("ID"); } } + else if (strcmp(buf, "AI0;") == 0) + { + usleep(50 * 1000); + } + else if (strcmp(buf, "FT;") == 0) + { + usleep(50 * 1000); + SNPRINTF(buf, sizeof(buf), "FT%c;", tx_vfo); + printf(" FT response#1=%s, tx_vfo=%c\n", buf, tx_vfo); + n = write(fd, buf, strlen(buf)); + printf(" FT response#2=%s\n", buf); + + if (n < 0) { perror("FT"); } + } + else if (strncmp(buf, "FT", 2) == 0) + { + tx_vfo = buf[2]; + + if (tx_vfo == '3') { tx_vfo = '1'; } + else if (tx_vfo == '2') { tx_vfo = '0'; } + else { perror("Expected 2 or 3"); } + } + else if (strcmp(buf, "MD0;") == 0) + { + usleep(50 * 1000); + SNPRINTF(buf, sizeof(buf), "MD0%c;", modeA); + n = write(fd, buf, strlen(buf)); + + if (n < 0) { perror("MD0;"); } + } + else if (strncmp(buf, "MD0", 3) == 0) + { + modeA = buf[3]; + } + else if (strcmp(buf, "MD1;") == 0) + { + usleep(50 * 1000); + SNPRINTF(buf, sizeof(buf), "MD1%c;", modeB); + n = write(fd, buf, strlen(buf)); + + if (n < 0) { perror("MD0;"); } + } + else if (strncmp(buf, "MD1", 3) == 0) + { + modeB = buf[3]; + } + + #if 0 else if (strncmp(buf, "AI", 2) == 0) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Hamlib-4.5.3/simulators/simjupiter.c new/Hamlib-4.5.4/simulators/simjupiter.c --- old/Hamlib-4.5.3/simulators/simjupiter.c 1970-01-01 01:00:00.000000000 +0100 +++ new/Hamlib-4.5.4/simulators/simjupiter.c 2023-01-10 02:31:41.000000000 +0100 @@ -0,0 +1,117 @@ +// can run this using rigctl/rigctld and socat pty devices +// gcc -o simft897 simft897.c +#define _XOPEN_SOURCE 600 +#include <stdio.h> +#include <stdlib.h> +#include <fcntl.h> +#include <string.h> +#include <unistd.h> +#include "../include/hamlib/rig.h" + +#define BUFSIZE 256 + +float freqA = 14074000; +float freqB = 14074500; +char tx_vfo = '0'; +char rx_vfo = '0'; +char modeA = '1'; +char modeB = '1'; +int width_main = 500; +int width_sub = 700; + + +int +getmyline(int fd, unsigned char *buf) +{ + unsigned char c; + int i = 0; + int n = 0; + memset(buf, 0, BUFSIZE); + + while (i < 5 && read(fd, &c, 1) > 0) + { + buf[i++] = c; + n++; + } + + printf("n=%d %02x %02x %02x %02x %02x\n", n, buf[0], buf[1], buf[2], buf[3], + buf[4]); + return n; +} + +#if defined(WIN32) || defined(_WIN32) +int openPort(char *comport) // doesn't matter for using pts devices +{ + int fd; + fd = open(comport, O_RDWR); + + if (fd < 0) + { + perror(comport); + } + + return fd; +} + +#else +int openPort(char *comport) // doesn't matter for using pts devices +{ + int fd = posix_openpt(O_RDWR); + char *name = ptsname(fd); + + if (name == NULL) + { + perror("pstname"); + return -1; + } + + printf("name=%s\n", name); + + if (fd == -1 || grantpt(fd) == -1 || unlockpt(fd) == -1) + { + perror("posix_openpt"); + return -1; + } + + return fd; +} +#endif + + + +int main(int argc, char *argv[]) +{ + unsigned char buf[256]; + unsigned char *pbuf; + int n; + + +again: + int fd = openPort(argv[1]); + + while (1) + { + int bytes = getmyline(fd, buf); + + if (bytes == 0) + { + close(fd); + goto again; + } + + if (bytes != 5) + { + printf("Not 5 bytes? bytes=%d\n", bytes); + } + + switch (buf[0]) + { + case '?': printf("Query %c\n", buf[1]);break; + case '*': printf("Set %c\n", buf[1]);break; + + default: printf("Unknown cmd=%02x\n", buf[4]); + } + } + + return 0; +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Hamlib-4.5.3/src/conf.c new/Hamlib-4.5.4/src/conf.c --- old/Hamlib-4.5.3/src/conf.c 2022-12-31 21:46:26.000000000 +0100 +++ new/Hamlib-4.5.4/src/conf.c 2023-01-10 02:31:41.000000000 +0100 @@ -554,6 +554,7 @@ } rs->pttport.parm.cm108.ptt_bitnum = val_i; + rs->rigport.parm.cm108.ptt_bitnum = val_i; rs->pttport_deprecated.parm.cm108.ptt_bitnum = val_i; break; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Hamlib-4.5.3/src/misc.c new/Hamlib-4.5.4/src/misc.c --- old/Hamlib-4.5.3/src/misc.c 2022-12-31 21:46:26.000000000 +0100 +++ new/Hamlib-4.5.4/src/misc.c 2023-01-10 02:31:41.000000000 +0100 @@ -1284,6 +1284,7 @@ { RIG_AGC_AUTO, "AUTO" }, { RIG_AGC_LONG, "LONG" }, { RIG_AGC_ON, "ON" }, + { RIG_AGC_NONE, "NONE" }, { -1, "" }, }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Hamlib-4.5.3/src/rig.c new/Hamlib-4.5.4/src/rig.c --- old/Hamlib-4.5.3/src/rig.c 2022-12-31 21:46:26.000000000 +0100 +++ new/Hamlib-4.5.4/src/rig.c 2023-01-10 02:31:41.000000000 +0100 @@ -586,8 +586,13 @@ */ case RIG_PORT_CM108: strncpy(rs->rigport.pathname, DEFAULT_CM108_PORT, HAMLIB_FILPATHLEN); - rs->rigport.parm.cm108.ptt_bitnum = DEFAULT_CM108_PTT_BITNUM; - rs->pttport.parm.cm108.ptt_bitnum = DEFAULT_CM108_PTT_BITNUM; + + if (rs->rigport.parm.cm108.ptt_bitnum == 0) + { + rs->rigport.parm.cm108.ptt_bitnum = DEFAULT_CM108_PTT_BITNUM; + rs->pttport.parm.cm108.ptt_bitnum = DEFAULT_CM108_PTT_BITNUM; + } + break; case RIG_PORT_GPIO: @@ -5847,11 +5852,23 @@ txrange = rig_get_range(rig->state.tx_range_list, freq, mode); - if (!txrange) + // check all the range lists + if (txrange == NULL) { rig_get_range(rig->caps->tx_range_list1, freq, mode); } + + if (txrange == NULL) { rig_get_range(rig->caps->tx_range_list2, freq, mode); } + + if (txrange == NULL) { rig_get_range(rig->caps->tx_range_list3, freq, mode); } + + if (txrange == NULL) { rig_get_range(rig->caps->tx_range_list4, freq, mode); } + + if (txrange == NULL) { rig_get_range(rig->caps->tx_range_list5, freq, mode); } + + if (txrange == NULL) { /* * freq is not on the tx range! */ + rig_debug(RIG_DEBUG_ERR, "%s: freq not in tx range\n", __func__); RETURNFUNC(-RIG_EINVAL); } @@ -6843,7 +6860,7 @@ { int i; - if (!range_list) + if (range_list == NULL) { return (NULL); } @@ -7713,3 +7730,15 @@ return (retcode); } + +HAMLIB_EXPORT(int) rig_is_model(RIG *rig, rig_model_t model) +{ + int is_rig; + + //a bit too verbose so disable this unless needed + //rig_debug(RIG_DEBUG_TRACE, "%s(%d):%s called\n", __FILE__, __LINE__, __func__); + is_rig = (model == rig->caps->rig_model) ? 1 : 0; + + return (is_rig); // RETURN is too verbose here +} + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Hamlib-4.5.3/tests/Makefile.am new/Hamlib-4.5.4/tests/Makefile.am --- old/Hamlib-4.5.3/tests/Makefile.am 2022-12-31 21:46:26.000000000 +0100 +++ new/Hamlib-4.5.4/tests/Makefile.am 2023-01-10 02:31:41.000000000 +0100 @@ -26,6 +26,7 @@ rigctl_SOURCES = rigctl.c $(RIGCOMMONSRC) rigctld_SOURCES = rigctld.c $(RIGCOMMONSRC) rigctlcom_SOURCES = rigctlcom.c $(RIGCOMMONSRC) +rigctltcp_SOURCES = rigctltcp.c $(RIGCOMMONSRC) rotctl_SOURCES = rotctl.c $(ROTCOMMONSRC) rotctld_SOURCES = rotctld.c $(ROTCOMMONSRC) ampctl_SOURCES = ampctl.c $(AMPCOMMONSRC) @@ -50,6 +51,7 @@ ampctl_CFLAGS = $(AM_CFLAGS) $(PTHREAD_CFLAGS) -I$(top_builddir)/src ampctld_CFLAGS = $(AM_CFLAGS) $(PTHREAD_CFLAGS) -I$(top_builddir)/src rigctlcom_CFLAGS = $(AM_CFLAGS) $(PTHREAD_CFLAGS) -I$(top_builddir)/security +rigctltcp_CFLAGS = $(AM_CFLAGS) $(PTHREAD_CFLAGS) -I$(top_builddir)/security if HAVE_LIBUSB rigtestlibusb_CFLAGS = $(AM_CFLAGS) $(PTHREAD_CFLAGS) $(LIBUSB_CFLAGS) endif @@ -63,6 +65,7 @@ ampctld_LDADD = $(NET_LIBS) $(PTHREAD_LIBS) $(LDADD) $(READLINE_LIBS) rigmem_LDADD = $(LIBXML2_LIBS) $(LDADD) rigctlcom_LDADD = $(NET_LIBS) $(PTHREAD_LIBS) $(LDADD) $(READLINE_LIBS) +rigctltcp_LDADD = $(NET_LIBS) $(PTHREAD_LIBS) $(LDADD) $(READLINE_LIBS) if HAVE_LIBUSB rigtestlibusb_LDADD = $(LIBUSB_LIBS) endif @@ -78,6 +81,7 @@ rotctld_LDFLAGS = $(WINEXELDFLAGS) ampctld_LDFLAGS = $(WINEXELDFLAGS) rigctlcom_LDFLAGS = $(WINEXELDFLAGS) +rigctltcp_LDFLAGS = $(WINEXELDFLAGS) if HAVE_LIBUSB rigtestlibusb_LDFLAGS = $(WINEXELDFLAGS) endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Hamlib-4.5.3/tests/dumpcaps.c new/Hamlib-4.5.4/tests/dumpcaps.c --- old/Hamlib-4.5.3/tests/dumpcaps.c 2022-12-31 21:46:26.000000000 +0100 +++ new/Hamlib-4.5.4/tests/dumpcaps.c 2023-01-10 02:31:41.000000000 +0100 @@ -296,7 +296,6 @@ fprintf(fout, "\n"); -#if 0 fprintf(fout, "AGC levels:"); const struct icom_priv_caps *priv_caps = (const struct icom_priv_caps *) rig->caps->priv; @@ -313,6 +312,7 @@ } else { + for (i = 0; i < HAMLIB_MAX_AGC_LEVELS && i < caps->agc_level_count; i++) { fprintf(fout, " %d=%s", caps->agc_levels[i], @@ -320,16 +320,13 @@ } } -#else - //fprintf(fout, "\n"); - fprintf(fout, "AGC levels: "); - char buf[1024]; - rig_sprintf_agc_levels(rig, buf, (int)sizeof(buf)); - fprintf(fout, "%s", buf); -#endif + fprintf(fout, "\n"); if (i == 0) { + rig_debug(RIG_DEBUG_WARN, + "%s: defaulting to all levels since rig does not have any\n", __func__); + // Fall back to printing out all levels for backwards-compatibility for (i = RIG_AGC_OFF; i <= RIG_AGC_LAST; i++) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Hamlib-4.5.3/tests/rigctld.c new/Hamlib-4.5.4/tests/rigctld.c --- old/Hamlib-4.5.3/tests/rigctld.c 2022-12-31 21:46:26.000000000 +0100 +++ new/Hamlib-4.5.4/tests/rigctld.c 2023-01-10 02:31:41.000000000 +0100 @@ -156,6 +156,7 @@ extern powerstat_t rig_powerstat; static int rigctld_idle = 0; // if true then rig will close when no clients are connected +static int skip_open = 0; #define MAXCONFLEN 1024 @@ -509,19 +510,29 @@ exit(1); } - if (*conf_parms != '\0') + if (strcmp(optarg, "autopower_on=0") == 0) { - strcat(conf_parms, ","); + rig_debug(RIG_DEBUG_ERR, "%s: skipping rig_open\n", __func__); + skip_open = 1; } - - if (strlen(conf_parms) + strlen(optarg) > MAXCONFLEN - 24) + else { - printf("Length of conf_parms exceeds internal maximum of %d\n", - MAXCONFLEN - 24); - return 1; + + if (*conf_parms != '\0') + { + strcat(conf_parms, ","); + } + + if (strlen(conf_parms) + strlen(optarg) > MAXCONFLEN - 24) + { + printf("Length of conf_parms exceeds internal maximum of %d\n", + MAXCONFLEN - 24); + return 1; + } + + strncat(conf_parms, optarg, MAXCONFLEN - strlen(conf_parms)); } - strncat(conf_parms, optarg, MAXCONFLEN - strlen(conf_parms)); break; case 't': @@ -758,8 +769,15 @@ } /* attempt to open rig to check early for issues */ - retcode = rig_open(my_rig); - rig_opened = retcode == RIG_OK ? 1 : 0; + if (skip_open) + { + rig_opened = 0; + } + else + { + retcode = rig_open(my_rig); + rig_opened = retcode == RIG_OK ? 1 : 0; + } if (retcode != RIG_OK) {