[Hamlib-commits] Hamlib -- Ham radio control libraries branch master updated. fd68f3874353e415a7b17
Library to control radio transceivers and receivers
Brought to you by:
n0nb
From: n0nb <n0...@us...> - 2025-09-18 01:39:44
|
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 fd68f3874353e415a7b177f45379a75bb656909b (commit) via 409949194e710698328469be7c5700c8f9c869ec (commit) via 4e6bcb11c9e7c4c217648fa0fa7a9cf206fd75d1 (commit) via 25a7c25a0f784ff2333ebb19775c56b1bbafeb6a (commit) via 8cb93e4b9c652bd9e45a1e348ddc559f76a21f37 (commit) via ee7d43fcf2119ace850269653ea68c699d86ebab (commit) via 00fb4bba71bdb93fa72f296f96819725d6ae77f8 (commit) via 5f845e92cbd3b41c31709b25cf6a34194824ca9d (commit) via 11ca4382224129734ce5244dd83758ed30865f9a (commit) via 7e572fcdd004b02f0f15972e90d21d25569c9ccd (commit) via f7a127dbdc42a700bb21518eba93e476dd6d42e6 (commit) from 2a01ecdc5d6ca848502397043f01058aa9af76ef (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 fd68f3874353e415a7b177f45379a75bb656909b Merge: 2a01ecdc5 409949194 Author: Nate Bargmann <n0...@n0...> Date: Wed Sep 17 20:12:20 2025 -0500 Merge GitHub PR #1914 commit 409949194e710698328469be7c5700c8f9c869ec Author: George Baltz N3GB <Geo...@gm...> Date: Wed Sep 17 21:08:30 2025 -0400 Once more into the breech... diff --git a/tests/Makefile.am b/tests/Makefile.am index 6a01d8684..f32952bc8 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -16,7 +16,7 @@ DISTCLEANFILES = rigctl.log rigctl.sum testbcd.log testbcd.sum bin_PROGRAMS = rigctl rigctld rigmem rigsmtr rigswr rotctl rotctld rigctlcom rigctltcp rigctlsync ampctl ampctld rigtestmcast rigtestmcastrx $(TESTLIBUSB) rigfreqwalk -check_PROGRAMS = dumpmem testrig testrigopen testrigcaps testtrn testbcd testfreq listrigs testloc rig_bench testcache cachetest cachetest2 testcookie testgrid hamlibmodels testmW2power test2038 +check_PROGRAMS = dumpmem testrig testrigopen testrigcaps testbcd testfreq listrigs testloc rig_bench testcache cachetest cachetest2 testcookie testgrid hamlibmodels testmW2power test2038 # Document building testsecurity ### check_PROGRAMS += testsecurity diff --git a/tests/README b/tests/README index 407aba27a..36cef9d30 100644 --- a/tests/README +++ b/tests/README @@ -28,7 +28,6 @@ rigmatrix - Output the HTML table of supported rigs, with .png files for freqs testbcd - Simple program to test BCD conversion, takes a number as arg. testfreq - Simple program to test Freq conversion, takes a number as arg. testrig - Sample program calling common API calls, uses rig_probe -testtrn - Sample program using event notification (transceive mode) rigctl - Combined tool to execute any call of the API, see man page rigmem - Combined tool to load/save content of rig memory, see man page rotctl - Similar to 'rigctl' but for rotators, see man page diff --git a/tests/testtrn.c b/tests/testtrn.c deleted file mode 100644 index b0330955a..000000000 --- a/tests/testtrn.c +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Hamlib sample program to test transceive mode (async event) - */ - -#include <stdio.h> -#include <string.h> -#include <unistd.h> -#include <stdlib.h> - -#include "hamlib/rig.h" - -#include "hamlib/config.h" - -#define SERIAL_PORT "/dev/ttyS0" - - -static int myfreq_event(RIG *rig, vfo_t vfo, freq_t freq, rig_ptr_t arg) -{ - int *count_ptr = (int *) arg; - - printf("Rig changed freq to %"PRIfreq"Hz\n", freq); - *count_ptr += 1; - - return 0; -} - - -int main(int argc, const char *argv[]) -{ - RIG *my_rig; /* handle to rig (instance) */ - int retcode; /* generic return code from functions */ - int i, count = 0; - - if (argc != 2) - { - fprintf(stderr, "%s <rig_num>\n", argv[0]); - exit(1); - } - - printf("testrig: Hello, I am your main() !\n"); - - /* - * allocate memory, setup & open port - */ - - my_rig = rig_init(atoi(argv[1])); - - if (!my_rig) - { - fprintf(stderr, "Unknown rig num: %d\n", atoi(argv[1])); - fprintf(stderr, "Please check riglist.h\n"); - exit(1); /* whoops! something went wrong (mem alloc?) */ - } - - rig_set_conf(my_rig, rig_token_lookup(my_rig, "rig_pathname"), SERIAL_PORT); - - if (rig_open(my_rig)) - { - exit(2); - } - - printf("Port %s opened ok\n", SERIAL_PORT); - - /* - * Below are examples of set/get routines. - * Must add checking of functionality map prior to command execution -- FS - * - */ - - retcode = rig_set_freq(my_rig, RIG_VFO_CURR, 439700000); - - if (retcode != RIG_OK) - { - printf("rig_set_freq: error = %s \n", rigerror(retcode)); - } - - rig_set_freq_callback(my_rig, myfreq_event, (rig_ptr_t)&count); - - retcode = rig_set_trn(my_rig, RIG_TRN_RIG); - - if (retcode != RIG_OK) - { - printf("rig_set_trn: error = %s \n", rigerror(retcode)); - } - - - for (i = 0; i < 12; i++) - { - printf("Loop count: %d\n", i); - sleep(10); /* or anything smarter */ - } - - printf("Frequency changed %d times\n", count); - - rig_close(my_rig); /* close port */ - rig_cleanup(my_rig); /* if you care about memory */ - - printf("port %s closed ok \n", SERIAL_PORT); - - return 0; -} commit 4e6bcb11c9e7c4c217648fa0fa7a9cf206fd75d1 Author: George Baltz N3GB <Geo...@gm...> Date: Mon Sep 15 18:08:44 2025 -0400 Yet another variation on the name diff --git a/bindings/python/test_rig.py b/bindings/python/test_rig.py index a4659c3c7..10b7a3187 100755 --- a/bindings/python/test_rig.py +++ b/bindings/python/test_rig.py @@ -286,7 +286,7 @@ class TestClass: assert isinstance(rig.get_split_freq(Hamlib.RIG_VFO_CURR), float) assert len(rig.get_split_mode()) == 2 assert len(rig.get_split_mode(Hamlib.RIG_VFO_CURR)) == 2 - assert isinstance(rig.get_trn(), int) # deprecated + # assert isinstance(rig.get_trn(), int) # deprecated assert isinstance(rig.get_ts(), int) assert isinstance(rig.get_ts(Hamlib.RIG_VFO_CURR), int) assert len(rig.get_vfo_info()) == 5 @@ -349,7 +349,7 @@ class TestClass: assert rig.set_split_mode(0, 0, 0) is None assert rig.set_split_vfo(0, 0) is None assert rig.set_split_vfo(0, 0, 0) is None - assert rig.set_trn(0) is None # deprecated + # assert rig.set_trn(0) is None # deprecated assert rig.set_ts(0, 0) is None assert rig.set_vfo_opt(0) is None assert rig.token_lookup("") is None commit 25a7c25a0f784ff2333ebb19775c56b1bbafeb6a Author: George Baltz N3GB <Geo...@gm...> Date: Mon Sep 15 17:46:43 2025 -0400 This did nothing locally, maybe needed remotely diff --git a/bindings/ignore.swg b/bindings/ignore.swg index 4765a41b9..9de6a6fe8 100644 --- a/bindings/ignore.swg +++ b/bindings/ignore.swg @@ -116,6 +116,8 @@ // others %rename("$ignore", regexmatch$name="python_callbacks") ""; // internal structs and methods used by bindings %ignore rig_state::cache; // deprecated +%ignore rig_set_trn; // deprecated +%ignore rig_get_trn; // deprecated #ifdef SWIGLUA %ignore Rig::set_level(setting_t,int,vfo_t); commit 8cb93e4b9c652bd9e45a1e348ddc559f76a21f37 Author: George Baltz N3GB <Geo...@gm...> Date: Mon Sep 15 17:12:25 2025 -0400 Generate required noise diff --git a/bindings/python/test_Hamlib_Rig_class.py b/bindings/python/test_Hamlib_Rig_class.py index 83387836f..f148f6918 100755 --- a/bindings/python/test_Hamlib_Rig_class.py +++ b/bindings/python/test_Hamlib_Rig_class.py @@ -49,7 +49,6 @@ class TestClass: 'get_split_freq', 'get_split_mode', 'get_split_vfo', -'get_trn', 'get_ts', 'get_vfo', 'get_vfo_info', @@ -103,7 +102,6 @@ class TestClass: 'set_split_freq_mode', 'set_split_mode', 'set_split_vfo', -'set_trn', 'set_ts', 'set_vfo', 'set_vfo_callback', commit ee7d43fcf2119ace850269653ea68c699d86ebab Author: George Baltz N3GB <Geo...@gm...> Date: Mon Sep 15 15:55:00 2025 -0400 Update documentation diff --git a/NEWS b/NEWS index c1905dc47..23b9189fe 100644 --- a/NEWS +++ b/NEWS @@ -14,16 +14,17 @@ Version 5.x -- future Version 4.7.0 * 2025-12-01 (target) + * Some internal functions change names to avoid conflicts with apps. * POSIX threads are required to build and run Hamlib. Note that it was actually the case for 4.6.x, but now the configuration step will fail instead of the compilation. * Functions rig_get_conf, rot_get_conf, amp_get_conf deprecated; - use *_get_conf2() instead. + use *_get_conf2() instead. Also rig_set_trn and rig_get_trn deprecated. * Fix handling of unprintable characters in kenwood.c that broke radios such as the TM-D710/TM-V71 that use EOM_TH (\r) as the command terminator. (TNX, Lars Kellogg-Stedman and George Baltz). * Reduce/repair excess output from cppcheck.sh - mostly cosmetic changes (WIP) - Output from `wc -l cppcheck.log` - 4.6.2: 981 now: 642 + Output from `wc -l cppcheck.log` - 4.6.2: 981 now: 595 * Remove dead getopt code. GitHub PR #1709. (TNX Daniele Forsi) * Move rig_cache to separate(calloc) storage. Prepare for other moves. Issue #1420 diff --git a/ReleaseNotes_4.7.md b/ReleaseNotes_4.7.md index 18c1323d5..2e1229d7d 100644 --- a/ReleaseNotes_4.7.md +++ b/ReleaseNotes_4.7.md @@ -17,6 +17,7 @@ changes to ease transition to 5.0 - Functions `rig_get_conf()`, `rot_get_conf()` and `amp_get_conf()` are deprecated and will be removed in 5.0. Use `..._get_conf2()` instead. See issue [#924](https://github.com/Hamlib/Hamlib/issues/924). +- Functions `rig_set_trn()` & `rig_get_trn()` deprecated; operation now handled internally. - Documentation brought up to date. - (TBD) commit 00fb4bba71bdb93fa72f296f96819725d6ae77f8 Author: George Baltz N3GB <Geo...@gm...> Date: Mon Sep 15 14:58:38 2025 -0400 Remove dependency on misc.h from sim.h Include string.h to declare strerror Remove rig.h from simic705.c From first principles, none of the simulators should use *ANY* of the code from Hamlib. Using the same code on both sides of a simulation gives the equivalent of a math "X = X" proof; guaranteed to work, but useless for proving anything else. diff --git a/simulators/sim.h b/simulators/sim.h index 10aa5403f..d4030bb7b 100644 --- a/simulators/sim.h +++ b/simulators/sim.h @@ -2,8 +2,7 @@ #include <fcntl.h> #include <stdlib.h> #include <unistd.h> - -#include "../src/misc.h" +#include <string.h> /* ID 0310 == 310, Must drop leading zero */ typedef enum nc_rigid_e @@ -44,7 +43,7 @@ int write_sim(int fd, const unsigned char *buf, int buflen, const char *func, int linenum) { int n; - dump_hex(buf, buflen); + dumphex(buf, buflen); n = write(fd, buf, buflen); if (n <= 0) @@ -111,7 +110,7 @@ getmyline(int fd, char *buf) if (c == ';') { return i; } } - if (i == 0) { hl_usleep(10 * 1000); } + if (i == 0) { sleep(1); } return i; } @@ -128,13 +127,16 @@ getmyline5(int fd, unsigned char *buf) buf[i++] = c; } +#if 0 if (i > 0) { printf("n=%d %02x %02x %02x %02x %02x\n", i, buf[0], buf[1], buf[2], buf[3], buf[4]); } +#endif if (i == 0) { - hl_usleep(10 * 1000); + //hl_usleep(10 * 1000); + sleep(1); } return i; diff --git a/simulators/simic705.c b/simulators/simic705.c index 1ab2cd567..724fcfe03 100644 --- a/simulators/simic705.c +++ b/simulators/simic705.c @@ -8,7 +8,6 @@ #include <unistd.h> #include <errno.h> -#include "hamlib/rig.h" #include "misc.h" #include "sim.h" /* Simulators really shouldn't be using ANY of the definitions @@ -585,7 +584,6 @@ int main(int argc, char **argv) unsigned char buf[BUFSIZE]; int fd = openPort(argv[1]); - printf("%s: %s\n", argv[0], rig_version()); #ifdef X25 printf("x25/x26 command recognized\n"); #else @@ -622,7 +620,7 @@ int main(int argc, char **argv) } else { - hl_usleep(1000 * 1000); + sleep(1); } rigStatus(); commit 5f845e92cbd3b41c31709b25cf6a34194824ca9d Author: George Baltz N3GB <Geo...@gm...> Date: Wed Sep 10 20:54:46 2025 -0400 Get rid of more cppcheck fluff Turn off -x option in cppcheck.sh, fix missing '\'. This fixes all the "error" messages from cppcheck except those due to its own inability to handle concatenated format strings. diff --git a/cppcheck.sh b/cppcheck.sh index aeb2115a8..ce41e7dae 100755 --- a/cppcheck.sh +++ b/cppcheck.sh @@ -1,5 +1,5 @@ #!/bin/sh -set -x +# set -x # Author Michael Black W9MDB # This SUPPRESS setting results in no warnings as of 2020-01-14 # There are things that could still be done...especially in the C++ area @@ -63,7 +63,7 @@ CHECK="\ -D DECLARE_INITRIG_BACKEND \ -D DECLARE_INITROT_BACKEND \ -D DECLARE_INITAMP_BACKEND \ --D B230400 +-D B230400 \ -U RIG_LEVEL_LINEOUT \ -U O_ASYNC \ -U F_SETSIG \ diff --git a/rigs/dummy/gqrx.c b/rigs/dummy/gqrx.c index e4ccb49d5..b8b8d1b32 100644 --- a/rigs/dummy/gqrx.c +++ b/rigs/dummy/gqrx.c @@ -840,6 +840,7 @@ static int gqrx_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) if (vfo == RIG_VFO_A) { + int tempi; switch(level) { case RIG_LEVEL_AF: @@ -851,12 +852,17 @@ static int gqrx_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) break; case RIG_LEVEL_STRENGTH: - val->i = round(rig_raw2val(round(val->f), &rig->caps->str_cal)); + // Overlapping read/write from one member of a union to another + // is technically undefined behavior, according to the C + // standard; use a temp to avoid cppcheck error. + tempi = round(rig_raw2val(round(val->f), &rig->caps->str_cal)); + val->i = tempi; priv->curr_meter = val->i; break; case RIG_LEVEL_RAWSTR: - val->i = round(val->f); + tempi = round(val->f); + val->i = tempi; break; default : diff --git a/rotators/apex/sharedloop.c b/rotators/apex/sharedloop.c index 5fa8eb865..edd889f63 100644 --- a/rotators/apex/sharedloop.c +++ b/rotators/apex/sharedloop.c @@ -5,7 +5,7 @@ #include "iofunc.h" #include "apex.h" -int apex_shared_loop_get_position(ROT *rot, float *az, float *el) +static int apex_shared_loop_get_position(ROT *rot, float *az, float *el) { int loop = 10; @@ -21,7 +21,7 @@ int apex_shared_loop_get_position(ROT *rot, float *az, float *el) return RIG_OK; } -int apex_shared_loop_set_position(ROT *rot, float az, float dummy) +static int apex_shared_loop_set_position(ROT *rot, float az, float dummy) { char cmdstr[16]; int retval; diff --git a/src/settings.c b/src/settings.c index 5120c17e3..ca5485524 100644 --- a/src/settings.c +++ b/src/settings.c @@ -1059,6 +1059,7 @@ HAMLIB_EXPORT(int) rig_settings_get_path(char *path, int pathlen) home = "?HOME"; } + // cppcheck-suppress nullPointerRedundantCheck snprintf(path, pathlen, "%s/.config", home); if (xdgpath) @@ -1098,13 +1099,13 @@ HAMLIB_EXPORT(int) rig_settings_save(const char *setting, void *value, FILE *fptmp; char path[4096]; char buf[4096]; - char *cvalue = (char *)value; - int *ivalue = (int *)value; + const char *cvalue = (char *)value; + const int *ivalue = (int *)value; int n = 0; - long *lvalue = (long *) value; - float *fvalue = (float *) value; - double *dvalue = (double *) value; - char *vformat = "Unknown format??"; + const long *lvalue = (long *) value; + const float *fvalue = (float *) value; + const double *dvalue = (double *) value; + const char *vformat = "Unknown format??"; char template[64]; rig_settings_get_path(path, sizeof(path)); commit 11ca4382224129734ce5244dd83758ed30865f9a Author: George Baltz N3GB <Geo...@gm...> Date: Wed Sep 10 13:42:16 2025 -0400 Deprecate rig_get_trn() and rig_set_trn() They have been marked as deprecated in doxygen for years. They both do nothing but return -RIG_EDEPRECATED. Remove them from the bindings. AFAICT adding them to bindings/ignore.swg has no effect. diff --git a/bindings/rig.swg b/bindings/rig.swg index d0757effe..9261058f8 100644 --- a/bindings/rig.swg +++ b/bindings/rig.swg @@ -569,7 +569,7 @@ int *rig_spectrum_cb_python(RIG *rig, struct rig_spectrum_line *rig_spectrum_lin #define _VFO_DECL METHOD1(set_vfo, vfo_t) /* particular case */ METHOD1(set_powerstat, powerstat_t) - METHOD1(set_trn, int) +// METHOD1(set_trn, int) METHOD1(has_get_level, setting_t) METHOD1(has_set_parm, setting_t) METHOD1(has_set_func, setting_t) @@ -637,7 +637,7 @@ int *rig_spectrum_cb_python(RIG *rig, struct rig_spectrum_line *rig_spectrum_lin { self->error_status = rig_get_vfo_info(self->rig, vfo, freq, mode, width, split, satmode); } METHOD1VGET(get_mem, int) METHOD1GET(get_powerstat, powerstat_t) - METHOD1GET(get_trn, int) +// METHOD1GET(get_trn, int) METHOD1VGET(get_dcd, dcd_t) // Handling of event callbacks diff --git a/c++/rigclass.cc b/c++/rigclass.cc index db473e2f1..703db8a47 100644 --- a/c++/rigclass.cc +++ b/c++/rigclass.cc @@ -616,20 +616,6 @@ float Rig::mW2power (unsigned int mwpower, freq_t freq, rmode_t mode) return power; } -void Rig::setTrn (int trn) -{ - CHECK_RIG( rig_set_trn(theRig, trn) ); -} - -int Rig::getTrn () -{ - int trn; - - CHECK_RIG( rig_get_trn(theRig, &trn) ); - - return trn; -} - void Rig::setBank (int bank, vfo_t vfo) { CHECK_RIG( rig_set_ts(theRig, vfo, bank) ); diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h index 7f0b08710..8ab47b8ff 100644 --- a/include/hamlib/rig.h +++ b/include/hamlib/rig.h @@ -3235,9 +3235,11 @@ rig_lookup_mem_caps HAMLIB_PARAMS((RIG *rig, extern HAMLIB_EXPORT(int) rig_mem_count HAMLIB_PARAMS((RIG *rig)); +HL_DEPRECATED extern HAMLIB_EXPORT(int) rig_set_trn HAMLIB_PARAMS((RIG *rig, int trn)); +HL_DEPRECATED extern HAMLIB_EXPORT(int) rig_get_trn HAMLIB_PARAMS((RIG *rig, int *trn)); commit 7e572fcdd004b02f0f15972e90d21d25569c9ccd Author: George Baltz N3GB <Geo...@gm...> Date: Tue Sep 9 11:41:21 2025 -0400 Rename spaces() -> hl_stars() Resolves conflict with function of same name in cqrlog. Makes future conflicts less likely. Add it to doxygen. diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h index f55ccf740..7f0b08710 100644 --- a/include/hamlib/rig.h +++ b/include/hamlib/rig.h @@ -35,7 +35,7 @@ // Our shared secret password #define HAMLIB_SECRET_LENGTH 32 -#define HAMLIB_TRACE rig_debug(RIG_DEBUG_TRACE,"%s%s(%d) trace\n",spaces(STATE(rig)->depth), __FILE__, __LINE__) +#define HAMLIB_TRACE rig_debug(RIG_DEBUG_TRACE,"%s%s(%d) trace\n",hl_stars(STATE(rig)->depth), __FILE__, __LINE__) #define __FILENAME__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__) #include <stdio.h> @@ -3356,7 +3356,7 @@ extern HAMLIB_EXPORT_VAR(char) debugmsgsave3[DEBUGMSGSAVE_SIZE]; // last-2 debu // Measuring elapsed time -- local variable inside function when macro is used #define ELAPSED1 struct timespec __begin; elapsed_ms(&__begin, HAMLIB_ELAPSED_SET); -#define ELAPSED2 rig_debug(RIG_DEBUG_VERBOSE, "%s%d:%s: elapsed=%.0lfms\n", spaces(STATE(rig)->depth), STATE(rig)->depth, __func__, elapsed_ms(&__begin, HAMLIB_ELAPSED_GET)); +#define ELAPSED2 rig_debug(RIG_DEBUG_VERBOSE, "%s%d:%s: elapsed=%.0lfms\n", hl_stars(STATE(rig)->depth), STATE(rig)->depth, __func__, elapsed_ms(&__begin, HAMLIB_ELAPSED_GET)); // use this instead of snprintf for automatic detection of buffer limit #define SNPRINTF(s,n,...) { if (snprintf(s,n,##__VA_ARGS__) >= (n)) fprintf(stderr,"***** %s(%d): message truncated *****\n", __func__, __LINE__); } diff --git a/src/misc.c b/src/misc.c index 92f5c0cba..92469f34f 100644 --- a/src/misc.c +++ b/src/misc.c @@ -2812,6 +2812,28 @@ static struct tm *gmtime_r(const time_t *t, struct tm *r) #endif // gmtime_r #endif // _WIN32 +/** + * \brief Get a string of stars for indenting messages + * \ingroup lib_internal + * + * \param len number of stars (sounds kinda like a rating) + * \return pointer to an appropriate string + */ +const char *hl_stars(int len) +{ +#define MAX_STARS 128 + static const char s[MAX_STARS + 1] = + "****************************************************************" + "****************************************************************"; + + if (len < 0 || len > MAX_STARS) + { + len = 0; + } + + return &s[MAX_STARS - len]; +} + //! @cond Doxygen_Suppress char *date_strget(char *buf, int buflen, int localtime) { @@ -2855,23 +2877,6 @@ char *rig_date_strget(char *buf, int buflen, int localtime) return date_strget(buf, buflen, localtime); } -#define MAX_SPACES 256 -const char *spaces(int len) -{ - static const char s[MAX_SPACES + 1] = - "****************************************************************" - "****************************************************************" - "****************************************************************" - "****************************************************************"; - - if (len < 0 || len > MAX_SPACES) - { - len = 0; - } - - return &s[MAX_SPACES - len]; -} - // if which==0 rig_band_select str will be returned // if which!=0 the rig_parm_gran band str will be returned const char *rig_get_band_str(RIG *rig, hamlib_band_t band, int which) diff --git a/src/misc.h b/src/misc.h index 25ad442f9..59c8e2e4a 100644 --- a/src/misc.h +++ b/src/misc.h @@ -35,12 +35,12 @@ __BEGIN_DECLS -// a function to return just a string of spaces for indenting rig debug lines -HAMLIB_EXPORT (const char *) spaces(int len); +// a function to return just a string of stars for indenting rig debug lines +HAMLIB_EXPORT (const char *) hl_stars(int len); + /* * Do a hex dump of the unsigned char array. */ - void dump_hex(const unsigned char ptr[], size_t size); /* @@ -154,7 +154,7 @@ extern HAMLIB_EXPORT(char *)date_strget(char *buf, int buflen, int localtime); void errmsg(int err, char *s, const char *func, const char *file, int line); #define ERRMSG(err, s) errmsg(err, s, __func__, __FILENAME__, __LINE__) #define ENTERFUNC { ++STATE(rig)->depth; \ - rig_debug(RIG_DEBUG_VERBOSE, "%s%d:%s(%d):%s entered\n", spaces(STATE(rig)->depth), STATE(rig)->depth, __FILENAME__, __LINE__, __func__); \ + rig_debug(RIG_DEBUG_VERBOSE, "%s%d:%s(%d):%s entered\n", hl_stars(STATE(rig)->depth), STATE(rig)->depth, __FILENAME__, __LINE__, __func__); \ } #define ENTERFUNC2 { rig_debug(RIG_DEBUG_VERBOSE, "%s(%d):%s entered\n", __FILENAME__, __LINE__, __func__); \ } @@ -162,7 +162,7 @@ void errmsg(int err, char *s, const char *func, const char *file, int line); // could be a function call #define RETURNFUNC(rc) {do { \ int rctmp = rc; \ - rig_debug(RIG_DEBUG_VERBOSE, "%s%d:%s(%d):%s returning(%ld) %s\n", spaces(STATE(rig)->depth), STATE(rig)->depth, __FILENAME__, __LINE__, __func__, (long int) (rctmp), rctmp<0?rigerror2(rctmp):""); \ + rig_debug(RIG_DEBUG_VERBOSE, "%s%d:%s(%d):%s returning(%ld) %s\n", hl_stars(STATE(rig)->depth), STATE(rig)->depth, __FILENAME__, __LINE__, __func__, (long int) (rctmp), rctmp<0?rigerror2(rctmp):""); \ --STATE(rig)->depth; \ return (rctmp); \ } while(0);} commit f7a127dbdc42a700bb21518eba93e476dd6d42e6 Author: George Baltz N3GB <Geo...@gm...> Date: Tue Sep 9 10:30:53 2025 -0400 Doxygen updates. diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h index b78d4ca0c..f55ccf740 100644 --- a/include/hamlib/rig.h +++ b/include/hamlib/rig.h @@ -2244,7 +2244,7 @@ struct rig_caps { int (*set_lock_mode)(RIG *rig, int mode); int (*get_lock_mode)(RIG *rig, int *mode); short timeout_retry; /*!< number of retries to make in case of read timeout errors, some serial interfaces may require this, 0 to use default value, -1 to disable */ - short morse_qsize; /* max length of morse */ + short morse_qsize; /*!< max length of morse message rig can accept in one command */ // int (*bandwidth2rig)(RIG *rig, enum bandwidth_t bandwidth); // enum bandwidth_t (*rig2bandwidth)(RIG *rig, int rigbandwidth); }; @@ -2683,10 +2683,10 @@ struct s_rig { struct rig_callbacks callbacks; /*!< registered event callbacks */ // state should really be a pointer but that's a LOT of changes involved struct rig_state state; /*!< Rig state */ -/* Data beyond this line is for hamlib internal use only, +/* Data after this line is for hamlib internal use only, * and should *NOT* be referenced by applications, as layout will change! */ - struct rig_cache *cache_addr; + struct rig_cache *cache_addr; /*!< address of rig_cache buffer */ }; diff --git a/src/misc.c b/src/misc.c index d363f0f1b..92f5c0cba 100644 --- a/src/misc.c +++ b/src/misc.c @@ -1031,11 +1031,13 @@ static const struct }; /** - * \brief check input to set_level + * \brief Check the input to rig_set_level + * \ingroup lib_internal + * * \param rig The rig handle * \param level RIG_LEVEL_* trying to set * \param val Raw input from the caller - * \param gran If not NULL, set to location of level_gran data + * \param[out] gran If not NULL, set to location of level_gran data * * \return RIG_OK if value is in range for this level, -RIG_EINVAL if not */ ----------------------------------------------------------------------- Summary of changes: NEWS | 5 +- ReleaseNotes_4.7.md | 1 + bindings/ignore.swg | 2 + bindings/python/test_Hamlib_Rig_class.py | 2 - bindings/python/test_rig.py | 4 +- bindings/rig.swg | 4 +- c++/rigclass.cc | 14 ----- cppcheck.sh | 4 +- include/hamlib/rig.h | 12 ++-- rigs/dummy/gqrx.c | 10 ++- rotators/apex/sharedloop.c | 4 +- simulators/sim.h | 12 ++-- simulators/simic705.c | 4 +- src/misc.c | 45 ++++++++------ src/misc.h | 10 +-- src/settings.c | 13 ++-- tests/Makefile.am | 2 +- tests/README | 1 - tests/testtrn.c | 101 ------------------------------- 19 files changed, 76 insertions(+), 174 deletions(-) delete mode 100644 tests/testtrn.c hooks/post-receive -- Hamlib -- Ham radio control libraries |