[Hamlib-commits] Hamlib -- Ham radio control libraries branch master updated. c51357388cb8b52456e2c
Library to control radio transceivers and receivers
Brought to you by:
n0nb
From: n0nb <n0...@us...> - 2025-08-12 12:41:10
|
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 c51357388cb8b52456e2c8561f2f3f329d12cb86 (commit) via 3b79b13f6d521a955faeac4274237478dcaeb57e (commit) via e2feb1d1d07c1e66b75c1e3d4d0414d790fce7e7 (commit) via 19dce9dc3256a1cac13dca2c43e11fef1462e3e5 (commit) via 6dec5791443a1d5e5bdb4684cfeaeb1cf37c8f04 (commit) via 65439c671961f589258427c4fbfd8ddc596ee744 (commit) from 5e13d102af3f90a16515982ccf5f23b93ea6a2dc (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 c51357388cb8b52456e2c8561f2f3f329d12cb86 Merge: 5e13d102a 3b79b13f6 Author: Nate Bargmann <n0...@n0...> Date: Tue Aug 12 07:04:50 2025 -0500 Merge GitHub PR #1841 commit 3b79b13f6d521a955faeac4274237478dcaeb57e Author: Daniele Forsi IU5HKX <iu...@gm...> Date: Mon Aug 11 23:41:39 2025 +0200 Make the tests for set_conf() and get_conf() more meaningful diff --git a/bindings/python/test_amp.py b/bindings/python/test_amp.py index 1a0b5eac3..4f8608761 100755 --- a/bindings/python/test_amp.py +++ b/bindings/python/test_amp.py @@ -27,11 +27,15 @@ class TestClass: assert amp.set_conf("", "") is None assert amp.get_conf("") == "" assert amp.get_conf(0) == "" - conf = amp.get_conf("mcfg") - assert isinstance(conf, str) - assert amp.set_conf("mcfg", "foo") is None - conf = amp.get_conf("mcfg") - assert conf == "" # FIXME: should return "foo" + if model == Hamlib.AMP_MODEL_DUMMY: + conf = amp.get_conf("mcfg") + assert conf == "" + assert amp.set_conf("mcfg", "foobar") is None + conf = amp.get_conf("mcfg") + assert conf == "" # FIXME: should return "foobar" + else: + conf = amp.get_conf("mcfg") + assert conf == "" assert amp.token_lookup("") is None diff --git a/bindings/python/test_rig.py b/bindings/python/test_rig.py index 5c0c305ec..a7545bd8e 100755 --- a/bindings/python/test_rig.py +++ b/bindings/python/test_rig.py @@ -29,13 +29,14 @@ class TestClass: assert rig.set_conf("", "") is None assert rig.get_conf("") == "" assert rig.get_conf(0) == "" - conf = rig.get_conf("mcfg") - assert isinstance(conf, str) - assert rig.set_conf("mcfg", "foo") is None - conf = rig.get_conf("mcfg") if model == Hamlib.RIG_MODEL_DUMMY: - assert conf == "foo" + conf = rig.get_conf("mcfg") + assert conf == "DX" + assert rig.set_conf("mcfg", "foobar") is None + conf = rig.get_conf("mcfg") + assert conf == "foobar" else: + conf = rig.get_conf("mcfg") assert conf == "" assert rig.token_lookup("") is None diff --git a/bindings/python/test_rot.py b/bindings/python/test_rot.py index c87835534..73cce79af 100755 --- a/bindings/python/test_rot.py +++ b/bindings/python/test_rot.py @@ -36,13 +36,14 @@ class TestClass: assert rot.set_conf("", "") is None assert rot.get_conf("") == "" assert rot.get_conf(0) == "" - conf = rot.get_conf("mcfg") - assert isinstance(conf, str) - assert rot.set_conf("mcfg", "foo") is None - conf = rot.get_conf("mcfg") if model == Hamlib.ROT_MODEL_DUMMY: - assert conf == "foo" + conf = rot.get_conf("mcfg") + assert conf == "ROTATOR" + assert rot.set_conf("mcfg", "foobar") is None + conf = rot.get_conf("mcfg") + assert conf == "foobar" else: + conf = rot.get_conf("mcfg") assert conf == "" assert rot.token_lookup("") is None commit e2feb1d1d07c1e66b75c1e3d4d0414d790fce7e7 Author: Daniele Forsi IU5HKX <iu...@gm...> Date: Mon Aug 11 23:40:01 2025 +0200 Fix "val_len" paramenter for rot_get_conf2() and amp_get_conf2() Thanks to @GeoBaltz. diff --git a/bindings/amplifier.swg b/bindings/amplifier.swg index 00ab8d533..136e9d5c1 100644 --- a/bindings/amplifier.swg +++ b/bindings/amplifier.swg @@ -124,7 +124,7 @@ typedef struct Amp { const char *get_conf(hamlib_token_t tok) { static char s[128] = ""; - self->error_status = amp_get_conf2(self->amp, tok, s, sizeof *s); + self->error_status = amp_get_conf2(self->amp, tok, s, sizeof s); return s; } @@ -134,7 +134,7 @@ typedef struct Amp { if (tok == RIG_CONF_END) self->error_status = -RIG_EINVAL; else - self->error_status = amp_get_conf2(self->amp, tok, s, sizeof *s); + self->error_status = amp_get_conf2(self->amp, tok, s, sizeof s); return s; } diff --git a/bindings/rotator.swg b/bindings/rotator.swg index 0cfa13cbe..8691e4730 100644 --- a/bindings/rotator.swg +++ b/bindings/rotator.swg @@ -133,7 +133,7 @@ typedef struct Rot { const char *get_conf(hamlib_token_t tok) { static char s[128] = ""; - self->error_status = rot_get_conf2(self->rot, tok, s, sizeof *s); + self->error_status = rot_get_conf2(self->rot, tok, s, sizeof s); return s; } @@ -143,7 +143,7 @@ typedef struct Rot { if (tok == RIG_CONF_END) self->error_status = -RIG_EINVAL; else - self->error_status = rot_get_conf2(self->rot, tok, s, sizeof *s); + self->error_status = rot_get_conf2(self->rot, tok, s, sizeof s); return s; } commit 19dce9dc3256a1cac13dca2c43e11fef1462e3e5 Author: Daniele Forsi IU5HKX <iu...@gm...> Date: Mon Aug 11 15:29:11 2025 +0200 Remove deprecated functions and methods from the bindings diff --git a/bindings/ignore.swg b/bindings/ignore.swg index 34f634034..4765a41b9 100644 --- a/bindings/ignore.swg +++ b/bindings/ignore.swg @@ -5,6 +5,7 @@ %rename("$ignore", regexmatch$name="^AMP_") ""; %rename("$ignore", regexmatch$name="^RIG_") ""; %rename("$ignore", regexmatch$name="^ROT_") ""; +%rename("$ignore", regexmatch$name="deprecated") ""; // re-add useful defines @@ -86,6 +87,7 @@ %rename("$ignore", regexmatch$name="^amp_", %$isfunction) ""; %rename("$ignore", regexmatch$name="^rig_", %$isfunction) ""; %rename("$ignore", regexmatch$name="^rot_", %$isfunction) ""; + // re-add some methods %rename("%s") rig_set_debug; %rename("%s", regexmatch$name="^rig_str", %$isfunction) ""; @@ -111,7 +113,9 @@ %ignore PRIfreq; %ignore SCNfreq; +// others %rename("$ignore", regexmatch$name="python_callbacks") ""; // internal structs and methods used by bindings +%ignore rig_state::cache; // deprecated #ifdef SWIGLUA %ignore Rig::set_level(setting_t,int,vfo_t); diff --git a/bindings/python/test_Hamlib_class.py b/bindings/python/test_Hamlib_class.py index 98f767f7e..f0323958d 100755 --- a/bindings/python/test_Hamlib_class.py +++ b/bindings/python/test_Hamlib_class.py @@ -52,7 +52,6 @@ class TestClass: 'multicast_s', 'netrigctl_get_vfo_mode', 'qrb', -'rig_cache_deprecated', 'rig_callbacks', 'rig_caps', 'rig_set_debug', @@ -60,7 +59,6 @@ class TestClass: 'rig_spectrum_line', 'rig_spectrum_scope', 'rig_state', -'rig_state_deprecated', 'rig_stragclevel', 'rig_strcommstatus', 'rig_strfunc', commit 6dec5791443a1d5e5bdb4684cfeaeb1cf37c8f04 Author: Daniele Forsi IU5HKX <iu...@gm...> Date: Mon Aug 11 15:09:49 2025 +0200 Replace library functions deprecated in Hamlib diff --git a/bindings/amplifier.swg b/bindings/amplifier.swg index ed28c8046..00ab8d533 100644 --- a/bindings/amplifier.swg +++ b/bindings/amplifier.swg @@ -124,7 +124,7 @@ typedef struct Amp { const char *get_conf(hamlib_token_t tok) { static char s[128] = ""; - self->error_status = amp_get_conf(self->amp, tok, s); + self->error_status = amp_get_conf2(self->amp, tok, s, sizeof *s); return s; } @@ -134,7 +134,7 @@ typedef struct Amp { if (tok == RIG_CONF_END) self->error_status = -RIG_EINVAL; else - self->error_status = amp_get_conf(self->amp, tok, s); + self->error_status = amp_get_conf2(self->amp, tok, s, sizeof *s); return s; } diff --git a/bindings/rig.swg b/bindings/rig.swg index a062bcfef..61f8674f3 100644 --- a/bindings/rig.swg +++ b/bindings/rig.swg @@ -699,7 +699,7 @@ int *rig_spectrum_cb_python(RIG *rig, struct rig_spectrum_line *rig_spectrum_lin void get_conf(hamlib_token_t tok, char *returnstr) { returnstr[0] = '\0'; - self->error_status = rig_get_conf(self->rig, tok, returnstr); + self->error_status = rig_get_conf2(self->rig, tok, returnstr, MAX_RETURNSTR); } void get_conf(const char *name, char *returnstr) { @@ -708,7 +708,7 @@ int *rig_spectrum_cb_python(RIG *rig, struct rig_spectrum_line *rig_spectrum_lin if (tok == RIG_CONF_END) self->error_status = -RIG_EINVAL; else - self->error_status = rig_get_conf(self->rig, tok, returnstr); + self->error_status = rig_get_conf2(self->rig, tok, returnstr, MAX_RETURNSTR); } void recv_dtmf(char *returnstr, vfo_t vfo = RIG_VFO_CURR) { diff --git a/bindings/rotator.swg b/bindings/rotator.swg index eb615319b..0cfa13cbe 100644 --- a/bindings/rotator.swg +++ b/bindings/rotator.swg @@ -133,7 +133,7 @@ typedef struct Rot { const char *get_conf(hamlib_token_t tok) { static char s[128] = ""; - self->error_status = rot_get_conf(self->rot, tok, s); + self->error_status = rot_get_conf2(self->rot, tok, s, sizeof *s); return s; } @@ -143,7 +143,7 @@ typedef struct Rot { if (tok == RIG_CONF_END) self->error_status = -RIG_EINVAL; else - self->error_status = rot_get_conf(self->rot, tok, s); + self->error_status = rot_get_conf2(self->rot, tok, s, sizeof *s); return s; } commit 65439c671961f589258427c4fbfd8ddc596ee744 Author: Daniele Forsi IU5HKX <iu...@gm...> Date: Mon Aug 11 14:47:06 2025 +0200 Fix typo diff --git a/rigs/drake/drake.c b/rigs/drake/drake.c index 028128eeb..88af10a99 100644 --- a/rigs/drake/drake.c +++ b/rigs/drake/drake.c @@ -618,7 +618,7 @@ int drake_report_all(RIG *rig, char* owner) // strings show mem off, ch 00, NB off, AGC fast, RF off, MN off, ant 1, AM mode, 6.0 bw, VFOA, sync off, not scanning // r8 //char testbuf[25] = {' ','0','0',' ','2','0','2','<','8',' ',' ','1','5','.','0','0','0','0','0','#','m','H','z', 0x0d, 0x0a }; - // r8a/b - TODO Note 7-char channel name that eitehr starts at [25] or [26] + // r8a/b - TODO Note 7-char channel name that either starts at [25] or [26] //char testbuf[35] = {' ','0','0','0',' ','2','0','2','<','8',' ',' ','1','5','.','0','0','0','0','0','#','m','H','z',' ','M','E','M','N','A','M','E',' ', 0x0d, 0x0a }; //drake_trans_rept(owner, "RA" EOM, 3, mdbuf, mdbuf_len, retval); ----------------------------------------------------------------------- Summary of changes: bindings/amplifier.swg | 4 ++-- bindings/ignore.swg | 4 ++++ bindings/python/test_Hamlib_class.py | 2 -- bindings/python/test_amp.py | 14 +++++++++----- bindings/python/test_rig.py | 11 ++++++----- bindings/python/test_rot.py | 11 ++++++----- bindings/rig.swg | 4 ++-- bindings/rotator.swg | 4 ++-- rigs/drake/drake.c | 2 +- 9 files changed, 32 insertions(+), 24 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |