[Hamlib-commits] Hamlib -- Ham radio control libraries branch master updated. 1557d848ed6add017f0c5
Library to control radio transceivers and receivers
Brought to you by:
n0nb
From: n0nb <n0...@us...> - 2025-09-23 13:14:59
|
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 1557d848ed6add017f0c5ad5a1efe276bb704e98 (commit) via 8d28c579f31ba35acd768b7aa4e46a6d18be2e18 (commit) via b48ff588956b2515bf41b1e2997f6a16157e607b (commit) via 0a30ba6dc70162a76cfa09c20dbdc545e2e58dda (commit) via 194f9d3a626fcbb1be5346f846f671d48cb42216 (commit) from c195d3dd4c66d959119d50a07801836fd6b558da (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 1557d848ed6add017f0c5ad5a1efe276bb704e98 Merge: c195d3dd4 8d28c579f Author: Nate Bargmann <n0...@n0...> Date: Mon Sep 22 21:32:40 2025 -0500 Merge GitHub PR #1920 commit 8d28c579f31ba35acd768b7aa4e46a6d18be2e18 Author: Daniele Forsi IU5HKX <iu...@gm...> Date: Sun Sep 21 14:09:01 2025 +0200 Use *_data_pointer() to get pointer to "state" Increases function coverage of functions and makes the bindings more future-proof. diff --git a/bindings/amplifier.swg b/bindings/amplifier.swg index 136e9d5c1..8d34f49cd 100644 --- a/bindings/amplifier.swg +++ b/bindings/amplifier.swg @@ -72,7 +72,7 @@ typedef struct Amp { } /* install shortcuts */ r->caps = r->amp->caps; - r->state = &r->amp->state; + r->state = amp_data_pointer(r->amp, RIG_PTRX_AMPSTATE); r->do_exception = 0; /* default is disabled */ r->error_status = RIG_OK; return r; diff --git a/bindings/rig.swg b/bindings/rig.swg index 285ab8359..a0327243b 100644 --- a/bindings/rig.swg +++ b/bindings/rig.swg @@ -485,7 +485,7 @@ int *rig_spectrum_cb_python(RIG *rig, struct rig_spectrum_line *rig_spectrum_lin #endif /* install shortcuts */ r->caps = r->rig->caps; - r->state = &r->rig->state; + r->state = rig_data_pointer(r->rig, RIG_PTRX_STATE); r->do_exception = 0; /* default is disabled */ r->error_status = RIG_OK; diff --git a/bindings/rotator.swg b/bindings/rotator.swg index 8691e4730..7db389cb9 100644 --- a/bindings/rotator.swg +++ b/bindings/rotator.swg @@ -68,7 +68,7 @@ typedef struct Rot { } /* install shortcuts */ r->caps = r->rot->caps; - r->state = &r->rot->state; + r->state = &r->rot->state; rot_data_pointer(r->rot, RIG_PTRX_ROTSTATE); r->do_exception = 0; /* default is disabled */ r->error_status = RIG_OK; return r; commit b48ff588956b2515bf41b1e2997f6a16157e607b Author: Daniele Forsi IU5HKX <iu...@gm...> Date: Sat Sep 6 21:19:25 2025 +0200 Add rig_has_get_func() and rig_has_get_parm() to the bindings Brings tests coverage of settings.c above 80%. diff --git a/bindings/python/test_Hamlib_Rig_class.py b/bindings/python/test_Hamlib_Rig_class.py index f148f6918..d4268f2fa 100755 --- a/bindings/python/test_Hamlib_Rig_class.py +++ b/bindings/python/test_Hamlib_Rig_class.py @@ -53,7 +53,9 @@ class TestClass: 'get_vfo', 'get_vfo_info', 'get_xit', +'has_get_func', 'has_get_level', +'has_get_parm', 'has_scan', 'has_set_func', 'has_set_parm', diff --git a/bindings/python/test_rig.py b/bindings/python/test_rig.py index 10b7a3187..91986d615 100755 --- a/bindings/python/test_rig.py +++ b/bindings/python/test_rig.py @@ -262,8 +262,8 @@ class TestClass: assert rig.get_ext_level(0) is None assert rig.get_ext_level(0, 0) is None assert rig.get_ext_parm(0) is None - assert isinstance(rig.get_func(0), int) - assert isinstance(rig.get_func(0, 0), int) + assert isinstance(rig.get_func(Hamlib.RIG_FUNC_BIT63), int) + assert isinstance(rig.get_func(Hamlib.RIG_FUNC_BIT63, 0), int) assert rig.get_info() is None assert rig.get_level(0) is None assert isinstance(rig.get_level_f(0), float) @@ -291,9 +291,9 @@ class TestClass: assert isinstance(rig.get_ts(Hamlib.RIG_VFO_CURR), int) assert len(rig.get_vfo_info()) == 5 assert len(rig.get_vfo_info(Hamlib.RIG_VFO_CURR)) == 5 - # assert rig_has_get_func(0) FIXME not defined + assert rig.has_get_func(Hamlib.RIG_FUNC_BIT63) is None assert rig.has_get_level(0) is None # FIXME should return setting_t - # assert rig_has_get_parm(0) FIXME not defined + assert rig.has_get_parm(0) is None # FIXME should return setting_t assert rig.has_scan(0) is None # FIXME should return scan_t assert rig.has_set_func(0) is None # FIXME should return setting_t # assert rig_has_set_level(0) FIXME not defined @@ -329,7 +329,7 @@ class TestClass: assert rig.set_ext_level(level, value, Hamlib.RIG_VFO_CURR) is None value = Hamlib.value_t() assert rig.set_ext_parm(0, value) is None - assert rig.set_func(0, 0, 0) is None + assert rig.set_func(Hamlib.RIG_FUNC_BIT63, 0, 0) is None assert rig.set_level(0, 0, 0) is None assert rig.set_mem(0, 0) is None assert rig.set_mode(0) is None diff --git a/bindings/rig.swg b/bindings/rig.swg index 9261058f8..285ab8359 100644 --- a/bindings/rig.swg +++ b/bindings/rig.swg @@ -571,7 +571,9 @@ int *rig_spectrum_cb_python(RIG *rig, struct rig_spectrum_line *rig_spectrum_lin METHOD1(set_powerstat, powerstat_t) // METHOD1(set_trn, int) METHOD1(has_get_level, setting_t) + METHOD1(has_get_parm, setting_t) METHOD1(has_set_parm, setting_t) + METHOD1(has_get_func, setting_t) METHOD1(has_set_func, setting_t) METHOD1(reset, reset_t) METHOD1(has_scan, scan_t) commit 0a30ba6dc70162a76cfa09c20dbdc545e2e58dda Author: Daniele Forsi IU5HKX <iu...@gm...> Date: Sat Sep 6 20:17:39 2025 +0200 Add rig_get_debug() and rig_set_debug_time_stamp() to the bindings Brings test coverage of debug.c over 55%. diff --git a/bindings/hamlib.swg b/bindings/hamlib.swg index 04f3968b5..f820ed14a 100644 --- a/bindings/hamlib.swg +++ b/bindings/hamlib.swg @@ -189,6 +189,8 @@ %apply int *OUTPUT { int *degrees, double *minutes, int *sw }; %apply double *OUTPUT { double *longitude, double *latitude }; +%apply unsigned int *OUTPUT { enum rig_debug_level_e * }; + #ifndef SWIGJAVA // If SWIGJAVA ever maps char * we can enable these %apply char *OUTPUT { char *locator_res }; diff --git a/bindings/ignore.swg b/bindings/ignore.swg index 9de6a6fe8..c0f342a35 100644 --- a/bindings/ignore.swg +++ b/bindings/ignore.swg @@ -89,7 +89,9 @@ %rename("$ignore", regexmatch$name="^rot_", %$isfunction) ""; // re-add some methods +%rename("%s") rig_get_debug; %rename("%s") rig_set_debug; +%rename("%s") rig_set_debug_time_stamp; %rename("%s", regexmatch$name="^rig_str", %$isfunction) ""; // remove typedefs diff --git a/bindings/python/test_Hamlib_class.py b/bindings/python/test_Hamlib_class.py index f0323958d..0493eb717 100755 --- a/bindings/python/test_Hamlib_class.py +++ b/bindings/python/test_Hamlib_class.py @@ -54,7 +54,9 @@ class TestClass: 'qrb', 'rig_callbacks', 'rig_caps', +'rig_get_debug', 'rig_set_debug', +'rig_set_debug_time_stamp', 'rig_spectrum_avg_mode', 'rig_spectrum_line', 'rig_spectrum_scope', diff --git a/bindings/python/test_startup.py b/bindings/python/test_startup.py index 8befdd15b..b44c12a9f 100755 --- a/bindings/python/test_startup.py +++ b/bindings/python/test_startup.py @@ -18,6 +18,8 @@ class TestClass: assert isinstance(Hamlib.cvar.hamlib_version, str) Hamlib.rig_set_debug(Hamlib.RIG_DEBUG_NONE) + assert Hamlib.rig_get_debug() == Hamlib.RIG_DEBUG_NONE + assert Hamlib.rig_set_debug_time_stamp(1) is None model = Hamlib.RIG_MODEL_DUMMY my_rig = Hamlib.Rig(model) commit 194f9d3a626fcbb1be5346f846f671d48cb42216 Author: Daniele Forsi IU5HKX <iu...@gm...> Date: Sat Sep 6 09:05:26 2025 +0200 Add tests for dmmm2dec() dec2dmmm() azimuth_long_path() Brings function coverage of locator.c to 100%. diff --git a/bindings/python/test_startup.py b/bindings/python/test_startup.py index e38cc355d..8befdd15b 100755 --- a/bindings/python/test_startup.py +++ b/bindings/python/test_startup.py @@ -128,4 +128,13 @@ class TestClass: assert lon3 == approx(-0.0414, abs=1.0e-04) # FIXME why need to override tolerance? assert lat3 == approx(48.1042) + assert Hamlib.dmmm2dec(48, 60.0 * 0.1042, 0) == approx(-Hamlib.dmmm2dec(-48, 60.0 * -0.1042, 1)) + assert Hamlib.dec2dmmm(48.1042) == [0, 48, 6, 0] + + assert Hamlib.azimuth_long_path(0.0) == 180.0 + assert Hamlib.azimuth_long_path(360.0) == 180.0 + assert Hamlib.azimuth_long_path(92.6) == approx(272.6) + assert Hamlib.azimuth_long_path(180.0) == 0.0 + assert Hamlib.azimuth_long_path(285.7) == approx(105.7) + assert my_rig.set_vfo_opt(0) is None ----------------------------------------------------------------------- Summary of changes: bindings/amplifier.swg | 2 +- bindings/hamlib.swg | 2 ++ bindings/ignore.swg | 2 ++ bindings/python/test_Hamlib_Rig_class.py | 2 ++ bindings/python/test_Hamlib_class.py | 2 ++ bindings/python/test_rig.py | 10 +++++----- bindings/python/test_startup.py | 11 +++++++++++ bindings/rig.swg | 4 +++- bindings/rotator.swg | 2 +- 9 files changed, 29 insertions(+), 8 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |