[Hamlib-commits] Hamlib -- Ham radio control libraries branch master updated. 79f8b1cde83cf35b1cd30
Library to control radio transceivers and receivers
Brought to you by:
n0nb
From: n0nb <n0...@us...> - 2025-07-23 03:24:00
|
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 79f8b1cde83cf35b1cd30e67ab8f26fd1137b650 (commit) via 8bcfeda94ad7e8d0160e80b0ac67423f5b583567 (commit) via 47dae3879d95b1b68dccfba4c0e5757bdcdf38eb (commit) via 8469ee1737ba8ab1191a12b5b0788bf6c666c527 (commit) via 062f260c073707d18878f5be755800a894c04058 (commit) via debcc2f565349a4ced8527dc9184a6d70d6a006c (commit) from 83ba4eb27fcde29a5e47fb102f805a6c24693388 (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 79f8b1cde83cf35b1cd30e67ab8f26fd1137b650 Merge: 83ba4eb27 8bcfeda94 Author: Nate Bargmann <n0...@n0...> Date: Tue Jul 22 22:11:06 2025 -0500 Merge HitHub PR #1811 diff --cc src/sleep.c index 1155065af,98c190b10..02507bb09 --- a/src/sleep.c +++ b/src/sleep.c @@@ -35,9 -35,10 +35,9 @@@ * \note parameters are same as man page for each * */ + #include "hamlib/config.h" #include <unistd.h> -#include <errno.h> #include <pthread.h> - #include "hamlib/config.h" #include "sleep.h" #ifdef __cplusplus commit 8bcfeda94ad7e8d0160e80b0ac67423f5b583567 Author: George Baltz N3GB <Geo...@gm...> Date: Tue Jul 22 11:28:37 2025 -0400 Don't forget the noise diff --git a/bindings/python/test_Hamlib_class.py b/bindings/python/test_Hamlib_class.py index 2f09aac97..98f767f7e 100755 --- a/bindings/python/test_Hamlib_class.py +++ b/bindings/python/test_Hamlib_class.py @@ -674,6 +674,7 @@ class TestClass: 'RIG_MODEL_G315', 'RIG_MODEL_G90', 'RIG_MODEL_GNURADIO', +'RIG_MODEL_GQRX', 'RIG_MODEL_GRAUDIO', 'RIG_MODEL_GRAUDIOIQ', 'RIG_MODEL_GS100', @@ -930,7 +931,6 @@ class TestClass: 'RIG_MODE_AM', 'RIG_MODE_AMN', 'RIG_MODE_AMS', -'RIG_MODE_BIT46', 'RIG_MODE_BIT47', 'RIG_MODE_BIT48', 'RIG_MODE_BIT49', @@ -994,6 +994,7 @@ class TestClass: 'RIG_MODE_USBD2', 'RIG_MODE_USBD3', 'RIG_MODE_WFM', +'RIG_MODE_WFMS', 'RIG_MTYPE_BAND', 'RIG_MTYPE_CALL', 'RIG_MTYPE_EDGE', commit 47dae3879d95b1b68dccfba4c0e5757bdcdf38eb Author: George Baltz N3GB <Geo...@gm...> Date: Tue Jul 22 11:07:33 2025 -0400 Fix compiler errors with strict C23 standards Fix missing/misplaced '#include "config.h"' statements. Fixes missing function prototypes, unknown type definitions, etc. Allows configuration of GCC with CFLAGS="-std=c23" instead of using default -std=gnu23. Don't know about CLANG, MSVC, MinGW, etc, but using gwb@stitch:~> gcc --version gcc (SUSE Linux) 15.1.1 20250714 Copyright (C) 2025 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Hamlib can compile in strict C23 mode, or previous standard levels. diff --git a/lib/precise_time.c b/lib/precise_time.c index 763caadb3..7639a7a26 100644 --- a/lib/precise_time.c +++ b/lib/precise_time.c @@ -20,6 +20,7 @@ // along with fldigi. If not, see <http://www.gnu.org/licenses/>. // --------------------------------------------------------------------- +#include "config.h" #include <errno.h> #include <time.h> #include <sys/time.h> diff --git a/rigs/barrett/barrett.c b/rigs/barrett/barrett.c index 17756ebcb..1aaf7a92d 100644 --- a/rigs/barrett/barrett.c +++ b/rigs/barrett/barrett.c @@ -19,6 +19,7 @@ * */ +#include "config.h" #include <stdio.h> #include <stdlib.h> #include <string.h> diff --git a/rigs/dummy/dummy.c b/rigs/dummy/dummy.c index 948bb89aa..a7006792f 100644 --- a/rigs/dummy/dummy.c +++ b/rigs/dummy/dummy.c @@ -20,6 +20,7 @@ * */ +#include "config.h" // cppcheck-suppress * #include <stdint.h> // cppcheck-suppress * diff --git a/rigs/dummy/flrig.c b/rigs/dummy/flrig.c index 4ee7b3de6..dd17395e8 100644 --- a/rigs/dummy/flrig.c +++ b/rigs/dummy/flrig.c @@ -20,6 +20,7 @@ * */ +#include "config.h" #include <stdio.h> #include <stdlib.h> #include <string.h> /* String function definitions */ diff --git a/rigs/dummy/netrigctl.c b/rigs/dummy/netrigctl.c index 382f5f039..d4b833d96 100644 --- a/rigs/dummy/netrigctl.c +++ b/rigs/dummy/netrigctl.c @@ -19,6 +19,7 @@ * */ +#include "config.h" #include <stdio.h> #include <stdlib.h> #include <string.h> /* String function definitions */ diff --git a/rigs/dummy/quisk.c b/rigs/dummy/quisk.c index c3fb30b0e..f240177b5 100644 --- a/rigs/dummy/quisk.c +++ b/rigs/dummy/quisk.c @@ -19,6 +19,7 @@ * */ +#include "config.h" #include <stdio.h> #include <stdlib.h> #include <string.h> /* String function definitions */ diff --git a/rigs/dummy/tci1x.c b/rigs/dummy/tci1x.c index cf9123c7b..984114b75 100644 --- a/rigs/dummy/tci1x.c +++ b/rigs/dummy/tci1x.c @@ -19,6 +19,7 @@ * */ +#include "config.h" #include <stdio.h> #include <stdlib.h> #include <string.h> /* String function definitions */ diff --git a/rigs/dummy/trxmanager.c b/rigs/dummy/trxmanager.c index e9790e4d2..1c320b221 100644 --- a/rigs/dummy/trxmanager.c +++ b/rigs/dummy/trxmanager.c @@ -20,6 +20,7 @@ * */ +#include "config.h" #include <stdio.h> #include <stdlib.h> #include <string.h> /* String function definitions */ diff --git a/security/AESStringCrypt.c b/security/AESStringCrypt.c index eacc750bd..908b1ab41 100644 --- a/security/AESStringCrypt.c +++ b/security/AESStringCrypt.c @@ -28,6 +28,7 @@ * BUT NOT LIMITED TO, LOSS OF DATA OR DATA BEING RENDERED INACCURATE. */ +#include "config.h" #include <stdio.h> #include <string.h> diff --git a/src/sleep.c b/src/sleep.c index 00a29e2d0..98c190b10 100644 --- a/src/sleep.c +++ b/src/sleep.c @@ -35,10 +35,10 @@ * \note parameters are same as man page for each * */ +#include "hamlib/config.h" #include <unistd.h> #include <errno.h> #include <pthread.h> -#include "hamlib/config.h" #include "sleep.h" #ifdef __cplusplus diff --git a/tests/rigtestmcastrx.c b/tests/rigtestmcastrx.c index fdc2b6596..e6a5d723f 100644 --- a/tests/rigtestmcastrx.c +++ b/tests/rigtestmcastrx.c @@ -1,3 +1,4 @@ +#include "config.h" #include <stdio.h> #include <stdlib.h> #include <string.h> commit 8469ee1737ba8ab1191a12b5b0788bf6c666c527 Author: George Baltz N3GB <Geo...@gm...> Date: Sun Jul 20 16:28:56 2025 -0400 Fix incorrect fallthroughs Found with -Wimplicit-fallthrough, but also many false positives diff --git a/rigs/dummy/dummy.c b/rigs/dummy/dummy.c index 0d59308d9..948bb89aa 100644 --- a/rigs/dummy/dummy.c +++ b/rigs/dummy/dummy.c @@ -712,6 +712,9 @@ static int dummy_set_vfo(RIG *rig, vfo_t vfo) priv->curr = &priv->mem[curr->channel_num]; break; } + rig_debug(RIG_DEBUG_ERR, "%s: invalid memory channel %d\n", __func__, + curr->channel_num); + RETURNFUNC(-RIG_EINVAL); case RIG_VFO_TX: if (priv->tx_vfo == RIG_VFO_A) { priv->curr = &priv->vfo_maina; } diff --git a/rigs/rs/xk852.c b/rigs/rs/xk852.c index 1b1b1a637..f4aee5555 100644 --- a/rigs/rs/xk852.c +++ b/rigs/rs/xk852.c @@ -334,47 +334,46 @@ xk852_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) { case XK852_NOISE_BLANK_OFF: val->f = 1; - return RIG_OK; break; case XK852_NOISE_BLANK_ON: val->f = 0; - return RIG_OK; - break; + } + return RIG_OK; + case RIG_LEVEL_RFPOWER: switch (state.op_mode) { case XK852_OP_MODE_OFF: val->f = 0; - return RIG_OK; break; case XK852_OP_MODE_RX: val->f = 0; - return RIG_OK; break; case XK852_OP_MODE_TX_LOW: val->f = 0.099; - return RIG_OK; break; case XK852_OP_MODE_TX_MID: val->f = 0.499; - return RIG_OK; break; case XK852_OP_MODE_TX_FULL: val->f = 1; - return RIG_OK; break; + + default: + return -RIG_EINVAL; + } + return RIG_OK; default: return -RIG_ENIMPL; - break; } return -RIG_EINVAL; commit 062f260c073707d18878f5be755800a894c04058 Author: George Baltz N3GB <Geo...@gm...> Date: Sat Jul 19 15:31:02 2025 -0400 Clean up some cppcheck gripes in simulators/ diff --git a/simulators/simpstrotator.c b/simulators/simpstrotator.c index 1b1454116..74e7cd01a 100644 --- a/simulators/simpstrotator.c +++ b/simulators/simpstrotator.c @@ -8,7 +8,7 @@ #define REPLY_PORT 12002 #define BUFFER_SIZE 1024 -void handle_receive(int recv_sockfd, struct sockaddr_in *client_addr, +static void handle_receive(int recv_sockfd, struct sockaddr_in *client_addr, socklen_t addr_len, char *buffer) { ssize_t recv_len; @@ -28,7 +28,7 @@ void handle_receive(int recv_sockfd, struct sockaddr_in *client_addr, printf("Data: %s\n", buffer); } -void handle_send(int send_sockfd, struct sockaddr_in *client_addr, +static void handle_send(int send_sockfd, struct sockaddr_in *client_addr, socklen_t addr_len, const char *message) { ssize_t sent_len; diff --git a/simulators/simts890.c b/simulators/simts890.c index 7d9120669..b39a40db7 100644 --- a/simulators/simts890.c +++ b/simulators/simts890.c @@ -123,7 +123,7 @@ int tfset = 0; typedef struct kvfo { int freq; - int mode; + unsigned int mode; short band, vfo; // Redundant, but useful for relative movement } *kvfop_t; @@ -267,8 +267,8 @@ getmyline(int fd, char *buf) if (retval != 0) { perror("read failed:"); - close(fd); - fd = openPort(""); + //close(fd); + //fd = openPort(""); } if (strlen(buf) == 0) { hl_usleep(10 * 1000); } @@ -588,7 +588,8 @@ int main(int argc, char *argv[]) else if (strncmp(buf, "SF", 2) == 0) { // Sets and Reads the VFO (Frequency and Mode) - int tmpvfo, tmpfreq, tmpmode, newband; + int tmpvfo, tmpfreq, newband; + unsigned int tmpmode; kvfop_t ovfo, nvfo; if (sscanf(buf, SFformat, &tmpvfo, &tmpfreq, &tmpmode) != 3 || tmpvfo < 0 @@ -599,7 +600,7 @@ int main(int argc, char *argv[]) continue; } - //printf("tmpvfo=%d, tmpfreq=%d, tmpmode=%d\n", tmpvfo, tmpfreq, tmpmode); + //printf("tmpvfo=%d, tmpfreq=%d, tmpmode=%u\n", tmpvfo, tmpfreq, tmpmode); ovfo = *vfoAB[tmpvfo]; newband = freq2band(tmpfreq); @@ -1251,10 +1252,10 @@ int main(int argc, char *argv[]) case '0': // Get/Set Local clock { time_t t; - struct tm *localtm; if (buf[3] == ';') { + const struct tm *localtm; t = time(NULL); localtm = localtime(&t); strftime(&buf[3], BUFSIZ - 3, "%y%m%d%H%M%S;", localtm); diff --git a/simulators/simts990.c b/simulators/simts990.c index 84b4d7c82..c39ba49ac 100644 --- a/simulators/simts990.c +++ b/simulators/simts990.c @@ -116,8 +116,8 @@ getmyline(int fd, char *buf) if (retval != 0) { perror("read failed:"); - close(fd); - fd = openPort(""); + //close(fd); + //fd = openPort(""); } if (strlen(buf) == 0) { hl_usleep(10 * 1000); } commit debcc2f565349a4ced8527dc9184a6d70d6a006c Author: George Baltz N3GB <Geo...@gm...> Date: Sun Jul 13 20:45:49 2025 -0400 Clean up simft847.c At least make get/set freq and mode work. diff --git a/simulators/simft847.c b/simulators/simft847.c index d73bea1a5..91d031c12 100644 --- a/simulators/simft847.c +++ b/simulators/simft847.c @@ -13,18 +13,19 @@ struct ip_mreq #include <fcntl.h> #include <string.h> #include <unistd.h> -#include "../include/hamlib/rig.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'; +/* In hono(u)r of the 10Hz resolution of the FT-847, vfo frequencies + * are stored in decaHertz(daHz) + */ +int freqs[4] = {1407400, 43510000, 43720000, 0}; +int modes[4] = {0x01, 0x02, 0x02, 0}; +char *vfoNames[4] = {"Main", "SAT Rx", "SAT Tx", "Bogus"}; int width_main = 500; int width_sub = 700; +int vfo; int @@ -89,7 +90,7 @@ int openPort(char *comport) // doesn't matter for using pts devices int main(int argc, char *argv[]) { unsigned char buf[256]; - int n; + int freq, i, n; again: @@ -109,6 +110,7 @@ again: { printf("Not 5 bytes? bytes=%d\n", bytes); } + n = 0; switch (buf[4]) { @@ -120,7 +122,11 @@ again: case 0x88: printf("PTT OFF\n"); break; - case 0x07: printf("MODE\n"); break; + case 0x07: + case 0x17: + case 0x27: + modes[(buf[4] & 0x30) >> 4] = buf[0]; + printf("MODE\n"); break; case 0x05: printf("CLAR ON\n"); break; @@ -148,13 +154,33 @@ again: case 0xF7: printf("READ TX STATUS\n"); break; + case 0x01: + case 0x11: + case 0x21: + freq = 0; + for (i = 0; i < 4; i++) + { + freq = freq * 100 + (((buf[i] & 0xf0) * 5) / 8) + (buf[i] & 0x0f); + } + freqs[(buf[4] & 0x30) >> 4] = freq; + printf("FREQ SET = %d\n", freq * 10); + break; + case 0x03: + case 0x13: + case 0x23: printf("READ RX STATUS\n"); - buf[0] = 0x01; - buf[1] = 0x40; - buf[2] = 0x74; - buf[3] = 0x00; - buf[4] = 0x03; n = write(fd, buf, 5); + vfo = (buf[4] & 0x30) >> 4; + freq = freqs[vfo]; + for (i = 3; i >= 0; i--) + { + buf[i] = freq % 10; + freq /= 10; + buf[i] += (freq % 10) << 4; + freq /= 10; + } + buf[4] = modes[vfo]; + n = write(fd, buf, 5); break; case 0xbb: buf[0] = buf[1] = 0; printf("READ EPROM\n"); n = write(fd, buf, 2); @@ -162,6 +188,7 @@ again: default: printf("Unknown cmd=%02x\n", buf[4]); } + if (n < 0) {printf("Write failed - n = %d\n", n); } } return 0; ----------------------------------------------------------------------- Summary of changes: lib/precise_time.c | 1 + rigs/barrett/barrett.c | 1 + rigs/dummy/dummy.c | 4 ++++ rigs/dummy/flrig.c | 1 + rigs/dummy/netrigctl.c | 1 + rigs/dummy/quisk.c | 1 + rigs/dummy/tci1x.c | 1 + rigs/dummy/trxmanager.c | 1 + rigs/rs/xk852.c | 17 +++++++------- security/AESStringCrypt.c | 1 + simulators/simft847.c | 55 ++++++++++++++++++++++++++++++++++------------ simulators/simpstrotator.c | 4 ++-- simulators/simts890.c | 13 ++++++----- simulators/simts990.c | 4 ++-- src/sleep.c | 2 +- tests/rigtestmcastrx.c | 1 + 16 files changed, 74 insertions(+), 34 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |