[Hamlib-commits] Hamlib -- Ham radio control libraries branch master updated. 137231cb7b1bdc9dfe075
Library to control radio transceivers and receivers
Brought to you by:
n0nb
From: n0nb <n0...@us...> - 2024-08-24 02:40:33
|
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 137231cb7b1bdc9dfe075f4cf4c311a9ebfcc306 (commit) via 4170953aa0fca9c9c351a13cd4847ac43d4f8fff (commit) via 79df61b9bc5cc2b5bb4a3703ee513e7f51ba45c2 (commit) via 5ba43ba00e2bc6bc8d41a57bb9cfec2ddfac5465 (commit) via b489f68533680d53ddb38178efe32170045436d9 (commit) via 227e1f47597a7a03177103db4ac5d7b6298e7a6e (commit) via ea481e98856e0326ec1a6adc38eee257f11590f2 (commit) via 67469ba119ad87b088b6942b2d4808dee40bfa2c (commit) via d7191615eeab68ef8c553b75dee3ffff774e3278 (commit) via df405cd6b5ae1130a93bb9b1487ef093b5f76560 (commit) via d556a2bcff17230e810f307ecac258e1ba53bb70 (commit) via 6e0aa59cc2aa425acc9b937b48c6d891167f871d (commit) via 4aff005665d22f0bea3293ede7f6bd08b8c24dca (commit) via 64518dac35ee91c76199ddce87a8f826843858fb (commit) via 0777ee61ca9b4ec13a0c1f3051ab8ce5c3df8f86 (commit) via 88572851b4774e7107331840d37c6b969960d9ef (commit) via 61036be5d9e5e752c919aba5f77cf8d8453bb919 (commit) via 6f9de59bbd349d92e200f4468870c43f344cffc8 (commit) via 82e9e5ffbe8b7c2b78e27d3f01d235047788fa50 (commit) via 8ec452827deb109c2e1aaa66732a57b7b6b50824 (commit) via a337debf260c0b5879326a824b30a9eb65f1b49e (commit) via 069b0bf5b05d6a209204dd1354d3f9f0fd953411 (commit) via 1e54e2476757bcecc8091d4d4aae5bdc33307311 (commit) via 9e6af9e99d24cf3756232de70354ea27a7f3286c (commit) via f3bd0bdf0a2d80b0fe223885973d74156b794918 (commit) via d3e191101f3603cc534549cfa4dd952d118a9e35 (commit) via 8975643aaa67b41d2d3dfeb330055544426625db (commit) via 437334818fbe70d9338352b0abdb50d54810f415 (commit) via 7719d048977acb035aabb6eca8c5d39c385fcb3b (commit) via 4c52f81e32c47844d4bb2a3b9864c12582088c65 (commit) via 24b47951b25443abfd43bc0f9725bcfd4031d9d1 (commit) via e63014a23f0fdcda5ad8a6bff9246489d9c8a358 (commit) via faee30ebd9c53b134947190e78bba469962020c4 (commit) via 15dc3ae8be03814b708b744f4df19415918a90d3 (commit) via 4312b26bc9401fe0d98c181bbd90fc81c280c3dd (commit) via 63acc6e6c24050ca289285ae6447723de1891b61 (commit) via 3e8b1d7a94c7366d7c14fa9bd4d0db86ff1c8dc0 (commit) from 3b1283496cdb89d3d43d0354216e8dfa0a8b8d00 (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 137231cb7b1bdc9dfe075f4cf4c311a9ebfcc306 Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Aug 19 09:01:05 2024 -0500 Add RFPOWER_METER_WATTS and SWR for Elecraft K4 diff --git a/rigs/kenwood/k3.c b/rigs/kenwood/k3.c index 587bd4cc9..22e85be3a 100644 --- a/rigs/kenwood/k3.c +++ b/rigs/kenwood/k3.c @@ -171,6 +171,29 @@ int k3_set_nb_level(RIG *rig, float dsp_nb, float if_nb); int k3_get_nb_level(RIG *rig, float *dsp_nb, float *if_nb); int k3_get_bar_graph_level(RIG *rig, float *smeter, float *pwr, float *alc, int *mode_tx); +int k4_get_bar_graph_level(RIG *rig, float *swr, float *pwr, float *alc, + int *mode_tx); +int kx3_get_bar_graph_level(RIG *rig, float *level); +int k3_send_voice_mem(RIG *rig, vfo_t vfo, int ch); +int k3_stop_voice_mem(RIG *rig, vfo_t vfo); +int k3_stop_morse(RIG *rig, vfo_t vfo); + +/* K4 functions */ +int k4_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt); +int k4_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt); +int k4_send_voice_mem(RIG *rig, vfo_t vfo, int ch); +int k4_stop_voice_mem(RIG *rig, vfo_t vfo); +int k4_stop_morse(RIG *rig, vfo_t vfo); + +/* + * K3 rig capabilities. + * This kit can recognize a large subset of TS-570/K2 commands and has many + * extensions of its own. Extension backend functions to standard Kenwood + * command are defined in elecraft.c (shared with K2) and in this file. + * + * Part of info comes from http://www.elecraft.com/K2_Manual_Download_Page.htm#K3 + * look for K3 Programmer's Reference PDF + */ int kx3_get_bar_graph_level(RIG *rig, float *level); int k3_send_voice_mem(RIG *rig, vfo_t vfo, int ch); int k3_stop_voice_mem(RIG *rig, vfo_t vfo); @@ -519,7 +542,7 @@ struct rig_caps k4_caps = RIG_MODEL(RIG_MODEL_K4), .model_name = "K4", .mfg_name = "Elecraft", - .version = BACKEND_VER ".31", + .version = BACKEND_VER ".32", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -2086,7 +2109,15 @@ int k3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) int tx_mode; float alc; - retval = k3_get_bar_graph_level(rig, NULL, NULL, &alc, &tx_mode); + if (RIG_IS_K4) + { + retval = k4_get_bar_graph_level(rig, NULL, NULL, &alc, &tx_mode); + tx_mode = 1; // Assume ALC is zero when in Tx so we don't care about ptt status + } + else + { + retval = k3_get_bar_graph_level(rig, NULL, NULL, &alc, &tx_mode); + } if (retval != RIG_OK) { @@ -2114,7 +2145,15 @@ int k3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) int tx_mode; float pwr; - retval = k3_get_bar_graph_level(rig, NULL, &pwr, NULL, &tx_mode); + if (RIG_IS_K4) + { + retval = k4_get_bar_graph_level(rig, NULL, &pwr, NULL, &tx_mode); + tx_mode = 1; // Does K4 return pwr=0 when in Rx? Hope so. + } + else + { + retval = k3_get_bar_graph_level(rig, NULL, &pwr, NULL, &tx_mode); + } if (retval != RIG_OK) { @@ -2319,14 +2358,22 @@ int k3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) break; case RIG_LEVEL_SWR: - retval = kenwood_safe_transaction(rig, "SW", levelbuf, sizeof(levelbuf), 5); - - if (retval != RIG_OK) + if (RIG_IS_K4) { - return retval; + retval = k4_get_bar_graph_level(rig, &val->f, NULL, NULL, NULL); + return RIG_OK; } + else + { + retval = kenwood_safe_transaction(rig, "SW", levelbuf, sizeof(levelbuf), 5); - sscanf(levelbuf + 2, "%d", &val->i); + if (retval != RIG_OK) + { + return retval; + } + + sscanf(levelbuf + 2, "%d", &val->i); + } val->f = (float) val->i / 10.0f; break; @@ -2694,6 +2741,29 @@ int k3_get_nb_level(RIG *rig, float *dsp_nb, float *if_nb) return RIG_OK; } +int k4_get_bar_graph_level(RIG *rig, float *swr, float *pwr, float *alc, + int *mode_tx) +{ + int retval; + int ialc,icmp,ifwd,iswr; + char levelbuf[16]; + + rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + + retval = kenwood_safe_transaction(rig, "TM", levelbuf, sizeof(levelbuf), 14); + + if (retval != RIG_OK) + { + return retval; + } + + sscanf(levelbuf, "TM%03d%03d%03d%03d", &ialc, &icmp, &ifwd, &iswr); + if (swr) *swr = iswr/10.0; + if (pwr) *pwr = ifwd/100.0; // pwr is returned in 0-1 sscale + if (alc) *alc = ialc; + return RIG_OK; +} + int k3_get_bar_graph_level(RIG *rig, float *smeter, float *pwr, float *alc, int *mode_tx) { diff --git a/rigs/kenwood/kenwood.h b/rigs/kenwood/kenwood.h index 77f5129d2..54082c091 100644 --- a/rigs/kenwood/kenwood.h +++ b/rigs/kenwood/kenwood.h @@ -28,7 +28,7 @@ #include "token.h" #include "idx_builtin.h" -#define BACKEND_VER "20240818" +#define BACKEND_VER "20240819" #define EOM_KEN ';' #define EOM_TH '\r' @@ -89,6 +89,7 @@ extern struct confparams kenwood_cfg_params[]; #define RIG_IS_K3S (rig->caps->rig_model == RIG_MODEL_K3S) #define RIG_IS_KX2 (rig->caps->rig_model == RIG_MODEL_KX2) #define RIG_IS_KX3 (rig->caps->rig_model == RIG_MODEL_KX3) +#define RIG_IS_K4 (rig->caps->rig_model == RIG_MODEL_K4) #define RIG_IS_THD7A (rig->caps->rig_model == RIG_MODEL_THD7A) #define RIG_IS_THD74 (rig->caps->rig_model == RIG_MODEL_THD74) #define RIG_IS_TMD700 (rig->caps->rig_model == RIG_MODEL_TMD700) diff --git a/simulators/simelecraftk4.c b/simulators/simelecraftk4.c index 1aa4cad2f..11e40bbd1 100644 --- a/simulators/simelecraftk4.c +++ b/simulators/simelecraftk4.c @@ -37,6 +37,7 @@ int ai = 0; int dt = 0; int modeA = 2; int modeB = 2; +int ptt = 0; // int freqa = 14074000, freqb = 14073500; // ID 0310 == 310, Must drop leading zero @@ -312,7 +313,7 @@ int main(int argc, char *argv[]) { WRITE(fd, "K30;", 4); } - else if (strcmp(buf, "RVM;") == 0) + else if (strncmp(buf, "RV", 2) == 0) { WRITE(fd, "RV02.37;", 8); } @@ -375,7 +376,7 @@ int main(int argc, char *argv[]) } else if (strncmp(buf, "TQ;", 3) == 0) { - SNPRINTF(buf, sizeof(buf), "TQ0;"); + SNPRINTF(buf, sizeof(buf), "TQ%d;", ptt); WRITE(fd, buf, strlen(buf)); } else if (strncmp(buf, "PC;", 3) == 0) @@ -430,6 +431,19 @@ int main(int argc, char *argv[]) { printf("Morse: %s\n", buf); } + else if (strncmp(buf, "TM", 2) == 0) + { + SNPRINTF(buf, sizeof(buf), "TM001002003004;"); + WRITE(fd, buf, strlen(buf)); + } + else if (strncmp(buf, "TX", 2) == 0) + { + ptt = 1; + } + else if (strncmp(buf, "RX", 2) == 0) + { + ptt = 0; + } else if (strlen(buf) > 0) { fprintf(stderr, "Unknown command: %s\n", buf); commit 4170953aa0fca9c9c351a13cd4847ac43d4f8fff Author: Mike Black W9MDB <mdb...@ya...> Date: Sun Aug 18 16:51:11 2024 -0500 Update man pages diff --git a/doc/man1/rigctld.1 b/doc/man1/rigctld.1 index fc701018b..8e80db79d 100644 --- a/doc/man1/rigctld.1 +++ b/doc/man1/rigctld.1 @@ -236,8 +236,8 @@ rigctl -m 2 -r ::1 (on Linux rigctld doesn't listen on IPV6 by default) .IP rigctld -T 127.0.0.1 .in +4n -rigctl -m 2 -rigctl -m 2 -r 127.0.0.1 +rigctl -m 2 (binds to all interfaces) +rigctl -m 2 -r 127.0.0.1 (bind only to 127.0.0.1) .EE Exceptions: .EX diff --git a/doc/man1/rotctld.1 b/doc/man1/rotctld.1 index f65bbcf3d..234b71a04 100644 --- a/doc/man1/rotctld.1 +++ b/doc/man1/rotctld.1 @@ -138,6 +138,27 @@ Use as the listening IP address. .IP The default is ANY. +.IP +.B rotctld +can be run and connected to like this: +. +.IP +.EX +rotctld (binds to all interfaces) +. +.in +4n +rotctl -m 2 +rotctl -m 2 -r 127.0.0.1 +rotctl -m 2 -r localhost +rotctl -m 2 -r 192.168.1.1 (local IP address) +rotctl -m 2 -r ::1 (on Linux rotctld doesn't listen on IPV6 by default) +.in +. +.IP +rotctld -T 127.0.0.1 (bind only to 127.0.0.1) +.in +4n +rotctl -m 2 (binds to all interfaces) +rotctl -m 2 -r 127.0.0.1 (bind only to 127.0.0.1) . .TP .BR \-t ", " \-\-port = \fInumber\fP @@ -149,8 +170,8 @@ The default is 4533. .IP .BR Note : As -.BR rigctld \(aqs -default port is 4532, it is advisable to use odd numbered ports for +.BR rotctld \(aqs +default port is 4533, it is advisable to use odd numbered ports for .BR rotctld , e.g. 4533, 4535, 4537, etc. . commit 79df61b9bc5cc2b5bb4a3703ee513e7f51ba45c2 Merge: 5ba43ba00 227e1f475 Author: Mike Black W9MDB <mdb...@ya...> Date: Sun Aug 18 08:23:28 2024 -0500 Merge branch 'master' of https://github.com/Hamlib/Hamlib commit 5ba43ba00e2bc6bc8d41a57bb9cfec2ddfac5465 Author: Mike Black W9MDB <mdb...@ya...> Date: Sun Aug 18 08:15:11 2024 -0500 Fix mingw compiles https://github.com/Hamlib/Hamlib/issues/1597 diff --git a/rotators/flir/flir.c b/rotators/flir/flir.c index cf76aec87..77e905ea2 100644 --- a/rotators/flir/flir.c +++ b/rotators/flir/flir.c @@ -63,8 +63,8 @@ struct flir_priv_data char *magic_conf; - float_t resolution_pp; - float_t resolution_tp; + double resolution_pp; + double resolution_tp; }; static int flir_request(ROT *rot, char *request, char *response, @@ -178,7 +178,7 @@ static int flir_open(ROT *rot) { struct flir_priv_data *priv; char return_str[MAXBUF]; - float_t resolution_pp, resolution_tp; + double resolution_pp, resolution_tp; int return_value = RIG_OK; rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); @@ -206,8 +206,8 @@ static int flir_open(ROT *rot) // Get PAN resolution in arcsecs if (flir_request(rot, "PR\n", return_str, MAXBUF) == RIG_OK) { - sscanf(return_str, "* %f", &resolution_pp); - rig_debug(RIG_DEBUG_VERBOSE, "PAN resolution: %f arcsecs per position\n", + sscanf(return_str, "* %lf", &resolution_pp); + rig_debug(RIG_DEBUG_VERBOSE, "PAN resolution: %lf arcsecs per position\n", resolution_pp); priv->resolution_pp = resolution_pp; } @@ -219,8 +219,8 @@ static int flir_open(ROT *rot) // Get TILT resolution in arcsecs if (flir_request(rot, "TR\n", return_str, MAXBUF) == RIG_OK) { - sscanf(return_str, "* %f", &resolution_tp); - rig_debug(RIG_DEBUG_VERBOSE, "TILT resolution: %f arcsecs per position\n", + sscanf(return_str, "* %lf", &resolution_tp); + rig_debug(RIG_DEBUG_VERBOSE, "TILT resolution: %lf arcsecs per position\n", resolution_tp); priv->resolution_tp = resolution_tp; } @@ -517,7 +517,7 @@ struct rot_caps flir_caps = ROT_MODEL(ROT_MODEL_FLIR), .model_name = "PTU Serial", .mfg_name = "FLIR", - .version = "20221126.0", + .version = "20240818.0", .copyright = "LGPL", .status = RIG_STATUS_BETA, .rot_type = ROT_TYPE_AZEL, diff --git a/tests/rotctl.c b/tests/rotctl.c index bf43a8f86..0cc62bfe6 100644 --- a/tests/rotctl.c +++ b/tests/rotctl.c @@ -108,8 +108,6 @@ static struct option long_options[] = /* variable for readline support */ #ifdef HAVE_LIBREADLINE static const int have_rl = 1; -#else -static const int have_rl = 0; #endif int main(int argc, char *argv[]) commit b489f68533680d53ddb38178efe32170045436d9 Author: Mike Black W9MDB <mdb...@ya...> Date: Sun Aug 18 07:16:34 2024 -0500 Fix mingw build diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index cf4922e63..13fbebe0a 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -3314,10 +3314,11 @@ int kenwood_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) switch (level) { - int retval = RIG_OK; + int retval; case RIG_LEVEL_RFPOWER: { + retval = RIG_OK; pbwidth_t twidth; int err = rig_get_mode(rig, vfo, &priv->curr_mode, &twidth); // https://github.com/Hamlib/Hamlib/issues/1595 @@ -3904,6 +3905,7 @@ int kenwood_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) break; case RIG_LEVEL_RFPOWER: + { pbwidth_t twidth; int err = rig_get_mode(rig, vfo, &priv->curr_mode, &twidth); // https://github.com/Hamlib/Hamlib/issues/1595 @@ -3922,6 +3924,7 @@ int kenwood_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) priv->power_min = 0; // our return scale is 0-max to match the input scale val->f = (priv->power_now - priv->power_min) / (float)(priv->power_max - priv->power_min); RETURNFUNC(RIG_OK); + } case RIG_LEVEL_AF: { diff --git a/rigs/kenwood/kenwood.h b/rigs/kenwood/kenwood.h index 1658944f4..77f5129d2 100644 --- a/rigs/kenwood/kenwood.h +++ b/rigs/kenwood/kenwood.h @@ -28,7 +28,7 @@ #include "token.h" #include "idx_builtin.h" -#define BACKEND_VER "20240817" +#define BACKEND_VER "20240818" #define EOM_KEN ';' #define EOM_TH '\r' commit 227e1f47597a7a03177103db4ac5d7b6298e7a6e Author: Mike Black W9MDB <mdb...@ya...> Date: Sun Aug 18 07:16:34 2024 -0500 Fix mingw build diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index cf4922e63..13fbebe0a 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -3314,10 +3314,11 @@ int kenwood_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) switch (level) { - int retval = RIG_OK; + int retval; case RIG_LEVEL_RFPOWER: { + retval = RIG_OK; pbwidth_t twidth; int err = rig_get_mode(rig, vfo, &priv->curr_mode, &twidth); // https://github.com/Hamlib/Hamlib/issues/1595 @@ -3904,6 +3905,7 @@ int kenwood_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) break; case RIG_LEVEL_RFPOWER: + { pbwidth_t twidth; int err = rig_get_mode(rig, vfo, &priv->curr_mode, &twidth); // https://github.com/Hamlib/Hamlib/issues/1595 @@ -3922,6 +3924,7 @@ int kenwood_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) priv->power_min = 0; // our return scale is 0-max to match the input scale val->f = (priv->power_now - priv->power_min) / (float)(priv->power_max - priv->power_min); RETURNFUNC(RIG_OK); + } case RIG_LEVEL_AF: { diff --git a/rigs/kenwood/kenwood.h b/rigs/kenwood/kenwood.h index 1658944f4..77f5129d2 100644 --- a/rigs/kenwood/kenwood.h +++ b/rigs/kenwood/kenwood.h @@ -28,7 +28,7 @@ #include "token.h" #include "idx_builtin.h" -#define BACKEND_VER "20240817" +#define BACKEND_VER "20240818" #define EOM_KEN ';' #define EOM_TH '\r' commit ea481e98856e0326ec1a6adc38eee257f11590f2 Merge: 67469ba11 df405cd6b Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Aug 17 17:16:08 2024 -0500 Merge branch 'master' of https://github.com/Hamlib/Hamlib commit 67469ba119ad87b088b6942b2d4808dee40bfa2c Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Aug 17 17:14:07 2024 -0500 Fixup kenwood PC command for RF_POWER set/get https://github.com/Hamlib/Hamlib/issues/1595 diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index 258c0d030..cf4922e63 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -3049,6 +3049,7 @@ static int kenwood_get_power_minmax(RIG *rig, int *power_now, int *power_min, int max_length = 18; int expected_length; int retval; + int simple_PC = 0; // flag to do just a simple PC command char levelbuf[max_length + 1]; // read power_now, set 0, read power_min, set 255, read_power_max; set 0 // we set back to 0 for safety and if restore is true we restore power_min @@ -3061,6 +3062,8 @@ static int kenwood_get_power_minmax(RIG *rig, int *power_now, int *power_min, ENTERFUNC; + if (power_now == NULL || power_min == NULL) simple_PC = 1; + switch (rig->caps->rig_model) { // TS480 can't handle the long command string @@ -3087,7 +3090,10 @@ static int kenwood_get_power_minmax(RIG *rig, int *power_now, int *power_min, break; default: - cmd = "PC;PC000;PC;PC255;PC;PC000;"; + if (simple_PC) + cmd = "PC;"; + else + cmd = "PC;PC000;PC;PC255;PC;PC000;"; } // Don't do this if PTT is on...don't want to max out power!! @@ -3106,7 +3112,7 @@ static int kenwood_get_power_minmax(RIG *rig, int *power_now, int *power_min, if (retval != RIG_OK) { RETURNFUNC(retval); } - if (RIG_IS_TS890S || RIG_IS_TS480) + if (RIG_IS_TS890S || RIG_IS_TS480 || simple_PC) { expected_length = 6; } @@ -3130,7 +3136,7 @@ static int kenwood_get_power_minmax(RIG *rig, int *power_now, int *power_min, RETURNFUNC(-RIG_EPROTO); } - if (RIG_IS_TS890S || RIG_IS_TS480) + if (RIG_IS_TS890S || RIG_IS_TS480 || simple_PC) { n = sscanf(levelbuf, "PC%d;", power_now); @@ -3160,12 +3166,13 @@ static int kenwood_get_power_minmax(RIG *rig, int *power_now, int *power_min, } } - rig_debug(RIG_DEBUG_TRACE, "%s: returning now=%d, min=%d, max=%d\n", __func__, - *power_now, *power_min, *power_max); rs->power_now = *power_now; - rs->power_min = *power_min; - rs->power_max = *power_max; + if (!simple_PC) + { + rs->power_min = *power_min; + rs->power_max = *power_max; + } RETURNFUNC(RIG_OK); } @@ -3307,30 +3314,27 @@ int kenwood_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) switch (level) { - int retval; + int retval = RIG_OK; case RIG_LEVEL_RFPOWER: { - static mode_t mode = RIG_MODE_NONE; - int power_now, power_min, power_max; pbwidth_t twidth; int err = rig_get_mode(rig, vfo, &priv->curr_mode, &twidth); // https://github.com/Hamlib/Hamlib/issues/1595 - if (!err && priv->curr_mode != mode) // only need to check when mode changes + if (!err && priv->last_mode_pc != priv->curr_mode) // only need to check when mode changes { - mode = priv->curr_mode; + priv->last_mode_pc = priv->curr_mode; // Power min/max can vary so we query to find them out every time - retval = kenwood_get_power_minmax(rig, &power_now, &power_min, &power_max, 0); + retval = kenwood_get_power_minmax(rig, &priv->power_now, &priv->power_min, &priv->power_max, 0); + if (retval != RIG_OK) { RETURNFUNC(retval); } } - if (retval != RIG_OK) { RETURNFUNC(retval); } - // https://github.com/Hamlib/Hamlib/issues/465 - kenwood_val = val.f * power_max; + kenwood_val = val.f * priv->power_max; - if (kenwood_val < power_min) { kenwood_val = power_min; } + if (kenwood_val < priv->power_min) { kenwood_val = priv->power_min; } - if (kenwood_val > power_max) { kenwood_val = power_max; } + if (kenwood_val > priv->power_max) { kenwood_val = priv->power_max; } SNPRINTF(levelbuf, sizeof(levelbuf), "PC%03d", kenwood_val); break; @@ -3690,8 +3694,6 @@ int kenwood_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) switch (level) { - int power_now, power_min, power_max; - case RIG_LEVEL_RAWSTR: if (RIG_IS_TS590S || RIG_IS_TS590SG) { @@ -3902,13 +3904,23 @@ int kenwood_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) break; case RIG_LEVEL_RFPOWER: - // Power min/max can vary so we query to find them out every time - retval = kenwood_get_power_minmax(rig, &power_now, &power_min, &power_max, 1); - - if (retval != RIG_OK) { RETURNFUNC(retval); } + pbwidth_t twidth; + int err = rig_get_mode(rig, vfo, &priv->curr_mode, &twidth); + // https://github.com/Hamlib/Hamlib/issues/1595 + if (!err && priv->last_mode_pc != priv->curr_mode) // only need to check when mode changes + { + priv->last_mode_pc = priv->curr_mode; + // Power min/max can vary so we query to find them out every time + retval = kenwood_get_power_minmax(rig, &priv->power_now, &priv->power_min, &priv->power_max, 0); + if (retval != RIG_OK) { RETURNFUNC(retval); } + } + else + { + retval = kenwood_get_power_minmax(rig, &priv->power_now, NULL, NULL, 0); + } - power_min = 0; // our return scale is 0-max to match the input scale - val->f = (power_now - power_min) / (float)(power_max - power_min); + priv->power_min = 0; // our return scale is 0-max to match the input scale + val->f = (priv->power_now - priv->power_min) / (float)(priv->power_max - priv->power_min); RETURNFUNC(RIG_OK); case RIG_LEVEL_AF: diff --git a/rigs/kenwood/kenwood.h b/rigs/kenwood/kenwood.h index 3508f91bd..1658944f4 100644 --- a/rigs/kenwood/kenwood.h +++ b/rigs/kenwood/kenwood.h @@ -28,7 +28,7 @@ #include "token.h" #include "idx_builtin.h" -#define BACKEND_VER "20240815" +#define BACKEND_VER "20240817" #define EOM_KEN ';' #define EOM_TH '\r' @@ -182,6 +182,8 @@ struct kenwood_priv_data int save_k2_ext_lvl; // so we can restore to original int save_k3_ext_lvl; // so we can restore to original -- for future use if needed int voice_bank; /* last voice bank send for use by stop_voice_mem */ + mode_t last_mode_pc; // last mode memory for PC command + int power_now,power_min,power_max; }; commit d7191615eeab68ef8c553b75dee3ffff774e3278 Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Aug 17 16:21:56 2024 -0500 Fix wording error in flrig.c diff --git a/rigs/dummy/flrig.c b/rigs/dummy/flrig.c index fe9c1ea6f..d62f7795a 100644 --- a/rigs/dummy/flrig.c +++ b/rigs/dummy/flrig.c @@ -954,7 +954,7 @@ static int flrig_open(RIG *rig) rig_debug(RIG_DEBUG_VERBOSE, "%s: get_bwB is available=%s\n", __func__, value); } - /* see if set_bwA is available */ + /* see if set_bwB is available */ retval = flrig_transaction(rig, "rig.set_bwB", NULL, value, sizeof(value)); if (retval == RIG_ENAVAIL) // must not have it commit df405cd6b5ae1130a93bb9b1487ef093b5f76560 Merge: 6e0aa59cc d556a2bcf Author: Michael Black <mdb...@ya...> Date: Fri Aug 16 12:39:58 2024 -0500 Merge pull request #1596 from reinerh/patch-1 Fix typo commit d556a2bcff17230e810f307ecac258e1ba53bb70 Author: Reiner Herrmann <re...@re...> Date: Fri Aug 16 17:47:35 2024 +0200 Fix typo diff --git a/NEWS b/NEWS index e847ac75a..f1c0e3967 100644 --- a/NEWS +++ b/NEWS @@ -13,7 +13,7 @@ Version 5.x -- future * Change FT1000MP Mark V model names to align with FT1000MP Version 4.6 - * Added Xeigu X6200 + * Added Xiegu X6200 * Added Commradio CTX-10 * Added Guoehe PMR-171 * Added csntechnoligies.net S.A.T Satellite rotor control commit 6e0aa59cc2aa425acc9b937b48c6d891167f871d Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Aug 16 06:54:15 2024 -0500 Add ROT_MODEL_SPID_ROT1PROG to priv allocation in spid.c -- fixes potential segfaults diff --git a/rotators/spid/spid.c b/rotators/spid/spid.c index ad4ce13db..703856a77 100644 --- a/rotators/spid/spid.c +++ b/rotators/spid/spid.c @@ -198,6 +198,7 @@ static int spid_rot_init(ROT *rot) } if (rot->caps->rot_model == ROT_MODEL_SPID_ROT2PROG || + rot->caps->rot_model == ROT_MODEL_SPID_ROT1PROG || rot->caps->rot_model == ROT_MODEL_SPID_MD01_ROT2PROG) { struct spid_rot2prog_priv_data *priv; @@ -216,6 +217,10 @@ static int spid_rot_init(ROT *rot) priv->el_resolution = 0; priv->dir = 0; } + else + { + rig_debug(RIG_DEBUG_ERR, "%s: Unknown SPID model=%s\n", __func__, rot->caps->model_name); + } return RIG_OK; } commit 4aff005665d22f0bea3293ede7f6bd08b8c24dca Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Aug 15 17:15:02 2024 -0500 Fix TS-2000 flicker during RFPOWER request -- only check min/max when mode changes https://github.com/Hamlib/Hamlib/issues/1595 diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index 3cc70f6c8..258c0d030 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -3311,9 +3311,17 @@ int kenwood_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) case RIG_LEVEL_RFPOWER: { + static mode_t mode = RIG_MODE_NONE; int power_now, power_min, power_max; - // Power min/max can vary so we query to find them out every time - retval = kenwood_get_power_minmax(rig, &power_now, &power_min, &power_max, 0); + pbwidth_t twidth; + int err = rig_get_mode(rig, vfo, &priv->curr_mode, &twidth); + // https://github.com/Hamlib/Hamlib/issues/1595 + if (!err && priv->curr_mode != mode) // only need to check when mode changes + { + mode = priv->curr_mode; + // Power min/max can vary so we query to find them out every time + retval = kenwood_get_power_minmax(rig, &power_now, &power_min, &power_max, 0); + } if (retval != RIG_OK) { RETURNFUNC(retval); } diff --git a/rigs/kenwood/kenwood.h b/rigs/kenwood/kenwood.h index 93b8cde1c..3508f91bd 100644 --- a/rigs/kenwood/kenwood.h +++ b/rigs/kenwood/kenwood.h @@ -28,7 +28,7 @@ #include "token.h" #include "idx_builtin.h" -#define BACKEND_VER "20240807" +#define BACKEND_VER "20240815" #define EOM_KEN ';' #define EOM_TH '\r' commit 64518dac35ee91c76199ddce87a8f826843858fb Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Aug 15 16:10:11 2024 -0500 Fix possible segfault in spid.c diff --git a/rotators/spid/spid.c b/rotators/spid/spid.c index a5f85bd52..ad4ce13db 100644 --- a/rotators/spid/spid.c +++ b/rotators/spid/spid.c @@ -535,7 +535,7 @@ static int spid_rot_stop(ROT *rot) return retval; } - priv->dir = 0; + if (priv) priv->dir = 0; return RIG_OK; } @@ -636,7 +636,7 @@ const struct rot_caps spid_rot1prog_rot_caps = ROT_MODEL(ROT_MODEL_SPID_ROT1PROG), .model_name = "Rot1Prog", .mfg_name = "SPID", - .version = "20240530.0", + .version = "20240815.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rot_type = ROT_TYPE_AZIMUTH, @@ -674,7 +674,7 @@ const struct rot_caps spid_rot2prog_rot_caps = ROT_MODEL(ROT_MODEL_SPID_ROT2PROG), .model_name = "Rot2Prog", .mfg_name = "SPID", - .version = "20220109.0", + .version = "20240815.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rot_type = ROT_TYPE_AZEL, @@ -712,7 +712,7 @@ const struct rot_caps spid_md01_rot2prog_rot_caps = ROT_MODEL(ROT_MODEL_SPID_MD01_ROT2PROG), .model_name = "MD-01/02 (ROT2 mode)", .mfg_name = "SPID", - .version = "20220109.0", + .version = "20240815.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rot_type = ROT_TYPE_AZEL, commit 0777ee61ca9b4ec13a0c1f3051ab8ce5c3df8f86 Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Aug 15 12:32:45 2024 -0500 Fix keyspd err message diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index bc6903262..42d543258 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -4544,7 +4544,7 @@ int icom_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) break; } } - rig_debug(RIG_DEBUG_ERR, "%s: did not find KEYSPD=%d\n", __func__, icom_val); + if (i == 43) rig_debug(RIG_DEBUG_ERR, "%s: did not find KEYSPD=%d\n", __func__, icom_val); break; case RIG_LEVEL_PREAMP: commit 88572851b4774e7107331840d37c6b969960d9ef Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Aug 15 12:31:45 2024 -0500 Fix KEYSPD values for Icom rigs diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 4d90e3604..bc6903262 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -51,6 +51,53 @@ static int icom_get_spectrum_edge_frequency_range(RIG *rig, vfo_t vfo, static void icom_set_x25x26_ability(RIG *rig, int status); static int icom_get_vfo_number_x25x26(RIG *rig, vfo_t vfo); +const int cw_lookup [43][2] = +{ +{0,6}, +{7,7}, +{12,8}, +{19,9}, +{25,10}, +{31,11}, +{37,12}, +{43,13}, +{49,14}, +{55,15}, +{61,16}, +{67,17}, +{73,18}, +{79,19}, +{84,20}, +{91,21}, +{97,22}, +{103,23}, +{108,24}, +{114,25}, +{121,26}, +{128,27}, +{134,28}, +{140,29}, +{144,30}, +{151,31}, +{156,32}, +{164,33}, +{169,34}, +{175,35}, +{182,36}, +{188,37}, +{192,38}, +{199,39}, +{203,40}, +{211,41}, +{215,42}, +{224,43}, +{229,44}, +{234,45}, +{239,46}, +{244,47}, +{250,48} +}; + const cal_table_float_t icom_default_swr_cal = { 5, @@ -3485,6 +3532,7 @@ int icom_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) switch (level) { + int i; case RIG_LEVEL_KEYSPD: if (val.i < 6) { @@ -3494,8 +3542,16 @@ int icom_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) { icom_val = 48; } + for(i=0;i<43;++i) + { + if (icom_val == cw_lookup[i][1]) + { + icom_val = cw_lookup[i][0]; + rig_debug(RIG_DEBUG_ERR, "%s: found %d at i=%d\n", __func__, icom_val, i); + break; + } + } - icom_val = (int) lroundf(((float) icom_val - 6.0f) * (255.0f / 42.0f)); break; case RIG_LEVEL_CWPITCH: @@ -4478,7 +4534,17 @@ int icom_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) break; case RIG_LEVEL_KEYSPD: - val->i = (int) lroundf((float) icom_val * (42.0f / 255.0f) + 6.0f); + for(i=0;i<43;++i) + { + int rigval = cw_lookup[i][0]; + if(rigval >= icom_val) + { + icom_val = cw_lookup[i][1]; + val->i = icom_val; + break; + } + } + rig_debug(RIG_DEBUG_ERR, "%s: did not find KEYSPD=%d\n", __func__, icom_val); break; case RIG_LEVEL_PREAMP: diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h index 07c988e46..5d9e315ad 100644 --- a/rigs/icom/icom.h +++ b/rigs/icom/icom.h @@ -35,7 +35,7 @@ #include <sys/time.h> #endif -#define BACKEND_VER "20240804" +#define BACKEND_VER "20240815" #define ICOM_IS_ID31 rig_is_model(rig, RIG_MODEL_ID31) #define ICOM_IS_ID51 rig_is_model(rig, RIG_MODEL_ID51) commit 61036be5d9e5e752c919aba5f77cf8d8453bb919 Author: Mike Black W9MDB <mdb...@ya...> Date: Wed Aug 14 12:45:52 2024 -0500 Fix smartsdr set_ptt diff --git a/rigs/flexradio/smartsdr.c b/rigs/flexradio/smartsdr.c index c452208a8..86492f9e6 100644 --- a/rigs/flexradio/smartsdr.c +++ b/rigs/flexradio/smartsdr.c @@ -511,7 +511,7 @@ int smartsdr_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) char slicechar[] = { '?','A','B','C','D','E','F','G','H' }; ENTERFUNC; - if (priv->ptt) + if (priv->ptt && ptt) // abort ptt if we're already transmitting { rig_debug(RIG_DEBUG_ERR, "%s: abort PTT on slice %c, another slice has PTT control\n", __func__, slicechar[priv->slicenum]); return -RIG_ENTARGET; diff --git a/rigs/flexradio/smartsdr_caps.h b/rigs/flexradio/smartsdr_caps.h index 50ec066d8..8d2407cae 100644 --- a/rigs/flexradio/smartsdr_caps.h +++ b/rigs/flexradio/smartsdr_caps.h @@ -1,5 +1,5 @@ .mfg_name = "Flex-radio", - .version = "20240807.0", + .version = "20240814.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, commit 6f9de59bbd349d92e200f4468870c43f344cffc8 Merge: 9e6af9e99 82e9e5ffb Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Aug 12 11:17:53 2024 -0500 Merge branch 'master' of https://github.com/Hamlib/Hamlib commit 82e9e5ffbe8b7c2b78e27d3f01d235047788fa50 Merge: 1e54e2476 8ec452827 Author: Michael Black <mdb...@ya...> Date: Mon Aug 12 11:17:39 2024 -0500 Merge pull request #1594 from chrbayer84/cbayer-857-pwr-levels-cal cbayer 857 pwr levels cal commit 8ec452827deb109c2e1aaa66732a57b7b6b50824 Author: Christian Bayer <chr...@sa...> Date: Mon Aug 12 18:10:37 2024 +0200 fixed merge errors and variable declarations diff --git a/rigs/yaesu/ft857.c b/rigs/yaesu/ft857.c index 6452a82e5..c554855a7 100644 --- a/rigs/yaesu/ft857.c +++ b/rigs/yaesu/ft857.c @@ -227,6 +227,20 @@ enum ft857_digi FT857_DIGI_USER_U, }; + +#define FT857_PWR_CAL { 9, \ + { \ + { 0x00, 0.0f }, \ + { 0x01, 10.0f }, \ + { 0x02, 15.0f }, \ + { 0x03, 20.0f }, \ + { 0x04, 34.0f }, \ + { 0x05, 50.0f }, \ + { 0x06, 66.0f }, \ + { 0x07, 82.f }, \ + { 0x08, 100.0f } \ + } } + #define FT857_ALL_RX_MODES (RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_USB|\ RIG_MODE_LSB|RIG_MODE_RTTY|RIG_MODE_FM|RIG_MODE_PKTUSB) #define FT857_SSB_CW_RX_MODES (RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_USB|RIG_MODE_LSB) @@ -265,7 +279,7 @@ struct rig_caps ft857_caps = .retry = 0, .has_get_func = RIG_FUNC_NONE, .has_set_func = RIG_FUNC_LOCK | RIG_FUNC_TONE | RIG_FUNC_TSQL | RIG_FUNC_CSQL | RIG_FUNC_RIT, - .has_get_level = RIG_LEVEL_STRENGTH | RIG_LEVEL_RFPOWER, + .has_get_level = RIG_LEVEL_STRENGTH | RIG_LEVEL_RFPOWER | RIG_LEVEL_RFPOWER_METER_WATTS, .has_set_level = RIG_LEVEL_BAND_SELECT, .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, @@ -356,6 +370,7 @@ struct rig_caps ft857_caps = // {RIG_MODE_WFM, kHz(230)}, /* ?? */ RIG_FLT_END, }, + .rfpower_meter_cal = FT857_PWR_CAL, .rig_init = ft857_init, .rig_cleanup = ft857_cleanup, @@ -843,7 +858,7 @@ int ft857_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt) return RIG_OK; } -static int ft857_get_pometer_level(RIG *rig, value_t *val) +static int ft857_get_pometer_level(RIG *rig, value_t *val, const cal_table_float_t *cal, float divider) { struct ft857_priv_data *p = (struct ft857_priv_data *) STATE(rig)->priv; rig_debug(RIG_DEBUG_VERBOSE, "%s: called \n", __func__); commit a337debf260c0b5879326a824b30a9eb65f1b49e Author: Christian Bayer <chr...@sa...> Date: Mon Aug 12 18:03:30 2024 +0200 fixed compile errors diff --git a/rigs/yaesu/ft857.c b/rigs/yaesu/ft857.c index c560cb122..6452a82e5 100644 --- a/rigs/yaesu/ft857.c +++ b/rigs/yaesu/ft857.c @@ -67,6 +67,7 @@ #include "bandplan.h" #include "cal.h" + enum ft857_native_cmd_e { FT857_NATIVE_CAT_LOCK_ON = 0, @@ -896,6 +897,10 @@ static int ft857_get_smeter_level(RIG *rig, value_t *val) int ft857_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) { rig_debug(RIG_DEBUG_VERBOSE, "%s: called \n", __func__); + freq_t freq; + rmode_t mode; + pbwidth_t width; + int freq_ms, mode_ms, width_ms; switch (level) { @@ -904,12 +909,14 @@ int ft857_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) case RIG_LEVEL_RFPOWER: case RIG_LEVEL_RFPOWER_METER_WATTS: - // if (144000000 >= vfo && 148000000 <= vfo) { - // return ft857_get_pometer_level(rig, val, &rig->caps->rfpower_meter_cal, 2.0); - // } - // else if (420000000 >= vfo && 450000000 <= vfo) { - // return ft857_get_pometer_level(rig, val, &rig->caps->rfpower_meter_cal, 5.0); - // } + rig_get_cache(rig, vfo, &freq, &freq_ms, &mode, &mode_ms, &width, + &width_ms); + if (144000000.0f >= freq && 148000000.0f <= freq) { + return ft857_get_pometer_level(rig, val, &rig->caps->rfpower_meter_cal, 2.0); + } + else if (420000000.0f >= freq && 450000000.0f <= freq) { + return ft857_get_pometer_level(rig, val, &rig->caps->rfpower_meter_cal, 5.0); + } return ft857_get_pometer_level(rig, val, &rig->caps->rfpower_meter_cal, 1.0); default: commit 069b0bf5b05d6a209204dd1354d3f9f0fd953411 Merge: 7719d0489 1e54e2476 Author: Michael Black <mdb...@ya...> Date: Mon Aug 12 06:40:39 2024 -0500 Merge branch 'master' into cbayer-857-pwr-levels-cal commit 1e54e2476757bcecc8091d4d4aae5bdc33307311 Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Aug 9 17:20:02 2024 -0500 Rename ctx10 unpack_frame to commradio_unpack_frame to avoid collision with freedv unpack_frame diff --git a/rigs/commradio/commradio.c b/rigs/commradio/commradio.c index 888db0f2c..c73c7b6fe 100644 --- a/rigs/commradio/commradio.c +++ b/rigs/commradio/commradio.c @@ -58,7 +58,7 @@ int commradio_transaction(RIG *rig, const unsigned char *cmd, int cmd_len, { goto transaction_quit; } - ret = unpack_frame(data, rx, ret); + ret = commradio_unpack_frame(data, rx, ret); if (ret < RIG_OK) { goto transaction_quit; diff --git a/rigs/commradio/ctx10.c b/rigs/commradio/ctx10.c index 1631a1664..fc411ee41 100644 --- a/rigs/commradio/ctx10.c +++ b/rigs/commradio/ctx10.c @@ -20,7 +20,7 @@ struct rig_caps ctx10_caps = RIG_MODEL(RIG_MODEL_CTX10), .model_name = "CTX-10", .mfg_name = "Commradio", - .version = "20240802.0", + .version = "20240809.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, diff --git a/rigs/commradio/frame.c b/rigs/commradio/frame.c index fc1756ab4..0bc44fd8a 100644 --- a/rigs/commradio/frame.c +++ b/rigs/commradio/frame.c @@ -104,7 +104,7 @@ int frame_message(unsigned char frame[], const unsigned char *data, return frame_len; } -int unpack_frame(unsigned char msg[], const unsigned char *frame, +int commradio_unpack_frame(unsigned char msg[], const unsigned char *frame, const int frame_len) { if (frame_len < 5) diff --git a/rigs/commradio/frame.h b/rigs/commradio/frame.h index 14458e412..56a7b177c 100644 --- a/rigs/commradio/frame.h +++ b/rigs/commradio/frame.h @@ -16,7 +16,7 @@ int frame_message(unsigned char frame[], const unsigned char *data, int data_len); -int unpack_frame(unsigned char msg[], const unsigned char *frame, int frame_len); +int commradio_unpack_frame(unsigned char msg[], const unsigned char *frame, int frame_len); #endif /* _FRAME_H */ commit 9e6af9e99d24cf3756232de70354ea27a7f3286c Merge: f3bd0bdf0 d3e191101 Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Aug 9 17:16:10 2024 -0500 xMerge branch 'master' of https://github.com/Hamlib/Hamlib commit f3bd0bdf0a2d80b0fe223885973d74156b794918 Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Aug 9 17:13:59 2024 -0500 Revert "export correct function for wsjtx" This reverts commit 4312b26bc9401fe0d98c181bbd90fc81c280c3dd. diff --git a/rigs/commradio/commradio.c b/rigs/commradio/commradio.c index 888db0f2c..c73c7b6fe 100644 --- a/rigs/commradio/commradio.c +++ b/rigs/commradio/commradio.c @@ -58,7 +58,7 @@ int commradio_transaction(RIG *rig, const unsigned char *cmd, int cmd_len, { goto transaction_quit; } - ret = unpack_frame(data, rx, ret); + ret = commradio_unpack_frame(data, rx, ret); if (ret < RIG_OK) { goto transaction_quit; diff --git a/rigs/commradio/ctx10.c b/rigs/commradio/ctx10.c index 1631a1664..fc411ee41 100644 --- a/rigs/commradio/ctx10.c +++ b/rigs/commradio/ctx10.c @@ -20,7 +20,7 @@ struct rig_caps ctx10_caps = RIG_MODEL(RIG_MODEL_CTX10), .model_name = "CTX-10", .mfg_name = "Commradio", - .version = "20240802.0", + .version = "20240809.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, diff --git a/rigs/commradio/frame.c b/rigs/commradio/frame.c index fc1756ab4..0bc44fd8a 100644 --- a/rigs/commradio/frame.c +++ b/rigs/commradio/frame.c @@ -104,7 +104,7 @@ int frame_message(unsigned char frame[], const unsigned char *data, return frame_len; } -int unpack_frame(unsigned char msg[], const unsigned char *frame, +int commradio_unpack_frame(unsigned char msg[], const unsigned char *frame, const int frame_len) { if (frame_len < 5) diff --git a/rigs/commradio/frame.h b/rigs/commradio/frame.h index 14458e412..56a7b177c 100644 --- a/rigs/commradio/frame.h +++ b/rigs/commradio/frame.h @@ -16,7 +16,7 @@ int frame_message(unsigned char frame[], const unsigned char *data, int data_len); -int unpack_frame(unsigned char msg[], const unsigned char *frame, int frame_len); +int commradio_unpack_frame(unsigned char msg[], const unsigned char *frame, int frame_len); #endif /* _FRAME_H */ commit d3e191101f3603cc534549cfa4dd952d118a9e35 Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Aug 9 11:43:28 2024 -0500 Revert "Merge pull request #1592 from chrbayer84/cbayer-857-pwr-levels-cal" This reverts commit 15dc3ae8be03814b708b744f4df19415918a90d3, reversing changes made to 3b1283496cdb89d3d43d0354216e8dfa0a8b8d00. diff --git a/rigs/yaesu/ft857.c b/rigs/yaesu/ft857.c index 1f1471ae4..8456e4811 100644 --- a/rigs/yaesu/ft857.c +++ b/rigs/yaesu/ft857.c @@ -225,19 +225,6 @@ enum ft857_digi FT857_DIGI_USER_U, }; -#define FT857_PWR_CAL { 9, \ - { \ - { 0x00, 0.0f }, \ - { 0x01, 10.0f }, \ - { 0x02, 15.0f }, \ - { 0x03, 20.0f }, \ - { 0x04, 34.0f }, \ - { 0x05, 50.0f }, \ - { 0x06, 66.0f }, \ - { 0x07, 82.f }, \ - { 0x08, 100.0f } \ - } } - #define FT857_ALL_RX_MODES (RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_USB|\ RIG_MODE_LSB|RIG_MODE_RTTY|RIG_MODE_FM|RIG_MODE_PKTUSB) #define FT857_SSB_CW_RX_MODES (RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_USB|RIG_MODE_LSB) @@ -276,7 +263,7 @@ struct rig_caps ft857_caps = .retry = 0, .has_get_func = RIG_FUNC_NONE, .has_set_func = RIG_FUNC_LOCK | RIG_FUNC_TONE | RIG_FUNC_TSQL | RIG_FUNC_CSQL | RIG_FUNC_RIT, - .has_get_level = RIG_LEVEL_STRENGTH | RIG_LEVEL_RFPOWER | RIG_LEVEL_RFPOWER_METER_WATTS, + .has_get_level = RIG_LEVEL_STRENGTH | RIG_LEVEL_RFPOWER, .has_set_level = RIG_LEVEL_BAND_SELECT, .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, @@ -367,7 +354,7 @@ struct rig_caps ft857_caps = // {RIG_MODE_WFM, kHz(230)}, /* ?? */ RIG_FLT_END, }, - .rfpower_meter_cal = FT857_PWR_CAL, + .rig_init = ft857_init, .rig_cleanup = ft857_cleanup, .rig_open = ft857_open, @@ -854,7 +841,7 @@ int ft857_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt) return RIG_OK; } -static int ft857_get_pometer_level(RIG *rig, value_t *val, const cal_table_float_t *cal, float divider) +static int ft857_get_pometer_level(RIG *rig, value_t *val) { struct ft857_priv_data *p = (struct ft857_priv_data *) STATE(rig)->priv; rig_debug(RIG_DEBUG_VERBOSE, "%s: called \n", __func__); @@ -874,7 +861,7 @@ static int ft857_get_pometer_level(RIG *rig, value_t *val, const cal_table_float { rig_debug(RIG_DEBUG_TRACE, "%s: bars=%d\n", __func__, p->tx_status & 0x0F); // does rig have 10 bars or 15? - val->f = (p->tx_status & 0x0F) / divider; + val->f = (p->tx_status & 0x0F) / 10.0; } else { @@ -915,23 +902,8 @@ int ft857_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) return ft857_get_smeter_level(rig, val); case RIG_LEVEL_RFPOWER: - if (144000000 >= vfo && 148000000 <= vfo) { - return ft857_get_pometer_level(rig, val, &rig->caps->rfpower_meter_cal, 2.0); - } - else if (420000000 >= vfo && 450000000 <= vfo) { - return ft857_get_pometer_level(rig, val, &rig->caps->rfpower_meter_cal, 5.0); - } - return ft857_get_pometer_level(rig, val, &rig->caps->rfpower_meter_cal, 1.0); - - case RIG_LEVEL_RFPOWER_METER_WATTS: - if (144000000 >= vfo && 148000000 <= vfo) { - return ft857_get_pometer_level(rig, val, &rig->caps->rfpower_meter_cal, 2.0); - } - else if (420000000 >= vfo && 450000000 <= vfo) { - return ft857_get_pometer_level(rig, val, &rig->caps->rfpower_meter_cal, 5.0); - } - return ft857_get_pometer_level(rig, val, &rig->caps->rfpower_meter_cal, 1.0); - + return ft857_get_pometer_level(rig, val); + default: return -RIG_EINVAL; } commit 8975643aaa67b41d2d3dfeb330055544426625db Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Aug 9 11:41:44 2024 -0500 Revert "Merge pull request #1592 from chrbayer84/cbayer-857-pwr-levels-cal" This reverts commit 15dc3ae8be03814b708b744f4df19415918a90d3, reversing changes made to 3b1283496cdb89d3d43d0354216e8dfa0a8b8d00. diff --git a/rigs/yaesu/ft857.c b/rigs/yaesu/ft857.c index 1f1471ae4..8456e4811 100644 --- a/rigs/yaesu/ft857.c +++ b/rigs/yaesu/ft857.c @@ -225,19 +225,6 @@ enum ft857_digi FT857_DIGI_USER_U, }; -#define FT857_PWR_CAL { 9, \ - { \ - { 0x00, 0.0f }, \ - { 0x01, 10.0f }, \ - { 0x02, 15.0f }, \ - { 0x03, 20.0f }, \ - { 0x04, 34.0f }, \ - { 0x05, 50.0f }, \ - { 0x06, 66.0f }, \ - { 0x07, 82.f }, \ - { 0x08, 100.0f } \ - } } - #define FT857_ALL_RX_MODES (RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_USB|\ RIG_MODE_LSB|RIG_MODE_RTTY|RIG_MODE_FM|RIG_MODE_PKTUSB) #define FT857_SSB_CW_RX_MODES (RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_USB|RIG_MODE_LSB) @@ -276,7 +263,7 @@ struct rig_caps ft857_caps = .retry = 0, .has_get_func = RIG_FUNC_NONE, .has_set_func = RIG_FUNC_LOCK | RIG_FUNC_TONE | RIG_FUNC_TSQL | RIG_FUNC_CSQL | RIG_FUNC_RIT, - .has_get_level = RIG_LEVEL_STRENGTH | RIG_LEVEL_RFPOWER | RIG_LEVEL_RFPOWER_METER_WATTS, + .has_get_level = RIG_LEVEL_STRENGTH | RIG_LEVEL_RFPOWER, .has_set_level = RIG_LEVEL_BAND_SELECT, .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, @@ -367,7 +354,7 @@ struct rig_caps ft857_caps = // {RIG_MODE_WFM, kHz(230)}, /* ?? */ RIG_FLT_END, }, - .rfpower_meter_cal = FT857_PWR_CAL, + .rig_init = ft857_init, .rig_cleanup = ft857_cleanup, .rig_open = ft857_open, @@ -854,7 +841,7 @@ int ft857_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt) return RIG_OK; } -static int ft857_get_pometer_level(RIG *rig, value_t *val, const cal_table_float_t *cal, float divider) +static int ft857_get_pometer_level(RIG *rig, value_t *val) { struct ft857_priv_data *p = (struct ft857_priv_data *) STATE(rig)->priv; rig_debug(RIG_DEBUG_VERBOSE, "%s: called \n", __func__); @@ -874,7 +861,7 @@ static int ft857_get_pometer_level(RIG *rig, value_t *val, const cal_table_float { rig_debug(RIG_DEBUG_TRACE, "%s: bars=%d\n", __func__, p->tx_status & 0x0F); // does rig have 10 bars or 15? - val->f = (p->tx_status & 0x0F) / divider; + val->f = (p->tx_status & 0x0F) / 10.0; } else { @@ -915,23 +902,8 @@ int ft857_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) return ft857_get_smeter_level(rig, val); case RIG_LEVEL_RFPOWER: - if (144000000 >= vfo && 148000000 <= vfo) { - return ft857_get_pometer_level(rig, val, &rig->caps->rfpower_meter_cal, 2.0); - } - else if (420000000 >= vfo && 450000000 <= vfo) { - return ft857_get_pometer_level(rig, val, &rig->caps->rfpower_meter_cal, 5.0); - } - return ft857_get_pometer_level(rig, val, &rig->caps->rfpower_meter_cal, 1.0); - - case RIG_LEVEL_RFPOWER_METER_WATTS: - if (144000000 >= vfo && 148000000 <= vfo) { - return ft857_get_pometer_level(rig, val, &rig->caps->rfpower_meter_cal, 2.0); - } - else if (420000000 >= vfo && 450000000 <= vfo) { - return ft857_get_pometer_level(rig, val, &rig->caps->rfpower_meter_cal, 5.0); - } - return ft857_get_pometer_level(rig, val, &rig->caps->rfpower_meter_cal, 1.0); - + return ft857_get_pometer_level(rig, val); + default: return -RIG_EINVAL; } commit 437334818fbe70d9338352b0abdb50d54810f415 Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Aug 9 11:40:38 2024 -0500 Revert "Abort multicast routine when UDP errors occur" This reverts commit 3b1283496cdb89d3d43d0354216e8dfa0a8b8d00. diff --git a/src/network.c b/src/network.c index 17183cf79..87c07cad8 100644 --- a/src/network.c +++ b/src/network.c @@ -1093,7 +1093,6 @@ void *multicast_publisher(void *arg) "%s: error sending UDP packet: %s\n", __func__, strerror(errno)); flag = 1; - break; // we'll just quit this routine for now -- debug in the future } } } commit 7719d048977acb035aabb6eca8c5d39c385fcb3b Author: Christian Bayer <chr...@sa...> Date: Fri Aug 9 16:32:28 2024 +0200 disable scaling diff --git a/rigs/yaesu/ft857.c b/rigs/yaesu/ft857.c index d931c261f..5fb502c09 100644 --- a/rigs/yaesu/ft857.c +++ b/rigs/yaesu/ft857.c @@ -916,21 +916,13 @@ int ft857_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) return ft857_get_smeter_level(rig, val); case RIG_LEVEL_RFPOWER: - if (144000000 >= vfo && 148000000 <= vfo) { - return ft857_get_pometer_level(rig, val, &rig->caps->rfpower_meter_cal, 2.0); - } - else if (420000000 >= vfo && 450000000 <= vfo) { - return ft857_get_pometer_level(rig, val, &rig->caps->rfpower_meter_cal, 5.0); - } - return ft857_get_pometer_level(rig, val, &rig->caps->rfpower_meter_cal, 1.0); - case RIG_LEVEL_RFPOWER_METER_WATTS: - if (144000000 >= vfo && 148000000 <= vfo) { - return ft857_get_pometer_level(rig, val, &rig->caps->rfpower_meter_cal, 4.0); - } - else if (420000000 >= vfo && 450000000 <= vfo) { - return ft857_get_pometer_level(rig, val, &rig->caps->rfpower_meter_cal, 5.0); - } + // if (144000000 >= vfo && 148000000 <= vfo) { + // return ft857_get_pometer_level(rig, val, &rig->caps->rfpower_meter_cal, 2.0); + // } + // else if (420000000 >= vfo && 450000000 <= vfo) { + // return ft857_get_pometer_level(rig, val, &rig->caps->rfpower_meter_cal, 5.0); + // } return ft857_get_pometer_level(rig, val, &rig->caps->rfpower_meter_cal, 1.0); default: commit 4c52f81e32c47844d4bb2a3b9864c12582088c65 Author: Christian Bayer <chr...@sa...> Date: Fri Aug 9 14:53:36 2024 +0200 divider update diff --git a/rigs/yaesu/ft857.c b/rigs/yaesu/ft857.c index 8f8d3d477..d931c261f 100644 --- a/rigs/yaesu/ft857.c +++ b/rigs/yaesu/ft857.c @@ -926,7 +926,7 @@ int ft857_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) case RIG_LEVEL_RFPOWER_METER_WATTS: if (144000000 >= vfo && 148000000 <= vfo) { - return ft857_get_pometer_level(rig, val, &rig->caps->rfpower_meter_cal, 2.0); + return ft857_get_pometer_level(rig, val, &rig->caps->rfpower_meter_cal, 4.0); } else if (420000000 >= vfo && 450000000 <= vfo) { return ft857_get_pometer_level(rig, val, &rig->caps->rfpower_meter_cal, 5.0); commit 24b47951b25443abfd43bc0f9725bcfd4031d9d1 Author: Christian Bayer <chr...@sa...> Date: Fri Aug 9 14:34:36 2024 +0200 use correct value diff --git a/rigs/yaesu/ft857.c b/rigs/yaesu/ft857.c index abe7bf7cc..8f8d3d477 100644 --- a/rigs/yaesu/ft857.c +++ b/rigs/yaesu/ft857.c @@ -875,7 +875,7 @@ static int ft857_get_pometer_level(RIG *rig, value_t *val, const cal_table_float { rig_debug(RIG_DEBUG_TRACE, "%s: bars=%d\n", __func__, p->tx_status & 0x0F); // does rig have 10 bars or 15? - val->f = rig_raw2val_float(*val, cal)/divider; + val->f = rig_raw2val_float(p->tx_status & 0x0F, cal)/divider; } else { commit e63014a23f0fdcda5ad8a6bff9246489d9c8a358 Author: Christian Bayer <chr...@go...> Date: Fri Aug 9 08:32:14 2024 -0400 added header diff --git a/rigs/yaesu/ft857.c b/rigs/yaesu/ft857.c index 24c6dff59..abe7bf7cc 100644 --- a/rigs/yaesu/ft857.c +++ b/rigs/yaesu/ft857.c @@ -65,6 +65,7 @@ #include "misc.h" #include "tones.h" #include "bandplan.h" +#include "cal.h" enum ft857_native_cmd_e { commit faee30ebd9c53b134947190e78bba469962020c4 Author: Christian Bayer <chr...@sa...> Date: Fri Aug 9 14:19:01 2024 +0200 fixed cal table conversion diff --git a/rigs/yaesu/ft857.c b/rigs/yaesu/ft857.c index 1f1471ae4..24c6dff59 100644 --- a/rigs/yaesu/ft857.c +++ b/rigs/yaesu/ft857.c @@ -874,7 +874,7 @@ static int ft857_get_pometer_level(RIG *rig, value_t *val, const cal_table_float { rig_debug(RIG_DEBUG_TRACE, "%s: bars=%d\n", __func__, p->tx_status & 0x0F); // does rig have 10 bars or 15? - val->f = (p->tx_status & 0x0F) / divider; + val->f = rig_raw2val_float(*val, cal)/divider; } else { commit 15dc3ae8be03814b708b744f4df19415918a90d3 Merge: 3b1283496 4312b26bc Author: Michael Black <mdb...@ya...> Date: Fri Aug 9 07:08:09 2024 -0500 Merge pull request #1592 from chrbayer84/cbayer-857-pwr-levels-cal Untested: ft-857 power levels for 2m/70cm commit 4312b26bc9401fe0d98c181bbd90fc81c280c3dd Author: Christian Bayer <chr...@go...> Date: Fri Aug 9 07:15:20 2024 -0400 export correct function for wsjtx diff --git a/rigs/yaesu/ft857.c b/rigs/yaesu/ft857.c index afa50d19c..1f1471ae4 100644 --- a/rigs/yaesu/ft857.c +++ b/rigs/yaesu/ft857.c @@ -276,7 +276,7 @@ struct rig_caps ft857_caps = .retry = 0, .has_get_func = RIG_FUNC_NONE, .has_set_func = RIG_FUNC_LOCK | RIG_FUNC_TONE | RIG_FUNC_TSQL | RIG_FUNC_CSQL | RIG_FUNC_RIT, - .has_get_level = RIG_LEVEL_STRENGTH | RIG_LEVEL_RFPOWER, + .has_get_level = RIG_LEVEL_STRENGTH | RIG_LEVEL_RFPOWER | RIG_LEVEL_RFPOWER_METER_WATTS, .has_set_level = RIG_LEVEL_BAND_SELECT, .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, @@ -915,14 +915,23 @@ int ft857_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) return ft857_get_smeter_level(rig, val); case RIG_LEVEL_RFPOWER: - if (144000000 >= vfo && 148000000 <= vfo) { - return ft857_get_pometer_level(rig, val, &rig->caps->rfpower_meter_cal, 2.0); - } - else if (420000000 >= vfo && 450000000 <= vfo) { - return ft857_get_pometer_level(rig, val, &rig->caps->rfpower_meter_cal, 5.0); - } + if (144000000 >= vfo && 148000000 <= vfo) { + return ft857_get_pometer_level(rig, val, &rig->caps->rfpower_meter_cal, 2.0); + } + else if (420000000 >= vfo && 450000000 <= vfo) { + return ft857_get_pometer_level(rig, val, &rig->caps->rfpower_meter_cal, 5.0); + } return ft857_get_pometer_level(rig, val, &rig->caps->rfpower_meter_cal, 1.0); - + + case RIG_LEVEL_RFPOWER_METER_WATTS: + if (144000000 >= vfo && 148000000 <= vfo) { + return ft857_get_pometer_level(rig, val, &rig->caps->rfpower_meter_cal, 2.0); + } + else if (420000000 >= vfo && 450000000 <= vfo) { + return ft857_get_pometer_level(rig, val, &rig->caps->rfpower_meter_cal, 5.0); + } + return ft857_get_pometer_level(rig, val, &rig->caps->rfpower_meter_cal, 1.0); + default: return -RIG_EINVAL; } commit 63acc6e6c24050ca289285ae6447723de1891b61 Merge: 3e8b1d7a9 3b1283496 Author: chrbayer84 <chr...@gm...> Date: Fri Aug 9 04:11:37 2024 -0400 Merge branch 'Hamlib:master' into cbayer-857-pwr-levels-cal commit 3e8b1d7a94c7366d7c14fa9bd4d0db86ff1c8dc0 Author: Christian Bayer <chr...@sa...> Date: Fri Aug 9 10:10:40 2024 +0200 ft-857 power levels for 2m/70cm diff --git a/rigs/yaesu/ft857.c b/rigs/yaesu/ft857.c index 8456e4811..afa50d19c 100644 --- a/rigs/yaesu/ft857.c +++ b/rigs/yaesu/ft857.c @@ -225,6 +225,19 @@ enum ft857_digi FT857_DIGI_USER_U, }; +#define FT857_PWR_CAL { 9, \ + { \ + { 0x00, 0.0f }, \ + { 0x01, 10.0f }, \ + { 0x02, 15.0f }, \ + { 0x03, 20.0f }, \ + { 0x04, 34.0f }, \ + { 0x05, 50.0f }, \ + { 0x06, 66.0f }, \ + { 0x07, 82.f }, \ + { 0x08, 100.0f } \ + } } + #define FT857_ALL_RX_MODES (RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_USB|\ RIG_MODE_LSB|RIG_MODE_RTTY|RIG_MODE_FM|RIG_MODE_PKTUSB) #define FT857_SSB_CW_RX_MODES (RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_USB|RIG_MODE_LSB) @@ -354,7 +367,7 @@ struct rig_caps ft857_caps = // {RIG_MODE_WFM, kHz(230)}, /* ?? */ RIG_FLT_END, }, - + .rfpower_meter_cal = FT857_PWR_CAL, .rig_init = ft857_init, .rig_cleanup = ft857_cleanup, ... [truncated message content] |