hamlib-cvs-digest Mailing List for Ham Radio Control Libraries (Page 9)
Library to control radio transceivers and receivers
Brought to you by:
n0nb
You can subscribe to this list here.
| 2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(57) |
Nov
(27) |
Dec
(25) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2001 |
Jan
(41) |
Feb
(101) |
Mar
(60) |
Apr
(32) |
May
(32) |
Jun
(198) |
Jul
(95) |
Aug
(60) |
Sep
(48) |
Oct
(96) |
Nov
(27) |
Dec
(222) |
| 2002 |
Jan
(180) |
Feb
(46) |
Mar
(68) |
Apr
(11) |
May
(36) |
Jun
(34) |
Jul
(113) |
Aug
(42) |
Sep
(71) |
Oct
(65) |
Nov
(116) |
Dec
(40) |
| 2003 |
Jan
(32) |
Feb
(92) |
Mar
(29) |
Apr
(102) |
May
(21) |
Jun
(34) |
Jul
(3) |
Aug
(60) |
Sep
(30) |
Oct
(62) |
Nov
(57) |
Dec
(33) |
| 2004 |
Jan
(28) |
Feb
(46) |
Mar
(16) |
Apr
(14) |
May
(31) |
Jun
(21) |
Jul
(10) |
Aug
(80) |
Sep
(42) |
Oct
(11) |
Nov
(28) |
Dec
(13) |
| 2005 |
Jan
(35) |
Feb
(26) |
Mar
(20) |
Apr
(118) |
May
(2) |
Jun
(5) |
Jul
|
Aug
|
Sep
(5) |
Oct
(1) |
Nov
(13) |
Dec
(1) |
| 2006 |
Jan
(9) |
Feb
(25) |
Mar
(22) |
Apr
(6) |
May
|
Jun
|
Jul
(2) |
Aug
(1) |
Sep
(3) |
Oct
(46) |
Nov
(13) |
Dec
(7) |
| 2007 |
Jan
(9) |
Feb
(14) |
Mar
(3) |
Apr
|
May
(6) |
Jun
(1) |
Jul
|
Aug
(11) |
Sep
(7) |
Oct
(8) |
Nov
(41) |
Dec
(3) |
| 2008 |
Jan
(27) |
Feb
(16) |
Mar
(13) |
Apr
(23) |
May
(39) |
Jun
(4) |
Jul
(7) |
Aug
(1) |
Sep
(13) |
Oct
(52) |
Nov
(44) |
Dec
(55) |
| 2009 |
Jan
(72) |
Feb
(69) |
Mar
|
Apr
|
May
|
Jun
(13) |
Jul
(1) |
Aug
(6) |
Sep
(15) |
Oct
(11) |
Nov
(31) |
Dec
(20) |
| 2010 |
Jan
(24) |
Feb
(21) |
Mar
(22) |
Apr
(40) |
May
(38) |
Jun
(4) |
Jul
(2) |
Aug
(22) |
Sep
(19) |
Oct
(14) |
Nov
(5) |
Dec
(8) |
| 2011 |
Jan
(14) |
Feb
(36) |
Mar
(6) |
Apr
|
May
|
Jun
(23) |
Jul
(13) |
Aug
(8) |
Sep
(7) |
Oct
|
Nov
(3) |
Dec
(9) |
| 2012 |
Jan
(17) |
Feb
(13) |
Mar
(10) |
Apr
|
May
(1) |
Jun
(14) |
Jul
(4) |
Aug
(12) |
Sep
(2) |
Oct
(24) |
Nov
(14) |
Dec
(2) |
| 2013 |
Jan
(4) |
Feb
(3) |
Mar
(3) |
Apr
(3) |
May
(10) |
Jun
(4) |
Jul
(7) |
Aug
|
Sep
(15) |
Oct
(5) |
Nov
(1) |
Dec
(2) |
| 2014 |
Jan
|
Feb
(8) |
Mar
(1) |
Apr
(3) |
May
(1) |
Jun
|
Jul
|
Aug
(1) |
Sep
(3) |
Oct
(7) |
Nov
(6) |
Dec
(3) |
| 2015 |
Jan
(4) |
Feb
(5) |
Mar
(8) |
Apr
(8) |
May
(2) |
Jun
|
Jul
(4) |
Aug
(7) |
Sep
(8) |
Oct
|
Nov
(6) |
Dec
(4) |
| 2016 |
Jan
(6) |
Feb
(26) |
Mar
(3) |
Apr
(10) |
May
(6) |
Jun
(5) |
Jul
(1) |
Aug
(4) |
Sep
(3) |
Oct
(4) |
Nov
(3) |
Dec
(10) |
| 2017 |
Jan
(11) |
Feb
(11) |
Mar
(2) |
Apr
(1) |
May
(7) |
Jun
(2) |
Jul
(11) |
Aug
(9) |
Sep
(5) |
Oct
(5) |
Nov
(1) |
Dec
(2) |
| 2018 |
Jan
(5) |
Feb
(2) |
Mar
(19) |
Apr
(7) |
May
(11) |
Jun
(3) |
Jul
(4) |
Aug
(10) |
Sep
(2) |
Oct
(8) |
Nov
(6) |
Dec
(9) |
| 2019 |
Jan
(9) |
Feb
(6) |
Mar
(2) |
Apr
(4) |
May
(6) |
Jun
(9) |
Jul
(6) |
Aug
(3) |
Sep
(5) |
Oct
(2) |
Nov
(8) |
Dec
(9) |
| 2020 |
Jan
(15) |
Feb
(1) |
Mar
(18) |
Apr
(33) |
May
(43) |
Jun
(87) |
Jul
(45) |
Aug
(8) |
Sep
(43) |
Oct
(3) |
Nov
(5) |
Dec
(42) |
| 2021 |
Jan
(116) |
Feb
(40) |
Mar
(58) |
Apr
(48) |
May
(29) |
Jun
(2) |
Jul
|
Aug
(22) |
Sep
(18) |
Oct
(1) |
Nov
|
Dec
(3) |
| 2022 |
Jan
(1) |
Feb
(1) |
Mar
|
Apr
(1) |
May
(2) |
Jun
(1) |
Jul
|
Aug
(1) |
Sep
|
Oct
(6) |
Nov
(2) |
Dec
(9) |
| 2023 |
Jan
(10) |
Feb
|
Mar
|
Apr
(10) |
May
(3) |
Jun
(1) |
Jul
(2) |
Aug
(4) |
Sep
(1) |
Oct
|
Nov
(2) |
Dec
(3) |
| 2024 |
Jan
(4) |
Feb
(1) |
Mar
(2) |
Apr
(2) |
May
(5) |
Jun
(3) |
Jul
(1) |
Aug
(2) |
Sep
|
Oct
(2) |
Nov
(3) |
Dec
(9) |
| 2025 |
Jan
(5) |
Feb
(5) |
Mar
|
Apr
(10) |
May
(20) |
Jun
(43) |
Jul
(24) |
Aug
(47) |
Sep
(38) |
Oct
(5) |
Nov
(3) |
Dec
(1) |
|
From: n0nb <n0...@us...> - 2025-01-21 01:53:38
|
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 198c14818a5c0f23a1dc8bd9bd577a4b4c5f2957 (commit)
via 4281a5ef7d32fe9adfb48de6fe52ace7b63e7d6d (commit)
via 704238da2f172fdfeca1b094d9978fccf4ef9f7e (commit)
via af1cab0619c2cead0fb2dbbb1ef380492a1d712d (commit)
via e3c67131cff0ec24d7142449a98287b33926af2f (commit)
via 5401dfeca89f3e735b12742a6f7ee9221bf9b8bc (commit)
via c0d0e6ff24e43b97885dc8a4e01c6638a03f3bbc (commit)
via 09b58274b320f7c36316508510674fa371bd9076 (commit)
via 8041563c2e628a8fda9452f5e571ddfe184caaab (commit)
via cfc199dac2a4df3995e8214fad48d7eb99935567 (commit)
via f76864a3c46d1ce9a4ec47538131e09f382fea62 (commit)
via ad50b0c7837aa4f8759082fdde279178c0d81c3f (commit)
via 0c5c34f8a5515b0064635f9b2e6f210c01280eca (commit)
via 8c3f13764d9af4c6ecf112657864b4262c097575 (commit)
via 6a4da2cbc5111f708efc7dd8735c41979c27a5c4 (commit)
via e4019531601331ea79be61dfbdd705a4ed78385a (commit)
via 4980beb9a9f28a2e6945d19cffd17820c9408911 (commit)
via 7a5bb89690837c53ce4f9c7f7507c75de2fd2092 (commit)
via 8aa487afb8a335b0550b0713a25e2c61d34058e4 (commit)
via 35f86232fada1cfd0af61a1efd97fb175025f1b4 (commit)
via 517a8918ab88fbd80ba45d87c0884e3d1ca67856 (commit)
via bedbfff8c4c574dad9bd14cc620d4c2683afe9ed (commit)
via a985b50eea15f8f8c8f376888e639dbb7c05daaa (commit)
via 24d67437b78aeb9d0c7925450bda9839ebd7c31a (commit)
via 46143578ae3853db6054e73be5867bd69cadff29 (commit)
via 8636901bf3a74a6a5af5c89df12393adcc0ae3f6 (commit)
via 33adef942e4e3227be56d0b9a2f5a3b5b7b43010 (commit)
via d2065fe781b1213c1458565eb4fe40227bb657f3 (commit)
via d1e0e3f204d3b0f5b3a17e83a50d360184136e0d (commit)
via b2b8586c93c3ce501cd6a46da5d7352668c87f15 (commit)
via 3eefab46a9ab631577f1bba9ca42752afe3f8b64 (commit)
via 1ad817dea9991c5ccc86553fc8e8c5f9914707e8 (commit)
via 181831bbd81c61b3d3aced3a08c8a74213d88235 (commit)
via 61f3a817d339d7010b192f6a588bfe13620c803c (commit)
via 083fed77f298d4a006b52dfbd9ebad549e54ec15 (commit)
via 820c28e63f01142c1a607b7bc86e458af1f1a14d (commit)
via 3222289ef501ff0bf63810b909c80bbc7c244294 (commit)
via b3118906311b0d5dd68883ee6aefb12f0c81e469 (commit)
via b3ef41354d9c7f97959e65d09aadb53bbb1d3232 (commit)
via a8f5ad0b6ff5453325fc5ca304818727ad9ad0de (commit)
via ab63103f6b553b72eb24c01f9fc4028a05e8e149 (commit)
via a8a5229147d689cd01294538d82399597b22b5b0 (commit)
via 7d535564bd5b283f2c4722b632aefb3d0ab764e3 (commit)
from 028d750249ab00c8c362598c838b15e8aa6a2951 (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 198c14818a5c0f23a1dc8bd9bd577a4b4c5f2957
Author: Michael Black W9MDB <mdb...@ya...>
Date: Mon Jan 20 16:54:16 2025 -0600
Reduce error message level in rig_set_freq...left over from debugging
diff --git a/src/rig.c b/src/rig.c
index fce0b168a..a380cf18a 100644
--- a/src/rig.c
+++ b/src/rig.c
@@ -2373,7 +2373,7 @@ int rig_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
rig_set_cache_freq(rig, vfo, freq_new);
- rig_debug(RIG_DEBUG_ERR, "%s: vfo=%s, save=%s\n", __func__, rig_strvfo(vfo), rig_strvfo(vfo_save));
+ rig_debug(RIG_DEBUG_VERBOSE, "%s: vfo=%s, save=%s\n", __func__, rig_strvfo(vfo), rig_strvfo(vfo_save));
if (vfo != vfo_save && vfo != RIG_VFO_CURR)
{
HAMLIB_TRACE;
commit 4281a5ef7d32fe9adfb48de6fe52ace7b63e7d6d
Author: Michael Black W9MDB <mdb...@ya...>
Date: Sun Jan 19 16:51:24 2025 -0600
Revert "Reapply "Update python binding to place some files in site-packages/Hamlib""
This reverts commit 704238da2f172fdfeca1b094d9978fccf4ef9f7e.
diff --git a/bindings/Makefile.am b/bindings/Makefile.am
index ee20d3810..34272b70c 100644
--- a/bindings/Makefile.am
+++ b/bindings/Makefile.am
@@ -83,47 +83,55 @@ uninstall-perl: ## Hamlib-pl.mk
endif
# Perl
+
if ENABLE_PYTHON
+##########################################
+# Python binding
+
+pyexec_ltlib = _Hamlib.la
+
+MOSTLYCLEANFILES += hamlibpy_wrap.c Hamlib.py *.pyc
+BUILT_SOURCES += hamlibpy_wrap.c Hamlib.py
-##############################################################################
-# 1. We declare a Python extension using 'pyexec_LTLIBRARIES'.
-# - Tells Automake: “Install this .so into $(pyexecdir).”
-# - We override 'pyexec_ltlibdir' to place it in a subdirectory: Hamlib
-##############################################################################
-pyexec_LTLIBRARIES = _Hamlib.la
-pyexec_ltlibdir = $(pyexecdir)/Hamlib
+# Set by AM_CONDITIONAL in configure.ac
+if PYVER_3
+pytest = py3test.py
+else !PYVER_3
+pytest = pytest.py
+endif
+# PYVER_3
+
+example_DATA += $(pytest)
+
+nodist_pyexec_PYTHON = Hamlib.py
+nodist__Hamlib_la_SOURCES = hamlibpy_wrap.c
-_Hamlib_la_SOURCES = hamlibpy_wrap.c
_Hamlib_la_LDFLAGS = -no-undefined -module -avoid-version
-_Hamlib_la_LIBADD = $(top_builddir)/src/libhamlib.la $(PYTHON_LIBS)
-
-##############################################################################
-# 2. We declare a set of Python (.py) files using a custom primary, e.g.
-# 'myhamlib_PYTHON'. Automake installs them into 'myhamlibdir' by default.
-##############################################################################
-myhamlib_PYTHON = \
- __init__.py \
- Hamlib.py
-
-# Place them in the exact same directory as the extension: $(pyexecdir)/Hamlib
-myhamlibdir = $(pyexecdir)/Hamlib
-
-##############################################################################
-# 3. Distribute these files (so they're included in 'make dist' tarballs).
-##############################################################################
-EXTRA_DIST += \
- __init__.py \
- Hamlib.py
-
-all-py:
+_Hamlib_la_LIBADD = $(top_builddir)/src/libhamlib.la $(PYTHON_LIBS)
+_Hamlib_ladir = $(pyexecdir)
+_Hamlib_la_LTLIBRARIES = $(pyexec_ltlib)
+
+all-py: $(pyexec_ltlib)
+
+check-py: all-py
+ $(AM_V_at)PYTHONPATH=$(builddir):$(builddir)/.libs \
+ $(PYTHON) $(srcdir)/$(pytest) \
+ || echo "Python test failed" 1>&2
+
+Hamlib.py: hamlibpy_wrap.c
+
+hamlibpy_wrap.c: hamlib.swg $(SWGDEP)
+ $(AM_V_GEN)$(SWIG) -python $(AM_CPPFLAGS) $(PYTHON_CPPFLAGS) -I$(top_srcdir)/bindings \
+ -o $@ $$(test -f hamlib.swg || echo '$(srcdir)/')hamlib.swg
+
install-py:
- @true
-##############################################################################
-# 4. Remove any custom 'install-py:' or 'install-exec-local: install-py'
-# You do NOT need them. Automake already knows how to install these files.
-##############################################################################
+clean-py:
+distclean-py:
+uninstall-py:
+
+endif
+# Python
-endif # ENABLE_PYTHON
if ENABLE_TCL
##########################################
diff --git a/bindings/py3test.py b/bindings/py3test.py
index 9c156234e..52f85e1e7 100755
--- a/bindings/py3test.py
+++ b/bindings/py3test.py
@@ -1,9 +1,8 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
-import site
# Change this path to match your "make install" path
-sys.path.append('/usr/local/lib/python3.12/site-packages')
+sys.path.append('/usr/local/lib/python3.10/site-packages')
## Uncomment to run this script from an in-tree build (or adjust to the
## build directory) without installing the bindings.
@@ -18,9 +17,7 @@ def StartUp():
print("%s: Python %s; %s\n" \
% (sys.argv[0], sys.version.split()[0], Hamlib.cvar.hamlib_version))
- print(site.getsitepackages())
-
- Hamlib.rig_set_debug(0)
+ Hamlib.rig_set_debug(Hamlib.RIG_DEBUG_NONE)
# Init RIG_MODEL_DUMMY
my_rig = Hamlib.Rig(Hamlib.RIG_MODEL_DUMMY)
commit 704238da2f172fdfeca1b094d9978fccf4ef9f7e
Author: Michael Black W9MDB <mdb...@ya...>
Date: Sun Jan 19 16:50:59 2025 -0600
Reapply "Update python binding to place some files in site-packages/Hamlib"
This reverts commit af1cab0619c2cead0fb2dbbb1ef380492a1d712d.
diff --git a/bindings/Makefile.am b/bindings/Makefile.am
index 34272b70c..ee20d3810 100644
--- a/bindings/Makefile.am
+++ b/bindings/Makefile.am
@@ -83,55 +83,47 @@ uninstall-perl: ## Hamlib-pl.mk
endif
# Perl
-
if ENABLE_PYTHON
-##########################################
-# Python binding
-
-pyexec_ltlib = _Hamlib.la
-
-MOSTLYCLEANFILES += hamlibpy_wrap.c Hamlib.py *.pyc
-BUILT_SOURCES += hamlibpy_wrap.c Hamlib.py
-# Set by AM_CONDITIONAL in configure.ac
-if PYVER_3
-pytest = py3test.py
-else !PYVER_3
-pytest = pytest.py
-endif
-# PYVER_3
-
-example_DATA += $(pytest)
-
-nodist_pyexec_PYTHON = Hamlib.py
-nodist__Hamlib_la_SOURCES = hamlibpy_wrap.c
+##############################################################################
+# 1. We declare a Python extension using 'pyexec_LTLIBRARIES'.
+# - Tells Automake: “Install this .so into $(pyexecdir).”
+# - We override 'pyexec_ltlibdir' to place it in a subdirectory: Hamlib
+##############################################################################
+pyexec_LTLIBRARIES = _Hamlib.la
+pyexec_ltlibdir = $(pyexecdir)/Hamlib
+_Hamlib_la_SOURCES = hamlibpy_wrap.c
_Hamlib_la_LDFLAGS = -no-undefined -module -avoid-version
-_Hamlib_la_LIBADD = $(top_builddir)/src/libhamlib.la $(PYTHON_LIBS)
-_Hamlib_ladir = $(pyexecdir)
-_Hamlib_la_LTLIBRARIES = $(pyexec_ltlib)
-
-all-py: $(pyexec_ltlib)
-
-check-py: all-py
- $(AM_V_at)PYTHONPATH=$(builddir):$(builddir)/.libs \
- $(PYTHON) $(srcdir)/$(pytest) \
- || echo "Python test failed" 1>&2
-
-Hamlib.py: hamlibpy_wrap.c
-
-hamlibpy_wrap.c: hamlib.swg $(SWGDEP)
- $(AM_V_GEN)$(SWIG) -python $(AM_CPPFLAGS) $(PYTHON_CPPFLAGS) -I$(top_srcdir)/bindings \
- -o $@ $$(test -f hamlib.swg || echo '$(srcdir)/')hamlib.swg
-
+_Hamlib_la_LIBADD = $(top_builddir)/src/libhamlib.la $(PYTHON_LIBS)
+
+##############################################################################
+# 2. We declare a set of Python (.py) files using a custom primary, e.g.
+# 'myhamlib_PYTHON'. Automake installs them into 'myhamlibdir' by default.
+##############################################################################
+myhamlib_PYTHON = \
+ __init__.py \
+ Hamlib.py
+
+# Place them in the exact same directory as the extension: $(pyexecdir)/Hamlib
+myhamlibdir = $(pyexecdir)/Hamlib
+
+##############################################################################
+# 3. Distribute these files (so they're included in 'make dist' tarballs).
+##############################################################################
+EXTRA_DIST += \
+ __init__.py \
+ Hamlib.py
+
+all-py:
install-py:
-clean-py:
-distclean-py:
-uninstall-py:
-
-endif
-# Python
+ @true
+##############################################################################
+# 4. Remove any custom 'install-py:' or 'install-exec-local: install-py'
+# You do NOT need them. Automake already knows how to install these files.
+##############################################################################
+endif # ENABLE_PYTHON
if ENABLE_TCL
##########################################
diff --git a/bindings/py3test.py b/bindings/py3test.py
index 52f85e1e7..9c156234e 100755
--- a/bindings/py3test.py
+++ b/bindings/py3test.py
@@ -1,8 +1,9 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
+import site
# Change this path to match your "make install" path
-sys.path.append('/usr/local/lib/python3.10/site-packages')
+sys.path.append('/usr/local/lib/python3.12/site-packages')
## Uncomment to run this script from an in-tree build (or adjust to the
## build directory) without installing the bindings.
@@ -17,7 +18,9 @@ def StartUp():
print("%s: Python %s; %s\n" \
% (sys.argv[0], sys.version.split()[0], Hamlib.cvar.hamlib_version))
- Hamlib.rig_set_debug(Hamlib.RIG_DEBUG_NONE)
+ print(site.getsitepackages())
+
+ Hamlib.rig_set_debug(0)
# Init RIG_MODEL_DUMMY
my_rig = Hamlib.Rig(Hamlib.RIG_MODEL_DUMMY)
commit af1cab0619c2cead0fb2dbbb1ef380492a1d712d
Author: Michael Black W9MDB <mdb...@ya...>
Date: Sun Jan 19 16:50:30 2025 -0600
Revert "Update python binding to place some files in site-packages/Hamlib"
This reverts commit 8aa487afb8a335b0550b0713a25e2c61d34058e4.
diff --git a/bindings/Makefile.am b/bindings/Makefile.am
index ee20d3810..34272b70c 100644
--- a/bindings/Makefile.am
+++ b/bindings/Makefile.am
@@ -83,47 +83,55 @@ uninstall-perl: ## Hamlib-pl.mk
endif
# Perl
+
if ENABLE_PYTHON
+##########################################
+# Python binding
+
+pyexec_ltlib = _Hamlib.la
+
+MOSTLYCLEANFILES += hamlibpy_wrap.c Hamlib.py *.pyc
+BUILT_SOURCES += hamlibpy_wrap.c Hamlib.py
-##############################################################################
-# 1. We declare a Python extension using 'pyexec_LTLIBRARIES'.
-# - Tells Automake: “Install this .so into $(pyexecdir).”
-# - We override 'pyexec_ltlibdir' to place it in a subdirectory: Hamlib
-##############################################################################
-pyexec_LTLIBRARIES = _Hamlib.la
-pyexec_ltlibdir = $(pyexecdir)/Hamlib
+# Set by AM_CONDITIONAL in configure.ac
+if PYVER_3
+pytest = py3test.py
+else !PYVER_3
+pytest = pytest.py
+endif
+# PYVER_3
+
+example_DATA += $(pytest)
+
+nodist_pyexec_PYTHON = Hamlib.py
+nodist__Hamlib_la_SOURCES = hamlibpy_wrap.c
-_Hamlib_la_SOURCES = hamlibpy_wrap.c
_Hamlib_la_LDFLAGS = -no-undefined -module -avoid-version
-_Hamlib_la_LIBADD = $(top_builddir)/src/libhamlib.la $(PYTHON_LIBS)
-
-##############################################################################
-# 2. We declare a set of Python (.py) files using a custom primary, e.g.
-# 'myhamlib_PYTHON'. Automake installs them into 'myhamlibdir' by default.
-##############################################################################
-myhamlib_PYTHON = \
- __init__.py \
- Hamlib.py
-
-# Place them in the exact same directory as the extension: $(pyexecdir)/Hamlib
-myhamlibdir = $(pyexecdir)/Hamlib
-
-##############################################################################
-# 3. Distribute these files (so they're included in 'make dist' tarballs).
-##############################################################################
-EXTRA_DIST += \
- __init__.py \
- Hamlib.py
-
-all-py:
+_Hamlib_la_LIBADD = $(top_builddir)/src/libhamlib.la $(PYTHON_LIBS)
+_Hamlib_ladir = $(pyexecdir)
+_Hamlib_la_LTLIBRARIES = $(pyexec_ltlib)
+
+all-py: $(pyexec_ltlib)
+
+check-py: all-py
+ $(AM_V_at)PYTHONPATH=$(builddir):$(builddir)/.libs \
+ $(PYTHON) $(srcdir)/$(pytest) \
+ || echo "Python test failed" 1>&2
+
+Hamlib.py: hamlibpy_wrap.c
+
+hamlibpy_wrap.c: hamlib.swg $(SWGDEP)
+ $(AM_V_GEN)$(SWIG) -python $(AM_CPPFLAGS) $(PYTHON_CPPFLAGS) -I$(top_srcdir)/bindings \
+ -o $@ $$(test -f hamlib.swg || echo '$(srcdir)/')hamlib.swg
+
install-py:
- @true
-##############################################################################
-# 4. Remove any custom 'install-py:' or 'install-exec-local: install-py'
-# You do NOT need them. Automake already knows how to install these files.
-##############################################################################
+clean-py:
+distclean-py:
+uninstall-py:
+
+endif
+# Python
-endif # ENABLE_PYTHON
if ENABLE_TCL
##########################################
diff --git a/bindings/py3test.py b/bindings/py3test.py
index 9c156234e..52f85e1e7 100755
--- a/bindings/py3test.py
+++ b/bindings/py3test.py
@@ -1,9 +1,8 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
-import site
# Change this path to match your "make install" path
-sys.path.append('/usr/local/lib/python3.12/site-packages')
+sys.path.append('/usr/local/lib/python3.10/site-packages')
## Uncomment to run this script from an in-tree build (or adjust to the
## build directory) without installing the bindings.
@@ -18,9 +17,7 @@ def StartUp():
print("%s: Python %s; %s\n" \
% (sys.argv[0], sys.version.split()[0], Hamlib.cvar.hamlib_version))
- print(site.getsitepackages())
-
- Hamlib.rig_set_debug(0)
+ Hamlib.rig_set_debug(Hamlib.RIG_DEBUG_NONE)
# Init RIG_MODEL_DUMMY
my_rig = Hamlib.Rig(Hamlib.RIG_MODEL_DUMMY)
commit e3c67131cff0ec24d7142449a98287b33926af2f
Author: Michael Black W9MDB <mdb...@ya...>
Date: Sun Jan 19 16:50:04 2025 -0600
Revert "Add __init__.py"
This reverts commit 7a5bb89690837c53ce4f9c7f7507c75de2fd2092.
diff --git a/bindings/__init__.py b/bindings/__init__.py
deleted file mode 100644
index f07e10cff..000000000
--- a/bindings/__init__.py
+++ /dev/null
@@ -1,25 +0,0 @@
-# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4; encoding:utf-8 -*-
-#
-# Copyright 2002 Ben Escoto <be...@em...>
-# Copyright 2007 Kenneth Loafman <ke...@lo...>
-#
-# This file is part of duplicity.
-#
-# Duplicity is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; either version 2 of the License, or (at your
-# option) any later version.
-#
-# Duplicity is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with duplicity; if not, write to the Free Software Foundation,
-# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-import Hamlib
-
-__version__ = "4.6.1"
-
commit 5401dfeca89f3e735b12742a6f7ee9221bf9b8bc
Author: Michael Black W9MDB <mdb...@ya...>
Date: Sun Jan 19 16:49:49 2025 -0600
\Revert "Try to fix breakage of make distcheck on github"
This reverts commit 4980beb9a9f28a2e6945d19cffd17820c9408911.
diff --git a/bindings/Makefile.am b/bindings/Makefile.am
index c959e4b2e..ee20d3810 100644
--- a/bindings/Makefile.am
+++ b/bindings/Makefile.am
@@ -117,7 +117,6 @@ EXTRA_DIST += \
all-py:
install-py:
-Hamlib.py:
@true
##############################################################################
# 4. Remove any custom 'install-py:' or 'install-exec-local: install-py'
commit c0d0e6ff24e43b97885dc8a4e01c6638a03f3bbc
Author: Michael Black W9MDB <mdb...@ya...>
Date: Sun Jan 19 16:49:39 2025 -0600
Revert "Another attempt to fix github build"
This reverts commit e4019531601331ea79be61dfbdd705a4ed78385a.
diff --git a/bindings/Makefile.am b/bindings/Makefile.am
index b33992c56..c959e4b2e 100644
--- a/bindings/Makefile.am
+++ b/bindings/Makefile.am
@@ -115,9 +115,6 @@ EXTRA_DIST += \
__init__.py \
Hamlib.py
-nodist_myhamlib_PYTHON = Hamlib.py
-myhamlibdir = $(pyexecdir)/Hamlib
-
all-py:
install-py:
Hamlib.py:
commit 09b58274b320f7c36316508510674fa371bd9076
Author: Michael Black W9MDB <mdb...@ya...>
Date: Sun Jan 19 16:49:02 2025 -0600
Revert "Another attempt to fix github build"
This reverts commit 6a4da2cbc5111f708efc7dd8735c41979c27a5c4.
diff --git a/bindings/Makefile.am b/bindings/Makefile.am
index 377668e9f..b33992c56 100644
--- a/bindings/Makefile.am
+++ b/bindings/Makefile.am
@@ -105,8 +105,6 @@ myhamlib_PYTHON = \
__init__.py \
Hamlib.py
-nodist_myhamlib_PYTHON = Hamlib.py
-
# Place them in the exact same directory as the extension: $(pyexecdir)/Hamlib
myhamlibdir = $(pyexecdir)/Hamlib
@@ -117,6 +115,8 @@ EXTRA_DIST += \
__init__.py \
Hamlib.py
+nodist_myhamlib_PYTHON = Hamlib.py
+myhamlibdir = $(pyexecdir)/Hamlib
all-py:
install-py:
commit 8041563c2e628a8fda9452f5e571ddfe184caaab
Author: Michael Black W9MDB <mdb...@ya...>
Date: Sun Jan 19 16:48:51 2025 -0600
Revert "Another attempt to fix github build"
This reverts commit 8c3f13764d9af4c6ecf112657864b4262c097575.
diff --git a/bindings/Makefile.am b/bindings/Makefile.am
index 6bc959b8f..377668e9f 100644
--- a/bindings/Makefile.am
+++ b/bindings/Makefile.am
@@ -107,8 +107,6 @@ myhamlib_PYTHON = \
nodist_myhamlib_PYTHON = Hamlib.py
-Hamlib.py: hamlib_wrap.c
-
# Place them in the exact same directory as the extension: $(pyexecdir)/Hamlib
myhamlibdir = $(pyexecdir)/Hamlib
commit cfc199dac2a4df3995e8214fad48d7eb99935567
Author: Michael Black W9MDB <mdb...@ya...>
Date: Sun Jan 19 16:48:38 2025 -0600
Revert "Another attempt to fix github build"
This reverts commit 0c5c34f8a5515b0064635f9b2e6f210c01280eca.
diff --git a/bindings/Makefile.am b/bindings/Makefile.am
index 2904f3a55..6bc959b8f 100644
--- a/bindings/Makefile.am
+++ b/bindings/Makefile.am
@@ -107,8 +107,7 @@ myhamlib_PYTHON = \
nodist_myhamlib_PYTHON = Hamlib.py
-Hamlib.py: hamlibpy_wrap.c
- @true
+Hamlib.py: hamlib_wrap.c
# Place them in the exact same directory as the extension: $(pyexecdir)/Hamlib
myhamlibdir = $(pyexecdir)/Hamlib
@@ -123,6 +122,7 @@ EXTRA_DIST += \
all-py:
install-py:
+Hamlib.py:
@true
##############################################################################
# 4. Remove any custom 'install-py:' or 'install-exec-local: install-py'
commit f76864a3c46d1ce9a4ec47538131e09f382fea62
Author: Michael Black W9MDB <mdb...@ya...>
Date: Sun Jan 19 16:48:28 2025 -0600
Revert "One more time before I revert all of this"
This reverts commit ad50b0c7837aa4f8759082fdde279178c0d81c3f.
diff --git a/bindings/Makefile.am b/bindings/Makefile.am
index b27be164f..2904f3a55 100644
--- a/bindings/Makefile.am
+++ b/bindings/Makefile.am
@@ -105,6 +105,8 @@ myhamlib_PYTHON = \
__init__.py \
Hamlib.py
+nodist_myhamlib_PYTHON = Hamlib.py
+
Hamlib.py: hamlibpy_wrap.c
@true
@@ -119,7 +121,6 @@ EXTRA_DIST += \
Hamlib.py
-clean-py:
all-py:
install-py:
@true
commit ad50b0c7837aa4f8759082fdde279178c0d81c3f
Author: Michael Black W9MDB <mdb...@ya...>
Date: Sun Jan 19 16:43:43 2025 -0600
One more time before I revert all of this
diff --git a/bindings/Makefile.am b/bindings/Makefile.am
index 2904f3a55..b27be164f 100644
--- a/bindings/Makefile.am
+++ b/bindings/Makefile.am
@@ -105,8 +105,6 @@ myhamlib_PYTHON = \
__init__.py \
Hamlib.py
-nodist_myhamlib_PYTHON = Hamlib.py
-
Hamlib.py: hamlibpy_wrap.c
@true
@@ -121,6 +119,7 @@ EXTRA_DIST += \
Hamlib.py
+clean-py:
all-py:
install-py:
@true
commit 0c5c34f8a5515b0064635f9b2e6f210c01280eca
Author: Michael Black W9MDB <mdb...@ya...>
Date: Sun Jan 19 16:15:19 2025 -0600
Another attempt to fix github build
diff --git a/bindings/Makefile.am b/bindings/Makefile.am
index 6bc959b8f..2904f3a55 100644
--- a/bindings/Makefile.am
+++ b/bindings/Makefile.am
@@ -107,7 +107,8 @@ myhamlib_PYTHON = \
nodist_myhamlib_PYTHON = Hamlib.py
-Hamlib.py: hamlib_wrap.c
+Hamlib.py: hamlibpy_wrap.c
+ @true
# Place them in the exact same directory as the extension: $(pyexecdir)/Hamlib
myhamlibdir = $(pyexecdir)/Hamlib
@@ -122,7 +123,6 @@ EXTRA_DIST += \
all-py:
install-py:
-Hamlib.py:
@true
##############################################################################
# 4. Remove any custom 'install-py:' or 'install-exec-local: install-py'
commit 8c3f13764d9af4c6ecf112657864b4262c097575
Author: Michael Black W9MDB <mdb...@ya...>
Date: Sun Jan 19 16:04:01 2025 -0600
Another attempt to fix github build
diff --git a/bindings/Makefile.am b/bindings/Makefile.am
index 377668e9f..6bc959b8f 100644
--- a/bindings/Makefile.am
+++ b/bindings/Makefile.am
@@ -107,6 +107,8 @@ myhamlib_PYTHON = \
nodist_myhamlib_PYTHON = Hamlib.py
+Hamlib.py: hamlib_wrap.c
+
# Place them in the exact same directory as the extension: $(pyexecdir)/Hamlib
myhamlibdir = $(pyexecdir)/Hamlib
commit 6a4da2cbc5111f708efc7dd8735c41979c27a5c4
Author: Michael Black W9MDB <mdb...@ya...>
Date: Sun Jan 19 15:59:30 2025 -0600
Another attempt to fix github build
diff --git a/bindings/Makefile.am b/bindings/Makefile.am
index b33992c56..377668e9f 100644
--- a/bindings/Makefile.am
+++ b/bindings/Makefile.am
@@ -105,6 +105,8 @@ myhamlib_PYTHON = \
__init__.py \
Hamlib.py
+nodist_myhamlib_PYTHON = Hamlib.py
+
# Place them in the exact same directory as the extension: $(pyexecdir)/Hamlib
myhamlibdir = $(pyexecdir)/Hamlib
@@ -115,8 +117,6 @@ EXTRA_DIST += \
__init__.py \
Hamlib.py
-nodist_myhamlib_PYTHON = Hamlib.py
-myhamlibdir = $(pyexecdir)/Hamlib
all-py:
install-py:
commit e4019531601331ea79be61dfbdd705a4ed78385a
Author: Michael Black W9MDB <mdb...@ya...>
Date: Sun Jan 19 15:58:44 2025 -0600
Another attempt to fix github build
diff --git a/bindings/Makefile.am b/bindings/Makefile.am
index c959e4b2e..b33992c56 100644
--- a/bindings/Makefile.am
+++ b/bindings/Makefile.am
@@ -115,6 +115,9 @@ EXTRA_DIST += \
__init__.py \
Hamlib.py
+nodist_myhamlib_PYTHON = Hamlib.py
+myhamlibdir = $(pyexecdir)/Hamlib
+
all-py:
install-py:
Hamlib.py:
commit 4980beb9a9f28a2e6945d19cffd17820c9408911
Author: Michael Black W9MDB <mdb...@ya...>
Date: Sun Jan 19 15:52:35 2025 -0600
Try to fix breakage of make distcheck on github
diff --git a/bindings/Makefile.am b/bindings/Makefile.am
index ee20d3810..c959e4b2e 100644
--- a/bindings/Makefile.am
+++ b/bindings/Makefile.am
@@ -117,6 +117,7 @@ EXTRA_DIST += \
all-py:
install-py:
+Hamlib.py:
@true
##############################################################################
# 4. Remove any custom 'install-py:' or 'install-exec-local: install-py'
commit 7a5bb89690837c53ce4f9c7f7507c75de2fd2092
Author: Michael Black W9MDB <mdb...@ya...>
Date: Sun Jan 19 15:38:38 2025 -0600
Add __init__.py
diff --git a/bindings/__init__.py b/bindings/__init__.py
new file mode 100644
index 000000000..f07e10cff
--- /dev/null
+++ b/bindings/__init__.py
@@ -0,0 +1,25 @@
+# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4; encoding:utf-8 -*-
+#
+# Copyright 2002 Ben Escoto <be...@em...>
+# Copyright 2007 Kenneth Loafman <ke...@lo...>
+#
+# This file is part of duplicity.
+#
+# Duplicity is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation; either version 2 of the License, or (at your
+# option) any later version.
+#
+# Duplicity is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with duplicity; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+import Hamlib
+
+__version__ = "4.6.1"
+
commit 8aa487afb8a335b0550b0713a25e2c61d34058e4
Author: Michael Black W9MDB <mdb...@ya...>
Date: Sun Jan 19 15:28:05 2025 -0600
Update python binding to place some files in site-packages/Hamlib
https://github.com/Hamlib/Hamlib/issues/1645
diff --git a/bindings/Makefile.am b/bindings/Makefile.am
index 34272b70c..ee20d3810 100644
--- a/bindings/Makefile.am
+++ b/bindings/Makefile.am
@@ -83,55 +83,47 @@ uninstall-perl: ## Hamlib-pl.mk
endif
# Perl
-
if ENABLE_PYTHON
-##########################################
-# Python binding
-
-pyexec_ltlib = _Hamlib.la
-
-MOSTLYCLEANFILES += hamlibpy_wrap.c Hamlib.py *.pyc
-BUILT_SOURCES += hamlibpy_wrap.c Hamlib.py
-# Set by AM_CONDITIONAL in configure.ac
-if PYVER_3
-pytest = py3test.py
-else !PYVER_3
-pytest = pytest.py
-endif
-# PYVER_3
-
-example_DATA += $(pytest)
-
-nodist_pyexec_PYTHON = Hamlib.py
-nodist__Hamlib_la_SOURCES = hamlibpy_wrap.c
+##############################################################################
+# 1. We declare a Python extension using 'pyexec_LTLIBRARIES'.
+# - Tells Automake: “Install this .so into $(pyexecdir).”
+# - We override 'pyexec_ltlibdir' to place it in a subdirectory: Hamlib
+##############################################################################
+pyexec_LTLIBRARIES = _Hamlib.la
+pyexec_ltlibdir = $(pyexecdir)/Hamlib
+_Hamlib_la_SOURCES = hamlibpy_wrap.c
_Hamlib_la_LDFLAGS = -no-undefined -module -avoid-version
-_Hamlib_la_LIBADD = $(top_builddir)/src/libhamlib.la $(PYTHON_LIBS)
-_Hamlib_ladir = $(pyexecdir)
-_Hamlib_la_LTLIBRARIES = $(pyexec_ltlib)
-
-all-py: $(pyexec_ltlib)
-
-check-py: all-py
- $(AM_V_at)PYTHONPATH=$(builddir):$(builddir)/.libs \
- $(PYTHON) $(srcdir)/$(pytest) \
- || echo "Python test failed" 1>&2
-
-Hamlib.py: hamlibpy_wrap.c
-
-hamlibpy_wrap.c: hamlib.swg $(SWGDEP)
- $(AM_V_GEN)$(SWIG) -python $(AM_CPPFLAGS) $(PYTHON_CPPFLAGS) -I$(top_srcdir)/bindings \
- -o $@ $$(test -f hamlib.swg || echo '$(srcdir)/')hamlib.swg
-
+_Hamlib_la_LIBADD = $(top_builddir)/src/libhamlib.la $(PYTHON_LIBS)
+
+##############################################################################
+# 2. We declare a set of Python (.py) files using a custom primary, e.g.
+# 'myhamlib_PYTHON'. Automake installs them into 'myhamlibdir' by default.
+##############################################################################
+myhamlib_PYTHON = \
+ __init__.py \
+ Hamlib.py
+
+# Place them in the exact same directory as the extension: $(pyexecdir)/Hamlib
+myhamlibdir = $(pyexecdir)/Hamlib
+
+##############################################################################
+# 3. Distribute these files (so they're included in 'make dist' tarballs).
+##############################################################################
+EXTRA_DIST += \
+ __init__.py \
+ Hamlib.py
+
+all-py:
install-py:
-clean-py:
-distclean-py:
-uninstall-py:
-
-endif
-# Python
+ @true
+##############################################################################
+# 4. Remove any custom 'install-py:' or 'install-exec-local: install-py'
+# You do NOT need them. Automake already knows how to install these files.
+##############################################################################
+endif # ENABLE_PYTHON
if ENABLE_TCL
##########################################
diff --git a/bindings/py3test.py b/bindings/py3test.py
index 52f85e1e7..9c156234e 100755
--- a/bindings/py3test.py
+++ b/bindings/py3test.py
@@ -1,8 +1,9 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
+import site
# Change this path to match your "make install" path
-sys.path.append('/usr/local/lib/python3.10/site-packages')
+sys.path.append('/usr/local/lib/python3.12/site-packages')
## Uncomment to run this script from an in-tree build (or adjust to the
## build directory) without installing the bindings.
@@ -17,7 +18,9 @@ def StartUp():
print("%s: Python %s; %s\n" \
% (sys.argv[0], sys.version.split()[0], Hamlib.cvar.hamlib_version))
- Hamlib.rig_set_debug(Hamlib.RIG_DEBUG_NONE)
+ print(site.getsitepackages())
+
+ Hamlib.rig_set_debug(0)
# Init RIG_MODEL_DUMMY
my_rig = Hamlib.Rig(Hamlib.RIG_MODEL_DUMMY)
commit 35f86232fada1cfd0af61a1efd97fb175025f1b4
Author: Michael Black W9MDB <mdb...@ya...>
Date: Sat Jan 18 15:56:59 2025 -0600
Fix simulators
diff --git a/simulators/simft450.c b/simulators/simft450.c
index 43fb68920..859db06f9 100644
--- a/simulators/simft450.c
+++ b/simulators/simft450.c
@@ -418,7 +418,7 @@ int main(int argc, char *argv[])
else if (strcmp(buf, "TX;") == 0)
{
hl_usleep(50 * 1000);
- SNPRINTF(buf, sizeof(buf), "TX+%04d;", tx);
+ SNPRINTF(buf, sizeof(buf), "TX%d;", tx);
n = write(fd, buf, strlen(buf));
if (n < 0) { perror("TX"); }
diff --git a/simulators/simic7610.c b/simulators/simic7610.c
index 60ac213c1..e76c4a09c 100644
--- a/simulators/simic7610.c
+++ b/simulators/simic7610.c
@@ -53,6 +53,7 @@ int keyspd = 130; // 130=20WPM
int ipp = 0;
int tx_inhibit = 0;
int dpp = 0;
+int dualwatch = 0;
void dumphex(const unsigned char *buf, int n)
{
@@ -122,6 +123,10 @@ void frameParse(int fd, unsigned char *frame, int len)
return;
}
+ int tmp = frame[2];
+ frame[2] = frame[3];
+ frame[3] = tmp;
+
switch (frame[4])
{
case 0x03:
@@ -201,13 +206,24 @@ void frameParse(int fd, unsigned char *frame, int len)
switch (frame[5])
{
- case 0x00: current_vfo = RIG_VFO_A; break;
-
- case 0x01: current_vfo = RIG_VFO_B; break;
+ case 0xd0: current_vfo = RIG_VFO_A; break;
- case 0xd0: current_vfo = RIG_VFO_MAIN; break;
+ case 0xd1: current_vfo = RIG_VFO_B; break;
- case 0xd1: current_vfo = RIG_VFO_SUB; break;
+ case 0xc2:
+ if (frame[6] == 0xfd)
+ {
+ frame[6] = dualwatch;
+ frame[7] = 0xfd;
+ n = write(fd,frame,8);
+ }
+ else
+ {
+ dualwatch = frame[6];
+ frame[4]=0xfb;
+ frame[5]=0xfd;
+ n = write(fd,frame,6);
+ }
}
printf("set_vfo to %s\n", rig_strvfo(current_vfo));
@@ -796,7 +812,7 @@ int main(int argc, char **argv)
while (1)
{
int len = frameGet(fd, buf);
- printf("#1 ========================================");
+ printf("#1 ========================================\n");
if (len <= 0)
{
diff --git a/simulators/simic9100.c b/simulators/simic9100.c
index 9e6a66950..ba490d999 100644
--- a/simulators/simic9100.c
+++ b/simulators/simic9100.c
@@ -202,6 +202,8 @@ void frameParse(int fd, unsigned char *frame, int len)
frame[4] = 0xfb;
frame[5] = 0xfd;
+printf("+++++++++++++++ SETTING VFO +++++++++++++++++\n");
+ dump_hex(frame, 6);
WRITE(fd, frame, 6);
break;
diff --git a/simulators/simic9700.c b/simulators/simic9700.c
index cd85836d2..bfaea8baf 100644
--- a/simulators/simic9700.c
+++ b/simulators/simic9700.c
@@ -120,6 +120,10 @@ void frameParse(int fd, unsigned char *frame, int len)
return;
}
+ int tmp = frame[2];
+ frame[2] = frame[3];
+ frame[3] = tmp;
+
switch (frame[4])
{
case 0x03:
diff --git a/simulators/simxiegux6100.c b/simulators/simxiegux6100.c
index 9720047e0..fc804fad8 100644
--- a/simulators/simxiegux6100.c
+++ b/simulators/simxiegux6100.c
@@ -77,6 +77,7 @@ frameGet(int fd, unsigned char *buf)
void frameParse(int fd, unsigned char *frame, int len)
{
double freq;
+ int n=0;
dumphex(frame, len);
@@ -87,6 +88,10 @@ void frameParse(int fd, unsigned char *frame, int len)
return;
}
+ int tmp = frame[2];
+ frame[2] = frame[3];
+ frame[3] = tmp;
+
switch (frame[4])
{
case 0x03:
@@ -104,7 +109,7 @@ void frameParse(int fd, unsigned char *frame, int len)
}
frame[10] = 0xfd;
- write(fd, frame, 11);
+ n = write(fd, frame, 11);
break;
@@ -123,7 +128,7 @@ void frameParse(int fd, unsigned char *frame, int len)
}
frame[7] = 0xfd;
- write(fd, frame, 8);
+ n = write(fd, frame, 8);
break;
case 0x05:
@@ -135,7 +140,7 @@ void frameParse(int fd, unsigned char *frame, int len)
frame[4] = 0xfb;
frame[5] = 0xfd;
- write(fd, frame, 6);
+ n = write(fd, frame, 6);
break;
case 0x06:
@@ -144,7 +149,7 @@ void frameParse(int fd, unsigned char *frame, int len)
frame[4] = 0xfb;
frame[5] = 0xfd;
- write(fd, frame, 6);
+ n = write(fd, frame, 6);
break;
case 0x07:
@@ -163,7 +168,7 @@ void frameParse(int fd, unsigned char *frame, int len)
frame[4] = 0xfb;
frame[5] = 0xfd;
- write(fd, frame, 6);
+ n = write(fd, frame, 6);
break;
case 0x0f:
@@ -173,7 +178,7 @@ void frameParse(int fd, unsigned char *frame, int len)
printf("set split %d\n", 1);
frame[4] = 0xfb;
frame[5] = 0xfd;
- write(fd, frame, 6);
+ n = write(fd, frame, 6);
break;
#if 0
@@ -194,9 +199,9 @@ void frameParse(int fd, unsigned char *frame, int len)
frame[5] = ant_curr;
frame[6] = ant_option;
frame[7] = 0xfd;
- printf("n=write 8 bytes\n");
+ printf("n=n = write 8 bytes\n");
dump_hex(frame, 8);
- write(fd, frame, 8);
+ n = write(fd, frame, 8);
break;
#endif
@@ -211,7 +216,7 @@ void frameParse(int fd, unsigned char *frame, int len)
printf("Using AF level %d\n", level);
to_bcd(&frame[6], (long long) level, 2);
frame[8] = 0xfd;
- write(fd, frame, 9);
+ n = write(fd, frame, 9);
break;
case 0x0a:
@@ -222,7 +227,7 @@ void frameParse(int fd, unsigned char *frame, int len)
to_bcd(&frame[6], (long long)power_level, 2);
frame[8] = 0xfd;
- write(fd, frame, 9);
+ n = write(fd, frame, 9);
break;
case 0x0c:
@@ -234,14 +239,14 @@ void frameParse(int fd, unsigned char *frame, int len)
printf("subcmd=0x0c #1\n");
keyspd = from_bcd(&frame[6], 2);
frame[6] = 0xfb;
- write(fd, frame, 7);
+ n = write(fd, frame, 7);
}
else
{
printf("subcmd=0x0c #1\n");
to_bcd(&frame[6], keyspd, 2);
frame[8] = 0xfd;
- write(fd, frame, 9);
+ n = write(fd, frame, 9);
}
break;
@@ -263,7 +268,7 @@ void frameParse(int fd, unsigned char *frame, int len)
to_bcd(&frame[6], (long long)meter_level, 2);
frame[8] = 0xfd;
- write(fd, frame, 9);
+ n = write(fd, frame, 9);
break;
}
@@ -274,7 +279,7 @@ void frameParse(int fd, unsigned char *frame, int len)
case 0x18: // miscellaneous things
frame[5] = 1;
frame[6] = 0xfd;
- write(fd, frame, 7);
+ n = write(fd, frame, 7);
break;
#endif
@@ -282,7 +287,7 @@ void frameParse(int fd, unsigned char *frame, int len)
frame[6] = 0x61;
frame[7] = 0x00;
frame[8] = 0xfd;
- write(fd, frame, 9);
+ n = write(fd, frame, 9);
break;
case 0x1a: // miscellaneous things
@@ -293,7 +298,7 @@ void frameParse(int fd, unsigned char *frame, int len)
else { frame[6] = widthB; }
frame[7] = 0xfd;
- write(fd, frame, 8);
+ n = write(fd, frame, 8);
break;
}
@@ -307,14 +312,14 @@ void frameParse(int fd, unsigned char *frame, int len)
{
frame[6] = ptt;
frame[7] = 0xfd;
- write(fd, frame, 8);
+ n = write(fd, frame, 8);
}
else
{
ptt = frame[6];
frame[7] = 0xfb;
frame[8] = 0xfd;
- write(fd, frame, 9);
+ n = write(fd, frame, 9);
}
break;
@@ -341,7 +346,7 @@ void frameParse(int fd, unsigned char *frame, int len)
}
frame[11] = 0xfd;
- write(fd, frame, 12);
+ n = write(fd, frame, 12);
}
else
{
@@ -353,7 +358,7 @@ void frameParse(int fd, unsigned char *frame, int len)
frame[4] = 0xfb;
frame[5] = 0xfd;
- write(fd, frame, 6);
+ n = write(fd, frame, 6);
}
break;
@@ -369,7 +374,7 @@ void frameParse(int fd, unsigned char *frame, int len)
frame[7] = frame[5] == 0 ? datamodeA : datamodeB;
frame[8] = 0xfb;
frame[9] = 0xfd;
- write(fd, frame, 10);
+ n = write(fd, frame, 10);
}
else
{
@@ -388,7 +393,7 @@ void frameParse(int fd, unsigned char *frame, int len)
frame[4] = 0xfb;
frame[5] = 0xfd;
- write(fd, frame, 6);
+ n = write(fd, frame, 6);
}
printf("\n");
@@ -410,6 +415,7 @@ void frameParse(int fd, unsigned char *frame, int len)
}
// don't care about the rig type yet
+ if (n == 0) printf("write failed?\n");
}
commit 517a8918ab88fbd80ba45d87c0884e3d1ca67856
Author: Michael Black W9MDB <mdb...@ya...>
Date: Sat Jan 18 15:56:24 2025 -0600
Update ax_python_devel.m4 to fix installation problems
diff --git a/macros/ax_python_devel.m4 b/macros/ax_python_devel.m4
old mode 100644
new mode 100755
index 1df46a9cf..780584eae
--- a/macros/ax_python_devel.m4
+++ b/macros/ax_python_devel.m4
@@ -67,7 +67,7 @@
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.
-#serial 23
+#serial 32
AU_ALIAS([AC_PYTHON_DEVEL], [AX_PYTHON_DEVEL])
AC_DEFUN([AX_PYTHON_DEVEL],[
@@ -112,15 +112,39 @@ to something else than an empty string.
fi
#
- # if the macro parameter ``version'' is set, honour it
+ # If the macro parameter ``version'' is set, honour it.
+ # A Python shim class, VPy, is used to implement correct version comparisons via
+ # string expressions, since e.g. a naive textual ">= 2.7.3" won't work for
+ # Python 2.7.10 (the ".1" being evaluated as less than ".3").
#
if test -n "$1"; then
AC_MSG_CHECKING([for a version of Python $1])
- ac_supports_python_ver=`$PYTHON -c "import sys; \
- ver = sys.version.split ()[[0]]; \
+ cat << EOF > ax_python_devel_vpy.py
+class VPy:
+ def vtup(self, s):
+ return tuple(map(int, s.strip().replace("rc", ".").split(".")))
+ def __init__(self):
+ import sys
+ self.vpy = tuple(sys.version_info)
+ def __eq__(self, s):
+ return self.vpy == self.vtup(s)
+ def __ne__(self, s):
+ return self.vpy != self.vtup(s)
+ def __lt__(self, s):
+ return self.vpy < self.vtup(s)
+ def __gt__(self, s):
+ return self.vpy > self.vtup(s)
+ def __le__(self, s):
+ return self.vpy <= self.vtup(s)
+ def __ge__(self, s):
+ return self.vpy >= self.vtup(s)
+EOF
+ ac_supports_python_ver=`$PYTHON -c "import ax_python_devel_vpy; \
+ ver = ax_python_devel_vpy.VPy(); \
print (ver $1)"`
+ rm -rf ax_python_devel_vpy*.py* __pycache__/ax_python_devel_vpy*.py*
if test "$ac_supports_python_ver" = "True"; then
- AC_MSG_RESULT([yes])
+ AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
AC_MSG_ERROR([this package requires Python $1.
@@ -208,7 +232,7 @@ EOD`
ac_python_version=$PYTHON_VERSION
else
ac_python_version=`$PYTHON -c "import sys; \
- print (sys.version[[:3]])"`
+ print ("%d.%d" % sys.version_info[[:2]])"`
fi
fi
@@ -251,7 +275,7 @@ EOD`
ac_python_libdir=`$PYTHON -c \
"from sysconfig import get_python_lib as f; \
import os; \
- print ('Using old way' + os.path.join(f(plat_specific=1, standard_lib=1), 'config'));"`
+ print (os.path.join(f(plat_specific=1, standard_lib=1), 'config'));"`
PYTHON_LIBS="-L$ac_python_libdir -lpython$ac_python_version"
fi
@@ -268,14 +292,24 @@ EOD`
#
# Check for site packages
#
- AC_MSG_CHECKING([for Python site-packages pathXX $PYTHON_SITE_PKG])
+ AC_MSG_CHECKING([for Python site-packages path])
if test -z "$PYTHON_SITE_PKG"; then
- AC_MSG_CHECKING([Using PYTHON_SITE_PKG])
if test "$IMPORT_SYSCONFIG" = "import sysconfig"; then
- PYTHON_SITE_PKG=`$PYTHON -c "$IMPORT_SYSCONFIG; \
- print (sysconfig.get_path('purelib'));"`
+ PYTHON_SITE_PKG=`$PYTHON -c "
+$IMPORT_SYSCONFIG;
+if hasattr(sysconfig, 'get_default_scheme'):
+ scheme = sysconfig.get_default_scheme()
+else:
+ scheme = sysconfig._get_default_scheme()
+if scheme == 'posix_local':
+ # Debian's default scheme installs to /usr/local/ but we want to find headers in /usr/
+ scheme = 'posix_prefix'
+prefix = '$prefix'
+if prefix == 'NONE':
+ prefix = '$ac_default_prefix'
+sitedir = sysconfig.get_path('purelib', scheme, vars={'base': prefix})
+print(sitedir)"`
else
- AC_MSG_CHECKING([Using old way])
# distutils.sysconfig way
PYTHON_SITE_PKG=`$PYTHON -c "$IMPORT_SYSCONFIG; \
print (sysconfig.get_python_lib(0,0));"`
@@ -288,10 +322,22 @@ EOD`
# Check for platform-specific site packages
#
AC_MSG_CHECKING([for Python platform specific site-packages path])
- if test -z "$PYTHON_SITE_PKG"; then
+ if test -z "$PYTHON_PLATFORM_SITE_PKG"; then
if test "$IMPORT_SYSCONFIG" = "import sysconfig"; then
- PYTHON_PLATFORM_SITE_PKG=`$PYTHON -c "$IMPORT_SYSCONFIG; \
- print (sysconfig.get_path('platlib'));"`
+ PYTHON_PLATFORM_SITE_PKG=`$PYTHON -c "
+$IMPORT_SYSCONFIG;
+if hasattr(sysconfig, 'get_default_scheme'):
+ scheme = sysconfig.get_default_scheme()
+else:
+ scheme = sysconfig._get_default_scheme()
+if scheme == 'posix_local':
+ # Debian's default scheme installs to /usr/local/ but we want to find headers in /usr/
+ scheme = 'posix_prefix'
+prefix = '$prefix'
+if prefix == 'NONE':
+ prefix = '$ac_default_prefix'
+sitedir = sysconfig.get_path('platlib', scheme, vars={'platbase': prefix})
+print(sitedir)"`
else
# distutils.sysconfig way
PYTHON_PLATFORM_SITE_PKG=`$PYTHON -c "$IMPORT_SYSCONFIG; \
@@ -333,7 +379,7 @@ EOD`
ac_save_LIBS="$LIBS"
ac_save_LDFLAGS="$LDFLAGS"
ac_save_CPPFLAGS="$CPPFLAGS"
- LIBS="$ac_save_LIBS $PYTHON_LIBS $PYTHON_EXTRA_LIBS $PYTHON_EXTRA_LIBS"
+ LIBS="$ac_save_LIBS $PYTHON_LIBS $PYTHON_EXTRA_LIBS"
LDFLAGS="$ac_save_LDFLAGS $PYTHON_EXTRA_LDFLAGS"
CPPFLAGS="$ac_save_CPPFLAGS $PYTHON_CPPFLAGS"
AC_LANG_PUSH([C])
@@ -349,7 +395,7 @@ EOD`
AC_MSG_RESULT([$pythonexists])
- if test ! "x$pythonexists" = "xyes"; then
+ if test ! "x$pythonexists" = "xyes"; then
AC_MSG_FAILURE([
Could not link test program to Python. Maybe the main Python library has been
installed in some non-standard library path. If so, pass it to configure,
commit bedbfff8c4c574dad9bd14cc620d4c2683afe9ed
Author: Michael Black W9MDB <mdb...@ya...>
Date: Sat Jan 18 15:55:54 2025 -0600
Remove unnecessary include
diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h
index 06f0fd428..6db75e359 100644
--- a/include/hamlib/rig.h
+++ b/include/hamlib/rig.h
@@ -52,7 +52,7 @@
#else
//#include <sys/socket.h> // doesn't seem we need this
#include <netinet/in.h>
-#include <arpa/inet.h>
+//#include <arpa/inet.h>
#endif
// mingw64 still shows __TIMESIZE != 64
commit a985b50eea15f8f8c8f376888e639dbb7c05daaa
Author: Michael Black W9MDB <mdb...@ya...>
Date: Wed Jan 15 08:11:02 2025 -0600
Fix IC9100 rigctld startup where it was starting on VFOA and ending up on VFOB
https://github.com/Hamlib/Hamlib/issues/1656
diff --git a/rigs/icom/ic9100.c b/rigs/icom/ic9100.c
index eab9239e4..65c2a3dcd 100644
--- a/rigs/icom/ic9100.c
+++ b/rigs/icom/ic9100.c
@@ -111,12 +111,15 @@ static const struct icom_priv_caps ic9100_priv_caps =
.data_mode_supported = 1
};
+// borrow this as they behave the same
+extern int ic9700_set_vfo(RIG *rig, vfo_t vfo);
+
struct rig_caps ic9100_caps =
{
RIG_MODEL(RIG_MODEL_IC9100),
.model_name = "IC-9100",
.mfg_name = "Icom",
- .version = BACKEND_VER ".5",
+ .version = BACKEND_VER ".6",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
@@ -250,8 +253,7 @@ struct rig_caps ic9100_caps =
.get_mode = icom_get_mode,
.set_mode = icom_set_mode,
-
- .set_vfo = icom_set_vfo,
+ .set_vfo = ic9700_set_vfo,
// .get_vfo = icom_get_vfo,
.set_ant = icom_set_ant,
.get_ant = icom_get_ant,
diff --git a/src/rig.c b/src/rig.c
index 813513293..fce0b168a 100644
--- a/src/rig.c
+++ b/src/rig.c
@@ -1547,7 +1547,7 @@ int HAMLIB_API rig_open(RIG *rig)
{
vfo_t myvfo = RIG_VFO_A;
- if (rig->caps->rig_model == RIG_MODEL_IC9700) { myvfo = RIG_VFO_MAIN_A; }
+ if (rig->caps->rig_model == RIG_MODEL_IC9700 || rig->caps->rig_model == RIG_MODEL_IC9100) { myvfo = RIG_VFO_MAIN_A; }
retval = rig_get_freq(rig, myvfo, &freq);
@@ -1557,7 +1557,7 @@ int HAMLIB_API rig_open(RIG *rig)
vfo_t tx_vfo = RIG_VFO_NONE;
myvfo = RIG_VFO_B;
- if (rig->caps->rig_model == RIG_MODEL_IC9700) { myvfo = RIG_VFO_MAIN_B; }
+ if (rig->caps->rig_model == RIG_MODEL_IC9700 || rig->caps->rig_model == RIG_MODEL_IC9100) { myvfo = RIG_VFO_MAIN_B; }
rig_get_freq(rig, myvfo, &freq);
rig_get_split_vfo(rig, RIG_VFO_RX, &split, &tx_vfo);
@@ -1570,7 +1570,7 @@ int HAMLIB_API rig_open(RIG *rig)
{
myvfo = RIG_VFO_A;
- if (rig->caps->rig_model == RIG_MODEL_IC9700) { myvfo = RIG_VFO_MAIN_A; }
+ if (rig->caps->rig_model == RIG_MODEL_IC9700 || rig->caps->rig_model == RIG_MODEL_IC9100) { myvfo = RIG_VFO_MAIN_A; }
rig_get_mode(rig, myvfo, &mode, &width);
@@ -1578,7 +1578,7 @@ int HAMLIB_API rig_open(RIG *rig)
{
myvfo = RIG_VFO_B;
- if (rig->caps->rig_model == RIG_MODEL_IC9700) { myvfo = RIG_VFO_MAIN_A; }
+ if (rig->caps->rig_model == RIG_MODEL_IC9700 || rig->caps->rig_model == RIG_MODEL_IC9100) { myvfo = RIG_VFO_MAIN_A; }
rig_debug(RIG_DEBUG_VERBOSE, "xxxsplit=%d\n", split);
HAMLIB_TRACE;
@@ -2373,6 +2373,7 @@ int rig_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
rig_set_cache_freq(rig, vfo, freq_new);
+ rig_debug(RIG_DEBUG_ERR, "%s: vfo=%s, save=%s\n", __func__, rig_strvfo(vfo), rig_strvfo(vfo_save));
if (vfo != vfo_save && vfo != RIG_VFO_CURR)
{
HAMLIB_TRACE;
@@ -2539,8 +2540,9 @@ int HAMLIB_API rig_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
// WSJT-X senses rig precision with 55 and 56 Hz values
// We do not want to allow cache response with these values
int wsjtx_special = ((long) * freq % 100) == 55 || ((long) * freq % 100) == 56;
+ int rig_special = rig->caps->rig_model == RIG_MODEL_IC9100;
- if (!wsjtx_special && *freq != 0 && (cache_ms_freq < cachep->timeout_ms
+ if (!rig_special && !wsjtx_special && *freq != 0 && (cache_ms_freq < cachep->timeout_ms
|| (cachep->timeout_ms == HAMLIB_CACHE_ALWAYS
|| rs->use_cached_freq)))
{
commit 24d67437b78aeb9d0c7925450bda9839ebd7c31a
Author: Michael Black W9MDB <mdb...@ya...>
Date: Sun Jan 12 12:43:39 2025 -0600
Remove include of sys/socket.h from rig.h -- doesn't seem we need it and breaks grig build
https://github.com/Hamlib/Hamlib/issues/1655
diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h
index 879c31c3d..06f0fd428 100644
--- a/include/hamlib/rig.h
+++ b/include/hamlib/rig.h
@@ -50,7 +50,7 @@
#include <windows.h>
#include <ws2tcpip.h>
#else
-#include <sys/socket.h>
+//#include <sys/socket.h> // doesn't seem we need this
#include <netinet/in.h>
#include <arpa/inet.h>
#endif
commit 46143578ae3853db6054e73be5867bd69cadff29
Author: Michael Black W9MDB <mdb...@ya...>
Date: Wed Jan 8 06:33:42 2025 -0600
Remove QMX from QDX entry
diff --git a/rigs/kenwood/ts480.c b/rigs/kenwood/ts480.c
index 5a466a36a..4cb0eb789 100644
--- a/rigs/kenwood/ts480.c
+++ b/rigs/kenwood/ts480.c
@@ -1740,9 +1740,9 @@ struct rig_caps trudx_caps =
struct rig_caps qrplabs_caps =
{
RIG_MODEL(RIG_MODEL_QRPLABS),
- .model_name = "QCX/QDX/QMX",
+ .model_name = "QCX/QDX",
.mfg_name = "QRPLabs",
- .version = BACKEND_VER ".3",
+ .version = BACKEND_VER ".4",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
commit 8636901bf3a74a6a5af5c89df12393adcc0ae3f6
Author: Michael Black W9MDB <mdb...@ya...>
Date: Tue Jan 7 16:56:52 2025 -0600
Fix IC746 and IC746PRO set mode to not use data byte
diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c
index 5fd927b17..cd05edcdb 100644
--- a/rigs/icom/icom.c
+++ b/rigs/icom/icom.c
@@ -2289,6 +2289,8 @@ static int icom_set_mode_without_data(RIG *rig, vfo_t vfo, rmode_t mode,
|| RIG_IS_IC375
|| RIG_IS_IC726
|| RIG_IS_IC475
+ || RIG_IS_IC746
+ || RIG_IS_IC746PRO
|| RIG_IS_IC756
|| RIG_IS_IC756PROII
|| RIG_IS_IC756PROIII
diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h
index c78c64e55..47d99d91d 100644
--- a/rigs/icom/icom.h
+++ b/rigs/icom/icom.h
@@ -35,7 +35,7 @@
#include <sys/time.h>
#endif
-#define BACKEND_VER "20241203"
+#define BACKEND_VER "20250107"
#define ICOM_IS_ID31 rig_is_model(rig, RIG_MODEL_ID31)
#define ICOM_IS_ID51 rig_is_model(rig, RIG_MODEL_ID51)
commit 33adef942e4e3227be56d0b9a2f5a3b5b7b43010
Author: Michael Black W9MDB <mdb...@ya...>
Date: Tue Jan 7 09:03:34 2025 -0600
Seperate QMX from QDX due to incompatible modes in FLRig
https://github.com/Hamlib/Hamlib/issues/1653
diff --git a/include/hamlib/riglist.h b/include/hamlib/riglist.h
index 7b1579e23..768c40691 100644
--- a/include/hamlib/riglist.h
+++ b/include/hamlib/riglist.h
@@ -208,6 +208,7 @@
#define RIG_MODEL_THETIS RIG_MAKE_MODEL(RIG_KENWOOD, 54)
#define RIG_MODEL_TRUSDX RIG_MAKE_MODEL(RIG_KENWOOD, 55)
#define RIG_MODEL_SDRCONSOLE RIG_MAKE_MODEL(RIG_KENWOOD, 56)
+#define RIG_MODEL_QRPLABS_QMX RIG_MAKE_MODEL(RIG_KENWOOD,57)
/*
* Icom
diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c
index fc6d2f2d8..d2e444a45 100644
--- a/rigs/kenwood/kenwood.c
+++ b/rigs/kenwood/kenwood.c
@@ -6532,6 +6532,7 @@ DECLARE_INITRIG_BACKEND(kenwood)
rig_register(&tx500_caps);
rig_register(&sdruno_caps);
rig_register(&qrplabs_caps);
+ rig_register(&qrplabs_qmx_caps);
rig_register(&fx4_caps);
rig_register(&thetis_caps);
rig_register(&trudx_caps);
diff --git a/rigs/kenwood/kenwood.h b/rigs/kenwood/kenwood.h
index 4fbd214bb..f1b2d0e07 100644
--- a/rigs/kenwood/kenwood.h
+++ b/rigs/kenwood/kenwood.h
@@ -334,6 +334,7 @@ extern struct rig_caps malachite_caps;
extern struct rig_caps tx500_caps;
extern struct rig_caps sdruno_caps;
extern struct rig_caps qrplabs_caps;
+extern struct rig_caps qrplabs_qmx_caps;
extern struct rig_caps fx4_caps;
extern struct rig_caps thetis_caps;
extern struct rig_caps trudx_caps;
diff --git a/rigs/kenwood/ts480.c b/rigs/kenwood/ts480.c
index 66fe2f130..5a466a36a 100644
--- a/rigs/kenwood/ts480.c
+++ b/rigs/kenwood/ts480.c
@@ -36,6 +36,7 @@
#define TS480_ALL_MODES (RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|RIG_MODE_FM|RIG_MODE_RTTY|RIG_MODE_RTTYR)
#define SDRUNO_ALL_MODES (RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|RIG_MODE_FM|RIG_MODE_RTTY|RIG_MODE_RTTYR|RIG_MODE_PKTUSB)
#define PS8000A_ALL_MODES (RIG_MODE_AM|RIG_MODE_AMS|RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|RIG_MODE_FM|RIG_MODE_RTTY|RIG_MODE_RTTYR)
+#define QMX_ALL_MODES (RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_PKTUSB|RIG_MODE_PKTLSB)
#define TS480_OTHER_TX_MODES (RIG_MODE_CW|RIG_MODE_SSB|RIG_MODE_FM|RIG_MODE_RTTY)
#define TS480_AM_TX_MODES RIG_MODE_AM
@@ -1937,6 +1938,67 @@ struct rig_caps qrplabs_caps =
.hamlib_check_rig_caps = HAMLIB_CHECK_RIG_CAPS
};
+struct rig_caps qrplabs_qmx_caps =
+{
+ RIG_MODEL(RIG_MODEL_QRPLABS_QMX),
+ .model_name = "QMX",
+ .mfg_name = "QRPLabs",
+ .version = BACKEND_VER ".1",
+ .copyright = "LGPL",
+ .status = RIG_STATUS_BETA,
+ .rig_type = RIG_TYPE_TRANSCEIVER,
+ .ptt_type = RIG_PTT_RIG,
+ .dcd_type = RIG_DCD_RIG,
+ .port_type = RIG_PORT_SERIAL,
+ .serial_rate_min = 9600,
+ .serial_rate_max = 256000,
+ .serial_data_bits = 8,
+ .serial_stop_bits = 1,
+ .serial_parity = RIG_PARITY_NONE,
+ .serial_handshake = RIG_HANDSHAKE_NONE,
+ .write_delay = 0,
+ .post_write_delay = 0,
+ .timeout = 500,
+ .retry = 3,
+ .preamp = {12, RIG_DBLST_END,},
+ .attenuator = {12, RIG_DBLST_END,},
+ .targetable_vfo = RIG_TARGETABLE_FREQ,
+ .transceive = RIG_TRN_RIG,
+
+ .rx_range_list1 = {
+ {MHz(4), MHz(14), QMX_ALL_MODES, -1, -1, TS480_VFO},
+ RIG_FRNG_END,
+ }, /*!< Receive frequency range list for ITU region 1 */
+ .tx_range_list1 = {
+ {MHz(4), MHz(14), QMX_ALL_MODES, 5000, 100000, TS480_VFO},
+ RIG_FRNG_END,
+ }, /*!< Transmit frequency range list for ITU region 1 */
+ /* mode/filter list, remember: order matters! */
+ .filters = {
+ {RIG_MODE_SSB | RIG_MODE_PKTUSB | RIG_MODE_PKTLSB, kHz(3.2)},
+ {RIG_MODE_CW | RIG_MODE_CWR, Hz(300)},
+ RIG_FLT_END,
+ },
+
+ .rig_init = ts480_init,
+ .rig_open = qrplabs_open,
+ .rig_cleanup = kenwood_cleanup,
+ .set_freq = kenwood_set_freq,
+ .get_freq = kenwood_get_freq,
+ .set_mode = kenwood_set_mode,
+ .get_mode = kenwood_get_mode,
+ .set_vfo = kenwood_set_vfo,
+ .get_vfo = kenwood_get_vfo_if,
+ .set_split_vfo = kenwood_set_split_vfo,
+ .get_split_vfo = kenwood_get_split_vfo_if,
+ .get_ptt = kenwood_get_ptt,
+ .set_ptt = kenwood_set_ptt,
+ .get_info = kenwood_ts480_get_info,
+ .get_clock = qrplabs_get_clock,
+ .set_clock = qrplabs_set_clock,
+ .hamlib_check_rig_caps = HAMLIB_CHECK_RIG_CAPS
+};
+
/*
* Hilberling PT8000A TS480 emulation
* Notice that some rigs share the same functions.
commit d2065fe781b1213c1458565eb4fe40227bb657f3
Author: Michael Black W9MDB <mdb...@ya...>
Date: Tue Jan 7 07:54:00 2025 -0600
Add DIGI-U and DIGI-L to possible modes from FLRig
https://github.com/Hamlib/Hamlib/issues/1653
diff --git a/rigs/dummy/flrig.c b/rigs/dummy/flrig.c
index b56f87453..f6a3620d8 100644
--- a/rigs/dummy/flrig.c
+++ b/rigs/dummy/flrig.c
@@ -143,7 +143,7 @@ struct rig_caps flrig_caps =
RIG_MODEL(RIG_MODEL_FLRIG),
.model_name = "",
.mfg_name = "FLRig",
- .version = "20241204.0",
+ .version = "20250107.0",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
@@ -1056,7 +1056,9 @@ static int flrig_open(RIG *rig)
else if (streq(p, "DIG")) { modeMapAdd(&modes, RIG_MODE_PKTUSB, p); }
else if (streq(p, "DIGI")) { modeMapAdd(&modes, RIG_MODE_PKTUSB, p); }
else if (streq(p, "DIGL")) { modeMapAdd(&modes, RIG_MODE_PKTLSB, p); }
+ else if (streq(p, "DIGI-L")) { modeMapAdd(&modes, RIG_MODE_PKTLSB, p); }
else if (streq(p, "DIGU")) { modeMapAdd(&modes, RIG_MODE_PKTUSB, p); }
+ else if (streq(p, "DIGI-U")) { modeMapAdd(&modes, RIG_MODE_PKTUSB, p); }
else if (streq(p, "DSB")) { modeMapAdd(&modes, RIG_MODE_DSB, p); }
else if (streq(p, "FM")) { modeMapAdd(&modes, RIG_MODE_FM, p); }
else if (streq(p, "FM-D")) { modeMapAdd(&modes, RIG_MODE_PKTFM, p); }
commit d1e0e3f204d3b0f5b3a17e83a50d360184136e0d
Author: Michael Black W9MDB <mdb...@ya...>
Date: Tue Jan 7 07:52:08 2025 -0600
Let kenwood serial read remove non-printable chars from responses
Should help it be a bit more robust against bad serial data like this
https://github.com/Hamlib/Hamlib/issues/1652
diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c
index 3cca97103..fc6d2f2d8 100644
--- a/rigs/kenwood/kenwood.c
+++ b/rigs/kenwood/kenwood.c
@@ -231,6 +231,23 @@ struct confparams kenwood_cfg_params[] =
{ RIG_CONF_END, NULL, }
};
+int remove_nonprint(char *s)
+{
+ int i, j = 0;
+ if (s == NULL) return 0;
+
+ for (i = 0; s[i] != '\0'; ++i)
+ {
+ if (isprint((unsigned char)s[i]))
+ {
+ s[j++] = s[i]; // Copy printable character
+ }
+ }
+ s[j] = '\0'; // Null-terminate the string
+
+ return j; // Return the new length of the string
+}
+
/**
* kenwood_transaction
@@ -424,6 +441,10 @@ transaction_read:
rig_debug(RIG_DEBUG_TRACE, "%s: read_string len=%d '%s'\n", __func__,
(int)strlen(buffer), buffer);
+ // this fixes the case when some corrupt...
[truncated message content] |
|
From: n0nb <n0...@us...> - 2024-12-30 12:15:11
|
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 028d750249ab00c8c362598c838b15e8aa6a2951 (commit)
via ac8a8b2027983f6710f29abc170555607b4796c9 (commit)
via 728d0a543290d23c4f19023f15845e1ca0e7fc3f (commit)
via 601dd1361cbc897b41c989a10dca2e2bb191a112 (commit)
via f2a9f091d08667db9d3fc2e842a427af7cfb990e (commit)
via 028e8f38cdcbeb1165688ed75fadac5dec603245 (commit)
via 1211da41d05c62797069caa63181687040db66c9 (commit)
via bf7d5c322b59683ddb3cc865abf6df31bb2b5061 (commit)
via 5d8593dd733253ddea9d15aacebdfb216f3b8f4a (commit)
via eb7a828f5e00c42cef4b9989a44e3a8d70c5ff11 (commit)
via 0ad5924050247f4a8fc4f79ed9881614c2e72817 (commit)
via f173673695fe6fd535beba0d9690c936c95447d5 (commit)
via 70708fdf7f388b1c80da10edc17daf53996e9ed2 (commit)
via 57c145d5d15e0aab7d62e5bbcba871c9a55d05ec (commit)
via f00e4f4708e3fa8f6a6976367a6264b58a1365e9 (commit)
via 8edf99fc187b7b462fa297d885cda89b172bb5d3 (commit)
via 9ac7f92d1ef1574bfb463d1a79ee90d0f5752312 (commit)
via e0a805ebc3283eb7bd878addc4479d7f0c37e722 (commit)
via 15d7242d5ad3df90088cc7e1cc49b0484db6a1a0 (commit)
via 8589d5c6bc24809cae1c8cfbdab589b92641d9db (commit)
via f9185d1d2469fad84aa925396606c6b752b17e49 (commit)
via e262fb82c262f1b6e279e337f1642a6689256f94 (commit)
via e56f8187614b2702fb584117a006a2e789ceea3f (commit)
via d5dd12d50d824d4655f4c3a0e8b3cffdc464df56 (commit)
via 45cc53a5265677f572f4526d750ee546bb4390c4 (commit)
via 750adb40b53f89889b802bc64100ce095f114dc2 (commit)
via b763761d9e307b4023e8a28d1dcbdc0116a5ff12 (commit)
via d302b8fabd713cfbebd53679ad5fb685122903cc (commit)
via fe45fa2dfc15f2152d6294e7457ae218df972a0f (commit)
via 86518546db30c22a42c5ddc12e68434c4ed3f8ee (commit)
via 13f7b01d279a14078b485b9af4e999d3d4f8f5c7 (commit)
via 62b0a25a3ddab25c65de373dd6a83d812af5a9f1 (commit)
via 57c5047c3ec662cd102961346ed1d4957ea88b5b (commit)
via 89383a553a5e6b05779479edac2af0134cb10335 (commit)
via ec3978e5210f6142f33504523168f55b4a4032ac (commit)
via 2b23051c6ddb266c359ce57008d44deeab3f5bc6 (commit)
via 032e530def273825892a6bfe8e4b5eef137ec529 (commit)
via a7dbebffa9297d3e9afa5c356ab74bfdb2c0243d (commit)
via 33293112744fc08f70811af4add9c7dd6f6533fa (commit)
via 6bb5c404994308c06bdfd853642b60adb662b78f (commit)
via ec7103582297545948602bc833cf1883fd94e8d8 (commit)
via 8842ae7c2920799442bfda812fa56c241dfdeebd (commit)
via 4b4b1b0d517403f0f460f1a255358b4f1b426e0b (commit)
via e6be427c519ae3228787c728a1bdc5cc5dc31d0c (commit)
via 72424ac144904dc9c70161fe70c64f8657e89758 (commit)
via 12c453ccd3cbf4455d346f7d4f42fa7061bee0cb (commit)
via 6cf93934a71a2ed143125a9f3b005ad38a542423 (commit)
via 9624f06be96bafaafaf12fe8188d7390cf5821a2 (commit)
via 0690fbc0c532f71d02ed74106191686d31cf13ea (commit)
via 3d8dbbcc1ada57a8660ccc919c98f40674df4b02 (commit)
via db00197e6adcddd18a810f619d38ac04c87fbd69 (commit)
via 5f621c9f5327be25432d0d761204faa434afaee2 (commit)
via a81c7d90c41ba6911b75d1806343b318141e6e0b (commit)
via a72aa0cb4171f0039f51c2112b1f523310b66ca7 (commit)
via a2af87068ea6771dc6e298b21e56ec769d6b31b0 (commit)
via bef2d13e4a8443ce32bba28116398a3edf156a45 (commit)
via 50e10f758223e456e1304e7b8ae8d2092d89a914 (commit)
via 5028a0c440e7643c25ae459f6150c8313b223a7d (commit)
via 74876c73ae45ed02b4f0ff45f317e59abb6212a1 (commit)
via 27c4eb19ee32b46e4740f781d9f2470638e9f459 (commit)
from 1364996bd298643a288d79edde45f7fd53cf0816 (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 028d750249ab00c8c362598c838b15e8aa6a2951
Author: Michael Black W9MDB <mdb...@ya...>
Date: Sun Dec 29 10:43:39 2024 -0600
Fix rig_list_foreach in testmW2power.c
diff --git a/tests/testmW2power.c b/tests/testmW2power.c
index 88c38b6ed..9e910e95c 100644
--- a/tests/testmW2power.c
+++ b/tests/testmW2power.c
@@ -13,7 +13,7 @@
int nrigs = 0;
-int callback(struct rig_caps *caps, rig_ptr_t rigp)
+int callback(const struct rig_caps *caps, rig_ptr_t rigp)
{
RIG *rig = (RIG *) rigp;
commit ac8a8b2027983f6710f29abc170555607b4796c9
Author: Michael Black W9MDB <mdb...@ya...>
Date: Sun Dec 29 10:33:33 2024 -0600
Fix rig_list_foreach in hamlibmodels.c
https://github.com/Hamlib/Hamlib/issues/1647
diff --git a/tests/hamlibmodels.c b/tests/hamlibmodels.c
index 0a5e21596..a7cfac7f0 100644
--- a/tests/hamlibmodels.c
+++ b/tests/hamlibmodels.c
@@ -7,7 +7,7 @@ char *list[1000]; // as of 2023-01-17 we have 275 rigs so this should cover us f
int nmodels = 0;
-static int hash_model_list(struct rig_caps *caps, void *data)
+static int hash_model_list(const struct rig_caps *caps, void *data)
{
char s[256];
sprintf(s, "%s %s", caps->mfg_name, caps->model_name);
commit 728d0a543290d23c4f19023f15845e1ca0e7fc3f
Author: Michael Black W9MDB <mdb...@ya...>
Date: Sun Dec 29 08:56:53 2024 -0600
Fix listrigs.s rig_list_foreach
https://github.com/Hamlib/Hamlib/issues/1647
diff --git a/tests/listrigs.c b/tests/listrigs.c
index 65300d25f..230b1c413 100644
--- a/tests/listrigs.c
+++ b/tests/listrigs.c
@@ -27,7 +27,7 @@
#include <hamlib/rig.h>
-int print_caps_sum(struct rig_caps *caps, void *data)
+int print_caps_sum(const struct rig_caps *caps, void *data)
{
const char *fmt1 = "%-13s";
printf("%6u \t%-22s \t%-23s\t%-8s \t",
commit 601dd1361cbc897b41c989a10dca2e2bb191a112
Author: Michael Black W9MDB <mdb...@ya...>
Date: Sun Dec 29 08:51:47 2024 -0600
Fix testrigopen.c rig_list_foreach
https://github.com/Hamlib/Hamlib/issues/1647
diff --git a/tests/testrigopen.c b/tests/testrigopen.c
index b98064a1e..74886e8d7 100644
--- a/tests/testrigopen.c
+++ b/tests/testrigopen.c
@@ -16,7 +16,7 @@
#define SERIAL_PORT "/dev/ttyUSB0"
-int callback(struct rig_caps *caps, rig_ptr_t rigp)
+int callback(const struct rig_caps *caps, rig_ptr_t rigp)
{
RIG *rig = (RIG *) rigp;
commit f2a9f091d08667db9d3fc2e842a427af7cfb990e
Author: Michael Black W9MDB <mdb...@ya...>
Date: Sun Dec 29 08:42:24 2024 -0600
Change rig_list_foreach back to using const argument -- was breaking many C++ application builds
https://github.com/Hamlib/Hamlib/issues/1647
diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h
index c15c706c9..bba2f8133 100644
--- a/include/hamlib/rig.h
+++ b/include/hamlib/rig.h
@@ -3791,7 +3791,7 @@ extern HAMLIB_EXPORT(int)
rig_unregister HAMLIB_PARAMS((rig_model_t rig_model));
extern HAMLIB_EXPORT(int)
-rig_list_foreach HAMLIB_PARAMS((int (*cfunc)(struct rig_caps *, rig_ptr_t),
+rig_list_foreach HAMLIB_PARAMS((int (*cfunc)(const struct rig_caps *, rig_ptr_t),
rig_ptr_t data));
extern HAMLIB_EXPORT(int)
diff --git a/src/register.c b/src/register.c
index fcf62b03e..ef0c1f9fd 100644
--- a/src/register.c
+++ b/src/register.c
@@ -393,7 +393,7 @@ int HAMLIB_API rig_unregister(rig_model_t rig_model)
* executes cfunc on all the elements stored in the rig hash list
*/
//! @cond Doxygen_Suppress
-int HAMLIB_API rig_list_foreach(int (*cfunc)(struct rig_caps *,
+int HAMLIB_API rig_list_foreach(int (*cfunc)(const struct rig_caps *,
rig_ptr_t),
rig_ptr_t data)
{
diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c
index 263a7bad8..bcb10af96 100644
--- a/tests/rigctl_parse.c
+++ b/tests/rigctl_parse.c
@@ -2088,7 +2088,7 @@ int print_conf_list2(const struct confparams *cfp, rig_ptr_t data)
return 1; /* !=0, we want them all ! */
}
-static int hash_model_list(struct rig_caps *caps, void *data)
+static int hash_model_list(const struct rig_caps *caps, void *data)
{
hash_add_model(caps->rig_model,
caps->mfg_name,
commit 028e8f38cdcbeb1165688ed75fadac5dec603245
Author: Michael Black W9MDB <mdb...@ya...>
Date: Sat Dec 28 15:59:43 2024 -0600
Improve error message when windows serial port is already in use
diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h
index c43d15bad..c15c706c9 100644
--- a/include/hamlib/rig.h
+++ b/include/hamlib/rig.h
@@ -208,6 +208,7 @@ enum rig_errcode_e {
RIG_ESECURITY, /*!< 19 Security error */
RIG_EPOWER, /*!< 20 Rig not powered on */
RIG_ELIMIT, /*!< 21 Limit exceeded */
+ RIG_EACCESS, /*!< 22 Access denied -- e.g. port already in use */
RIG_EEND // MUST BE LAST ITEM IN LAST
};
/**
diff --git a/src/iofunc.c b/src/iofunc.c
index 28633aec8..956d56c25 100644
--- a/src/iofunc.c
+++ b/src/iofunc.c
@@ -252,8 +252,13 @@ int HAMLIB_API port_open(hamlib_port_t *p)
if (status < 0)
{
+#if defined(WIN32)
+// rig_debug(RIG_DEBUG_ERR, "%s: serial_open(%s) status=%d, err=%s\n", __func__,
+// p->pathname, status, rigerror(status));
+#else
rig_debug(RIG_DEBUG_ERR, "%s: serial_open(%s) status=%d, err=%s\n", __func__,
p->pathname, status, strerror(errno));
+#endif
close_sync_data_pipe(p);
return (status);
}
diff --git a/src/rig.c b/src/rig.c
index a73a9df7e..813513293 100644
--- a/src/rig.c
+++ b/src/rig.c
@@ -233,7 +233,8 @@ static const char *const rigerror_table[] =
"Function deprecated",
"Security error password not provided or crypto failure",
"Rig is not powered on",
- "Limit exceeded"
+ "Limit exceeded",
+ "Access denied"
};
@@ -996,7 +997,7 @@ int HAMLIB_API rig_open(RIG *rig)
}
else
{
- rig_debug(RIG_DEBUG_VERBOSE, "%s: cwd=%s\n", __func__, cwd);
+ //rig_debug(RIG_DEBUG_VERBOSE, "%s: cwd=%s\n", __func__, cwd);
char *path = calloc(1, 8192);
extern char settings_file[4096];
const char *xdgpath = getenv("XDG_CONFIG_HOME");
@@ -1016,7 +1017,7 @@ int HAMLIB_API rig_open(RIG *rig)
if (fp == NULL)
{
- rig_debug(RIG_DEBUG_VERBOSE, "%s: %s %s\n", __func__, path, strerror(errno));
+ //rig_debug(RIG_DEBUG_VERBOSE, "%s: %s %s\n", __func__, path, strerror(errno));
}
else
{
@@ -1169,8 +1170,7 @@ int HAMLIB_API rig_open(RIG *rig)
if (status < 0)
{
- rig_debug(RIG_DEBUG_VERBOSE, "%s: rs->comm_state==0?=%d\n", __func__,
- rs->comm_state);
+ //rig_debug(RIG_DEBUG_VERBOSE, "%s: rs->comm_state==0?=%d\n", __func__, rs->comm_state);
rs->comm_state = 0;
rs->comm_status = RIG_COMM_STATUS_ERROR;
RETURNFUNC2(status);
diff --git a/src/serial.c b/src/serial.c
index b580bacf9..2d6fd5a7c 100644
--- a/src/serial.c
+++ b/src/serial.c
@@ -126,6 +126,89 @@ int is_uh_radio_fd(int fd)
}
//! @endcond
+#if defined(WIN32)
+#include <windows.h>
+#include <strsafe.h>
+
+void WinErrorShow(LPCTSTR lpszFunction, DWORD dw)
+{
+ // Retrieve the system error message for the last-error code
+
+ LPVOID lpMsgBuf;
+ LPVOID lpDisplayBuf;
+// DWORD dw = GetLastError();
+
+ FormatMessage(
+ FORMAT_MESSAGE_ALLOCATE_BUFFER |
+ FORMAT_MESSAGE_FROM_SYSTEM |
+ FORMAT_MESSAGE_IGNORE_INSERTS,
+ NULL,
+ dw,
+ MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
+ (LPTSTR) &lpMsgBuf,
+ 0, NULL);
+
+ // Display the error message and exit the process
+
+ lpDisplayBuf = (LPVOID)LocalAlloc(LMEM_ZEROINIT,
+ (lstrlen((LPCTSTR)lpMsgBuf) + lstrlen((LPCTSTR)lpszFunction) + 40) * sizeof(
+ TCHAR));
+ StringCchPrintf((LPTSTR)lpDisplayBuf,
+ LocalSize(lpDisplayBuf) / sizeof(TCHAR),
+ TEXT("%s failed with error %d: %s"),
+ lpszFunction, dw, lpMsgBuf);
+ //MessageBox(NULL, (LPCTSTR)lpDisplayBuf, TEXT("Error"), MB_OK);
+ rig_debug(RIG_DEBUG_ERR, "%s: %s", __func__, (char *)lpDisplayBuf);
+
+ LocalFree(lpMsgBuf);
+ LocalFree(lpDisplayBuf);
+}
+
+enum serial_status
+{
+ SER_NO_EXIST,
+ SER_IN_USE,
+ SER_UNKNOWN_ERR,
+ SER_AVAILABLE
+};
+
+int check_com_port_in_use(const char *port)
+{
+ char device[1024];
+ snprintf(device, sizeof(device), "\\\\.\\%s", port);
+ HANDLE hCom = CreateFileA(
+ device,
+ GENERIC_READ | GENERIC_WRITE,
+ 0, // No sharing
+ NULL, // Default security
+ OPEN_EXISTING,
+ 0, // Non-overlapped mode
+ NULL // No template file
+ );
+
+ if (hCom == INVALID_HANDLE_VALUE)
+ {
+ DWORD error = GetLastError();
+
+ if (error == ERROR_FILE_NOT_FOUND)
+ {
+ return SER_NO_EXIST;
+ }
+ else if (error == ERROR_ACCESS_DENIED)
+ {
+ return SER_IN_USE;
+ }
+ else
+ {
+ WinErrorShow("serial error on CreateFileA: ", error);
+ return SER_IN_USE;
+ }
+ }
+ CloseHandle(hCom);
+
+ return SER_AVAILABLE;
+}
+#endif
/**
* \brief Open serial port using STATE(rig) data
@@ -143,6 +226,28 @@ int HAMLIB_API serial_open(hamlib_port_t *rp)
return (-RIG_EINVAL);
}
+#if defined(WIN32)
+ int retcode = check_com_port_in_use(rp->pathname);
+
+ switch (retcode)
+ {
+ case SER_IN_USE:
+ rig_debug(RIG_DEBUG_ERR, "%s: serial port %s is already open\n", __func__,
+ rp->pathname);
+ return -RIG_EACCESS;
+
+ case SER_NO_EXIST:
+ rig_debug(RIG_DEBUG_ERR, "%s: serial port %s does not exist\n", __func__,
+ rp->pathname);
+ return -RIG_EIO;
+
+ case SER_AVAILABLE:
+ rig_debug(RIG_DEBUG_ERR, "%s: serial port %s is OK\n", __func__, rp->pathname);
+ break;
+ }
+
+#endif
+
rig_debug(RIG_DEBUG_VERBOSE, "%s: %s\n", __func__, rp->pathname);
commit 1211da41d05c62797069caa63181687040db66c9
Author: Michael Black W9MDB <mdb...@ya...>
Date: Fri Dec 27 16:28:06 2024 -0600
Remove csharp for now
diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml
index 9f24dcb65..3cb9dcdd4 100644
--- a/.github/workflows/codeql-analysis.yml
+++ b/.github/workflows/codeql-analysis.yml
@@ -32,7 +32,7 @@ jobs:
strategy:
fail-fast: false
matrix:
- language: [ 'cpp', 'python', 'csharp' ]
+ language: [ 'cpp', 'python' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
commit bf7d5c322b59683ddb3cc865abf6df31bb2b5061
Merge: 5d8593dd7 0ad592405
Author: Michael Black W9MDB <mdb...@ya...>
Date: Thu Dec 26 15:34:37 2024 -0600
Merge branch 'master' of github.com:Hamlib/Hamlib
commit 5d8593dd733253ddea9d15aacebdfb216f3b8f4a
Author: Michael Black W9MDB <mdb...@ya...>
Date: Thu Dec 26 15:33:20 2024 -0600
Update simic7300 and simic7000
diff --git a/simulators/simic7000.c b/simulators/simic7000.c
index aa44ab0e7..ef14d0298 100644
--- a/simulators/simic7000.c
+++ b/simulators/simic7000.c
@@ -72,18 +72,17 @@ again:
while (read(fd, &c, 1) > 0)
{
buf[i++] = c;
- //printf("i=%d, c=0x%02x\n",i,c);
+ printf("i=%d, c=0x%02x\n", i, c);
if (c == 0xfd)
{
char mytime[256];
date_strget(mytime, sizeof(mytime), 1);
printf("%s:", mytime); dumphex(buf, i);
+ printf("\n");
// echo
- n = write(fd, buf, i);
-
- if (n != i) { printf("%s: error on write: %s\n", __func__, strerror(errno)); }
-
+ //n = write(fd, buf, i);
+ //if (n != i) { printf("%s: error on write: %s\n", __func__, strerror(errno)); }
return i;
}
@@ -132,7 +131,7 @@ void frameParse(int fd, unsigned char *frame, int len)
{
case 0x03:
- if (frame[5] != 0xfd)
+ if (frame[5] == 0xfd)
{
//from_bcd(frameackbuf[2], (civ_731_mode ? 4 : 5) * 2);
if (current_vfo == RIG_VFO_A || current_vfo == RIG_VFO_MAIN)
@@ -153,21 +152,21 @@ void frameParse(int fd, unsigned char *frame, int len)
n = write(fd, frame, 11);
dump_hex(frame, 11);
}
+ }
+ else
+ {
+ if (current_vfo == RIG_VFO_A)
+ {
+ freqA = from_bcd(&frame[5], (civ_731_mode ? 4 : 5) * 2);
+ }
else
{
- if (current_vfo == RIG_VFO_A)
- {
- freqA = from_bcd(&frame[5], (civ_731_mode ? 4 : 5) * 2);
- }
- else
- {
- freqB = from_bcd(&frame[5], (civ_731_mode ? 4 : 5) * 2);
- }
-
- frame[4] = 0xfb;
- frame[5] = 0xfd;
- n = write(fd, frame, 6);
+ freqB = from_bcd(&frame[5], (civ_731_mode ? 4 : 5) * 2);
}
+
+ frame[4] = 0xfb;
+ frame[5] = 0xfd;
+ n = write(fd, frame, 6);
}
break;
@@ -614,6 +613,9 @@ int main(int argc, char **argv)
if (powerstat)
{
+ unsigned char tmp = buf[2];
+ buf[2] = buf[3];
+ buf[3] = tmp;
frameParse(fd, buf, len);
}
else
diff --git a/simulators/simic7300.c b/simulators/simic7300.c
index 797259dba..551b2108e 100644
--- a/simulators/simic7300.c
+++ b/simulators/simic7300.c
@@ -76,7 +76,13 @@ again:
if (c == 0xfd)
{
- dumphex(buf, i);
+ char mytime[256];
+ date_strget(mytime, sizeof(mytime), 1);
+ printf("%s:", mytime); dumphex(buf, i);
+ printf("\n");
+ // echo
+ //n = write(fd, buf, i);
+ //if (n != i) { printf("%s: error on write: %s\n", __func__, strerror(errno)); }
return i;
}
@@ -125,28 +131,47 @@ void frameParse(int fd, unsigned char *frame, int len)
{
case 0x03:
- //from_bcd(frameackbuf[2], (civ_731_mode ? 4 : 5) * 2);
- if (current_vfo == RIG_VFO_A || current_vfo == RIG_VFO_MAIN)
- {
- printf("get_freqA\n");
- to_bcd(&frame[5], (long long)freqA, (civ_731_mode ? 4 : 5) * 2);
- }
- else
+ if (frame[5] == 0xfd)
{
- printf("get_freqB\n");
- to_bcd(&frame[5], (long long)freqB, (civ_731_mode ? 4 : 5) * 2);
- }
+ //from_bcd(frameackbuf[2], (civ_731_mode ? 4 : 5) * 2);
+ if (current_vfo == RIG_VFO_A || current_vfo == RIG_VFO_MAIN)
+ {
+ printf("get_freqA\n");
+ to_bcd(&frame[5], (long long)freqA, (civ_731_mode ? 4 : 5) * 2);
+ }
+ else
+ {
+ printf("get_freqB\n");
+ to_bcd(&frame[5], (long long)freqB, (civ_731_mode ? 4 : 5) * 2);
+ }
- frame[10] = 0xfd;
+ frame[10] = 0xfd;
+
+ if (powerstat)
+ {
+ dump_hex(frame, 11);
+ n = write(fd, frame, 11);
- if (powerstat)
+ if (n <= 0) { fprintf(stderr, "%s(%d) write error %s\n", __func__, __LINE__, strerror(errno)); }
+ }
+ }
+ else
{
- dump_hex(frame, 11);
- n = write(fd, frame, 11);
+ if (current_vfo == RIG_VFO_A)
+ {
+ freqA = from_bcd(&frame[5], (civ_731_mode ? 4 : 5) * 2);
+ }
+ else
+ {
+ freqB = from_bcd(&frame[5], (civ_731_mode ? 4 : 5) * 2);
+ }
- if (n <= 0) { fprintf(stderr, "%s(%d) write error %s\n", __func__, __LINE__, strerror(errno)); }
+ frame[4] = 0xfb;
+ frame[5] = 0xfd;
+ n = write(fd, frame, 6);
}
+
break;
case 0x04:
commit eb7a828f5e00c42cef4b9989a44e3a8d70c5ff11
Author: Michael Black W9MDB <mdb...@ya...>
Date: Thu Dec 26 07:56:06 2024 -0600
Add stdarg.c as va_list requires
https://github.com/Hamlib/Hamlib/issues/1644
diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h
index 82b18e0ff..c43d15bad 100644
--- a/include/hamlib/rig.h
+++ b/include/hamlib/rig.h
@@ -37,6 +37,7 @@
#define __FILENAME__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
#include <stdio.h>
+#include <stdarg.h>
#include <string.h>
#include <inttypes.h>
#include <time.h>
commit 0ad5924050247f4a8fc4f79ed9881614c2e72817
Author: Michael Black W9MDB <mdb...@ya...>
Date: Thu Dec 26 07:56:06 2024 -0600
Add stdarg.c as va_list requires
diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h
index 82b18e0ff..c43d15bad 100644
--- a/include/hamlib/rig.h
+++ b/include/hamlib/rig.h
@@ -37,6 +37,7 @@
#define __FILENAME__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
#include <stdio.h>
+#include <stdarg.h>
#include <string.h>
#include <inttypes.h>
#include <time.h>
commit f173673695fe6fd535beba0d9690c936c95447d5
Author: Michael Black W9MDB <mdb...@ya...>
Date: Wed Dec 25 22:59:50 2024 -0600
Update rigctl.1 man page
diff --git a/doc/man1/rigctl.1 b/doc/man1/rigctl.1
index 7c0dadc8e..e8ce4e31a 100644
--- a/doc/man1/rigctl.1
+++ b/doc/man1/rigctl.1
@@ -335,7 +335,7 @@ Sets the cookie to be used for remote access security
.
.TP
.BR \-# ", " \-\-skip_init
-Skips most startup intialization. This is now automatically done when any commands are on the line.
+Skips most startup intialization.
.
.TP
.B \-
commit 70708fdf7f388b1c80da10edc17daf53996e9ed2
Author: Michael Black W9MDB <mdb...@ya...>
Date: Wed Dec 25 22:53:34 2024 -0600
Update multicast.csproj to use .net 8
diff --git a/bindings/csharp/multicast/multicast.csproj b/bindings/csharp/multicast/multicast.csproj
index d08b4c72a..21e08b007 100644
--- a/bindings/csharp/multicast/multicast.csproj
+++ b/bindings/csharp/multicast/multicast.csproj
@@ -2,7 +2,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
- <TargetFramework>net7.0</TargetFramework>
+ <TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
commit 57c145d5d15e0aab7d62e5bbcba871c9a55d05ec
Author: Michael Black W9MDB <mdb...@ya...>
Date: Wed Dec 25 22:43:20 2024 -0600
Remove skip_init default
Was causing segfault on rigctl -m 2041 -r /dev/pts/4 M CW 250 b 73
diff --git a/tests/rigctl.c b/tests/rigctl.c
index 5a40b3e11..9affbab35 100644
--- a/tests/rigctl.c
+++ b/tests/rigctl.c
@@ -547,7 +547,8 @@ int main(int argc, char *argv[])
if (optind < argc)
{
interactive = 0;
- skip_init = 1;
+ // skip_init here caused segfault on rigctl -m 2041 -r /dev/pts/4 M CW 250 b 73
+ //skip_init = 1;
}
else
{
commit f00e4f4708e3fa8f6a6976367a6264b58a1365e9
Author: Michael Black W9MDB <mdb...@ya...>
Date: Wed Dec 25 17:12:29 2024 -0600
Add csharp codeql check
diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml
index 3cb9dcdd4..9f24dcb65 100644
--- a/.github/workflows/codeql-analysis.yml
+++ b/.github/workflows/codeql-analysis.yml
@@ -32,7 +32,7 @@ jobs:
strategy:
fail-fast: false
matrix:
- language: [ 'cpp', 'python' ]
+ language: [ 'cpp', 'python', 'csharp' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
commit 8edf99fc187b7b462fa297d885cda89b172bb5d3
Author: Michael Black W9MDB <mdb...@ya...>
Date: Wed Dec 25 16:36:37 2024 -0600
Change skipinit so skip-init for consistency
And now ignores the skip-init on the non-interactive rigctl
diff --git a/doc/man1/rigctl.1 b/doc/man1/rigctl.1
index b318f3fc3..7c0dadc8e 100644
--- a/doc/man1/rigctl.1
+++ b/doc/man1/rigctl.1
@@ -334,7 +334,7 @@ and exit.
Sets the cookie to be used for remote access security
.
.TP
-.BR \-# ", " \-\-skipinit
+.BR \-# ", " \-\-skip_init
Skips most startup intialization. This is now automatically done when any commands are on the line.
.
.TP
diff --git a/tests/rigctl.c b/tests/rigctl.c
index 75b41a14d..5a40b3e11 100644
--- a/tests/rigctl.c
+++ b/tests/rigctl.c
@@ -110,7 +110,7 @@ static struct option long_options[] =
{"help", 0, 0, 'h'},
{"version", 0, 0, 'V'},
{"cookie", 0, 0, '!'},
- {"skipinit", 0, 0, '#'},
+ {"skip-init", 0, 0, '#'},
{0, 0, 0, 0}
};
@@ -956,7 +956,7 @@ void usage(void)
" -h, --help display this help and exit\n"
" -V, --version output version information and exit\n"
" -!, --cookie use cookie control\n"
- " -#, --skipinit skips rig initialization\n\n"
+ " -#, --skip-init skips rig initialization\n\n"
);
usage_rig(stdout);
diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c
index ebe9df723..263a7bad8 100644
--- a/tests/rigctl_parse.c
+++ b/tests/rigctl_parse.c
@@ -915,11 +915,21 @@ int rigctl_parse(RIG *my_rig, FILE *fin, FILE *fout, char *argv[], int argc,
}
}
+ if (strcmp(command,"skip-init")==0)
+ {
+ // no-op now since it's automatic in non-interactive mode
+ return(RIG_OK);
+ }
+
cmd_entry = find_cmd_entry(cmd);
if (!cmd_entry)
{
- if (cmd != ' ')
+ if (cmd == 0)
+ {
+ fprintf(stderr, "Command '%s' not found!\n", command);
+ }
+ else if (cmd != ' ')
{
fprintf(stderr, "Command '%c' not found!\n", cmd);
}
commit 9ac7f92d1ef1574bfb463d1a79ee90d0f5752312
Author: Michael Black W9MDB <mdb...@ya...>
Date: Wed Dec 25 15:59:40 2024 -0600
Update some documentation
diff --git a/doc/man1/rigctl.1 b/doc/man1/rigctl.1
index 9a1b6d44e..b318f3fc3 100644
--- a/doc/man1/rigctl.1
+++ b/doc/man1/rigctl.1
@@ -330,6 +330,14 @@ Show version of
and exit.
.
.TP
+.BR \-! ", " \-\-cookie
+Sets the cookie to be used for remote access security
+.
+.TP
+.BR \-# ", " \-\-skipinit
+Skips most startup intialization. This is now automatically done when any commands are on the line.
+.
+.TP
.B \-
Stop option processing and read commands from standard input.
.IP
diff --git a/tests/rigctl.c b/tests/rigctl.c
index 9d17fba44..75b41a14d 100644
--- a/tests/rigctl.c
+++ b/tests/rigctl.c
@@ -955,8 +955,8 @@ void usage(void)
" -Z, --debug-time-stamps enable time stamps for debug messages\n"
" -h, --help display this help and exit\n"
" -V, --version output version information and exit\n"
- " -!, --cookie use cookie control\n\n"
- " -#, --skipinit skips rig initialization\n"
+ " -!, --cookie use cookie control\n"
+ " -#, --skipinit skips rig initialization\n\n"
);
usage_rig(stdout);
commit e0a805ebc3283eb7bd878addc4479d7f0c37e722
Author: Michael Black W9MDB <mdb...@ya...>
Date: Tue Dec 24 23:19:02 2024 -0600
Make skip_init automatic when rigctl has commands on the line
diff --git a/tests/rigctl.c b/tests/rigctl.c
index 383c7185b..9d17fba44 100644
--- a/tests/rigctl.c
+++ b/tests/rigctl.c
@@ -547,6 +547,7 @@ int main(int argc, char *argv[])
if (optind < argc)
{
interactive = 0;
+ skip_init = 1;
}
else
{
-----------------------------------------------------------------------
Summary of changes:
amplifiers/gemini/gemini.h | 2 +-
bindings/csharp/multicast/multicast.csproj | 2 +-
doc/man1/rigctl.1 | 8 +
docker-build/Dockerfile | 29 +--
docker-build/README.Docker.md | 71 ++++++++
docker-build/README.docker | 13 --
include/hamlib/rig.h | 4 +-
rigs/dummy/aclog.c | 4 +-
rigs/dummy/flrig.c | 10 +-
rigs/dummy/netrigctl.c | 2 +-
rigs/dummy/tci1x.c | 2 +-
rigs/dummy/trxmanager.c | 2 +-
rigs/flexradio/smartsdr.c | 2 +-
rigs/icom/frame.c | 11 +-
rigs/icom/icom.c | 4 +-
rigs/kenwood/kenwood.c | 11 +-
rigs/kenwood/ts590.c | 18 +-
rigs/yaesu/ft1000mp.c | 4 +-
rigs/yaesu/ft991.c | 2 +-
rigs/yaesu/newcat.c | 6 +-
rotators/gs232a/gs232b.c | 2 +-
simulators/simic7000.c | 38 ++--
simulators/simic7300.c | 57 ++++--
src/iofunc.c | 5 +
src/register.c | 2 +-
src/rig.c | 24 ++-
src/serial.c | 105 +++++++++++
src/sprintflst.c | 278 ++++++++++++++++++++---------
tests/ampctl.c | 2 +-
tests/ampctl_parse.c | 3 +-
tests/ampctld.c | 2 +-
tests/hamlibmodels.c | 2 +-
tests/listrigs.c | 2 +-
tests/rigctl.c | 10 +-
tests/rigctl_parse.c | 34 ++--
tests/rigctlcom.c | 2 +-
tests/rigctld.c | 2 +-
tests/rigctlsync.c | 2 +-
tests/rigctltcp.c | 2 +-
tests/rigmem.c | 2 +-
tests/rigsmtr.c | 4 +-
tests/rigswr.c | 2 +-
tests/rotctl.c | 2 +-
tests/rotctl_parse.c | 3 +-
tests/rotctld.c | 2 +-
tests/testmW2power.c | 2 +-
tests/testrigopen.c | 2 +-
47 files changed, 564 insertions(+), 236 deletions(-)
create mode 100644 docker-build/README.Docker.md
delete mode 100644 docker-build/README.docker
hooks/post-receive
--
Hamlib -- Ham radio control libraries
|
|
From: n0nb <n0...@us...> - 2024-12-24 08:51:25
|
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 annotated tag, 4.6 has been created
at 214380b3509cf5ac7d5985cc630b1530473ab4a7 (tag)
tagging c9031ca4d7d1b7817f0e461814a740bfeb383f84 (commit)
tagged by Nate Bargmann
on Tue Dec 24 02:44:02 2024 -0600
- Log -----------------------------------------------------------------
Hamlib 4.6 release
-----BEGIN PGP SIGNATURE-----
iF0EABECAB0WIQSC1k9rDmfNQfaJu6b7LFEw1VqIGQUCZ2p0iwAKCRD7LFEw1VqI
GZ+7AJ9kyLR9iGlSaIbfSdjmQSeEudABEACeIDG800BMADkMlFUKaZnEHR3YLEM=
=5Ds4
-----END PGP SIGNATURE-----
(no author) (1):
New repository initialized by cvs2svn.
Addison Schuhardt (1):
Refactoring GPIO push-to-talk logic to use libgpiod rather than the deprecated/broken sysfs method. TODO: I'm not familiar with autoconf to set up linking to libgpiod correctly, so I'd like to ask someone else to do that. Fixes #1538
Adrian Chadd (1):
Upgrade TS-711 and TS-811 to work.
Agis Zisimatos (1):
easycomm: Return the correct value of pointer val
Alessandro Zummo, IZ1PRB (36):
Remove const from priv_caps to allow kenwood_init to initialize default values if they're missing
Call kenwood_init in each and every driver
Use an appropriate debug level
Support get/set_powerstat on pcr100
Add kenwood_simple_cmd
Make set_ptt behave as before, fix set_ant for ts570.c
ts450: remove RIG_FUNC_TONE from has_xx_func if tone unit is not detected
ts450,ts690,ts850: use FL command to get/set filters in get/set_mode. (code from ts850.c)
ts450: indentation fixes
remove fixed command terminator (;) from generic code
ts140,ts2000,ts480,ts570,ts680,ts850,ts870s: remove usage of fixed ; and EOM
fix tabs
thg71,tmv7,ts450s,ts690: verify rig id at rig_open
ts450: implement set_channel
remove unused parameter from get_kenwood_func
ts570,ts850,ts870s,ts140,ts480,ts680: use kenwood_simple_cmd where possible
Replace __FUNCTION__, which is gcc specific and was deprecated a long time ago, with __func__, which is at least defined in C99.
generic, ts850: implemented CTCSS TN command (reported not working for ts850, should now be fixed)
Add description for the kenwood mode n. 8
implemented set/get_ext_param (voice, fine, xit, rit). enabled on ts450 and ts850
Added my call sign
removed comment about switch optimizatons. the compiler will generate the assembly code in a different order which is usually based on the case value. other compiler optimizations might also affect it, so it's useless to optimize the order.
check ptt status before set_ptt. enabled on ts850.
style fixes
band up/down was inverted
Try to compensate for leftover characters
Try to cope withe the PCR100 and PCR1000 at the same time
Bumped out to beta, solved a few bugs. Tested with PCR100/1000/1500.
kenwood: send the whole buffer at once, added kenwood_cmd
- removed EOM, it's handled by kenwood_transaction - fixed tabs and spaces - added generic routine for vfo errors - set_mem: do not switch vfo if already in mem mode - simplified invocation of some commands - buffer optimizations - added PARM_BEEP and PARM_APO - fixed getting of LEVEL_RFPOWER - fixed get_ant
tmv7: removed EOM
thg71: removed EOM
thf7: - wrong rfpower level granularity - added .reset - call kenwood_open - use generic th_set_vfo
th: fixed formatting issue
th: fixed stack corruption
th: fixed a missing newline
Alex V Flinsch, KC2IVL (8):
Initial changes for ft100
Initial release
initial release
fixed various command options
new file, list of tones/codes and sequence used by various yaesu rigs
added get frequency to ft100 code
added getinfo func hdr
*** empty log message ***
Alexander Sack (1):
Get firmware revision level from K3/KX3.
Alexander Schultze (3):
easycomm: include a new EasyComm3 to support move speed and infostring
update EasyComm3 to include setting and getting of config and status
easycomm: implement get/set config, easycom include status and error bytes, fix get_info
Alexandru Csete OZ9AEC (34):
Added new stylesheet to make API docs look better.
Modified to use new stylesheet.
Added doxygen comments.
Added rotator.h and rotlist.h to the input list.
Applied Tommi's improvements from the FT-857 backend with the following changes and additions:
Full RF power scale corresponds to 10 bars, not 15.
Added RIT, XIT and IF shift ranges to dummy backend.
Cast constant caps to variable caps in order to avoid compiler warnings.
Cast from const to variable in order to avoid compiler warnings.
- Cast unsigned char to char in order to avoid compiler warnings. - Ensure that all variables have a value before they are used (ft920). - Disable unused functions and variables (frg100). - Incremented backend version numbers.
Use tone_t for pcr1_ctcss_list. Changed arg 4 of pcr_transaction to unsigned. Cast the other mismatches to (char *).
Cast unsigned char to char in order to avoid compiler warnings. Incremented backend version number.
- Cast unsigned char to char in order to avoid compiler warnings. - Ensure that all variables have a value before they are used (tentec.c).
- Cast unsigned char to char in order to avoid compiler warnings. - Incremented backend version number.
- Cast/change unsigned char to char in order to fix compile warnings. - Incremented backend version number.
- Cast/change unsigned char to char in order to fix compile warnings. - Incremented backend version numbers.
- Cast/change unsigned char to char in order to fix compile warnings. - Incremented backend version numbers.
- Cast/change unsigned char to char in order to fix compile warnings. - Incremented backend version number.
- Cast/change unsigned char to char in order to fix compile warnings. - Incremented backend version numbers.
- Cast unsigned char to char in order to avoid compiler warnings. - Handle all enum values in switch statements.
Fixed type mismatches that caused compile warnings.
Fixed type mismatches that caused compile warnings.
Initialise icom_val to avoid compiler warning.
Fixed type mismatches between signed and unsigned char. There are a few very suspicious 'if' statements in icom.c and frame.c
- Fixed type mismatches and unhandled switch cases. - Incremented backend version numbers.
Cast constant caps to variable caps in order to avoid compiler warnings.
Updated.
Added infor about w (send_cmd).
Max serial rate is 9600. Changed backend status to stable.
Escape the backslash character.
The 765 can do RIG_SCAN_PROG and RIG_SCAN_MEM.
Fixed S-meter reading to use calibration table since frontend always uses RAWSTR.
Fixed RF power reading and added power2mw and mw2power.
Fixed RIG_LEVEL_STRENGTH reading.
Andrew Errington (1):
Initial support for CM108 GPIO contorl of PTT
Andrew Rodland (3):
Fix spurious writes when no RT-21 second port
Enable "stop" command for RT-21 rotator.
Update RT-21 version
AuroraRAS (5):
Prepare .gitignore file for NDK build
Append the missing information to build hamlib v4.3 for Android NDK
make the Android.mk files adapt to multi arch
add androidsensor rotator
AndroidSensor codes improvement
Ben Coleman, NJ8J (6):
Fixed bug in rpcrig_set_parm (using RIG_LEVEL_IS_FLOAT instead of RIG_PARM_FLOAT)
Fixed same bug in rigctl_get_parm.
Added checking of return string from rig on set (non-retrieval) commands. Added code for COMP function. Added alinco_set_parm & tweaked dx77 capabilities.
Handle setting Keyer speed and CW Pitch
Added NJ8J's email address.
Change email address for NJ8J
Berndt Josef Wulf, VK5ABN (11):
Implemented rig_set_channel()
Implemented set_parm() for BACKLIGHT operation
Commented out RIG_MODE_PKTFM overlooked at the submission of previous code
Implemented RIG_MODE_PKTFM and RIG_MODE_PKTLSB modes
Changed debug message format for freq_t from long long to double
ft990_get_ptt() now uses the FT990_SF_XMIT instead of FT990_SF_PTT. FT990_SF_PTT only returns status of PTT activated by CAT commands, whereas FT990_SF_XMIT reports the actual status of the ptt line.
ft990_get_mem(): Fixed bug that prevented the reporting of current channel number when vfo != RIG_VFO_MEM
Fixed erroneous return value
Fixed mispelled name for VK5ABN
Added missing modes to RX/TX caps
Fixed bug in ft990_set_mode that caused RTTY interchanged modes USB/LSB Fixed bugs in ft990_get_channel
Bill Barker (1):
Add test for Flex 6300 ID
Bill Somerville (212):
Patch submission for IC-756
Patch to allow same serial port for PTT and CAT.
Patch to fix broken Yaesu backend with FT-2000(D)
Fix rig_open not failing when PTT/DCD port is unavailable.
Fix Icom IC-756 filter handling.
Fix Yaesu newcat backend set_tx_vfo issue.
Add support for Data Modes on Icom "Pro" models.
Fix Icom IC-726 mode handling.
Fix Kenwood TS-2000 split operation.
Fix Kenwood Split Operation for TS50 & TS480.
Fix Kenwood TS-870s split and bandwidth set/get.
Correct receive buffer length for IS; comamnd.
Fix Kenwood CAT transaction busy retry mechanism.
Fix Kenwood get split VFO function.
Add data sub-mode support for TS590s.
Correct order of MD and DA commands for TS590s.
Get firmware revision for TS590s in rig_open.
Fix TS590s firmware defect.
Fix Kenwood get_vfo function returning wrong VFO in split TX.
Make Kenwood TS590s firmware defect fixup revision specific.
Extend TS590s firmware defect fixup to both VFOs.
Fix Icom IC-756 Pro III get data mode.
Add spilt mode get and set for Elecraft K3.
Fix data sub-modes on Elecraft K3.
Fix Elecraft Data Mode Translation.
Fix Elecraft K3 Data Sub-Mode Setting.
Fix Yaesu FT1000MP and FT1000MP Mk V modes.
Fix configure.ac
Fix a warning message.
Added option to not use VFO XCHG command when setting split parameters.
Fix a buffer overflow in the Windows termios emulation.
Fix pkg-config generation.
Fix Icom IC-756Pro mode get/set.
Facility for rigctl to read commands from standard input.
Add a pause command to the rigctl command set.
Prefix action function names so as not to clash with system names.
Prefix action function names so as not to clash with system names.
Corrected typos in rigctl.1 manpage.
Add read commands from stdin and pause command features to rotctl.
Merge branch 'rigctl-stdin' of ssh://git.code.sf.net/u/bsomervi/hamlib into rigctl-stdin
Fix manpage errors.
Remove redundant RIG_PTT_SERIAL_CAT enum from ptt_t
Only check for serial control line conflicts if PTT shares CAT port
Fix Ten-Tec Orion get/set split functions
Icom IC-7410 has VFO A/B not MAIN/SUB
Added IC-7410 data modes
Add retry mechanism for Yaesu "newcat" backend
Implement retries for Yaesu "newcat" rigs
Disable auto information mode on open
Add retry mechanism for Yaesu "newcat" backend
Implement retries for Yaesu "newcat" rigs
Disable auto information mode on open
Merge branch 'yaesu-retries' of ssh://git.code.sf.net/u/bsomervi/hamlib into yaesu-retries
RIG_OK is zero and need not be negated and this will not change
Fix response length expected error in K3 back end
Data mode support for the Icom IC-7700
Data mode support for the Icom IC-9100
Data mode support for the Icom IC-7200
Add support for the Kenwood TS-590SG
Kenwood TS-590SG
Always clear serial control lines when used for PTT
Disable AI mode on open for Kenwood/Elecraft rigs
Add more diagnostics and error checks to serial line control
Move serial line control error checks to lower level routines
Merge branch 'master' into kenwood-ai-off-at-start
Merge branch 'master' into ptt-control-on-cat-port
Fix serial i/o on Windows.
Yaesu newcat style command response reading improvements
Increase communications timeout for Icom rigs
Kenwood AIn; command has no reply
Revert read_string() to partial results are a success status
Remove gratuitous sleeps before function exits
Error checks on simulated direct VFO addressing
Elecraft K2 RTTY modes are not FSK
Kenwood and Elecraft rigs sometimes ignore commands
Removed kenwood_cmd function and replaced uses of it
Allow for failed test command on the K2
Elecraft K3 has 1 stop bit
Kenwood TS-570 series IF returns current frequency
Switch to "ID;" command for verification as no "AI;" on TS-840s
Increase Elecraft K2 comms timeout and retries
Switch Kenwood TS940 to generic kenwood CAT functions
Improve command verification for Kenwood & Elecraft
Use local buffer in kenwood transaction funciton
Clarify the handling of Kenwood CAT message terminators
Further clarification in the implementation of kenwood_transaction()
Removed redundant precondition test
Remove kenwood_simple_cmd as kenwood_transaction has that functionality
Call kenwood_open() for TS-2000 to ensure AI mode is disabled
Allow for bad ID from DDUtil in TS-2000 mode
Allow one extra byte in read_string() length to accomodate terminator
Enable data modes for the Icom IC-7100
Allow for PowerSDR ID in Kenwood TS2000 emulation mode
Fix TenTec Argonaut message lengths and timeout
Fix TenTec set split command
Implement get PTT status for the TenTec Argonaut
Fix error with width in set mode for the TT argonaut
Yaesu FT540 can only change the frequency of the current VFO
Fix defect in Kenwood TS-940 IF command response parsing
Fix response lengths for the TT Jupiter 538
Do not attempt CAT PTT commands on the Icom IC-706mkIIG
Use correct argument type for serial control line functions
Initial back end implementation for the Kenwood TS-990s
Mode set is not VFO targetable on the Kenwood TS990s
The Kenwood TS990s only does split Tx on SUB VFO
The doesn't appear to be a way of getting PTT/SEND on the TS990s
Lower both RTS and DTR on alternate PTT serial port
Honour any error status from serial port calls
Dummy get_ptt function needs to read RTS/DTR/PARALLEL
Make autogen.sh agnostic to whitespace in paths
Increase the number or retries for most Kenwood rigs
Command validation for Yaesu set commands
Remove unecessary delays from TS-940S backend
Proper IPv6 and dual stack networking
Fix compiler warnings
Proper IPv6 and dual stack networking for rotator net daemon
Attempt to restore AI status on exit
Allow for poor emulations of Kenwood rigs that have no ID command
Use correct function to execute set type commands with no response
Add a new command line option '--no-restore-ai' ('-n') to rigctl
Fix FT-817/857/897 issues and add some missing functionality
Fix missing PKTUSB mode setting code for FT-817 & FT-897
Fix a logic error in band detection during IC-910 set frequency
Add missing configuration getters
Detect C-IV NAK returns as rejected commands
Elecraft rigs do not switch VFO in IF command responses during split Tx.
Redundant split mode directives on Elecraft rigs cause Tx failures
Only use IPv6 features on Windows versions that support it (>=XP)
Improve IPv6 portability and consistency
Add 23cms to IC-910(H) backend
Implement combined split VFO frequency and mode setting.
Initial implementation of rig_{set,get}_split_freq_mode() for FT-857.
Implement rig_{set,get}_split_freq_mode() for IC-756 series.
Add {get,set}_splitfrequency_mode for the IC-910(H)
Elide unnecessary CAT commands when setting split frequency and mode
Do not swap VFO unnecessarily
Better set frequency semantics for the IC-910(h)
VFO targetable get frequency operation for the Icom IC-910(h)
Make sure right band is used when setting frequency on IC-910(H)
Use rig state rig port retry option rather than from capabilities
Use a sensible port timeout value for the Kenwood TS-850
Further attempts to simplify and improve Icom CAT for split operating
Add RIG_PASSBAND_NOCHANGE as possible set_{split_,split_freq_,}mode argument
Switch to POSIXLY_CORRECT mode for getopt_long()
Fix a regression introduced in 222ad74
Do not crash if expected CTCSS tones not sepcified
Do not attempt to query AI state on the TS-450s as it is not supported
Some more Kenwood rigs with no AI query
Adjust rig_list_foreach to allow use for unregistering
Fix an issue presenting on the Yaesu FT-450(D)
Release the serial port used for PTT when possible
Change the IC7600 & IC7800 set/get mode to versions that support DATA modes
Add rig_{open,close} functions to TS-790 backend
Revised kenwood rig busy response handling
Add get and set split functions for the TS450S
Simplify and fix defects in the FT991 back end
Fix some endian issues in the si570/AVR SDR back ends
Fix a state machine defect with repeated PTT reset calls
Do not pass --no-cpp_precomp to compilers on Mac OS X
Allow RIG_LEVEL_STRENGTH queries over the network link
Stop rigctld and rotctld crashing when service threads cannot write to clients
Use snprintf throughout kenwood/kenwood.c for buffer safety
Fix off-by-one issue in reading memory mode from IF command response
Fix some issues with commands not supported by TS-2000 CAT emulations
Add best guess transmit status to rig state structure
Take out unecessary delays in K(X)3(S) back end.
FT-817 status queries honour retries and timeout
Make rig_open() call in rigctld lazy and add graceful termination
Simplify SWIG interface definition and hide 64-bit values from Lua binding
Remove unnecessary delays from TS-990 and TS-2000 back ends
Change frequency setting for the FT-747GX to something more basic
Fix an incorrect error return value from win32_serial_select()
Fix timeout issues with the Ten-Tec Orion/Eagle
Ensure compilation works with a pre C11 compiler
Make code C90 compliant again
Move unnecessary global and file static variables to the stack
Simplify unnecessary persistence of extended response state
Fix misunderstanding of netrigctl_transaction() return value
Made PTT and DCD options consistent between rigctl and rigctld
Report unrecognised PTT and DCD types in rigctl and rigctld
Update i/o functions to support GPIO(N) port closure
Fixed erroneous messages in rig_close with GPIO(N) PTT or DCD types
Remove duplication across GPIO and GPION handling of PTT and DCD
Improved get PTT state handling in dummy backend
Simplify closing of device files
Repair a regression with the dummy get PTT functionality
Revert "Add debug to serial.c"
Repair a regression with the dummy get PTT functionality
Revert "Add debug to serial.c"
Fix regression with slow responses from SmartSDR causing errors
Deal with remote PTT type at the client end
Avoid 'echo -n' as macOS sh doesn't support it
Fixing an operator precedence defect
Updates to the TH-D7A/E back end
Less ambiguous variable name and repair merge issue in prior commit
Add missing config parameters for rig power on/off and screen-saver
New power on option rather than power on/off
Make version recording safe for parallel builds without breaking make dist
Make version recording safe for parallel builds
Ensure old hamlibdatetime.h headers in the source dir are ignored
Merge branch 'safe-scs-versioning' of ssh://git.code.sf.net/u/bsomervi/hamlib into safe-scs-versioning
Fix make dist versioning
Use BUILT_SOURCES make mechanism as intended
Fix rebuild dependency
Build hamlibdatetime.h every time
Force copy over existing
Minimize rebuilding
Correct use of sh if
Another attempt at a reliable SCS version header generation
Remove temporary file
Add missing shared library API exports
Add missing export definition
Blaine Kubesh (8):
added Icom803 to icmarine
added Icom803 to icmarine
added Icom803 to icmarine
Update ic-m803 remote-id to 20
Update icm803.c
Update AUTHORS
undo author changes
Update icm803.c
Bob Freeman (1):
New CNCTRK rotor backend
Brandon Durepo (5):
Added multi-stage Docker build and hamlib-runtime image
Added multi-platform support for linux/arm64 and linux/amd64
Add support for the hamlib-base-image and hamlib-runtime targets - support the arm64 and amd64 platforms on both a base-image and runtime
Added git and vim to the hamlib-base-image
Added Python support
Brian G. Lucas (10):
Pretty much a complete re-write of thd72.c, since the old one didn't work at all. Many commands have been tested with real hardware. But more work remains to be done.
WIP: thd72 driver. More level, func, and parm stuff works.
WIP: thd72 driver. Try to simplify the menu based interface.
WIP: thd72 driver. First cut at get_channel(). Other cleanup.
WIP: thd72 driver. More interfaces implemented. Other cleanup.
Implement some more interfaces. Comment out get_chan_all_cb because the block read routine doesn't work.
Fix a format so that it works with Windows. Can't test it because I have no Windows machines.
Fix RFPOWER level for FT-450D. It uses 5-100, rather than 0-255 that the FT-450 does.
In newcat_open(), initialize rig_id in case any subsequent commands need it.
Some calls to thd72_get_menu_item where passing wrong values for range check.
C-Elegans (1):
Add ability to have rigctld display transverter frequency
CJ (1):
fix windows makefile
Cedric DJ3CE (1):
Add SWR get_level to K3 (KX3, KX2)
Charles Suprin (7):
Add file for TM-D710 support.
Merge branch 'master' of ssh://hamlib.git.sourceforge.net/gitroot/hamlib/hamlib
Add D710 to riglist.
Add D710 code to kenwood library.
Register D710 interface.
Initial D710 Implementation.
Register D710 interface.
Charles Suprin, AA1VS (3):
extend th_get_vfo_char to support D700
Changed th_set_freq to round and select step size to use. Allows 6.25kHz and 5kHz channelization.
Use new th_set_freq for TM-D700
Chris Karpinsky, AA1VL (7):
add serial_flush() method to clean rx buffer
initial stab at this for the Yaesu FT-817
add ft817.*
add ft817
bump the backend status to ALPHA
Initial entry of cgirig giving ability to use hamlib from a web browser.
increased post write delay to 300
Chris Ruvolo (4):
TS-690: deal with optional tone board using TS-450 logic
TS-690 does not implement the PC command to get/set output power level
TS-690 does not implement the GT command to get/set AGC rate
TS-690: bump version
Christian Bayer (11):
upstream 817
FT-817 power and SWR levels
ft-857 power levels for 2m/70cm
export correct function for wsjtx
fixed cal table conversion
added header
use correct value
divider update
disable scaling
fixed compile errors
fixed merge errors and variable declarations
Christoph Berg (2):
ic7610: Re-add send_morse
Implement netrigctl_stop_morse
Christoph Nadig (1):
Fix for setting power on Elecraft TRXs
Chuck Hemker, N2POR (1):
Use RIG_TARGETABLE_MODE in rig_set_mode and rig_get_mode
Chuck Ritola (8):
Use loop to ensure RS-HFIQ hears first command. Closes #730
Add ability to read TX drive level
Implement board temperature reading for TEMP_METER
Parse and store RS-HFIQ firmware version.
Firmware version check before power meter query.
Merge branch 'master' into rshfiq-aug2021
Map FCDPP LNA and Mixer Gain as PREAMP values. Closes #766
Map FCDPP LNA and Mixer Gain as PREAMP values. Closes #766
DJ3CE (1):
Patch power reading of IC-705/-905
DL1YCF (6):
Merge branch 'master' of https://github.com/Hamlib/Hamlib
Merge branch 'master' of https://github.com/Hamlib/Hamlib
Merge branch 'master' of https://github.com/Hamlib/Hamlib
Merge branch 'master' of https://github.com/Hamlib/Hamlib
Merge branch 'master' of https://github.com/Hamlib/Hamlib
Merge branch 'master' of https://github.com/Hamlib/Hamlib
Dale E. Edmons, KD7ENI (19):
Added comments to commandline in rigctl (second time) --Dale
Started TS-2000 update/overhaul --Dale
Copied too much stuff, backed out what I broke.
Bring ts2k.c more in line with current CVS.
Changed ts2000.c to ts2000.h.
Start of rig menuing functions.
New file.
Renamed ts2000.c.new ts2000.h
Bring code more in line with CVS code.
Changes often, so added status. Will delete when things stabilize.
Corrected status to CVS branch.
Renamed new ts2000.c to ts2000.h
Wouldn't compile. Removed ts2k.c. Haven't got all new rig.h stuff removed.
Temp kludge to make ts2k.c compile (keeps Hamlib from compiling!).
Updated status.
Added working TS-2000 files. There are some changes left out but this is the minimum I could commit and have a functional rig. The cost is that I've broken kylix and others that duplicate rig.h. I'm in the process of repairing the damage. Please be patient. I hope a day or so, but am asking for up to a week. E-mail me about *anything* you find broken. Kylix (and similar) is (are) known to not work.
Changed name back to original.
Had to re-run automake kenwood/Makefile.
1) Updated branch_ts2k with respect to HEAD. 2) Working ts2k_menu. (only in RIG_MODEL_TS2K) 3) Split TS-2000 into experimental and standard versions: RIG_MODEL_TS2000 = standard, RIG_MODEL_TS2K = experimental. 4) Basic command parser in tests/rc. Will open/close rig or copy a freq from one rig/vfo to another rig/vfo. Very cool. Very basic. Very experimental. 5) Added test programs. a) testcmd - calls parser (no command prompt yet!) b) testts2k - replacement for testrig (with trivial modification) c) testptt - testts2k/testrig should not transmit. TX stuff in testptt. 6) Used crowbar to merge HEAD into branch_ts2k. Working on clean-up. 7) I'm sure I've forgotten or neglected to mention some other stuff.
Daniel Estévez (2):
Fix DIG MODE for FT817-ND
Fix DIG MODE for FT817-ND
Daniele Forsi (5):
Set the executable bits on py3test.py
Fix spelling errors
Fix more spelling errors
Fix more spelling errors
Fix typos
Daniele Forsi IU5HKX (71):
Fix a [missingInclude] "information" when running cppcheck --check-config
The -M option needs an argument like its long version "multicast-addr"
Fix lintian warning: macro 'RG' not defined
Fix lintian warning: macro 'IN' not defined
Fix spelling errors
Remove unused includes related to times and dates
Remove unused includes of math.h
Remove unused includes
Revert unwanted changes
Remove unused includes of errno.h
Remove unused include of amp_dummy.h
Remove unused include of cm108.h
Remove unused includes of fcntl.h
Remove unused includes of frame.h
Remove unused include of getopt.h
Remove unused includes of gpio.h
Remove unused includes of cal.h
Remove unused include of usb_port.h
Remove unused includes of ctype.h
Remove unused include of stdbool.h
Remove unused include of stdarg.h
Remove unused include of stdlib.h
[icom] Remove unused include of config.h
[kenwood] Remove unused include of config.h
[yaesu] Remove unused include of config.h
[rotators] Remove unused include of config.h
[tests] Remove unused include of config.h
[rigs/*] Remove unused include of config.h
[amplifiers] Remove unused include of config.h
[extra] Remove unused include of config.h
Add include/hamlib directory to all makefiles
[icom] Fix includes
[kenwood] Fix includes
[yaesu] Fix includes
[rigs/*] Fix includes
[rotators] Fix includes
[tests] Fix includes
[amplifiers] Fix includes
Update .gitignore
Fix unterminated comment
Fix include not found by cppcheck.sh
Enable --show-conf for ampctl and ampctld
Fix typos
Fix include not found by cppcheck.sh also in the other branch of the "if"
Fix passing one or more paths to ./cppcheck.sh
Fix several cppcheck "missingInclude" informational messages
Fix cppcheck "unmatchedSuppression" informational messages
Add to .gitignore some files created during "make check"
Fix cppcheck "missingInclude" informational message
Fix Doxygen unmatched directives \cond and \endcond
Fix Doxygen documentation for the Apex rotator
Fix Doxygen documentation for the GRBLTRK rotators
Fix typos
Fix Doxygen comments
Fix typos
Remove duplicated conditions
Fix initializer-overrides warnings by clang
Fix typos
Add/fix Doxygen comments
Fix segfaults with malformed input and wrong command line arguments
Fix segfaults with malformed input and wrong command line arguments
Fix check for RIG_BUSBUSY
Fix name of command in the usage and version texts
Fix name of command in the version text
Fix man page of rigctld
Fix warning message for twiddle_rit
Fix typos in man pages and other documentation
Fix typos in comments
Fix typos in messages
Remove duplicated sentence
Fix typos
Dario Ventura (3):
New Prosistel rotor backend from IZ7CRX
Add elevation code to Prosistel backend
TS2000 Satellite mode and Gpredict
Dariusz Bismor, SQ9KEJ (1):
rigmem: implement CSV file loading
David Brewerton M0EZP (1):
FT990UNI patch contribution from M0EZP
David Fannin (1):
Submission for new backend model (134) for Yaesu FT-DX1200
Davide Gerhard (3):
tests/{memcsv.c,memsave.c}: partially revert commit 4072f9f4
ic746.c: correct chanbuf length, fix channel structure and support split
ic746.c: add ic746pro_set_channel() to load memory from csv
Dawid SQ6EMM (3):
Add method to build inside docker
Let SEND_MORSE and SEND_VOICE_MEM be announced as capabilities.
Allow \send_voice_mem to be used over network and tested in dummy rig
Dawid Szymanski (2):
ICOM Voice Keyer implemented.
typo fix
Dhiru Kholia (1):
Minor fixes for FT-747GX simulator
Diane Bruce, VA3DB (5):
- first cut at fixing configure to recognise --without-tcl-binding and --without-python-binding options
- gt_HEADER_INTTYPES_H is definitely bogus here, leftover from what?
- document debian/FreeBSD needs for AUTOMAKE etc. - add in libtoolize which should be there
- These should have been commented out.
- Extra comma on RIG_STATUS_BUGGY can cause a compiler error.
Dieter Röver (1):
Fix bug in vfo_comp calculation in Hamlib
Ekki Plicht (DF4OR) (2):
New model Icom IC-R8600
Patch for Icom DCS code handling
Eli Schwartz (1):
tests: fix compilation with modern compilers
Elliott Liggett (1):
Added functionality for the IC-7300 auto antenna tuner
Eriks Dobelis (2):
ft817: adding delay before next retry after returning from tx to rx
ft817: Moving delay value into #define section of the header
Ervin Hegedus (9):
RIG_PASSBAND_NORMAL wasn't handled correctly when rig_set_mode() was called - fixed
Fixed SWIG `Setting a const char * variable may leak memory' error
Fixed Kenwood filter cmd when passband is set to 500Hz
Merged from upstream
Merge branch 'master' of http://git.code.sf.net/p/hamlib/code
Added Lua binding and demo script
Added new example to Python demo script (set/get float type level)
Change variable length argument handling in affected functions
Fix two typos
Ervin Hegedüs (1):
rig.swg: New properly formatted macro
Evgeniy Titorenko (1):
Add Radant AZV-1 Rotator controller protocol.
Francois Retief (21):
Added read_serial function to read strings from a port.
Corrected some comments
Added code to hexdump to right align ASCII dump column
added private caps for rig termination character
add private caps and more commands.
Changed to a new transaction function and adde quite a few commands.
add private caps to store the termination character of Kenwood rigs commands.
added a kenwood_init and _cleanup routine for priv caps & priv data.
Added a new function: LCD Lamp ON/OFF (for Kenwood TH-7DA)
check trn state of rig in rig_open.
Initial commit of Kylix binding
New backend for rotators
New RPC backend for rotators
Added rot_move function
Fix macro name
Added rot_move function
Added easycomm and rpcrot backends
Fixed circular dependency for rpc.rigd and rpc.rotd
regenerated
Added IC-910 rig.
Added constants for the IC-910 rig.
Frank Goenninger (8):
Add ADAT ADT-200A backend
adat updates from Frank, DG1SBG
ADAT fixes on Windows
RIG ADAT: Adaption to firmware 1.40fb and transverter board.
.gitignore: Ignore some macOS housekeeping files.
Major code cleanup. Replace dyn. memory by static memory usage.
FIXED: Source code inconsistency after major code change.
FIXED: Incorrect usage of snprintf() argument for buffer length.
Frank Singleton, VK3FCS (165):
Initial revision
Initial revision
*** empty log message ***
*** empty log message ***
*** empty log message ***
Initial revision
Initial revision
*** empty log message ***
*** empty log message ***
added build_all ,cleanall and verify targets
*** empty log message ***
initial top level makefile
add some things
initial import
initial import
initial import
fixed some typos
use rig_open and rig_close
added rig_open and rig_close
fixed cmd_sat_on / off
added sat-on and sat_off to test
changed cmd_get_rx_status, must do tx also
updated test()
all reads use while (1) and break
added ../common as object path
added rig_open and rig_close
using rig_open and rig_close and serial.h
use common dir for serial stuff
use ft747 on serial port /dev/ttyS0
read uses while(1) and break
use while(1) and break
added read_sleep
use read_sleep now from serial.h
using read_sleep from serial.h
had rx and tx status swapped (document error?)
removed cmd_get_update
using CVS instead of RCS directories
use MODE_xx defines
cannot use const int in case statements ?? so use #define instead
use #defines for MODE_XXX used in case statements
working out freq conversion, unfinished
playing with test routines
long int cmd_get_freq_mode_status_main_vfo(int fd, unsigned char *mode);
long int cmd_get_freq_mode_status_main_vfo(int fd, unsigned char *mode)
frq = cmd_get_freq_mode_status_main_vfo(fd, &mode);
starting with the cmd_set commands now
starting on cmd_set commands now
starting on cmd_set_freq commands now
add scanning todo
now set sat rx and tx freq and mode also
fix typo
dump raw hex data when writing and reading
trying some cms_set_freq_xxx commands
added routines for dec <-> packed decimal conversion
minor
added generic hex dump routine, static void dump_hex(unsigned char *ptr, int size, int width);
removed unwanted debug printf's
removed dump_hex from here..
calc_freq_from_packed4 is about to be replaced
calc_packed_from_char and calc_char_from_packed now here
cleanup
cleanup
void dump_hex(unsigned char *ptr, int size, int width);
adding dcs tables and repeater offset in Hz
describe faulty yaesu documentation
added README.license for GPL
added GPL license info
included full GPL license
Updated docs to point to http://sourceforge.net/projects/hamlib/ and added a C code snippet on how to use the API.
added -I$(COMMON_DIR) to find rig.h
added -I$(COMMON_DIR) to find rig.h
adding capabilities
initial capabilities stuff
starting to add rig_caps stuff
starting to add rig_caps stuff
starting to add rig_caps stuff.
added GPL stuff and comments
adding rig_caps stuff
adding rig_cap stuff
adding rig_caps stuff
add capabilities and preferences
adding rig_caps functionality
adding rig_caps stuff
frontend reduction on backend function namespace - phew !!
frontend API clarification
removed old open_port2() using old rig_caps
fixed some typos, added 3 more candidates for API
missing ; in some enums
converting to frontend/backend structure compiles ok
removed open_port() and write_block()
removed open_port() and write_block()
fixed typos, added &ft747_caps in rig_caps
changing to frontend/backend style
converting to frontend/backend style
added 3 more cmd_* for API examples
Example of setting rig Main VFO to 439.700 Mhz FM
cleanup comments
added extern const struct rig_caps ft747_caps;
still thinking about set/get strategy
minor updates
added extra rig caps
added some set/get examples with return code checking
added testrig to Makefile, no linking yet
added usleep to read_sleep()
updated rig_caps structure
*** empty log message ***
test making a shared lib (at last) for the frontend - more todo
test making a shared lib for the frontend - make hamlib
describe frontend/backend structure
updated code snippet example
started ft747_set_ptt and ft747_set_vfo
starting to implement set/get pairs
added typedef enum ptt_type_e ptt_type_t;
added VFO types to enum
starting on libhamlib Makefile, added ./lib and ./include under common
make, make install, and make clean work ok, using ./lib and ./include directories also.
make, make install, and make clean work ok, using ./lib and ./include directories also.
removed "make verify". Added reference to common/Makefile
added printf("testrig:main() has been called \n"); for testing linking
makefile for testing testrig linking
alternative rig_base declaration removes references to rig_caps at compile time. should populate it another way -- FS
added printf's to confirm rig.c (hamlib) is being called ok
better libhamlib.so version :-)
added ft847_open and ft847_close to enable CAT ON/OFF
added ft747_open and ft747_close
updated lib names for backend to libhamlib-xxxxx.so
API updates - added set/get_mode
merge with TRN stuff and add some set/get_mode and vfo stuff
added post_write_delay
cvs mails to hamlib-cvs-digest
cvs mail update works ok :-)
minor fixes
updated ptt/mode/vfo
added set/get freq to use generic bcd etc
more set_freq() examples
1. Added VFO as target for some set/get cmds. 2. ./testrig still runs ok using RIG_VFO_CURR.
minor update to active VFO handling in _set_vfo
some new defines for FT747_VFO_A/B
minor updates to active vfo handling
added ptt handling example, stand back !
trying different approach to storing cmd sequence. _set_ptt is being converted. Needs tidying up though. Some sequences are complete, and can be read from static data. Incomplete sequences will eventually be copied form static declaration, and completed in priv data.
Removed static stuff from functions. Also, begin to implement table driven command translation from API to rig native. priv now contains a cmd table that is used for backend commands towards rig.
Added some new freq/mode combinations.
converting ft847 to table driven, similar to ft747.
more table driven stuff for ft847. cat/ptt/freq being converted.
Added ft847_send_priv_cmd(), converted some part of API to use this. Added _set_mode to work now. TODO: put _send_priv_cmd into yaesu.[ch] so ft747 can use also. Turned on PTT also (stand back)..
rig_cleanup and rig_close not calling backend
removed unused calc_ functions.
removed old API functions, general cleanup tested rig_close and rig_cleanup
Initial release, common yaesu declareations etc.
add version tag
nseq uses YAESU_CMD_LENGTH
Initial yaesu Makefile
Moved from ft747 and ft847 dirs
common yaesu handling
common yaesu dir
Begin to use common yaesu code
general cleanup, added _send_priv_cmd
added targetable_vfo value to caps
minor cleanup
ChangeLog history started
Initial import for ChangeLog handling
starting to convert rig struct to readable form
more of convert rig struct to readable form
Changelog update for HAMLIB-1.1.1
GeoBaltz (1):
Merge branch 'master' into rp12
George Baltz N3GB (179):
Add missing level definitions for TS-590SG
Add routine to check input to <brand>_set_level
ATTenuator level 0 should always be allowed - to turn it off.
First round of level_gran additions.
Do the check for min=max=0 the right way.
Round 2.
Enable first user of check_level_param
Round 3 of level_gran updates.
Remove hard-coded constants.
Enable full level checking for TS-890S.
Add default level values for Elecraft rigs.
Update RIG_LEVEL_READONLY_LIST.
Round 4 of level_gran updates.
Fix the comment about float levels.
Add Elecraft defaults to makefile.
Fix typos (missing '('s ) in man pages.
Add missing commands to man pages
Avoid NULL dereference in debug statement.
Use level_gran[] values in kenwood_get_level.
Still more level_gran data.
Yet more missing level defs.
Enable level_gran[] checking for all calls to kenwood_set_level.
Add basis for level_gran use in newcat.c
Convert set/get AF, RF to use level_gran info.
Convert MICGAIN to level_gran
Convert COMP
Convert ANTIVOX & VOXGAIN
New for old - update level_gran for ft9000Old
Fix segfault on rigctl exit
Convert SQL to use level_gran data.
Convert MONITOR_GAIN
Convert RFPOWER to level_gran usage
Convert NR to use level_gran
Fix inverted VHF/UHF BANDSELECT labels
Fix duplicate level definition
Add RIG_LEVEL_USB_AF_INPUT to RIG_LEVEL_FLOAT_LIST
Implement RIG_LEVEL_USB_AF[_INPUT] for TS-890S
Enable set_level checking for all Yaesu/newcat rigs.
Replace hard coded constants with table values
f conversion already rounds, so no external rounding needed.
Move meter reader to kenwood.c, so it can be used by ts990.c
Use general meter reader to get SWR value for TS-990.
Revert "Fix FTDX101MP RFPOWER to allow 200W" Unnecessary code, breaks other levels.
Fix FTDX101MP RFPOWER the right way.
Restore shared library ABI compatibility with previous hamlibs
Add basic support for transparent access to port structures.
More Kenwood rigs ported to new access macros.
Convert the remaining files in rigs/kenwood/
Define different (disambiguated) names for external use.
Fix copy/paste errors in xiegu.c
More typos/copy/paste errors in rigs/icom
Add cache to the MACRO/porting list
Implement function to get structure address
Function to get amplifier port address Convert src/amplifier.c to new MACROs/access method.
Add function to get rotator port address(es)
Port conf.c to use access macros
Convert more files in src/
Pointerize all the ports in src/rig.c
Need more parens to work in expressions.
Update example.c Avoid using raw rigport, in two different ways. Fix variable name.
Implement ctcss tone for TS-890S.
Fix off by one error in tones for TS-590/890/990 Fix some rigs I found docs for - more needed
Add funcs to set/clear TONE/CTCSS modes for TS-890S
Add remaining rigs, matching old behavior. Fix copy/paste foulup.
Drat. Fix more copy/paste SNAFUs
Update NEWS with pointer conversion macros.
Make simulator match the Real World(TM) Add missing P4 Repair RIG_LEVEL_STRENGTH
Add calibration table for TS-890S RFPOWER_METER_WATTS
Bring simts890.c a little closer to the real thing Still needs more work.
Fix icom_set_powerstat() to correctly save&restore rp->retry, rp->timeout_retry
Convert some cache references to pointers
Convert a few more cache pointers
Cache pointers for src/rig.c Issue #1420 again.
Convert rot_conf.c and amp_conf.c to pointers
Update dcdport usage in tests/*.c Issue #1445
Play catchup with split/VFO revision. Fix typos in rebase fixups.
Start converting rigs/* This commit does rigs/adat/, rigs/alinco/ and rigs/aor/.
Port rigs/anytone/, rigs/barrett/ and rigs/codan/ Fixup git rebase SMerge error.
Convert rigs/dorji, rigs/drake, rigs/elad.
Convert rigs/dummy/
Convert rigs/flexradio, rigs/gomspace, rigs/jrc, rigs/kachina
Convert rigs/icom/, rigs/kit/
Convert rigs/loew/, rigs/pcr/, rigs/prm80/, rigs/racal/ and rigs/rs/
Convert rigs/mds/, rigs/skanti/, rigs/tapr/ and rigs/tentec/
Do rigs/tuner/, rigs/uniden/, rigs/winradio/ & rigs/wj/
Convert rigs/yaesu
Minor cleanup of ts890.c
Update simts890.c Make IF return RX/TX status Document IF data, reformat IF & SF commands
Convert all port references in amplifiers/ to pointers.
Convert first part of rotators/
Finish rotators/
Add STATE to the list of pointers
Convert tests/* to pointers
Finish tests/*
Update some of rigs/* to use pointer to cache
Use pointers for all cache references in rigs/*
All struct rig_cache referenced converted to pointers.
Start converting rigs/* to use pointers to state
More pointers to state
More pointers to state
Pointerize all state references in rigs/kenwood/*
Add macros for amplifier and rotator state pointers.
Fix incorrect port read for elevation
Normalize some debug/trace output.
More state pointer changes
Convert macros in rig.h to use STATE()
More state pointer changes
Still more state pointer conversions.
More state pointers - mostly sed i
Pointerize state references in Tentec rigs.
And another batch...
Use sed -i on all in rigs/kit/
More sed -i with manual fixups.
Convert all of rigs/* except rigs/icom and rigs/yaesu
First set of rigs/icom/* state pointer macros.
Convert rigs/icom/icom.[ch]
First batch of state pointers in rigs/yaesu/
Next batch of state pointers
Convert newcat.c
FIx the stragglers
Revert "Fix rotorez set_conf in both rotctl and rotctld -- since it needs to be done after rot_open"
Definitions, storage and infrastructure for queuing config commands
Implement the first user of the deferred set_conf entries.
Fix other rotators that try to do I/O before open.
Finish all port initialization before allowing I/O.
Balance ENTERFUNC/RETURNFUNC, ENTERFUNC2/RETURNFUNC2, ELAPSED1/ELAPSED2 usage
Balance ENTERFUNC/RETURNFUNC usage
More of the balancing act.
More balancing
Finish balancing
Get rid of some false positives for func_chk
Fix func_chk to do useful things
Fix ENTERFUNC/RETURNFUNC imbalances found by repaired func_chk
More pointer conversions for rig->state.
More pointerizations in src/*
Convert all rig->state. references in src/rig.c to pointers.
Play catch-up with recent code.
Use pointers for amp->state references
Use macros/pointers for rot->state references
More amplifier and rotator state changes
Yet another batch of state pointers
Catch up with latest code
Balance new code.
Fix wrong error message for SF1 command.
Make SNPRINTF do something useful for Hamlib
Remove dead code
Declare local functions as local
Implement rig_get_clock for TS-890S
Fix wrong utc_offset
Use a reliable source for TZ offset
Add just enough to simts890.c to fake kenwood_get_clock.
Tweaks to simts890.c
Fix negative fractional UTC offsets
Implement kenwood_set_clock
Fix command lengths for TS-890S set/get_antenna.
Still more tweaks to simts890.c
Replace raw write() calls with macro
More fixes for simts890.c
Reduce dependency on include/hamlib/rig.h
Convert VFOs into objects(structs).
Get rid of ghost commands.
More VFOs as objects.
Change FA/FB/SF to use band memories
Implement step sizes for some freq changes
Add DN/UP, FC, and UD commands to simts890.c
Correct some split problems and connect VFO ops
Clean up
Make FR & FT commands aware of new vfo structs.
Add traffic tracing to simts890.c
Annotate legacy (undocumented) commands in simts890.c
Add RIT/XIT commands (FS, RC, RD/RU, RF, RT, XT) to simts890.c
Astyle simts890.c
Update TS-890S and TS-990S RIT/XIT handling
Factor out TS-890S and TS-990S from kenwood_get_split_vfo_if()
MACROize new code.
Minimal support for KY commands in simts890.c
Use short (i.e., variable length) messages in kenwood_send_morse()
Fix porting unneeded code
Fix unbalanced ENTERFUNC/RETURNFUNC pairs in icom.c
Georges Auberger (1):
Add product id for CM119B chip. Used in KURI adapter designed by W7NX.
Gerardo Richarte (1):
gs232b.c: Improve get_position string parsing
Gisle Vanem (1):
Enable verbose mode in bindings/pytest.py
Greg Troxel (1):
Warning about dodgy code in drake.c
HB9EIK (4):
Initial release ELAD FDM DUO
Update ELAD files
Update build system for ELAD backend
Update copyright for fdm_duo.c
Hans Van Ingelgom (1):
Added Peaberry V1 and V2 models
Hegedüs Ervin (4):
Merge branch 'master' of http://git.code.sf.net/p/hamlib/code
Check SWIG string functions for some languages
Leave off multiply 'typedef const char * const_char_string' definition (in rig.swg and rotator.swg)
Fixed int[10] type variable error in bindings
Jae Stutzman (5):
Added HPSDR backend
Clears potential garbage data in read buffer prior to command being sent
Updated PiHPSDR backend defaults
Use Windows ioctlsocket to avoid buffer overrun
Added new AGC control for PiHPSDR
James Watson, HZ1JW (2):
Added ic7200 to icom
Corrected modes in ic7200.c
Jaroslav Skarvada (2):
Fix hardcoded pcconfig libdir
Fix serial_port DCD squelch
Jeroen Vreeken (9):
Add support for GPIO PTT.
Add missing breaks and improve error messages
Add Dorji DRA818 modules (VHF and UHF variants) Also works with NiceRF SA818 modules
Merge branch 'master' of git://git.code.sf.net/p/hamlib/code
Small fixes to DRA818 volume handling
Add GPIO and GPION options for DCD. Also bump abi version since the config params struct needed resizing.
Merge branch 'master' of github.com:Hamlib/Hamlib
GPIO working after debugging
Merge branch 'master' of github.com:Hamlib/Hamlib
Johan Ström (1):
Backup serial options on open, restore on close
John Paul Adrian Glaubitz (1):
dummy/dummy.c: Fix unaligned access in dummy_get_level()
Jonathan Bastien-Filiatrault (3):
Correct FT; command that does not exist on the FT-891.
Allow setting split mode without smashing the VFOB frequency.
Scale power values correctly for Yaesu FT-891.
Jonny public (1):
ether6: New rotor backend from Jonny, DG9OAA
Joop Stakenborg, PG4I (116):
update (kenwood is not a WIP anymore)
first implementation of kenwood_get_ptt
enable get_ptt for this rig
add get_ptt for this rig
additional protocol checks and cleanups
fix signal strength
add RIG_LEVEL_RFPOWER
fix_compilation
add rit capabilities
bring comands in sync with other kenwood rigs
add rit capabilities
send_morse added
explain set_rit
fix get_ctcss_tone by using IF command
typo
add xit capabilities
add set_level and get_level
bring rig in sync with other kenwood rigs
bump version numbers
nothing returned by the rig for these commands
fix get_level_agc
fix set_level_agc
getting in sync with the debian 1.1.2 package
remove template files
initial checkin
make this NMU for now
correct the path for copying files in the apropriate package
do not install the old changelog
versioning not used
move .la, .a, .so files to the correct package
include rpc.rigd and rpc.rotd
include pkgconfig support
don't create shlibs file for drake, jrc and easycomm libraries
move hamlib1 to the top so the documentations gets installed correctly
make building easier, call autogen.sh
INSTALL file not used
build the documentation package
we don't have to call configure twice
cleanup
remove some build dependencies and don't call autogen.sh
ts450s uses IF command for get_vfo, get_freq and get_mode
minor bugfix, bump to beta
add CWR and RTTYR
this rig does not have a command for reading IF bandwidth
retrieve passband with FW command
passband should be calculated after mode is set
use rig_passband_normal here
various lintian fixes
one last lintian fix
use FW command to set bandpass
cw filters for normal, narrow and wide
more filters
get_mode and set_mode for this rig
filters
some comments
correct rit
add get_level
cleanups
more modes
set_level for this rig
should use kenwood_get_freq
minor bug
add rpm support
need hamlib.spec for 'make rpm'
make rpm will fail with a '-' in the version number
a working spec file
update debian build for rotorez and fodtrack, minor fixes
unofficial
fix the debian build script, new maintainer
update the debian build tree to the latest
correct baudrate for the ts-950, use the information field IF for get_vfo by default (supported by most kenwood rigs), ts870s will use the much shorter FR command for get_vfo
correct baudrate for some rigs and add ts-950 to the id_list
ts-850 returns ID 009 according to martin, OK1RR
fix 'make rpm'
build for hamlib-1.1.5
not needed
sync with latest debian package and add tcl, c++, python and perl bindings
correct spelling
s-meter calibration by Matt Dawson
basic functionality by Matt Dawson, tested with grig and xlog
lifetime e-mail address :-)
sync with latest debian release
more functionality, mode and frequency get by Matt Dawson
only switch tx vfo is split is on
set attenuator level
export convenience function get_kenwood_level, so they can be use by other backends
add RIG_LEVEL_SWR, copied from ts850
add RIG_LEVEL_COMP, RIG_LEVEL_AGC, copied from ts850
bump version, no preamp
really add ALC read this time, only change meter if needed, cleanups
split has_get_level and has_set_level
fix coding, python2.4 compatibility
fix compilation warnings
more compilation warnings nuked, use tone_t for ctcss_list
use size_t
fix more compilation warnings, int->size_t, unsigned char->char
more unsigned char->char and int->size_t transitions
set functions should have ack_len zero, also need to check other rigs
make sure we use ack_len=0 for functions that return nothing (set functions)
more unsigned char->char and int->size_t transitions
extend rig capabilities, patch by Tom, DL1JBE
add RIG_LEVEL_STRENGTH to caps, set post write delay to 0 and do some cleanups
re-establish post-write delay
remove rpath backdoor
long long really needed here?
updates by matt, GW0VNR
long long really needed here? - patch by diane Bruce
distribute footer.html
correct set/get power
try better s-meter readings
packages renamed
obsolete
sync with latest debian release
no need to link to python
sync with latest, python changes
another debian update: use 'make distclean' in the rules file
Joshua Lynch (4):
initial SatEL rotator support
factored io functions out. improve reliability...i hope.
fixed state bug. reconnecting would disable motion every other connect.
merged upstream/master into master
Juergen Rinas, DC3BW (4):
added antenna switching...
added a few get_level/set_level get_function/set_functions.
* fixed set_func (concerns most kenwood rigs) * added 115200 to the list of baudrates in probeallrigs_kenwood()
* fixed ptt * expanded frequency range (available after firmware update) according to http://www.kenwood.com/i/products/info/amateur/ts_480/firmware/pop_ts480_e.htm * added tuning steps * added filter list * increased version info
Julian Cable (3):
WinRadio G313: Updates from Julian Campbell
wrg313api.c: Fix Win32 (MinGW) build issue
Use Automake conditionals for G313 build
Juuso Lehtinen (4):
Add get & set RIG_LEVEL_NB for Yaesu rigs.
Fix set level METER for Yaesu rigs
Add ID, VD & Comp meter cals for FT991
Add better defaults for newcat meter cals
Kamal Mostafa (3):
Fix mingw32 cross-compilation procedure and config
Do not let macros/ac_python_devel.m4 trash CPPFLAGS and LIBS
Fix spelling errors
Kamal Mostafa, KA6MAL (19):
Hard-code length of hamlib_version and hamlib_copyright strings to stay compliant with hamlib 1.2 ABI and avoid spurious "consider relinking" warnings from dynamic loader.
Removed stale debian/ dir from the hamlib source (it is maintained in the Debian diff and isn't useful in this tree).
Update bundled libltdl (libtool) to version 2.2.6b to address CVE-2009-3736. - autogen.sh: never downgrade our bundled libltdl/ (only run libtoolize if system version is newer than our bundled version). - autofixer.sh: script removed as libtool 1.x is no longer allowed. - configure.ac: (not enabled) optional setting to deprecate embedded libltdl/.
Added Kamal Mostafa and Jaime Robles as maintainers for Debian packaging.
Fix build --with-python-binding breakage introduced by Python 2.6: Do not reference LOCALMODLIBS, else it will add libraries to our link line (e.g -lssl) which are not necessarily installed.
Elektor 507 frequency selection resolution improvements, contributed by John Nogatch AC6SL.
Move backend libraries into /usr/lib/hamlib directory.
Force automake to invoke the C (not C++) linker in kit/ when no C++ is in use.
python: fix --with-python-binding configure macro
fix configure.ac pa...
[truncated message content] |
|
From: n0nb <n0...@us...> - 2024-12-24 08:43:38
|
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, Hamlib-4.6 has been updated
via c9031ca4d7d1b7817f0e461814a740bfeb383f84 (commit)
via d66b176d1b848ddf46753d5f3483688028716b23 (commit)
via 15d7242d5ad3df90088cc7e1cc49b0484db6a1a0 (commit)
via 8589d5c6bc24809cae1c8cfbdab589b92641d9db (commit)
via f9185d1d2469fad84aa925396606c6b752b17e49 (commit)
via e262fb82c262f1b6e279e337f1642a6689256f94 (commit)
via e56f8187614b2702fb584117a006a2e789ceea3f (commit)
via d5dd12d50d824d4655f4c3a0e8b3cffdc464df56 (commit)
via 45cc53a5265677f572f4526d750ee546bb4390c4 (commit)
via 750adb40b53f89889b802bc64100ce095f114dc2 (commit)
via b763761d9e307b4023e8a28d1dcbdc0116a5ff12 (commit)
via d302b8fabd713cfbebd53679ad5fb685122903cc (commit)
via fe45fa2dfc15f2152d6294e7457ae218df972a0f (commit)
via 86518546db30c22a42c5ddc12e68434c4ed3f8ee (commit)
via 13f7b01d279a14078b485b9af4e999d3d4f8f5c7 (commit)
via 62b0a25a3ddab25c65de373dd6a83d812af5a9f1 (commit)
via 57c5047c3ec662cd102961346ed1d4957ea88b5b (commit)
via 89383a553a5e6b05779479edac2af0134cb10335 (commit)
via ec3978e5210f6142f33504523168f55b4a4032ac (commit)
via 2b23051c6ddb266c359ce57008d44deeab3f5bc6 (commit)
via 032e530def273825892a6bfe8e4b5eef137ec529 (commit)
via a7dbebffa9297d3e9afa5c356ab74bfdb2c0243d (commit)
via 33293112744fc08f70811af4add9c7dd6f6533fa (commit)
via 6bb5c404994308c06bdfd853642b60adb662b78f (commit)
via ec7103582297545948602bc833cf1883fd94e8d8 (commit)
via 8842ae7c2920799442bfda812fa56c241dfdeebd (commit)
via 4b4b1b0d517403f0f460f1a255358b4f1b426e0b (commit)
via e6be427c519ae3228787c728a1bdc5cc5dc31d0c (commit)
via 72424ac144904dc9c70161fe70c64f8657e89758 (commit)
via 12c453ccd3cbf4455d346f7d4f42fa7061bee0cb (commit)
via 6cf93934a71a2ed143125a9f3b005ad38a542423 (commit)
via 9624f06be96bafaafaf12fe8188d7390cf5821a2 (commit)
via 0690fbc0c532f71d02ed74106191686d31cf13ea (commit)
via 3d8dbbcc1ada57a8660ccc919c98f40674df4b02 (commit)
via db00197e6adcddd18a810f619d38ac04c87fbd69 (commit)
via 5f621c9f5327be25432d0d761204faa434afaee2 (commit)
via a81c7d90c41ba6911b75d1806343b318141e6e0b (commit)
via a72aa0cb4171f0039f51c2112b1f523310b66ca7 (commit)
via a2af87068ea6771dc6e298b21e56ec769d6b31b0 (commit)
via bef2d13e4a8443ce32bba28116398a3edf156a45 (commit)
via 50e10f758223e456e1304e7b8ae8d2092d89a914 (commit)
via 5028a0c440e7643c25ae459f6150c8313b223a7d (commit)
via 74876c73ae45ed02b4f0ff45f317e59abb6212a1 (commit)
via 1364996bd298643a288d79edde45f7fd53cf0816 (commit)
via 27c4eb19ee32b46e4740f781d9f2470638e9f459 (commit)
from c0542ae864ce6f9cc4b29b0c30b44e273261d114 (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 c9031ca4d7d1b7817f0e461814a740bfeb383f84
Author: Nate Bargmann <n0...@n0...>
Date: Tue Dec 24 02:42:29 2024 -0600
Advance to 4.6 release
diff --git a/NEWS b/NEWS
index 37ec46881..94c00d634 100644
--- a/NEWS
+++ b/NEWS
@@ -13,6 +13,7 @@ Version 5.x -- future
* Change FT1000MP Mark V model names to align with FT1000MP
Version 4.6
+ * 2024-12-24
* send_raw can now take hex digits as colon-separated -- e.g. send_raw icom xfe:xfe:x94:xe0:03:xfd
* Add IC7760
* IC7300 Mode filter can now be set by # (i.e. 1,2,3)
@@ -86,8 +87,6 @@ static int add_to_list(const struct rig_caps* rc, void*)
* Add MDS 4710/9710 rigs
* Add FLIR PTU-D48, E46, D100, D300 rotors
* Fix FTDX3000 rig split
-
-Version 4.5.6
* Fix rigctld/rigctltcp information
* Fix FT817 get/set_vfo
diff --git a/configure.ac b/configure.ac
index 4c1c914d2..6e9b48eeb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -14,7 +14,7 @@ dnl Please do not use '-' in the version number, as package managers will fail,
dnl however, the use of '~' should be fine as apt (others?) will treat
dnl it as an earlier version than the actual release. TNX KA6MAL
dnl PACKAGE_NAME + " " + PACKAGE_VERSION must not exceed 20 chars!
-AC_INIT([Hamlib],[4.6~rc1],[ham...@li...],[hamlib],[http://www.hamlib.org])
+AC_INIT([Hamlib],[4.6],[ham...@li...],[hamlib],[http://www.hamlib.org])
#AC_INIT([PRODUCT_NAME], [Hamlib])
#AC_DEFINE([Hamlib], [PRODUCT_VERSION_RESOURCE])
commit d66b176d1b848ddf46753d5f3483688028716b23
Merge: c0542ae86 15d7242d5
Author: Nate Bargmann <n0...@n0...>
Date: Tue Dec 24 02:36:30 2024 -0600
Merge branch 'master' of github.com:Hamlib/Hamlib into Hamlib-4.6
commit 15d7242d5ad3df90088cc7e1cc49b0484db6a1a0
Merge: f9185d1d2 8589d5c6b
Author: Michael Black <mdb...@ya...>
Date: Sun Dec 22 16:23:09 2024 -0600
Merge pull request #1640 from GeoBaltz/fix25
Fix unbalanced ENTERFUNC/RETURNFUNC pairs in icom.c
commit 8589d5c6bc24809cae1c8cfbdab589b92641d9db
Author: George Baltz N3GB <Geo...@gm...>
Date: Sun Dec 22 15:50:56 2024 -0500
Fix unbalanced ENTERFUNC/RETURNFUNC pairs in icom.c
Also tweak comments/formats to eliminate false positives in code base
(except for the Catch-22 ones in tests/func_chk.c itself)
diff --git a/rigs/dummy/aclog.c b/rigs/dummy/aclog.c
index b8b8bedd9..3e0f69803 100644
--- a/rigs/dummy/aclog.c
+++ b/rigs/dummy/aclog.c
@@ -834,7 +834,7 @@ static int aclog_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
}
rig_debug(RIG_DEBUG_TRACE,
- "%s: return modeA=%s, widthA=%d\n,modeB=%s, widthB=%d\n", __func__,
+ "%s: Return modeA=%s, widthA=%d\n,modeB=%s, widthB=%d\n", __func__,
rig_strrmode(priv->curr_modeA), (int)priv->curr_widthA,
rig_strrmode(priv->curr_modeB), (int)priv->curr_widthB);
RETURNFUNC(RIG_OK);
diff --git a/rigs/dummy/flrig.c b/rigs/dummy/flrig.c
index 811ce04d7..b56f87453 100644
--- a/rigs/dummy/flrig.c
+++ b/rigs/dummy/flrig.c
@@ -943,7 +943,7 @@ static int flrig_open(RIG *rig)
if (priv->has_get_bwA)
{
- /* see if get_bwB is available FLRig can return empty value too */
+ // see if get_bwB is available FLRig can return empty value too
retval = flrig_transaction(rig, "rig.get_bwB", NULL, value, sizeof(value));
if (retval == RIG_ENAVAIL || strlen(value) == 0) // must not have it
@@ -1667,7 +1667,7 @@ static int flrig_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
}
rig_debug(RIG_DEBUG_TRACE,
- "%s: return modeA=%s, widthA=%d\n,modeB=%s, widthB=%d\n", __func__,
+ "%s: Return modeA=%s, widthA=%d\n,modeB=%s, widthB=%d\n", __func__,
rig_strrmode(priv->curr_modeA), (int)priv->curr_widthA,
rig_strrmode(priv->curr_modeB), (int)priv->curr_widthB);
RETURNFUNC(RIG_OK);
@@ -1792,7 +1792,7 @@ static int flrig_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
if (strlen(value) ==
0) // sometimes we get a null reply here -- OK...deal with it
{
- rig_debug(RIG_DEBUG_WARN, "%s: empty value return cached bandwidth\n",
+ rig_debug(RIG_DEBUG_WARN, "%s: empty value, returning cached bandwidth\n",
__func__);
*width = CACHE(rig)->widthMainA;
RETURNFUNC(RIG_OK);
@@ -1819,7 +1819,7 @@ static int flrig_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
if (strlen(value) == 0)
{
- rig_debug(RIG_DEBUG_WARN, "%s: empty value return cached bandwidth\n",
+ rig_debug(RIG_DEBUG_WARN, "%s: empty value, returning cached bandwidth\n",
__func__);
*width = CACHE(rig)->widthMainA;
RETURNFUNC(RIG_OK);
diff --git a/rigs/dummy/netrigctl.c b/rigs/dummy/netrigctl.c
index e0678653b..69241b448 100644
--- a/rigs/dummy/netrigctl.c
+++ b/rigs/dummy/netrigctl.c
@@ -280,7 +280,7 @@ static int netrigctl_open(RIG *rig)
}
else
{
- rig_debug(RIG_DEBUG_ERR, "%s: unknown return from netrigctl_transaction=%d\n",
+ rig_debug(RIG_DEBUG_ERR, "%s: unknown value returned from netrigctl_transaction=%d\n",
__func__, ret);
}
diff --git a/rigs/dummy/tci1x.c b/rigs/dummy/tci1x.c
index 0cc1cc0b9..779a9a8f3 100644
--- a/rigs/dummy/tci1x.c
+++ b/rigs/dummy/tci1x.c
@@ -1281,7 +1281,7 @@ static int tci1x_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
}
rig_debug(RIG_DEBUG_TRACE,
- "%s: return modeA=%s, widthA=%d\n,modeB=%s, widthB=%d\n", __func__,
+ "%s: Return modeA=%s, widthA=%d\n,modeB=%s, widthB=%d\n", __func__,
rig_strrmode(priv->curr_modeA), (int)priv->curr_widthA,
rig_strrmode(priv->curr_modeB), (int)priv->curr_widthB);
RETURNFUNC(RIG_OK);
diff --git a/rigs/icom/frame.c b/rigs/icom/frame.c
index 06ef16798..09a2faddd 100644
--- a/rigs/icom/frame.c
+++ b/rigs/icom/frame.c
@@ -150,9 +150,8 @@ int icom_one_transaction(RIG *rig, unsigned char cmd, int subcmd,
ctrl_id = priv_caps->serial_full_duplex == 0 ? CTRLID : 0x80;
- /*
- * should check return code and that write wrote cmd_len chars!
- */
+ // Should check return code and that write wrote cmd_len chars!
+
set_transaction_active(rig);
collision_retry:
@@ -204,7 +203,7 @@ again1:
if (retval < 0)
{
set_transaction_inactive(rig);
- /* Other error, return it */
+ // Other error, return it
RETURNFUNC(retval);
}
@@ -390,8 +389,8 @@ again2:
__func__, priv_caps->re_civ_addr, priv->re_civ_addr);
}
- /* RIG_TIMEOUT: timeout getting response, return timeout */
- /* other error: return it */
+ // RIG_TIMEOUT: timeout getting response, return timeout
+ // other error: return it
RETURNFUNC(frm_len);
}
diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c
index 0e651af5b..5fd927b17 100644
--- a/rigs/icom/icom.c
+++ b/rigs/icom/icom.c
@@ -1190,7 +1190,7 @@ retry_open:
rig_debug(RIG_DEBUG_ERR,
"%s: Unable to determine Icom echo status -- is rig on and connected?\n",
__func__);
- return retval_echo;
+ RETURNFUNC(retval_echo);
}
else
{
@@ -2687,7 +2687,7 @@ int icom_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
if (width <= 3)
{
rig_debug(RIG_DEBUG_TRACE, "%s: setting filter=%d\n", __func__, (int)width);
- return RIG_OK;
+ RETURNFUNC(RIG_OK);
}
if (((width != RIG_PASSBAND_NOCHANGE) && (width != current_width))
diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c
index 38a87600a..3cca97103 100644
--- a/rigs/kenwood/kenwood.c
+++ b/rigs/kenwood/kenwood.c
@@ -5518,12 +5518,11 @@ int kenwood_send_morse(RIG *rig, vfo_t vfo, const char *msg)
RETURNFUNC(retval);
}
- /*
- * If answer is "KY0;", there is space in buffer and we can proceed.
- * If answer is "KY1;", we have to wait a while
- * If answer is "KY2;", there is space in buffer and we aren't sending so we can proceed.
- * If answer is something else, return with error to prevent infinite loops
- */
+ // If answer is "KY0;", there is space in buffer and we can proceed.
+ // If answer is "KY1;", we have to wait a while
+ // If answer is "KY2;", there is space in buffer and we aren't sending so we can proceed.
+ // If answer is something else, return with error to prevent infinite loops
+
if (!strncmp(m2, "KY0", 3)) { break; }
if (!strncmp(m2, "KY2", 3)) { break; }
diff --git a/rigs/yaesu/ft1000mp.c b/rigs/yaesu/ft1000mp.c
index fa8dd68a4..86b5b63c0 100644
--- a/rigs/yaesu/ft1000mp.c
+++ b/rigs/yaesu/ft1000mp.c
@@ -963,7 +963,7 @@ static int ft1000mp_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
f,
vfo);
- *freq = f; /* return displayed frequency */
+ *freq = f; // return displayed frequency
RETURNFUNC(RIG_OK);
}
@@ -1542,7 +1542,7 @@ static int ft1000mp_get_rxit(RIG *rig, vfo_t vfo, shortfreq_t *rit)
rig_debug(RIG_DEBUG_TRACE, "%s: freq = %d Hz for VFO [%s]\n", __func__, (int)f,
rig_strvfo(vfo));
- *rit = f; /* return displayed frequency */
+ *rit = f; // return displayed frequency
RETURNFUNC(RIG_OK);
}
diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c
index 1706f54a1..766297eae 100644
--- a/rigs/yaesu/newcat.c
+++ b/rigs/yaesu/newcat.c
@@ -11342,7 +11342,7 @@ int newcat_get_cmd(RIG *rig)
RETURNFUNC(-RIG_ENAVAIL);
case 'O':
- /* Too many characters sent without a carriage return */
+ // Too many characters sent without a carriage return
rig_debug(RIG_DEBUG_VERBOSE, "%s: Overflow for '%s'\n", __func__,
priv->cmd_str);
rc = -RIG_EPROTO;
@@ -11776,7 +11776,7 @@ int newcat_set_cmd(RIG *rig)
RETURNFUNC(-RIG_ENAVAIL);
case 'O':
- /* Too many characters sent without a carriage return */
+ // Too many characters sent without a carriage return
rig_debug(RIG_DEBUG_VERBOSE, "%s: Overflow for '%s'\n", __func__,
priv->cmd_str);
rc = -RIG_EPROTO;
diff --git a/src/rig.c b/src/rig.c
index dc9a7a5de..a73a9df7e 100644
--- a/src/rig.c
+++ b/src/rig.c
@@ -1697,10 +1697,8 @@ int HAMLIB_API rig_close(RIG *rig)
#endif
- /*
- * Let the backend say 73s to the rig.
- * and ignore the return code.
- */
+ // Let the backend say 73 to the rig.
+ // and ignore the return code.
if (caps->rig_close)
{
caps->rig_close(rig);
@@ -3145,14 +3143,14 @@ pbwidth_t HAMLIB_API rig_passband_normal(RIG *rig, rmode_t mode)
{
if (rs->filters[i].modes & mode)
{
- rig_debug(RIG_DEBUG_VERBOSE, "%s: return filter#%d, width=%d\n", __func__, i,
+ rig_debug(RIG_DEBUG_VERBOSE, "%s: Return filter#%d, width=%d\n", __func__, i,
(int)rs->filters[i].width);
RETURNFUNC(rs->filters[i].width);
}
}
rig_debug(RIG_DEBUG_VERBOSE,
- "%s: filter not found...return %d\n", __func__,
+ "%s: filter not found...returning %d\n", __func__,
0);
RETURNFUNC(0);
}
@@ -3407,7 +3405,7 @@ int HAMLIB_API rig_set_vfo(RIG *rig, vfo_t vfo)
rig_set_cache_freq(rig, RIG_VFO_ALL, 0);
}
- rig_debug(RIG_DEBUG_TRACE, "%s: return %d, vfo=%s, curr_vfo=%s\n", __func__,
+ rig_debug(RIG_DEBUG_TRACE, "%s: returning %d, vfo=%s, curr_vfo=%s\n", __func__,
retcode,
rig_strvfo(vfo), rig_strvfo(rs->current_vfo));
ELAPSED2;
@@ -3838,7 +3836,7 @@ int HAMLIB_API rig_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt)
cachep->ptt = ptt;
elapsed_ms(&cachep->time_ptt, HAMLIB_ELAPSED_SET);
- if (retcode != RIG_OK) { rig_debug(RIG_DEBUG_ERR, "%s: return code=%d\n", __func__, retcode); }
+ if (retcode != RIG_OK) { rig_debug(RIG_DEBUG_ERR, "%s: Return code=%d\n", __func__, retcode); }
memcpy(&rs->pttport_deprecated, pttp,
sizeof(rs->pttport_deprecated));
commit f9185d1d2469fad84aa925396606c6b752b17e49
Author: Michael Black W9MDB <mdb...@ya...>
Date: Sun Dec 22 15:19:38 2024 -0600
Print error on bufferoverflow and astyle sprintflst.c
diff --git a/src/sprintflst.c b/src/sprintflst.c
index 978a783d3..06b381316 100644
--- a/src/sprintflst.c
+++ b/src/sprintflst.c
@@ -72,19 +72,23 @@ int rig_sprintf_vfo(char *str, int nlen, vfo_t vfo)
if (sv && sv[0] && (strstr(sv, "None") == 0))
{
int written = snprintf(str + len, nlen - len, "%s ", sv);
+
if (written < 0 || written >= nlen - len)
{
// Truncate and break if there's no space left
+ rig_debug(RIG_DEBUG_ERR, "%s: buffer overflow\n", __func__);
len = nlen - 1;
str[len] = '\0';
break;
}
+
len += written;
}
if (len >= nlen)
{
// Ensure null-termination and avoid overflow
+ rig_debug(RIG_DEBUG_ERR, "%s: buffer overflow\n", __func__);
str[nlen - 1] = '\0';
break;
}
@@ -143,12 +147,19 @@ int rig_sprintf_ant(char *str, int str_len, ant_t ant)
switch (i)
{
case 0: ant_name = "ANT1"; break;
+
case 1: ant_name = "ANT2"; break;
+
case 2: ant_name = "ANT3"; break;
+
case 3: ant_name = "ANT4"; break;
+
case 4: ant_name = "ANT5"; break;
+
case 30: ant_name = "ANT_UNKNOWN"; break;
+
case 31: ant_name = "ANT_CURR"; break;
+
default:
ant_name = "ANT_UNK";
rig_debug(RIG_DEBUG_ERR, "%s: unknown ant=%d\n", __func__, i);
@@ -156,19 +167,23 @@ int rig_sprintf_ant(char *str, int str_len, ant_t ant)
}
int written = snprintf(str + len, str_len - len, "%s ", ant_name);
+
if (written < 0 || written >= str_len - len)
{
// Truncate if buffer is full
+ rig_debug(RIG_DEBUG_ERR, "%s: buffer overflow\n", __func__);
len = str_len - 1;
str[len] = '\0';
break;
}
+
len += written;
}
if (len >= str_len)
{
// Ensure null-termination
+ rig_debug(RIG_DEBUG_ERR, "%s: buffer overflow\n", __func__);
str[str_len - 1] = '\0';
break;
}
@@ -370,7 +385,8 @@ int sprintf_level_ext(char *str, int nlen, const struct confparams *extlevels)
return len;
}
-int rig_sprintf_level_gran(char *str, int nlen, setting_t level, const gran_t *gran)
+int rig_sprintf_level_gran(char *str, int nlen, setting_t level,
+ const gran_t *gran)
{
int i, len = 0;
@@ -398,22 +414,27 @@ int rig_sprintf_level_gran(char *str, int nlen, setting_t level, const gran_t *g
{
rig_debug(RIG_DEBUG_BUG, "unknown level idx %d\n", i);
}
+
continue;
}
int written;
+
if (RIG_LEVEL_IS_FLOAT(rig_idx2setting(i)))
{
- written = snprintf(str + len, nlen - len, "%s(%f..%f/%f) ", ms, gran[i].min.f, gran[i].max.f, gran[i].step.f);
+ written = snprintf(str + len, nlen - len, "%s(%f..%f/%f) ", ms, gran[i].min.f,
+ gran[i].max.f, gran[i].step.f);
}
else
{
- written = snprintf(str + len, nlen - len, "%s(%d..%d/%d) ", ms, gran[i].min.i, gran[i].max.i, gran[i].step.i);
+ written = snprintf(str + len, nlen - len, "%s(%d..%d/%d) ", ms, gran[i].min.i,
+ gran[i].max.i, gran[i].step.i);
}
if (written < 0 || written >= nlen - len)
{
// Truncate and stop further processing if the buffer is full
+ rig_debug(RIG_DEBUG_ERR, "%s: buffer overflow\n", __func__);
len = nlen - 1;
str[len] = '\0';
break;
@@ -424,6 +445,7 @@ int rig_sprintf_level_gran(char *str, int nlen, setting_t level, const gran_t *g
if (len >= nlen)
{
// Ensure null-termination and avoid overflow
+ rig_debug(RIG_DEBUG_ERR, "%s: buffer overflow\n", __func__);
str[nlen - 1] = '\0';
break;
}
@@ -432,11 +454,13 @@ int rig_sprintf_level_gran(char *str, int nlen, setting_t level, const gran_t *g
return len;
}
-int rot_sprintf_level_gran(char *str, int nlen, setting_t level, const gran_t *gran)
+int rot_sprintf_level_gran(char *str, int nlen, setting_t level,
+ const gran_t *gran)
{
int i, len = 0;
*str = '\0';
+
if (level == ROT_LEVEL_NONE)
{
return 0;
@@ -459,23 +483,28 @@ int rot_sprintf_level_gran(char *str, int nlen, setting_t level, const gran_t *g
{
rig_debug(RIG_DEBUG_BUG, "unknown level idx %d\n", i);
}
+
continue;
}
int written;
+
if (ROT_LEVEL_IS_FLOAT(rig_idx2setting(i)))
{
- written = snprintf(str + len, nlen - len, "%s(%f..%f/%f) ", ms, gran[i].min.f, gran[i].max.f, gran[i].step.f);
+ written = snprintf(str + len, nlen - len, "%s(%f..%f/%f) ", ms, gran[i].min.f,
+ gran[i].max.f, gran[i].step.f);
}
else
{
- written = snprintf(str + len, nlen - len, "%s(%d..%d/%d) ", ms, gran[i].min.i, gran[i].max.i, gran[i].step.i);
+ written = snprintf(str + len, nlen - len, "%s(%d..%d/%d) ", ms, gran[i].min.i,
+ gran[i].max.i, gran[i].step.i);
}
if (written < 0 || written >= nlen - len)
{
// Truncate and stop further processing if the buffer is full
len = nlen - 1;
+ rig_debug(RIG_DEBUG_ERR, "%s: buffer overflow\n", __func__);
str[len] = '\0';
break;
}
@@ -485,6 +514,7 @@ int rot_sprintf_level_gran(char *str, int nlen, setting_t level, const gran_t *g
if (len >= nlen)
{
// Ensure null-termination and avoid overflow
+ rig_debug(RIG_DEBUG_ERR, "%s: buffer overflow\n", __func__);
str[nlen - 1] = '\0';
break;
}
@@ -547,6 +577,7 @@ int rot_sprintf_parm(char *str, int nlen, setting_t parm)
if (written < 0 || written >= nlen - len)
{
// Truncate and stop further processing if the buffer is full
+ rig_debug(RIG_DEBUG_ERR, "%s: buffer overflow\n", __func__);
len = nlen - 1;
str[len] = '\0';
break;
@@ -557,6 +588,7 @@ int rot_sprintf_parm(char *str, int nlen, setting_t parm)
if (len >= nlen)
{
// Ensure null-termination and avoid overflow
+ rig_debug(RIG_DEBUG_ERR, "%s: buffer overflow\n", __func__);
str[nlen - 1] = '\0';
break;
}
@@ -565,7 +597,8 @@ int rot_sprintf_parm(char *str, int nlen, setting_t parm)
return len;
}
-int rig_sprintf_parm_gran(char *str, int nlen, setting_t parm, const gran_t *gran)
+int rig_sprintf_parm_gran(char *str, int nlen, setting_t parm,
+ const gran_t *gran)
{
int i, len = 0;
*str = '\0';
@@ -578,24 +611,30 @@ int rig_sprintf_parm_gran(char *str, int nlen, setting_t parm, const gran_t *gra
for (i = 0; i < RIG_SETTING_MAX; i++)
{
const char *ms;
+
if (!(parm & rig_idx2setting(i)))
{
continue;
}
+
ms = rig_strparm(parm & rig_idx2setting(i));
+
if (!ms || !ms[0])
{
if (parm != DUMMY_ALL && parm != RIG_PARM_SET(DUMMY_ALL))
{
rig_debug(RIG_DEBUG_BUG, "unknown parm idx %d\n", i);
}
+
continue;
}
int written;
+
if (RIG_PARM_IS_FLOAT(rig_idx2setting(i)))
{
- written = snprintf(str + len, nlen - len, "%s(%.g..%.g/%.g) ", ms, gran[i].min.f, gran[i].max.f, gran[i].step.f);
+ written = snprintf(str + len, nlen - len, "%s(%.g..%.g/%.g) ", ms,
+ gran[i].min.f, gran[i].max.f, gran[i].step.f);
}
else if (RIG_PARM_IS_STRING(rig_idx2setting(i)))
{
@@ -610,21 +649,25 @@ int rig_sprintf_parm_gran(char *str, int nlen, setting_t parm, const gran_t *gra
}
else
{
- written = snprintf(str + len, nlen - len, "%s(%d..%d/%d) ", ms, gran[i].min.i, gran[i].max.i, gran[i].step.i);
+ written = snprintf(str + len, nlen - len, "%s(%d..%d/%d) ", ms, gran[i].min.i,
+ gran[i].max.i, gran[i].step.i);
}
if (written < 0 || written >= nlen - len)
{
// Truncate and stop further processing if the buffer is full
+ rig_debug(RIG_DEBUG_ERR, "%s: buffer overflow\n", __func__);
len = nlen - 1;
str[len] = '\0';
break;
}
+
len += written;
if (len >= nlen)
{
// Ensure null-termination and avoid overflow
+ rig_debug(RIG_DEBUG_ERR, "%s: buffer overflow\n", __func__);
str[nlen - 1] = '\0';
break;
}
@@ -633,7 +676,8 @@ int rig_sprintf_parm_gran(char *str, int nlen, setting_t parm, const gran_t *gra
return len;
}
-int rot_sprintf_parm_gran(char *str, int nlen, setting_t parm, const gran_t *gran)
+int rot_sprintf_parm_gran(char *str, int nlen, setting_t parm,
+ const gran_t *gran)
{
int i, len = 0;
*str = '\0';
@@ -646,42 +690,52 @@ int rot_sprintf_parm_gran(char *str, int nlen, setting_t parm, const gran_t *gra
for (i = 0; i < RIG_SETTING_MAX; i++)
{
const char *ms;
+
if (!(parm & rig_idx2setting(i)))
{
continue;
}
+
ms = rot_strparm(parm & rig_idx2setting(i));
+
if (!ms || !ms[0])
{
if (parm != DUMMY_ALL && parm != ROT_PARM_SET(DUMMY_ALL))
{
rig_debug(RIG_DEBUG_BUG, "unknown parm idx %d\n", i);
}
+
continue;
}
int written;
+
if (ROT_PARM_IS_FLOAT(rig_idx2setting(i)))
{
- written = snprintf(str + len, nlen - len, "%s(%f..%f/%f) ", ms, gran[i].min.f, gran[i].max.f, gran[i].step.f);
+ written = snprintf(str + len, nlen - len, "%s(%f..%f/%f) ", ms, gran[i].min.f,
+ gran[i].max.f, gran[i].step.f);
}
else
{
- written = snprintf(str + len, nlen - len, "%s(%d..%d/%d) ", ms, gran[i].min.i, gran[i].max.i, gran[i].step.i);
+ written = snprintf(str + len, nlen - len, "%s(%d..%d/%d) ", ms, gran[i].min.i,
+ gran[i].max.i, gran[i].step.i);
}
if (written < 0 || written >= nlen - len)
{
// Truncate and stop further processing if the buffer is full
+ rig_debug(RIG_DEBUG_ERR, "%s: buffer overflow\n", __func__);
len = nlen - 1;
str[len] = '\0';
break;
}
+
len += written;
if (len >= nlen)
{
// Ensure null-termination and avoid overflow
+ rig_debug(RIG_DEBUG_ERR, "%s: buffer overflow\n", __func__);
str[nlen - 1] = '\0';
break;
}
@@ -769,19 +823,23 @@ int rot_sprintf_status(char *str, int nlen, rot_status_t status)
if (sv && sv[0] && (strstr(sv, "None") == 0))
{
int written = snprintf(str + len, nlen - len, "%s ", sv);
+
if (written < 0 || written >= nlen - len)
{
// Truncate and break if there's no space left
+ rig_debug(RIG_DEBUG_ERR, "%s: buffer overflow\n", __func__);
len = nlen - 1;
str[len] = '\0';
break;
}
+
len += written;
}
if (len >= nlen)
{
// Ensure null-termination and avoid overflow
+ rig_debug(RIG_DEBUG_ERR, "%s: buffer overflow\n", __func__);
str[nlen - 1] = '\0';
break;
}
commit e262fb82c262f1b6e279e337f1642a6689256f94
Author: Michael Black W9MDB <mdb...@ya...>
Date: Sun Dec 22 12:27:43 2024 -0600
Fix several potential overflows in sprintflst.c
diff --git a/src/sprintflst.c b/src/sprintflst.c
index 800f0a80d..978a783d3 100644
--- a/src/sprintflst.c
+++ b/src/sprintflst.c
@@ -52,10 +52,10 @@ int check_buffer_overflow(char *str, int len, int nlen)
return RIG_OK;
}
-
int rig_sprintf_vfo(char *str, int nlen, vfo_t vfo)
{
- unsigned int i, len = 0;
+ unsigned int i;
+ int len = 0;
rig_debug(RIG_DEBUG_TRACE, "%s: vfo=%s\n", __func__, rig_strvfo(vfo));
*str = '\0';
@@ -67,20 +67,32 @@ int rig_sprintf_vfo(char *str, int nlen, vfo_t vfo)
for (i = 0; i < HAMLIB_MAX_VFOS; i++)
{
- const char *sv;
- sv = rig_strvfo(vfo & RIG_VFO_N(i));
+ const char *sv = rig_strvfo(vfo & RIG_VFO_N(i));
if (sv && sv[0] && (strstr(sv, "None") == 0))
{
- len += snprintf(str + len, nlen - len, "%s ", sv);
- check_buffer_overflow(str, len, nlen);
+ int written = snprintf(str + len, nlen - len, "%s ", sv);
+ if (written < 0 || written >= nlen - len)
+ {
+ // Truncate and break if there's no space left
+ len = nlen - 1;
+ str[len] = '\0';
+ break;
+ }
+ len += written;
+ }
+
+ if (len >= nlen)
+ {
+ // Ensure null-termination and avoid overflow
+ str[nlen - 1] = '\0';
+ break;
}
}
return len;
}
-
int rig_sprintf_mode(char *str, int nlen, rmode_t mode)
{
unsigned int i, len = 0;
@@ -111,18 +123,17 @@ int rig_sprintf_mode(char *str, int nlen, rmode_t mode)
return len;
}
-
int rig_sprintf_ant(char *str, int str_len, ant_t ant)
{
int i, len = 0;
- char *ant_name;
+ const char *ant_name;
*str = '\0';
if (ant == RIG_ANT_NONE)
{
- SNPRINTF(str, str_len, "ANT_NONE");
- return 0;
+ snprintf(str, str_len, "ANT_NONE");
+ return (int)strlen(str); // Return length of "ANT_NONE"
}
for (i = 0; i < RIG_ANT_MAX; i++)
@@ -132,34 +143,40 @@ int rig_sprintf_ant(char *str, int str_len, ant_t ant)
switch (i)
{
case 0: ant_name = "ANT1"; break;
-
case 1: ant_name = "ANT2"; break;
-
case 2: ant_name = "ANT3"; break;
-
case 3: ant_name = "ANT4"; break;
-
case 4: ant_name = "ANT5"; break;
-
case 30: ant_name = "ANT_UNKNOWN"; break;
-
case 31: ant_name = "ANT_CURR"; break;
-
default:
ant_name = "ANT_UNK";
rig_debug(RIG_DEBUG_ERR, "%s: unknown ant=%d\n", __func__, i);
break;
}
- len += snprintf(str + len, str_len - len, "%s ", ant_name);
- check_buffer_overflow(str, len, str_len);
+ int written = snprintf(str + len, str_len - len, "%s ", ant_name);
+ if (written < 0 || written >= str_len - len)
+ {
+ // Truncate if buffer is full
+ len = str_len - 1;
+ str[len] = '\0';
+ break;
+ }
+ len += written;
+ }
+
+ if (len >= str_len)
+ {
+ // Ensure null-termination
+ str[str_len - 1] = '\0';
+ break;
}
}
return len;
}
-
int rig_sprintf_func(char *str, int nlen, setting_t func)
{
unsigned int i, len = 0;
@@ -353,9 +370,7 @@ int sprintf_level_ext(char *str, int nlen, const struct confparams *extlevels)
return len;
}
-
-int rig_sprintf_level_gran(char *str, int nlen, setting_t level,
- const gran_t *gran)
+int rig_sprintf_level_gran(char *str, int nlen, setting_t level, const gran_t *gran)
{
int i, len = 0;
@@ -383,43 +398,45 @@ int rig_sprintf_level_gran(char *str, int nlen, setting_t level,
{
rig_debug(RIG_DEBUG_BUG, "unknown level idx %d\n", i);
}
-
continue;
}
+ int written;
if (RIG_LEVEL_IS_FLOAT(rig_idx2setting(i)))
{
- len += snprintf(str + len, nlen - len,
- "%s(%f..%f/%f) ",
- ms,
- gran[i].min.f,
- gran[i].max.f,
- gran[i].step.f);
+ written = snprintf(str + len, nlen - len, "%s(%f..%f/%f) ", ms, gran[i].min.f, gran[i].max.f, gran[i].step.f);
}
else
{
- len += snprintf(str + len, nlen - len,
- "%s(%d..%d/%d) ",
- ms,
- gran[i].min.i,
- gran[i].max.i,
- gran[i].step.i);
+ written = snprintf(str + len, nlen - len, "%s(%d..%d/%d) ", ms, gran[i].min.i, gran[i].max.i, gran[i].step.i);
}
- check_buffer_overflow(str, len, nlen);
+ if (written < 0 || written >= nlen - len)
+ {
+ // Truncate and stop further processing if the buffer is full
+ len = nlen - 1;
+ str[len] = '\0';
+ break;
+ }
+
+ len += written;
+
+ if (len >= nlen)
+ {
+ // Ensure null-termination and avoid overflow
+ str[nlen - 1] = '\0';
+ break;
+ }
}
return len;
}
-
-int rot_sprintf_level_gran(char *str, int nlen, setting_t level,
- const gran_t *gran)
+int rot_sprintf_level_gran(char *str, int nlen, setting_t level, const gran_t *gran)
{
int i, len = 0;
*str = '\0';
-
if (level == ROT_LEVEL_NONE)
{
return 0;
@@ -442,36 +459,40 @@ int rot_sprintf_level_gran(char *str, int nlen, setting_t level,
{
rig_debug(RIG_DEBUG_BUG, "unknown level idx %d\n", i);
}
-
continue;
}
+ int written;
if (ROT_LEVEL_IS_FLOAT(rig_idx2setting(i)))
{
- len += snprintf(str + len, nlen - len,
- "%s(%f..%f/%f) ",
- ms,
- gran[i].min.f,
- gran[i].max.f,
- gran[i].step.f);
+ written = snprintf(str + len, nlen - len, "%s(%f..%f/%f) ", ms, gran[i].min.f, gran[i].max.f, gran[i].step.f);
}
else
{
- len += snprintf(str + len, nlen - len,
- "%s(%d..%d/%d) ",
- ms,
- gran[i].min.i,
- gran[i].max.i,
- gran[i].step.i);
+ written = snprintf(str + len, nlen - len, "%s(%d..%d/%d) ", ms, gran[i].min.i, gran[i].max.i, gran[i].step.i);
}
- check_buffer_overflow(str, len, nlen);
+ if (written < 0 || written >= nlen - len)
+ {
+ // Truncate and stop further processing if the buffer is full
+ len = nlen - 1;
+ str[len] = '\0';
+ break;
+ }
+
+ len += written;
+
+ if (len >= nlen)
+ {
+ // Ensure null-termination and avoid overflow
+ str[nlen - 1] = '\0';
+ break;
+ }
}
return len;
}
-
int rig_sprintf_parm(char *str, int nlen, setting_t parm)
{
int i, len = 0;
@@ -501,7 +522,6 @@ int rig_sprintf_parm(char *str, int nlen, setting_t parm)
return len;
}
-
int rot_sprintf_parm(char *str, int nlen, setting_t parm)
{
int i, len = 0;
@@ -519,24 +539,35 @@ int rot_sprintf_parm(char *str, int nlen, setting_t parm)
if (!ms || !ms[0])
{
- continue; /* unknown, FIXME! */
+ continue; /* unknown, FIXME! */
}
- strcat(str, ms);
- strcat(str, " ");
- len += strlen(ms) + 1;
- check_buffer_overflow(str, len, nlen);
+ int written = snprintf(str + len, nlen - len, "%s ", ms);
+
+ if (written < 0 || written >= nlen - len)
+ {
+ // Truncate and stop further processing if the buffer is full
+ len = nlen - 1;
+ str[len] = '\0';
+ break;
+ }
+
+ len += written;
+
+ if (len >= nlen)
+ {
+ // Ensure null-termination and avoid overflow
+ str[nlen - 1] = '\0';
+ break;
+ }
}
return len;
}
-
-int rig_sprintf_parm_gran(char *str, int nlen, setting_t parm,
- const gran_t *gran)
+int rig_sprintf_parm_gran(char *str, int nlen, setting_t parm, const gran_t *gran)
{
int i, len = 0;
-
*str = '\0';
if (parm == RIG_PARM_NONE)
@@ -547,65 +578,64 @@ int rig_sprintf_parm_gran(char *str, int nlen, setting_t parm,
for (i = 0; i < RIG_SETTING_MAX; i++)
{
const char *ms;
-
if (!(parm & rig_idx2setting(i)))
{
continue;
}
-
ms = rig_strparm(parm & rig_idx2setting(i));
-
if (!ms || !ms[0])
{
if (parm != DUMMY_ALL && parm != RIG_PARM_SET(DUMMY_ALL))
{
rig_debug(RIG_DEBUG_BUG, "unknown parm idx %d\n", i);
}
-
continue;
}
+ int written;
if (RIG_PARM_IS_FLOAT(rig_idx2setting(i)))
{
- len += snprintf(str + len, nlen - len,
- "%s(%.g..%.g/%.g) ",
- ms,
- gran[i].min.f,
- gran[i].max.f,
- gran[i].step.f);
+ written = snprintf(str + len, nlen - len, "%s(%.g..%.g/%.g) ", ms, gran[i].min.f, gran[i].max.f, gran[i].step.f);
}
else if (RIG_PARM_IS_STRING(rig_idx2setting(i)))
{
if (gran[i].step.s)
{
- len += snprintf(str + len, nlen - len,
- "%s(%s) ",
- ms,
- gran[i].step.s);
+ written = snprintf(str + len, nlen - len, "%s(%s) ", ms, gran[i].step.s);
+ }
+ else
+ {
+ continue;
}
}
else
{
- len += snprintf(str + len, nlen - len,
- "%s(%d..%d/%d) ",
- ms,
- gran[i].min.i,
- gran[i].max.i,
- gran[i].step.i);
+ written = snprintf(str + len, nlen - len, "%s(%d..%d/%d) ", ms, gran[i].min.i, gran[i].max.i, gran[i].step.i);
}
- check_buffer_overflow(str, len, nlen);
+ if (written < 0 || written >= nlen - len)
+ {
+ // Truncate and stop further processing if the buffer is full
+ len = nlen - 1;
+ str[len] = '\0';
+ break;
+ }
+ len += written;
+
+ if (len >= nlen)
+ {
+ // Ensure null-termination and avoid overflow
+ str[nlen - 1] = '\0';
+ break;
+ }
}
return len;
}
-
-int rot_sprintf_parm_gran(char *str, int nlen, setting_t parm,
- const gran_t *gran)
+int rot_sprintf_parm_gran(char *str, int nlen, setting_t parm, const gran_t *gran)
{
int i, len = 0;
-
*str = '\0';
if (parm == ROT_PARM_NONE)
@@ -616,50 +646,50 @@ int rot_sprintf_parm_gran(char *str, int nlen, setting_t parm,
for (i = 0; i < RIG_SETTING_MAX; i++)
{
const char *ms;
-
if (!(parm & rig_idx2setting(i)))
{
continue;
}
-
ms = rot_strparm(parm & rig_idx2setting(i));
-
if (!ms || !ms[0])
{
if (parm != DUMMY_ALL && parm != ROT_PARM_SET(DUMMY_ALL))
{
rig_debug(RIG_DEBUG_BUG, "unknown parm idx %d\n", i);
}
-
continue;
}
+ int written;
if (ROT_PARM_IS_FLOAT(rig_idx2setting(i)))
{
- len += snprintf(str + len, nlen - len,
- "%s(%f..%f/%f) ",
- ms,
- gran[i].min.f,
- gran[i].max.f,
- gran[i].step.f);
+ written = snprintf(str + len, nlen - len, "%s(%f..%f/%f) ", ms, gran[i].min.f, gran[i].max.f, gran[i].step.f);
}
else
{
- len += snprintf(str + len, nlen - len,
- "%s(%d..%d/%d) ",
- ms,
- gran[i].min.i,
- gran[i].max.i,
- gran[i].step.i);
+ written = snprintf(str + len, nlen - len, "%s(%d..%d/%d) ", ms, gran[i].min.i, gran[i].max.i, gran[i].step.i);
}
- check_buffer_overflow(str, len, nlen);
+ if (written < 0 || written >= nlen - len)
+ {
+ // Truncate and stop further processing if the buffer is full
+ len = nlen - 1;
+ str[len] = '\0';
+ break;
+ }
+ len += written;
+
+ if (len >= nlen)
+ {
+ // Ensure null-termination and avoid overflow
+ str[nlen - 1] = '\0';
+ break;
+ }
}
return len;
}
-
int rig_sprintf_vfop(char *str, int nlen, vfo_op_t op)
{
int i, len = 0;
commit e56f8187614b2702fb584117a006a2e789ceea3f
Author: Michael Black W9MDB <mdb...@ya...>
Date: Sun Dec 22 11:39:51 2024 -0600
Fix overrunning write in gemeni.c
diff --git a/amplifiers/gemini/gemini.h b/amplifiers/gemini/gemini.h
index 94ecc26c1..d32d1db0c 100644
--- a/amplifiers/gemini/gemini.h
+++ b/amplifiers/gemini/gemini.h
@@ -47,7 +47,7 @@ struct gemini_priv_data
double vswr;
int current; // Amps
int temperature; // Centigrade
- char state[5];
+ char state[8];
int ptt;
char trip[256];
};
commit d5dd12d50d824d4655f4c3a0e8b3cffdc464df56
Author: Michael Black W9MDB <mdb...@ya...>
Date: Sun Dec 22 11:38:27 2024 -0600
Fix overrunning write in newcat.c
diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c
index 8549048b9..1706f54a1 100644
--- a/rigs/yaesu/newcat.c
+++ b/rigs/yaesu/newcat.c
@@ -8096,7 +8096,7 @@ int newcat_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only)
if (priv->ret_data[28] != ';') // must have TAG data?
{
// get the TAG data
- sscanf(&priv->ret_data[28], "%32s", chan->tag);
+ sscanf(&priv->ret_data[28], "%31s", chan->tag);
char *p = strchr(chan->tag, ';');
if (p) { *p = 0; }
commit 45cc53a5265677f572f4526d750ee546bb4390c4
Author: Michael Black W9MDB <mdb...@ya...>
Date: Sun Dec 22 11:36:45 2024 -0600
Fix potential overflow in sprintflst.c
diff --git a/src/sprintflst.c b/src/sprintflst.c
index eada0d7b6..800f0a80d 100644
--- a/src/sprintflst.c
+++ b/src/sprintflst.c
@@ -719,7 +719,6 @@ int rig_sprintf_scan(char *str, int nlen, scan_t rscan)
return len;
}
-
int rot_sprintf_status(char *str, int nlen, rot_status_t status)
{
int len = 0;
@@ -735,20 +734,33 @@ int rot_sprintf_status(char *str, int nlen, rot_status_t status)
for (i = 0; i < HAMLIB_MAX_ROTORS; i++)
{
- const char *sv;
- sv = rot_strstatus(status & ROT_STATUS_N(i));
+ const char *sv = rot_strstatus(status & ROT_STATUS_N(i));
if (sv && sv[0] && (strstr(sv, "None") == 0))
{
- len += snprintf(str + len, nlen - len, "%s ", sv);
+ int written = snprintf(str + len, nlen - len, "%s ", sv);
+ if (written < 0 || written >= nlen - len)
+ {
+ // Truncate and break if there's no space left
+ len = nlen - 1;
+ str[len] = '\0';
+ break;
+ }
+ len += written;
}
- check_buffer_overflow(str, len, nlen);
+ if (len >= nlen)
+ {
+ // Ensure null-termination and avoid overflow
+ str[nlen - 1] = '\0';
+ break;
+ }
}
return len;
}
+
int rig_sprintf_spectrum_modes(char *str, int nlen,
const enum rig_spectrum_mode_e *modes)
{
commit 750adb40b53f89889b802bc64100ce095f114dc2
Author: Michael Black W9MDB <mdb...@ya...>
Date: Sun Dec 22 11:30:04 2024 -0600
Fix cleartext warning in rigctl_parse.c
diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c
index 4565f8779..ebe9df723 100644
--- a/tests/rigctl_parse.c
+++ b/tests/rigctl_parse.c
@@ -5518,8 +5518,9 @@ declare_proto_rig(password)
}
else
{
- rig_debug(RIG_DEBUG_ERR, "%s: password error, '%s'!='%s'\n", __func__,
- key, rigctld_password);
+ //rig_debug(RIG_DEBUG_ERR, "%s: password error, '%s'!='%s'\n", __func__,
+ // key, rigctld_password);
+ rig_debug(RIG_DEBUG_ERR, "%s: password error\n", __func__);
}
RETURNFUNC2(retval);
commit b763761d9e307b4023e8a28d1dcbdc0116a5ff12
Author: Michael Black W9MDB <mdb...@ya...>
Date: Sun Dec 22 11:26:18 2024 -0600
Fix cleartext warning in rigctl_parse.c and rotctl_parse.c
diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c
index e54c18263..4565f8779 100644
--- a/tests/rigctl_parse.c
+++ b/tests/rigctl_parse.c
@@ -1879,8 +1879,9 @@ readline_repeat:
else
{
fprintf(fout,
- "%s: error = %s\n",
- cmd_entry->name,
+ //"%s: error = %s\n",
+ //cmd_entry->name,
+ "error = %s\n",
rigerror(retcode));
}
}
diff --git a/tests/rotctl_parse.c b/tests/rotctl_parse.c
index 08807d6fc..c47457645 100644
--- a/tests/rotctl_parse.c
+++ b/tests/rotctl_parse.c
@@ -1489,7 +1489,8 @@ int rotctl_parse(ROT *my_rot, FILE *fin, FILE *fout, const char *argv[],
{
if (cmd_entry->name != NULL)
{
- fprintf(fout, "%s: error = %s\n", cmd_entry->name, rigerror(retcode));
+ //fprintf(fout, "%s: error = %s\n", cmd_entry->name, rigerror(retcode));
+ fprintf(fout, "error = %s\n", rigerror(retcode));
}
}
}
commit d302b8fabd713cfbebd53679ad5fb685122903cc
Author: Michael Black W9MDB <mdb...@ya...>
Date: Sun Dec 22 11:14:14 2024 -0600
Fix sscanf in rigctl_parse.c
diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c
index d90fdda5a..e54c18263 100644
--- a/tests/rigctl_parse.c
+++ b/tests/rigctl_parse.c
@@ -825,7 +825,7 @@ int rigctl_parse(RIG *my_rig, FILE *fin, FILE *fout, char *argv[], int argc,
retcode = fscanf(fin, "%s", ++pcmd);
- if (retcode == 0) { rig_debug(RIG_DEBUG_WARN, "%s: unable to scan %c\n", __func__, *(pcmd - 1)); }
+ if (retcode == 0 || retcode == EOF) { rig_debug(RIG_DEBUG_WARN, "%s: unable to scan %c\n", __func__, *(pcmd - 1)); }
while (*++pcmd);
@@ -3398,7 +3398,7 @@ declare_proto_rig(set_level)
int dummy;
- if (level == RIG_LEVEL_METER && sscanf(arg2, "%d", &dummy) == 0)
+ if (level == RIG_LEVEL_METER && sscanf(arg2, "%d", &dummy) <= 0)
{
if (strcmp(arg2, "COMP") == 0) { arg2 = "2"; }
else if (strcmp(arg2, "ALC") == 0) { arg2 = "4"; }
@@ -5932,7 +5932,7 @@ declare_proto_rig(cm108_get_bit)
// try GPIO format first
int n = sscanf(arg1, "GPIO%d", &gpio);
- if (n == 0)
+ if (n == 0 || n == EOF)
{
n = sscanf(arg1, "%d", &gpio);
}
commit fe45fa2dfc15f2152d6294e7457ae218df972a0f
Author: Michael Black W9MDB <mdb...@ya...>
Date: Sun Dec 22 10:38:07 2024 -0600
Fix sscanf compare in rigctl_parse.c
diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c
index aeb4313fd..d90fdda5a 100644
--- a/tests/rigctl_parse.c
+++ b/tests/rigctl_parse.c
@@ -5967,7 +5967,7 @@ declare_proto_rig(cm108_set_bit)
// try GPIO format first
int n = sscanf(arg1, "GPIO%d", &gpio);
- if (n == 0)
+ if (n == 0 || n == EOF)
{
n = sscanf(arg1, "%d", &gpio);
}
commit 86518546db30c22a42c5ddc12e68434c4ed3f8ee
Author: Michael Black W9MDB <mdb...@ya...>
Date: Sun Dec 22 10:37:15 2024 -0600
Fix sscanf compare in gs232b.c
diff --git a/rotators/gs232a/gs232b.c b/rotators/gs232a/gs232b.c
index 65a900855..461a8491b 100644
--- a/rotators/gs232a/gs232b.c
+++ b/rotators/gs232a/gs232b.c
@@ -226,7 +226,7 @@ gs232b_rot_get_position(ROT *rot, azimuth_t *az, elevation_t *el)
* directives, any amount of space is matched, including none in the input.
*/
// There's a 12PR1A rotor that only returns AZ so we may only get AZ=xxx
- if (sscanf(posbuf, "AZ=%d EL=%d", &int_az, &int_el) == 0)
+ if (sscanf(posbuf, "AZ=%d EL=%d", &int_az, &int_el) <= 0)
{
// only give error if we didn't parse anything
rig_debug(RIG_DEBUG_ERR, "%s: wrong reply '%s', expected AZ=xxx EL=xxx\n",
commit 13f7b01d279a14078b485b9af4e999d3d4f8f5c7
Author: Michael Black W9MDB <mdb...@ya...>
Date: Sun Dec 22 10:36:05 2024 -0600
Fix sscanf compare in trxmanager.c
diff --git a/rigs/dummy/trxmanager.c b/rigs/dummy/trxmanager.c
index 9a4dcf50a..e9790e4d2 100644
--- a/rigs/dummy/trxmanager.c
+++ b/rigs/dummy/trxmanager.c
@@ -1114,7 +1114,7 @@ static int trxmanager_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split,
*tx_vfo = RIG_VFO_B;
n = sscanf(response, "SP%d", &tsplit);
- if (n == 0)
+ if (n == 0 || n == EOF)
{
rig_debug(RIG_DEBUG_ERR, "%s error getting split from '%s'\n", __func__,
response);
commit 62b0a25a3ddab25c65de373dd6a83d812af5a9f1
Author: Michael Black W9MDB <mdb...@ya...>
Date: Sun Dec 22 10:35:06 2024 -0600
Fix sscanf compare in flrig.c
diff --git a/rigs/dummy/flrig.c b/rigs/dummy/flrig.c
index dac27e01e..811ce04d7 100644
--- a/rigs/dummy/flrig.c
+++ b/rigs/dummy/flrig.c
@@ -910,7 +910,7 @@ static int flrig_open(RIG *rig)
int dummy;
if (retval == RIG_ENAVAIL || value[0] == 0
- || sscanf(value, "%d", &dummy) == 0) // must not have it
+ || sscanf(value, "%d", &dummy) <= 0) // must not have it
{
priv->has_get_bwA = 0;
priv->has_get_bwB = 0; // if we don't have A then surely we don't have B either
commit 57c5047c3ec662cd102961346ed1d4957ea88b5b
Author: Michael Black W9MDB <mdb...@ya...>
Date: Sun Dec 22 10:32:59 2024 -0600
Hopefully fix codeql warning about cleartext storage of sensitive information
diff --git a/tests/ampctl_parse.c b/tests/ampctl_parse.c
index ed45d6f95..62e3ac080 100644
--- a/tests/ampctl_parse.c
+++ b/tests/ampctl_parse.c
@@ -1406,7 +1406,8 @@ int ampctl_parse(AMP *my_amp, FILE *fin, FILE *fout, char *argv[], int argc)
}
else
{
- fprintf(fout, "%s: error = %s\n", cmd_entry->name, rigerror(retcode));
+ fprintf(fout, "error = %s\n", rigerror(retcode));
+ //fprintf(fout, "%s: error = %s\n", cmd_entry->name, rigerror(retcode));
}
}
else
commit 89383a553a5e6b05779479edac2af0134cb10335
Author: Michael Black W9MDB <mdb...@ya...>
Date: Sun Dec 22 10:31:17 2024 -0600
Fix buffer overrun in ampctl.c
diff --git a/tests/ampctl.c b/tests/ampctl.c
index 6fc960bb5..6a0cf29b3 100644
--- a/tests/ampctl.c
+++ b/tests/ampctl.c
@@ -213,7 +213,7 @@ int main(int argc, char *argv[])
return 1;
}
- strncat(conf_parms, optarg, MAXCONFLEN - strlen(conf_parms));
+ strncat(conf_parms, optarg, MAXCONFLEN - strlen(conf_parms) - 1);
break;
case 't':
commit ec3978e5210f6142f33504523168f55b4a4032ac
Author: Michael Black W9MDB <mdb...@ya...>
Date: Sun Dec 22 06:37:50 2024 -0600
Remove vim from Dockerfile since it is not portable
diff --git a/docker-build/Dockerfile b/docker-build/Dockerfile
index d92407f18..612034dce 100644
--- a/docker-build/Dockerfile
+++ b/docker-build/Dockerfile
@@ -4,7 +4,7 @@ FROM ubuntu:latest AS hamlib-base-image
ENV DEBIAN_FRONTEND="noninteractive" TZ="Etc/UTC"
RUN apt-get update \
- && apt-get install -y vim git build-essential automake libtool python-is-python3 \
+ && apt-get install -y git build-essential automake libtool python-is-python3 \
&& rm -rf /var/lib/apt/lists/*
# Builder Image
commit 2b23051c6ddb266c359ce57008d44deeab3f5bc6
Author: Michael Black W9MDB <mdb...@ya...>
Date: Sat Dec 21 15:19:06 2024 -0600
Remove display of password from debug
https://github.com/Hamlib/Hamlib/security/code-scanning/15
diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c
index 5c52ad408..aeb4313fd 100644
--- a/tests/rigctl_parse.c
+++ b/tests/rigctl_parse.c
@@ -5478,7 +5478,7 @@ int rigctld_password_check(RIG *rig, const char *md5)
{
int retval = -RIG_EINVAL;
//fprintf(fout, "password %s\n", password);
- rig_debug(RIG_DEBUG_TRACE, "%s: %s == %s\n", __func__, md5, rigctld_password);
+ //rig_debug(RIG_DEBUG_TRACE, "%s: %s == %s\n", __func__, md5, rigctld_password);
is_passwordOK = 0;
char *mymd5 = rig_make_md5(rigctld_password);
commit 032e530def273825892a6bfe8e4b5eef137ec529
Author: Michael Black W9MDB <mdb...@ya...>
Date: Sat Dec 21 15:06:11 2024 -0600
Fix the other ts590.c problems
diff --git a/rigs/kenwood/ts590.c b/rigs/kenwood/ts590.c
index 66ecd38a4..bbe80b940 100644
--- a/rigs/kenwood/ts590.c
+++ b/rigs/kenwood/ts590.c
@@ -1958,7 +1958,7 @@ struct rig_caps fx4_caps =
.max_ifshift = Hz(0),
// .targetable_vfo = RIG_TARGETABLE_FREQ | RIG_TARGETABLE_MODE,
// mode command is not vfo targetable
- .targetable_vfo = RIG_TARGETABLE_FREQ
+ .targetable_vfo = RIG_TARGETABLE_FREQ,
.transceive = RIG_TRN_RIG,
.agc_level_count = 6,
.agc_levels = { RIG_AGC_OFF, RIG_AGC_SLOW, RIG_AGC_MEDIUM, RIG_AGC_FAST, RIG_AGC_SUPERFAST, RIG_AGC_ON },
@@ -2168,7 +2168,7 @@ struct rig_caps ts590sg_caps =
.max_ifshift = Hz(0),
// .targetable_vfo = RIG_TARGETABLE_FREQ | RIG_TARGETABLE_MODE,
// mode command is not vfo targetable
- .targetable_vfo = RIG_TARGETABLE_FREQ
+ .targetable_vfo = RIG_TARGETABLE_FREQ,
.transceive = RIG_TRN_RIG,
.agc_level_count = 6,
.agc_levels = { RIG_AGC_OFF, RIG_AGC_SLOW, RIG_AGC_MEDIUM, RIG_AGC_FAST, RIG_AGC_SUPERFAST, RIG_AGC_ON },
commit a7dbebffa9297d3e9afa5c356ab74bfdb2c0243d
Author: Michael Black W9MDB <mdb...@ya...>
Date: Sat Dec 21 15:05:14 2024 -0600
Fix ts590.c
diff --git a/rigs/kenwood/ts590.c b/rigs/kenwood/ts590.c
index 624904517..66ecd38a4 100644
--- a/rigs/kenwood/ts590.c
+++ b/rigs/kenwood/ts590.c
@@ -1738,7 +1738,7 @@ struct rig_caps ts590_caps =
.max_ifshift = Hz(0),
// .targetable_vfo = RIG_TARGETABLE_FREQ | RIG_TARGETABLE_MODE,
// mode command is not vfo targetable
- .targetable_vfo = RIG_TARGETABLE_FREQ
+ .targetable_vfo = RIG_TARGETABLE_FREQ,
.transceive = RIG_TRN_RIG,
.agc_level_count = 6,
.agc_levels = { RIG_AGC_OFF, RIG_AGC_SLOW, RIG_AGC_MEDIUM, RIG_AGC_FAST, RIG_AGC_SUPERFAST, RIG_AGC_ON },
commit 33293112744fc08f70811af4add9c7dd6f6533fa
Merge: ec7103582 6bb5c4049
Author: Michael Black W9MDB <mdb...@ya...>
Date: Sat Dec 21 14:59:06 2024 -0600
Merge branch 'master' of github.com:Hamlib/Hamlib
commit 6bb5c404994308c06bdfd853642b60adb662b78f
Merge: 1364996bd db00197e6
Author: Michael Black <mdb...@ya...>
Date: Sat Dec 21 14:50:12 2024 -0600
Merge pull request #1639 from 8r4n/feature/multi-stage-docker-build
Added multi-stage Docker build and hamlib-runtime image
commit ec7103582297545948602bc833cf1883fd94e8d8
Author: Michael Black W9MDB <mdb...@ya...>
Date: Sat Dec 21 14:47:43 2024 -0600
Fix sscanf check in aclog.c
https://github.com/Hamlib/Hamlib/security/code-scanning/3206
diff --git a/rigs/dummy/aclog.c b/rigs/dummy/aclog.c
index 6f8183ac0..b8b8bedd9 100644
--- a/rigs/dummy/aclog.c
+++ b/rigs/dummy/aclog.c
@@ -530,7 +530,7 @@ static int aclog_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
*mode = RIG_MODE_NONE;
int n = sscanf(p, "<MODE>%31[^<]", modetmp);
- if (n) { *mode = modeMapGetHamlib(modetmp); }
+ if (n == 1) { *mode = modeMapGetHamlib(modetmp); }
else
{
rig_debug(RIG_DEBUG_ERR, "%s: Unable to parse <MODE> from '%s'\n", __func__,
commit 8842ae7c2920799442bfda812fa56c241dfdeebd
Author: Michael Black W9MDB <mdb...@ya...>
Date: Sat Dec 21 14:46:39 2024 -0600
Fix sscanf check in smartsdr.c
https://github.com/Hamlib/Hamlib/security/code-scanning/3208
diff --git a/rigs/flexradio/smartsdr.c b/rigs/flexradio/smartsdr.c
index 16324b5bc..e91cab9c0 100644
--- a/rigs/flexradio/smartsdr.c
+++ b/rigs/flexradio/smartsdr.c
@@ -462,7 +462,7 @@ static int smartsdr_parse_S(RIG *rig, char *s)
rig_debug(RIG_DEBUG_VERBOSE, "%s: PTT state=%s, ptt=%d\n", __func__, state,
priv->ptt);
}
- else if (sscanf(p, "tx=%d\n", &priv->tx))
+ else if (sscanf(p, "tx=%d\n", &priv->tx) == 1)
{
rig_debug(RIG_DEBUG_VERBOSE, "%s: tx=%d\n", __func__, priv->tx);
}
commit 4b4b1b0d517403f0f460f1a255358b4f1b426e0b
Author: Michael Black W9MDB <mdb...@ya...>
Date: Sat Dec 21 14:43:20 2024 -0600
Fix buffer overflow in ft991.c
https://github.com/Hamlib/Hamlib/security/code-scanning/3209
diff --git a/rigs/yaesu/ft991.c b/rigs/yaesu/ft991.c
index dfe56fe80..d2c36f37d 100644
--- a/rigs/yaesu/ft991.c
+++ b/rigs/yaesu/ft991.c
@@ -702,7 +702,7 @@ static int ft991_set_split_mode(RIG *rig, vfo_t vfo, rmode_t tx_mode,
}
strncat(restore_commands, priv->ret_data,
- NEWCAT_DATA_LEN - strlen(restore_commands));
+ NEWCAT_DATA_LEN - strlen(restore_commands) - 1);
/* Change mode on VFOA */
if (RIG_OK != (err = newcat_set_mode(rig, RIG_VFO_A, tx_mode,
commit e6be427c519ae3228787c728a1bdc5cc5dc31d0c
Author: Michael Black W9MDB <mdb...@ya...>
Date: Sat Dec 21 14:42:46 2024 -0600
Fix buffer overflow in ampctld.c
diff --git a/tests/ampctld.c b/tests/ampctld.c
index a2e00aa78..079eb068b 100644
--- a/tests/ampctld.c
+++ b/tests/ampctld.c
@@ -256,7 +256,7 @@ int main(int argc, char *argv[])
return 1;
}
- strncat(conf_parms, optarg, MAXCONFLEN - strlen(conf_parms));
+ strncat(conf_parms, optarg, MAXCONFLEN - strlen(conf_parms) - 1);
break;
case 't':
commit 72424ac144904dc9c70161fe70c64f8657e89758
Author: Michael Black W9MDB <mdb...@ya...>
Date: Sat Dec 21 14:41:58 2024 -0600
Fix buffer overflow in rigctl.c
https://github.com/Hamlib/Hamlib/security/code-scanning/3212
diff --git a/tests/rigctl.c b/tests/rigctl.c
index 078d621fd..383c7185b 100644
--- a/tests/rigctl.c
+++ b/tests/rigctl.c
@@ -475,7 +475,7 @@ int main(int argc, char *argv[])
return 1;
}
- strncat(conf_parms, optarg, MAXCONFLEN - strlen(conf_parms));
+ strncat(conf_parms, optarg, MAXCONFLEN - strlen(conf_parms) - 1);
break;
case 'o':
commit 12c453ccd3cbf4455d346f7d4f42fa7061bee0cb
Author: Michael Black W9MDB <mdb...@ya...>
Date: Sat Dec 21 14:41:25 2024 -0600
Fix buffer overflow in rigctlcom.c
https://github.com/Hamlib/Hamlib/security/code-scanning/3213
diff --git a/tests/rigctlcom.c b/tests/rigctlcom.c
index 3938a4027..f81de0ce5 100644
--- a/tests/rigctlcom.c
+++ b/tests/rigctlcom.c
@@ -439,7 +439,7 @@ int main(int argc, char *argv[])
retur...
[truncated message content] |
|
From: n0nb <n0...@us...> - 2024-12-20 00:06:09
|
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 1364996bd298643a288d79edde45f7fd53cf0816 (commit)
from be045da06b661234feb6b1258ca58e8c028b9b56 (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 1364996bd298643a288d79edde45f7fd53cf0816
Author: Nate Bargmann <n0...@n0...>
Date: Thu Dec 19 18:05:40 2024 -0600
Advance to 4.7~git
diff --git a/configure.ac b/configure.ac
index 7cb321c75..c0516aab6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -14,7 +14,7 @@ dnl Please do not use '-' in the version number, as package managers will fail,
dnl however, the use of '~' should be fine as apt (others?) will treat
dnl it as an earlier version than the actual release. TNX KA6MAL
dnl PACKAGE_NAME + " " + PACKAGE_VERSION must not exceed 20 chars!
-AC_INIT([Hamlib],[4.6~git],[ham...@li...],[hamlib],[http://www.hamlib.org])
+AC_INIT([Hamlib],[4.7~git],[ham...@li...],[hamlib],[http://www.hamlib.org])
#AC_INIT([PRODUCT_NAME], [Hamlib])
#AC_DEFINE([Hamlib], [PRODUCT_VERSION_RESOURCE])
-----------------------------------------------------------------------
Summary of changes:
configure.ac | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
hooks/post-receive
--
Hamlib -- Ham radio control libraries
|
|
From: n0nb <n0...@us...> - 2024-12-20 00:03:52
|
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, Hamlib-4.6 has been created
at c0542ae864ce6f9cc4b29b0c30b44e273261d114 (commit)
- Log -----------------------------------------------------------------
commit c0542ae864ce6f9cc4b29b0c30b44e273261d114
Author: Nate Bargmann <n0...@n0...>
Date: Thu Dec 19 07:18:18 2024 -0600
Advance to 4.6~rc1
diff --git a/configure.ac b/configure.ac
index 7cb321c75..4c1c914d2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -14,7 +14,7 @@ dnl Please do not use '-' in the version number, as package managers will fail,
dnl however, the use of '~' should be fine as apt (others?) will treat
dnl it as an earlier version than the actual release. TNX KA6MAL
dnl PACKAGE_NAME + " " + PACKAGE_VERSION must not exceed 20 chars!
-AC_INIT([Hamlib],[4.6~git],[ham...@li...],[hamlib],[http://www.hamlib.org])
+AC_INIT([Hamlib],[4.6~rc1],[ham...@li...],[hamlib],[http://www.hamlib.org])
#AC_INIT([PRODUCT_NAME], [Hamlib])
#AC_DEFINE([Hamlib], [PRODUCT_VERSION_RESOURCE])
-----------------------------------------------------------------------
hooks/post-receive
--
Hamlib -- Ham radio control libraries
|
|
From: n0nb <n0...@us...> - 2024-12-06 11:38:51
|
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 be045da06b661234feb6b1258ca58e8c028b9b56 (commit)
via 58924b7bec47a73ee4665030be78b83a530b45c0 (commit)
from 671a3b8562d71f28cb75874d30c90f969a129902 (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 be045da06b661234feb6b1258ca58e8c028b9b56
Author: Michael Black W9MDB <mdb...@ya...>
Date: Wed Dec 4 17:15:35 2024 -0600
Fix set_mode on rigctlcom
diff --git a/tests/rigctlcom.c b/tests/rigctlcom.c
index fca7aaabd..3938a4027 100644
--- a/tests/rigctlcom.c
+++ b/tests/rigctlcom.c
@@ -224,7 +224,7 @@ int main(int argc, char *argv[])
char conf_parms[MAXCONFLEN] = "";
int status;
- printf("rigctlcom Version 1.5\n");
+ printf("rigctlcom Version 1.6\n");
while (1)
{
@@ -1604,7 +1604,6 @@ static int handle_ts2000(void *arg)
}
else if (strncmp(arg, "MD", 2) == 0)
{
- //char response[32];
mode_t mode = 0;
int imode = 0;
@@ -1633,10 +1632,6 @@ static int handle_ts2000(void *arg)
case 9: mode = RIG_MODE_RTTYR; break;
}
rig_set_mode(my_rig, RIG_VFO_A, mode, -1);
-#if 0
- SNPRINTF(response, sizeof(response), "MD%c;", mode + '0');
- return write_block2((void *)__func__, &my_com, response, strlen(response));
-#endif
}
else if (strcmp(arg, "PS1;") == 0)
{
commit 58924b7bec47a73ee4665030be78b83a530b45c0
Author: Michael Black W9MDB <mdb...@ya...>
Date: Wed Dec 4 15:43:47 2024 -0600
Add DATA_FMN mode to flrig
diff --git a/rigs/dummy/flrig.c b/rigs/dummy/flrig.c
index df6f27bde..dac27e01e 100644
--- a/rigs/dummy/flrig.c
+++ b/rigs/dummy/flrig.c
@@ -1047,6 +1047,7 @@ static int flrig_open(RIG *rig)
else if (streq(p, "D-USB")) { modeMapAdd(&modes, RIG_MODE_PKTUSB, p); }
else if (streq(p, "DATA")) { modeMapAdd(&modes, RIG_MODE_PKTUSB, p); }
else if (streq(p, "DATA-FM")) { modeMapAdd(&modes, RIG_MODE_PKTFM, p); }
+ else if (streq(p, "DATA-FMN")) { modeMapAdd(&modes, RIG_MODE_PKTFMN, p); }
else if (streq(p, "DATA-L")) { modeMapAdd(&modes, RIG_MODE_PKTLSB, p); }
else if (streq(p, "DATA-R")) { modeMapAdd(&modes, RIG_MODE_PKTLSB, p); }
else if (streq(p, "DATA-LSB")) { modeMapAdd(&modes, RIG_MODE_PKTLSB, p); }
-----------------------------------------------------------------------
Summary of changes:
rigs/dummy/flrig.c | 1 +
tests/rigctlcom.c | 7 +------
2 files changed, 2 insertions(+), 6 deletions(-)
hooks/post-receive
--
Hamlib -- Ham radio control libraries
|
|
From: n0nb <n0...@us...> - 2024-12-04 20:57:24
|
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 671a3b8562d71f28cb75874d30c90f969a129902 (commit)
from 46711b1db4b4f737964f700941c1184db81d5bf1 (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 671a3b8562d71f28cb75874d30c90f969a129902
Author: Michael Black W9MDB <mdb...@ya...>
Date: Wed Dec 4 14:47:48 2024 -0600
Fix rig_get_DBM in flrig
diff --git a/rigs/dummy/flrig.c b/rigs/dummy/flrig.c
index e739acf81..df6f27bde 100644
--- a/rigs/dummy/flrig.c
+++ b/rigs/dummy/flrig.c
@@ -2386,8 +2386,7 @@ static int flrig_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
}
case RIG_LEVEL_STRENGTH:
- val->i = atoi(value);
- //if (val->i > 0) val->i /= 10;
+ val->i = atoi(value) + 73;
rig_debug(RIG_DEBUG_TRACE, "%s: val.i='%s'(%d)\n", __func__, value, val->i);
break;
-----------------------------------------------------------------------
Summary of changes:
rigs/dummy/flrig.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
hooks/post-receive
--
Hamlib -- Ham radio control libraries
|
|
From: n0nb <n0...@us...> - 2024-12-04 20:21:23
|
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 46711b1db4b4f737964f700941c1184db81d5bf1 (commit)
via 941e69eda5b5516e5614f1b69b23fbd69ca74430 (commit)
via dd15ffc7bd47a6ba481e42d6211a0f50c908d6c7 (commit)
via 8f0e9909da7c3f93cc68515b58ce6f199cc61425 (commit)
via 3e0a9eeae703765f932ffa3dc95e8ed65ec9540d (commit)
from d1d4964a193217da42f57ef7bdeb59796ea7acc2 (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 46711b1db4b4f737964f700941c1184db81d5bf1
Author: Michael Black W9MDB <mdb...@ya...>
Date: Wed Dec 4 10:00:41 2024 -0600
Fix FLRig STRENGTH reading to use rig.get_DBM instead of rig.get_smeter -- much better representation
diff --git a/rigs/dummy/flrig.c b/rigs/dummy/flrig.c
index bfabc388b..e739acf81 100644
--- a/rigs/dummy/flrig.c
+++ b/rigs/dummy/flrig.c
@@ -143,7 +143,7 @@ struct rig_caps flrig_caps =
RIG_MODEL(RIG_MODEL_FLRIG),
.model_name = "",
.mfg_name = "FLRig",
- .version = "20241110.0",
+ .version = "20241204.0",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
@@ -2332,7 +2332,7 @@ static int flrig_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
case RIG_LEVEL_MICGAIN: cmd = "rig.get_micgain"; break;
- case RIG_LEVEL_STRENGTH: cmd = "rig.get_smeter"; break;
+ case RIG_LEVEL_STRENGTH: cmd = "rig.get_DBM"; break;
case RIG_LEVEL_SWR:
cmd = "rig.get_swrmeter";
@@ -2386,7 +2386,7 @@ static int flrig_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
}
case RIG_LEVEL_STRENGTH:
- val->i = atoi(value) - 54;
+ val->i = atoi(value);
//if (val->i > 0) val->i /= 10;
rig_debug(RIG_DEBUG_TRACE, "%s: val.i='%s'(%d)\n", __func__, value, val->i);
break;
commit 941e69eda5b5516e5614f1b69b23fbd69ca74430
Author: Michael Black W9MDB <mdb...@ya...>
Date: Tue Dec 3 23:19:16 2024 -0600
Fix set_mode on rigctlcom
diff --git a/tests/rigctlcom.c b/tests/rigctlcom.c
index 4bf136ec3..fca7aaabd 100644
--- a/tests/rigctlcom.c
+++ b/tests/rigctlcom.c
@@ -1604,7 +1604,7 @@ static int handle_ts2000(void *arg)
}
else if (strncmp(arg, "MD", 2) == 0)
{
- char response[32];
+ //char response[32];
mode_t mode = 0;
int imode = 0;
@@ -1632,9 +1632,11 @@ static int handle_ts2000(void *arg)
case 9: mode = RIG_MODE_RTTYR; break;
}
-
+ rig_set_mode(my_rig, RIG_VFO_A, mode, -1);
+#if 0
SNPRINTF(response, sizeof(response), "MD%c;", mode + '0');
return write_block2((void *)__func__, &my_com, response, strlen(response));
+#endif
}
else if (strcmp(arg, "PS1;") == 0)
{
commit dd15ffc7bd47a6ba481e42d6211a0f50c908d6c7
Author: Michael Black W9MDB <mdb...@ya...>
Date: Tue Dec 3 23:18:48 2024 -0600
Add KY command to simts590
diff --git a/simulators/simts590.c b/simulators/simts590.c
index ee2db59b6..759283a9c 100644
--- a/simulators/simts590.c
+++ b/simulators/simts590.c
@@ -431,6 +431,11 @@ int main(int argc, char *argv[])
SNPRINTF(buf, sizeof(buf), "SL%02d;", width_low);
WRITE(fd, buf, strlen(buf));
}
+ else if (strcmp(buf, "KY;") == 0)
+ {
+ SNPRINTF(buf, sizeof(buf), "KY0;");
+ WRITE(fd, buf, strlen(buf));
+ }
else if (strlen(buf) > 0)
{
commit 8f0e9909da7c3f93cc68515b58ce6f199cc61425
Author: Michael Black W9MDB <mdb...@ya...>
Date: Tue Dec 3 15:32:08 2024 -0600
astyle icom.h and update icom date
diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c
index 8045d8890..0e651af5b 100644
--- a/rigs/icom/icom.c
+++ b/rigs/icom/icom.c
@@ -2110,7 +2110,9 @@ pbwidth_t icom_get_dsp_flt(RIG *rig, rmode_t mode)
RIG_MODE_RTTYR | RIG_MODE_PKTUSB | RIG_MODE_PKTLSB))
{
rig_debug(RIG_DEBUG_TRACE, "%s: using filtericom width=%d\n", __func__, i);
- if (i > sizeof(filtericom)/sizeof(int)) i = 40;
+
+ if (i > sizeof(filtericom) / sizeof(int)) { i = 40; }
+
RETURNFUNC2(filtericom[i]);
}
}
@@ -2181,7 +2183,8 @@ int icom_set_dsp_flt(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
}
flt_idx = width <= 500 ? ((width + 49) / 50) - 1 : ((width + 99) / 100) + 4;
- if (flt_idx > 40) flt_idx = 40;
+
+ if (flt_idx > 40) { flt_idx = 40; }
}
else
{
@@ -2684,8 +2687,9 @@ int icom_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
if (width <= 3)
{
rig_debug(RIG_DEBUG_TRACE, "%s: setting filter=%d\n", __func__, (int)width);
- return RIG_OK;
+ return RIG_OK;
}
+
if (((width != RIG_PASSBAND_NOCHANGE) && (width != current_width))
|| (priv->filter_usbd > 0 || priv->filter_usb > 0 || priv->filter_cw > 0
|| priv->filter_fm > 0))
diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h
index faf004030..c78c64e55 100644
--- a/rigs/icom/icom.h
+++ b/rigs/icom/icom.h
@@ -35,7 +35,7 @@
#include <sys/time.h>
#endif
-#define BACKEND_VER "20241127"
+#define BACKEND_VER "20241203"
#define ICOM_IS_ID31 rig_is_model(rig, RIG_MODEL_ID31)
#define ICOM_IS_ID51 rig_is_model(rig, RIG_MODEL_ID51)
commit 3e0a9eeae703765f932ffa3dc95e8ed65ec9540d
Author: Michael Black W9MDB <mdb...@ya...>
Date: Tue Dec 3 15:31:16 2024 -0600
Fix icom filter selection and bandwidth limits
diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c
index 363772cc2..8045d8890 100644
--- a/rigs/icom/icom.c
+++ b/rigs/icom/icom.c
@@ -2110,6 +2110,7 @@ pbwidth_t icom_get_dsp_flt(RIG *rig, rmode_t mode)
RIG_MODE_RTTYR | RIG_MODE_PKTUSB | RIG_MODE_PKTLSB))
{
rig_debug(RIG_DEBUG_TRACE, "%s: using filtericom width=%d\n", __func__, i);
+ if (i > sizeof(filtericom)/sizeof(int)) i = 40;
RETURNFUNC2(filtericom[i]);
}
}
@@ -2179,8 +2180,8 @@ int icom_set_dsp_flt(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
width = 1;
}
- flt_idx =
- width <= 500 ? ((width + 49) / 50) - 1 : ((width + 99) / 100) + 4;
+ flt_idx = width <= 500 ? ((width + 49) / 50) - 1 : ((width + 99) / 100) + 4;
+ if (flt_idx > 40) flt_idx = 40;
}
else
{
@@ -2679,6 +2680,12 @@ int icom_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
}
}
+ // no change and not setting filter number either
+ if (width <= 3)
+ {
+ rig_debug(RIG_DEBUG_TRACE, "%s: setting filter=%d\n", __func__, (int)width);
+ return RIG_OK;
+ }
if (((width != RIG_PASSBAND_NOCHANGE) && (width != current_width))
|| (priv->filter_usbd > 0 || priv->filter_usb > 0 || priv->filter_cw > 0
|| priv->filter_fm > 0))
-----------------------------------------------------------------------
Summary of changes:
rigs/dummy/flrig.c | 6 +++---
rigs/icom/icom.c | 15 +++++++++++++--
rigs/icom/icom.h | 2 +-
simulators/simts590.c | 5 +++++
tests/rigctlcom.c | 6 ++++--
5 files changed, 26 insertions(+), 8 deletions(-)
hooks/post-receive
--
Hamlib -- Ham radio control libraries
|
|
From: n0nb <n0...@us...> - 2024-12-03 13:24:07
|
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 d1d4964a193217da42f57ef7bdeb59796ea7acc2 (commit)
via cf61b9a178b2ce48eeeaba01b677a31d8ef92e0a (commit)
via abe40e6e8b6322b7811a4466d2a9c4f29440a249 (commit)
via 558234897807c793baa2874e351007a6c827ab37 (commit)
via 806b08729356d1515b7c2994b032fb79e187f772 (commit)
via bdbe66dfa06114974331e42f1072fef78bfa2f1e (commit)
via 8bd74aa3bcdfec900955c15ef1cc754bfb93d6df (commit)
via 65832ecf53b3788ae3adc1eefe697b7e0112ac7c (commit)
via 890ed18c43132c3b0d1b96eff6a2b5d6a96d57ba (commit)
via 711a35135326af3f949bd69b227bd3e31d67c6ae (commit)
via 5219ef2b26fa657e9370fefbdfa6396ecda7faa3 (commit)
via 7b679afa1d851a3d0962f5f3d18ad4ad4088d2b1 (commit)
via e480bc74796ad6206ae882251db0575127663aad (commit)
via 71698e44325c26c92efd09b027e54cf22f0f18a8 (commit)
via 4a34d4c27f5ae9305e689fccbc3ca496223b5309 (commit)
via 5abc606e13903e821c0ac88a2768f6549c5b8704 (commit)
via ab2b5fb9e9d9f8bcf48bac5190b8fa17ce33c04c (commit)
via dc7bbeca34cd91bd021bcd60dfa936fbd1f242de (commit)
via d86f0db383cd51c3640aab17de91168351744ec3 (commit)
via 3f90a9323eb3b477fbc92308dee131221a7cac90 (commit)
via 610581ca95686a9eb8e407c399816b421e720aa9 (commit)
via 8ee3c9fa64fdebf70aa18b5b1ccbc313a5442a53 (commit)
via a94e2948f550f2e040a24d5c965a62be4628f2ea (commit)
via fbdb6656209306df75aaa2f541122f325f90a818 (commit)
via dcc7b3743215e6a47a70863125c02d6e9d19c750 (commit)
via 2447cb204ecaa5119d3d09e93e6b183791885446 (commit)
via aae8109d4e63ce812f302fa9db6534ae069361ca (commit)
via 6adfce0305ebfd26a88fc08c99cd4007053d0986 (commit)
via 6036a65d2e075393664f27d639fa4c6a312c6e1f (commit)
via 82c8a0795e5eaab6bdd27a56bbb684a77ca915db (commit)
via 4811ebe3bc72f98a4ed688be03040f442dab5c89 (commit)
via 5b277e460047270c8ec85274d112d939fefedcdc (commit)
from 4b77f9b6b67afc4bf26e4aeaa4774cb842d48d8b (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 d1d4964a193217da42f57ef7bdeb59796ea7acc2
Merge: abe40e6e8 cf61b9a17
Author: Michael Black <mdb...@ya...>
Date: Tue Dec 3 07:05:22 2024 -0600
Merge pull request #1636 from GeoBaltz/fix24
Change Kenwood _send_morse() for TS-890/990
commit cf61b9a178b2ce48eeeaba01b677a31d8ef92e0a
Merge: 806b08729 abe40e6e8
Author: Michael Black <mdb...@ya...>
Date: Tue Dec 3 06:57:15 2024 -0600
Merge branch 'master' into fix24
diff --cc rigs/kenwood/kenwood.c
index 3222a69a7,ae6a8e109..38a87600a
--- a/rigs/kenwood/kenwood.c
+++ b/rigs/kenwood/kenwood.c
@@@ -5553,31 -5551,19 +5553,29 @@@ int kenwood_send_morse(RIG *rig, vfo_t
SNPRINTF(morsebuf, sizeof(morsebuf), "KY %s", m2);
break;
- case RIG_MODEL_TS590S:
+ case RIG_MODEL_TS890S:
+ SNPRINTF(morsebuf, sizeof morsebuf, "KY2%s", m2);
+ break;
+
+ case RIG_MODEL_TS990S:
+ // Variable message length only on newer firmware
+ priv = STATE(rig)->priv;
+ if (priv->fw_rev_uint >= 110)
+ {
+ SNPRINTF(morsebuf, sizeof morsebuf, "KY2%s", m2);
+ break;
+ }
+ /* FALL THROUGH */
+
++ case RIG_MODEL_TS590S:
+ /* the command must consist of 28 bytes right aligned */
- SNPRINTF(morsebuf, sizeof(morsebuf), "KY %24s", m2);
- break;
++ SNPRINTF(morsebuf, sizeof(morsebuf), "KY %24s", m2);
++ break;
+
default:
/* the command must consist of 28 bytes 0x20 padded */
SNPRINTF(morsebuf, sizeof(morsebuf), "KY %-24s", m2);
- #if 0 // Why is this here?? 0x20 == ' '
- int i;
-- for (i = strlen(morsebuf) - 1; i > 0 && morsebuf[i] == ' '; --i)
-- {
-- morsebuf[i] = 0x20;
-- }
- #endif
}
retval = kenwood_transaction(rig, morsebuf, NULL, 0);
commit abe40e6e8b6322b7811a4466d2a9c4f29440a249
Merge: 65832ecf5 558234897
Author: Michael Black <mdb...@ya...>
Date: Tue Dec 3 06:45:02 2024 -0600
Merge pull request #1637 from dl1jbe/ts590_fix_kenwood_send_morse
Drop addional unwanted space after message
commit 558234897807c793baa2874e351007a6c827ab37
Author: Thomas Beierlein <to...@ge...>
Date: Tue Dec 3 12:34:32 2024 +0100
Drop addional unwanted space after message
Kenwood_send_morse adds an unwanted space after each transmission on
TS-590S model (see issue 1634).
Tests showed that all space before any message gets ignored and all
trailing spaces (if any) were compressed to exactly one space.
The patch changes the alignment to the right.
diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c
index e0bad2505..ae6a8e109 100644
--- a/rigs/kenwood/kenwood.c
+++ b/rigs/kenwood/kenwood.c
@@ -5551,6 +5551,11 @@ int kenwood_send_morse(RIG *rig, vfo_t vfo, const char *msg)
SNPRINTF(morsebuf, sizeof(morsebuf), "KY %s", m2);
break;
+ case RIG_MODEL_TS590S:
+ /* the command must consist of 28 bytes right aligned */
+ SNPRINTF(morsebuf, sizeof(morsebuf), "KY %24s", m2);
+ break;
+
default:
/* the command must consist of 28 bytes 0x20 padded */
SNPRINTF(morsebuf, sizeof(morsebuf), "KY %-24s", m2);
commit 806b08729356d1515b7c2994b032fb79e187f772
Author: George Baltz N3GB <Geo...@gm...>
Date: Tue Dec 3 05:06:10 2024 -0500
Fix porting unneeded code
diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c
index da75b19f8..3222a69a7 100644
--- a/rigs/kenwood/kenwood.c
+++ b/rigs/kenwood/kenwood.c
@@ -5572,7 +5572,8 @@ int kenwood_send_morse(RIG *rig, vfo_t vfo, const char *msg)
SNPRINTF(morsebuf, sizeof(morsebuf), "KY %-24s", m2);
#if 0 // Why is this here?? 0x20 == ' '
- for (int i = strlen(morsebuf) - 1; i > 0 && morsebuf[i] == ' '; --i)
+ int i;
+ for (i = strlen(morsebuf) - 1; i > 0 && morsebuf[i] == ' '; --i)
{
morsebuf[i] = 0x20;
}
commit bdbe66dfa06114974331e42f1072fef78bfa2f1e
Author: George Baltz N3GB <Geo...@gm...>
Date: Sat Nov 30 04:17:01 2024 -0500
Use short (i.e., variable length) messages in kenwood_send_morse()
Enabled for TS-890S & TS-990S(if firmware capable)
Kludge the kludges in kenwood_transaction() for KY->KY2 change.
diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c
index e0bad2505..da75b19f8 100644
--- a/rigs/kenwood/kenwood.c
+++ b/rigs/kenwood/kenwood.c
@@ -375,6 +375,7 @@ transaction_write:
skip |= strncmp(cmdstr, "RD", 2) == 0;
skip |= strncmp(cmdstr, "KYW", 3) == 0;
skip |= strncmp(cmdstr, "KY ", 3) == 0;
+ skip |= strncmp(cmdstr, "KY2", 3) == 0;
skip |= strncmp(cmdstr, "PS1", 3) == 0;
skip |= strncmp(cmdstr, "PS0", 3) == 0;
skip |= strncmp(cmdstr, "K22", 3) == 0;
@@ -382,7 +383,7 @@ transaction_write:
if (skip)
{
// most command we give them a little time -- but not KY
- if (strncmp(cmdstr, "KY ", 3) != 0)
+ if (strncmp(cmdstr, "KY ", 3) != 0 && strncmp(cmdstr, "KY2", 3) != 0)
{
hl_usleep(200 * 1000); // give little settle time for these commands
}
@@ -958,7 +959,7 @@ int kenwood_open(RIG *rig)
priv->has_rit2 = 1;
}
- if (RIG_IS_TS590S)
+ if (RIG_IS_TS590S || RIG_IS_TS990S)
{
/* we need the firmware version for these rigs to deal with f/w defects */
static char fw_version[7];
@@ -992,7 +993,7 @@ int kenwood_open(RIG *rig)
}
}
- rig_debug(RIG_DEBUG_TRACE, "%s: found f/w version %.1f\n", __func__,
+ rig_debug(RIG_DEBUG_TRACE, "%s: found f/w version %.2f\n", __func__,
priv->fw_rev_uint / 100.0);
}
@@ -5486,8 +5487,9 @@ int kenwood_reset(RIG *rig, reset_t reset)
int kenwood_send_morse(RIG *rig, vfo_t vfo, const char *msg)
{
char morsebuf[40], m2[30];
- int msg_len, retval, i;
+ int msg_len, retval;
const char *p;
+ struct kenwood_priv_data *priv;
ENTERFUNC;
@@ -5551,14 +5553,30 @@ int kenwood_send_morse(RIG *rig, vfo_t vfo, const char *msg)
SNPRINTF(morsebuf, sizeof(morsebuf), "KY %s", m2);
break;
+ case RIG_MODEL_TS890S:
+ SNPRINTF(morsebuf, sizeof morsebuf, "KY2%s", m2);
+ break;
+
+ case RIG_MODEL_TS990S:
+ // Variable message length only on newer firmware
+ priv = STATE(rig)->priv;
+ if (priv->fw_rev_uint >= 110)
+ {
+ SNPRINTF(morsebuf, sizeof morsebuf, "KY2%s", m2);
+ break;
+ }
+ /* FALL THROUGH */
+
default:
/* the command must consist of 28 bytes 0x20 padded */
SNPRINTF(morsebuf, sizeof(morsebuf), "KY %-24s", m2);
- for (i = strlen(morsebuf) - 1; i > 0 && morsebuf[i] == ' '; --i)
+#if 0 // Why is this here?? 0x20 == ' '
+ for (int i = strlen(morsebuf) - 1; i > 0 && morsebuf[i] == ' '; --i)
{
morsebuf[i] = 0x20;
}
+#endif
}
retval = kenwood_transaction(rig, morsebuf, NULL, 0);
commit 8bd74aa3bcdfec900955c15ef1cc754bfb93d6df
Author: George Baltz N3GB <Geo...@gm...>
Date: Fri Nov 29 15:10:46 2024 -0500
Minimal support for KY commands in simts890.c
diff --git a/simulators/simts890.c b/simulators/simts890.c
index 6ebc0f264..b1d4158ae 100644
--- a/simulators/simts890.c
+++ b/simulators/simts890.c
@@ -927,6 +927,24 @@ int main(int argc, char *argv[])
{
sscanf(buf, "KS%03d", &keyspd);
}
+ else if (strncmp(buf, "KY", 2) == 0)
+ { // CW Keying
+ if (buf[2] == ';')
+ {
+ // Checking status - we always have room
+ OUTPUT("KY0;");
+ }
+ else if (buf[3] == ';')
+ {
+ // Stop sending(?)
+ if (buf[2] != '0') {cmd_err = 1; }
+ }
+ else
+ {
+ // Send the message
+ //printf("CW mesg: %s\n", buf + 2);
+ }
+ }
else if (strncmp(buf, "OM", 2) == 0)
{
// Operating Mode
commit 65832ecf53b3788ae3adc1eefe697b7e0112ac7c
Author: Michael Black W9MDB <mdb...@ya...>
Date: Mon Dec 2 07:24:00 2024 -0600
Fix compile warnings
diff --git a/src/rig.c b/src/rig.c
index cd315ab1f..dc9a7a5de 100644
--- a/src/rig.c
+++ b/src/rig.c
@@ -997,7 +997,7 @@ int HAMLIB_API rig_open(RIG *rig)
else
{
rig_debug(RIG_DEBUG_VERBOSE, "%s: cwd=%s\n", __func__, cwd);
- char *path = calloc(1, 4096);
+ char *path = calloc(1, 8192);
extern char settings_file[4096];
const char *xdgpath = getenv("XDG_CONFIG_HOME");
commit 890ed18c43132c3b0d1b96eff6a2b5d6a96d57ba
Author: Michael Black W9MDB <mdb...@ya...>
Date: Mon Dec 2 07:20:42 2024 -0600
Change morse_data_handler from LOCK to rig_lock as it needs to always use it
diff --git a/src/rig.c b/src/rig.c
index d886d6ecb..cd315ab1f 100644
--- a/src/rig.c
+++ b/src/rig.c
@@ -169,6 +169,10 @@ const char hamlib_copyright[231] = /* hamlib 1.2 ABI specifies 231 bytes */
#define CHECK_RIG_ARG(r) (!(r) || !(r)->caps || !STATE((r))->comm_state)
#define CHECK_RIG_CAPS(r) (!(r) || !(r)->caps)
+// The LOCK macro is for the primary thread calling the rig functions
+// For a separate thread use rig_lock directly
+// The purpose here is to avoid deadlock during recursion
+// Any other thread should grab the mutex itself via rig_lock
#define LOCK(n) if (STATE(rig)->depth == 1) { rig_debug(RIG_DEBUG_CACHE, "%s: %s\n", n?"lock":"unlock", __func__); rig_lock(rig,n); }
MUTEX(morse_mutex);
@@ -8760,9 +8764,9 @@ void *morse_data_handler(void *arg)
if (strlen(c) > 0)
{
int nloops = 10;
- MUTEX_LOCK(morse_mutex);
+ MUTEX_LOCK(morse_mutex); // wait until the write is idle
- LOCK(1);
+ rig_lock(rig, 1);
do
{
result = rig->caps->send_morse(rig, RIG_VFO_CURR, c);
@@ -8786,7 +8790,7 @@ void *morse_data_handler(void *arg)
}
while (result != RIG_OK && STATE(rig)->fifo_morse->flush == 0 && --nloops > 0);
- LOCK(0);
+ rig_lock(rig,0);
MUTEX_UNLOCK(morse_mutex);
commit 711a35135326af3f949bd69b227bd3e31d67c6ae
Merge: 5219ef2b2 7b679afa1
Author: Michael Black W9MDB <mdb...@ya...>
Date: Sun Dec 1 22:41:04 2024 -0600
Merge branch 'master' of github.com:Hamlib/Hamlib
commit 5219ef2b26fa657e9370fefbdfa6396ecda7faa3
Author: Michael Black W9MDB <mdb...@ya...>
Date: Sun Dec 1 16:44:22 2024 -0600
Put a heavier LOCK around send_morse when clearing the buffer
diff --git a/src/rig.c b/src/rig.c
index e47105e6c..c755fefd6 100644
--- a/src/rig.c
+++ b/src/rig.c
@@ -8762,6 +8762,7 @@ void *morse_data_handler(void *arg)
int nloops = 10;
MUTEX_LOCK(morse_mutex);
+ LOCK(1);
do
{
result = rig->caps->send_morse(rig, RIG_VFO_CURR, c);
@@ -8785,6 +8786,7 @@ void *morse_data_handler(void *arg)
}
while (result != RIG_OK && STATE(rig)->fifo_morse->flush == 0 && --nloops > 0);
+ LOCK(0);
MUTEX_UNLOCK(morse_mutex);
commit 7b679afa1d851a3d0962f5f3d18ad4ad4088d2b1
Merge: 71698e443 e480bc747
Author: Nate Bargmann <n0...@n0...>
Date: Sun Dec 1 16:06:16 2024 -0600
Merge pull request #1635 from dforsi/fix/typos
Fix typos
commit e480bc74796ad6206ae882251db0575127663aad
Author: Daniele Forsi IU5HKX <iu...@gm...>
Date: Sun Dec 1 21:52:34 2024 +0100
Fix typos
diff --git a/NEWS b/NEWS
index d9b04777f..37ec46881 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
- * send_raw can now take hex digits as colon-seperated -- e.g. send_raw icom xfe:xfe:x94:xe0:03:xfd
+ * send_raw can now take hex digits as colon-separated -- e.g. send_raw icom xfe:xfe:x94:xe0:03:xfd
* Add IC7760
* IC7300 Mode filter can now be set by # (i.e. 1,2,3)
* Fixed AF6SA WRC rotor controller
@@ -44,7 +44,7 @@ Version 4.6
* Added Thetis entry -- derived from FlexRadio/Apache PowerSDR
* Added VOICE/CW memory capability to many rigs -- thanks to David Balharrie M0DGB/G8FKH
* Add -# --skip_init option to rigctl to skip rig initialization -- useful for executing commands quickly
- * rig_caps is no longer constant -- this may break some 3rd party relying on the "const" declaration. Here's an example of how to handle compatiblity.
+ * rig_caps is no longer constant -- this may break some 3rd party relying on the "const" declaration. Here's an example of how to handle compatibility.
#ifdef RIGCAPS_NOT_CONST
static int add_to_list(struct rig_caps* rc, void*)
#else
@@ -66,7 +66,7 @@ static int add_to_list(const struct rig_caps* rc, void*)
* Added rig_cm108_get/set_bit to API and get/set_gpio to rigctl(d) for GPIO1,2,3,4 access on CM108
* Added BG2FX FX4/C/CR/L
* Fixed IC7610 to use new 0x25 0x26 command added in latest firmware
- * Fix W command in rigctld to work propery -- can take terminating char or # of bytes to expect
+ * Fix W command in rigctld to work properly -- can take terminating char or # of bytes to expect
* Add rig_set_debug_filename so Python can redirect debug stream
* Fix Yaesu LBL_NR to use proper values
* Add IC-905
diff --git a/bindings/csharp/multicast/README.txt b/bindings/csharp/multicast/README.txt
index fbb130f50..f87c199a1 100644
--- a/bindings/csharp/multicast/README.txt
+++ b/bindings/csharp/multicast/README.txt
@@ -22,7 +22,7 @@ You should then be able to run
./bin/Debug/net6.0/multicast
======================================================
-Waiting for Net 7.0/8.0 to be in Ubunut main packages
+Waiting for Net 7.0/8.0 to be in Ubuntu main packages
Following did not work
sudo apt remove 'dotnet*' 'aspnet*' 'netstandard*'
diff --git a/rigs/icom/ic821h.c b/rigs/icom/ic821h.c
index 1d0938eba..8e9dacb06 100644
--- a/rigs/icom/ic821h.c
+++ b/rigs/icom/ic821h.c
@@ -181,8 +181,8 @@ struct rig_caps ic821h_caps =
},
/* mode/filter list, remember: order matters! */
.filters = {
- {RIG_MODE_CW | RIG_MODE_SSB, kHz(2.3)}, /* buildin */
- {RIG_MODE_FM, kHz(15)}, /* buildin */
+ {RIG_MODE_CW | RIG_MODE_SSB, kHz(2.3)}, /* built-in */
+ {RIG_MODE_FM, kHz(15)}, /* built-in */
RIG_FLT_END,
},
diff --git a/rigs/kenwood/thf6a.c b/rigs/kenwood/thf6a.c
index 7b1bdacf8..0f2b80a6e 100644
--- a/rigs/kenwood/thf6a.c
+++ b/rigs/kenwood/thf6a.c
@@ -5,7 +5,7 @@
*
* 10-03-2010
* Ported from Stephane Fillod's thf7.c
- * Changed TH-F7E perameters to reflect TH-F6A
+ * Changed TH-F7E parameters to reflect TH-F6A
* Changed RIG_ITU_REGION from 1 to 2
*
*
diff --git a/rigs/kenwood/ts590.c b/rigs/kenwood/ts590.c
index 73e5b3997..95a9779dd 100644
--- a/rigs/kenwood/ts590.c
+++ b/rigs/kenwood/ts590.c
@@ -400,7 +400,7 @@ static int ts590_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
const int ssb_htable[] = { 1000, 1200, 1400, 1600, 1800, 2000, 2200, 2400, 2600, 2800, 3000, 3400, 4000, 5000 };
const int ssb_ltable[] = { 0, 50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 1000 };
*width = ssb_htable[hwidth];
- // we dont' do anything with shift yet which will be just the hwidth value
+ // we don't do anything with shift yet which will be just the hwidth value
shift = ssb_ltable[lwidth];
}
else if (*mode == RIG_MODE_AM || *mode == RIG_MODE_PKTAM)
diff --git a/rigs/yaesu/README.ft920 b/rigs/yaesu/README.ft920
index 76fd5acec..e58eddfac 100644
--- a/rigs/yaesu/README.ft920
+++ b/rigs/yaesu/README.ft920
@@ -97,7 +97,7 @@ rig_get_split_mode
and set "proper" VFO?
rig_set_rit
- * Hamlib specificies that passing 0 as the RIT frequency disables
+ * Hamlib specifies that passing 0 as the RIT frequency disables
RIT. Thus there is no way to meet the spec and mimic the front
panel RIT off function whilst keeping the RIT offset on the
display. The Hamlib spec causes behavior analogous to shutting
@@ -112,7 +112,7 @@ rig_get_rit
* vfo is honored and stored RIT is returned.
rig_set_xit
- * Hamlib specificies that passing 0 as the XIT frequency disables
+ * Hamlib specifies that passing 0 as the XIT frequency disables
XIT. Thus there is no way to meet the spec and mimic the front
panel XIT off function whilst keeping the XIT offset on the
display. The Hamlib spec causes behavior analogous to shutting
diff --git a/rotators/easycomm/easycomm.txt b/rotators/easycomm/easycomm.txt
index c62795778..fe33fed92 100644
--- a/rotators/easycomm/easycomm.txt
+++ b/rotators/easycomm/easycomm.txt
@@ -34,7 +34,7 @@ may only decode the rotator control commands.
The Host PC can issue the following commands -:
-Command Meaning Perameters
+Command Meaning Parameters
------- ------- ----------
AZ Azimuth number - 1 decimal place [deg]
@@ -88,7 +88,7 @@ EASYCOMM III Standard
The EasyComm 3 standard is an extension of the version 2 with the additional features:
-Command Meaning Perameters Hamlib Config Token
+Command Meaning Parameters Hamlib Config Token
------- ------- ---------- -------------------
VL Velocity Left number [mdeg/s]
VR Velocity Right number [mdeg/s]
diff --git a/simulators/simts890.c b/simulators/simts890.c
index a3c513d21..6ebc0f264 100644
--- a/simulators/simts890.c
+++ b/simulators/simts890.c
@@ -328,7 +328,7 @@ int main(int argc, char *argv[])
if (strcmp(buf, "IF;") == 0)
{
- // Reads the tranceiver status
+ // Reads the transceiver status
#if defined(LEGACY)
char ifbuf[256];
hl_usleep(mysleep * 1000);
@@ -1322,7 +1322,7 @@ int main(int argc, char *argv[])
case '3': // Bandscope Span
case '4': // Bandscope Span
case '5': // Bandscope Scope Range (Fixed Mode)
- case '6': // Bandscope Dispaly Pause
+ case '6': // Bandscope Display Pause
case '7': // Bandscope Marker
case '8': // Bandscope Attenuator
case '9': // Bandscope Max Hold
@@ -1371,7 +1371,7 @@ int main(int argc, char *argv[])
case '0': // Registration of CW Message (Paddle Input)
case '1': // Play/Stop the CW Message
case '2': // Register State of CW Message (Paddle Input)
- case '3': // Clear the CW Message (Paddle Inut)
+ case '3': // Clear the CW Message (Paddle Input)
case '4': // CW Message Memory Name (Paddle Input)
case '5': // Registering the CW Message Memory (Text Input)
case '6': // CW Message Channel Repeat
@@ -1454,7 +1454,7 @@ int main(int argc, char *argv[])
case '2': // Memory Channel (Channel Name)
case '3': // Memory Channel (Scan Lockout)
case '4': // Memory Channel (Channel Copy)
- case '5': // Memory Channle (Channel Deletion)
+ case '5': // Memory Channel (Channel Deletion)
case '6': // Programmable VFO End Frequency
case '7': // Memory Channel (Temporary Change Frequency)
break;
diff --git a/src/microham.c b/src/microham.c
index c47a0bb0f..f6482c782 100644
--- a/src/microham.c
+++ b/src/microham.c
@@ -721,7 +721,7 @@ static void writeControl(const unsigned char *data, int len)
//
// send a heartbeat and record time
// The "last heartbeat" time is recorded in a global variable
-// such that the service thread can decice whether a new
+// such that the service thread can decide whether a new
// heartbeat is due.
//
static void heartbeat()
diff --git a/src/rig.c b/src/rig.c
index e47105e6c..24be4ca1a 100644
--- a/src/rig.c
+++ b/src/rig.c
@@ -7547,7 +7547,7 @@ int HAMLIB_API rig_stop_morse(RIG *rig, vfo_t vfo)
/*
* wait_morse_ptt
* generic routine to wait for ptt=0
- * should work on any full breakin CW morse send
+ * should work on any full break-in CW morse send
* Assumes rig!=NULL, msg!=NULL
*/
static int wait_morse_ptt(RIG *rig, vfo_t vfo)
diff --git a/src/sleep.c b/src/sleep.c
index c3cc6c162..00a29e2d0 100644
--- a/src/sleep.c
+++ b/src/sleep.c
@@ -116,7 +116,7 @@ int hl_usleep(rig_useconds_t usec)
int retval = 0;
rig_debug(RIG_DEBUG_ERR, "%s: usec=%ld\n", __func__, usec);
- if (usec <= 1000) { return 0; } // dont' sleep if only 1ms is requested -- speeds things up on Windows
+ if (usec <= 1000) { return 0; } // don't sleep if only 1ms is requested -- speeds things up on Windows
while (usec > 1000000)
{
commit 71698e44325c26c92efd09b027e54cf22f0f18a8
Merge: 4a34d4c27 5abc606e1
Author: Michael Black W9MDB <mdb...@ya...>
Date: Sun Dec 1 11:25:36 2024 -0600
Merge branch 'master' of github.com:Hamlib/Hamlib
commit 4a34d4c27f5ae9305e689fccbc3ca496223b5309
Author: Michael Black W9MDB <mdb...@ya...>
Date: Sun Dec 1 11:23:13 2024 -0600
Add new semi-colon separated hex values for send_raw icom
https://github.com/Hamlib/Hamlib/issues/1632
diff --git a/NEWS b/NEWS
index 2cef16957..d9b04777f 100644
--- a/NEWS
+++ b/NEWS
@@ -13,6 +13,7 @@ Version 5.x -- future
* Change FT1000MP Mark V model names to align with FT1000MP
Version 4.6
+ * send_raw can now take hex digits as colon-seperated -- e.g. send_raw icom xfe:xfe:x94:xe0:03:xfd
* Add IC7760
* IC7300 Mode filter can now be set by # (i.e. 1,2,3)
* Fixed AF6SA WRC rotor controller
diff --git a/doc/man1/rigctl.1 b/doc/man1/rigctl.1
index cb8ba8a89..9a1b6d44e 100644
--- a/doc/man1/rigctl.1
+++ b/doc/man1/rigctl.1
@@ -1398,13 +1398,26 @@ Returns current lock mode status 1=On, 2=Off (only useful when using rigctld)
.TP
.BR send_raw " \(aq" \fITerminator\fP "\(aq \(aq" \fIString\fP \(aq
.EX
-Can send ASCII string or 0xnn values -- there can be no spaces in the command string.
+Can send ASCII string or 0xnn values or xnn values -- there can be no spaces in the command string.
Possible terminator values are CR, LF, ;, ICOM, 0-100 (bytes to read), or -1 meaning unknown (will timeout on read)
-Examples:
- send_raw ; FA;MD;
+Examples (note that a ; must be escaped in Unix/Linux):
+For Windows & Unix/Linux we have a new colon-separated format for hex digits
+ send_raw icom 0xFE:0xFE:0x94:0x03:0xFD Note: colon-separated does not have to be escaped on Unix/Linux
+ send_raw -1 0xFE:0xFE:0x94:0x03:0xFD
+ send_raw 14 0xFE:0xFE:0x94:0x03:0xFD
+ Note that ASCII commands still require escaping the semicolon on Unix/Linux
+ send_raw \; FA\;MD\;
+
+For Windows:
send_raw icom 0xFE;0xFE;0x94;0x03;0xFD
send_raw -1 0xFE;0xFE;0x94;0x03;0xFD
send_raw 14 0xFE;0xFE;0x94;0x03;0xFD
+
+ For Unix/Linux
+ send_raw icom 0xFE\;0xFE\;0x94\;0x03\;0xFD
+ send_raw \; FA\;MD\;
+ send_raw -1 0xFE\;0xFE\;0x94\;0x03\;0xFD
+ send_raw 14 0xFE\;0xFE\;0x94\;0x03\;0xFD
.
.TP
.BR client_version " \(aq" \fIString\fP "\(aq
diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c
index 4b305a281..5c52ad408 100644
--- a/tests/rigctl_parse.c
+++ b/tests/rigctl_parse.c
@@ -5793,14 +5793,26 @@ static int parse_hex(const char *s, unsigned char *buf, int len)
int i = 0;
buf[0] = 0;
char *s2 = strdup(s);
- char *p = strtok(s2, ";");
+ char *p = strtok(s2, ";:");
while (p)
{
unsigned int val;
- sscanf(p, "0x%x", &val);
+ int n;
+
+ if ((n = sscanf(p, "0x%2x", &val)) != 1)
+ {
+ n = sscanf(p, "x%2x", &val);
+ }
+
+ if (n == 0)
+ {
+ rig_debug(RIG_DEBUG_ERR, "%s: unable to parse 0x??; or x??; from '%s'\n",
+ __func__, s);
+ }
+
buf[i++] = val;
- p = strtok(NULL, ";");
+ p = strtok(NULL, ";:");
}
free(s2);
@@ -5863,7 +5875,7 @@ declare_proto_rig(send_raw)
return -RIG_EINVAL;
}
- if (strncmp(arg2, "0x", 2) == 0)
+ if (strncmp(arg2, "0x", 2) == 0 || arg2[0] == 'x')
{
arg2_len = parse_hex(arg2, send, sizeof(send));
sendp = send;
commit 5abc606e13903e821c0ac88a2768f6549c5b8704
Author: Michael Black W9MDB <mdb...@ya...>
Date: Sun Dec 1 11:23:13 2024 -0600
Add new semi-colon separated hex values for send_raw icom
diff --git a/NEWS b/NEWS
index 2cef16957..d9b04777f 100644
--- a/NEWS
+++ b/NEWS
@@ -13,6 +13,7 @@ Version 5.x -- future
* Change FT1000MP Mark V model names to align with FT1000MP
Version 4.6
+ * send_raw can now take hex digits as colon-seperated -- e.g. send_raw icom xfe:xfe:x94:xe0:03:xfd
* Add IC7760
* IC7300 Mode filter can now be set by # (i.e. 1,2,3)
* Fixed AF6SA WRC rotor controller
diff --git a/doc/man1/rigctl.1 b/doc/man1/rigctl.1
index cb8ba8a89..9a1b6d44e 100644
--- a/doc/man1/rigctl.1
+++ b/doc/man1/rigctl.1
@@ -1398,13 +1398,26 @@ Returns current lock mode status 1=On, 2=Off (only useful when using rigctld)
.TP
.BR send_raw " \(aq" \fITerminator\fP "\(aq \(aq" \fIString\fP \(aq
.EX
-Can send ASCII string or 0xnn values -- there can be no spaces in the command string.
+Can send ASCII string or 0xnn values or xnn values -- there can be no spaces in the command string.
Possible terminator values are CR, LF, ;, ICOM, 0-100 (bytes to read), or -1 meaning unknown (will timeout on read)
-Examples:
- send_raw ; FA;MD;
+Examples (note that a ; must be escaped in Unix/Linux):
+For Windows & Unix/Linux we have a new colon-separated format for hex digits
+ send_raw icom 0xFE:0xFE:0x94:0x03:0xFD Note: colon-separated does not have to be escaped on Unix/Linux
+ send_raw -1 0xFE:0xFE:0x94:0x03:0xFD
+ send_raw 14 0xFE:0xFE:0x94:0x03:0xFD
+ Note that ASCII commands still require escaping the semicolon on Unix/Linux
+ send_raw \; FA\;MD\;
+
+For Windows:
send_raw icom 0xFE;0xFE;0x94;0x03;0xFD
send_raw -1 0xFE;0xFE;0x94;0x03;0xFD
send_raw 14 0xFE;0xFE;0x94;0x03;0xFD
+
+ For Unix/Linux
+ send_raw icom 0xFE\;0xFE\;0x94\;0x03\;0xFD
+ send_raw \; FA\;MD\;
+ send_raw -1 0xFE\;0xFE\;0x94\;0x03\;0xFD
+ send_raw 14 0xFE\;0xFE\;0x94\;0x03\;0xFD
.
.TP
.BR client_version " \(aq" \fIString\fP "\(aq
diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c
index 4b305a281..5c52ad408 100644
--- a/tests/rigctl_parse.c
+++ b/tests/rigctl_parse.c
@@ -5793,14 +5793,26 @@ static int parse_hex(const char *s, unsigned char *buf, int len)
int i = 0;
buf[0] = 0;
char *s2 = strdup(s);
- char *p = strtok(s2, ";");
+ char *p = strtok(s2, ";:");
while (p)
{
unsigned int val;
- sscanf(p, "0x%x", &val);
+ int n;
+
+ if ((n = sscanf(p, "0x%2x", &val)) != 1)
+ {
+ n = sscanf(p, "x%2x", &val);
+ }
+
+ if (n == 0)
+ {
+ rig_debug(RIG_DEBUG_ERR, "%s: unable to parse 0x??; or x??; from '%s'\n",
+ __func__, s);
+ }
+
buf[i++] = val;
- p = strtok(NULL, ";");
+ p = strtok(NULL, ";:");
}
free(s2);
@@ -5863,7 +5875,7 @@ declare_proto_rig(send_raw)
return -RIG_EINVAL;
}
- if (strncmp(arg2, "0x", 2) == 0)
+ if (strncmp(arg2, "0x", 2) == 0 || arg2[0] == 'x')
{
arg2_len = parse_hex(arg2, send, sizeof(send));
sendp = send;
commit ab2b5fb9e9d9f8bcf48bac5190b8fa17ce33c04c
Author: Michael Black W9MDB <mdb...@ya...>
Date: Wed Nov 27 12:30:27 2024 -0600
Fix IC7760 civ address
diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c
index 85edeb01d..363772cc2 100644
--- a/rigs/icom/icom.c
+++ b/rigs/icom/icom.c
@@ -678,7 +678,7 @@ static const struct icom_addr icom_addr_list[] =
{RIG_MODEL_IC7300, 0x94},
{RIG_MODEL_IC7610, 0x98},
{RIG_MODEL_IC7700, 0x74},
- {RIG_MODEL_IC7760, 0xB1},
+ {RIG_MODEL_IC7760, 0xB2},
{RIG_MODEL_PERSEUS, 0xE1},
{RIG_MODEL_X108G, 0x70},
{RIG_MODEL_X6100, 0x70},
commit dc7bbeca34cd91bd021bcd60dfa936fbd1f242de
Author: Michael Black W9MDB <mdb...@ya...>
Date: Wed Nov 27 12:28:59 2024 -0600
Fix civ address for IC7760
diff --git a/rigs/icom/ic7760.c b/rigs/icom/ic7760.c
index 438ae191f..c20f46d74 100644
--- a/rigs/icom/ic7760.c
+++ b/rigs/icom/ic7760.c
@@ -118,7 +118,7 @@ int ic7760_ext_tokens[] =
*/
static const struct icom_priv_caps ic7760_priv_caps =
{
- 0xb1, /* default address */
+ 0xb2, /* default address */
0, /* 731 mode */
0, /* no XCHG */
ic756pro_ts_sc_list,
commit d86f0db383cd51c3640aab17de91168351744ec3
Author: Michael Black W9MDB <mdb...@ya...>
Date: Wed Nov 27 12:10:48 2024 -0600
Fix 10GHz power watts for IC9700
diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c
index 082d846b4..85edeb01d 100644
--- a/rigs/icom/icom.c
+++ b/rigs/icom/icom.c
@@ -4550,11 +4550,6 @@ int icom_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
rig_raw2val_float(icom_val, &rig->caps->rfpower_meter_cal) * 0.01;
}
- if (RIG_IS_IC9700 && CACHE(rig)->freqMainA >= 1e9)
- {
- val->f /= 10; // power scale is different for 10GHz
- }
-
break;
case RIG_LEVEL_RFPOWER_METER_WATTS:
@@ -4578,6 +4573,11 @@ int icom_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
val->f);
}
+ if (RIG_IS_IC9700 && CACHE(rig)->freqMainA >= 1e9)
+ {
+ val->f /= 10; // power scale is different for 10GHz
+ }
+
rig_get_range(&range_list, STATE(rig)->current_freq, STATE(rig)->current_mode);
rig_debug(RIG_DEBUG_VERBOSE, "%s: maxpower=%d\n", __func__,
range_list.high_power);
diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h
index b1f3812b7..faf004030 100644
--- a/rigs/icom/icom.h
+++ b/rigs/icom/icom.h
@@ -35,7 +35,7 @@
#include <sys/time.h>
#endif
-#define BACKEND_VER "20241121"
+#define BACKEND_VER "20241127"
#define ICOM_IS_ID31 rig_is_model(rig, RIG_MODEL_ID31)
#define ICOM_IS_ID51 rig_is_model(rig, RIG_MODEL_ID51)
commit 3f90a9323eb3b477fbc92308dee131221a7cac90
Author: Michael Black W9MDB <mdb...@ya...>
Date: Wed Nov 27 12:07:03 2024 -0600
Update POWER_METER values for IC7700 and IC7760
diff --git a/rigs/icom/ic7700.c b/rigs/icom/ic7700.c
index 700da9a4e..3d1a2f576 100644
--- a/rigs/icom/ic7700.c
+++ b/rigs/icom/ic7700.c
@@ -72,21 +72,12 @@
{ 120, 1.0f } \
} }
-#define IC7700_RFPOWER_METER_CAL { 13, \
+#define IC7700_RFPOWER_METER_CAL { 4, \
{ \
{ 0, 0.0f }, \
- { 21, 5.0f }, \
- { 43, 10.0f }, \
- { 65, 15.0f }, \
- { 83, 20.0f }, \
- { 95, 25.0f }, \
- { 105, 30.0f }, \
- { 114, 35.0f }, \
- { 124, 40.0f }, \
- { 143, 50.0f }, \
- { 183, 75.0f }, \
- { 213, 100.0f }, \
- { 255, 120.0f } \
+ { 143, 100.0f }, \
+ { 212, 200.0f }, \
+ { 255, 250.0f }, \
} }
@@ -277,7 +268,7 @@ struct rig_caps ic7700_caps =
RIG_MODEL(RIG_MODEL_IC7700),
.model_name = "IC-7700",
.mfg_name = "Icom",
- .version = BACKEND_VER ".5",
+ .version = BACKEND_VER ".6",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
diff --git a/rigs/icom/ic7760.c b/rigs/icom/ic7760.c
index dd03adf8b..438ae191f 100644
--- a/rigs/icom/ic7760.c
+++ b/rigs/icom/ic7760.c
@@ -49,7 +49,7 @@
#define IC7760_ANTS (RIG_ANT_1|RIG_ANT_2|RIG_ANT_3|RIG_ANT_4)
-// IC-7760 S-meter calibration data based on manual
+// IC-7760 calibration data based on manual
#define IC7760_STR_CAL { 3, \
{ \
{ 0,-54 }, \
@@ -72,24 +72,14 @@
{ 120, 1.0f } \
} }
-#define IC7760_RFPOWER_METER_CAL { 13, \
+#define IC7760_RFPOWER_METER_CAL { 4, \
{ \
{ 0, 0.0f }, \
- { 21, 5.0f }, \
- { 43, 10.0f }, \
- { 65, 15.0f }, \
- { 83, 20.0f }, \
- { 95, 25.0f }, \
- { 105, 30.0f }, \
- { 114, 35.0f }, \
- { 124, 40.0f }, \
- { 143, 50.0f }, \
- { 183, 75.0f }, \
- { 213, 100.0f }, \
- { 255, 120.0f } \
+ { 143, 100.0f }, \
+ { 212, 200.0f }, \
+ { 255, 250.0f }, \
} }
-
#define IC7760_COMP_METER_CAL { 3, \
{ \
{ 0, 0.0f }, \
commit 610581ca95686a9eb8e407c399816b421e720aa9
Author: Michael Black W9MDB <mdb...@ya...>
Date: Wed Nov 27 10:47:34 2024 -0600
Some updates to IC7760
diff --git a/rigs/icom/ic7760.c b/rigs/icom/ic7760.c
index f101e9726..dd03adf8b 100644
--- a/rigs/icom/ic7760.c
+++ b/rigs/icom/ic7760.c
@@ -343,10 +343,10 @@ struct rig_caps ic7760_caps =
RIG_FRNG_END,
},
.tx_range_list1 = {
- FRQ_RNG_HF(1, IC7760_OTHER_TX_MODES, W(5), W(200), IC7760_VFOS, IC7760_ANTS),
- FRQ_RNG_6m(1, IC7760_OTHER_TX_MODES, W(5), W(200), IC7760_VFOS, IC7760_ANTS),
- FRQ_RNG_HF(1, IC7760_AM_TX_MODES, W(5), W(50), IC7760_VFOS, IC7760_ANTS), /* AM class */
- FRQ_RNG_6m(1, IC7760_AM_TX_MODES, W(5), W(50), IC7760_VFOS, IC7760_ANTS), /* AM class */
+ FRQ_RNG_HF(1, IC7760_OTHER_TX_MODES, W(1), W(200), IC7760_VFOS, IC7760_ANTS),
+ FRQ_RNG_6m(1, IC7760_OTHER_TX_MODES, W(1), W(200), IC7760_VFOS, IC7760_ANTS),
+ FRQ_RNG_HF(1, IC7760_AM_TX_MODES, W(.25), W(50), IC7760_VFOS, IC7760_ANTS), /* AM class */
+ FRQ_RNG_6m(1, IC7760_AM_TX_MODES, W(.25), W(50), IC7760_VFOS, IC7760_ANTS), /* AM class */
RIG_FRNG_END,
},
@@ -354,16 +354,16 @@ struct rig_caps ic7760_caps =
RIG_FRNG_END,
},
.tx_range_list2 = {
- FRQ_RNG_HF(2, IC7760_OTHER_TX_MODES, W(5), W(200), IC7760_VFOS, IC7760_ANTS),
- FRQ_RNG_6m(2, IC7760_OTHER_TX_MODES, W(5), W(200), IC7760_VFOS, IC7760_ANTS),
- FRQ_RNG_HF(2, IC7760_AM_TX_MODES, W(5), W(50), IC7760_VFOS, IC7760_ANTS), /* AM class */
- FRQ_RNG_6m(2, IC7760_AM_TX_MODES, W(5), W(50), IC7760_VFOS, IC7760_ANTS), /* AM class */
+ FRQ_RNG_HF(2, IC7760_OTHER_TX_MODES, W(1), W(200), IC7760_VFOS, IC7760_ANTS),
+ FRQ_RNG_6m(2, IC7760_OTHER_TX_MODES, W(1), W(200), IC7760_VFOS, IC7760_ANTS),
+ FRQ_RNG_HF(2, IC7760_AM_TX_MODES, W(.25), W(50), IC7760_VFOS, IC7760_ANTS), /* AM class */
+ FRQ_RNG_6m(2, IC7760_AM_TX_MODES, W(.251), W(50), IC7760_VFOS, IC7760_ANTS), /* AM class */
/* USA only, TBC: end of range and modes */
- {MHz(5.33050), MHz(5.33350), IC7760_OTHER_TX_MODES, W(5), W(200), IC7760_VFOS, IC7760_ANTS}, /* USA only */
- {MHz(5.34650), MHz(5.34950), IC7760_OTHER_TX_MODES, W(5), W(200), IC7760_VFOS, IC7760_ANTS}, /* USA only */
- {MHz(5.36650), MHz(5.36950), IC7760_OTHER_TX_MODES, W(5), W(200), IC7760_VFOS, IC7760_ANTS}, /* USA only */
- {MHz(5.37150), MHz(5.37450), IC7760_OTHER_TX_MODES, W(5), W(200), IC7760_VFOS, IC7760_ANTS}, /* USA only */
- {MHz(5.40350), MHz(5.40650), IC7760_OTHER_TX_MODES, W(5), W(200), IC7760_VFOS, IC7760_ANTS}, /* USA only */
+ {MHz(5.33050), MHz(5.33350), IC7760_OTHER_TX_MODES, W(1), W(200), IC7760_VFOS, IC7760_ANTS}, /* USA only */
+ {MHz(5.34650), MHz(5.34950), IC7760_OTHER_TX_MODES, W(1), W(200), IC7760_VFOS, IC7760_ANTS}, /* USA only */
+ {MHz(5.36650), MHz(5.36950), IC7760_OTHER_TX_MODES, W(1), W(200), IC7760_VFOS, IC7760_ANTS}, /* USA only */
+ {MHz(5.37150), MHz(5.37450), IC7760_OTHER_TX_MODES, W(1), W(200), IC7760_VFOS, IC7760_ANTS}, /* USA only */
+ {MHz(5.40350), MHz(5.40650), IC7760_OTHER_TX_MODES, W(1), W(200), IC7760_VFOS, IC7760_ANTS}, /* USA only */
RIG_FRNG_END,
},
commit 8ee3c9fa64fdebf70aa18b5b1ccbc313a5442a53
Author: Michael Black W9MDB <mdb...@ya...>
Date: Tue Nov 26 23:44:45 2024 -0600
Add ic7760.c
diff --git a/rigs/icom/ic7760.c b/rigs/icom/ic7760.c
new file mode 100644
index 000000000..f101e9726
--- /dev/null
+++ b/rigs/icom/ic7760.c
@@ -0,0 +1,466 @@
+/*
+ * Hamlib CI-V backend - description of IC-7760 and variations
+ * Copyright (c) 2009-2010 by Stephane Fillod
+ *
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Stre<et, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+#include <stdlib.h>
+
+#include <hamlib/rig.h>
+#include "token.h"
+#include "tones.h"
+#include "idx_builtin.h"
+
+#include "icom.h"
+#include "icom_defs.h"
+#include "bandplan.h"
+#include "frame.h"
+#include "misc.h"
+
+#define IC7760_OTHER_TX_MODES (RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_RTTYR|RIG_MODE_FM|RIG_MODE_PKTLSB|RIG_MODE_PKTUSB|RIG_MODE_PKTFM|RIG_MODE_PSK|RIG_MODE_PSKR)
+#define IC7760_AM_TX_MODES (RIG_MODE_AM|RIG_MODE_PKTAM)
+#define IC7760_ALL_RX_MODES IC7760_OTHER_TX_MODES | IC7760_AM_TX_MODES
+#define IC7760_1HZ_TS_MODES IC7760_ALL_RX_MODES
+
+#define IC7760_FUNCS (RIG_FUNC_NB|RIG_FUNC_COMP|RIG_FUNC_VOX|RIG_FUNC_TONE|RIG_FUNC_TSQL|RIG_FUNC_SBKIN|RIG_FUNC_FBKIN|RIG_FUNC_NR|RIG_FUNC_MON|RIG_FUNC_MN|RIG_FUNC_ANF|RIG_FUNC_VSC|RIG_FUNC_LOCK|RIG_FUNC_RIT|RIG_FUNC_XIT|RIG_FUNC_TUNER|RIG_FUNC_APF)
+
+#define IC7760_LEVELS (RIG_LEVEL_PREAMP|RIG_LEVEL_ATT|RIG_LEVEL_AGC|RIG_LEVEL_COMP|RIG_LEVEL_BKINDL|RIG_LEVEL_BALANCE|RIG_LEVEL_NR|RIG_LEVEL_PBT_IN|RIG_LEVEL_PBT_OUT|RIG_LEVEL_CWPITCH|RIG_LEVEL_RFPOWER|RIG_LEVEL_MICGAIN|RIG_LEVEL_KEYSPD|RIG_LEVEL_NOTCHF_RAW|RIG_LEVEL_SQL|RIG_LEVEL_RAWSTR|RIG_LEVEL_STRENGTH|RIG_LEVEL_AF|RIG_LEVEL_RF|RIG_LEVEL_APF|RIG_LEVEL_VOXGAIN|RIG_LEVEL_ANTIVOX|RIG_LEVEL_VOXDELAY|RIG_LEVEL_SWR|RIG_LEVEL_ALC|RIG_LEVEL_RFPOWER_METER|RIG_LEVEL_RFPOWER_METER_WATTS|RIG_LEVEL_COMP_METER|RIG_LEVEL_VD_METER|RIG_LEVEL_ID_METER|RIG_LEVEL_MONITOR_GAIN|RIG_LEVEL_NB|RIG_LEVEL_AGC_TIME)
+
+#define IC7760_VFOS (RIG_VFO_MAIN|RIG_VFO_SUB|RIG_VFO_MEM)
+#define IC7760_PARMS (RIG_PARM_ANN|RIG_PARM_BACKLIGHT)
+
+#define IC7760_VFO_OPS (RIG_OP_CPY|RIG_OP_XCHG|RIG_OP_FROM_VFO|RIG_OP_TO_VFO|RIG_OP_MCL|RIG_OP_TUNE)
+#define IC7760_SCAN_OPS (RIG_SCAN_MEM|RIG_SCAN_VFO|RIG_SCAN_PROG|RIG_SCAN_DELTA|RIG_SCAN_PRIO)
+
+#define IC7760_ANTS (RIG_ANT_1|RIG_ANT_2|RIG_ANT_3|RIG_ANT_4)
+
+// IC-7760 S-meter calibration data based on manual
+#define IC7760_STR_CAL { 3, \
+ { \
+ { 0,-54 }, \
+ { 120, 0 }, \
+ { 241, 60 } \
+ } }
+
+#define IC7760_SWR_CAL { 5, \
+ { \
+ { 0, 1.0f }, \
+ { 48, 1.5f }, \
+ { 80, 2.0f }, \
+ { 120, 3.0f }, \
+ { 240, 6.0f } \
+ } }
+
+#define IC7760_ALC_CAL { 2, \
+ { \
+ { 0, 0.0f }, \
+ { 120, 1.0f } \
+ } }
+
+#define IC7760_RFPOWER_METER_CAL { 13, \
+ { \
+ { 0, 0.0f }, \
+ { 21, 5.0f }, \
+ { 43, 10.0f }, \
+ { 65, 15.0f }, \
+ { 83, 20.0f }, \
+ { 95, 25.0f }, \
+ { 105, 30.0f }, \
+ { 114, 35.0f }, \
+ { 124, 40.0f }, \
+ { 143, 50.0f }, \
+ { 183, 75.0f }, \
+ { 213, 100.0f }, \
+ { 255, 120.0f } \
+ } }
+
+
+#define IC7760_COMP_METER_CAL { 3, \
+ { \
+ { 0, 0.0f }, \
+ { 130, 15.0f }, \
+ { 241, 30.0f } \
+ } }
+
+#define IC7760_VD_METER_CAL { 4, \
+ { \
+ { 0, 0.0f }, \
+ { 151, 44.0f }, \
+ { 180, 48.0f }, \
+ { 211, 52.0f } \
+ } }
+
+#define IC7760_ID_METER_CAL { 3, \
+ { \
+ { 0, 0.0f }, \
+ { 165, 10.0f }, \
+ { 241, 15.0f } \
+ } }
+
+struct cmdparams ic7760_extcmds[] =
+{
+ { {.s = RIG_LEVEL_VOXDELAY}, CMD_PARAM_TYPE_LEVEL, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x82}, CMD_DAT_INT, 1 },
+ { { 0 } }
+};
+
+int ic7760_ext_tokens[] =
+{
+ TOK_DRIVE_GAIN, TOK_DIGI_SEL_FUNC, TOK_DIGI_SEL_LEVEL, TOK_BACKEND_NONE
+};
+
+/*
+ * IC-7760 rig capabilities.
+ */
+static const struct icom_priv_caps ic7760_priv_caps =
+{
+ 0xb1, /* default address */
+ 0, /* 731 mode */
+ 0, /* no XCHG */
+ ic756pro_ts_sc_list,
+ .antack_len = 4,
+ .ant_count = 4,
+ .agc_levels_present = 1,
+ .agc_levels = {
+ { .level = RIG_AGC_OFF, .icom_level = 0 },
+ { .level = RIG_AGC_FAST, .icom_level = 1 },
+ { .level = RIG_AGC_MEDIUM, .icom_level = 2 },
+ { .level = RIG_AGC_SLOW, .icom_level = 3 },
+ { .level = RIG_AGC_LAST, .icom_level = -1 },
+ },
+ .extcmds = ic7760_extcmds,
+ .x25x26_always = 1,
+ .x25x26_possibly = 1,
+ .x1cx03_always = 1,
+ .x1cx03_possibly = 1,
+ .x1ax03_supported = 1,
+ .mode_with_filter = 1,
+ .data_mode_supported = 1
+};
+
+// if hour < 0 then only date will be set
+int ic7760_set_clock(RIG *rig, int year, int month, int day, int hour, int min,
+ int sec, double msec, int utc_offset)
+{
+ int cmd = 0x1a;
+ int subcmd = 0x05;
+ int retval = RIG_OK;
+ unsigned char prmbuf[MAXFRAMELEN];
+
+ if (year >= 0)
+ {
+ prmbuf[0] = 0x02;
+ prmbuf[1] = 0x05;
+ to_bcd(&prmbuf[2], year / 100, 2);
+ to_bcd(&prmbuf[3], year % 100, 2);
+ to_bcd(&prmbuf[4], month, 2);
+ to_bcd(&prmbuf[5], day, 2);
+ retval = icom_transaction(rig, cmd, subcmd, prmbuf, 6, NULL, NULL);
+
+ if (retval != RIG_OK)
+ {
+ rig_debug(RIG_DEBUG_ERR, "%s(%d): %s\b", __func__, __LINE__, rigerror(retval));
+ }
+ }
+
+ if (hour >= 0)
+ {
+ prmbuf[0] = 0x02;
+ prmbuf[1] = 0x06;
+ to_bcd(&prmbuf[2], hour, 2);
+ to_bcd(&prmbuf[3], min, 2);
+ retval = icom_transaction(rig, cmd, subcmd, prmbuf, 4, NULL, NULL);
+
+ if (retval != RIG_OK)
+ {
+ rig_debug(RIG_DEBUG_ERR, "%s(%d): %s\b", __func__, __LINE__, rigerror(retval));
+ }
+
+ prmbuf[0] = 0x02;
+ prmbuf[1] = 0x04;
+ rig_debug(RIG_DEBUG_ERR, "%s: utc_offset=%d\n", __func__, utc_offset);
+ to_bcd(&prmbuf[2], abs(utc_offset) / 100, 2);
+ to_bcd(&prmbuf[3], abs(utc_offset) % 100, 2);
+ to_bcd(&prmbuf[4], utc_offset >= 0 ? 0 : 1, 2);
+ retval = icom_transaction(rig, cmd, subcmd, prmbuf, 5, NULL, NULL);
+
+ if (retval != RIG_OK)
+ {
+ rig_debug(RIG_DEBUG_ERR, "%s(%d): %s\b", __func__, __LINE__, rigerror(retval));
+ }
+ }
+
+ return retval;
+}
+
+int ic7760_get_clock(RIG *rig, int *year, int *month, int *day, int *hour,
+ int *min, int *sec, double *msec, int *utc_offset)
+{
+ int cmd = 0x1a;
+ int subcmd = 0x05;
+ int retval = RIG_OK;
+ int resplen;
+ unsigned char prmbuf[MAXFRAMELEN];
+ unsigned char respbuf[MAXFRAMELEN];
+
+ prmbuf[0] = 0x00;
+ prmbuf[1] = 0x58;
+ resplen = sizeof(respbuf);
+ retval = icom_transaction(rig, cmd, subcmd, prmbuf, 2, respbuf, &resplen);
+ *year = from_bcd(&respbuf[4], 2) * 100 + from_bcd(&respbuf[5], 2);
+ *month = from_bcd(&respbuf[6], 2);
+ *day = from_bcd(&respbuf[7], 2);
+
+ if (hour != NULL)
+ {
+ prmbuf[0] = 0x00;
+ prmbuf[1] = 0x59;
+ retval = icom_transaction(rig, cmd, subcmd, prmbuf, 2, respbuf, &resplen);
+
+ if (retval != RIG_OK)
+ {
+ return retval;
+ }
+
+ *hour = from_bcd(&respbuf[4], 2);
+ *min = from_bcd(&respbuf[5], 2);
+ *sec = 0;
+ *msec = 0;
+
+ prmbuf[0] = 0x00;
+ prmbuf[1] = 0x61;
+ retval = icom_transaction(rig, cmd, subcmd, prmbuf, 2, respbuf, &resplen);
+
+ if (retval != RIG_OK)
+ {
+ return retval;
+ }
+
+ *utc_offset = from_bcd(&respbuf[4], 2) * 100;
+ *utc_offset += from_bcd(&respbuf[5], 2);
+
+ if (respbuf[6] != 0x00) { *utc_offset *= -1; }
+
+ //rig_debug(RIG_DEBUG_VERBOSE,
+ // "%s: %02d-%02d-%02dT%02d:%02d:%06.3lf%s%04d\n'",
+ // __func__, *year, *month, *day, *hour, *min, *sec + *msec / 1000,
+ // *utc_offset >= 0 ? "+" : "-", (unsigned)abs(*utc_offset));
+ }
+
+ return retval;
+}
+
+static int ic7760_rig_open(RIG *rig)
+{
+ rig_debug(RIG_DEBUG_VERBOSE, "%s: enter\n", __func__);
+ return icom_rig_open(rig);
+}
+
+struct rig_caps ic7760_caps =
+{
+ RIG_MODEL(RIG_MODEL_IC7760),
+ .model_name = "IC-7760",
+ .mfg_name = "Icom",
+ .version = BACKEND_VER ".0",
+ .copyright = "LGPL",
+ .status = RIG_STATUS_ALPHA,
+ .rig_type = RIG_TYPE_TRANSCEIVER,
+ .ptt_type = RIG_PTT_RIG,
+ .dcd_type = RIG_DCD_RIG,
+ .port_type = RIG_PORT_SERIAL,
+ .serial_rate_min = 300, // the manual does not show serial speeds
+ .serial_rate_max = 19200,
+ .serial_data_bits = 8,
+ .serial_stop_bits = 1,
+ .serial_parity = RIG_PARITY_NONE,
+ .serial_handshake = RIG_HANDSHAKE_NONE,
+ .write_delay = 0,
+ .post_write_delay = 0,
+ .timeout = 1000,
+ .retry = 3,
+ .has_get_func = IC7760_FUNCS,
+ .has_set_func = IC7760_FUNCS,
+ .has_get_level = IC7760_LEVELS,
+ .has_set_level = RIG_LEVEL_SET(IC7760_LEVELS),
+ .has_get_parm = IC7760_PARMS,
+ .has_set_parm = RIG_PARM_SET(IC7760_PARMS), /* FIXME: parms */
+ .level_gran =
+ {
+#define NO_LVL_KEYSPD
+#define NO_LVL_CWPITCH
+#include "level_gran_icom.h"
+#undef NO_LVL_KEYSPD
+#undef NO_LVL_CWPITCH
+ [LVL_KEYSPD] = { .min = { .i = 6 }, .max = { .i = 48 }, .step = { .i = 1 } },
+ [LVL_CWPITCH] = { .min = { .i = 300 }, .max = { .i = 900 }, .step = { .i = 1 } },
+ },
+ .parm_gran = {
+ [PARM_BACKLIGHT] = {.min = {.f = 0.0f}, .max = {.f = 1.0f}, .step = {.f = 1.0f / 255.0f}},
+ [PARM_BANDSELECT] = {.step = {.s = "BANDUNUSED,BAND160M,BAND80M,BAND40M,BAND30M,BAND20M,BAND17M,BAND15M,BAND12M,BAND10M,BAND6M,BANDGEN"}},
+ [PARM_ANN] = {.min = {.i = 0}, .max = {.i = 2}, .step = {.i = 1}},
+ },
+
+ .ext_tokens = ic7760_ext_tokens,
+ .ctcss_list = common_ctcss_list,
+ .dcs_list = NULL,
+ .preamp = { 10, 20, RIG_DBLST_END, }, /* FIXME: TBC */
+ .attenuator = { 6, 12, 18, RIG_DBLST_END, },
+ .max_rit = Hz(9999),
+ .max_xit = Hz(9999),
+ .max_ifshift = Hz(0),
+ .agc_level_count = 4,
+ .agc_levels = { RIG_AGC_OFF, RIG_AGC_FAST, RIG_AGC_MEDIUM, RIG_AGC_SLOW },
+ // ?? 7700 can have a different mode on VFOB but requires VFO swap
+ .targetable_vfo = RIG_TARGETABLE_FREQ | RIG_TARGETABLE_MODE,
+ .vfo_ops = IC7760_VFO_OPS,
+ .scan_ops = IC7760_SCAN_OPS,
+ .transceive = RIG_TRN_RIG,
+ .bank_qty = 0,
+ .chan_desc_sz = 0,
+
+ .chan_list = {
+ { 1, 99, RIG_MTYPE_MEM },
+ { 100, 101, RIG_MTYPE_EDGE }, /* two by two */
+ { 1, 4, RIG_MTYPE_MORSE },
+ RIG_CHAN_END,
+ },
+
+ .rx_range_list1 = { {kHz(30), MHz(60), IC7760_ALL_RX_MODES, -1, -1, IC7760_VFOS, IC7760_ANTS},
+ RIG_FRNG_END,
+ },
+ .tx_range_list1 = {
+ FRQ_RNG_HF(1, IC7760_OTHER_TX_MODES, W(5), W(200), IC7760_VFOS, IC7760_ANTS),
+ FRQ_RNG_6m(1, IC7760_OTHER_TX_MODES, W(5), W(200), IC7760_VFOS, IC7760_ANTS),
+ FRQ_RNG_HF(1, IC7760_AM_TX_MODES, W(5), W(50), IC7760_VFOS, IC7760_ANTS), /* AM class */
+ FRQ_RNG_6m(1, IC7760_AM_TX_MODES, W(5), W(50), IC7760_VFOS, IC7760_ANTS), /* AM class */
+ RIG_FRNG_END,
+ },
+
+ .rx_range_list2 = { {kHz(30), MHz(60), IC7760_ALL_RX_MODES, -1, -1, IC7760_VFOS, IC7760_ANTS},
+ RIG_FRNG_END,
+ },
+ .tx_range_list2 = {
+ FRQ_RNG_HF(2, IC7760_OTHER_TX_MODES, W(5), W(200), IC7760_VFOS, IC7760_ANTS),
+ FRQ_RNG_6m(2, IC7760_OTHER_TX_MODES, W(5), W(200), IC7760_VFOS, IC7760_ANTS),
+ FRQ_RNG_HF(2, IC7760_AM_TX_MODES, W(5), W(50), IC7760_VFOS, IC7760_ANTS), /* AM class */
+ FRQ_RNG_6m(2, IC7760_AM_TX_MODES, W(5), W(50), IC7760_VFOS, IC7760_ANTS), /* AM class */
+ /* USA only, TBC: end of range and modes */
+ {MHz(5.33050), MHz(5.33350), IC7760_OTHER_TX_MODES, W(5), W(200), IC7760_VFOS, IC7760_ANTS}, /* USA only */
+ {MHz(5.34650), MHz(5.34950), IC7760_OTHER_TX_MODES, W(5), W(200), IC7760_VFOS, IC7760_ANTS}, /* USA only */
+ {MHz(5.36650), MHz(5.36950), IC7760_OTHER_TX_MODES, W(5), W(200), IC7760_VFOS, IC7760_ANTS}, /* USA only */
+ {MHz(5.37150), MHz(5.37450), IC7760_OTHER_TX_MODES, W(5), W(200), IC7760_VFOS, IC7760_ANTS}, /* USA only */
+ {MHz(5.40350), MHz(5.40650), IC7760_OTHER_TX_MODES, W(5), W(200), IC7760_VFOS, IC7760_ANTS}, /* USA only */
+ RIG_FRNG_END,
+ },
+
+ .tuning_steps = {
+ {IC7760_1HZ_TS_MODES, 1},
+ {IC7760_ALL_RX_MODES, Hz(100)},
+ {IC7760_ALL_RX_MODES, kHz(1)},
+ {IC7760_ALL_RX_MODES, kHz(5)},
+ {IC7760_ALL_RX_MODES, kHz(9)},
+ {IC7760_ALL_RX_MODES, kHz(10)},
+ {IC7760_ALL_RX_MODES, kHz(12.5)},
+ {IC7760_ALL_RX_MODES, kHz(20)},
+ {IC7760_ALL_RX_MODES, kHz(25)},
+ RIG_TS_END,
+ },
+ /* mode/filter list, remember: order matters! */
+ .filters = {
+ {RIG_MODE_SSB | RIG_MODE_PKTLSB | RIG_MODE_PKTUSB, kHz(2.4)},
+ {RIG_MODE_SSB | RIG_MODE_PKTLSB | RIG_MODE_PKTUSB, kHz(1.8)},
+ {RIG_MODE_SSB | RIG_MODE_PKTLSB | RIG_MODE_PKTUSB, kHz(3)},
+ {RIG_MODE_CW | RIG_MODE_CWR | RIG_MODE_RTTY | RIG_MODE_RTTYR | RIG_MODE_PSK | RIG_MODE_PSKR, Hz(400)},
+ {RIG_MODE_CW | RIG_MODE_CWR | RIG_MODE_RTTY | RIG_MODE_RTTYR | RIG_MODE_PSK | RIG_MODE_PSKR, Hz(50)},
+ {RIG_MODE_CW | RIG_MODE_CWR | RIG_MODE_PSK | RIG_MODE_PSKR, kHz(1.0)},
+ {RIG_MODE_RTTY | RIG_MODE_RTTYR, kHz(2.4)},
+ {RIG_MODE_AM | RIG_MODE_PKTAM, kHz(6)},
+ {RIG_MODE_AM | RIG_MODE_PKTAM, kHz(3)},
+ {RIG_MODE_AM | RIG_MODE_PKTAM, kHz(9)},
+ {RIG_MODE_FM | RIG_MODE_PKTFM, kHz(12)},
+ {RIG_MODE_FM | RIG_MODE_PKTFM, kHz(8)},
+ {RIG_MODE_FM | RIG_MODE_PKTFM, kHz(15)},
+ RIG_FLT_END,
+ },
+ .str_cal = IC7760_STR_CAL,
+ .swr_cal = IC7760_SWR_CAL,
+ .alc_cal = IC7760_ALC_CAL,
+ .rfpower_meter_cal = IC7760_RFPOWER_METER_CAL,
+ .comp_meter_cal = IC7760_COMP_METER_CAL,
+ .vd_meter_cal = IC7760_VD_METER_CAL,
+ .id_meter_cal = IC7760_ID_METER_CAL,
+
+ .cfgparams = icom_cfg_params,
+ .set_conf = icom_set_conf,
+ .get_conf = icom_get_conf,
+
+ .priv = (void *)& ic7760_priv_caps,
+ .rig_init = icom_init,
+ .rig_cleanup = icom_cleanup,
+ .rig_open = ic7760_rig_open,
+ .rig_close = icom_rig_close,
+
+ .set_freq = icom_set_freq,
+ .get_freq = icom_get_freq,
+ .set_mode = icom_set_mode,
+ .get_mode = icom_get_mode,
+ .set_vfo = icom_set_vfo,
+// .get_vfo = icom_get_vfo,
+ .set_ant = icom_set_ant,
+ .get_ant = icom_get_ant,
+
+ .set_rit = icom_set_rit_new,
+ .get_rit = icom_get_rit_new,
+ .get_xit = icom_get_rit_new,
+ .set_xit = icom_set_xit_new,
+
+ .decode_event = icom_decode_event,
+ .set_level = icom_set_level,
+ .get_level = icom_get_level,
+ .set_ext_level = icom_set_ext_level,
+ .get_ext_level = icom_get_ext_level,
+ .set_func = icom_set_func,
+ .get_func = icom_get_func,
+ .set_parm = icom_set_parm,
+ .get_parm = icom_get_parm,
+ .set_mem = icom_set_mem,
+ .vfo_op = icom_vfo_op,
+ .scan = icom_scan,
+ .set_ptt = icom_set_ptt,
+ .get_ptt = icom_get_ptt,
+ .get_dcd = icom_get_dcd,
+ .set_ts = icom_set_ts,
+ .get_ts = icom_get_ts,
+ .set_ctcss_tone = icom_set_ctcss_tone,
+ .get_ctcss_tone = icom_get_ctcss_tone,
+ .set_ctcss_sql = icom_set_ctcss_sql,
+ .get_ctcss_sql = icom_get_ctcss_sql,
+ .set_split_freq = icom_set_split_freq,
+ .get_split_freq = icom_get_split_freq,
+ .set_split_mode = icom_set_split_mode,
+ .get_split_mode = icom_get_split_mode,
+ .set_split_vfo = icom_set_split_vfo,
+ .get_split_vfo = icom_get_split_vfo,
+ .set_powerstat = icom_set_powerstat,
+ .get_powerstat = icom_get_powerstat,
+ .send_morse = icom_send_morse,
+ .stop_morse = icom_stop_morse,
+ .wait_morse = rig_wait_morse,
+ .set_clock = ic7760_set_clock,
+ .get_clock = ic7760_get_clock,
+ .hamlib_check_rig_caps = HAMLIB_CHECK_RIG_CAPS
+};
commit a94e2948f550f2e040a24d5c965a62be4628f2ea
Author: Michael Black W9MDB <mdb...@ya...>
Date: Tue Nov 26 23:38:19 2024 -0600
Add IC7760 Alpha
diff --git a/NEWS b/NEWS
index 32e029f7b..2cef16957 100644
--- a/NEWS
+++ b/NEWS
@@ -13,6 +13,7 @@ Version 5.x -- future
* Change FT1000MP Mark V model names to align with FT1000MP
Version 4.6
+ * Add IC7760
* IC7300 Mode filter can now be set by # (i.e. 1,2,3)
* Fixed AF6SA WRC rotor controller
* Added Rhode&Schwarz XK852
diff --git a/include/hamlib/riglist.h b/include/hamlib/riglist.h
index 8b1abb743..7b1579e23 100644
--- a/include/hamlib/riglist.h
+++ b/include/hamlib/riglist.h
@@ -297,6 +297,7 @@
#define RIG_MODEL_X5105 RIG_MAKE_MODEL(RIG_ICOM, 89) /* Xiegu X5105 -- G90 compatible */
#define RIG_MODEL_IC905 RIG_MAKE_MODEL(RIG_ICOM, 90)
#define RIG_MODEL_X6200 RIG_MAKE_MODEL(RIG_ICOM, 91) /* Xiegu X6200 */
+#define RIG_MODEL_IC7760 RIG_MAKE_MODEL(RIG_ICOM, 92)
/*
* Optoelectronics (CI-V)
diff --git a/rigs/icom/Makefile.am b/rigs/icom/Makefile.am
index ae35b5139..b295fe8d1 100644
--- a/rigs/icom/Makefile.am
+++ b/rigs/icom/Makefile.am
@@ -8,7 +8,7 @@ ICOMSRC = icom.c icom.h icom_defs.h frame.c frame.h ic706.c icr8500.c ic735.c ic
id1.c id31.c id51.c id4100.c id5100.c perseus.c ic2730.c \
ic707.c ic728.c ic751.c ic761.c \
ic78.c ic7800.c ic785x.c \
- ic7000.c ic7100.c ic7200.c ic7300.c ic7600.c ic7610.c ic7700.c icf8101.c \
+ ic7000.c ic7100.c ic7200.c ic7300.c ic7600.c ic7610.c ic7700.c ic7760.c icf8101.c \
ic7300.h optoscan.c optoscan.h xiegu.c level_gran_icom.h
noinst_LTLIBRARIES = libhamlib-icom.la
diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c
index 5eaec5dde..082d846b4 100644
--- a/rigs/icom/icom.c
+++ b/rigs/icom/icom.c
@@ -668,15 +668,17 @@ static const struct icom_addr icom_addr_list[] =
{RIG_MODEL_ICR8500, 0x4a},
{RIG_MODEL_ICR9000, 0x2a},
{RIG_MODEL_ICR9500, 0x72},
- {RIG_MODEL_MINISCOUT, 0x94},
+// {RIG_MODEL_MINISCOUT, 0x94}, // ic7300 took this one
{RIG_MODEL_IC718, 0x5e},
{RIG_MODEL_OS535, 0x80}, /* same address as IC-7410 */
{RIG_MODEL_ICID1, 0x01},
{RIG_MODEL_IC7000, 0x70},
{RIG_MODEL_IC7100, 0x88},
{RIG_MODEL_IC7200, 0x76},
+ {RIG_MODEL_IC7300, 0x94},
{RIG_MODEL_IC7610, 0x98},
{RIG_MODEL_IC7700, 0x74},
+ {RIG_MODEL_IC7760, 0xB1},
{RIG_MODEL_PERSEUS, 0xE1},
{RIG_MODEL_X108G, 0x70},
{RIG_MODEL_X6100, 0x70},
@@ -10043,6 +10045,7 @@ DECLARE_INITRIG_BACKEND(icom)
rig_register(&ic7200_caps);
rig_register(&ic7300_caps);
rig_register(&ic7610_caps);
+ rig_register(&ic7760_caps);
rig_register(&ic781_caps);
rig_register(&ic707_caps);
rig_register(&ic728_caps);
diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h
index 11d6e7214..b1f3812b7 100644
--- a/rigs/icom/icom.h
+++ b/rigs/icom/icom.h
@@ -497,6 +497,7 @@ extern struct rig_caps ic475_caps;
extern struct rig_caps ic575_caps;
extern struct rig_caps ic1275_caps;
extern struct rig_caps icf8101_caps;
+extern struct rig_caps ic7760_caps;
extern struct rig_caps omnivip_caps;
extern struct rig_caps delta2_caps;
commit fbdb6656209306df75aaa2f541122f325f90a818
Merge: dcc7b3743 2447cb204
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sun Nov 24 22:30:38 2024 -0600
Merge branch 'master' of https://github.com/Hamlib/Hamlib
diff --cc doc/man1/rigctlsync.1
index c84ea9ef7,d07dc83b4..d35dd41eb
--- a/doc/man1/rigctlsync.1
+++ b/doc/man1/rigctlsync.1
@@@ -29,7 -29,7 +29,7 @@@ rigctlsync \- synchronize a rig to SDR
.YS
.
.SH DESCRIPTION
- Allows you to synchronize frequence from a rig to SDR#.
-Allows you to synchornize frequency from a rig to SDR#.
++Allows you to synchronize frequency from a rig to SDR#.
Best when used with rigctld, FlRig, or a multiport radio.
.
.PP
diff --cc rigs/icom/icom.h
index 2cf9259c0,2cf9259c0..11d6e7214
--- a/rigs/icom/icom.h
+++ b/rigs/icom/icom.h
@@@ -35,7 -35,7 +35,7 @@@
#include <sys/time.h>
#endif
--#define BACKEND_VER "20241111"
++#define BACKEND_VER "20241121"
#define ICOM_IS_ID31 rig_is_model(rig, RIG_MODEL_ID31)
#define ICOM_IS_ID51 rig_is_model(rig, RIG_MODEL_ID51)
diff --cc rigs/kenwood/flex6xxx.c
index 76da92547,76da92547..dd145a368
--- a/rigs/kenwood/flex6xxx.c
+++ b/rigs/kenwood/flex6xxx.c
@@@ -1331,6 -1331,6 +1331,9 @@@ int powersdr_get_parm(RIG *rig, setting
RETURNFUNC(RIG_OK);
}
++#define NO_LVL_KEYSPD
++#define NO_LVL_SLOPE_LOW
++#define NO_LVL_SLOPE_HIGH
/*
* F6K rig capabilities.
@@@ -1360,13 -1360,13 +1363,7 @@@ struct rig_caps f6k_caps
.has_set_level = F6K_LEVEL_ALL,
.has_get_parm = RIG_P...
[truncated message content] |
|
From: n0nb <n0...@us...> - 2024-11-22 22:03:30
|
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 4b77f9b6b67afc4bf26e4aeaa4774cb842d48d8b (commit)
via 11acef5d3bc4645ad70881759b2aeaf0de443cfe (commit)
via c080ba7b829e0d1427edd066ff39a1a4f88b8fb5 (commit)
via 238344b0ce3db6d50b8647c54de7d56355a37f64 (commit)
via d640511b206b466892ce37085b2e0bd35ef59b71 (commit)
via 3f526117097b08d075134309cb94e76c8cfdba5f (commit)
via 48aa284152ff5c6e031eecff261bbe9b3d809c01 (commit)
from d444fe43c61477ea823009ab5de24c69cf4de817 (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 4b77f9b6b67afc4bf26e4aeaa4774cb842d48d8b
Merge: d640511b2 11acef5d3
Author: Michael Black <mdb...@ya...>
Date: Fri Nov 22 15:07:51 2024 -0600
Merge pull request #1630 from GeoBaltz/fix23
Fix23
commit 11acef5d3bc4645ad70881759b2aeaf0de443cfe
Author: George Baltz N3GB <Geo...@gm...>
Date: Thu Nov 21 19:21:41 2024 -0500
MACROize new code.
diff --git a/rigs/dummy/flrig.c b/rigs/dummy/flrig.c
index 58b6e8692..bfabc388b 100644
--- a/rigs/dummy/flrig.c
+++ b/rigs/dummy/flrig.c
@@ -853,7 +853,7 @@ static int flrig_open(RIG *rig)
char model_name[256];
snprintf(model_name,sizeof(model_name), "%.248s(%s)", value, "FLRig");
rig->caps->model_name = strdup(model_name);
- rig->state.model_name = strdup(model_name);
+ STATE(rig)->model_name = strdup(model_name);
/* see if get_pwrmeter_scale is available */
retval = flrig_transaction(rig, "rig.get_pwrmeter_scale", NULL, value,
diff --git a/rigs/yaesu/ft1000mp.c b/rigs/yaesu/ft1000mp.c
index 9a6db6b78..d134c2b3a 100644
--- a/rigs/yaesu/ft1000mp.c
+++ b/rigs/yaesu/ft1000mp.c
@@ -945,7 +945,7 @@ static int ft1000mp_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
RETURNFUNC(retval);
}
- priv = (struct ft1000mp_priv_data *)rig->state.priv;
+ priv = (struct ft1000mp_priv_data *)STATE(rig)->priv;
if (vfo == RIG_VFO_B)
{
diff --git a/rigs/yaesu/ft817.c b/rigs/yaesu/ft817.c
index 68a28bf73..301e0e44f 100644
--- a/rigs/yaesu/ft817.c
+++ b/rigs/yaesu/ft817.c
@@ -1711,7 +1711,7 @@ static int ft817_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
// check if we're already in the mode and return if so
// the memory check was failing when in FM mode -- still showing digmode
- if (rig->state.current_mode == mode)
+ if (STATE(rig)->current_mode == mode)
{
if (digmode[0] == 0x00 && mode == RIG_MODE_RTTY) { return RIG_OK; }
else if (digmode[0] == 0x01 && mode == RIG_MODE_PSKR) { return RIG_OK; }
diff --git a/src/rig.c b/src/rig.c
index a6cd5f2f3..bf233f360 100644
--- a/src/rig.c
+++ b/src/rig.c
@@ -7979,7 +7979,7 @@ int HAMLIB_API rig_get_rig_info(RIG *rig, char *response, int max_response_len)
"VFO=%s Freq=%.0f Mode=%s Width=%d RX=%d TX=%d\nVFO=%s Freq=%.0f Mode=%s Width=%d RX=%d TX=%d\nSplit=%d SatMode=%d\nRig=%s\nApp=%s\nVersion=20241103 1.1.0\nModel=%u\n",
rig_strvfo(vfoA), freqA, modeAstr, (int)widthA, rxa, txa, rig_strvfo(vfoB),
freqB, modeBstr, (int)widthB, rxb, txb, split, satmode, rig->caps->model_name,
- rig->state.client_version, rig->caps->rig_model);
+ STATE(rig)->client_version, rig->caps->rig_model);
unsigned long crc = CRC32_function((unsigned char *)response, strlen(response));
char tmpstr[32];
SNPRINTF(tmpstr, sizeof(tmpstr), "CRC=0x%08lx\n", crc);
commit c080ba7b829e0d1427edd066ff39a1a4f88b8fb5
Author: George Baltz N3GB <Geo...@gm...>
Date: Wed Nov 20 16:35:15 2024 -0500
Factor out TS-890S and TS-990S from kenwood_get_split_vfo_if()
Fix TS-890S to return correct VFO
More of issue #1380
diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c
index 9d37c46ff..e0bad2505 100644
--- a/rigs/kenwood/kenwood.c
+++ b/rigs/kenwood/kenwood.c
@@ -1675,7 +1675,7 @@ int kenwood_set_split(RIG *rig, vfo_t vfo, split_t split, vfo_t txvfo)
}
-/* IF TB
+/* IF
* Gets split VFO status from kenwood_get_if()
*
*/
@@ -1694,30 +1694,6 @@ int kenwood_get_split_vfo_if(RIG *rig, vfo_t rxvfo, split_t *split,
RETURNFUNC(-RIG_EINVAL);
}
- if (RIG_IS_TS990S || RIG_IS_TS890S)
- {
- char buf[4];
-
- if (RIG_OK == (retval = kenwood_safe_transaction(rig, "TB", buf, sizeof(buf),
- 3)))
- {
- if ('1' == buf[2])
- {
- *split = RIG_SPLIT_ON;
- *txvfo = RIG_VFO_SUB;
- priv->tx_vfo = rs->tx_vfo = *txvfo;
- }
- else
- {
- *split = RIG_SPLIT_OFF;
- *txvfo = RIG_VFO_MAIN;
- priv->tx_vfo = rs->tx_vfo = *txvfo;
- }
- }
-
- RETURNFUNC(retval);
- }
-
retval = kenwood_get_if(rig);
if (retval != RIG_OK)
diff --git a/rigs/kenwood/ts890s.c b/rigs/kenwood/ts890s.c
index ec71d0a9f..c5906f6dc 100644
--- a/rigs/kenwood/ts890s.c
+++ b/rigs/kenwood/ts890s.c
@@ -466,6 +466,50 @@ static int ts890_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status)
return RIG_OK;
}
+/*
+ * Gets split VFO status
+ *
+ */
+static int ts890s_get_split_vfo(RIG *rig, vfo_t rxvfo, split_t *split,
+ vfo_t *txvfo)
+{
+ char buf[4];
+ int retval;
+ vfo_t tvfo;
+ struct rig_state *rs = STATE(rig);
+ struct kenwood_priv_data *priv = rs->priv;
+
+ if (RIG_OK == (retval = kenwood_safe_transaction(rig, "FT", buf, sizeof(buf),
+ 3)))
+ {
+ if ('0' == buf[2])
+ {
+ tvfo = RIG_VFO_A;
+ }
+ else if ('1' == buf[2])
+ {
+ tvfo = RIG_VFO_B;
+ }
+ else if ('3' == buf[2])
+ {
+ tvfo = RIG_VFO_MEM;
+ }
+ else
+ {
+ rig_debug(RIG_DEBUG_ERR, "%s: Unknown VFO - %s\n", __func__, buf);
+ return -RIG_EPROTO;
+ }
+
+ *txvfo = priv->tx_vfo = rs->tx_vfo = tvfo;
+ // Now get split status
+ retval = kenwood_safe_transaction(rig, "TB", buf, sizeof buf, 3);
+ if (RIG_OK != retval) {return retval;}
+ *split = priv->split = buf[2] == '1';
+ }
+
+ return retval;
+}
+
static struct kenwood_priv_caps ts890s_priv_caps =
{
@@ -626,7 +670,7 @@ struct rig_caps ts890s_caps =
.set_vfo = kenwood_set_vfo,
.get_vfo = kenwood_get_vfo_if,
.set_split_vfo = kenwood_set_split_vfo,
- .get_split_vfo = kenwood_get_split_vfo_if,
+ .get_split_vfo = ts890s_get_split_vfo,
.set_ctcss_tone = kenwood_set_ctcss_tone_tn,
.get_ctcss_tone = kenwood_get_ctcss_tone,
.set_ctcss_sql = kenwood_set_ctcss_sql,
diff --git a/rigs/kenwood/ts990s.c b/rigs/kenwood/ts990s.c
index 4c8d97a2e..0deda6bed 100644
--- a/rigs/kenwood/ts990s.c
+++ b/rigs/kenwood/ts990s.c
@@ -88,6 +88,7 @@
/* prototypes */
static int ts990s_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val);
+static int ts990s_get_split_vfo(RIG *rig, vfo_t rxvfo, split_t *split, vfo_t *txvfo);
static rmode_t ts990s_mode_table[KENWOOD_MODE_TABLE_MAX] =
{
@@ -352,7 +353,7 @@ struct rig_caps ts990s_caps =
.set_vfo = kenwood_set_vfo_main_sub,
.get_vfo = kenwood_get_vfo_main_sub,
.set_split_vfo = kenwood_set_split_vfo,
- .get_split_vfo = kenwood_get_split_vfo_if,
+ .get_split_vfo = ts990s_get_split_vfo,
.set_ctcss_tone = kenwood_set_ctcss_tone_tn,
.get_ctcss_tone = kenwood_get_ctcss_tone,
.set_ctcss_sql = kenwood_set_ctcss_sql,
@@ -761,3 +762,34 @@ int ts990s_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
return retval;
}
+
+/*
+ * Gets split VFO status
+ *
+ */
+static int ts990s_get_split_vfo(RIG *rig, vfo_t rxvfo, split_t *split,
+ vfo_t *txvfo)
+{
+ char buf[4];
+ int retval;
+ struct rig_state *rs = STATE(rig);
+ struct kenwood_priv_data *priv = rs->priv;
+
+ if (RIG_OK == (retval = kenwood_safe_transaction(rig, "TB", buf, sizeof(buf),
+ 3)))
+ {
+ if ('1' == buf[2])
+ {
+ *split = RIG_SPLIT_ON;
+ *txvfo = RIG_VFO_SUB;
+ }
+ else
+ {
+ *split = RIG_SPLIT_OFF;
+ *txvfo = RIG_VFO_MAIN;
+ }
+ priv->tx_vfo = rs->tx_vfo = *txvfo;
+ }
+
+ return retval;
+}
commit 238344b0ce3db6d50b8647c54de7d56355a37f64
Author: George Baltz N3GB <Geo...@gm...>
Date: Wed Nov 6 16:47:19 2024 -0500
Update TS-890S and TS-990S RIT/XIT handling
Use dedicated commands that make setting much simpler.
Replaces usage of deprecated IF command.
See issue #1380
diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c
index 7fd811422..9d37c46ff 100644
--- a/rigs/kenwood/kenwood.c
+++ b/rigs/kenwood/kenwood.c
@@ -1885,7 +1885,6 @@ int kenwood_get_vfo_if(RIG *rig, vfo_t *vfo)
RETURNFUNC(RIG_OK);
}
-
/*
* kenwood_set_freq
*/
@@ -2156,6 +2155,29 @@ int kenwood_get_rit(RIG *rig, vfo_t vfo, shortfreq_t *rit)
RETURNFUNC(RIG_OK);
}
+/* RF
+ * kenwood_get_rit_new (also usable as kenwood_get_xit_new)
+ * Gets the RIT or XIT value using dedicated command
+ * and without using IF.
+ */
+int kenwood_get_rit_new(RIG *rig, vfo_t vfo, shortfreq_t *rit)
+{
+ int retval, tempf;
+ char rfbuf[10];
+
+ ENTERFUNC;
+ if (!rit) { RETURNFUNC(-RIG_EINVAL); }
+ retval = kenwood_safe_transaction(rig, "RF", rfbuf, sizeof rfbuf, 7);
+ if (retval != RIG_OK) {RETURNFUNC(retval); }
+ tempf = atoi(rfbuf + 3);
+ if (rfbuf[2] == '1')
+ {
+ tempf = -tempf;
+ }
+ *rit = tempf;
+ RETURNFUNC(RIG_OK);
+}
+
/*
* rit can only move up/down by 10 Hz, so we use a loop...
*/
@@ -2252,6 +2274,30 @@ int kenwood_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit)
RETURNFUNC2(retval);
}
+/* RU/RD
+ * Set the RIT/XIT frequency offset
+ * using dedicated commands (not IF)
+ */
+int kenwood_set_rit_new(RIG *rig, vfo_t vfo, shortfreq_t rit)
+{
+ int retval, diff;
+ shortfreq_t oldrit;
+ char rdbuf[10];
+
+ ENTERFUNC;
+ if (abs(rit) > 9999) { RETURNFUNC(-RIG_EINVAL); }
+ retval = kenwood_get_rit_new(rig, vfo, &oldrit);
+ if (retval != RIG_OK) { RETURNFUNC(retval); }
+ if (rit == oldrit) // if the new value is the same
+ {
+ RETURNFUNC(RIG_OK); // Nothing to do
+ }
+ diff = rit - oldrit;
+ SNPRINTF(rdbuf, sizeof rdbuf, "R%c%05d;", diff < 0 ? 'D' : 'U', abs(diff));
+ retval = kenwood_transaction(rig, rdbuf, NULL, 0);
+ RETURNFUNC(retval);
+}
+
/*
* rit and xit are the same
*/
diff --git a/rigs/kenwood/kenwood.h b/rigs/kenwood/kenwood.h
index 0989f722f..4e363d533 100644
--- a/rigs/kenwood/kenwood.h
+++ b/rigs/kenwood/kenwood.h
@@ -223,9 +223,11 @@ int kenwood_set_freq(RIG *rig, vfo_t vfo, freq_t freq);
int kenwood_get_freq(RIG *rig, vfo_t vfo, freq_t *freq);
int kenwood_get_freq_if(RIG *rig, vfo_t vfo, freq_t *freq);
int kenwood_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit);
+int kenwood_set_rit_new(RIG *rig, vfo_t vfo, shortfreq_t rit); // Also use this for xit
int kenwood_get_rit(RIG *rig, vfo_t vfo, shortfreq_t *rit);
-int kenwood_set_xit(RIG *rig, vfo_t vfo, shortfreq_t rit);
-int kenwood_get_xit(RIG *rig, vfo_t vfo, shortfreq_t *rit);
+int kenwood_get_rit_new(RIG *rig, vfo_t vfo, shortfreq_t *rit); // Also use this for xit
+int kenwood_set_xit(RIG *rig, vfo_t vfo, shortfreq_t xit);
+int kenwood_get_xit(RIG *rig, vfo_t vfo, shortfreq_t *xit);
int kenwood_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width);
int kenwood_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width);
int kenwood_get_mode_if(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width);
diff --git a/rigs/kenwood/ts890s.c b/rigs/kenwood/ts890s.c
index 5ae39970d..ec71d0a9f 100644
--- a/rigs/kenwood/ts890s.c
+++ b/rigs/kenwood/ts890s.c
@@ -617,10 +617,10 @@ struct rig_caps ts890s_caps =
.rig_cleanup = kenwood_cleanup,
.set_freq = kenwood_set_freq,
.get_freq = kenwood_get_freq,
- .set_rit = kenwood_set_rit,
- .get_rit = kenwood_get_rit,
- .set_xit = kenwood_set_xit,
- .get_xit = kenwood_get_xit,
+ .set_rit = kenwood_set_rit_new,
+ .get_rit = kenwood_get_rit_new,
+ .set_xit = kenwood_set_rit_new, // Same routines as for RIT
+ .get_xit = kenwood_get_rit_new, // Same
.set_mode = kenwood_set_mode,
.get_mode = kenwood_get_mode,
.set_vfo = kenwood_set_vfo,
diff --git a/rigs/kenwood/ts990s.c b/rigs/kenwood/ts990s.c
index 6933581be..4c8d97a2e 100644
--- a/rigs/kenwood/ts990s.c
+++ b/rigs/kenwood/ts990s.c
@@ -343,10 +343,10 @@ struct rig_caps ts990s_caps =
.rig_cleanup = kenwood_cleanup,
.set_freq = kenwood_set_freq,
.get_freq = kenwood_get_freq,
- .set_rit = kenwood_set_rit,
- .get_rit = kenwood_get_rit,
- .set_xit = kenwood_set_xit,
- .get_xit = kenwood_get_xit,
+ .set_rit = kenwood_set_rit_new,
+ .get_rit = kenwood_get_rit_new,
+ .set_xit = kenwood_set_rit_new, // Use same routines as for rit
+ .get_xit = kenwood_get_rit_new, // Same
.set_mode = kenwood_set_mode,
.get_mode = kenwood_get_mode,
.set_vfo = kenwood_set_vfo_main_sub,
commit d640511b206b466892ce37085b2e0bd35ef59b71
Author: Mike Black W9MDB <mdb...@ya...>
Date: Thu Nov 21 11:06:52 2024 -0600
astyle icom.c
diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c
index e17c15707..00929c528 100644
--- a/rigs/icom/icom.c
+++ b/rigs/icom/icom.c
@@ -4547,6 +4547,7 @@ int icom_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
val->f =
rig_raw2val_float(icom_val, &rig->caps->rfpower_meter_cal) * 0.01;
}
+
if (RIG_IS_IC9700 && CACHE(rig)->freqMainA >= 1e9)
{
val->f /= 10; // power scale is different for 10GHz
@@ -9134,8 +9135,9 @@ int icom_is_async_frame(RIG *rig, size_t frame_length,
/* Spectrum scope data is not CI-V transceive data, but handled the same way as it is pushed by the rig */
// IC-7100 sends 0xe1 for broadcast frame?
- return frame[2] == BCASTID || frame[2] == C_SND_MODE || (frame[2] == CTRLID && frame[4] == C_CTL_SCP
- && frame[5] == S_SCP_DAT);
+ return frame[2] == BCASTID || frame[2] == C_SND_MODE || (frame[2] == CTRLID
+ && frame[4] == C_CTL_SCP
+ && frame[5] == S_SCP_DAT);
}
int icom_process_async_frame(RIG *rig, size_t frame_length,
@@ -9159,8 +9161,9 @@ int icom_process_async_frame(RIG *rig, size_t frame_length,
if (frame[2] != 0x00 || frame[2] == 0x01)
{
// just ignoring 0x01 for now
- // fe fe 01 94 1c 03 00 80 07 07 00 fd
- rig_debug(RIG_DEBUG_VERBOSE, "%s: 3rd byte not 0x00 or is 0x01...not async\n", __func__);
+ // fe fe 01 94 1c 03 00 80 07 07 00 fd
+ rig_debug(RIG_DEBUG_VERBOSE, "%s: 3rd byte not 0x00 or is 0x01...not async\n",
+ __func__);
RETURNFUNC(RIG_OK);
}
commit 3f526117097b08d075134309cb94e76c8cfdba5f
Author: Mike Black W9MDB <mdb...@ya...>
Date: Thu Nov 21 11:06:21 2024 -0600
Fix IC9700 WATTS measurement when freq > 1GHz
diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c
index 91771ca81..e17c15707 100644
--- a/rigs/icom/icom.c
+++ b/rigs/icom/icom.c
@@ -4547,6 +4547,10 @@ int icom_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
val->f =
rig_raw2val_float(icom_val, &rig->caps->rfpower_meter_cal) * 0.01;
}
+ if (RIG_IS_IC9700 && CACHE(rig)->freqMainA >= 1e9)
+ {
+ val->f /= 10; // power scale is different for 10GHz
+ }
break;
commit 48aa284152ff5c6e031eecff261bbe9b3d809c01
Author: Mike Black W9MDB <mdb...@ya...>
Date: Mon Nov 18 17:26:10 2024 -0600
Ensure tuner is off for FTDX101D/MP for 70cm band -- bug in firmware leaves it on which can cause damage
diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c
index 94c306065..8044f532f 100644
--- a/rigs/yaesu/newcat.c
+++ b/rigs/yaesu/newcat.c
@@ -1011,6 +1011,13 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
RETURNFUNC(RIG_OK); /* make it look like we changed */
}
+ if ((is_ftdx101d || is_ftdx101mp) && (freq >= 70000000 && freq <= 70499999))
+ {
+ // ensure the tuner is off for 70cm -- can cause damage to the rig
+ newcat_set_func(rig, RIG_VFO_A, RIG_FUNC_TUNER, 0);
+ hl_usleep(100 * 1000); // give it a chance to turn off
+ }
+
switch (vfo)
{
case RIG_VFO_A:
diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h
index dc1e4669d..b41ffe2cd 100644
--- a/rigs/yaesu/newcat.h
+++ b/rigs/yaesu/newcat.h
@@ -50,7 +50,7 @@
typedef char ncboolean;
/* shared function version */
-#define NEWCAT_VER "20240922"
+#define NEWCAT_VER "20241118"
/* Hopefully large enough for future use, 128 chars plus '\0' */
#define NEWCAT_DATA_LEN 129
-----------------------------------------------------------------------
Summary of changes:
rigs/dummy/flrig.c | 2 +-
rigs/icom/icom.c | 15 +++++++---
rigs/kenwood/kenwood.c | 74 ++++++++++++++++++++++++++++++++------------------
rigs/kenwood/kenwood.h | 6 ++--
rigs/kenwood/ts890s.c | 54 ++++++++++++++++++++++++++++++++----
rigs/kenwood/ts990s.c | 42 ++++++++++++++++++++++++----
rigs/yaesu/ft1000mp.c | 2 +-
rigs/yaesu/ft817.c | 2 +-
rigs/yaesu/newcat.c | 7 +++++
rigs/yaesu/newcat.h | 2 +-
src/rig.c | 2 +-
11 files changed, 161 insertions(+), 47 deletions(-)
hooks/post-receive
--
Hamlib -- Ham radio control libraries
|
|
From: n0nb <n0...@us...> - 2024-11-18 15:33: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 d444fe43c61477ea823009ab5de24c69cf4de817 (commit)
via eafdf897056165aecd6f67de1950290c5d9b2373 (commit)
via b86822064a25abc0d70cfad7129ba4b6850ba9c4 (commit)
via 05d7551c22bf568a2e081fb9bd0560b302acd06a (commit)
via 92b692bd919434d509ce922204417b7b55fa1caa (commit)
via 06bd1fe3e190173ea2ee0e47790bd0d396877975 (commit)
via 1d3941d1175bc7da0b5f7d6d3de3efd80c91b268 (commit)
via fbcd0f166748648d695e1cd966c0e6fa012f21d0 (commit)
via 320daa975a441acae11c44be4dcdd95be498c380 (commit)
via 22c00013206b021d95606af67bee01bfb3253c8a (commit)
via 3bd462308ceaef956ba0a40564e9529ea0aaa6f8 (commit)
via 356776f4bf56098c1afe1d59333c8b5c836513d4 (commit)
via 27643a9a0edb147a5fb8aa20b4bb5bfc8bbb2711 (commit)
via 7a98365c151b6aa15e1940556575042e18c25d2c (commit)
via 473a77406e90db47ff6cfbd8b05038a55e67eb5b (commit)
via c22392e5cd8654874b9e18bdc99d80293c0f28a8 (commit)
via 32e6b90f4abbea1da9fbf0f3f88327ae624e2a3e (commit)
via 6dcd60c2ac68bed9b5129befdac71f06d265cdce (commit)
via 84b733d028cd00cdb3210cd12d1e79e3dd558b54 (commit)
via 0bd214f2c46131da04ac83ccdbab5bb8a99343df (commit)
via ec36b21f5415c57b6135dc3cdd35d047e6a36bff (commit)
via 10292fd3383ff28b384ab7c42c63c19733c0e121 (commit)
via dd9696cf2dc72d9397d290c3986d6b63a3cf7061 (commit)
via d0b19252343ab4c584db3467b39de5dcce701309 (commit)
via 27767fcfc1ce18ee06276d76f14decc569ba236c (commit)
via 5c269964c28a32876dc04b715095e5d094b76055 (commit)
via 7f8f7a0e58ea1ce01c2d63b53a30cc3d0da509e2 (commit)
via ad70cc0ba46257ecd45dbe578b5fca2ef737fb6d (commit)
via 4e4c82e83ca492aa51a208c1a577a2f45523be39 (commit)
via d76da346f560a46bde785a436ca97e82ae25b735 (commit)
via 4acfeef26a8cf9a0bbbcc95c5a55d922a7b1a079 (commit)
via 5a9deee7d0132b656a15a56835eee758426a0e97 (commit)
via 44bb600a01a7a1f4c44e115cc33910032db45eb3 (commit)
from ece40e6bc28ee304a806181fc6483adec540c25c (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 d444fe43c61477ea823009ab5de24c69cf4de817
Author: Mike Black W9MDB <mdb...@ya...>
Date: Mon Nov 18 08:57:17 2024 -0600
Fix compile warnings from gcc 14.2.0
diff --git a/src/rig.c b/src/rig.c
index 21948050c..a6cd5f2f3 100644
--- a/src/rig.c
+++ b/src/rig.c
@@ -1517,7 +1517,7 @@ int HAMLIB_API rig_open(RIG *rig)
if (status < 0)
{
- rig_debug(RIG_DEBUG_ERR, "%s: cw_data_handler_start failed: %s\n", __func__,
+ rig_debug(RIG_DEBUG_ERR, "%s: cw_data_handler_start failed: %.23000s\n", __func__,
rigerror(status));
port_close(rp, rp->type.rig);
RETURNFUNC2(status);
@@ -1602,7 +1602,7 @@ int HAMLIB_API rig_open(RIG *rig)
if (retval != RIG_OK)
{
- rig_debug(RIG_DEBUG_ERR, "%s: network_multicast_publisher_start failed: %s\n",
+ rig_debug(RIG_DEBUG_ERR, "%s: network_multicast_publisher_start failed: %.23000s\n",
__FILE__,
rigerror(retval));
// we will consider this non-fatal for now
@@ -1613,7 +1613,7 @@ int HAMLIB_API rig_open(RIG *rig)
if (retval != RIG_OK)
{
- rig_debug(RIG_DEBUG_ERR, "%s: network_multicast_receiver_start failed: %s\n",
+ rig_debug(RIG_DEBUG_ERR, "%s: network_multicast_receiver_start failed: %.23000s\n",
__FILE__,
rigerror(retval));
// we will consider this non-fatal for now
@@ -1623,7 +1623,7 @@ int HAMLIB_API rig_open(RIG *rig)
if (retval != RIG_OK)
{
- rig_debug(RIG_DEBUG_ERR, "%s: rig_poll_routine_start failed: %s\n", __FILE__,
+ rig_debug(RIG_DEBUG_ERR, "%s: rig_poll_routine_start failed: %.23000s\n", __FILE__,
rigerror(retval));
// we will consider this non-fatal for now
}
@@ -2287,7 +2287,7 @@ int rig_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
if (retcode != RIG_OK)
{
- rig_debug(RIG_DEBUG_ERR, "%s: set_vfo failed: %s\n", __func__,
+ rig_debug(RIG_DEBUG_ERR, "%s: set_vfo failed: %.23000s\n", __func__,
rigerror(retcode));
}
@@ -2913,7 +2913,7 @@ int HAMLIB_API rig_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
if (retcode != RIG_OK)
{
- rig_debug(RIG_DEBUG_TRACE, "%s: failed set_mode(%s)=%s\n",
+ rig_debug(RIG_DEBUG_TRACE, "%s: failed set_mode(%s)=%.23000s\n",
__func__, rig_strrmode(mode), rigerror(retcode));
ELAPSED2;
LOCK(0);
@@ -3328,7 +3328,7 @@ int HAMLIB_API rig_set_vfo(RIG *rig, vfo_t vfo)
if (retcode != RIG_OK)
{
- rig_debug(RIG_DEBUG_WARN, "%s: rig_get_vfo error=%s\n", __func__,
+ rig_debug(RIG_DEBUG_WARN, "%s: rig_get_vfo error=%.23000s\n", __func__,
rigerror(retcode));
}
@@ -8768,7 +8768,7 @@ void *morse_data_handler(void *arg)
if (result != RIG_OK)
{
- rig_debug(RIG_DEBUG_ERR, "%s: error: %s\n", __func__, rigerror(result));
+ rig_debug(RIG_DEBUG_ERR, "%s: error: %.23971s\n", __func__, rigerror(result));
if (result == -RIG_EINVAL)
{
commit eafdf897056165aecd6f67de1950290c5d9b2373
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sun Nov 17 16:54:05 2024 -0600
Fix for FT817 when rig is manually set to non-dig mode and WSJTX then tries digmode
Memory was not reflecing non-digmode when FM was selected so we now check to see if mode is changing
diff --git a/rigs/yaesu/ft817.c b/rigs/yaesu/ft817.c
index 859aa9faa..68a28bf73 100644
--- a/rigs/yaesu/ft817.c
+++ b/rigs/yaesu/ft817.c
@@ -310,7 +310,7 @@ struct rig_caps ft817_caps =
RIG_MODEL(RIG_MODEL_FT817),
.model_name = "FT-817",
.mfg_name = "Yaesu",
- .version = "20241112.0",
+ .version = "20241117.0",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
@@ -460,7 +460,7 @@ struct rig_caps q900_caps =
RIG_MODEL(RIG_MODEL_Q900),
.model_name = "Q900",
.mfg_name = "Guohe",
- .version = "20241112.0",
+ .version = "20241117.0",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
@@ -610,7 +610,7 @@ struct rig_caps ft818_caps =
RIG_MODEL(RIG_MODEL_FT818),
.model_name = "FT-818",
.mfg_name = "Yaesu",
- .version = "20221112.0",
+ .version = "20221117.0",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
@@ -1710,11 +1710,15 @@ static int ft817_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
digmode[0] = digmode[0] >> 5; // shift 5 bits
// check if we're already in the mode and return if so
- if (digmode[0] == 0x00 && mode == RIG_MODE_RTTY) { return RIG_OK; }
- else if (digmode[0] == 0x01 && mode == RIG_MODE_PSKR) { return RIG_OK; }
- else if (digmode[0] == 0x02 && mode == RIG_MODE_PSK) { return RIG_OK; }
- else if (digmode[0] == 0x03 && mode == RIG_MODE_PKTLSB) { return RIG_OK; }
- else if (digmode[0] == 0x04 && mode == RIG_MODE_PKTUSB) { return RIG_OK; }
+ // the memory check was failing when in FM mode -- still showing digmode
+ if (rig->state.current_mode == mode)
+ {
+ if (digmode[0] == 0x00 && mode == RIG_MODE_RTTY) { return RIG_OK; }
+ else if (digmode[0] == 0x01 && mode == RIG_MODE_PSKR) { return RIG_OK; }
+ else if (digmode[0] == 0x02 && mode == RIG_MODE_PSK) { return RIG_OK; }
+ else if (digmode[0] == 0x03 && mode == RIG_MODE_PKTLSB) { return RIG_OK; }
+ else if (digmode[0] == 0x04 && mode == RIG_MODE_PKTUSB) { return RIG_OK; }
+ }
memcpy(data, ncmd[FT817_NATIVE_CAT_EEPROM_WRITE].nseq, YAESU_CMD_LENGTH);
commit b86822064a25abc0d70cfad7129ba4b6850ba9c4
Author: Mike Black W9MDB <mdb...@ya...>
Date: Thu Nov 14 16:24:39 2024 -0600
Change all Flex-radio to FlexRadio
diff --git a/rigs/flexradio/sdr1k.c b/rigs/flexradio/sdr1k.c
index e31e2438b..e66de1632 100644
--- a/rigs/flexradio/sdr1k.c
+++ b/rigs/flexradio/sdr1k.c
@@ -114,7 +114,7 @@ struct rig_caps sdr1k_rig_caps =
{
RIG_MODEL(RIG_MODEL_SDR1000),
.model_name = "SDR-1000",
- .mfg_name = "Flex-radio",
+ .mfg_name = "FlexRadio",
.version = "20200323.0",
.copyright = "LGPL",
.status = RIG_STATUS_BETA,
diff --git a/rigs/flexradio/smartsdr_caps.h b/rigs/flexradio/smartsdr_caps.h
index 5396f5fde..4736412f2 100644
--- a/rigs/flexradio/smartsdr_caps.h
+++ b/rigs/flexradio/smartsdr_caps.h
@@ -1,4 +1,4 @@
- .mfg_name = "Flex-radio",
+ .mfg_name = "FlexRadio",
.version = "20240814.0",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
diff --git a/rigs/kenwood/flex6xxx.c b/rigs/kenwood/flex6xxx.c
index e2da38baf..76da92547 100644
--- a/rigs/kenwood/flex6xxx.c
+++ b/rigs/kenwood/flex6xxx.c
@@ -1339,7 +1339,7 @@ struct rig_caps f6k_caps =
{
RIG_MODEL(RIG_MODEL_F6K),
.model_name = "6xxx",
- .mfg_name = "Flex-radio",
+ .mfg_name = "FlexRadio",
.version = "20240829.0",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
@@ -1481,7 +1481,7 @@ struct rig_caps powersdr_caps =
{
RIG_MODEL(RIG_MODEL_POWERSDR),
.model_name = "PowerSDR",
- .mfg_name = "Flex-radio/Apache",
+ .mfg_name = "FlexRadio/Apache",
.version = "20231107.0",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
commit 05d7551c22bf568a2e081fb9bd0560b302acd06a
Author: Mike Black W9MDB <mdb...@ya...>
Date: Tue Nov 12 16:28:33 2024 -0600
Update msvc 2022 build to use lib instead of link
Apparently it got changed
diff --git a/scripts/build-w64.sh b/scripts/build-w64.sh
index fff9b6241..665dfadf6 100755
--- a/scripts/build-w64.sh
+++ b/scripts/build-w64.sh
@@ -206,7 +206,7 @@ not appear to be correct to generate a 64 bit libhamlib-4.lib file!
For VS 2022:
cd lib/msvc
-c:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.32.31326\bin\Hostx64\x86\link.exe /lib /machine:i386 /def:libhamlib-4.def
+c:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.32.31326\bin\Hostx64\x86\lib.exe /lib /machine:i386 /def:libhamlib-4.def
The published Hamlib API may be found at:
commit 92b692bd919434d509ce922204417b7b55fa1caa
Merge: 06bd1fe3e 1d3941d11
Author: Mike Black W9MDB <mdb...@ya...>
Date: Tue Nov 12 16:07:58 2024 -0600
Merge branch 'master' of https://github.com/Hamlib/Hamlib
commit 06bd1fe3e190173ea2ee0e47790bd0d396877975
Author: Mike Black W9MDB <mdb...@ya...>
Date: Tue Nov 12 16:06:57 2024 -0600
Fix ft817.c DIG/PKT modes
https://github.com/Hamlib/Hamlib/issues/1629
diff --git a/rigs/yaesu/ft817.c b/rigs/yaesu/ft817.c
index d492d46bc..859aa9faa 100644
--- a/rigs/yaesu/ft817.c
+++ b/rigs/yaesu/ft817.c
@@ -186,8 +186,8 @@ static const yaesu_cmd_set_t ncmd[] =
{ 1, { 0x04, 0x00, 0x00, 0x00, 0x07 } }, /* mode set main AM */
{ 1, { 0x08, 0x00, 0x00, 0x00, 0x07 } }, /* mode set main FM */
{ 1, { 0x88, 0x00, 0x00, 0x00, 0x07 } }, /* mode set main FM-N */
- { 1, { 0x0a, 0x00, 0x00, 0x00, 0x0a } }, /* mode set main DIG */
- { 1, { 0x0c, 0x00, 0x00, 0x00, 0x0c } }, /* mode set main PKT */
+ { 1, { 0x0a, 0x00, 0x00, 0x00, 0x07 } }, /* mode set main DIG */
+ { 1, { 0x0c, 0x00, 0x00, 0x00, 0x07 } }, /* mode set main PKT */
{ 1, { 0x00, 0x00, 0x00, 0x00, 0x05 } }, /* clar on */
{ 1, { 0x00, 0x00, 0x00, 0x00, 0x85 } }, /* clar off */
{ 0, { 0x00, 0x00, 0x00, 0x00, 0xf5 } }, /* set clar freq */
@@ -310,7 +310,7 @@ struct rig_caps ft817_caps =
RIG_MODEL(RIG_MODEL_FT817),
.model_name = "FT-817",
.mfg_name = "Yaesu",
- .version = "20241109.0",
+ .version = "20241112.0",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
@@ -460,7 +460,7 @@ struct rig_caps q900_caps =
RIG_MODEL(RIG_MODEL_Q900),
.model_name = "Q900",
.mfg_name = "Guohe",
- .version = "20241109.0",
+ .version = "20241112.0",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
@@ -610,7 +610,7 @@ struct rig_caps ft818_caps =
RIG_MODEL(RIG_MODEL_FT818),
.model_name = "FT-818",
.mfg_name = "Yaesu",
- .version = "20221109.0",
+ .version = "20221112.0",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
commit 1d3941d1175bc7da0b5f7d6d3de3efd80c91b268
Author: Mike Black W9MDB <mdb...@ya...>
Date: Tue Nov 12 16:06:57 2024 -0600
Fix ft817.c DIG/PKT modes
diff --git a/rigs/yaesu/ft817.c b/rigs/yaesu/ft817.c
index d492d46bc..859aa9faa 100644
--- a/rigs/yaesu/ft817.c
+++ b/rigs/yaesu/ft817.c
@@ -186,8 +186,8 @@ static const yaesu_cmd_set_t ncmd[] =
{ 1, { 0x04, 0x00, 0x00, 0x00, 0x07 } }, /* mode set main AM */
{ 1, { 0x08, 0x00, 0x00, 0x00, 0x07 } }, /* mode set main FM */
{ 1, { 0x88, 0x00, 0x00, 0x00, 0x07 } }, /* mode set main FM-N */
- { 1, { 0x0a, 0x00, 0x00, 0x00, 0x0a } }, /* mode set main DIG */
- { 1, { 0x0c, 0x00, 0x00, 0x00, 0x0c } }, /* mode set main PKT */
+ { 1, { 0x0a, 0x00, 0x00, 0x00, 0x07 } }, /* mode set main DIG */
+ { 1, { 0x0c, 0x00, 0x00, 0x00, 0x07 } }, /* mode set main PKT */
{ 1, { 0x00, 0x00, 0x00, 0x00, 0x05 } }, /* clar on */
{ 1, { 0x00, 0x00, 0x00, 0x00, 0x85 } }, /* clar off */
{ 0, { 0x00, 0x00, 0x00, 0x00, 0xf5 } }, /* set clar freq */
@@ -310,7 +310,7 @@ struct rig_caps ft817_caps =
RIG_MODEL(RIG_MODEL_FT817),
.model_name = "FT-817",
.mfg_name = "Yaesu",
- .version = "20241109.0",
+ .version = "20241112.0",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
@@ -460,7 +460,7 @@ struct rig_caps q900_caps =
RIG_MODEL(RIG_MODEL_Q900),
.model_name = "Q900",
.mfg_name = "Guohe",
- .version = "20241109.0",
+ .version = "20241112.0",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
@@ -610,7 +610,7 @@ struct rig_caps ft818_caps =
RIG_MODEL(RIG_MODEL_FT818),
.model_name = "FT-818",
.mfg_name = "Yaesu",
- .version = "20221109.0",
+ .version = "20221112.0",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
commit fbcd0f166748648d695e1cd966c0e6fa012f21d0
Author: Mike Black W9MDB <mdb...@ya...>
Date: Mon Nov 11 17:20:53 2024 -0600
Update async detection in icom.c
diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c
index 7223c3801..91771ca81 100644
--- a/rigs/icom/icom.c
+++ b/rigs/icom/icom.c
@@ -9130,7 +9130,7 @@ int icom_is_async_frame(RIG *rig, size_t frame_length,
/* Spectrum scope data is not CI-V transceive data, but handled the same way as it is pushed by the rig */
// IC-7100 sends 0xe1 for broadcast frame?
- return frame[2] == BCASTID || (frame[2] == CTRLID && frame[4] == C_CTL_SCP
+ return frame[2] == BCASTID || frame[2] == C_SND_MODE || (frame[2] == CTRLID && frame[4] == C_CTL_SCP
&& frame[5] == S_SCP_DAT);
}
commit 320daa975a441acae11c44be4dcdd95be498c380
Author: Mike Black W9MDB <mdb...@ya...>
Date: Mon Nov 11 17:14:56 2024 -0600
Ignore icom fe fe 01 packets
diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c
index e2aef9411..7223c3801 100644
--- a/rigs/icom/icom.c
+++ b/rigs/icom/icom.c
@@ -9152,9 +9152,11 @@ int icom_process_async_frame(RIG *rig, size_t frame_length,
* the rest is data
* and don't forget one byte at the end for the EOM
*/
- if (frame[2] != 0x00)
+ if (frame[2] != 0x00 || frame[2] == 0x01)
{
- rig_debug(RIG_DEBUG_VERBOSE, "%s: 3rd byte not 0x00...not async\n", __func__);
+ // just ignoring 0x01 for now
+ // fe fe 01 94 1c 03 00 80 07 07 00 fd
+ rig_debug(RIG_DEBUG_VERBOSE, "%s: 3rd byte not 0x00 or is 0x01...not async\n", __func__);
RETURNFUNC(RIG_OK);
}
commit 22c00013206b021d95606af67bee01bfb3253c8a
Author: Mike Black W9MDB <mdb...@ya...>
Date: Mon Nov 11 17:01:11 2024 -0600
Another IC-PW2 change
diff --git a/rigs/icom/frame.c b/rigs/icom/frame.c
index 35f8cb197..a11a98867 100644
--- a/rigs/icom/frame.c
+++ b/rigs/icom/frame.c
@@ -347,7 +347,7 @@ again2:
}
// IC-PW2 was sending fe fe 94 aa 1c 03
- if (buf[3] == 0xaa)
+ if (buf[3] == 0xaa || buf[2] == 0xaa)
{
goto again2;
}
commit 3bd462308ceaef956ba0a40564e9529ea0aaa6f8
Author: Mike Black W9MDB <mdb...@ya...>
Date: Mon Nov 11 16:55:12 2024 -0600
Another IC-PW2 try
diff --git a/rigs/icom/frame.c b/rigs/icom/frame.c
index aefc23bb9..35f8cb197 100644
--- a/rigs/icom/frame.c
+++ b/rigs/icom/frame.c
@@ -347,7 +347,12 @@ again2:
}
// IC-PW2 was sending fe fe 94 aa 1c 03
- if (sendbuf[3] != buf[2] && buf[3] != 0xaa && buf[2] != 0xaa && buf[3] != 0xe0)
+ if (buf[3] == 0xaa)
+ {
+ goto again2;
+ }
+
+ if (sendbuf[3] != buf[2])
{
rig_debug(RIG_DEBUG_VERBOSE, "%s: unknown async? read again\n", __func__);
hl_usleep(100);
commit 356776f4bf56098c1afe1d59333c8b5c836513d4
Author: Mike Black W9MDB <mdb...@ya...>
Date: Mon Nov 11 16:48:54 2024 -0600
Another fix for IC-PW2
diff --git a/rigs/icom/frame.c b/rigs/icom/frame.c
index 10e2b6df1..aefc23bb9 100644
--- a/rigs/icom/frame.c
+++ b/rigs/icom/frame.c
@@ -347,7 +347,7 @@ again2:
}
// IC-PW2 was sending fe fe 94 aa 1c 03
- if (sendbuf[3] != buf[2] && buf[3] != 0xaa && buf[3] != 0xe0)
+ if (sendbuf[3] != buf[2] && buf[3] != 0xaa && buf[2] != 0xaa && buf[3] != 0xe0)
{
rig_debug(RIG_DEBUG_VERBOSE, "%s: unknown async? read again\n", __func__);
hl_usleep(100);
commit 27643a9a0edb147a5fb8aa20b4bb5bfc8bbb2711
Author: Mike Black W9MDB <mdb...@ya...>
Date: Mon Nov 11 16:32:04 2024 -0600
Another fix for IC-PW2
diff --git a/rigs/icom/frame.c b/rigs/icom/frame.c
index 6c2bbcea2..10e2b6df1 100644
--- a/rigs/icom/frame.c
+++ b/rigs/icom/frame.c
@@ -347,7 +347,7 @@ again2:
}
// IC-PW2 was sending fe fe 94 aa 1c 03
- if (sendbuf[3] != buf[2] && buf[3] != 0xaa)
+ if (sendbuf[3] != buf[2] && buf[3] != 0xaa && buf[3] != 0xe0)
{
rig_debug(RIG_DEBUG_VERBOSE, "%s: unknown async? read again\n", __func__);
hl_usleep(100);
commit 7a98365c151b6aa15e1940556575042e18c25d2c
Author: Mike Black W9MDB <mdb...@ya...>
Date: Mon Nov 11 16:27:20 2024 -0600
Other file for IC-PW2 fix
diff --git a/rigs/icom/frame.c b/rigs/icom/frame.c
index 626724ecf..6c2bbcea2 100644
--- a/rigs/icom/frame.c
+++ b/rigs/icom/frame.c
@@ -346,7 +346,8 @@ again2:
goto again2;
}
- if (sendbuf[3] != buf[2])
+ // IC-PW2 was sending fe fe 94 aa 1c 03
+ if (sendbuf[3] != buf[2] && buf[3] != 0xaa)
{
rig_debug(RIG_DEBUG_VERBOSE, "%s: unknown async? read again\n", __func__);
hl_usleep(100);
commit 473a77406e90db47ff6cfbd8b05038a55e67eb5b
Author: Mike Black W9MDB <mdb...@ya...>
Date: Mon Nov 11 16:26:15 2024 -0600
Fix for async packet from IC-PW2 amplifier
diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h
index f7aa3a42c..2cf9259c0 100644
--- a/rigs/icom/icom.h
+++ b/rigs/icom/icom.h
@@ -35,7 +35,7 @@
#include <sys/time.h>
#endif
-#define BACKEND_VER "20241030"
+#define BACKEND_VER "20241111"
#define ICOM_IS_ID31 rig_is_model(rig, RIG_MODEL_ID31)
#define ICOM_IS_ID51 rig_is_model(rig, RIG_MODEL_ID51)
commit c22392e5cd8654874b9e18bdc99d80293c0f28a8
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sun Nov 10 09:53:35 2024 -0600
Update FLRig's model name with the connected rig in FLRig
diff --git a/rigs/dummy/flrig.c b/rigs/dummy/flrig.c
index c026c6aac..58b6e8692 100644
--- a/rigs/dummy/flrig.c
+++ b/rigs/dummy/flrig.c
@@ -143,7 +143,7 @@ struct rig_caps flrig_caps =
RIG_MODEL(RIG_MODEL_FLRIG),
.model_name = "",
.mfg_name = "FLRig",
- .version = "20240612.0",
+ .version = "20241110.0",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
@@ -850,6 +850,10 @@ static int flrig_open(RIG *rig)
strncpy(priv->info, value, sizeof(priv->info));
rig_debug(RIG_DEBUG_VERBOSE, "Transceiver=%s\n", value);
+ char model_name[256];
+ snprintf(model_name,sizeof(model_name), "%.248s(%s)", value, "FLRig");
+ rig->caps->model_name = strdup(model_name);
+ rig->state.model_name = strdup(model_name);
/* see if get_pwrmeter_scale is available */
retval = flrig_transaction(rig, "rig.get_pwrmeter_scale", NULL, value,
commit 32e6b90f4abbea1da9fbf0f3f88327ae624e2a3e
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sat Nov 9 07:02:04 2024 -0600
Change FT817/FT818/Q900 to use 0x0a for digital mode and 0x0c for packet instead of 0x07
diff --git a/rigs/yaesu/ft817.c b/rigs/yaesu/ft817.c
index ff15241ff..d492d46bc 100644
--- a/rigs/yaesu/ft817.c
+++ b/rigs/yaesu/ft817.c
@@ -186,8 +186,8 @@ static const yaesu_cmd_set_t ncmd[] =
{ 1, { 0x04, 0x00, 0x00, 0x00, 0x07 } }, /* mode set main AM */
{ 1, { 0x08, 0x00, 0x00, 0x00, 0x07 } }, /* mode set main FM */
{ 1, { 0x88, 0x00, 0x00, 0x00, 0x07 } }, /* mode set main FM-N */
- { 1, { 0x0a, 0x00, 0x00, 0x00, 0x07 } }, /* mode set main DIG */
- { 1, { 0x0c, 0x00, 0x00, 0x00, 0x07 } }, /* mode set main PKT */
+ { 1, { 0x0a, 0x00, 0x00, 0x00, 0x0a } }, /* mode set main DIG */
+ { 1, { 0x0c, 0x00, 0x00, 0x00, 0x0c } }, /* mode set main PKT */
{ 1, { 0x00, 0x00, 0x00, 0x00, 0x05 } }, /* clar on */
{ 1, { 0x00, 0x00, 0x00, 0x00, 0x85 } }, /* clar off */
{ 0, { 0x00, 0x00, 0x00, 0x00, 0xf5 } }, /* set clar freq */
@@ -310,7 +310,7 @@ struct rig_caps ft817_caps =
RIG_MODEL(RIG_MODEL_FT817),
.model_name = "FT-817",
.mfg_name = "Yaesu",
- .version = "20241101.0",
+ .version = "20241109.0",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
@@ -460,7 +460,7 @@ struct rig_caps q900_caps =
RIG_MODEL(RIG_MODEL_Q900),
.model_name = "Q900",
.mfg_name = "Guohe",
- .version = "20241101.0",
+ .version = "20241109.0",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
@@ -610,7 +610,7 @@ struct rig_caps ft818_caps =
RIG_MODEL(RIG_MODEL_FT818),
.model_name = "FT-818",
.mfg_name = "Yaesu",
- .version = "20221101.0",
+ .version = "20221109.0",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
commit 6dcd60c2ac68bed9b5129befdac71f06d265cdce
Author: Mike Black W9MDB <mdb...@ya...>
Date: Fri Nov 8 22:29:29 2024 -0600
Increate FT747GX post_write_delay from 5ms to 10ms
Doing two commands at once via rigctld needed a little extra delay
diff --git a/rigs/yaesu/ft747.c b/rigs/yaesu/ft747.c
index 4c9373092..b8ad27ffa 100644
--- a/rigs/yaesu/ft747.c
+++ b/rigs/yaesu/ft747.c
@@ -301,7 +301,7 @@ struct rig_caps ft747_caps =
RIG_MODEL(RIG_MODEL_FT747),
.model_name = "FT-747GX",
.mfg_name = "Yaesu",
- .version = "20220819.1",
+ .version = "20241108.0",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_MOBILE,
diff --git a/rigs/yaesu/ft747.h b/rigs/yaesu/ft747.h
index 2df6513a1..a17692f8c 100644
--- a/rigs/yaesu/ft747.h
+++ b/rigs/yaesu/ft747.h
@@ -39,8 +39,9 @@
/* Sequential fast writes confuse my FT747 without this delay */
+/* Node Red combined "F 028074000 M USB 0" needed 10ms */
-#define FT747_POST_WRITE_DELAY 5
+#define FT747_POST_WRITE_DELAY 10
/*
commit 84b733d028cd00cdb3210cd12d1e79e3dd558b54
Author: Mike Black W9MDB <mdb...@ya...>
Date: Thu Nov 7 08:12:46 2024 -0600
Add RIG_OP_TUNE for TS990S
diff --git a/rigs/kenwood/ts990s.c b/rigs/kenwood/ts990s.c
index e20edd031..6933581be 100644
--- a/rigs/kenwood/ts990s.c
+++ b/rigs/kenwood/ts990s.c
@@ -42,7 +42,7 @@
#define TS2000_LEVEL_ALL (RIG_LEVEL_PREAMP|RIG_LEVEL_ATT|RIG_LEVEL_VOXDELAY|RIG_LEVEL_AF|RIG_LEVEL_RF|RIG_LEVEL_SQL|RIG_LEVEL_CWPITCH|RIG_LEVEL_RFPOWER|RIG_LEVEL_MICGAIN|RIG_LEVEL_KEYSPD|RIG_LEVEL_COMP|RIG_LEVEL_AGC|RIG_LEVEL_BKINDL|RIG_LEVEL_METER|RIG_LEVEL_VOXGAIN|RIG_LEVEL_ANTIVOX|RIG_LEVEL_RAWSTR|RIG_LEVEL_STRENGTH|RIG_LEVEL_SWR)
-#define TS990S_VFO_OP (RIG_OP_BAND_UP|RIG_OP_BAND_DOWN)
+#define TS990S_VFO_OP (RIG_OP_BAND_UP|RIG_OP_BAND_DOWN|RIG_OP_TUNE)
#define TS990S_SCAN_OP (RIG_SCAN_VFO)
#define TS990S_ANTS (RIG_ANT_1|RIG_ANT_2|RIG_ANT_3|RIG_ANT_4)
@@ -135,7 +135,7 @@ struct rig_caps ts990s_caps =
RIG_MODEL(RIG_MODEL_TS990S),
.model_name = "TS-990S",
.mfg_name = "Kenwood",
- .version = BACKEND_VER ".6",
+ .version = BACKEND_VER ".7",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
commit 0bd214f2c46131da04ac83ccdbab5bb8a99343df
Merge: ec36b21f5 10292fd33
Author: Michael Black <mdb...@ya...>
Date: Wed Nov 6 10:46:06 2024 -0600
Merge pull request #1628 from GeoBaltz/fix22
More commands for simts890.c
commit ec36b21f5415c57b6135dc3cdd35d047e6a36bff
Author: Mike Black W9MDB <mdb...@ya...>
Date: Wed Nov 6 09:43:14 2024 -0600
Remove forcine Icom rigs to always set mode.
If mode does not change then don't set it
https://github.com/Hamlib/Hamlib/issues/1580
diff --git a/src/rig.c b/src/rig.c
index beee71652..21948050c 100644
--- a/src/rig.c
+++ b/src/rig.c
@@ -2824,8 +2824,14 @@ int HAMLIB_API rig_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
retcode = caps->get_mode(rig, vfo, &mode_curr, &width_curr);
// For Icom rigs we may need to force the filter so we always set mode
+#if 0
+ // This should not be necessary anymore with the new filter method for Icom rigs
+ // Hopefully fixes issue https://github.com/Hamlib/Hamlib/issues/1580
if (retcode == RIG_OK && mode == mode_curr
&& RIG_ICOM != RIG_BACKEND_NUM(rig->caps->rig_model))
+#else
+ if (retcode == RIG_OK && mode == mode_curr)
+#endif
{
rig_debug(RIG_DEBUG_VERBOSE,
"%s: mode already %s and bw change not requested\n", __func__,
commit 10292fd3383ff28b384ab7c42c63c19733c0e121
Author: George Baltz N3GB <Geo...@gm...>
Date: Wed Nov 6 10:19:40 2024 -0500
Astyle simts890.c
Man, this is ugly!
diff --git a/simulators/simts890.c b/simulators/simts890.c
index e99107bf7..a3c513d21 100644
--- a/simulators/simts890.c
+++ b/simulators/simts890.c
@@ -70,7 +70,8 @@ int rl = 0;
int is = 0;
int sp = 0; // Split OFF/ON
int split_op = 0; // Split frequency setting operation in progress
-int rit=0, xit=0, rxit=0; // RIT off/on, XIT off/on, Offset freq(-9999<=rxit<=+9999)
+int rit = 0, xit = 0, rxit =
+ 0; // RIT off/on, XIT off/on, Offset freq(-9999<=rxit<=+9999)
int fine = 0; // Fine tuning - step size off=10hz, on=1hz
// Clock data
int autoset = 1;
@@ -269,26 +270,26 @@ int main(int argc, char *argv[])
* This description is taken from the TS-590S/SG manual, with values
* reflecting a real TS-890S.
*/
- char IFformat[] = "IF" // Output only
- "%011d" // P1 freq(Hz)
- " " // P2 ??
- "% 05d" // P3 RIT/XIT freq(Hz)
- "%1d" // P4 RIT on/off
- "%1d" // P5 XIT on/off
- "000" // P6,P7 mem channel
- "%1d" // P8 RX/TX
- "%1X" // P9 Operating mode (See OM command)
- "0" // P10 Function?
- "0" // P11 Scan status?
- "%1d" // P12 Simplex=0/Split=1
- "0" // P13 Tone/CTCSS (not on TS-890S)
- "00" // P14 Tone/CTCSS freq (not on TS-890S)
- "0;"; // P15 Always zero
+ const char IFformat[] = "IF" // Output only
+ "%011d" // P1 freq(Hz)
+ " " // P2 ??
+ "% 05d" // P3 RIT/XIT freq(Hz)
+ "%1d" // P4 RIT on/off
+ "%1d" // P5 XIT on/off
+ "000" // P6,P7 mem channel
+ "%1d" // P8 RX/TX
+ "%1X" // P9 Operating mode (See OM command)
+ "0" // P10 Function?
+ "0" // P11 Scan status?
+ "%1d" // P12 Simplex=0/Split=1
+ "0" // P13 Tone/CTCSS (not on TS-890S)
+ "00" // P14 Tone/CTCSS freq (not on TS-890S)
+ "0;"; // P15 Always zero
#endif
- char SFformat[] = "SF" // Input/Output
- "%1d" // P1 VFOA/VFOB
- "%011d" // P2 Freq(Hz)
- "%1X;"; // P3 Mode
+ const char SFformat[] = "SF" // Input/Output
+ "%1d" // P1 VFOA/VFOB
+ "%011d" // P2 Freq(Hz)
+ "%1X;"; // P3 Mode
/* Initialization */
for (int i = 0; i < NBANDS; i++)
@@ -326,7 +327,8 @@ int main(int argc, char *argv[])
buf[1] = toupper(buf[1]);
if (strcmp(buf, "IF;") == 0)
- { // Reads the tranceiver status
+ {
+ // Reads the tranceiver status
#if defined(LEGACY)
char ifbuf[256];
hl_usleep(mysleep * 1000);
@@ -958,7 +960,8 @@ int main(int argc, char *argv[])
}
}
else if (strncmp(buf, "MD", 2) == 0)
- { // Sets and reads the operating mode status
+ {
+ // Sets and reads the operating mode status
#if defined(LEGACY)
if (buf[2] == ';')
{
@@ -969,6 +972,7 @@ int main(int argc, char *argv[])
{
sscanf(buf, "MD%1X", &(*vfoLR[0])->mode);
}
+
#else
cmd_err = 1;
#endif
@@ -1128,7 +1132,8 @@ int main(int argc, char *argv[])
sscanf(buf, "RL1%d", &rl);
}
else if (strncmp(buf, "FS", 2) == 0)
- { // FINE Function
+ {
+ // FINE Function
if (buf[2] == ';')
{
snprintf(buf, sizeof buf, "FS%d%d;", fine, fine); // For now
@@ -1137,19 +1142,22 @@ int main(int argc, char *argv[])
else
{
if (buf[2] == '0' || buf[2] == '1')
- { fine = buf[2] - '0'; }
+ { fine = buf[2] - '0'; }
else
- { cmd_err = 1; }
+ { cmd_err = 1; }
}
}
else if (strcmp(buf, "RC;") == 0)
- { // RIT/XIT Frequency Clear
+ {
+ // RIT/XIT Frequency Clear
rxit = 0;
}
- else if (buf[0] == 'R' && (buf[1] =='D' || buf[1] == 'U')) // RD/RU
- { // RIT/XIT Frequency Up/Down
+ else if (buf[0] == 'R' && (buf[1] == 'D' || buf[1] == 'U')) // RD/RU
+ {
+ // RIT/XIT Frequency Up/Down
int dir = buf[1] == 'D' ? -1 : +1;
- int tempit;
+ int tempit;
+
if (buf[2] == ';')
{
tempit = rxit + (dir * (fine ? 1 : 10));
@@ -1158,43 +1166,55 @@ int main(int argc, char *argv[])
{
tempit = rxit + dir * atoi(buf + 2);
}
+
if (abs(tempit) > 9999) {cmd_err = 1; continue;}
+
/* Some weird rounding going on here - TBD */
rxit = tempit;
}
else if (strcmp(buf, "RF;") == 0)
- { // RIT/XIT Frequency
+ {
+ // RIT/XIT Frequency
snprintf(buf, sizeof buf, "RF%1d%04d;", rxit < 0 ? 1 : 0, abs(rxit));
OUTPUT(buf);
}
else if (strncmp(buf, "RT", 2) == 0)
- { // RIT Function State, RIT Shift
- switch(buf[2]) {
+ {
+ // RIT Function State, RIT Shift
+ switch (buf[2])
+ {
case ';': // Read
snprintf(buf, sizeof buf, "RT%d;", rit);
OUTPUT(buf);
break;
+
case '0': // Set
case '1':
rit = buf[2] - '0';
break;
+
case '2': // Shift
//TODO: set recv freq to vfo+rxit, clear rxit and rit
break;
+
default:
cmd_err = 1;
}
}
else if (strncmp(buf, "XT", 2) == 0)
- { // XIT Function State, XIT Shift
- switch(buf[2]) {
+ {
+ // XIT Function State, XIT Shift
+ switch (buf[2])
+ {
case '0': // Set
case '1':
xit = buf[2] - '0';
break;
+
case '2': // Shift
//TODO: set xmit freq to vfo+rxit(Which vfo?), set split, clear rxit and xit
break;
+
default:
cmd_err = 1;
}
commit dd9696cf2dc72d9397d290c3986d6b63a3cf7061
Author: George Baltz N3GB <Geo...@gm...>
Date: Tue Nov 5 17:09:31 2024 -0500
Add RIT/XIT commands (FS, RC, RD/RU, RF, RT, XT) to simts890.c
Add RIT/XIT data to IF command.
FS probably affects more places, TBD
Constify some strings
diff --git a/simulators/simts890.c b/simulators/simts890.c
index f1ab8f6c3..e99107bf7 100644
--- a/simulators/simts890.c
+++ b/simulators/simts890.c
@@ -70,6 +70,8 @@ int rl = 0;
int is = 0;
int sp = 0; // Split OFF/ON
int split_op = 0; // Split frequency setting operation in progress
+int rit=0, xit=0, rxit=0; // RIT off/on, XIT off/on, Offset freq(-9999<=rxit<=+9999)
+int fine = 0; // Fine tuning - step size off=10hz, on=1hz
// Clock data
int autoset = 1;
int tzs[2] = {36, 56}; // 0=primary(EST), 1=auxiliary(UTC)
@@ -270,9 +272,9 @@ int main(int argc, char *argv[])
char IFformat[] = "IF" // Output only
"%011d" // P1 freq(Hz)
" " // P2 ??
- " 0000" // P3 RIT/XIT freq(Hz)
- "0" // P4 RIT on/off
- "0" // P5 XIT on/off
+ "% 05d" // P3 RIT/XIT freq(Hz)
+ "%1d" // P4 RIT on/off
+ "%1d" // P5 XIT on/off
"000" // P6,P7 mem channel
"%1d" // P8 RX/TX
"%1X" // P9 Operating mode (See OM command)
@@ -282,6 +284,7 @@ int main(int argc, char *argv[])
"0" // P13 Tone/CTCSS (not on TS-890S)
"00" // P14 Tone/CTCSS freq (not on TS-890S)
"0;"; // P15 Always zero
+#endif
char SFformat[] = "SF" // Input/Output
"%1d" // P1 VFOA/VFOB
"%011d" // P2 Freq(Hz)
@@ -327,8 +330,9 @@ int main(int argc, char *argv[])
#if defined(LEGACY)
char ifbuf[256];
hl_usleep(mysleep * 1000);
- sprintf(ifbuf, IFformat, (*vfoLR[0])->freq,
- (ptt + ptt_mic + ptt_data + ptt_tune) > 0 ? 1 : 0, (*vfoLR[0])->mode, sp);
+ sprintf(ifbuf, IFformat, (*vfoLR[0])->freq, rxit, rit, xit,
+ (ptt + ptt_mic + ptt_data + ptt_tune) > 0 ? 1 : 0,
+ (*vfoLR[0])->mode, sp);
OUTPUT(ifbuf);
#else
cmd_err = 1;
@@ -1123,6 +1127,78 @@ int main(int argc, char *argv[])
puts(buf);
sscanf(buf, "RL1%d", &rl);
}
+ else if (strncmp(buf, "FS", 2) == 0)
+ { // FINE Function
+ if (buf[2] == ';')
+ {
+ snprintf(buf, sizeof buf, "FS%d%d;", fine, fine); // For now
+ OUTPUT(buf);
+ }
+ else
+ {
+ if (buf[2] == '0' || buf[2] == '1')
+ { fine = buf[2] - '0'; }
+ else
+ { cmd_err = 1; }
+ }
+ }
+ else if (strcmp(buf, "RC;") == 0)
+ { // RIT/XIT Frequency Clear
+ rxit = 0;
+ }
+ else if (buf[0] == 'R' && (buf[1] =='D' || buf[1] == 'U')) // RD/RU
+ { // RIT/XIT Frequency Up/Down
+ int dir = buf[1] == 'D' ? -1 : +1;
+ int tempit;
+ if (buf[2] == ';')
+ {
+ tempit = rxit + (dir * (fine ? 1 : 10));
+ }
+ else
+ {
+ tempit = rxit + dir * atoi(buf + 2);
+ }
+ if (abs(tempit) > 9999) {cmd_err = 1; continue;}
+ /* Some weird rounding going on here - TBD */
+ rxit = tempit;
+ }
+ else if (strcmp(buf, "RF;") == 0)
+ { // RIT/XIT Frequency
+ snprintf(buf, sizeof buf, "RF%1d%04d;", rxit < 0 ? 1 : 0, abs(rxit));
+ OUTPUT(buf);
+ }
+ else if (strncmp(buf, "RT", 2) == 0)
+ { // RIT Function State, RIT Shift
+ switch(buf[2]) {
+ case ';': // Read
+ snprintf(buf, sizeof buf, "RT%d;", rit);
+ OUTPUT(buf);
+ break;
+ case '0': // Set
+ case '1':
+ rit = buf[2] - '0';
+ break;
+ case '2': // Shift
+ //TODO: set recv freq to vfo+rxit, clear rxit and rit
+ break;
+ default:
+ cmd_err = 1;
+ }
+ }
+ else if (strncmp(buf, "XT", 2) == 0)
+ { // XIT Function State, XIT Shift
+ switch(buf[2]) {
+ case '0': // Set
+ case '1':
+ xit = buf[2] - '0';
+ break;
+ case '2': // Shift
+ //TODO: set xmit freq to vfo+rxit(Which vfo?), set split, clear rxit and xit
+ break;
+ default:
+ cmd_err = 1;
+ }
+ }
else if (strncmp(buf, "CK", 2) == 0)
{
// All the clock functions
commit d0b19252343ab4c584db3467b39de5dcce701309
Author: George Baltz N3GB <Geo...@gm...>
Date: Mon Nov 4 16:09:24 2024 -0500
Annotate legacy (undocumented) commands in simts890.c
Allow them to be disabled
Relevant to issues #1380 and #899
diff --git a/simulators/simts890.c b/simulators/simts890.c
index 8f41bff99..f1ab8f6c3 100644
--- a/simulators/simts890.c
+++ b/simulators/simts890.c
@@ -21,7 +21,16 @@ struct ip_mreq
#include <time.h>
//#include <hamlib/rig.h>
+/* Definitions */
+/* The TS-890S has some undocumented commands, left over from older
+ * Kenwood models. They have newer counterparts with more functionality,
+ * but are still around for legacy software. If you want to see if your
+ * app is only using the latest-and-greatest, comment out the next define.
+ */
+#define LEGACY
+// Size of command buffer
#define BUFSIZE 256
+// Number of selectable bands
#define NBANDS 11
/* Type we're emulating - K=The Americas(default), E=Europe */
#if !defined(TYPE)
@@ -30,6 +39,7 @@ struct ip_mreq
/* Define a macro for sending response back to the app
* This will allow us to reroute output to a buffering routine
* Needed to handle multiple commands in a single message
+ * Also makes it easy to trace
*/
#if defined(TRACE)
#define OUTPUT(s) {printf("Resp:\"%s\"\n", s); write(fd, s, strlen(s)); }
@@ -251,6 +261,7 @@ int main(int argc, char *argv[])
kvfop_t *const vfoAB[2] = {&vfoA, &vfoB}; // 0=A, 1=B, fixed
kvfop_t *vfoLR[2] = {&vfoA, &vfoB}; // 0=Left, 1=Right, can change
+#if defined(LEGACY)
/* The IF command is not documented for the TS-890S, and is supposed
* to be supplanted by SF. However, it is still there for legacy S/W.
* This description is taken from the TS-590S/SG manual, with values
@@ -312,12 +323,16 @@ int main(int argc, char *argv[])
buf[1] = toupper(buf[1]);
if (strcmp(buf, "IF;") == 0)
- {
+ { // Reads the tranceiver status
+#if defined(LEGACY)
char ifbuf[256];
hl_usleep(mysleep * 1000);
sprintf(ifbuf, IFformat, (*vfoLR[0])->freq,
(ptt + ptt_mic + ptt_data + ptt_tune) > 0 ? 1 : 0, (*vfoLR[0])->mode, sp);
OUTPUT(ifbuf);
+#else
+ cmd_err = 1;
+#endif
}
else if (strncmp(buf, "AN", 2) == 0)
{
@@ -938,6 +953,22 @@ int main(int argc, char *argv[])
sscanf(&buf[3], "%1X", &(*vfoLR[idx])->mode);
}
}
+ else if (strncmp(buf, "MD", 2) == 0)
+ { // Sets and reads the operating mode status
+#if defined(LEGACY)
+ if (buf[2] == ';')
+ {
+ snprintf(buf, sizeof(buf), "MD%X;", (*vfoLR[0])->mode);
+ OUTPUT(buf);
+ }
+ else
+ {
+ sscanf(buf, "MD%1X", &(*vfoLR[0])->mode);
+ }
+#else
+ cmd_err = 1;
+#endif
+ }
else if (strncmp(buf, "RM", 2) == 0)
{
// Meter
commit 27767fcfc1ce18ee06276d76f14decc569ba236c
Author: George Baltz N3GB <Geo...@gm...>
Date: Fri Nov 1 15:36:16 2024 -0400
Add traffic tracing to simts890.c
diff --git a/simulators/simts890.c b/simulators/simts890.c
index 58d39557e..8f41bff99 100644
--- a/simulators/simts890.c
+++ b/simulators/simts890.c
@@ -1,3 +1,4 @@
+//#define TRACE /* Full traffic trace if enabled */
// can run this using rigctl/rigctld and socat pty devices
// gcc -o simts890 -l hamlib simts890.c
#define _XOPEN_SOURCE 700
@@ -30,7 +31,11 @@ struct ip_mreq
* This will allow us to reroute output to a buffering routine
* Needed to handle multiple commands in a single message
*/
+#if defined(TRACE)
+#define OUTPUT(s) {printf("Resp:\"%s\"\n", s); write(fd, s, strlen(s)); }
+#else
#define OUTPUT(s) write(fd, s, strlen(s))
+#endif
int mysleep = 20;
@@ -296,7 +301,9 @@ int main(int argc, char *argv[])
if (getmyline(fd, buf) > 0)
{
-// printf("Cmd:\"%s\"\n", buf);
+#if defined(TRACE)
+ printf("Cmd:\"%s\"\n", buf);
+#endif
}
// else { return 0; }
commit 5c269964c28a32876dc04b715095e5d094b76055
Author: Mike Black W9MDB <mdb...@ya...>
Date: Wed Nov 6 08:07:34 2024 -0600
astyle files in preparation for release 4.6
diff --git a/amplifiers/elecraft/kpa.c b/amplifiers/elecraft/kpa.c
index e1acfba88..8ffbbe28e 100644
--- a/amplifiers/elecraft/kpa.c
+++ b/amplifiers/elecraft/kpa.c
@@ -67,7 +67,7 @@ int kpa_init(AMP *amp)
}
AMPSTATE(amp)->priv = (struct kpa_priv_data *)
- calloc(1, sizeof(struct kpa_priv_data));
+ calloc(1, sizeof(struct kpa_priv_data));
if (!AMPSTATE(amp)->priv)
{
diff --git a/amplifiers/expert/expert.c b/amplifiers/expert/expert.c
index 48f88c871..7f4080cf8 100644
--- a/amplifiers/expert/expert.c
+++ b/amplifiers/expert/expert.c
@@ -69,7 +69,7 @@ int expert_init(AMP *amp)
}
AMPSTATE(amp)->priv = (struct expert_priv_data *)
- calloc(1, sizeof(struct expert_priv_data));
+ calloc(1, sizeof(struct expert_priv_data));
if (!AMPSTATE(amp)->priv)
{
diff --git a/amplifiers/gemini/gemini.c b/amplifiers/gemini/gemini.c
index 41129fec1..5a154f52c 100644
--- a/amplifiers/gemini/gemini.c
+++ b/amplifiers/gemini/gemini.c
@@ -46,7 +46,7 @@ int gemini_init(AMP *amp)
}
AMPSTATE(amp)->priv = (struct gemini_priv_data *)
- calloc(1, sizeof(struct gemini_priv_data));
+ calloc(1, sizeof(struct gemini_priv_data));
if (!AMPSTATE(amp)->priv)
{
diff --git a/rigs/barrett/4100.c b/rigs/barrett/4100.c
index 99004f6ac..02842e819 100644
--- a/rigs/barrett/4100.c
+++ b/rigs/barrett/4100.c
@@ -110,7 +110,9 @@ static int barrett4100_open(RIG *rig)
ENTERFUNC;
retval = barrett_transaction2(rig, "M:REMOTE SENTER2,1", 3, &response);
- rig_debug(RIG_DEBUG_ERR, "%s: back from REMOTE SENTER2: got %d\n", __func__, retval);
+ rig_debug(RIG_DEBUG_ERR, "%s: back from REMOTE SENTER2: got %d\n", __func__,
+ retval);
+
if (response[0] != 's')
{
rig_debug(RIG_DEBUG_ERR, "%s: REMOTE SENTER2 error: got %s\n", __func__,
@@ -159,6 +161,7 @@ int barrett4100_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
rig_debug(RIG_DEBUG_ERR, "%s: unable to parse s gRF\n", __func__);
}
}
+
retval = barrett_transaction2(rig, "M:FF STF%.0f GTF", freq, &response);
if (retval != RIG_OK)
@@ -196,10 +199,12 @@ int barrett4100_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
else
{
int n = sscanf(response, "gRF%lf", freq);
+
//int n = sscanf(response, "gRFA1,%*d,%lf,%*d", freq);
if (n != 1)
{
- rig_debug(RIG_DEBUG_ERR, "%s(%d): unable to parse freq from '%s'\n", __func__, __LINE__, response);
+ rig_debug(RIG_DEBUG_ERR, "%s(%d): unable to parse freq from '%s'\n", __func__,
+ __LINE__, response);
return -RIG_EPROTO;
}
}
diff --git a/rigs/barrett/barrett.c b/rigs/barrett/barrett.c
index 21757143c..17756ebcb 100644
--- a/rigs/barrett/barrett.c
+++ b/rigs/barrett/barrett.c
@@ -74,11 +74,13 @@ int barrett_transaction2(RIG *rig, char *cmd, int expected, char **result)
SNPRINTF(cmd_buf, sizeof(cmd_buf), "%c%s%s", 0x0a, cmd, EOM);
barrett_flush(rig);
retval = write_block(rp, (unsigned char *) cmd_buf, strlen(cmd_buf));
+
if (retval < 0)
{
rig_debug(RIG_DEBUG_ERR, "%s(%d): error in write_block\n", __func__, __LINE__);
return retval;
}
+
retval = read_block(RIGPORT(rig), (unsigned char *) priv->ret_data, expected);
if (retval < 0)
@@ -86,15 +88,19 @@ int barrett_transaction2(RIG *rig, char *cmd, int expected, char **result)
rig_debug(RIG_DEBUG_ERR, "%s(%d): error in read_block\n", __func__, __LINE__);
return retval;
}
- rig_debug(RIG_DEBUG_VERBOSE, "%s(%d): %d bytes read\n", __func__, __LINE__, retval);
- if (priv->ret_data[0] == 0x13) // we'll return from the 1st good char
- {
- *result = &(priv->ret_data[1]);
- }
- else // some commands like IAL don't give XOFF but XON is there -- is this a bug?
- {
- *result = &(priv->ret_data[0]);
- }
+
+ rig_debug(RIG_DEBUG_VERBOSE, "%s(%d): %d bytes read\n", __func__, __LINE__,
+ retval);
+
+ if (priv->ret_data[0] == 0x13) // we'll return from the 1st good char
+ {
+ *result = &(priv->ret_data[1]);
+ }
+ else // some commands like IAL don't give XOFF but XON is there -- is this a bug?
+ {
+ *result = &(priv->ret_data[0]);
+ }
+
return retval;
}
@@ -227,7 +233,7 @@ int barrett_init(RIG *rig)
rig->caps->version);
// cppcheck claims leak here but it's freed in cleanup
STATE(rig)->priv = (struct barrett_priv_data *)calloc(1,
- sizeof(struct barrett_priv_data));
+ sizeof(struct barrett_priv_data));
if (!STATE(rig)->priv)
{
diff --git a/rigs/codan/codan.c b/rigs/codan/codan.c
index 692cb4695..92b146709 100644
--- a/rigs/codan/codan.c
+++ b/rigs/codan/codan.c
@@ -138,7 +138,7 @@ int codan_init(RIG *rig)
rig->caps->version);
// cppcheck claims leak here but it's freed in cleanup
STATE(rig)->priv = (struct codan_priv_data *)calloc(1,
- sizeof(struct codan_priv_data));
+ sizeof(struct codan_priv_data));
if (!STATE(rig)->priv)
{
diff --git a/rigs/commradio/commradio.c b/rigs/commradio/commradio.c
index c73c7b6fe..d830e6eda 100644
--- a/rigs/commradio/commradio.c
+++ b/rigs/commradio/commradio.c
@@ -24,81 +24,86 @@
*/
int commradio_transaction(RIG *rig, const unsigned char *cmd, int cmd_len,
- unsigned char *data, int *data_len)
+ unsigned char *data, int *data_len)
{
- int ret = -RIG_EINTERNAL;
- struct rig_state *rs;
- hamlib_port_t *rp = RIGPORT(rig);
-
- ENTERFUNC;
-
- rs = STATE(rig);
- rs->transaction_active = 1;
-
- /*
- * Flush is needed until async mode is done. The CTX-10 sends frames every
- * time the VFO changes.
- */
- rig_flush(rp);
-
- int frame_len;
- unsigned char frame[3+2*(cmd_len+2)];
- size_t rx_len = CR_FRAMELENGTH;
- unsigned char rx[rx_len];
- frame_len = frame_message(frame, cmd, cmd_len);
- ret = write_block(rp, frame, frame_len);
- if (ret < RIG_OK)
- {
- goto transaction_quit;
- }
-
- const char stopset[] = { CR_EOF };
- ret = read_string(rp, rx, rx_len-1, stopset, 1, 0, 1);
- if (ret < RIG_OK)
- {
- goto transaction_quit;
- }
- ret = commradio_unpack_frame(data, rx, ret);
- if (ret < RIG_OK)
- {
- goto transaction_quit;
- }
- *data_len = ret;
- //TODO: check for error response 0x11
+ int ret = -RIG_EINTERNAL;
+ struct rig_state *rs;
+ hamlib_port_t *rp = RIGPORT(rig);
+
+ ENTERFUNC;
+
+ rs = STATE(rig);
+ rs->transaction_active = 1;
+
+ /*
+ * Flush is needed until async mode is done. The CTX-10 sends frames every
+ * time the VFO changes.
+ */
+ rig_flush(rp);
+
+ int frame_len;
+ unsigned char frame[3 + 2 * (cmd_len + 2)];
+ size_t rx_len = CR_FRAMELENGTH;
+ unsigned char rx[rx_len];
+ frame_len = frame_message(frame, cmd, cmd_len);
+ ret = write_block(rp, frame, frame_len);
+
+ if (ret < RIG_OK)
+ {
+ goto transaction_quit;
+ }
+
+ const char stopset[] = { CR_EOF };
+ ret = read_string(rp, rx, rx_len - 1, stopset, 1, 0, 1);
+
+ if (ret < RIG_OK)
+ {
+ goto transaction_quit;
+ }
+
+ ret = commradio_unpack_frame(data, rx, ret);
+
+ if (ret < RIG_OK)
+ {
+ goto transaction_quit;
+ }
+
+ *data_len = ret;
+ //TODO: check for error response 0x11
transaction_quit:
- rs->transaction_active = 0;
- RETURNFUNC(ret);
+ rs->transaction_active = 0;
+ RETURNFUNC(ret);
}
int commradio_init(RIG *rig)
{
- ENTERFUNC;
- // I can't think of anything that goes in here yet.
- RETURNFUNC(RIG_OK);
+ ENTERFUNC;
+ // I can't think of anything that goes in here yet.
+ RETURNFUNC(RIG_OK);
}
int commradio_cleanup(RIG *rig)
{
- ENTERFUNC;
- // dealloc stuff if it gets added to _init
- RETURNFUNC(RIG_OK);
+ ENTERFUNC;
+ // dealloc stuff if it gets added to _init
+ RETURNFUNC(RIG_OK);
}
int commradio_rig_open(RIG *rig)
{
- ENTERFUNC;
- // Possibly check if our serial port is configured right and we are not
- // doing bad things to the GPIO lines
- RETURNFUNC(RIG_OK);
+ ENTERFUNC;
+ // Possibly check if our serial port is configured right and we are not
+ // doing bad things to the GPIO lines
+ RETURNFUNC(RIG_OK);
}
int commradio_rig_close(RIG *rig)
{
- ENTERFUNC;
- // i don't really know
- RETURNFUNC(RIG_OK);
+ ENTERFUNC;
+ // i don't really know
+ RETURNFUNC(RIG_OK);
}
/*
@@ -110,73 +115,79 @@ int commradio_rig_close(RIG *rig)
int commradio_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
{
- const unsigned char cmd[] = {0x32}; // Get frequency request
- unsigned char data[CR_FRAMELENGTH];
- int data_len;
- int ret = -RIG_EINTERNAL;
-
- ENTERFUNC;
-
- ret = commradio_transaction(rig, cmd, 1, data, &data_len);
- if(data_len == 5 && (data[0] == 0x33 || data[0] == 0x34))
- {
- *freq = (data[1] << 24 | data[2] << 16 | data[3] << 8 | data[4]);
- ret = RIG_OK;
- }
- else
- {
- rig_debug(RIG_DEBUG_ERR, "%s: Unexpected response to 0x32\n", __func__);
- }
- RETURNFUNC(ret);
+ const unsigned char cmd[] = {0x32}; // Get frequency request
+ unsigned char data[CR_FRAMELENGTH];
+ int data_len;
+ int ret = -RIG_EINTERNAL;
+
+ ENTERFUNC;
+
+ ret = commradio_transaction(rig, cmd, 1, data, &data_len);
+
+ if (data_len == 5 && (data[0] == 0x33 || data[0] == 0x34))
+ {
+ *freq = (data[1] << 24 | data[2] << 16 | data[3] << 8 | data[4]);
+ ret = RIG_OK;
+ }
+ else
+ {
+ rig_debug(RIG_DEBUG_ERR, "%s: Unexpected response to 0x32\n", __func__);
+ }
+
+ RETURNFUNC(ret);
}
int commradio_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
{
- unsigned char data[CR_FRAMELENGTH];
- int data_len;
- int ret = -RIG_EINTERNAL;
-
- ENTERFUNC;
-
- if(freq < 150000 || freq > 30000000)
- {
- RETURNFUNC(-RIG_EINVAL);
- }
- uint32_t int_freq = freq;
- rig_debug(RIG_DEBUG_VERBOSE, "%s: Got freq=%f, int_freq=%u\n", __func__,
- freq, int_freq);
- unsigned char cmd[] =
- {
- 0x30, // Set frequency request
- 0xFF & (int_freq >> 24),
- 0xFF & (int_freq >> 16),
- 0xFF & (int_freq >> 8),
- 0xFF & (int_freq)
- };
-
- ret = commradio_transaction(rig, cmd, 5, data, &data_len);
- if(data_len == 5 && (data[0] == 0x31 || data[0] == 0x34))
- {
- uint32_t new_freq = (data[1] << 24 | data[2] << 16 | data[3] << 8 | data[4]);
- if(int_freq == new_freq)
- {
- RETURNFUNC(RIG_OK);
- }
- else
- {
- RETURNFUNC(-RIG_ERJCTED);
- }
- }
- // CTX-10 returns 11 02 30 00 00 00 01 if we try to go out of its
- // general-coverage frequency range 150kHz - 30MHz. I'm not sure why Hamlib
- // even tries to do this, since its defined in the caps...
- else
- {
- rig_debug(RIG_DEBUG_ERR, "%s: Unexpected response to 0x30\n", __func__);
- ret = -RIG_ERJCTED;
- }
- RETURNFUNC(ret);
+ unsigned char data[CR_FRAMELENGTH];
+ int data_len;
+ int ret = -RIG_EINTERNAL;
+
+ ENTERFUNC;
+
+ if (freq < 150000 || freq > 30000000)
+ {
+ RETURNFUNC(-RIG_EINVAL);
+ }
+
+ uint32_t int_freq = freq;
+ rig_debug(RIG_DEBUG_VERBOSE, "%s: Got freq=%f, int_freq=%u\n", __func__,
+ freq, int_freq);
+ unsigned char cmd[] =
+ {
+ 0x30, // Set frequency request
+ 0xFF & (int_freq >> 24),
+ 0xFF & (int_freq >> 16),
+ 0xFF & (int_freq >> 8),
+ 0xFF & (int_freq)
+ };
+
+ ret = commradio_transaction(rig, cmd, 5, data, &data_len);
+
+ if (data_len == 5 && (data[0] == 0x31 || data[0] == 0x34))
+ {
+ uint32_t new_freq = (data[1] << 24 | data[2] << 16 | data[3] << 8 | data[4]);
+
+ if (int_freq == new_freq)
+ {
+ RETURNFUNC(RIG_OK);
+ }
+ else
+ {
+ RETURNFUNC(-RIG_ERJCTED);
+ }
+ }
+ // CTX-10 returns 11 02 30 00 00 00 01 if we try to go out of its
+ // general-coverage frequency range 150kHz - 30MHz. I'm not sure why Hamlib
+ // even tries to do this, since its defined in the caps...
+ else
+ {
+ rig_debug(RIG_DEBUG_ERR, "%s: Unexpected response to 0x30\n", __func__);
+ ret = -RIG_ERJCTED;
+ }
+
+ RETURNFUNC(ret);
}
/*
@@ -184,13 +195,13 @@ int commradio_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
*/
int commradio_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
{
- return (RIG_OK);
+ return (RIG_OK);
}
int commradio_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
{
- *mode = RIG_MODE_NONE;
- return (RIG_OK);
+ *mode = RIG_MODE_NONE;
+ return (RIG_OK);
}
/*
@@ -199,22 +210,22 @@ int commradio_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
*/
int commradio_set_vfo(RIG *rig, vfo_t vfo)
{
- return (RIG_OK);
+ return (RIG_OK);
}
int commradio_get_vfo(RIG *rig, vfo_t *vfo)
{
- *vfo = RIG_VFO_A;
- return (RIG_OK);
+ *vfo = RIG_VFO_A;
+ return (RIG_OK);
}
DECLARE_INITRIG_BACKEND(commradio)
{
- rig_debug(RIG_DEBUG_VERBOSE, "%s: _init called\n", __func__);
- rig_register(&ctx10_caps);
+ rig_debug(RIG_DEBUG_VERBOSE, "%s: _init called\n", __func__);
+ rig_register(&ctx10_caps);
- return (RIG_OK);
+ return (RIG_OK);
}
/*
@@ -222,6 +233,6 @@ DECLARE_INITRIG_BACKEND(commradio)
*/
DECLARE_PROBERIG_BACKEND(commradio)
{
- return (RIG_MODEL_NONE);
+ return (RIG_MODEL_NONE);
}
diff --git a/rigs/commradio/ctx10.c b/rigs/commradio/ctx10.c
index fc411ee41..ddaa0e617 100644
--- a/rigs/commradio/ctx10.c
+++ b/rigs/commradio/ctx10.c
@@ -17,79 +17,79 @@
struct rig_caps ctx10_caps =
{
- RIG_MODEL(RIG_MODEL_CTX10),
- .model_name = "CTX-10",
- .mfg_name = "Commradio",
- .version = "20240809.0",
- .copyright = "LGPL",
- .status = RIG_STATUS_STABLE,
- .rig_type = RIG_TYPE_TRANSCEIVER,
- .ptt_type = RIG_PTT_NONE,
- .dcd_type = RIG_DCD_NONE,
- .port_type = RIG_PORT_SERIAL,
- .serial_rate_min = 3000000,
- .serial_rate_max = 3000000,
- .serial_data_bits = 8,
- .serial_stop_bits = 1,
- .serial_parity = RIG_PARITY_NONE,
- .serial_handshake = RIG_HANDSHAKE_NONE,
- .write_delay = 0,
- .post_write_delay = 0,
- .timeout = 1000,
- .retry = 3,
- .has_get_func = RIG_FUNC_NONE,
- .has_set_func = RIG_FUNC_NONE,
- .has_get_level = RIG_LEVEL_NONE,
- .has_set_level = RIG_LEVEL_NONE,
- .has_get_parm = RIG_PARM_NONE,
- .has_set_parm = RIG_PARM_NONE,
-// .level_gran = {},
-// .parm_gran = {},
- .ctcss_list = NULL,
- .dcs_list = NULL,
-// .preamp = { RIG_DBLST_END, },
-// .attenuator = { RIG_DBLST_END, },
-// .max_rit = Hz(0),
-// .max_xit = Hz(0),
-// .max_ifshift = Hz(0),
- .targetable_vfo = 0,
- .vfo_ops = (RIG_OP_FROM_VFO|RIG_OP_TO_VFO),
- .scan_ops = RIG_SCAN_NONE,
- .transceive = RIG_TRN_OFF,
- .bank_qty = 0,
- .chan_desc_sz = 0,
- .chan_list = { RIG_CHAN_END, },
- .rx_range_list1 = {
- {kHz(150), MHz(30), CTX10_RX_MODES, -1, -1, CTX10_VFO, 0},
- RIG_FRNG_END,
- },
- .tx_range_list1 = {
- FRQ_RNG_80m_REGION2(CTX10_TX_MODES, W(1), W(10), CTX10_VFO, 0),
- FRQ_RNG_60m_REGION2(CTX10_TX_MODES, W(1), W(10), CTX10_VFO, 0),
- FRQ_RNG_40m_REGION2(CTX10_TX_MODES, W(1), W(10), CTX10_VFO, 0),
- FRQ_RNG_30m_REGION2(CTX10_TX_MODES, W(1), W(10), CTX10_VFO, 0),
- FRQ_RNG_20m_REGION2(CTX10_TX_MODES, W(1), W(10), CTX10_VFO, 0),
- FRQ_RNG_17m_REGION2(CTX10_TX_MODES, W(1), W(10), CTX10_VFO, 0),
- FRQ_RNG_15m_REGION2(CTX10_TX_MODES, W(1), W(10), CTX10_VFO, 0),
- FRQ_RNG_12m_REGION2(CTX10_TX_MODES, W(1), W(10), CTX10_VFO, 0),
- FRQ_RNG_10m_REGION2(CTX10_TX_MODES, W(1), W(10), CTX10_VFO, 0),
- },
- .tuning_steps = {
- {CTX10_RX_MODES, 10},
- RIG_TS_END,
- },
-// .async_data_supported = 1, //TODO: R...
[truncated message content] |
|
From: n0nb <n0...@us...> - 2024-11-02 11:32:48
|
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 ece40e6bc28ee304a806181fc6483adec540c25c (commit)
via 88cae85ab27e9cd59b4a37502e4fb2cd9c254541 (commit)
via 49e870cfb8cb9a7dd119c8fee75de912936993ab (commit)
from be44ddc83055418110984c009dd6cf923136cc86 (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 ece40e6bc28ee304a806181fc6483adec540c25c
Author: Mike Black W9MDB <mdb...@ya...>
Date: Wed Oct 30 17:05:44 2024 -0500
Hopefully clean up clang warning on compile
diff --git a/tests/testrig.c b/tests/testrig.c
index e73a4cd79..b7a5b1abd 100644
--- a/tests/testrig.c
+++ b/tests/testrig.c
@@ -80,8 +80,8 @@ int main(int argc, const char *argv[])
uint64_t levels = rig_get_caps_int(my_rig->caps->rig_model,
RIG_CAPS_HAS_GET_LEVEL);
- printf("HAS_GET_LEVEL=0x%8lx, SWR=%8llx,true=%d\n", levels,
- levels & RIG_LEVEL_SWR, (levels & RIG_LEVEL_SWR) == RIG_LEVEL_SWR);
+ printf("HAS_GET_LEVEL=0x%8llx, SWR=%8llx,true=%d\n", (unsigned long long)levels,
+ (unsigned long long)(levels & RIG_LEVEL_SWR), (levels & RIG_LEVEL_SWR) == RIG_LEVEL_SWR);
char val[256];
retcode = rig_get_conf2(my_rig, rig_token_lookup(my_rig, "write_delay"), val,
commit 88cae85ab27e9cd59b4a37502e4fb2cd9c254541
Merge: 49e870cfb be44ddc83
Author: Mike Black W9MDB <mdb...@ya...>
Date: Wed Oct 30 16:42:26 2024 -0500
Merge branch 'master' of https://github.com/Hamlib/Hamlib
commit 49e870cfb8cb9a7dd119c8fee75de912936993ab
Author: Mike Black W9MDB <mdb...@ya...>
Date: Wed Oct 30 16:41:29 2024 -0500
Remove collision_retry=0 in icom/frame.c -- was causing a loop when random data received
https://github.com/Hamlib/Hamlib/issues/1604
diff --git a/rigs/icom/frame.c b/rigs/icom/frame.c
index 50e962517..985df2613 100644
--- a/rigs/icom/frame.c
+++ b/rigs/icom/frame.c
@@ -329,7 +329,12 @@ again2:
// https://github.com/Hamlib/Hamlib/issues/1575
// these types of async can interrupt the cmd we sent
// if our host number changes must not be for us
- collision_retry = 0;
+ if (icom_is_async_frame(rig, frm_len, buf))
+ {
+ icom_process_async_frame(rig, frm_len, buf);
+ goto again2;
+ }
+
if (sendbuf[3] != buf[2])
{
rig_debug(RIG_DEBUG_VERBOSE, "%s: unknown async? read again\n", __func__);
@@ -341,12 +346,6 @@ again2:
}
- if (icom_is_async_frame(rig, frm_len, buf))
- {
- icom_process_async_frame(rig, frm_len, buf);
- goto again2;
- }
-
#if 0
// this was causing rigctld to fail on IC706 and WSJT-X
-----------------------------------------------------------------------
Summary of changes:
rigs/icom/frame.c | 13 ++++++-------
tests/testrig.c | 4 ++--
2 files changed, 8 insertions(+), 9 deletions(-)
hooks/post-receive
--
Hamlib -- Ham radio control libraries
|
|
From: n0nb <n0...@us...> - 2024-10-30 21:33:32
|
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 be44ddc83055418110984c009dd6cf923136cc86 (commit)
via ab883be8504c61568ef383e1aa3061e99199d0d6 (commit)
via da5e490b2406676a27afc5157390de896c5b1533 (commit)
via eead7a572ab579b68ef884d37fb870056cfa0e3b (commit)
via 671d45f33775851bbcf4bf8bcf951a0be8fee2b2 (commit)
via 3445d94c8d9bff1f57473d275135b46e744da15c (commit)
via d209c655b0bb32706d2e1b96907ada54fa3205eb (commit)
via 8bbf60d5c87f556a2093b7088b5cc14203c292e0 (commit)
via 7aa739a97d5b5f3803a0940ac74f6955d77b26ed (commit)
via ddf51e6b52361c870a377de43a3dd4be0a76a32d (commit)
via 2b99b9d2ef04867166b9682709e8b508e168e3ec (commit)
via ebe685125e5d728969113dbaf35a0f76138a7b93 (commit)
via 5b1df09ad00d0cb1ef7faf66dda561ed76133745 (commit)
via 3e34acc1e036ca13de01ee4c2dd43d49c79a56c1 (commit)
via 65ae33845461e24f667d5acdc8d0bdbdf790da4b (commit)
via 536cf13c698489bb112f93002f3235a40306fa3a (commit)
via aa6d028b73934a307aae3b6d8a0cb7ca11f554ef (commit)
from e3b067307a93bebd3eab6c5d11687f6adc482d27 (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 be44ddc83055418110984c009dd6cf923136cc86
Merge: 5b1df09ad ab883be85
Author: Michael Black <mdb...@ya...>
Date: Wed Oct 30 12:13:58 2024 -0500
Merge pull request #1626 from GeoBaltz/fix21
Loads of code for simts890.c
commit ab883be8504c61568ef383e1aa3061e99199d0d6
Author: George Baltz N3GB <Geo...@gm...>
Date: Tue Oct 29 14:38:19 2024 -0400
Make FR & FT commands aware of new vfo structs.
Get rid of vfo_rx & vfo_tx; find both thru vfoLR.
diff --git a/simulators/simts890.c b/simulators/simts890.c
index 34af7d616..55224df45 100644
--- a/simulators/simts890.c
+++ b/simulators/simts890.c
@@ -36,7 +36,7 @@ int mysleep = 20;
int filternum1 = 7;
int filternum2 = 8;
-int vfo_rx, vfo_tx, ptt, ptt_data, ptt_mic, ptt_tune;
+int ptt, ptt_data, ptt_mic, ptt_tune;
int keyspd = 20;
int sl=3, sh=3;
int nr=0;
@@ -434,7 +434,7 @@ int main(int argc, char *argv[])
{
int temp = -1;
sscanf(buf + 8, "%3d", &temp);
- if (temp < 2 && temp >= 0)
+ if (temp <= 2 && temp >= 0)
{ nummems = temp * 2 + 1; }
else
{ cmd_err = 1; }
@@ -535,26 +535,48 @@ int main(int argc, char *argv[])
*vfoAB[tmpvfo] = nvfo;
printf("modeA=%X, modeB=%X\n", vfoA->mode, vfoB->mode);
}
- else if (strcmp(buf, "FR;") == 0)
- {
- snprintf(buf, sizeof(buf), "FR%d;", vfo_rx);
- OUTPUT(buf);
- }
else if (strncmp(buf, "FR", 2) == 0)
- {
- sscanf(buf, "FR%d", &vfo_rx);
- }
- else if (strcmp(buf, "FT;") == 0)
- {
- snprintf(buf, sizeof(buf), "FT%d;", vfo_tx);
- OUTPUT(buf);
+ { // Receiver Function (VFO A / VFO B / Memory channel)
+ int idx;
+
+ if (buf[2] == ';')
+ { // Read
+ idx = sp && tfset;
+ snprintf(buf, sizeof(buf), "FR%d;", (*vfoLR[idx])->vfo);
+ OUTPUT(buf);
+ }
+ else
+ { // Set
+ idx = buf[2] - '0';
+ if (idx == 3)
+ { //TODO: Memory channels are a long way off
+ puts("Memory channels not implemented.\n");
+ cmd_err = 3;
+ continue;
+ }
+ if (idx < 0 || idx > 1) {cmd_err = 1; continue; }
+ sp = 0; // Turn off split
+ if ((*vfoLR[0])->vfo != idx) // If the selected vfo is not the operational one
+ {
+ swapvfos(vfoLR); // Make it so
+ }
+ }
}
else if (strncmp(buf, "FT", 2) == 0)
- {
- sscanf(buf, "FT%d", &vfo_tx);
- if (vfo_tx != vfo_rx)
- {
- sp = 1;
+ { // Transmitter Function ( VFO A / VFO B )
+ int idx;
+
+ if (buf[2] == ';')
+ { // Read
+ idx = sp && !tfset;
+ snprintf(buf, sizeof(buf), "FT%d;", (*vfoLR[idx])->vfo);
+ OUTPUT(buf);
+ }
+ else
+ { // Set
+ idx = buf[2] - '0';
+ if (idx < 0 || idx > 1) {cmd_err = 1; continue; }
+ sp = idx != (*vfoLR[0])->vfo; // Turn split on if vfos differ, else off
}
}
else if (buf[0] == 'B' && (buf[1] == 'D' || buf[1] == 'U')) // BU/BD
@@ -678,7 +700,7 @@ int main(int argc, char *argv[])
/* This section needs a lot of work, and a lot
* of cooperation from other commands.
* AFAICT the split freq can be set by spinning
- * the big knob, or by other means. When oper=1
+ * the big knob, or by other means. When oper=0
* is sent, the current freq is used as the split
* value. See page 5-1 of the IM, blinking SPLIT
*/
commit da5e490b2406676a27afc5157390de896c5b1533
Author: George Baltz N3GB <Geo...@gm...>
Date: Fri Oct 25 17:05:26 2024 -0400
Clean up
Fix up NB commands.
Update VFO in case copy caused a band change.
Change MODEL to TYPE to match Kenwood nomenclature, make it
easier to change via cli.
Comments
diff --git a/simulators/simts890.c b/simulators/simts890.c
index e1a2545dc..34af7d616 100644
--- a/simulators/simts890.c
+++ b/simulators/simts890.c
@@ -22,8 +22,10 @@ struct ip_mreq
#define BUFSIZE 256
#define NBANDS 11
-/* Model we're emulating - K=The Americas, E=Europe */
-#define MODEL K
+/* Type we're emulating - K=The Americas(default), E=Europe */
+#if !defined(TYPE)
+#define TYPE K
+#endif
/* Define a macro for sending response back to the app
* This will allow us to reroute output to a buffering routine
* Needed to handle multiple commands in a single message
@@ -44,7 +46,7 @@ int sm = 35;
int nt = 0;
int ag = 100;
int ac = 0;
-int nb1=0,nb2=0;
+int nb[2] = {0, 0}; // NB1/NB2 OFF/ON
int sq=0;
int rg=0;
int mg=0;
@@ -90,7 +92,7 @@ int bandslot[2][NBANDS]; // 0-based band memory: ((bandslot[i] + 1) % nummems)
* selection is by BD/BU command
*/
struct kvfo band_mem[2][NBANDS][5] = { {
-#if MODEL==K
+#if TYPE==K
/* 160M */ { { 1800000, 3}, { 1810000, 3}, { 1820000, 3}, { 1830000, 3}, { 1840000, 3} },
/* 80M */ { { 3500000, 1}, { 3600000, 1}, { 3700000, 1}, { 3800000, 1}, { 3900000, 1} },
/* 40M */ { { 7000000, 1}, { 7050000, 1}, { 7100000, 1}, { 7150000, 1}, { 7200000, 1} },
@@ -102,7 +104,7 @@ struct kvfo band_mem[2][NBANDS][5] = { {
/* 10M */ { {28000000, 2}, {28300000, 2}, {28500000, 2}, {29000000, 4}, {29300000, 4} },
/* 6M */ { {50000000, 2}, {50125000, 2}, {50200000, 2}, {51000000, 4}, {52000000, 4} },
/* GENE */ { { 135700, 3}, { 472000, 3}, { 1000000, 5}, { 5305500, 2}, { 5403500, 2} }
-#else // MODEL==E
+#else // TYPE==E
/* 160M */ { { 1830000, 3}, { 1840000, 3}, { 1850000, 3}, { 1810000, 3}, { 1820000, 3} },
/* 80M */ { { 3500000, 1}, { 3550000, 1}, { 3600000, 1}, { 3650000, 1}, { 3700000, 1} },
/* 40M */ { { 7000000, 1}, { 7050000, 1}, { 7100000, 1}, { 7150000, 1}, { 7200000, 1} },
@@ -125,7 +127,7 @@ struct band_def {
int high;
};
const struct band_def band_limits[NBANDS] = {
-#if MODEL == K
+#if TYPE == K
{ 1800000, 2000000}, { 3500000, 4000000}, { 7000000, 7300000},
{10100000, 10150000}, {14000000, 14350000}, {18068000, 18168000},
{21000000, 21450000}, {24890000, 24990000}, {28000000, 29700000},
@@ -253,7 +255,7 @@ int main(int argc, char *argv[])
"%1X" // P9 Operating mode (See OM command)
"0" // P10 Function?
"0" // P11 Scan status?
- "%1d" // P12 Simplex/Split
+ "%1d" // P12 Simplex=0/Split=1
"0" // P13 Tone/CTCSS (not on TS-890S)
"00" // P14 Tone/CTCSS freq (not on TS-890S)
"0;"; // P15 Always zero
@@ -324,27 +326,31 @@ int main(int argc, char *argv[])
if (buf[5] != '9') antout = buf[5];
}
}
- else if (strcmp(buf, "NB1;") == 0)
- {
- hl_usleep(mysleep * 20);
- sprintf(buf, "NB1%d;", nb1);
- OUTPUT(buf);
- }
- else if (strncmp(buf, "NB1", 3) == 0)
- {
- puts(buf);
- sscanf(buf, "NB1%d", &nb1);
- }
- else if (strcmp(buf, "NB2;") == 0)
- {
- hl_usleep(mysleep * 20);
- sprintf(buf, "NB2%d;", nb2);
- OUTPUT(buf);
- }
- else if (strncmp(buf, "NB2", 3) == 0)
- {
- puts(buf);
- sscanf(buf, "NB2%d", &nb2);
+ else if (strncmp(buf, "NB", 2) == 0)
+ { // Noise Blanker settings
+ int idx;
+ switch (toupper(buf[2])) {
+ case '1': // Noise Blanker 1
+ case '2': // Noise Blanker 2
+ idx = buf[2] - '1';
+ if (buf[3] == ';')
+ { // Read
+ hl_usleep(mysleep * 20);
+ sprintf(buf, "NB%d%d;", idx + 1, nb[idx]);
+ OUTPUT(buf);
+ }
+ else
+ { // Set
+ nb[idx] = buf[3] - '0';
+ }
+ break;
+ case 'D': // Noise Blanker 2, type B Depth
+ case 'T': // Noise Blanker 2 Type
+ case 'W': // Noise Blanker 2, type B Width
+ break;
+ default:
+ cmd_err = 1;
+ }
}
else if (strcmp(buf, "RA;") == 0)
{
@@ -756,13 +762,14 @@ int main(int argc, char *argv[])
{ // VFO A to VFO B Copy ([A=B] Operation)
/* Akin to the EC command above, this isn't really a "VFO A to VFO B"
* copy, but an "Operational VFO to Secondary VFO" copy. It also
- * mimics the front panel [A=B] button.
+ * mimics the front panel [A=B] action.
*/
kvfop_t ovfo, svfo;
ovfo = *vfoLR[0];
svfo = newvfo(*vfoLR[1], ovfo->band); // Get appropriate vfo for new freq
svfo->freq = ovfo->freq;
svfo->mode = ovfo->mode;
+ *vfoLR[1] = svfo;
}
else if (strncmp(buf, "KS;", 3) == 0)
{
@@ -804,7 +811,7 @@ int main(int argc, char *argv[])
}
}
else if (strncmp(buf, "RM", 2) == 0)
- { // Meter control/readout
+ { // Meter
if (buf[2] == ';')
{ // Read all enabled meters
char tbuf[8];
commit eead7a572ab579b68ef884d37fb870056cfa0e3b
Author: George Baltz N3GB <Geo...@gm...>
Date: Thu Oct 24 16:20:35 2024 -0400
Correct some split problems and connect VFO ops
Fix SP command to match real rig. Still needs work.
Add split status to IF response.
Add EC and VV commands, and explain that they are not what they're
described to be.
diff --git a/simulators/simts890.c b/simulators/simts890.c
index df8652f0c..e1a2545dc 100644
--- a/simulators/simts890.c
+++ b/simulators/simts890.c
@@ -35,7 +35,6 @@ int mysleep = 20;
int filternum1 = 7;
int filternum2 = 8;
int vfo_rx, vfo_tx, ptt, ptt_data, ptt_mic, ptt_tune;
-int split = 0;
int keyspd = 20;
int sl=3, sh=3;
int nr=0;
@@ -52,7 +51,8 @@ int mg=0;
int ra=0;
int rl=0;
int is=0;
-int sp=0;
+int sp=0; // Split OFF/ON
+int split_op = 0; // Split frequency setting operation in progress
// Clock data
int autoset = 1;
int tzs[2] = {36, 56}; // 0=primary(EST), 1=auxiliary(UTC)
@@ -103,7 +103,7 @@ struct kvfo band_mem[2][NBANDS][5] = { {
/* 6M */ { {50000000, 2}, {50125000, 2}, {50200000, 2}, {51000000, 4}, {52000000, 4} },
/* GENE */ { { 135700, 3}, { 472000, 3}, { 1000000, 5}, { 5305500, 2}, { 5403500, 2} }
#else // MODEL==E
- /* 160M */ { { 1830000, 3}, { 1840000, 3}, { 1850000, 3}, { 1820000, 3}, { 1820000, 3} },
+ /* 160M */ { { 1830000, 3}, { 1840000, 3}, { 1850000, 3}, { 1810000, 3}, { 1820000, 3} },
/* 80M */ { { 3500000, 1}, { 3550000, 1}, { 3600000, 1}, { 3650000, 1}, { 3700000, 1} },
/* 40M */ { { 7000000, 1}, { 7050000, 1}, { 7100000, 1}, { 7150000, 1}, { 7200000, 1} },
/* 30M */ { {10100000, 3}, {10110000, 3}, {10120000, 3}, {10130000, 3}, {10140000, 3} },
@@ -124,7 +124,7 @@ struct band_def {
int low;
int high;
};
-struct band_def band_limits[NBANDS] = {
+const struct band_def band_limits[NBANDS] = {
#if MODEL == K
{ 1800000, 2000000}, { 3500000, 4000000}, { 7000000, 7300000},
{10100000, 10150000}, {14000000, 14350000}, {18068000, 18168000},
@@ -144,8 +144,8 @@ struct band_def band_limits[NBANDS] = {
* 2 = FM
* 3 = AM
*/
-int mode2classtab[16] = { -1, 0, 0, 1, 2, 3, 1, 1, -1, 1, 1, 1, 0, 0, 2, 3};
-int stepvalues[4][10] = { // Step sizes in Hz
+const int mode2classtab[16] = { -1, 0, 0, 1, 2, 3, 1, 1, -1, 1, 1, 1, 0, 0, 2, 3};
+const int stepvalues[4][10] = { // Step sizes in Hz
/* SSB */ { 500, 1000, 2500, 5000, 10000, 0, 0, 0, 0, 0},
/* CW/FSK/PSK */ { 500, 1000, 2500, 5000, 10000, 0, 0, 0, 0, 0},
/* FM */ { 5000, 6250, 10000, 12500, 15000, 20000, 25000, 30000, 50000, 100000},
@@ -156,6 +156,7 @@ int stepsize[4] = { 1000, 500, 10000, 5000}; // Defaults by modeclass
/* Function prototypes */
int freq2band(int freq);
kvfop_t newvfo(kvfop_t ovfo, int band);
+void swapvfos(kvfop_t *vfoset[]);
// Extracted from rig.h
int hl_usleep(unsigned long usec); // Until it's replaced
@@ -252,7 +253,7 @@ int main(int argc, char *argv[])
"%1X" // P9 Operating mode (See OM command)
"0" // P10 Function?
"0" // P11 Scan status?
- "0" // P12 Simplex/Split
+ "%1d" // P12 Simplex/Split
"0" // P13 Tone/CTCSS (not on TS-890S)
"00" // P14 Tone/CTCSS freq (not on TS-890S)
"0;"; // P15 Always zero
@@ -299,7 +300,7 @@ int main(int argc, char *argv[])
char ifbuf[256];
hl_usleep(mysleep * 1000);
sprintf(ifbuf, IFformat, (*vfoLR[0])->freq,
- (ptt + ptt_mic + ptt_data + ptt_tune) > 0 ? 1 : 0, (*vfoLR[0])->mode);
+ (ptt + ptt_mic + ptt_data + ptt_tune) > 0 ? 1 : 0, (*vfoLR[0])->mode, sp);
OUTPUT(ifbuf);
}
else if (strncmp(buf, "AN", 2) == 0)
@@ -547,7 +548,7 @@ int main(int argc, char *argv[])
sscanf(buf, "FT%d", &vfo_tx);
if (vfo_tx != vfo_rx)
{
- split = 1;
+ sp = 1;
}
}
else if (buf[0] == 'B' && (buf[1] == 'D' || buf[1] == 'U')) // BU/BD
@@ -659,14 +660,68 @@ int main(int argc, char *argv[])
break;
}
}
+ else if (strncmp(buf, "SP", 2) == 0)
+ { // Split Operation Frequency Setting
+ if (buf[2] == ';')
+ { // Read
+ snprintf(buf + 2, sizeof(buf) -2, "%1d;", split_op);
+ OUTPUT(buf);
+ }
+ else if (buf[3] == ';')
+ { // Set 1
+ /* This section needs a lot of work, and a lot
+ * of cooperation from other commands.
+ * AFAICT the split freq can be set by spinning
+ * the big knob, or by other means. When oper=1
+ * is sent, the current freq is used as the split
+ * value. See page 5-1 of the IM, blinking SPLIT
+ */
+ switch (buf[2]) {
+ case '0':
+ // Operation complete
+ if (split_op) // If a split setup was in progress,
+ {
+ sp = 1; // split operation is enabled
+ }
+ //TODO: Set split freq VFO
+ split_op = 0;
+ break;
+ case '1':
+ // Start split frequency setup
+ split_op = 1;
+ break;
+ case '2':
+ // Cancel op
+ split_op = 0;
+ break;
+ default:
+ cmd_err = 1;
+ }
+ }
+ else
+ { // Set 2
+ int dir, split, spfreq, band;
+ kvfop_t ovfo, svfo;
+ sscanf(buf, "SP%1d%1d%1d", &sp, &dir, &split);
+ dir = dir == 0 ? +1 : -1;
+ split = dir * 1000 * split; // Convert kHz to +/- Hz
+ ovfo = *vfoLR[0]; // Operational VFO
+ spfreq = ovfo->freq + split;
+ band = freq2band(spfreq);
+ svfo = newvfo(*vfoLR[1], band); // Other VFO
+ svfo->freq = spfreq;
+ *vfoLR[1] = svfo;
+ sp = 1; // Turn On Split
+ }
+ }
else if (strncmp(buf, "TB;", 3) == 0)
{ // Split
- sprintf(buf, "TB%d;", split);
+ sprintf(buf, "TB%d;", sp);
OUTPUT(buf);
}
else if (strncmp(buf, "TB", 2) == 0)
{
- sscanf(buf, "TB%d", &split);
+ sscanf(buf, "TB%d", &sp);
}
else if (strncmp(buf, "TS", 2) == 0)
{ // TF-SET
@@ -677,6 +732,10 @@ int main(int argc, char *argv[])
}
else if (buf[2] >= '0' && buf[2] < '2')
{
+ if (sp && (tfset != buf[2] - '0'))
+ { // Split is set and we're changing state of TF-SET
+ swapvfos(vfoLR); // Reverse vfo functions
+ }
tfset = buf[2] - '0';
}
else
@@ -684,6 +743,27 @@ int main(int argc, char *argv[])
cmd_err = 1;
}
}
+ else if (strcmp(buf, "EC;") == 0)
+ { // VFO A and VFO B Frequency Information Exchange
+ /* No matter what the title says above, the TS-890S does not
+ * have a frequency swap command. It does, however, have a VFO
+ * function exchange - just by swapping the left and right displays.
+ * This command is the same as the "A/B" button on the front panel.
+ */
+ swapvfos(vfoLR);
+ }
+ else if (strcmp(buf, "VV;") == 0)
+ { // VFO A to VFO B Copy ([A=B] Operation)
+ /* Akin to the EC command above, this isn't really a "VFO A to VFO B"
+ * copy, but an "Operational VFO to Secondary VFO" copy. It also
+ * mimics the front panel [A=B] button.
+ */
+ kvfop_t ovfo, svfo;
+ ovfo = *vfoLR[0];
+ svfo = newvfo(*vfoLR[1], ovfo->band); // Get appropriate vfo for new freq
+ svfo->freq = ovfo->freq;
+ svfo->mode = ovfo->mode;
+ }
else if (strncmp(buf, "KS;", 3) == 0)
{
sprintf(buf, "KS%03d;", keyspd);
@@ -694,7 +774,7 @@ int main(int argc, char *argv[])
sscanf(buf, "KS%03d", &keyspd);
}
else if (strncmp(buf, "OM", 2) == 0)
- {
+ { // Operating Mode
/* The TS-890S displays two frequencies and modes - left and right,
* along with arrows that show which is VFO A and which is VFO B.
* In almost all cases, the left VFO is the receive freq. The right
@@ -719,7 +799,7 @@ int main(int argc, char *argv[])
* which is always the left VFO unless split is active and
* we are transmitting.
*/
- int idx = split && ((ptt + ptt_mic + ptt_data + ptt_tune) > 0);
+ int idx = sp && ((ptt + ptt_mic + ptt_data + ptt_tune) > 0);
sscanf(&buf[3], "%1X", &(*vfoLR[idx])->mode);
}
}
@@ -870,15 +950,6 @@ int main(int argc, char *argv[])
puts(buf);
sscanf(buf,"RL1%d", &rl);
}
- else if (strcmp(buf, "SP;") == 0)
- {
- sprintf(buf,"SP%d;", sp);
- OUTPUT(buf);
- }
- else if (strncmp(buf, "SP", 2) == 0)
- {
- sscanf(buf,"SP%d", &sp);
- }
else if (strncmp(buf, "CK", 2) == 0)
{ // All the clock functions
switch (buf[2]) {
@@ -989,6 +1060,20 @@ int main(int argc, char *argv[])
cmd_err = 1;
}
}
+ else if (strncmp(buf, "CD", 2) == 0)
+ { // CW Communications
+ switch (buf[2]) {
+ case '0': // CW Communication Screen Display
+ case '1': // CW Morse Decoding Threshold Level
+ case '2': // Decoded CW Morse Character Output
+ case '3': // CW Communication Screen (Decode Filter)
+ case '4': // CW Communication Screen (Quick Mode)
+ case '5': // CW Decode
+ break;
+ default:
+ cmd_err = 1;
+ }
+ }
else if (strncmp(buf, "CM", 2) == 0)
{ // CW Message Memory
switch (buf[2]) {
@@ -1147,3 +1232,17 @@ kvfop_t newvfo(kvfop_t ovfo, int band)
return &band_mem[vfonum][band][slot];
}
+
+/* Reverse the function of vfoA and vfoB
+ * No status returned
+ */
+void swapvfos(kvfop_t *vfoset[])
+{
+ kvfop_t *temp;
+
+ temp = vfoset[0];
+ vfoset[0] = vfoset[1];
+ vfoset[1] = temp;
+
+ return;
+}
commit 671d45f33775851bbcf4bf8bcf951a0be8fee2b2
Author: George Baltz N3GB <Geo...@gm...>
Date: Fri Oct 18 15:50:49 2024 -0400
Add DN/UP, FC, and UD commands to simts890.c
Yet more ways to apply a delta to a VFO
diff --git a/simulators/simts890.c b/simulators/simts890.c
index 295de5fe4..df8652f0c 100644
--- a/simulators/simts890.c
+++ b/simulators/simts890.c
@@ -590,6 +590,56 @@ int main(int argc, char *argv[])
cmd_err = 1;
}
}
+ else if ( (strncmp(buf, "DN", 2) == 0) || (strncmp(buf, "UP", 2) == 0) )
+ { // Microphone UP/DOWN Switch Operation
+ int dir = buf[0] == 'D' ? -1 : +1;
+ int steps = -1;
+ kvfop_t ovfo = *vfoLR[0]; // Modify the current operational VFO
+
+ if (buf[2] == ';')
+ {
+ steps= 1;
+ }
+ else if (buf[4] == ';')
+ {
+ steps = atoi(buf + 2);
+ }
+ if (steps < 0 || steps > 99) {cmd_err = 1; continue;}
+ ovfo->freq += dir * steps * stepsize[mode2classtab[ovfo->mode]];
+ }
+ else if (strncmp(buf, "FC", 2) == 0)
+ { // Change the Frequency (Tuning Control)
+ static const int fc_steps[6] = { 1, 2, 5, 10, 50, 100};
+ int dir = buf[2] == '0' ? +1 : -1;
+ int stepidx = buf[3] - '0';
+ int delta;
+ kvfop_t ovfo = *vfoLR[0];
+
+ if (stepidx < 0 || stepidx > 5) {cmd_err = 1; continue;}
+ delta = dir * fc_steps[stepidx] * stepsize[mode2classtab[ovfo->mode]];
+ //TODO: This really needs a sanity check here
+ ovfo->freq += delta;
+ }
+ else if (strncmp(buf, "UD", 2) == 0)
+ { // VFO Frequency UP/DOWN
+ int idx = buf[2] - '0';
+ int dir = buf[3] == '0' ? +1 : -1;
+ int steps = -1;
+ kvfop_t nvfo;
+
+ if (idx < 0 || idx > 1 || tfset != 0) {cmd_err = 1; continue;}
+ nvfo = *vfoAB[idx];
+ if (buf[4] == ';')
+ {
+ steps = 1;
+ }
+ else if (buf[6] == ';')
+ {
+ steps = atoi(buf + 4);
+ }
+ if (steps < 0 || steps > 99) {cmd_err = 1; continue; }
+ nvfo->freq += dir * steps * stepsize[mode2classtab[nvfo->mode]];
+ }
else if (strcmp(buf, "RX;") == 0)
{ // Receive Function State
ptt = ptt_mic = ptt_data = ptt_tune = 0;
commit 3445d94c8d9bff1f57473d275135b46e744da15c
Author: George Baltz N3GB <Geo...@gm...>
Date: Fri Oct 18 05:04:31 2024 -0400
Implement step sizes for some freq changes
Add a few more placeholders
Disable #include <hamlib/rig.h>; cleanse namespace
Typos and formatting
diff --git a/simulators/simts890.c b/simulators/simts890.c
index a7f7f3e38..295de5fe4 100644
--- a/simulators/simts890.c
+++ b/simulators/simts890.c
@@ -9,6 +9,7 @@ struct ip_mreq
};
#endif
+#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
@@ -17,7 +18,7 @@ struct ip_mreq
#include <errno.h>
#include <ctype.h>
#include <time.h>
-#include <hamlib/rig.h>
+//#include <hamlib/rig.h>
#define BUFSIZE 256
#define NBANDS 11
@@ -132,14 +133,31 @@ struct band_def band_limits[NBANDS] = {
#else
{ 1810000, 2000000}, { 3500000, 3800000}, { 7000000, 7200000},
{10100000, 10150000}, {14000000, 14350000}, {18068000, 18168000},
- {21000000, 21450000}, {24890000, 24990000}, {28000000, 29000000},
+ {21000000, 21450000}, {24890000, 24990000}, {28000000, 29700000},
{50000000, 52000000}, { 30000, 74800000}
#endif
};
+/* Table for mode<->emission class conversion
+ * Claas 0 = SSB
+ * 1 = CW/FSK/PSK
+ * 2 = FM
+ * 3 = AM
+ */
+int mode2classtab[16] = { -1, 0, 0, 1, 2, 3, 1, 1, -1, 1, 1, 1, 0, 0, 2, 3};
+int stepvalues[4][10] = { // Step sizes in Hz
+ /* SSB */ { 500, 1000, 2500, 5000, 10000, 0, 0, 0, 0, 0},
+ /* CW/FSK/PSK */ { 500, 1000, 2500, 5000, 10000, 0, 0, 0, 0, 0},
+ /* FM */ { 5000, 6250, 10000, 12500, 15000, 20000, 25000, 30000, 50000, 100000},
+ /* AM */ { 5000, 6250, 10000, 12500, 15000, 20000, 25000, 30000, 50000, 100000}
+};
+int stepsize[4] = { 1000, 500, 10000, 5000}; // Defaults by modeclass
+
/* Function prototypes */
int freq2band(int freq);
kvfop_t newvfo(kvfop_t ovfo, int band);
+// Extracted from rig.h
+int hl_usleep(unsigned long usec); // Until it's replaced
#if defined(WIN32) || defined(_WIN32)
int openPort(char *comport) // doesn't matter for using pts devices
@@ -414,7 +432,33 @@ int main(int argc, char *argv[])
else
{ cmd_err = 1; }
}
- }
+ }
+ else if (strncmp(buf + 2, "00301", 5) >= 0 && strncmp(buf + 2, "00304", 5) <= 0)
+ { // [SSB|CW/FSK/PSK|FM|AM] Mode Frequency Step Size (Multi/Channel Control)
+ int class = buf[6] - '1';
+ int i, tmpstep = -1;
+ if (buf[7] == ';')
+ { // Read
+ for (i = 0; i < 10 && stepvalues[class][i] != 0; i++)
+ {
+ if (stepsize[class] == stepvalues[class][i])
+ {
+ tmpstep = i;
+ break;
+ }
+ }
+ if (tmpstep < 0) {cmd_err = 3; continue;} // Shouldn't happen
+ snprintf(buf + 7, sizeof(buf) - 7, " %03d;", tmpstep);
+ OUTPUT(buf);
+ }
+ else
+ { // Set
+ tmpstep = atoi(buf + 8);
+ if (tmpstep < 0 || tmpstep > 9 || stepvalues[class][tmpstep] == 0)
+ {cmd_err = 1; continue;}
+ stepsize[class] = stepvalues[class][tmpstep];
+ }
+ }
}
else if (buf[0] == 'F' && (buf[1] == 'A' || buf[1] == 'B')) // FA/FB
{ // VFO {A|B} Frequency
@@ -462,7 +506,7 @@ int main(int argc, char *argv[])
OUTPUT(buf);
}
else if (strncmp(buf, "SF", 2) == 0)
- {
+ { // Sets and Reads the VFO (Frequency and Mode)
int tmpvfo, tmpfreq, tmpmode, newband;
kvfop_t ovfo, nvfo;
@@ -484,18 +528,6 @@ int main(int argc, char *argv[])
*vfoAB[tmpvfo] = nvfo;
printf("modeA=%X, modeB=%X\n", vfoA->mode, vfoB->mode);
}
- else if (strncmp(buf, "FL", 2) == 0)
- {
- switch (buf[2]) {
- case '0': // Select the Receive Filter
- case '1': // Roofing Filter
- case '2': // IF Filter Shape
- case '3': // AF Filter Type
- continue; // For now
- default:
- cmd_err = 1;
- }
- }
else if (strcmp(buf, "FR;") == 0)
{
snprintf(buf, sizeof(buf), "FR%d;", vfo_rx);
@@ -526,13 +558,15 @@ int main(int argc, char *argv[])
if (buf[2] == ';')
{ // Setting 2
- /* The TS-890S doesn't have a real BAND_UP/BAND_DOWN commnd
- * This one just does a simple UP/DOWN. As the manual says, just
- * like pushing the UP/DOWN button on the mic
- */
- newfreq = ovfo->freq + dir * 1000; // Needs to be tracked by mode
- // Checking for band edges needs to go here
- ovfo->freq = newfreq;
+ /* The TS-890S doesn't have a real BAND_UP/BAND_DOWN command
+ * This one just does a simple UP/DOWN. As the manual says, just
+ * like pushing the UP/DOWN button on the mic
+ */
+ int class = mode2classtab[ovfo->mode];
+ if (class < 0 || class > 3) {cmd_err = 3; continue;} // Shouldn't happen
+ newfreq = ovfo->freq + (dir * stepsize[class]);
+ //TODO: Checking for band edges needs to go here
+ ovfo->freq = newfreq;
}
else if (buf[3] == ';')
{ // Read
@@ -795,38 +829,6 @@ int main(int argc, char *argv[])
{
sscanf(buf,"SP%d", &sp);
}
- else if (strncmp(buf, "BS", 2) == 0)
- { // All the Bandscope commands
- switch (toupper(buf[2])) {
- case '0': // Scope Display ON/OFF
- case '1': // Scope Display Type
- case '2': // Bandscpoe Operation Mode
- case '3': // Bandscope Span
- case '4': // Bandscope Span
- case '5': // Bandscope Scope Range (Fixed Mode)
- case '6': // Bandscope Dispaly Pause
- case '7': // Bandscope Marker
- case '8': // Bandscope Attenuator
- case '9': // Bandscope Max Hold
- case 'A': // Bandscope Averaging
- case 'B': // Bandscope Waterfall Display Speed
- case 'C': // Bandscope Reference Level
- case 'D': // Bandscope Waterfall Display Clear
- case 'E': // Bandscope Marker Shift / Marker Center
- case 'G': // Audio Scope Attenuator
- case 'H': // Audio Scope Span
- case 'I': // Oscilloscope Level
- case 'J': // Oscilloscpoe Sweep Time
- case 'K': // Bandscope Shift Position
- case 'L': // Bandscope Receive Circuit State
- case 'M': // Bandscope Scope Range Lower/Upper Frequency Limit
- case 'N': // Audio Scope Display Pause
- case 'O': // Expands Spectrum Analysis Range
- break;
- default: // Unknown
- cmd_err = 1;
- }
- }
else if (strncmp(buf, "CK", 2) == 0)
{ // All the clock functions
switch (buf[2]) {
@@ -904,7 +906,39 @@ int main(int argc, char *argv[])
default:
printf("Bad clock command - %s\n", buf);
}
- }
+ }
+ else if (strncmp(buf, "BS", 2) == 0)
+ { // All the Bandscope commands
+ switch (toupper(buf[2])) {
+ case '0': // Scope Display ON/OFF
+ case '1': // Scope Display Type
+ case '2': // Bandscpoe Operation Mode
+ case '3': // Bandscope Span
+ case '4': // Bandscope Span
+ case '5': // Bandscope Scope Range (Fixed Mode)
+ case '6': // Bandscope Dispaly Pause
+ case '7': // Bandscope Marker
+ case '8': // Bandscope Attenuator
+ case '9': // Bandscope Max Hold
+ case 'A': // Bandscope Averaging
+ case 'B': // Bandscope Waterfall Display Speed
+ case 'C': // Bandscope Reference Level
+ case 'D': // Bandscope Waterfall Display Clear
+ case 'E': // Bandscope Marker Shift / Marker Center
+ case 'G': // Audio Scope Attenuator
+ case 'H': // Audio Scope Span
+ case 'I': // Oscilloscope Level
+ case 'J': // Oscilloscpoe Sweep Time
+ case 'K': // Bandscope Shift Position
+ case 'L': // Bandscope Receive Circuit State
+ case 'M': // Bandscope Scope Range Lower/Upper Frequency Limit
+ case 'N': // Audio Scope Display Pause
+ case 'O': // Expands Spectrum Analysis Range
+ break;
+ default: // Unknown
+ cmd_err = 1;
+ }
+ }
else if (strncmp(buf, "CM", 2) == 0)
{ // CW Message Memory
switch (buf[2]) {
@@ -921,6 +955,57 @@ int main(int argc, char *argv[])
cmd_err = 1; // Unknown command
}
}
+ else if (strncmp(buf, "FL", 2) == 0)
+ {
+ switch (buf[2]) {
+ case '0': // Select the Receive Filter
+ case '1': // Roofing Filter
+ case '2': // IF Filter Shape
+ case '3': // AF Filter Type
+ continue; // For now
+ default:
+ cmd_err = 1;
+ }
+ }
+ else if (strncmp(buf, "FM", 2) == 0)
+ { // Frequency Markers
+ switch (buf[2]) {
+ case '0': // Frequency Marker Function
+ case '1': // Frequency Marker List Regiatration
+ case '2': // Total Number Registered of Frequency Marker List
+ case '3': // Frequency Marker List Readout
+ case '4': // Frequency Marker List Delete
+ break;
+ default:
+ cmd_err = 1;
+ }
+ }
+ else if (strncmp(buf, "IP", 2) == 0)
+ { // Network Config
+ switch (buf[2]) {
+ case '0': // DHCP
+ case '1': // IP Address (Manual Configuration)
+ case '2': // MAC Address
+ break;
+ default:
+ cmd_err = 1;
+ }
+ }
+ else if (strncmp(buf, "LA", 2) == 0)
+ { // Linear Amplifier Configuration
+ switch (buf[2]) {
+ case '0': // Target Band of Linear Amplifier Menu
+ case '1': // Linear Amplifier ON/OFF
+ case '2': // Linear Amplifier Transmission Control
+ case '3': // Linear Amplifier Transmission Delay ON/OFF
+ case '4': // Linear Amplifier Transmission Delay Time
+ case '5': // Linear Amplifier Relay Control
+ case '6': // Linear Amplifier External ALC Voltage
+ break;
+ default:
+ cmd_err = 1;
+ }
+ }
else if (strncmp(buf, "MA", 2) == 0)
{ // Memory Channel Functions
switch (buf[2]) {
@@ -937,6 +1022,21 @@ int main(int argc, char *argv[])
cmd_err = 1;
}
}
+ else if (strncmp(buf, "PB", 2) == 0)
+ { // Voice Messages
+ switch (buf[2]) {
+ case '0': // Voice Message List Display
+ case '1': // Voice Message Playback, etc.
+ case '2': // Voice Message Channel Registration State
+ case '3': // Voice Message Channel Repeat
+ case '4': // Voice Message Channel Name
+ case '5': // Voice Message Recording Sound Source
+ case '6': // Voice Message Recording Total Remaining Time
+ break;
+ default:
+ cmd_err = 1;
+ }
+ }
else if (strncmp(buf, "SC", 2) == 0)
{ // Scan functions
switch (buf[2]) {
commit d209c655b0bb32706d2e1b96907ada54fa3205eb
Author: George Baltz N3GB <Geo...@gm...>
Date: Tue Oct 15 19:32:37 2024 -0400
Change FA/FB/SF to use band memories
Change name of kvfo_t to denote it's a pointer
Add routines to convert freq to band and to get a new band's vfo
diff --git a/simulators/simts890.c b/simulators/simts890.c
index 8fcf91a6a..a7f7f3e38 100644
--- a/simulators/simts890.c
+++ b/simulators/simts890.c
@@ -77,12 +77,13 @@ typedef struct kvfo {
int freq;
int mode;
short band, vfo; // Redundant, but useful for relative movement
-} *kvfo_t;
+} *kvfop_t;
int nummems = 3; // Default - values = 1, 3, 5
int bandslot[2][NBANDS]; // 0-based band memory: ((bandslot[i] + 1) % nummems) (+1 for display)
/* Storage and default data for band memories
+ * vfoA freq and mode initialized here, vfoB and other items set at startup
* 1, 3(default), or 5 memories per band can be used. One is always active on
* each band. Manually they are selected by multiple band button pushes; CAT
* selection is by BD/BU command
@@ -115,6 +116,31 @@ struct kvfo band_mem[2][NBANDS][5] = { {
#endif
} };
+/* Band definitions
+ * differ by model
+ */
+struct band_def {
+ int low;
+ int high;
+};
+struct band_def band_limits[NBANDS] = {
+#if MODEL == K
+ { 1800000, 2000000}, { 3500000, 4000000}, { 7000000, 7300000},
+ {10100000, 10150000}, {14000000, 14350000}, {18068000, 18168000},
+ {21000000, 21450000}, {24890000, 24990000}, {28000000, 29700000},
+ {50000000, 54000000}, { 30000, 60000000}
+#else
+ { 1810000, 2000000}, { 3500000, 3800000}, { 7000000, 7200000},
+ {10100000, 10150000}, {14000000, 14350000}, {18068000, 18168000},
+ {21000000, 21450000}, {24890000, 24990000}, {28000000, 29000000},
+ {50000000, 52000000}, { 30000, 74800000}
+#endif
+};
+
+/* Function prototypes */
+int freq2band(int freq);
+kvfop_t newvfo(kvfop_t ovfo, int band);
+
#if defined(WIN32) || defined(_WIN32)
int openPort(char *comport) // doesn't matter for using pts devices
{
@@ -189,8 +215,8 @@ int main(int argc, char *argv[])
char *err_txt[] = { "?;", "E;", "O;" };
struct kvfo *vfoA = &band_mem[0][4][0], *vfoB = &band_mem[1][6][0];
- const kvfo_t *vfoAB[2] = {&vfoA, &vfoB}; // 0=A, 1=B, fixed
- kvfo_t *vfoLR[2] = {&vfoA, &vfoB}; // 0=Left, 1=Right, can change
+ kvfop_t * const vfoAB[2] = {&vfoA, &vfoB}; // 0=A, 1=B, fixed
+ kvfop_t *vfoLR[2] = {&vfoA, &vfoB}; // 0=Left, 1=Right, can change
/* The IF command is not documented for the TS-890S, and is supposed
* to be supplanted by SF. However, it is still there for legacy S/W.
@@ -400,10 +426,15 @@ int main(int argc, char *argv[])
}
else
{
- int tmpfreq;
+ int tmpfreq, newband;
+ kvfop_t ovfo, nvfo;
sscanf(buf + 2, "%d", &tmpfreq);
- // TODO: Check and decode freq. Check band and set vfo to band mem.
- (*vfoAB[idx])->freq = tmpfreq;
+ newband = freq2band(tmpfreq);
+ if (newband < 0) {cmd_err = 1; continue; }
+ ovfo = *vfoAB[idx];
+ nvfo = newvfo(ovfo, newband);
+ nvfo->freq = tmpfreq;
+ *vfoAB[idx] = nvfo;
}
}
else if (strncmp(buf, "AI;", 3) == 0)
@@ -432,7 +463,8 @@ int main(int argc, char *argv[])
}
else if (strncmp(buf, "SF", 2) == 0)
{
- int tmpvfo, tmpfreq, tmpmode;
+ int tmpvfo, tmpfreq, tmpmode, newband;
+ kvfop_t ovfo, nvfo;
if (sscanf(buf, SFformat, &tmpvfo, &tmpfreq, &tmpmode) != 3 || tmpvfo < 0
|| tmpvfo > 1)
@@ -443,9 +475,13 @@ int main(int argc, char *argv[])
}
//printf("tmpvfo=%d, tmpfreq=%d, tmpmode=%d\n", tmpvfo, tmpfreq, tmpmode);
- (*vfoAB[tmpvfo])->mode = tmpmode;
- (*vfoAB[tmpvfo])->freq = tmpfreq;
-
+ ovfo = *vfoAB[tmpvfo];
+ newband = freq2band(tmpfreq);
+ if (newband < 0) {cmd_err = 1; continue; }
+ nvfo = newvfo(ovfo, newband);
+ nvfo->mode = tmpmode;
+ nvfo->freq = tmpfreq;
+ *vfoAB[tmpvfo] = nvfo;
printf("modeA=%X, modeB=%X\n", vfoA->mode, vfoB->mode);
}
else if (strncmp(buf, "FL", 2) == 0)
@@ -484,9 +520,9 @@ int main(int argc, char *argv[])
}
else if (buf[0] == 'B' && (buf[1] == 'D' || buf[1] == 'U')) // BU/BD
{ // Frequency Band Selection(Setting 1)/[UP}/{DOWN] Operating(Setting 2)
- int band, cycle, idx, newfreq;
+ int band, idx, newfreq;
int dir = buf[1] == 'D' ? -1 : +1;
- kvfo_t ovfo = *vfoLR[0]; // Current operating VFO
+ kvfop_t ovfo = *vfoLR[0]; // Current operating VFO
if (buf[2] == ';')
{ // Setting 2
@@ -500,20 +536,20 @@ int main(int argc, char *argv[])
}
else if (buf[3] == ';')
{ // Read
- idx = buf[2] - '0';
- if (idx < 0 || idx > 1) {cmd_err = 1; continue;}
- snprintf(buf + 3, sizeof(buf) - 3, "%d;", bandslot[idx][ovfo->band]);
- OUTPUT(buf);
+ idx = buf[2] - '0';
+ if (idx < 0 || idx > 1) {cmd_err = 1; continue;}
+ snprintf(buf + 3, sizeof(buf) - 3, "%d;", bandslot[idx][ovfo->band] + 1);
+ OUTPUT(buf);
}
else if (buf[5] == ';')
{ // Setting 1
- band = atoi(buf + 3);
- if (band < 0 || band >= NBANDS) {cmd_err = 1; continue;}
- if (band == ovfo->band)
- { // Same band, just cycle the band memory #
+ band = atoi(buf + 3);
+ if (band < 0 || band >= NBANDS) {cmd_err = 1; continue;}
+ if (band == ovfo->band)
+ { // Same band, cycle the band memory #
bandslot[ovfo->vfo][band] = (bandslot[ovfo->vfo][band] + 1) % nummems;
}
- *(vfoLR[0]) = &band_mem[ovfo->vfo][band][bandslot[ovfo->vfo][band]];
+ *vfoLR[0] = newvfo(ovfo, band);
}
else
{
@@ -922,3 +958,42 @@ int main(int argc, char *argv[])
return 0;
}
+
+/* Convert freq to TS-890S band #
+ *
+ * Input freq in Hz
+ *
+ * Returns band # or negative if invalid input
+ */
+int freq2band(int freq)
+{
+ int i, retval = -1; // Assume the worst
+
+ for ( i = 0; i < NBANDS; i++ )
+ {
+ if ( freq >= band_limits[i].low && freq <= band_limits[i].high )
+ {
+ retval = i;
+ break;
+ }
+ }
+ //printf("%dHz is in band # %d\n", freq, retval);
+
+ return retval;
+}
+
+/* Get appropriate vfo for new frequency
+ *
+ * Input: current vfo
+ * new band
+ * Return: new vfo pointer
+ */
+kvfop_t newvfo(kvfop_t ovfo, int band)
+{
+ int vfonum, slot;
+
+ vfonum = ovfo->vfo;
+ slot = bandslot[vfonum][band];
+
+ return &band_mem[vfonum][band][slot];
+}
commit 8bbf60d5c87f556a2093b7088b5cc14203c292e0
Author: George Baltz N3GB <Geo...@gm...>
Date: Fri Oct 11 16:12:50 2024 -0400
More VFOs as objects.
Add band memory objects.
Use them to implement BD/BU.
Default to Model K; E as compile time option
Would have been easier as real OOP objects; C syntax is clunky, and the
parentheses look weird. Oh well.
Still TODO: tie all the other frequency settings into band memories. May
need some storage rearrangement to make functions cleaner.
diff --git a/simulators/simts890.c b/simulators/simts890.c
index f827f14c0..8fcf91a6a 100644
--- a/simulators/simts890.c
+++ b/simulators/simts890.c
@@ -20,7 +20,9 @@ struct ip_mreq
#include <hamlib/rig.h>
#define BUFSIZE 256
-
+#define NBANDS 11
+/* Model we're emulating - K=The Americas, E=Europe */
+#define MODEL K
/* Define a macro for sending response back to the app
* This will allow us to reroute output to a buffering routine
* Needed to handle multiple commands in a single message
@@ -31,9 +33,7 @@ int mysleep = 20;
int filternum1 = 7;
int filternum2 = 8;
-int datamode = 0;
int vfo_rx, vfo_tx, ptt, ptt_data, ptt_mic, ptt_tune;
-int operatingband;
int split = 0;
int keyspd = 20;
int sl=3, sh=3;
@@ -76,11 +76,44 @@ int tfset = 0;
typedef struct kvfo {
int freq;
int mode;
+ short band, vfo; // Redundant, but useful for relative movement
} *kvfo_t;
-struct kvfo temp1 = {14074000, 1};
-struct kvfo temp2 = {14073500, 2};
+int nummems = 3; // Default - values = 1, 3, 5
+int bandslot[2][NBANDS]; // 0-based band memory: ((bandslot[i] + 1) % nummems) (+1 for display)
+/* Storage and default data for band memories
+ * 1, 3(default), or 5 memories per band can be used. One is always active on
+ * each band. Manually they are selected by multiple band button pushes; CAT
+ * selection is by BD/BU command
+ */
+struct kvfo band_mem[2][NBANDS][5] = { {
+#if MODEL==K
+ /* 160M */ { { 1800000, 3}, { 1810000, 3}, { 1820000, 3}, { 1830000, 3}, { 1840000, 3} },
+ /* 80M */ { { 3500000, 1}, { 3600000, 1}, { 3700000, 1}, { 3800000, 1}, { 3900000, 1} },
+ /* 40M */ { { 7000000, 1}, { 7050000, 1}, { 7100000, 1}, { 7150000, 1}, { 7200000, 1} },
+ /* 30M */ { {10100000, 3}, {10110000, 3}, {10120000, 3}, {10130000, 3}, {10140000, 3} },
+ /* 20M */ { {14000000, 2}, {14100000, 2}, {14150000, 2}, {14200000, 2}, {14250000, 2} },
+ /* 17M */ { {18068000, 2}, {18100000, 2}, {18110000, 2}, {18150000, 2}, {18160000, 2} },
+ /* 15M */ { {21000000, 2}, {21100000, 2}, {21150000, 2}, {21200000, 2}, {21300000, 2} },
+ /* 12M */ { {24890000, 2}, {24920000, 2}, {24940000, 2}, {24960000, 2}, {24980000, 2} },
+ /* 10M */ { {28000000, 2}, {28300000, 2}, {28500000, 2}, {29000000, 4}, {29300000, 4} },
+ /* 6M */ { {50000000, 2}, {50125000, 2}, {50200000, 2}, {51000000, 4}, {52000000, 4} },
+ /* GENE */ { { 135700, 3}, { 472000, 3}, { 1000000, 5}, { 5305500, 2}, { 5403500, 2} }
+#else // MODEL==E
+ /* 160M */ { { 1830000, 3}, { 1840000, 3}, { 1850000, 3}, { 1820000, 3}, { 1820000, 3} },
+ /* 80M */ { { 3500000, 1}, { 3550000, 1}, { 3600000, 1}, { 3650000, 1}, { 3700000, 1} },
+ /* 40M */ { { 7000000, 1}, { 7050000, 1}, { 7100000, 1}, { 7150000, 1}, { 7200000, 1} },
+ /* 30M */ { {10100000, 3}, {10110000, 3}, {10120000, 3}, {10130000, 3}, {10140000, 3} },
+ /* 20M */ { {14000000, 2}, {14100000, 2}, {14150000, 2}, {14200000, 2}, {14250000, 2} },
+ /* 17M */ { {18068000, 2}, {18100000, 2}, {18110000, 2}, {18150000, 2}, {18160000, 2} },
+ /* 15M */ { {21000000, 2}, {21100000, 2}, {21150000, 2}, {21200000, 2}, {21300000, 2} },
+ /* 12M */ { {24890000, 2}, {24920000, 2}, {24940000, 2}, {24960000, 2}, {24980000, 2} },
+ /* 10M */ { {28000000, 2}, {28300000, 2}, {28500000, 2}, {29000000, 4}, {29300000, 4} },
+ /* 6M */ { {50000000, 2}, {50125000, 2}, {50200000, 2}, {51000000, 4}, {52000000, 4} },
+ /* GENE */ { {70100000, 2}, { 135700, 3}, { 472000, 5}, { 999000, 5}, { 5258500, 2} }
+#endif
+} };
#if defined(WIN32) || defined(_WIN32)
int openPort(char *comport) // doesn't matter for using pts devices
@@ -155,9 +188,9 @@ int main(int argc, char *argv[])
int cmd_err = 0;
char *err_txt[] = { "?;", "E;", "O;" };
- struct kvfo *vfoA = &temp1, *vfoB = &temp2;
- const kvfo_t vfoAB[2] = {vfoA, vfoB}; // 0=A, 1=B, fixed
- kvfo_t vfoLR[2] = {vfoA, vfoB}; // 0=Left, 1=Right, can change
+ struct kvfo *vfoA = &band_mem[0][4][0], *vfoB = &band_mem[1][6][0];
+ const kvfo_t *vfoAB[2] = {&vfoA, &vfoB}; // 0=A, 1=B, fixed
+ kvfo_t *vfoLR[2] = {&vfoA, &vfoB}; // 0=Left, 1=Right, can change
/* The IF command is not documented for the TS-890S, and is supposed
* to be supplanted by SF. However, it is still there for legacy S/W.
@@ -184,6 +217,17 @@ int main(int argc, char *argv[])
"%011d" // P2 Freq(Hz)
"%1X;"; // P3 Mode
+ /* Initialization */
+ for (int i = 0; i < NBANDS; i++)
+ {
+ for (int j = 0; j < 5; j++)
+ {
+ band_mem[1][i][j] = band_mem[0][i][j];
+ band_mem[1][i][j].vfo = 1;
+ band_mem[0][i][j].band = band_mem[1][i][j].band = i;
+ }
+ }
+
while (1)
{
hl_usleep(10);
@@ -201,15 +245,17 @@ int main(int argc, char *argv[])
// printf("Cmd:\"%s\"\n", buf);
}
-
// else { return 0; }
+ buf[0] = toupper(buf[0]);
+ buf[1] = toupper(buf[1]);
+
if (strcmp(buf, "IF;") == 0)
{
char ifbuf[256];
hl_usleep(mysleep * 1000);
- sprintf(ifbuf, IFformat, vfoLR[0]->freq,
- (ptt + ptt_mic + ptt_data + ptt_tune) > 0 ? 1 : 0, vfoLR[0]->mode);
+ sprintf(ifbuf, IFformat, (*vfoLR[0])->freq,
+ (ptt + ptt_mic + ptt_data + ptt_tune) > 0 ? 1 : 0, (*vfoLR[0])->mode);
OUTPUT(ifbuf);
}
else if (strncmp(buf, "AN", 2) == 0)
@@ -319,32 +365,46 @@ int main(int argc, char *argv[])
snprintf(buf, sizeof(buf), "ID%03d;", id);
OUTPUT(buf);
}
- else if (strcmp(buf, "EX00011;") == 0)
- {
- pbuf = "EX00011 001;";
- OUTPUT(pbuf);
- }
else if (strncmp(buf, "EX", 2) == 0)
- {
- continue;
- }
- else if (strcmp(buf, "FA;") == 0)
- {
- snprintf(buf, sizeof(buf), "FA%011d;", vfoA->freq);
- OUTPUT(buf);
- }
- else if (strcmp(buf, "FB;") == 0)
- {
- snprintf(buf, sizeof(buf), "FB%011d;", vfoB->freq);
- OUTPUT(buf);
- }
- else if (strncmp(buf, "FA", 2) == 0)
- {
- sscanf(buf, "FA%d", &vfoA->freq);
+ { // Menu Setting
+ if (strcmp(buf + 2, "00011;") == 0)
+ { // S-Meter Scale
+ pbuf = "EX00011 001;";
+ OUTPUT(pbuf);
+ }
+ else if (strncmp(buf + 2, "00311", 5) == 0)
+ { // Number of Band Memories
+ if(buf[7] == ';')
+ {
+ snprintf(buf, sizeof buf, "EX00311 %03d;", nummems / 2); // Rounds down
+ OUTPUT(buf);
+ }
+ else
+ {
+ int temp = -1;
+ sscanf(buf + 8, "%3d", &temp);
+ if (temp < 2 && temp >= 0)
+ { nummems = temp * 2 + 1; }
+ else
+ { cmd_err = 1; }
+ }
+ }
}
- else if (strncmp(buf, "FB", 2) == 0)
- {
- sscanf(buf, "FB%d", &vfoB->freq);
+ else if (buf[0] == 'F' && (buf[1] == 'A' || buf[1] == 'B')) // FA/FB
+ { // VFO {A|B} Frequency
+ int idx = buf[1] - 'A';
+ if (buf[2] == ';')
+ {
+ snprintf(buf + 2, sizeof(buf) - 2, "%011d;", (*vfoAB[idx])->freq);
+ OUTPUT(buf);
+ }
+ else
+ {
+ int tmpfreq;
+ sscanf(buf + 2, "%d", &tmpfreq);
+ // TODO: Check and decode freq. Check band and set vfo to band mem.
+ (*vfoAB[idx])->freq = tmpfreq;
+ }
}
else if (strncmp(buf, "AI;", 3) == 0)
{
@@ -366,7 +426,7 @@ int main(int argc, char *argv[])
continue;
}
snprintf(buf, sizeof(buf), SFformat, tmpvfo,
- vfoAB[tmpvfo]->freq, vfoAB[tmpvfo]->mode);
+ (*vfoAB[tmpvfo])->freq, (*vfoAB[tmpvfo])->mode);
//printf("SF buf=%s\n", buf);
OUTPUT(buf);
}
@@ -383,8 +443,8 @@ int main(int argc, char *argv[])
}
//printf("tmpvfo=%d, tmpfreq=%d, tmpmode=%d\n", tmpvfo, tmpfreq, tmpmode);
- vfoAB[tmpvfo]->mode = tmpmode;
- vfoAB[tmpvfo]->freq = tmpfreq;
+ (*vfoAB[tmpvfo])->mode = tmpmode;
+ (*vfoAB[tmpvfo])->freq = tmpfreq;
printf("modeA=%X, modeB=%X\n", vfoA->mode, vfoB->mode);
}
@@ -422,20 +482,50 @@ int main(int argc, char *argv[])
split = 1;
}
}
- else if (strncmp(buf, "BD;", 3) == 0)
- {
- continue;
- }
- else if (strncmp(buf, "BU;", 3) == 0)
- {
- continue;
+ else if (buf[0] == 'B' && (buf[1] == 'D' || buf[1] == 'U')) // BU/BD
+ { // Frequency Band Selection(Setting 1)/[UP}/{DOWN] Operating(Setting 2)
+ int band, cycle, idx, newfreq;
+ int dir = buf[1] == 'D' ? -1 : +1;
+ kvfo_t ovfo = *vfoLR[0]; // Current operating VFO
+
+ if (buf[2] == ';')
+ { // Setting 2
+ /* The TS-890S doesn't have a real BAND_UP/BAND_DOWN commnd
+ * This one just does a simple UP/DOWN. As the manual says, just
+ * like pushing the UP/DOWN button on the mic
+ */
+ newfreq = ovfo->freq + dir * 1000; // Needs to be tracked by mode
+ // Checking for band edges needs to go here
+ ovfo->freq = newfreq;
+ }
+ else if (buf[3] == ';')
+ { // Read
+ idx = buf[2] - '0';
+ if (idx < 0 || idx > 1) {cmd_err = 1; continue;}
+ snprintf(buf + 3, sizeof(buf) - 3, "%d;", bandslot[idx][ovfo->band]);
+ OUTPUT(buf);
+ }
+ else if (buf[5] == ';')
+ { // Setting 1
+ band = atoi(buf + 3);
+ if (band < 0 || band >= NBANDS) {cmd_err = 1; continue;}
+ if (band == ovfo->band)
+ { // Same band, just cycle the band memory #
+ bandslot[ovfo->vfo][band] = (bandslot[ovfo->vfo][band] + 1) % nummems;
+ }
+ *(vfoLR[0]) = &band_mem[ovfo->vfo][band][bandslot[ovfo->vfo][band]];
+ }
+ else
+ {
+ cmd_err = 1;
+ }
}
else if (strcmp(buf, "RX;") == 0)
- {
+ { // Receive Function State
ptt = ptt_mic = ptt_data = ptt_tune = 0;
}
else if (strncmp(buf, "TX", 2) == 0)
- {
+ { // Transmission Mode
ptt = ptt_mic = ptt_data = ptt_tune = 0;
switch (buf[2])
@@ -450,7 +540,7 @@ int main(int argc, char *argv[])
}
}
else if (strncmp(buf, "TB;", 3) == 0)
- {
+ { // Split
sprintf(buf, "TB%d;", split);
OUTPUT(buf);
}
@@ -458,6 +548,22 @@ int main(int argc, char *argv[])
{
sscanf(buf, "TB%d", &split);
}
+ else if (strncmp(buf, "TS", 2) == 0)
+ { // TF-SET
+ if (buf[2] == ';')
+ {
+ snprintf(buf, sizeof buf, "TS%d;", tfset);
+ OUTPUT(buf);
+ }
+ else if (buf[2] >= '0' && buf[2] < '2')
+ {
+ tfset = buf[2] - '0';
+ }
+ else
+ {
+ cmd_err = 1;
+ }
+ }
else if (strncmp(buf, "KS;", 3) == 0)
{
sprintf(buf, "KS%03d;", keyspd);
@@ -483,15 +589,19 @@ int main(int argc, char *argv[])
}
else
{
- sprintf(buf, "OM%d%X;", tmpvfo, vfoLR[tmpvfo]->mode);
+ sprintf(buf, "OM%d%X;", tmpvfo, (*vfoLR[tmpvfo])->mode);
OUTPUT(buf);
}
- continue;
}
+ else
+ {
/* Setting - Only sets the active function(RX/TX),
- * which is always the left VFO.
+ * which is always the left VFO unless split is active and
+ * we are transmitting.
*/
- sscanf(&buf[3], "%1X", &vfoLR[0]->mode);
+ int idx = split && ((ptt + ptt_mic + ptt_data + ptt_tune) > 0);
+ sscanf(&buf[3], "%1X", &(*vfoLR[idx])->mode);
+ }
}
else if (strncmp(buf, "RM", 2) == 0)
{ // Meter control/readout
@@ -793,32 +903,16 @@ int main(int argc, char *argv[])
}
else if (strncmp(buf, "SC", 2) == 0)
{ // Scan functions
- switch (buf[2]) {
- case '0': // Scan
- case '1': // Scan Speed
- case '2': // Tone Scan/CTCSS Scan
- case '3': // Program Scan/VFO Scan Selection
- break;
- default:
- cmd_err = 1;
+ switch (buf[2]) {
+ case '0': // Scan
+ case '1': // Scan Speed
+ case '2': // Tone Scan/CTCSS Scan
+ case '3': // Program Scan/VFO Scan Selection
+ break;
+ default:
+ cmd_err = 1;
}
}
- else if (strncmp(buf, "TS", 2) == 0)
- { // TF-SET
- if (buf[2] == ';')
- {
- snprintf(buf, sizeof buf, "TS%d;", tfset);
- OUTPUT(buf);
- continue;
- }
- int tmpset = buf[2] - '0';
- if (tmpset < 0 || tmpset > 1)
- {
- cmd_err = 1;
- continue;
- }
- tfset = tmpset;
- }
else if (strlen(buf) > 0)
{
fprintf(stderr, "Unknown command: %s\n", buf);
commit 7aa739a97d5b5f3803a0940ac74f6955d77b26ed
Author: George Baltz N3GB <Geo...@gm...>
Date: Tue Oct 8 11:11:03 2024 -0400
Get rid of ghost commands.
They ain't coming back.
diff --git a/simulators/simts890.c b/simulators/simts890.c
index 1ba3769db..f827f14c0 100644
--- a/simulators/simts890.c
+++ b/simulators/simts890.c
@@ -212,19 +212,6 @@ int main(int argc, char *argv[])
(ptt + ptt_mic + ptt_data + ptt_tune) > 0 ? 1 : 0, vfoLR[0]->mode);
OUTPUT(ifbuf);
}
-#if 0
- else if (strncmp(buf, "RM2", 3) == 0)
- {
- pbuf = "RM20020;";
- OUTPUT(pbuf);
- }
- else if (strcmp(buf, "RM5;") == 0)
- {
- hl_usleep(mysleep * 1000);
- pbuf = "RM5100000;";
- OUTPUT(pbuf);
- }
-#endif
else if (strncmp(buf, "AN", 2) == 0)
{ // Antenna connection handling
hl_usleep(mysleep * 1000);
@@ -325,19 +312,6 @@ int main(int argc, char *argv[])
{
sscanf(buf,"PC%d", &pc);
}
-#if 0
- else if (strcmp(buf, "FW1;") == 0)
- {
- //usleep(mysleep * 1000);
- pbuf = "FW10;";
- OUTPUT(pbuf);
- hl_usleep(20 * 1000);
- }
- else if (strncmp(buf, "FW", 2) == 0)
- {
- continue;
- }
-#endif
else if (strcmp(buf, "ID;") == 0)
{
hl_usleep(mysleep * 1000);
@@ -345,18 +319,6 @@ int main(int argc, char *argv[])
snprintf(buf, sizeof(buf), "ID%03d;", id);
OUTPUT(buf);
}
-
-#if 0
- else if (strncmp(buf, "AI", 2) == 0)
- {
- if (strcmp(buf, "AI;"))
- {
- hl_usleep(mysleep * 1000);
- n = fprintf(fp, "%s", "AI0;");
- }
- }
-
-#endif
else if (strcmp(buf, "EX00011;") == 0)
{
pbuf = "EX00011 001;";
@@ -426,18 +388,6 @@ int main(int argc, char *argv[])
printf("modeA=%X, modeB=%X\n", vfoA->mode, vfoB->mode);
}
-#if 0
- else if (strncmp(buf, "MD;", 3) == 0)
- {
- snprintf(buf, sizeof(buf), "MD%d;",
- vfoA->mode); // not worried about modeB yet for simulator
- OUTPUT(buf);
- }
- else if (strncmp(buf, "MD", 2) == 0)
- {
- sscanf(buf, "MD%d", &vfoA->mode); // not worried about modeB yet for simulator
- }
-#endif
else if (strncmp(buf, "FL", 2) == 0)
{
switch (buf[2]) {
@@ -472,17 +422,6 @@ int main(int argc, char *argv[])
split = 1;
}
}
-#if 0
- else if (strncmp(buf, "DA;", 3) == 0)
- {
- snprintf(buf, sizeof(buf), "DA%d;", datamode);
- OUTPUT(buf);
- }
- else if (strncmp(buf, "DA", 2) == 0)
- {
- sscanf(buf, "DA%d", &datamode);
- }
-#endif
else if (strncmp(buf, "BD;", 3) == 0)
{
continue;
@@ -510,18 +449,6 @@ int main(int argc, char *argv[])
break;
}
}
-#if 0
- else if (strncmp(buf, "CB;", 3) == 0)
- {
- printf("No CB command!\n");
- sprintf(buf, "CB%d;", operatingband);
- OUTPUT(buf);
- }
- else if (strncmp(buf, "CB", 2) == 0)
- {
- sscanf(buf, "CB...
[truncated message content] |
|
From: n0nb <n0...@us...> - 2024-10-25 21:19:54
|
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 e3b067307a93bebd3eab6c5d11687f6adc482d27 (commit)
via f9d60d6b25d24b66b37b7c48f1afba548a6dd2c5 (commit)
via 407a1deabe03e6b3fed17c9ba8288deafd839bd2 (commit)
via 9b26eb1684d4be31c71857ae2fcc2d246e680710 (commit)
via 8b0dc0731c34d215d991f1f11b76ee503221ae72 (commit)
via 87531d273dd3902e2130c9a7db64da2dbc518cb1 (commit)
via f6b8bdabe8fe369249b0f22946a3c417f1368056 (commit)
via c02cf9726f5857e74eb4bd0545a881d8ccc8c112 (commit)
via c015c3690b7784cd1a17e624ed2c813f8038dc2c (commit)
via 41eb2b076c370571f9a2c27553aaa45ecc55b034 (commit)
via 327517a881c127ee91d3dbd7882aa65a8fe62085 (commit)
via e096426ddc8210f298571ad943159f2b3844ddef (commit)
via c01e55b09b164587f8b7ddfa8d910f39ec60b0ed (commit)
via 2a7d5387ee1b4e0e8c8ca5d0bb19d76f7a95d335 (commit)
via 882d22a50ca99f4a2600620844ca4ffb216400fc (commit)
via 96fc6855671e046f95da1b9f7b5a765de0b607aa (commit)
via baf2897e76b367325a1a2085df7bf4b0459fd862 (commit)
via ba62edc51b9b2d390b1c051562c34b06dda909bf (commit)
via 53a3d8635373124b9b6b93c141673f2ea1c6c814 (commit)
via e5c8117cea9798174a7bc5464743cba60c8d2b41 (commit)
via 4afe039147ad1633cdaeaa328ad5aec50b279ccb (commit)
via c1130737fa01be6c481145311201db8ce6d2ab09 (commit)
via 6a9cec677af718d97f7f0097524cb235c4e16322 (commit)
via 0548fea7c1340efb1c7667bea834a0c1f164f455 (commit)
via aa9d227d64c1a17af7ad224dd82bba221954accf (commit)
via e55c7dd8404d144c9b5219c07a2d500467710f8c (commit)
via db854ab8e029310471d971990da2eae46f76bc46 (commit)
via 07e490eada0ab711b4b20fb184f2fc2304461be7 (commit)
via f33aa9a712c177bcfaf0e084bdb5ab996afbf2be (commit)
via 141ca8bf3f5ea6b05fa6d1ed204b3369378091a2 (commit)
via 64d39f58efe1601d89fd8067be172fd355b89c64 (commit)
via a6fe6b547539e14e8ecb2a28cce6eb7f2f47b2cd (commit)
via 548745d1f04fa327516ab125c66b1e7049abfdba (commit)
via 7bde413c52a8d3b31e269b3107605eb255a58446 (commit)
via 0b12c5cfff269ecde77c51d5adc107bd1744465f (commit)
via 23e373b99dcff7ddf173cad79aad1a639ed30bc2 (commit)
via f63b60a86644e9d0cf4af1c6c4b5891974a80129 (commit)
via 4613f7d9331686ab5d75a424aebaa05e52b30d32 (commit)
via e24617a4fe22a134701a8c800c8170fa80b72220 (commit)
via 56eda7a76c6fea9504cc70ea895a82b8f2d6699a (commit)
via 96bd1367fb84754c16e7429e16963fe01287555e (commit)
via b0afbd22e6b56893ad86bec181423f26cff4bb32 (commit)
via 55f83b1647aa43fc6cd0a946e57f2fd81287d075 (commit)
via 73cdd0b214f6cb7dd2e2199c0c13a9e26bfeb5be (commit)
via 4efdf1dffdf2053f509eba8138d1f9cdfa4900d0 (commit)
via 4b05884fd7ee40c3a0869b89bed3d40fa3661ffa (commit)
via 88bb2e63c25b931094476cbfa783f47c01a4c193 (commit)
via c4f7cf35f9286acd9eb5405b0b7304452be490a9 (commit)
via c37fb872cdd20cf4af355544aed105f0b9f95d54 (commit)
via 1d45224e8a58ada49f449fd378c7b416162cfd27 (commit)
via 48398dd3d46ed071a52a285797060ad62fbeeecb (commit)
via 5fd100f06e56e62e0b4ee73773a615ac5b914ad1 (commit)
via 31b625df2bed7080ea2faecce0a309f9b176a6b6 (commit)
via 2a47377243cb89ef7607b162b83d3534772f3ca7 (commit)
via 76a1a589c900fe1d7b7e0b3ba7dc3ea6a9c70925 (commit)
via 9236b778ae05b9642b12000c8412c88e0855c9a8 (commit)
via 76c3cd15bb72d6f2b83758b558e5368875baf125 (commit)
via d81726e72452aa6d8150ad6f0468d86070440e51 (commit)
via 496d8fde316c24572576b58bce9fc5bed52fd418 (commit)
via 8a6a500ccdfbc63b98b31b0ebb6d854bcbe0097f (commit)
via fc849732c0c1dfdbccc0d7666f46952eeee4c731 (commit)
via 99d008a664fa2381d12e47741a645350800a1418 (commit)
via 711089f25269e26e23bbe139d8f53fd4c45c6ca5 (commit)
via 2b3000c21de924a5d9ad78586b3d2959a54c07ee (commit)
via c58d46cfbec8982169f3b007f61f23a8b27cc4eb (commit)
via 0eca80281fe8ebf9c2bb9c57608e15fd4bff4ebc (commit)
via e09dd84bc25a1650b32ff1bc7fed26a4d50135f7 (commit)
via b9b4d44f4f9539626119c5c34c9e13b156d2e290 (commit)
via 6d0b4a7fce20eb7d2038e8026e5f82f84c24b3c4 (commit)
via 1ffd767f884327f01a9369a657f174eea3009186 (commit)
via 92a35118cbaa550771d723b431afd846156f1d1a (commit)
via 0f4066bcdfbcad31bad397515f793aca7cf6bdf5 (commit)
via f10ff6a61b3615eba4442db783fc65c9cf8e837d (commit)
via 14615c5bb53a052204856caab03947eeae483135 (commit)
via 276b891fd6c33568650f46c989bf8626675548c1 (commit)
via 3e1df2db19ca0ea641c18aea25d9b3c408f40fc4 (commit)
via 150bfa5a25ee9082843714d50ca32ee3f0b04ab6 (commit)
via 83109ba43874e3532df7a19b6d77f04dbf284315 (commit)
via 5fc4e6753103278d962b084d5ac32eebe21cc9c9 (commit)
via ec7b23b19cb329cb17860778190860fb067f4087 (commit)
via 913c00a707157c198b5d247f7a468dbb923b4ce4 (commit)
via d179eed3e8459d87c0bdb43dbf7602da5737e0b7 (commit)
via 9360ab4e3bf34dfb6edef5a0e8f77f202538db5e (commit)
via ca705649ce0da3271d2e6120b51e11b2586eca2a (commit)
via f4bb956bf90fc22d2bb21cce5dc16ba4a07346b8 (commit)
via 1235945076a9388c24b68921f60eb188805079c6 (commit)
via a9f4a35c7deb7256e366daf00f1b2c69f1ed6fc0 (commit)
via 5f1c2b134818b8a2669e4e01163a64fc82690bb6 (commit)
via 32f5f97a5f7e6a340900dd0328177d5e2fe4e0b4 (commit)
via e50dd7bcde4bbb49b75110bc79da1369955b31ce (commit)
via 19ee9056d9163b793d2c35071232e698090ea07f (commit)
via c1da9b979cb369839c1ca7210c52f9bb83a41b59 (commit)
via 5ea17ccd21e680ddf5e21454e1b8530d2b6ab5af (commit)
via 1f3360e11d6f624483efbe32b6348be1f2b1aa7f (commit)
via f8485ec2dc74789a02e72dc8896162b14510e461 (commit)
via 7d78e8a2842ede00d1bfa62a3b83f79b3f8ba0c4 (commit)
via 49e5ba81b032f4b2748d8a80082e911202fede08 (commit)
via de13630c643276d4f7724daa919583650b03831e (commit)
via 1ff85278640c8f4da639ee2a8640abc1a9d7d386 (commit)
via 5f6554c797cb57d8053f47d4f72a27a570436ead (commit)
via b667e31dcf56fd6a65512eb88e59ef55437c8577 (commit)
via 99535c06822b7b66885e164d327c273fb14fc42a (commit)
via 676c39a9d0d42385d04285474d3a4f24d32ac4b7 (commit)
via 52deeeeebf13c6e10b19f71f19b32f174a349407 (commit)
via 3f40c7b70da224093cb27a17ee81d8e1eaf272bf (commit)
via ed7b65d58c7269ea87cbc0f3d66df3202216a321 (commit)
via 82c03a80fcfd7b82c16fa236370cae59a3349621 (commit)
via fe909084b923ba21317a15c2efb8bbaadf8666ac (commit)
via 86f6339f5ebef581437323edd3be1f61be6bcb40 (commit)
via f3f3cb9977ef3f4ec6a047e33dddb358a1e41e96 (commit)
via 1dd12f0ef071048aa9ae0cba7cdc680cf580c3d7 (commit)
via ba1424ff7d93b2f9960999eb96310a4066547519 (commit)
via ef4d932ffd2ce196b250ceb5fc3b3736b784c285 (commit)
via d0da604d502235318a3ca9c1fa6073e81b5a31e2 (commit)
via f2811b739406af6a20715ade6b26f8ca72705cff (commit)
via be9f3e7a62ca74e175e0185641fa16adc25ac958 (commit)
via ecadc46ca26dcac51ab0f3e50aa9acef9a824a1e (commit)
via 853a0a2822553cb808f43b5600b839afa93d66c4 (commit)
via cb26ccbbc45b611b275758bc69deb2eef6be7c0a (commit)
via 8d52565335784aad266eaec984b41e988a4a8332 (commit)
via 4c3aca9299584349b32a8d8b834805cb9cee8901 (commit)
via ae29c0c66568bcc989884055c0059ba1ae001fa0 (commit)
via fc33324dcc27d3f884307185750566578b0819ea (commit)
via 293f5ec2e5b1d455df9da136a5892b52d30f5740 (commit)
via bdf4baa5b7d7630af8579fc3714f46b26c3dec7c (commit)
via e35b87b11a25fb622c0e2469b81e064d1de66f65 (commit)
via 240407d917ccec87082ec1e5b840c65c770fc528 (commit)
via 0082572cd0f4461cf0f1f58d38a7f60713253839 (commit)
via 23b4e00f0e9e9144339ebae26b0774606c640621 (commit)
via 5d3d35d7bea2920b2a8715bd4cd321caec38be1b (commit)
via fa4926c2d6d01c650346146772ad0a6c9830fe1e (commit)
via 6d76ba4e7ff578edd6b4d0040094887b35bd5bb2 (commit)
via d20a2358606bec98e232be0a7dbbfacafe98b2ab (commit)
via 8fcb77664c15cbc76c3ce9806194d390cf763159 (commit)
via 111a51217d82c0b0a50f6e8c2854b63c02f3d8eb (commit)
via 6cc21cdad3b21e0b8e7f7b72482d58a7dcc4f360 (commit)
via 147fb072f4e78181930e2395c9d323d421654753 (commit)
via c4988900699971be3c7423568ed4533ab2f641d3 (commit)
via 67c62e9b2a5ad1a2743b0dd595da26436f0915b4 (commit)
via 93d12b9c6a1e13bd99954d1d12cd2b113cb19c65 (commit)
via efb3cdc09d4f184d34f1444444d51cf5daa37c61 (commit)
via f64727c1e094a89970e82ff6fea4dbb4e0e6c151 (commit)
via 7e35ffac8d9f0ce63b641ec0e28260f314777389 (commit)
via 940814617baf4a074e4cf00aa708231e6fc8318f (commit)
via 954fd001610556370cec1ffda8e3fd2b7c54cb99 (commit)
via f6c1a1429193dec15ee84e400044287fb3a437bb (commit)
via 25ecaea63a34cb93bd12531181e2b1dfb1f61112 (commit)
via 0dd52cec026b0c2518774723d7056c147a4639ea (commit)
via 3a09649816251a92ffa767486a66d561a4bcaddb (commit)
via 4d1148c1ba52e6401ccdd6b80b173ff766f3341f (commit)
via 099cc7fc489c7fe27ec42d626924f8fa50bb07f6 (commit)
via 846a56a39bfcb94018132da2947eccbb0c4740cd (commit)
from 137231cb7b1bdc9dfe075f4cf4c311a9ebfcc306 (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 e3b067307a93bebd3eab6c5d11687f6adc482d27
Author: Mike Black W9MDB <mdb...@ya...>
Date: Fri Oct 25 12:11:50 2024 -0500
Fix icom width filter using 1,2,3 for all modes
diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c
index 54b7b53de..ce1de5b83 100644
--- a/rigs/icom/icom.c
+++ b/rigs/icom/icom.c
@@ -2428,6 +2428,9 @@ static int icom_set_mode_x26(RIG *rig, vfo_t vfo, rmode_t mode,
rig_debug(RIG_DEBUG_TRACE, "%s: vfo=%s, vfo_number=%d\n", __func__,
rig_strvfo(vfo), vfo_number);
+ // allow width of 1,2,3 to set explicit filter
+ if (width >=1 && width <= 3) buf[2] = width;
+
retval = icom_transaction(rig, C_SEND_SEL_MODE, vfo_number, buf, buf_len, ackbuf,
&ack_len);
diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h
index e41cdbbc2..b5bb5a3d1 100644
--- a/rigs/icom/icom.h
+++ b/rigs/icom/icom.h
@@ -35,7 +35,7 @@
#include <sys/time.h>
#endif
-#define BACKEND_VER "20241020"
+#define BACKEND_VER "20241025"
#define ICOM_IS_ID31 rig_is_model(rig, RIG_MODEL_ID31)
#define ICOM_IS_ID51 rig_is_model(rig, RIG_MODEL_ID51)
commit f9d60d6b25d24b66b37b7c48f1afba548a6dd2c5
Author: Mike Black W9MDB <mdb...@ya...>
Date: Tue Oct 22 10:30:30 2024 -0500
Remove duplicate parm
diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h
index 8a9ac7ad7..60d4da02b 100644
--- a/include/hamlib/rig.h
+++ b/include/hamlib/rig.h
@@ -1182,7 +1182,7 @@ enum multicast_item_e {
//! @cond Doxygen_Suppress
#define RIG_PARM_FLOAT_LIST (RIG_PARM_BACKLIGHT|RIG_PARM_BAT|RIG_PARM_KEYLIGHT|RIG_PARM_BACKLIGHT)
-#define RIG_PARM_STRING_LIST (RIG_PARM_BANDSELECT|RIG_PARM_KEYERTYPE|RIG_PARM_KEYERTYPE)
+#define RIG_PARM_STRING_LIST (RIG_PARM_BANDSELECT|RIG_PARM_KEYERTYPE)
#define RIG_PARM_READONLY_LIST (RIG_PARM_BAT)
#define RIG_PARM_IS_FLOAT(l) ((l)&RIG_PARM_FLOAT_LIST)
commit 407a1deabe03e6b3fed17c9ba8288deafd839bd2
Merge: 9b26eb168 8b0dc0731
Author: Mike Black W9MDB <mdb...@ya...>
Date: Tue Oct 22 09:21:33 2024 -0500
Merge branch 'master' of https://github.com/Hamlib/Hamlib
commit 9b26eb1684d4be31c71857ae2fcc2d246e680710
Author: Mike Black W9MDB <mdb...@ya...>
Date: Tue Oct 22 09:16:38 2024 -0500
Fix power_minmax for kenwood
https://github.com/Hamlib/Hamlib/issues/1622
diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c
index ad262512b..9922b8930 100644
--- a/rigs/kenwood/kenwood.c
+++ b/rigs/kenwood/kenwood.c
@@ -3037,11 +3037,11 @@ static int kenwood_get_power_minmax(RIG *rig, int *power_now, int *power_min,
rs->power_min = 5;
rs->power_max = 100;
if (power_min) *power_min = 5;
- if (power_max) *power_max = 5;
+ if (power_max) *power_max = 100;
- if (rs->current_mode == RIG_MODE_AM) { *power_max = 50; }
+ if (rs->current_mode == RIG_MODE_AM) { *power_max = 25; }
- if (rs->current_freq >= 70)
+ if (rs->current_freq >= 70000000)
{
rs->power_max = 50;
commit 8b0dc0731c34d215d991f1f11b76ee503221ae72
Author: Mike Black W9MDB <mdb...@ya...>
Date: Tue Oct 22 09:16:38 2024 -0500
Fix power_minmax for kenwood
diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c
index ad262512b..9922b8930 100644
--- a/rigs/kenwood/kenwood.c
+++ b/rigs/kenwood/kenwood.c
@@ -3037,11 +3037,11 @@ static int kenwood_get_power_minmax(RIG *rig, int *power_now, int *power_min,
rs->power_min = 5;
rs->power_max = 100;
if (power_min) *power_min = 5;
- if (power_max) *power_max = 5;
+ if (power_max) *power_max = 100;
- if (rs->current_mode == RIG_MODE_AM) { *power_max = 50; }
+ if (rs->current_mode == RIG_MODE_AM) { *power_max = 25; }
- if (rs->current_freq >= 70)
+ if (rs->current_freq >= 70000000)
{
rs->power_max = 50;
commit 87531d273dd3902e2130c9a7db64da2dbc518cb1
Author: Mike Black W9MDB <mdb...@ya...>
Date: Mon Oct 21 22:31:42 2024 -0500
Fix KEYERTYPE
diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h
index bbe579bc2..8a9ac7ad7 100644
--- a/include/hamlib/rig.h
+++ b/include/hamlib/rig.h
@@ -1152,7 +1152,8 @@ enum rig_parm_e {
enum rig_keyertype_e {
RIG_KEYERTYPE_STRAIGHT = 0,
RIG_KEYERTYPE_BUG = (1 << 0),
- RIG_KEYERTYPE_PADDLE = (2 << 0)
+ RIG_KEYERTYPE_PADDLE = (1 << 1),
+ RIG_KEYERTYPE_UNKNOWN = (1 << 2)
};
/**
@@ -1181,7 +1182,7 @@ enum multicast_item_e {
//! @cond Doxygen_Suppress
#define RIG_PARM_FLOAT_LIST (RIG_PARM_BACKLIGHT|RIG_PARM_BAT|RIG_PARM_KEYLIGHT|RIG_PARM_BACKLIGHT)
-#define RIG_PARM_STRING_LIST (RIG_PARM_BANDSELECT|RIG_PARM_KEYERTYPE)
+#define RIG_PARM_STRING_LIST (RIG_PARM_BANDSELECT|RIG_PARM_KEYERTYPE|RIG_PARM_KEYERTYPE)
#define RIG_PARM_READONLY_LIST (RIG_PARM_BAT)
#define RIG_PARM_IS_FLOAT(l) ((l)&RIG_PARM_FLOAT_LIST)
diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c
index 5be851fb6..4c6020baf 100644
--- a/tests/rigctl_parse.c
+++ b/tests/rigctl_parse.c
@@ -3745,11 +3745,13 @@ declare_proto_rig(set_parm)
break;
case RIG_CONF_STRING:
+#if 0
if (parm == RIG_PARM_KEYERTYPE)
{
val.i = atoi(arg2);
}
else
+#endif
{
val.cs = arg2;
}
commit f6b8bdabe8fe369249b0f22946a3c417f1368056
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sun Oct 20 11:28:44 2024 -0500
Allow 1,2,3 width usage for all modes in icom.c
diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c
index 9050a9214..54b7b53de 100644
--- a/rigs/icom/icom.c
+++ b/rigs/icom/icom.c
@@ -2586,6 +2586,8 @@ int icom_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
if (priv_caps->mode_with_filter)
{
HAMLIB_TRACE;
+ // allow 1,2,3 values to set filter number
+ if (width >= 1 && width <= 3) datamode[1] = width;
if (datamode[0] == 0) { datamode[1] = 0; } // the only good combo possible according to manual
@@ -2593,7 +2595,7 @@ int icom_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
if((priv_caps->fm_filters[0] != 0) && (mode == RIG_MODE_FM || mode == RIG_MODE_WFM))
{
// assumed fm_filters is ascending sequence -- see ic7300.c for example
- if (width <= 3) datamode[1] = width;
+ if (width >= 1 && width <= 3) datamode[1] = width;
else if (width <= priv_caps->fm_filters[0]) datamode[1] = 3;
else if (width <= priv_caps->fm_filters[1]) datamode[1] = 2;
else datamode[1] = 1;
diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h
index 8da32718e..e41cdbbc2 100644
--- a/rigs/icom/icom.h
+++ b/rigs/icom/icom.h
@@ -35,7 +35,7 @@
#include <sys/time.h>
#endif
-#define BACKEND_VER "20241018"
+#define BACKEND_VER "20241020"
#define ICOM_IS_ID31 rig_is_model(rig, RIG_MODEL_ID31)
#define ICOM_IS_ID51 rig_is_model(rig, RIG_MODEL_ID51)
commit c02cf9726f5857e74eb4bd0545a881d8ccc8c112
Author: Mike Black W9MDB <mdb...@ya...>
Date: Fri Oct 18 09:30:19 2024 -0500
Fix compile warning on icom.c fm_filters
diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c
index 95ed7a186..9050a9214 100644
--- a/rigs/icom/icom.c
+++ b/rigs/icom/icom.c
@@ -2590,7 +2590,7 @@ int icom_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
if (datamode[0] == 0) { datamode[1] = 0; } // the only good combo possible according to manual
// we need to let FM mode widths through here with datamode[1] set to FM width
- if((priv_caps->fm_filters != NULL) && (mode == RIG_MODE_FM || mode == RIG_MODE_WFM))
+ if((priv_caps->fm_filters[0] != 0) && (mode == RIG_MODE_FM || mode == RIG_MODE_WFM))
{
// assumed fm_filters is ascending sequence -- see ic7300.c for example
if (width <= 3) datamode[1] = width;
diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h
index bcc9a05a5..8da32718e 100644
--- a/rigs/icom/icom.h
+++ b/rigs/icom/icom.h
@@ -35,7 +35,7 @@
#include <sys/time.h>
#endif
-#define BACKEND_VER "20241009"
+#define BACKEND_VER "20241018"
#define ICOM_IS_ID31 rig_is_model(rig, RIG_MODEL_ID31)
#define ICOM_IS_ID51 rig_is_model(rig, RIG_MODEL_ID51)
commit c015c3690b7784cd1a17e624ed2c813f8038dc2c
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sun Oct 13 16:11:25 2024 -0500
Update rigctl.1 for IC7300 filter 1,2,3 usage
diff --git a/doc/man1/rigctl.1 b/doc/man1/rigctl.1
index d79f55f95..866fa3b76 100644
--- a/doc/man1/rigctl.1
+++ b/doc/man1/rigctl.1
@@ -494,6 +494,7 @@ Mode is a token: \(oqUSB\(cq, \(oqLSB\(cq, \(oqCW\(cq, \(oqCWR\(cq,
\(oqDSB\(cq.
.IP
Passband is in Hz as an integer, -1 for no change, or \(oq0\(cq for the radio backend default.
+IC7300 can use 1,2,3 to select which filter to use
.IP
.BR Note :
Passing a \(oq?\(cq (query) as the first argument instead of a Mode token will
commit 41eb2b076c370571f9a2c27553aaa45ecc55b034
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sun Oct 13 16:10:00 2024 -0500
Fix IC7300 set mode FM
Allow IC7300 to use width of 1,2,3 to select filter
diff --git a/NEWS b/NEWS
index 52398b117..32e029f7b 100644
--- a/NEWS
+++ b/NEWS
@@ -13,6 +13,7 @@ Version 5.x -- future
* Change FT1000MP Mark V model names to align with FT1000MP
Version 4.6
+ * IC7300 Mode filter can now be set by # (i.e. 1,2,3)
* Fixed AF6SA WRC rotor controller
* Added Rhode&Schwarz XK852
* Added Xiegu X6200
diff --git a/rigs/icom/ic7300.c b/rigs/icom/ic7300.c
index 2bce4bebb..7cd2e9373 100644
--- a/rigs/icom/ic7300.c
+++ b/rigs/icom/ic7300.c
@@ -67,7 +67,7 @@ int ic9700_set_vfo(RIG *rig, vfo_t vfo);
#define IC7300_PARMS (RIG_PARM_ANN|RIG_PARM_BACKLIGHT|RIG_PARM_SCREENSAVER|RIG_PARM_TIME|RIG_PARM_BEEP|RIG_PARM_KEYERTYPE|RIG_PARM_AFIF)
#define IC7300_VFO_OPS (RIG_OP_CPY|RIG_OP_XCHG|RIG_OP_FROM_VFO|RIG_OP_TO_VFO|RIG_OP_MCL|RIG_OP_TUNE)
-#define IC7300_SCAN_OPS (RIG_SCAN_STOP|RIG_SCAN_MEM|RIG_SCAN_PROG|RIG_SCAN_SLCT)
+#define IC7300_SCAN_OPS (RIG_SCAN_STOP|RIG_SCAN_MEM|RIG_SCAN_PROG|RIG_SCAN_SLCT|RIG_SCAN_VFO)
#define IC7300_ANTS (RIG_ANT_1) /* ant-1 is Hf-6m */
@@ -419,7 +419,8 @@ static const struct icom_priv_caps IC7300_priv_caps =
.x1cx03_possibly = 1,
.x1ax03_supported = 1,
.mode_with_filter = 1,
- .data_mode_supported = 1
+ .data_mode_supported = 1,
+ .fm_filters = { 7000, 10000, 15000 }
};
static const struct icom_priv_caps IC9700_priv_caps =
@@ -474,7 +475,7 @@ static const struct icom_priv_caps IC9700_priv_caps =
.x1cx03_possibly = 1,
.x1ax03_supported = 1,
.mode_with_filter = 1,
- .data_mode_supported = 1
+ .data_mode_supported = 1,
};
static const struct icom_priv_caps IC705_priv_caps =
@@ -741,7 +742,7 @@ struct rig_caps ic7300_caps =
RIG_MODEL(RIG_MODEL_IC7300),
.model_name = "IC-7300",
.mfg_name = "Icom",
- .version = BACKEND_VER ".13",
+ .version = BACKEND_VER ".14",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c
index 6d2b18ee5..95ed7a186 100644
--- a/rigs/icom/icom.c
+++ b/rigs/icom/icom.c
@@ -512,19 +512,19 @@ const struct confparams icom_cfg_params[] =
},
{
TOK_FILTER_USBD, "filter_usbd", "Filter to use USBD", "Filter to use for USBD/LSBD when setting mode",
- "0", RIG_CONF_NUMERIC, {.n = {0, 3, 1}}
+ "1", RIG_CONF_NUMERIC, {.n = {0, 3, 1}}
},
{
TOK_FILTER_USB, "filter_usb", "Filter to use USB", "Filter to use when for USB/LSB setting mode",
- "0", RIG_CONF_NUMERIC, {.n = {0, 3, 1}}
+ "2", RIG_CONF_NUMERIC, {.n = {0, 3, 1}}
},
{
TOK_FILTER_CW, "filter_cw", "Filter to use CW", "Filter to use for CW/CWR when setting mode",
- "0", RIG_CONF_NUMERIC, {.n = {0, 3, 1}}
+ "3", RIG_CONF_NUMERIC, {.n = {0, 3, 1}}
},
{
TOK_FILTER_FM, "filter_fm", "Filter to use FM", "Filter to use for FM/PKTFM when setting mode",
- "0", RIG_CONF_NUMERIC, {.n = {0, 3, 1}}
+ "1", RIG_CONF_NUMERIC, {.n = {0, 3, 1}}
},
{RIG_CONF_END, NULL,}
};
@@ -858,6 +858,7 @@ static int icom_check_ack(int ack_len, unsigned char *ackbuf)
{
// if we don't get ACK/NAK some serial corruption occurred
// so we'll call it a timeout for retry purposes
+ rig_debug(RIG_DEBUG_WARN, "%s: command timed out (%#.2x)\n", __func__, ackbuf[0]);
return -RIG_ETIMEOUT;
}
@@ -2346,7 +2347,7 @@ static int icom_get_mode_x26(RIG *rig, vfo_t vfo, int *mode_len,
static int icom_set_mode_x26(RIG *rig, vfo_t vfo, rmode_t mode,
rmode_t icom_mode, int datamode,
- int filter)
+ int filter, pbwidth_t width)
{
struct icom_priv_data *priv = STATE(rig)->priv;
const struct icom_priv_caps *priv_caps = rig->caps->priv;
@@ -2354,6 +2355,7 @@ static int icom_set_mode_x26(RIG *rig, vfo_t vfo, rmode_t mode,
unsigned char buf[3];
unsigned char ackbuf[MAXFRAMELEN];
int ack_len = sizeof(ackbuf);
+ int buf_len = 3;
int mode_len;
unsigned char mode_buf[4];
@@ -2380,25 +2382,45 @@ static int icom_set_mode_x26(RIG *rig, vfo_t vfo, rmode_t mode,
if (priv->filter_usbd > 0 && (mode == RIG_MODE_PKTUSB
|| mode == RIG_MODE_PKTLSB))
{
- rig_debug(RIG_DEBUG_TRACE, "%s: filter usbd=%d\n", __func__, priv->filter_usbd);
+ rig_debug(RIG_DEBUG_TRACE, "%s: filter usbd=%d, width=%d\n", __func__, priv->filter_usbd, (int)width);
buf[2] = priv->filter_usbd;
+ if (width >= 1 && width <=3) buf[2] = width;
+ if (width == RIG_PASSBAND_NOCHANGE)
+ {
+ buf_len = 1;
+ }
}
else if (priv->filter_usb > 0 && (mode == RIG_MODE_USB || mode == RIG_MODE_LSB))
{
rig_debug(RIG_DEBUG_TRACE, "%s: filter usb=%d\n", __func__, priv->filter_usb);
buf[2] = priv->filter_usb;
+ if (width == RIG_PASSBAND_NOCHANGE)
+ {
+ buf_len = 1;
+ }
}
else if (priv->filter_cw > 0 && (mode == RIG_MODE_CW || mode == RIG_MODE_CWR))
{
rig_debug(RIG_DEBUG_TRACE, "%s: filter cw=%d\n", __func__, priv->filter_cw);
buf[2] = priv->filter_cw;
+ if (width == RIG_PASSBAND_NOCHANGE)
+ {
+ buf_len = 1;
+ }
}
- else if (priv->filter_fm > 0 && (mode == RIG_MODE_FM || mode == RIG_MODE_PKTFM))
+ else if (mode == RIG_MODE_FM || mode == RIG_MODE_PKTFM)
{
- rig_debug(RIG_DEBUG_TRACE, "%s: filter fm=%d\n", __func__, priv->filter_fm);
- buf[2] = priv->filter_fm;
+ rig_debug(RIG_DEBUG_TRACE, "%s: width=%d\n", __func__, (int)width);
+ buf[2] = width;
+ if (width > 10000) buf[2] = 1;
+ else if (width > 7000) buf[2] = 2;
+ else if (width > 3) buf[2] = 3;
+ if (width == RIG_PASSBAND_NOCHANGE)
+ {
+ buf_len = 1;
+ }
}
int vfo_number = icom_get_vfo_number_x25x26(rig, vfo);
@@ -2406,7 +2428,7 @@ static int icom_set_mode_x26(RIG *rig, vfo_t vfo, rmode_t mode,
rig_debug(RIG_DEBUG_TRACE, "%s: vfo=%s, vfo_number=%d\n", __func__,
rig_strvfo(vfo), vfo_number);
- retval = icom_transaction(rig, C_SEND_SEL_MODE, vfo_number, buf, 3, ackbuf,
+ retval = icom_transaction(rig, C_SEND_SEL_MODE, vfo_number, buf, buf_len, ackbuf,
&ack_len);
if (priv->x26cmdfails < 0 || priv_caps->x25x26_always)
@@ -2568,11 +2590,17 @@ int icom_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
if (datamode[0] == 0) { datamode[1] = 0; } // the only good combo possible according to manual
// we need to let FM mode widths through here with datamode[1] set to FM width
- if((RIG_IS_IC7300 || RIG_IS_IC9700) && (mode == RIG_MODE_FM || mode == RIG_MODE_WFM))
+ if((priv_caps->fm_filters != NULL) && (mode == RIG_MODE_FM || mode == RIG_MODE_WFM))
{
- if (width <= 7000) datamode[1] = 3;
- else if (width <= 10000) datamode[1] = 2;
+ // assumed fm_filters is ascending sequence -- see ic7300.c for example
+ if (width <= 3) datamode[1] = width;
+ else if (width <= priv_caps->fm_filters[0]) datamode[1] = 3;
+ else if (width <= priv_caps->fm_filters[1]) datamode[1] = 2;
else datamode[1] = 1;
+ if (width > 3)
+ {
+ rig_debug(RIG_DEBUG_WARN, "%s: IC7300 width set by 1,2,3 - adjustable widht not implemented yet\n", __func__);
+ }
}
rig_debug(RIG_DEBUG_TRACE, "%s(%d) mode_icom=%d, datamode=%d, filter=%d\n",
@@ -2585,7 +2613,7 @@ int icom_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
else
{
if (datamode[0] == 0) datamode[1] = 0;
- retval = icom_set_mode_x26(rig, vfo, mode, mode_icom, datamode[0], datamode[1]);
+ retval = icom_set_mode_x26(rig, vfo, mode, mode_icom, datamode[0], datamode[1], width);
}
if (retval != RIG_OK)
diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h
index 608dbe594..bcc9a05a5 100644
--- a/rigs/icom/icom.h
+++ b/rigs/icom/icom.h
@@ -251,6 +251,7 @@ struct icom_priv_caps
int x1ax03_supported; /*!< Rig supports setting/getting filter width */
int mode_with_filter; /*!< Rig mode commands include filter selection */
int data_mode_supported; /*!< Rig supports data mode flag */
+ int fm_filters[3]; /*!< For models with FIL1/2/3 for FM low-to-high fixed filters -- IC7300/9700 */
};
struct icom_priv_data
commit 327517a881c127ee91d3dbd7882aa65a8fe62085
Author: Mike Black W9MDB <mdb...@ya...>
Date: Thu Oct 10 22:58:12 2024 -0500
Remote get_ts from ic707.c -- rig does not support it
https://github.com/Hamlib/Hamlib/issues/1617
diff --git a/rigs/icom/ic707.c b/rigs/icom/ic707.c
index da5ab31b9..81d7d1d78 100644
--- a/rigs/icom/ic707.c
+++ b/rigs/icom/ic707.c
@@ -59,7 +59,7 @@ struct rig_caps ic707_caps =
RIG_MODEL(RIG_MODEL_IC707),
.model_name = "IC-707",
.mfg_name = "Icom",
- .version = BACKEND_VER ".3",
+ .version = BACKEND_VER ".4",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
@@ -159,7 +159,7 @@ struct rig_caps ic707_caps =
.set_split_mode = icom_set_split_mode,
.get_split_mode = icom_get_split_mode,
.set_ts = icom_set_ts,
- .get_ts = icom_get_ts,
+// .get_ts = icom_get_ts, // apparently does not have this
.scan = icom_scan,
commit e096426ddc8210f298571ad943159f2b3844ddef
Author: Mike Black W9MDB <mdb...@ya...>
Date: Wed Oct 9 08:53:37 2024 -0500
rigctld show-conf now exits only if no -r argument is given
https://github.com/Hamlib/Hamlib/issues/1619
diff --git a/tests/rigctld.c b/tests/rigctld.c
index 44be5afc6..45042e3ad 100644
--- a/tests/rigctld.c
+++ b/tests/rigctld.c
@@ -761,8 +761,11 @@ int main(int argc, char *argv[])
if (show_conf)
{
rig_token_foreach(my_rig, print_conf_list, (rig_ptr_t)my_rig);
- fflush(stdout);
- exit(0);
+ if (rig_file == NULL)
+ {
+ fflush(stdout);
+ exit(0);
+ }
}
/*
commit c01e55b09b164587f8b7ddfa8d910f39ec60b0ed
Author: Mike Black W9MDB <mdb...@ya...>
Date: Wed Oct 9 08:35:59 2024 -0500
Change icom_scan to use vfo argument to set vfo -- default VFO_CURR to just switching to vfo mode
https://github.com/Hamlib/Hamlib/issues/1619#issuecomment-2402159608
diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c
index fcb4c7a4c..6d2b18ee5 100644
--- a/rigs/icom/icom.c
+++ b/rigs/icom/icom.c
@@ -8664,11 +8664,14 @@ int icom_scan(RIG *rig, vfo_t vfo, scan_t scan, int ch)
unsigned char ackbuf[MAXFRAMELEN];
int scan_len, ack_len = sizeof(ackbuf), retval;
int scan_cn, scan_sc;
+ vfo_t myvfo = vfo;
ENTERFUNC;
scan_len = 0;
scan_cn = C_CTL_SCAN;
+ // for current vfo just switch to VFO mode (we might be in MEM)
+ if (myvfo == RIG_VFO_CURR) myvfo = RIG_VFO_VFO;
switch (scan)
{
case RIG_SCAN_STOP:
@@ -8678,7 +8681,7 @@ int icom_scan(RIG *rig, vfo_t vfo, scan_t scan, int ch)
case RIG_SCAN_VFO:
case RIG_SCAN_MEM:
HAMLIB_TRACE;
- retval = rig_set_vfo(rig, scan==RIG_SCAN_MEM?RIG_VFO_MEM:RIG_VFO_VFO);
+ retval = rig_set_vfo(rig, scan==RIG_SCAN_MEM?RIG_VFO_MEM:myvfo);
if (retval != RIG_OK)
{
commit 2a7d5387ee1b4e0e8c8ca5d0bb19d76f7a95d335
Author: Mike Black W9MDB <mdb...@ya...>
Date: Wed Oct 9 08:30:55 2024 -0500
Change icom_scan VFO to just switch to VFO mode instead of VFOA
https://github.com/Hamlib/Hamlib/issues/1619#issuecomment-2402159608
diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c
index b95eebcde..fcb4c7a4c 100644
--- a/rigs/icom/icom.c
+++ b/rigs/icom/icom.c
@@ -8678,7 +8678,7 @@ int icom_scan(RIG *rig, vfo_t vfo, scan_t scan, int ch)
case RIG_SCAN_VFO:
case RIG_SCAN_MEM:
HAMLIB_TRACE;
- retval = rig_set_vfo(rig, scan==RIG_SCAN_MEM?RIG_VFO_MEM:RIG_VFO_A);
+ retval = rig_set_vfo(rig, scan==RIG_SCAN_MEM?RIG_VFO_MEM:RIG_VFO_VFO);
if (retval != RIG_OK)
{
diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h
index 80c0eff6a..608dbe594 100644
--- a/rigs/icom/icom.h
+++ b/rigs/icom/icom.h
@@ -35,7 +35,7 @@
#include <sys/time.h>
#endif
-#define BACKEND_VER "20241007"
+#define BACKEND_VER "20241009"
#define ICOM_IS_ID31 rig_is_model(rig, RIG_MODEL_ID31)
#define ICOM_IS_ID51 rig_is_model(rig, RIG_MODEL_ID51)
commit 882d22a50ca99f4a2600620844ca4ffb216400fc
Author: Mike Black W9MDB <mdb...@ya...>
Date: Mon Oct 7 12:19:03 2024 -0500
Add help to N command in rigctl
diff --git a/src/sprintflst.c b/src/sprintflst.c
index 047fb2bc5..1ad8434ba 100644
--- a/src/sprintflst.c
+++ b/src/sprintflst.c
@@ -852,6 +852,37 @@ int rig_sprintf_spectrum_avg_modes(char *str, int nlen,
return len;
}
+int rig_sprintf_tuning_steps(char *str, int nlen, const struct tuning_step_list *tuning_step_list)
+{
+ int i, len = 0;
+
+ *str = '\0';
+
+ for (i = 0; i < HAMLIB_TSLSTSIZ; i++)
+ {
+ int lentmp;
+
+ if (tuning_step_list[i].modes == RIG_MODE_NONE)
+ {
+ break;
+ }
+
+ lentmp = snprintf(str + len, nlen - len, "%s%d", i>0?", ":"", (int)tuning_step_list[i].ts);
+
+ if (len < 0 || lentmp >= nlen - len)
+ {
+ rig_debug(RIG_DEBUG_ERR, "%s(%d): overflowed str buffer\n", __FILE__, __LINE__);
+ break;
+ }
+
+ len += lentmp;
+ check_buffer_overflow(str, len, nlen);
+ }
+
+ return len;
+
+}
+
char *get_rig_conf_type(enum rig_conf_e type)
{
switch (type)
diff --git a/src/sprintflst.h b/src/sprintflst.h
index bfb80ebe4..1e207aae5 100644
--- a/src/sprintflst.h
+++ b/src/sprintflst.h
@@ -51,6 +51,7 @@ extern HAMLIB_EXPORT( int ) rot_sprintf_status(char *str, int len, rot_status_t
extern HAMLIB_EXPORT( int ) rig_sprintf_spectrum_modes(char *str, int nlen, const enum rig_spectrum_mode_e *modes);
extern HAMLIB_EXPORT( int ) rig_sprintf_spectrum_spans(char *str, int nlen, const freq_t *spans);
extern HAMLIB_EXPORT( int ) rig_sprintf_spectrum_avg_modes(char *str, int nlen, const struct rig_spectrum_avg_mode *avg_modes);
+extern HAMLIB_EXPORT( int ) rig_sprintf_tuning_steps(char *str, int nlen, const struct tuning_step_list *tuning_step_list);
extern HAMLIB_EXPORT( char *) get_rig_conf_type(enum rig_conf_e type);
extern HAMLIB_EXPORT( int ) print_ext_param(const struct confparams *cfp, rig_ptr_t ptr);
diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c
index c4ea871c7..5be851fb6 100644
--- a/tests/rigctl_parse.c
+++ b/tests/rigctl_parse.c
@@ -3191,9 +3191,17 @@ declare_proto_rig(get_split_vfo)
declare_proto_rig(set_ts)
{
unsigned long ts;
+ char s[SPRINTF_MAX_SIZE];
ENTERFUNC2;
+ if (!strcmp(arg1, "?"))
+ {
+ rig_sprintf_tuning_steps(s, sizeof(s), rig->caps->tuning_steps);
+ fprintf(fout, "%s\n", s);
+ RETURNFUNC2(RIG_OK);
+ }
+
CHKSCN1ARG(sscanf(arg1, "%lu", &ts));
RETURNFUNC2(rig_set_ts(rig, vfo, ts));
commit 96fc6855671e046f95da1b9f7b5a765de0b607aa
Author: Mike Black W9MDB <mdb...@ya...>
Date: Mon Oct 7 09:19:04 2024 -0500
Update rigctl.1
diff --git a/doc/man1/rigctl.1 b/doc/man1/rigctl.1
index 48baede60..d79f55f95 100644
--- a/doc/man1/rigctl.1
+++ b/doc/man1/rigctl.1
@@ -182,7 +182,7 @@ below.
.BR \-L ", " \-\-show\-conf
List all config parameters for the radio defined with
.B \-m
-above. Note the dummy device has no serial parameters.
+above. Will exit if no -r is given. Note the dummy device has no serial parameters.
.
.TP
.BR \-C ", " \-\-set\-conf = \fIparm=val\fP [ \fI,parm=val\fP ]
@@ -1137,7 +1137,7 @@ Set
.RI \(aq Transceive \(aq
mode.
.IP
-Transcieve is a token: \(oqOFF\(cq, \(oqRIG\(cq, \(oqPOLL\(cq.
+Transceive is a token: \(oqOFF\(cq, \(oqRIG\(cq, \(oqPOLL\(cq.
.IP
Transceive is a mechanism for radios to report events without a specific call
for information.
commit baf2897e76b367325a1a2085df7bf4b0459fd862
Author: Mike Black W9MDB <mdb...@ya...>
Date: Mon Oct 7 08:11:31 2024 -0500
Add SCAN_VFO to icom.c and fix ic707.c to support correct scan modes
diff --git a/rigs/icom/ic707.c b/rigs/icom/ic707.c
index 0cc6e66f4..da5ab31b9 100644
--- a/rigs/icom/ic707.c
+++ b/rigs/icom/ic707.c
@@ -40,7 +40,7 @@
#define IC707_VFO_OPS (RIG_OP_FROM_VFO|RIG_OP_TO_VFO|RIG_OP_CPY)
-#define IC707_SCAN_OPS (RIG_SCAN_VFO|RIG_SCAN_MEM|RIG_SCAN_STOP|RIG_SCAN_SLCT)
+#define IC707_SCAN_OPS (RIG_SCAN_VFO|RIG_SCAN_MEM|RIG_SCAN_STOP)
#define IC707_ANTS RIG_ANT_1
@@ -59,7 +59,7 @@ struct rig_caps ic707_caps =
RIG_MODEL(RIG_MODEL_IC707),
.model_name = "IC-707",
.mfg_name = "Icom",
- .version = BACKEND_VER ".2",
+ .version = BACKEND_VER ".3",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c
index 7e227e40b..b95eebcde 100644
--- a/rigs/icom/icom.c
+++ b/rigs/icom/icom.c
@@ -8675,9 +8675,10 @@ int icom_scan(RIG *rig, vfo_t vfo, scan_t scan, int ch)
scan_sc = S_SCAN_STOP;
break;
+ case RIG_SCAN_VFO:
case RIG_SCAN_MEM:
HAMLIB_TRACE;
- retval = rig_set_vfo(rig, RIG_VFO_MEM);
+ retval = rig_set_vfo(rig, scan==RIG_SCAN_MEM?RIG_VFO_MEM:RIG_VFO_A);
if (retval != RIG_OK)
{
@@ -8688,7 +8689,7 @@ int icom_scan(RIG *rig, vfo_t vfo, scan_t scan, int ch)
* but some old models don't have it.
* Should be put in icom_priv_caps ?
*/
- if (rig->caps->rig_type == RIG_TYPE_RECEIVER)
+ if (rig->caps->rig_type == RIG_TYPE_RECEIVER && scan == RIG_SCAN_MEM)
{
scan_sc = S_SCAN_MEM2;
}
@@ -8738,7 +8739,7 @@ int icom_scan(RIG *rig, vfo_t vfo, scan_t scan, int ch)
break;
default:
- rig_debug(RIG_DEBUG_ERR, "%s: unsupported scan %#x", __func__, scan);
+ rig_debug(RIG_DEBUG_ERR, "%s: unsupported scan %#x\n", __func__, scan);
RETURNFUNC(-RIG_EINVAL);
}
diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h
index 15e1559c2..80c0eff6a 100644
--- a/rigs/icom/icom.h
+++ b/rigs/icom/icom.h
@@ -35,7 +35,7 @@
#include <sys/time.h>
#endif
-#define BACKEND_VER "20241005"
+#define BACKEND_VER "20241007"
#define ICOM_IS_ID31 rig_is_model(rig, RIG_MODEL_ID31)
#define ICOM_IS_ID51 rig_is_model(rig, RIG_MODEL_ID51)
commit ba62edc51b9b2d390b1c051562c34b06dda909bf
Author: Mike Black W9MDB <mdb...@ya...>
Date: Mon Oct 7 07:52:48 2024 -0500
Fix simic7300
diff --git a/simulators/simic7300.c b/simulators/simic7300.c
index 7c0c48487..797259dba 100644
--- a/simulators/simic7300.c
+++ b/simulators/simic7300.c
@@ -779,6 +779,9 @@ while (1)
if (powerstat)
{
+ unsigned char tmp = buf[2];
+ buf[2] = buf[3];
+ buf[3] = tmp;
frameParse(fd, buf, len);
}
else
commit 53a3d8635373124b9b6b93c141673f2ea1c6c814
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sat Oct 5 14:48:09 2024 -0500
Fix async detection in icom.c
diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c
index 75f16bf22..7e227e40b 100644
--- a/rigs/icom/icom.c
+++ b/rigs/icom/icom.c
@@ -9068,6 +9068,11 @@ int icom_process_async_frame(RIG *rig, size_t frame_length,
* the rest is data
* and don't forget one byte at the end for the EOM
*/
+ if (frame[2] != 0x00)
+ {
+ rig_debug(RIG_DEBUG_VERBOSE, "%s: 3rd byte not 0x00...not async\n", __func__);
+ RETURNFUNC(RIG_OK);
+ }
switch (frame[4])
{
case C_RD_FREQ:
diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h
index b45c0b3da..15e1559c2 100644
--- a/rigs/icom/icom.h
+++ b/rigs/icom/icom.h
@@ -35,7 +35,7 @@
#include <sys/time.h>
#endif
-#define BACKEND_VER "20241001"
+#define BACKEND_VER "20241005"
#define ICOM_IS_ID31 rig_is_model(rig, RIG_MODEL_ID31)
#define ICOM_IS_ID51 rig_is_model(rig, RIG_MODEL_ID51)
commit e5c8117cea9798174a7bc5464743cba60c8d2b41
Author: Mike Black W9MDB <mdb...@ya...>
Date: Fri Oct 4 16:28:32 2024 -0500
Add STOP and VFO to IC707 scan operations
https://github.com/Hamlib/Hamlib/issues/1619
diff --git a/rigs/icom/ic707.c b/rigs/icom/ic707.c
index d242a5215..0cc6e66f4 100644
--- a/rigs/icom/ic707.c
+++ b/rigs/icom/ic707.c
@@ -40,7 +40,7 @@
#define IC707_VFO_OPS (RIG_OP_FROM_VFO|RIG_OP_TO_VFO|RIG_OP_CPY)
-#define IC707_SCAN_OPS (RIG_SCAN_VFO|RIG_SCAN_MEM) /* TBC */
+#define IC707_SCAN_OPS (RIG_SCAN_VFO|RIG_SCAN_MEM|RIG_SCAN_STOP|RIG_SCAN_SLCT)
#define IC707_ANTS RIG_ANT_1
commit 4afe039147ad1633cdaeaa328ad5aec50b279ccb
Author: Mike Black W9MDB <mdb...@ya...>
Date: Fri Oct 4 16:24:25 2024 -0500
Improve conf.c debug output
diff --git a/src/conf.c b/src/conf.c
index a38fd4c47..24fd6a5e3 100644
--- a/src/conf.c
+++ b/src/conf.c
@@ -1372,10 +1372,18 @@ const struct confparams *HAMLIB_API rig_confparam_lookup(RIG *rig,
const struct confparams *cfp;
hamlib_token_t token;
- rig_debug(RIG_DEBUG_VERBOSE, "%s called for %s\n", __func__, name);
if (!rig || !rig->caps)
{
+ if (rig)
+ {
+ rig_debug(RIG_DEBUG_ERR, "%s: rig->caps is NULL\n", __func__);
+ }
+ else
+ {
+ rig_debug(RIG_DEBUG_ERR, "%s: rig is NULL\n", __func__);
+ }
+
return NULL;
}
@@ -1386,6 +1394,7 @@ const struct confparams *HAMLIB_API rig_confparam_lookup(RIG *rig,
{
if (!strcmp(cfp->name, name) || token == cfp->token)
{
+ rig_debug(RIG_DEBUG_VERBOSE, "%s called for %s\n", __func__, cfp->name);
return cfp;
}
}
@@ -1394,6 +1403,7 @@ const struct confparams *HAMLIB_API rig_confparam_lookup(RIG *rig,
{
if (!strcmp(cfp->name, name) || token == cfp->token)
{
+ rig_debug(RIG_DEBUG_VERBOSE, "%s called for %s\n", __func__, cfp->name);
return cfp;
}
}
@@ -1404,11 +1414,15 @@ const struct confparams *HAMLIB_API rig_confparam_lookup(RIG *rig,
{
if (!strcmp(cfp->name, name) || token == cfp->token)
{
+ rig_debug(RIG_DEBUG_VERBOSE, "%s called for %s\n", __func__, cfp->name);
return cfp;
}
}
}
+
+ rig_debug(RIG_DEBUG_VERBOSE, "%s called for %s and not found\n", __func__,
+ name);
return NULL;
}
commit c1130737fa01be6c481145311201db8ce6d2ab09
Author: Mike Black W9MDB <mdb...@ya...>
Date: Fri Oct 4 15:44:40 2024 -0500
Remove get_freq from ft757gx.c -- at least some of them apparently can't read freq
diff --git a/rigs/yaesu/ft757gx.c b/rigs/yaesu/ft757gx.c
index 1c6a3cb28..78011543b 100644
--- a/rigs/yaesu/ft757gx.c
+++ b/rigs/yaesu/ft757gx.c
@@ -55,7 +55,7 @@ static int ft757gx_get_conf(RIG *rig, hamlib_token_t token, char *val);
static int ft757gx_set_conf(RIG *rig, hamlib_token_t token, const char *val);
static int ft757_set_freq(RIG *rig, vfo_t vfo, freq_t freq);
-static int ft757_get_freq(RIG *rig, vfo_t vfo, freq_t *freq);
+//static int ft757_get_freq(RIG *rig, vfo_t vfo, freq_t *freq);
static int ft757gx_get_freq(RIG *rig, vfo_t vfo, freq_t *freq);
static int ft757_set_mode(RIG *rig, vfo_t vfo, rmode_t mode,
@@ -230,7 +230,7 @@ struct rig_caps ft757gx2_caps =
RIG_MODEL(RIG_MODEL_FT757GXII),
.model_name = "FT-757GXII",
.mfg_name = "Yaesu",
- .version = "20200325.0",
+ .version = "20240927.0",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_MOBILE,
@@ -338,7 +338,7 @@ struct rig_caps ft757gx2_caps =
.rig_close = NULL, /* port closed */
.set_freq = ft757_set_freq, /* set freq */
- .get_freq = ft757_get_freq, /* get freq */
+ .get_freq = ft757gx_get_freq, /* get freq */
.set_mode = ft757_set_mode, /* set mode */
.get_mode = ft757_get_mode, /* get mode */
.set_vfo = ft757_set_vfo, /* set vfo */
@@ -515,6 +515,7 @@ static int ft757gx_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
* Return Freq
*/
+#if 0
static int ft757_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
{
struct ft757_priv_data *priv = (struct ft757_priv_data *)STATE(rig)->priv;
@@ -552,6 +553,7 @@ static int ft757_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
*freq);
return RIG_OK;
}
+#endif
static int ft757_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
commit 6a9cec677af718d97f7f0097524cb235c4e16322
Author: Mike Black W9MDB <mdb...@ya...>
Date: Fri Oct 4 15:43:29 2024 -0500
Have multicast wait until rig is powered on
diff --git a/src/multicast.c b/src/multicast.c
index 9ef201e12..1c7e57373 100644
--- a/src/multicast.c
+++ b/src/multicast.c
@@ -390,6 +390,12 @@ void *multicast_thread(void *vrig)
while (rs->multicast->runflag)
{
+ while (STATE(rig)->powerstat == RIG_POWER_OFF)
+ {
+ rig_debug(RIG_DEBUG_VERBOSE,"%s: waiting for RIG_POWER_ON\n", __func__);
+ hl_usleep(500*1000);
+ }
+
#if 0
if ((retval = rig_get_freq(rig, RIG_VFO_A, &freqA)) != RIG_OK)
commit 0548fea7c1340efb1c7667bea834a0c1f164f455
Author: Mike Black W9MDB <mdb...@ya...>
Date: Fri Oct 4 15:40:56 2024 -0500
Fix spelling error in misc.c
diff --git a/src/misc.c b/src/misc.c
index b4b86331d..bcc24d818 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -2879,7 +2879,7 @@ const char *spaces(int len)
}
// if which==0 rig_band_select str will be returned
-// if which!=0 the rig_parm_gran band str will be returne
+// 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)
{
int i;
commit aa9d227d64c1a17af7ad224dd82bba221954accf
Author: Mike Black W9MDB <mdb...@ya...>
Date: Fri Oct 4 15:39:17 2024 -0500
Add device_class strings to cm108
diff --git a/src/cm108.c b/src/cm108.c
index 120a6ab23..3e4bac440 100644
--- a/src/cm108.c
+++ b/src/cm108.c
@@ -68,6 +68,66 @@
#include "cm108.h"
+#include <stdio.h>
+
+const char* get_usb_device_class_string(int device_class) {
+ switch (device_class) {
+ case 0x00:
+ return "Device Unspecified (Defined at Interface level)";
+ case 0x01:
+ return "Audio";
+ case 0x02:
+ return "Communications and CDC Control";
+ case 0x03:
+ return "Human Interface Device (HID)";
+ case 0x05:
+ return "Physical Interface Device";
+ case 0x06:
+ return "Image (Scanner, Camera)";
+ case 0x07:
+ return "Printer";
+ case 0x08:
+ return "Mass Storage";
+ case 0x09:
+ return "Hub";
+ case 0x0A:
+ return "CDC Data";
+ case 0x0B:
+ return "Smart Card";
+ case 0x0D:
+ return "Content Security";
+ case 0x0E:
+ return "Video";
+ case 0x0F:
+ return "Personal Healthcare";
+ case 0x10:
+ return "Audio/Video Devices";
+ case 0x11:
+ return "Billboard Device Class";
+ case 0x12:
+ return "USB Type-C Bridge Class";
+ case 0x13:
+ return "Bulk Display";
+ case 0x14:
+ return "MCTCP over USB";
+ case 0x3C:
+ return "I3C";
+ case 0x58:
+ return "Xbox";
+ case 0xDC:
+ return "Diagnostic Device";
+ case 0xE0:
+ return "Wireless Controller";
+ case 0xEF:
+ return "Miscellaneous";
+ case 0xFE:
+ return "Application Specific";
+ case 0xFF:
+ return "Vendor Specific";
+ default:
+ return "Unknown Device Class";
+ }
+}
/**
* \brief Open CM108 HID port (/dev/hidraw<i>X</i>).
commit e55c7dd8404d144c9b5219c07a2d500467710f8c
Author: Mike Black W9MDB <mdb...@ya...>
Date: Fri Oct 4 15:38:24 2024 -0500
Change IC910 to use IC9700 set_vfo routine
diff --git a/rigs/icom/ic910.c b/rigs/icom/ic910.c
index 67c10ade9..8afbfd55a 100644
--- a/rigs/icom/ic910.c
+++ b/rigs/icom/ic910.c
@@ -196,12 +196,14 @@ int ic910_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
}
}
+extern int ic9700_set_vfo(RIG *rig, vfo_t vfo);
+
struct rig_caps ic910_caps =
{
RIG_MODEL(RIG_MODEL_IC910),
.model_name = "IC-910",
.mfg_name = "Icom",
- .version = BACKEND_VER ".1",
+ .version = BACKEND_VER ".2",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
@@ -323,7 +325,7 @@ struct rig_caps ic910_caps =
.set_ptt = icom_set_ptt,
.get_ptt = icom_get_ptt,
- .set_vfo = icom_set_vfo,
+ .set_vfo = ic9700_set_vfo,
// .get_vfo = icom_get_vfo,
.get_ts = icom_get_ts,
.set_ts = icom_set_ts,
commit db854ab8e029310471d971990da2eae46f76bc46
Author: Mike Black W9MDB <mdb...@ya...>
Date: Fri Oct 4 15:36:50 2024 -0500
Add initializer-overrides to Makefile
diff --git a/Makefile.am b/Makefile.am
index 398b1f812..f191a4f69 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -30,4 +30,4 @@ DIST_SUBDIRS = macros include lib src c++ bindings tests doc android scripts rot
# Install any third party macros into our tree for distribution
ACLOCAL_AMFLAGS = -I macros --install
-AM_CFLAGS=-D_TIME_BITS=64
+AM_CFLAGS=-D_TIME_BITS=64 -Winitializer-overrides
commit 07e490eada0ab711b4b20fb184f2fc2304461be7
Author: Mike Black W9MDB <mdb...@ya...>
Date: Thu Oct 3 22:23:46 2024 -0500
Add set_ts and get_ts to IC707
https://github.com/Hamlib/Hamlib/issues/1617
diff --git a/rigs/icom/ic707.c b/rigs/icom/ic707.c
index b3ee6f9d8..d242a5215 100644
--- a/rigs/icom/ic707.c
+++ b/rigs/icom/ic707.c
@@ -59,7 +59,7 @@ struct rig_caps ic707_caps =
RIG_MODEL(RIG_MODEL_IC707),
.model_name = "IC-707",
.mfg_name = "Icom",
- .version = BACKEND_VER ".1",
+ .version = BACKEND_VER ".2",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
@@ -158,6 +158,8 @@ struct rig_caps ic707_caps =
.get_split_freq = icom_get_split_freq,
.set_split_mode = icom_set_split_mode,
.get_split_mode = icom_get_split_mode,
+ .set_ts = icom_set_ts,
+ .get_ts = icom_get_ts,
.scan = icom_scan,
commit f33aa9a712c177bcfaf0e084bdb5ab996afbf2be
Author: Mike Black W9MDB <mdb...@ya...>
Date: Tue Oct 1 22:31:16 2024 -0500
Fix IC707 tuning steps and memory items
Add MEM_SPLIT
diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h
index eeebb5f81..bbe579bc2 100644
--- a/include/hamlib/rig.h
+++ b/include/hamlib/rig.h
@@ -1671,7 +1671,8 @@ typedef enum {
RIG_MTYPE_BAND, /*!< VFO/Band channel */
RIG_MTYPE_PRIO, /*!< Priority channel */
RIG_MTYPE_VOICE, /*!< Stored Voice Message */
- RIG_MTYPE_MORSE /*!< Morse Message */
+ RIG_MTYPE_MORSE, /*!< Morse Message */
+ RIG_MTYPE_SPLIT /*!< Split operations */
} chan_type_t;
diff --git a/rigs/icom/ic707.c b/rigs/icom/ic707.c
index 1b4834760..b3ee6f9d8 100644
--- a/rigs/icom/ic707.c
+++ b/rigs/icom/ic707.c
@@ -38,7 +38,7 @@
#define IC707_VFO_ALL (RIG_VFO_A|RIG_VFO_B|RIG_VFO_MEM)
-#define IC707_VFO_OPS (RIG_OP_FROM_VFO|RIG_OP_TO_VFO|RIG_OP_CPY|RIG_OP_MCL)
+#define IC707_VFO_OPS (RIG_OP_FROM_VFO|RIG_OP_TO_VFO|RIG_OP_CPY)
#define IC707_SCAN_OPS (RIG_SCAN_VFO|RIG_SCAN_MEM) /* TBC */
@@ -59,9 +59,9 @@ struct rig_caps ic707_caps =
RIG_MODEL(RIG_MODEL_IC707),
.model_name = "IC-707",
.mfg_name = "Icom",
- .version = BACKEND_VER ".0",
+ .version = BACKEND_VER ".1",
.copyright = "LGPL",
- .status = RIG_STATUS_BETA,
+ .status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
.ptt_type = RIG_PTT_NONE,
.dcd_type = RIG_DCD_NONE,
@@ -99,9 +99,9 @@ struct rig_caps ic707_caps =
.chan_desc_sz = 0,
.chan_list = {
- { 1, 26, RIG_MTYPE_MEM, IC_MIN_MEM_CAP },
- { 27, 30, RIG_MTYPE_EDGE, IC_MIN_MEM_CAP },
- { 31, 35, RIG_MTYPE_SAT, IC_MIN_MEM_CAP }, /* split ? */
+ { 1, 25, RIG_MTYPE_MEM, IC_MIN_MEM_CAP },
+ { 26, 30, RIG_MTYPE_SPLIT, IC_MIN_MEM_CAP }, /* split ? */
+ { 31, 32, RIG_MTYPE_EDGE, IC_MIN_MEM_CAP },
RIG_CHAN_END,
},
@@ -126,7 +126,8 @@ struct rig_caps ic707_caps =
},
.tuning_steps = {
- {IC707_ALL_RX_MODES, 10}, /* basic resolution, there's no set_ts */
+ {IC707_ALL_RX_MODES, 10},
+ {IC707_ALL_RX_MODES, 1000},
RIG_TS_END,
},
/* mode/filter list, remember: order matters! */
commit 141ca8bf3f5ea6b05fa6d1ed204b3369378091a2
Author: Mike Black W9MDB <mdb...@ya...>
Date: Tue Oct 1 22:30:06 2024 -0500
Fix r8500 tuning steps
diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c
index e8dafa04f..75f16bf22 100644
--- a/rigs/icom/icom.c
+++ b/rigs/icom/icom.c
@@ -176,7 +176,7 @@ const struct ts_sc_list r8500_ts_sc_list[] =
{50, 0x01},
{100, 0x02},
{kHz(1), 0x03},
- {12500, 0x04},
+ {2500, 0x04},
{kHz(5), 0x05},
{kHz(9), 0x06},
{kHz(10), 0x07},
diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h
index 2e0356eb8..b45c0b3da 100644
--- a/rigs/icom/icom.h
+++ b/rigs/icom/icom.h
@@ -35,7 +35,7 @@
#include <sys/time.h>
#endif
-#define BACKEND_VER "20240922"
+#define BACKEND_VER "20241001"
#define ICOM_IS_ID31 rig_is_model(rig, RIG_MODEL_ID31)
#define ICOM_IS_ID51 rig_is_model(rig, RIG_MODEL_ID51)
commit 64d39f58efe1601d89fd8067be172fd355b89c64
Author: Mike Black W9MDB <mdb...@ya...>
Date: Tue Oct 1 11:50:01 2024 -0500
Fix segfault in powerminmax for kenwood
diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c
index 711bd6168..ad262512b 100644
--- a/rigs/kenwood/kenwood.c
+++ b/rigs/kenwood/kenwood.c
@@ -3034,8 +3034,10 @@ static int kenwood_get_power_minmax(RIG *rig, int *power_now, int *power_min,
// TS890S can't take power levels outside 5-100 and 5-25
// So all we'll do is read power_now
case RIG_MODEL_TS890S:
- rs->power_min = *power_min = 5;
- rs->power_max = *power_max = 100;
+ rs->power_min = 5;
+ rs->power_max = 100;
+ if (power_min) *power_min = 5;
+ if (power_max) *power_max = 5;
if (rs->current_mode == RIG_MODE_AM) { *power_max = 50; }
diff --git a/rigs/kenwood/kenwood.h b/rigs/kenwood/kenwood.h
index 158f67125..171ba605c 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 "20240925"
+#define BACKEND_VER "20241001"
#define EOM_KEN ';'
#define EOM_TH '\r'
commit a6fe6b547539e14e8ecb2a28cce6eb7f2f47b2cd
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sat Sep 28 22:50:25 2024 -0500
More sleep.c cleanup
diff --git a/src/sleep.c b/src/sleep.c
index 37b873e02..f02017f67 100644
--- a/src/sleep.c
+++ b/src/sleep.c
@@ -51,8 +51,6 @@ int hl_usleep(rig_useconds_t usec)
{
double sleep_time = usec / 1e6;
struct timespec tv1;
- double start_at = monotonic_seconds();
- double end_at = start_at + sleep_time;
double delay = sleep_time;
if (sleep_time > .001) { delay -= .0001; }
@@ -86,6 +84,8 @@ int hl_usleep(rig_useconds_t usec)
{
struct timespec tv2;
double lasterr = 0;
+ double start_at = monotonic_seconds();
+ double end_at = start_at + sleep_time;
tv2.tv_sec = 0;
tv2.tv_nsec = 1000000;
nanosleep(&tv1, NULL);
commit 548745d1f04fa327516ab125c66b1e7049abfdba
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sat Sep 28 22:48:11 2024 -0500
Clean up sleep.c
diff --git a/src/sleep.c b/src/sleep.c
index 347962dce..37b873e02 100644
--- a/src/sleep.c
+++ b/src/sleep.c
@@ -50,19 +50,16 @@ extern double monotonic_seconds();
int hl_usleep(rig_useconds_t usec)
{
double sleep_time = usec / 1e6;
- struct timespec tv1, tv2;
+ struct timespec tv1;
double start_at = monotonic_seconds();
double end_at = start_at + sleep_time;
double delay = sleep_time;
- double lasterr = 0;
if (sleep_time > .001) { delay -= .0001; }
else if (sleep_time > .0001) { delay -= .00005; }
tv1.tv_sec = (time_t) delay;
tv1.tv_nsec = (long)((delay - tv1.tv_sec) * 1e+9);
- tv2.tv_sec = 0;
- tv2.tv_nsec = 1000000;
// rig_debug(RIG_DEBUG_CACHE,"usec=%ld, sleep_time=%f, tv1=%ld,%ld\n", usec, sleep_time, (long)tv1.tv_sec,
// (long)tv1.tv_nsec);
@@ -74,26 +71,30 @@ int hl_usleep(rig_useconds_t usec)
double elapsed;
QueryPerformanceFrequency(&frequency);
QueryPerformanceCounter(&start);
- long long loops=0;
do {
struct timespec startc;
clock_gettime(CLOCK_REALTIME, &startc);
QueryPerformanceCounter(&end);
elapsed = (double)(end.QuadPart - start.QuadPart) / frequency.QuadPart;
- ++loops;
} while (elapsed < sleep_time);
} else {
// Use Sleep for larger durations >= 3 milliseconds
//Sleep((DWORD)(seconds * 1000 - 1)); // Convert seconds to milliseconds
- usleep(sleep_time*1e6-400);
+ usleep(sleep_time*1e6-400);
}
#else
+ {
+ struct timespec tv2;
+ double lasterr = 0;
+ tv2.tv_sec = 0;
+ tv2.tv_nsec = 1000000;
nanosleep(&tv1, NULL);
while (((lasterr = end_at - monotonic_seconds()) > 0))
{
nanosleep(&tv2, NULL);
}
+ }
#endif
return 0;
commit 7bde413c52a8d3b31e269b3107605eb255a58446
Author: Mike Black W9MDB <mdb...@ya...>
Date: Fri Sep 27 22:57:58 2024 -0500
New hl_usleep routine to fix power on/on slowness and a little faster performance to boot.
Times < 3ms use busy-wait for accuracy -- can't find any wait state to minimize CPU usage for those small times.
https://github.com/Hamlib/Hamlib/issues/1601
https://github.com/Hamlib/Hamlib/issues/1604
diff --git a/src/sleep.c b/src/sleep.c
index bf1dc5454..347962dce 100644
--- a/src/sleep.c
+++ b/src/sleep.c
@@ -67,15 +67,26 @@ int hl_usleep(rig_useconds_t usec)
// (long)tv1.tv_nsec);
#ifdef __WIN32__
- timeBeginPeriod(1);
- nanosleep(&tv1, NULL);
- while ((lasterr = end_at - monotonic_seconds()) > 0)
- {
- nanosleep(&tv2, NULL);
+ if (sleep_time < 0.003) {
+ // Busy-wait for small durations < 2 milliseconds
+ LARGE_INTEGER frequency, start, end;
+ double elapsed;
+ QueryPerformanceFrequency(&frequency);
+ QueryPerformanceCounter(&start);
+ long long loops=0;
+ do {
+ struct timespec startc;
+ clock_gettime(CLOCK_REALTIME, &startc);
+ QueryPerformanceCounter(&end);
+ elapsed = (double)(end.QuadPart - start.QuadPart) / frequency.QuadPart;
+ ++loops;
+ } while (elapsed < sleep_time);
+ } else {
+ // Use Sleep for larger durations >= 3 milliseconds
+ //Sleep((DWORD)(seconds * 1000 - 1)); // Convert seconds to milliseconds
+ usleep(sleep_time*1e6-400);
}
-
- timeEndPeriod(1);
#else
nanosleep(&tv1, NULL);
commit 0b12c5cfff269ecde77c51d5adc107bd1744465f
Author: Mike Black W9MDB <mdb...@ya...>
Date: Wed Sep 25 22:35:16 2024 -0500
Fix power_min/max segfault
diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c
index 536ee5e73..711bd6168 100644
--- a/rigs/kenwood/kenwood.c
+++ b/rigs/kenwood/kenwood.c
@@ -3064,8 +3064,8 @@ static int kenwood_get_power_minmax(RIG *rig, int *power_now, int *power_min,
__func__);
// return the last values we got
*power_now = rs->power_now;
- *power_min = rs->power_min;
- *power_max = rs->power_max;
+ if (power_min) *power_min = rs->power_min;
+ if (power_max) *power_max = rs->power_max;
RETURNFUNC(RIG_OK);
}
diff --git a/rigs/kenwood/kenwood.h b/rigs/kenwood/kenwood.h
index 04d39b76f..158f67125 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 "20240919"
+#define BACKEND_VER "20240925"
#define EOM_KEN ';'
#define EOM_TH '\r'
commit 23e373b99dcff7ddf173cad79aad1a639ed30bc2
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sun Sep 22 10:41:02 2024 -0500
Speed up FT991 power on -- more rigs can added when identified
https://github.com/Hamlib/Hamlib/issues/1601
diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c
index e87ac16ae..ba22ec713 100644
--- a/rigs/yaesu/newcat.c
+++ b/rigs/yaesu/newcat.c
@@ -3706,10 +3706,14 @@ int newcat_set_powerstat(RIG *rig, powerstat_t status)
// so we reopen the com port again
HAMLIB_TRACE;
//oser_close(rp);
- rig_close(rig);
- hl_usleep(3000000);
- //PTTPORT(rig)->fd = ser_open(rp);
- rig_open(rig);
+ // we can add more rigs to this exception to speed t...
[truncated message content] |
|
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] |
|
From: n0nb <n0...@us...> - 2024-08-08 12:36:11
|
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 3b1283496cdb89d3d43d0354216e8dfa0a8b8d00 (commit)
via d9d07e513c66a2558840addb53d9227554eec5f2 (commit)
via 782911f5214e087f0f3c50c767e2ae4bc3738794 (commit)
via afccc646db9f0d8693009f19ff89a75ca923fd1b (commit)
via dd9d98ca1a86494aee8fb79b0c15e6127fe9ed97 (commit)
via eeca01c08088f70f1ce52ff7c0d8b72055f01124 (commit)
via 7b71bc09ab260a784f6faccee143e8233d19bae6 (commit)
via df48595add88d2fc6ee3ded71eaa6cb70db45efd (commit)
via fe43a6425ecfd7fde14e61f07fe7aa783f519f91 (commit)
via 4d07c2abad33bfa46bb9f994a48bcc615e38725e (commit)
via 9d8cc7d2608156eae0c9ccf853df8698dc054d70 (commit)
via 48862ece543bd5e5654b0c6b64c83f8aa9db55d1 (commit)
via ff71f202c9ad77f6f8cb2fb61061879ded4220d6 (commit)
via 725542775b0df57d1fd067cdec5764528baf8c8f (commit)
via 47d1dbb0306385add4bfb4641fe62ff4a7a27bd5 (commit)
via 0fdfacafa3a5021353aa82c926138d114497ce6f (commit)
via 9ace7dbe5c1bfb0ffeb1399db116f7f4c9eda2a5 (commit)
via 6679746c62b398f5ffb488c0d480461836a079f6 (commit)
via fd153e26f4104b4df7d9c1460b54a310cb74aebd (commit)
via 1a37c569fa95f877909ded91cf9d7ff5c4d5aeb5 (commit)
via 748be3707ff353b25585b12a780a5253f9f2a8de (commit)
via 2b10a3078e98682a0eeb689f8761bbf037f5f498 (commit)
via 2668605fbd0968dce8126bcbd5357eade65fb9a9 (commit)
via ae39040fb12d2366a4c2dca33c5361e271d9a250 (commit)
via 6db44d6d497d6e1399fde1daaf65d1fcf36f11e3 (commit)
via 5ec0b8464572ee7290fe65d11b95e60bb5b76cd3 (commit)
via 647b477dc95d3d688e352a125e77993c1f46d652 (commit)
via 3f59e962e1060e517a10f25310cecff2ccca53d9 (commit)
via b718788c9ab46a7b370b74ef77436c9741f8b09b (commit)
via 75783cb1255d184c13f13464322ce6ba3c234a4e (commit)
via ed33a235f4acd515bc415556343b599698958387 (commit)
via db74acc725aa86d9a153d012cf4fa2dec82e1037 (commit)
via 673d031d5e6819ab7169ead9947e24b1a9b87476 (commit)
via 979d2adccf7e7f76821d8c760808341b29f0fd2f (commit)
via abd6d4f388cb7c236f14025e670e85d124f04655 (commit)
via 2e96b91b04eece8b9aeee304a0cbd09002044607 (commit)
via 56d55f59b313d55f85e2e7f2fd0df3ef021c4388 (commit)
via 3e2922fe69be4d5e69c465e853652e4355c5b311 (commit)
via 8b9c7680633e2639ec2e192f82d030fcd6096869 (commit)
via c0be98aea96dbea63c038438f28db8aeb4fdefd5 (commit)
via 1e8ba0dff9bdb30de73bf8e9d36c76a49e8668cc (commit)
via 16707507c66842d28dc93ad2b341fce5c2d24cae (commit)
via 7bf63ecbf0235b86b23425f3912c4c8bd36d8c4d (commit)
via c28caa7a9cab11d190bc783d29ce2b373aa9db37 (commit)
via 105a411c749700ebe8a0b90260d210e70979cdc2 (commit)
via fc8642fbf85bb3d866f9dfb9b139c9e7b0611f80 (commit)
via 21897517b6fc40a0c50582da54cea708458a06e6 (commit)
via 8cc51f5ad72c49f2c5d0f6da7d1a3fb9e6066509 (commit)
via f5ad3c64bfb0c86622184416f0543f1d741726b4 (commit)
via a3f930b061d9e48f0c7b3c476ec8d56696ed55ff (commit)
via 47cb5fdc1abee6b9851ea1bb74507be925ef835c (commit)
via 74d780f19f2bcd7a774185b0fa0b8888538b3827 (commit)
via 2f1e6b636e301edf6a1a1309c144378d8e764ea2 (commit)
via 52f91b3ced59528ac2979767e9a1cfbb68fb757d (commit)
via 27838026f5a415b260dd9cd86b1e3ff1c7f9dce0 (commit)
via a40311173be7826abfbaf9115ed3bae0d061bf01 (commit)
via 645cab50dda663efa7394815611a98a21881af87 (commit)
via fc27cc32ceb1a5c36244dc9ab1765a0b1f41e295 (commit)
via 40b20aa91272e0a483de434f18cf9622439bbf55 (commit)
via 5814f745b9429a9f141f1b28b916b65a5bef762b (commit)
via 6ed7cfe73d3a949a05ec7ce9fd2bc19b9b0b3c89 (commit)
via 7b9f1241d9c61465c92908ca1e7c6e0011c04628 (commit)
via 388a18e5da4895bd176887440b6f752dd96ca4aa (commit)
via 660bfcb1d98c42494925b3efee5fff7a8208c70a (commit)
via 6a2bbf130dde42695c3c675e771c3660aed13e48 (commit)
via 5daf92d224a478f519570420749a75c5f9e0b6e8 (commit)
via 328731921ef7cd4bfbda6553ab76f29cf8a9ffb7 (commit)
via 150ac1608fbe91579c4cedc629a3b69554653111 (commit)
via f98fc86f93fc3428369899dda55881bffe927316 (commit)
via a2aecdcf020d01b24d98cce9f264dd2cea439335 (commit)
via 37321a1df898022e0c2020839ca91c99a90a8e9c (commit)
via b0dc954a9298991edd0bb10e591040dc0bea3b9c (commit)
via d4480045f39163aa6c17169bcc7bfa1cd1ba7031 (commit)
via 02102f60e4a1fcbbbf467e07eb803b0aa2a1c9d4 (commit)
via 00bc700ec18020e477dd025d7ef65d7c73e63279 (commit)
via 5b8cc94b012be67a861e2abcb3fcfe448bb681c0 (commit)
from fee7007fb9031869ce38e09f3ce57745b1f32626 (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 3b1283496cdb89d3d43d0354216e8dfa0a8b8d00
Author: Mike Black W9MDB <mdb...@ya...>
Date: Wed Aug 7 17:26:03 2024 -0500
Abort multicast routine when UDP errors occur
Some setups don't work correctly and this is not critical now
diff --git a/src/network.c b/src/network.c
index 87c07cad8..17183cf79 100644
--- a/src/network.c
+++ b/src/network.c
@@ -1093,6 +1093,7 @@ 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 d9d07e513c66a2558840addb53d9227554eec5f2
Author: Mike Black W9MDB <mdb...@ya...>
Date: Wed Aug 7 12:02:09 2024 -0500
For Kenwood rigs add 50ms wait after set_freq to allow rig to update internal IF command
diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c
index 3c1637c31..3cc70f6c8 100644
--- a/rigs/kenwood/kenwood.c
+++ b/rigs/kenwood/kenwood.c
@@ -1963,6 +1963,7 @@ int kenwood_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
if (priv->verify_cmd[1] == 'A' && vfo_letter == 'B') { priv->verify_cmd[1] = 'A'; }
err = kenwood_transaction(rig, freqbuf, NULL, 0);
+ hl_usleep(50*1000); // TS480 is slow to change freq so give it some time as well as others just in case
if (priv->verify_cmd[1] == 'B' && vfo_letter == 'B') { priv->verify_cmd[1] = 'A'; }
diff --git a/rigs/kenwood/kenwood.h b/rigs/kenwood/kenwood.h
index 390c5b00e..93b8cde1c 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 "20240730"
+#define BACKEND_VER "20240807"
#define EOM_KEN ';'
#define EOM_TH '\r'
commit 782911f5214e087f0f3c50c767e2ae4bc3738794
Author: Mike Black W9MDB <mdb...@ya...>
Date: Wed Aug 7 06:06:41 2024 -0500
Remove sleep in smartsdr set_ptt and move the priv->ptt earlier.
Trying to avoid ptt on more than one slice at a time.
diff --git a/rigs/flexradio/smartsdr.c b/rigs/flexradio/smartsdr.c
index fd8847fef..c452208a8 100644
--- a/rigs/flexradio/smartsdr.c
+++ b/rigs/flexradio/smartsdr.c
@@ -516,6 +516,7 @@ int smartsdr_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt)
rig_debug(RIG_DEBUG_ERR, "%s: abort PTT on slice %c, another slice has PTT control\n", __func__, slicechar[priv->slicenum]);
return -RIG_ENTARGET;
}
+ priv->ptt = ptt;
if (ptt)
{
sprintf(cmd, "dax audio set %d tx=1", priv->slicenum + 1);
@@ -527,8 +528,6 @@ int smartsdr_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt)
smartsdr_transaction(rig, cmd);
sprintf(cmd, "xmit %d", ptt);
smartsdr_transaction(rig, cmd);
- if (!ptt) hl_usleep(100*1000); // need a little time for PTT to actually turn off
- priv->ptt = ptt;
RETURNFUNC(RIG_OK);
}
diff --git a/rigs/flexradio/smartsdr_caps.h b/rigs/flexradio/smartsdr_caps.h
index 80845fe61..50ec066d8 100644
--- a/rigs/flexradio/smartsdr_caps.h
+++ b/rigs/flexradio/smartsdr_caps.h
@@ -1,5 +1,5 @@
.mfg_name = "Flex-radio",
- .version = "20240806.0",
+ .version = "20240807.0",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
commit afccc646db9f0d8693009f19ff89a75ca923fd1b
Author: Mike Black W9MDB <mdb...@ya...>
Date: Tue Aug 6 17:52:36 2024 -0500
Flex slice return RIG_ENTARGET when ptt is requested and ptt is already engaged
diff --git a/rigs/flexradio/smartsdr.c b/rigs/flexradio/smartsdr.c
index 60ab0d96e..fd8847fef 100644
--- a/rigs/flexradio/smartsdr.c
+++ b/rigs/flexradio/smartsdr.c
@@ -508,8 +508,14 @@ int smartsdr_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt)
{
struct smartsdr_priv_data *priv = (struct smartsdr_priv_data *)STATE(rig)->priv;
char cmd[64];
+ char slicechar[] = { '?','A','B','C','D','E','F','G','H' };
ENTERFUNC;
+ if (priv->ptt)
+ {
+ rig_debug(RIG_DEBUG_ERR, "%s: abort PTT on slice %c, another slice has PTT control\n", __func__, slicechar[priv->slicenum]);
+ return -RIG_ENTARGET;
+ }
if (ptt)
{
sprintf(cmd, "dax audio set %d tx=1", priv->slicenum + 1);
commit dd9d98ca1a86494aee8fb79b0c15e6127fe9ed97
Author: Mike Black W9MDB <mdb...@ya...>
Date: Tue Aug 6 17:10:58 2024 -0500
Make write_block_sync return the correct value
diff --git a/src/iofunc.c b/src/iofunc.c
index 1b355ea1e..e22e738e7 100644
--- a/src/iofunc.c
+++ b/src/iofunc.c
@@ -960,13 +960,22 @@ static int port_wait_for_data(hamlib_port_t *p, int direct)
int HAMLIB_API write_block_sync(hamlib_port_t *p, const unsigned char *txbuffer,
size_t count)
{
+ int retval = RIG_OK;
if (p->asyncio)
{
- return (int) write(p->fd_sync_write, txbuffer, count);
+ retval = write(p->fd_sync_write, txbuffer, count);
}
-
- return (int) write(p->fd, txbuffer, count);
+ else
+ {
+ retval = write(p->fd, txbuffer, count);
+ }
+ if (retval != count)
+ {
+ rig_debug(RIG_DEBUG_ERR, "%s: write failed: %s\n", __func__, strerror(errno));
+ retval = -RIG_EIO;
+ }
+ return retval;
}
int HAMLIB_API write_block_sync_error(hamlib_port_t *p,
commit eeca01c08088f70f1ce52ff7c0d8b72055f01124
Author: Mike Black W9MDB <mdb...@ya...>
Date: Tue Aug 6 17:01:07 2024 -0500
Give a little time for Flex to turn off ptt
diff --git a/rigs/flexradio/smartsdr.c b/rigs/flexradio/smartsdr.c
index dd7b04860..60ab0d96e 100644
--- a/rigs/flexradio/smartsdr.c
+++ b/rigs/flexradio/smartsdr.c
@@ -518,9 +518,10 @@ int smartsdr_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt)
}
sprintf(cmd, "slice set %d tx=1", priv->slicenum);
- smartsdr_transaction(rig, cmd);
+ smartsdr_transaction(rig, cmd);
sprintf(cmd, "xmit %d", ptt);
smartsdr_transaction(rig, cmd);
+ if (!ptt) hl_usleep(100*1000); // need a little time for PTT to actually turn off
priv->ptt = ptt;
RETURNFUNC(RIG_OK);
}
diff --git a/rigs/flexradio/smartsdr_caps.h b/rigs/flexradio/smartsdr_caps.h
index b00ca4e91..80845fe61 100644
--- a/rigs/flexradio/smartsdr_caps.h
+++ b/rigs/flexradio/smartsdr_caps.h
@@ -1,5 +1,5 @@
.mfg_name = "Flex-radio",
- .version = "20240609.0",
+ .version = "20240806.0",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
commit 7b71bc09ab260a784f6faccee143e8233d19bae6
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sun Aug 4 17:11:19 2024 -0500
Change timeout on IC7100 to 700ms instead of 1000ms
Hopefully allow for timeout when async packets are coming in every 1000ms
https://github.com/Hamlib/Hamlib/issues/1587
diff --git a/rigs/icom/frame.c b/rigs/icom/frame.c
index 4be5c3012..216f36890 100644
--- a/rigs/icom/frame.c
+++ b/rigs/icom/frame.c
@@ -218,11 +218,11 @@ again1:
// if we get a reply that is not our cmd/subcmd we should just ignore it and retry the read.
// this should somewhat allow splitting the COM port between two controllers
if (cmd != buf[4]) {
- rig_debug(RIG_DEBUG_VERBOSE, "%s: cmd x%02d != buf x%02x so retry read\n", __func__, cmd, buf[4]);
+ rig_debug(RIG_DEBUG_VERBOSE, "%s: cmd x%02x != buf x%02x so retry read\n", __func__, cmd, buf[4]);
goto again1;
}
if (subcmd != -1 && subcmd != buf[5]) {
- rig_debug(RIG_DEBUG_VERBOSE, "%s: subcmd x%02d != buf x%02x so retry read\n", __func__, subcmd, buf[5]);
+ rig_debug(RIG_DEBUG_VERBOSE, "%s: subcmd x%02x != buf x%02x so retry read\n", __func__, subcmd, buf[5]);
goto again1;
}
diff --git a/rigs/icom/ic7100.c b/rigs/icom/ic7100.c
index 4c2cd7325..dbb3dd5d4 100644
--- a/rigs/icom/ic7100.c
+++ b/rigs/icom/ic7100.c
@@ -342,7 +342,7 @@ struct rig_caps ic7100_caps =
.serial_handshake = RIG_HANDSHAKE_NONE,
.write_delay = 0,
.post_write_delay = 0,
- .timeout = 1000,
+ .timeout = 700,
.retry = 3,
.has_get_func = IC7100_FUNC_ALL,
.has_set_func = IC7100_FUNC_ALL | RIG_FUNC_RESUME,
commit df48595add88d2fc6ee3ded71eaa6cb70db45efd
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sun Aug 4 11:51:18 2024 -0500
Put rig_flush back in frame.c for the IC-7100 -- hopefully fixed async packets on the CI-V port coming from amplifiers
The 7100 cannot unlink the CI-V port and these async packets are not being handled well.
https://github.com/Hamlib/Hamlib/issues/1587
diff --git a/rigs/icom/frame.c b/rigs/icom/frame.c
index 4705ea265..4be5c3012 100644
--- a/rigs/icom/frame.c
+++ b/rigs/icom/frame.c
@@ -156,7 +156,11 @@ int icom_one_transaction(RIG *rig, unsigned char cmd, int subcmd,
set_transaction_active(rig);
collision_retry:
- //rig_flush(rp);
+ // The IC7100 cannot separate the CI-V port from the USB CI-V
+ // We see async packets coming in so we'll try and do the flush
+ // This also means the IC7100 will not support async packets anymore
+ if (rig->caps->rig_model == RIG_MODEL_IC7100)
+ rig_flush(rp);
frm_len = make_cmd_frame(sendbuf, priv->re_civ_addr, ctrl_id, cmd,
subcmd, payload, payload_len);
diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h
index 90e50d8d3..07c988e46 100644
--- a/rigs/icom/icom.h
+++ b/rigs/icom/icom.h
@@ -35,7 +35,7 @@
#include <sys/time.h>
#endif
-#define BACKEND_VER "20240801"
+#define BACKEND_VER "20240804"
#define ICOM_IS_ID31 rig_is_model(rig, RIG_MODEL_ID31)
#define ICOM_IS_ID51 rig_is_model(rig, RIG_MODEL_ID51)
commit fe43a6425ecfd7fde14e61f07fe7aa783f519f91
Author: Mike Black W9MDB <mdb...@ya...>
Date: Fri Aug 2 16:31:49 2024 -0500
In icom frame.c move the frm building inside the collision_retry block
https://github.com/Hamlib/Hamlib/issues/1587
diff --git a/rigs/icom/frame.c b/rigs/icom/frame.c
index 74b4dfa36..4705ea265 100644
--- a/rigs/icom/frame.c
+++ b/rigs/icom/frame.c
@@ -150,9 +150,6 @@ int icom_one_transaction(RIG *rig, unsigned char cmd, int subcmd,
ctrl_id = priv_caps->serial_full_duplex == 0 ? CTRLID : 0x80;
- frm_len = make_cmd_frame(sendbuf, priv->re_civ_addr, ctrl_id, cmd,
- subcmd, payload, payload_len);
-
/*
* should check return code and that write wrote cmd_len chars!
*/
@@ -160,6 +157,9 @@ int icom_one_transaction(RIG *rig, unsigned char cmd, int subcmd,
collision_retry:
//rig_flush(rp);
+ frm_len = make_cmd_frame(sendbuf, priv->re_civ_addr, ctrl_id, cmd,
+ subcmd, payload, payload_len);
+
if (data_len) { *data_len = 0; }
commit 4d07c2abad33bfa46bb9f994a48bcc615e38725e
Author: Mike Black W9MDB <mdb...@ya...>
Date: Fri Aug 2 08:41:23 2024 -0500
Remove some bad declarations in ctx10.c
diff --git a/rigs/commradio/ctx10.c b/rigs/commradio/ctx10.c
index 10782fd1e..1631a1664 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 = "20240118" ".0",
+ .version = "20240802.0",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
@@ -43,15 +43,15 @@ struct rig_caps ctx10_caps =
.has_set_level = RIG_LEVEL_NONE,
.has_get_parm = RIG_PARM_NONE,
.has_set_parm = RIG_PARM_NONE,
- .level_gran = {},
- .parm_gran = {},
+// .level_gran = {},
+// .parm_gran = {},
.ctcss_list = NULL,
.dcs_list = NULL,
- .preamp = { RIG_DBLST_END, },
- .attenuator = { RIG_DBLST_END, },
- .max_rit = Hz(0),
- .max_xit = Hz(0),
- .max_ifshift = Hz(0),
+// .preamp = { RIG_DBLST_END, },
+// .attenuator = { RIG_DBLST_END, },
+// .max_rit = Hz(0),
+// .max_xit = Hz(0),
+// .max_ifshift = Hz(0),
.targetable_vfo = 0,
.vfo_ops = (RIG_OP_FROM_VFO|RIG_OP_TO_VFO),
.scan_ops = RIG_SCAN_NONE,
commit 9d8cc7d2608156eae0c9ccf853df8698dc054d70
Author: Mike Black W9MDB <mdb...@ya...>
Date: Thu Aug 1 17:30:03 2024 -0500
Move the async detection for Icom to after the echo detection
https://github.com/Hamlib/Hamlib/issues/1587
diff --git a/rigs/icom/frame.c b/rigs/icom/frame.c
index 0498af506..74b4dfa36 100644
--- a/rigs/icom/frame.c
+++ b/rigs/icom/frame.c
@@ -206,16 +206,6 @@ again1:
RETURNFUNC(-RIG_EPROTO);
}
- // https://github.com/Hamlib/Hamlib/issues/1575
- // these types of async can interrupt the cmd we sent
- // if our host number changes must not be for us
- if (sendbuf[3] != buf[2])
- {
- hl_usleep(100);
- rig_flush(rp);
- goto collision_retry;
- }
-
if (icom_is_async_frame(rig, frm_len, buf))
{
icom_process_async_frame(rig, frm_len, buf);
@@ -332,6 +322,17 @@ again2:
priv->serial_USB_echo_off = 0;
goto again2;
}
+ // https://github.com/Hamlib/Hamlib/issues/1575
+ // these types of async can interrupt the cmd we sent
+ // if our host number changes must not be for us
+ if (sendbuf[3] != buf[2])
+ {
+ rig_debug(RIG_DEBUG_VERBOSE, "%s: unknown async? read again\n", __func__);
+ hl_usleep(100);
+ rig_flush(rp);
+ goto collision_retry;
+ }
+
if (icom_is_async_frame(rig, frm_len, buf))
{
commit 48862ece543bd5e5654b0c6b64c83f8aa9db55d1
Author: Mike Black W9MDB <mdb...@ya...>
Date: Thu Aug 1 16:49:38 2024 -0500
Add comment for Barrett 4100 -- not ready for prime time
diff --git a/rigs/barrett/4100.c b/rigs/barrett/4100.c
index 8b8d1db04..99004f6ac 100644
--- a/rigs/barrett/4100.c
+++ b/rigs/barrett/4100.c
@@ -244,7 +244,7 @@ struct rig_caps barrett4100_caps =
.mfg_name = "Rhode&Schwarz",
.version = BACKEND_VER ".1",
.copyright = "LGPL",
- .status = RIG_STATUS_BETA,
+ .status = RIG_STATUS_BETA, // do no promote until somebody confirms it works ok -- nobody to test it
.rig_type = RIG_TYPE_TRANSCEIVER,
.targetable_vfo = RIG_TARGETABLE_FREQ | RIG_TARGETABLE_MODE,
.ptt_type = RIG_PTT_RIG,
commit ff71f202c9ad77f6f8cb2fb61061879ded4220d6
Author: Mike Black W9MDB <mdb...@ya...>
Date: Thu Aug 1 11:59:15 2024 -0500
Another attempt to fix IC7100 behavior when amplifier is sending requests
Seems the IC7100 cannot separate the CI-V port from the USB CI-V like other Icom rigs
diff --git a/rigs/icom/frame.c b/rigs/icom/frame.c
index c544442ba..0498af506 100644
--- a/rigs/icom/frame.c
+++ b/rigs/icom/frame.c
@@ -208,7 +208,8 @@ again1:
// https://github.com/Hamlib/Hamlib/issues/1575
// these types of async can interrupt the cmd we sent
- if (sendbuf[3] != buf[2] && buf[4] == 0x03)
+ // if our host number changes must not be for us
+ if (sendbuf[3] != buf[2])
{
hl_usleep(100);
rig_flush(rp);
diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h
index c36744ec0..90e50d8d3 100644
--- a/rigs/icom/icom.h
+++ b/rigs/icom/icom.h
@@ -35,7 +35,7 @@
#include <sys/time.h>
#endif
-#define BACKEND_VER "20240731"
+#define BACKEND_VER "20240801"
#define ICOM_IS_ID31 rig_is_model(rig, RIG_MODEL_ID31)
#define ICOM_IS_ID51 rig_is_model(rig, RIG_MODEL_ID51)
commit 725542775b0df57d1fd067cdec5764528baf8c8f
Author: Mike Black W9MDB <mdb...@ya...>
Date: Wed Jul 31 11:49:59 2024 -0500
Hopefully fix IC-7100 0xe1 packet async problem
diff --git a/rigs/icom/frame.c b/rigs/icom/frame.c
index 69ee33ba7..c544442ba 100644
--- a/rigs/icom/frame.c
+++ b/rigs/icom/frame.c
@@ -206,6 +206,15 @@ again1:
RETURNFUNC(-RIG_EPROTO);
}
+ // https://github.com/Hamlib/Hamlib/issues/1575
+ // these types of async can interrupt the cmd we sent
+ if (sendbuf[3] != buf[2] && buf[4] == 0x03)
+ {
+ hl_usleep(100);
+ rig_flush(rp);
+ goto collision_retry;
+ }
+
if (icom_is_async_frame(rig, frm_len, buf))
{
icom_process_async_frame(rig, frm_len, buf);
commit 47d1dbb0306385add4bfb4641fe62ff4a7a27bd5
Author: Mike Black W9MDB <mdb...@ya...>
Date: Wed Jul 31 11:48:21 2024 -0500
Remove 0xe1 check for async -- not that simple and now ignored when wrong response in frame.c
diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c
index 5bc76736d..4d90e3604 100644
--- a/rigs/icom/icom.c
+++ b/rigs/icom/icom.c
@@ -8971,7 +8971,7 @@ int icom_is_async_frame(RIG *rig, size_t frame_length,
/* Spectrum scope data is not CI-V transceive data, but handled the same way as it is pushed by the rig */
// IC-7100 sends 0xe1 for broadcast frame?
- return frame[2] == 0xe1 || frame[2] == BCASTID || (frame[2] == CTRLID && frame[4] == C_CTL_SCP
+ return frame[2] == BCASTID || (frame[2] == CTRLID && frame[4] == C_CTL_SCP
&& frame[5] == S_SCP_DAT);
}
diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h
index a0477319a..c36744ec0 100644
--- a/rigs/icom/icom.h
+++ b/rigs/icom/icom.h
@@ -35,7 +35,7 @@
#include <sys/time.h>
#endif
-#define BACKEND_VER "20240726"
+#define BACKEND_VER "20240731"
#define ICOM_IS_ID31 rig_is_model(rig, RIG_MODEL_ID31)
#define ICOM_IS_ID51 rig_is_model(rig, RIG_MODEL_ID51)
commit 0fdfacafa3a5021353aa82c926138d114497ce6f
Author: Mike Black W9MDB <mdb...@ya...>
Date: Tue Jul 30 11:11:54 2024 -0500
Fix PT8000A ptt and bandwidth
diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c
index 62450fd92..3c1637c31 100644
--- a/rigs/kenwood/kenwood.c
+++ b/rigs/kenwood/kenwood.c
@@ -378,7 +378,6 @@ transaction_write:
skip |= strncmp(cmdstr, "PS1", 3) == 0;
skip |= strncmp(cmdstr, "PS0", 3) == 0;
skip |= strncmp(cmdstr, "K22", 3) == 0;
- skip |= (rig->caps->rig_model == RIG_MODEL_PT8000A); // Skip Hilberling command check
if (skip)
{
diff --git a/rigs/kenwood/ts480.c b/rigs/kenwood/ts480.c
index 7c9ec248d..d6a49cab5 100644
--- a/rigs/kenwood/ts480.c
+++ b/rigs/kenwood/ts480.c
@@ -1897,6 +1897,7 @@ struct rig_caps pt8000a_caps =
},
/* mode/filter list, remember: order matters! */
.filters = {
+ {RIG_MODE_SSB, kHz(6.0)},
{RIG_MODE_SSB, kHz(1.0)},
{RIG_MODE_SSB, kHz(1.2)},
{RIG_MODE_SSB, kHz(1.4)},
@@ -1920,7 +1921,6 @@ struct rig_caps pt8000a_caps =
{RIG_MODE_SSB, kHz(3.4)},
{RIG_MODE_SSB, kHz(3.5)},
{RIG_MODE_SSB, kHz(4.6)},
- {RIG_MODE_SSB, kHz(6.0)},
{RIG_MODE_CW, Hz(50)},
{RIG_MODE_CW, Hz(100)},
{RIG_MODE_CW, Hz(200)},
@@ -1987,8 +1987,8 @@ struct rig_caps pt8000a_caps =
.get_ptt = kenwood_get_ptt,
.set_ptt = kenwood_set_ptt,
.get_dcd = kenwood_get_dcd,
- .set_powerstat = kenwood_set_powerstat,
- .get_powerstat = kenwood_get_powerstat,
+// .set_powerstat = kenwood_set_powerstat,
+// .get_powerstat = kenwood_get_powerstat,
.get_info = kenwood_ts480_get_info,
.reset = kenwood_reset,
.set_ant = kenwood_set_ant,
commit 9ace7dbe5c1bfb0ffeb1399db116f7f4c9eda2a5
Author: Mike Black W9MDB <mdb...@ya...>
Date: Tue Jul 30 10:03:16 2024 -0500
Don't do any ID checks on Hilberling PT8000A
diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c
index 22730dcad..62450fd92 100644
--- a/rigs/kenwood/kenwood.c
+++ b/rigs/kenwood/kenwood.c
@@ -378,7 +378,7 @@ transaction_write:
skip |= strncmp(cmdstr, "PS1", 3) == 0;
skip |= strncmp(cmdstr, "PS0", 3) == 0;
skip |= strncmp(cmdstr, "K22", 3) == 0;
- skip |= (rig->caps->rig_model == RIG_MODEL_PT8000A && (strncmp(cmdstr, "TQ", 2) == 0)); // Skip Hilberling TQn command check
+ skip |= (rig->caps->rig_model == RIG_MODEL_PT8000A); // Skip Hilberling command check
if (skip)
{
@@ -5161,6 +5161,7 @@ int kenwood_set_trn(RIG *rig, int trn)
case RIG_MODEL_POWERSDR: // powersdr doesn't have AI command
case RIG_MODEL_THETIS: // powersdr doesn't have AI command
+ case RIG_MODEL_PT8000A: // powersdr doesn't have AI command
RETURNFUNC(-RIG_ENAVAIL);
case RIG_MODEL_TS990S:
diff --git a/rigs/kenwood/kenwood.h b/rigs/kenwood/kenwood.h
index 4f9078639..390c5b00e 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 "20240712"
+#define BACKEND_VER "20240730"
#define EOM_KEN ';'
#define EOM_TH '\r'
commit 6679746c62b398f5ffb488c0d480461836a079f6
Author: Mike Black W9MDB <mdb...@ya...>
Date: Tue Jul 30 09:46:37 2024 -0500
Remove KEYSPD from Hilberling PT8000A
diff --git a/rigs/kenwood/ts480.c b/rigs/kenwood/ts480.c
index 2f9bc21c5..7c9ec248d 100644
--- a/rigs/kenwood/ts480.c
+++ b/rigs/kenwood/ts480.c
@@ -44,10 +44,16 @@
#define TS480_LEVEL_GET (RIG_LEVEL_RFPOWER|RIG_LEVEL_AF|RIG_LEVEL_RF|RIG_LEVEL_SQL|RIG_LEVEL_AGC|RIG_LEVEL_MICGAIN|RIG_LEVEL_STRENGTH|RIG_LEVEL_KEYSPD|RIG_LEVEL_CWPITCH| \
RIG_LEVEL_MONITOR_GAIN|RIG_LEVEL_NB|RIG_LEVEL_NR|RIG_LEVEL_PREAMP|RIG_LEVEL_COMP|RIG_LEVEL_ATT|RIG_LEVEL_VOXDELAY|RIG_LEVEL_VOXGAIN|RIG_LEVEL_BKIN_DLYMS| \
RIG_LEVEL_SWR|RIG_LEVEL_COMP_METER|RIG_LEVEL_ALC|RIG_LEVEL_RFPOWER_METER|RIG_LEVEL_SLOPE_HIGH|RIG_LEVEL_SLOPE_LOW)
+#define PT8000A_LEVEL_GET (RIG_LEVEL_RFPOWER|RIG_LEVEL_AF|RIG_LEVEL_RF|RIG_LEVEL_SQL|RIG_LEVEL_AGC|RIG_LEVEL_MICGAIN|RIG_LEVEL_STRENGTH|RIG_LEVEL_CWPITCH| \
+ RIG_LEVEL_MONITOR_GAIN|RIG_LEVEL_NB|RIG_LEVEL_NR|RIG_LEVEL_PREAMP|RIG_LEVEL_COMP|RIG_LEVEL_ATT|RIG_LEVEL_VOXDELAY|RIG_LEVEL_VOXGAIN|RIG_LEVEL_BKIN_DLYMS| \
+ RIG_LEVEL_SWR|RIG_LEVEL_COMP_METER|RIG_LEVEL_ALC|RIG_LEVEL_RFPOWER_METER|RIG_LEVEL_SLOPE_HIGH|RIG_LEVEL_SLOPE_LOW)
#define TS480_LEVEL_SET (RIG_LEVEL_RFPOWER|RIG_LEVEL_AF|RIG_LEVEL_RF|RIG_LEVEL_SQL|RIG_LEVEL_AGC|RIG_LEVEL_MICGAIN|RIG_LEVEL_KEYSPD|RIG_LEVEL_CWPITCH| \
RIG_LEVEL_MONITOR_GAIN|RIG_LEVEL_NB|RIG_LEVEL_NR|RIG_LEVEL_PREAMP|RIG_LEVEL_COMP|RIG_LEVEL_ATT|RIG_LEVEL_VOXDELAY|RIG_LEVEL_VOXGAIN|RIG_LEVEL_BKIN_DLYMS| \
RIG_LEVEL_METER|RIG_LEVEL_SLOPE_HIGH|RIG_LEVEL_SLOPE_LOW)
+#define PT8000A_LEVEL_SET (RIG_LEVEL_RFPOWER|RIG_LEVEL_AF|RIG_LEVEL_RF|RIG_LEVEL_SQL|RIG_LEVEL_AGC|RIG_LEVEL_MICGAIN|RIG_LEVEL_CWPITCH| \
+ RIG_LEVEL_MONITOR_GAIN|RIG_LEVEL_NB|RIG_LEVEL_NR|RIG_LEVEL_PREAMP|RIG_LEVEL_COMP|RIG_LEVEL_ATT|RIG_LEVEL_VOXDELAY|RIG_LEVEL_VOXGAIN|RIG_LEVEL_BKIN_DLYMS| \
+ RIG_LEVEL_METER|RIG_LEVEL_SLOPE_HIGH|RIG_LEVEL_SLOPE_LOW)
#define TS480_FUNC_ALL (RIG_FUNC_NB|RIG_FUNC_COMP|RIG_FUNC_VOX|RIG_FUNC_NR|RIG_FUNC_NR|RIG_FUNC_BC|RIG_FUNC_BC2|RIG_FUNC_RIT|RIG_FUNC_XIT| \
RIG_FUNC_TUNER|RIG_FUNC_MON|RIG_FUNC_FBKIN|RIG_FUNC_LOCK)
@@ -1830,7 +1836,7 @@ struct rig_caps qrplabs_caps =
};
/*
- * Hilberling PS8000A TS480 emulation
+ * Hilberling PT8000A TS480 emulation
* Notice that some rigs share the same functions.
*/
struct rig_caps pt8000a_caps =
@@ -1838,7 +1844,7 @@ struct rig_caps pt8000a_caps =
RIG_MODEL(RIG_MODEL_PT8000A),
.model_name = "PT-8000A",
.mfg_name = "Hilberling",
- .version = BACKEND_VER ".3",
+ .version = BACKEND_VER ".2",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
@@ -1988,8 +1994,8 @@ struct rig_caps pt8000a_caps =
.set_ant = kenwood_set_ant,
.get_ant = kenwood_get_ant,
.scan = kenwood_scan, /* not working, invalid arguments using rigctl; kenwood_scan does only support on/off and not tone and CTCSS scan */
- .has_set_level = TS480_LEVEL_SET,
- .has_get_level = TS480_LEVEL_GET,
+ .has_set_level = PT8000A_LEVEL_SET,
+ .has_get_level = PT8000A_LEVEL_GET,
.set_level = kenwood_ts480_set_level,
.get_level = kenwood_ts480_get_level,
.has_get_func = TS480_FUNC_ALL,
commit fd153e26f4104b4df7d9c1460b54a310cb74aebd
Merge: 2b10a3078 1a37c569f
Author: Michael Black <mdb...@ya...>
Date: Mon Jul 29 11:20:21 2024 -0500
Merge pull request #1590 from chrbayer84/upstream-817
FT-817 power/SWR levels
commit 1a37c569fa95f877909ded91cf9d7ff5c4d5aeb5
Merge: 748be3707 2b10a3078
Author: chrbayer84 <chr...@gm...>
Date: Mon Jul 29 11:57:27 2024 -0400
Merge branch 'master' into upstream-817
diff --cc rigs/yaesu/ft817.c
index 2234d42a7,590af3d48..a2ba846f3
--- a/rigs/yaesu/ft817.c
+++ b/rigs/yaesu/ft817.c
@@@ -1200,8 -1194,8 +1200,9 @@@ static int ft817_get_ptt(RIG *rig, vfo_
}
}
- *ptt = ((p->tx_status & 0x20) == 0x20);
+ *ptt = p->tx_status != 0xff;
+
+
return RIG_OK;
}
@@@ -1234,8 -1228,9 +1235,9 @@@ static int ft817_get_tx_level(RIG *rig
if (ptt == RIG_PTT_OFF)
{
- val->f = p->swr;
- val->f = p->swr;
- //rig_debug(RIG_DEBUG_VERBOSE, "%s: rig not keyed\n", __func__);
- return RIG_OK; // use known prior value
++
++ val->f = p->swr;
+ return RIG_OK;
}
n = ft817_get_status(rig, FT817_NATIVE_CAT_GET_TX_METERING);
@@@ -1246,7 -1241,8 +1248,8 @@@
}
}
- val->f = rig_raw2val_float(*tx_level, cal);
- p->swr = val->f;
+ p->swr = val->f = rig_raw2val_float(*tx_level, cal);
++
rig_debug(RIG_DEBUG_VERBOSE, "%s: level %f\n", __func__, val->f);
return RIG_OK;
commit 748be3707ff353b25585b12a780a5253f9f2a8de
Author: Christian Bayer <chr...@go...>
Date: Mon Jul 29 17:54:50 2024 +0200
FT-817 power and SWR levels
diff --git a/rigs/yaesu/ft817.c b/rigs/yaesu/ft817.c
index 499e2c019..2234d42a7 100644
--- a/rigs/yaesu/ft817.c
+++ b/rigs/yaesu/ft817.c
@@ -128,6 +128,7 @@ struct ft817_priv_data
/* Digi mode is not part of regular fm_status response.
* So keep track of it in a separate variable. */
unsigned char dig_mode;
+ float swr;
};
static int ft817_init(RIG *rig);
@@ -261,15 +262,15 @@ enum ft817_digi
// Thanks to Olivier Schmitt sc....@gm... for these tables
#define FT817_PWR_CAL { 9, \
{ \
- { 0x00, 0 }, \
- { 0x01, 10 }, \
- { 0x02, 14 }, \
- { 0x03, 20 }, \
- { 0x04, 34 }, \
- { 0x05, 50 }, \
- { 0x06, 66 }, \
- { 0x07, 82 }, \
- { 0x08, 100 } \
+ { 0x00, 0.0f }, \
+ { 0x01, 0.5f }, \
+ { 0x02, 0.75f }, \
+ { 0x03, 1.0f }, \
+ { 0x04, 1.7f }, \
+ { 0x05, 2.5f }, \
+ { 0x06, 3.3f }, \
+ { 0x07, 4.1f }, \
+ { 0x08, 5.0f } \
} }
#define FT817_ALC_CAL { 6, \
@@ -330,7 +331,7 @@ struct rig_caps ft817_caps =
.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_RAWSTR | RIG_LEVEL_RFPOWER |
- RIG_LEVEL_ALC | RIG_LEVEL_SWR,
+ RIG_LEVEL_ALC | RIG_LEVEL_SWR | RIG_LEVEL_RFPOWER_METER_WATTS,
.has_set_level = RIG_LEVEL_BAND_SELECT,
.has_get_parm = RIG_PARM_NONE,
.has_set_parm = RIG_PARM_NONE,
@@ -765,6 +766,7 @@ struct rig_caps ft818_caps =
static int ft817_init(RIG *rig)
{
+ struct ft817_priv_data *p;
rig_debug(RIG_DEBUG_VERBOSE, "%s: called, version %s\n", __func__,
rig->caps->version);
@@ -772,6 +774,9 @@ static int ft817_init(RIG *rig)
{
return -RIG_ENOMEM;
}
+ p = (struct ft817_priv_data *) STATE(rig)->priv;
+
+ p->swr = 10;
return RIG_OK;
}
@@ -979,9 +984,9 @@ static int ft817_get_status(RIG *rig, int status)
/* FT-817 returns 2 bytes with 4 nibbles.
* Extract raw values here;
* convert to float when they are requested. */
- p->swr_level = result[0] & 0xF;
- p->pwr_level = result[0] >> 4;
- p->alc_level = result[1] & 0xF;
+ p->swr_level = (result[1] & 0xF0) >> 4;
+ p->pwr_level = (result[0] & 0xF0) >> 4;
+ p->alc_level = result[0] & 0x0F;
p->mod_level = result[1] >> 4;
rig_debug(RIG_DEBUG_TRACE, "%s: swr: %d, pwr %d, alc %d, mod %d\n",
__func__,
@@ -1168,10 +1173,12 @@ static int ft817_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split,
}
*split = (c[0] & 0x80) ? RIG_SPLIT_ON : RIG_SPLIT_OFF;
+ *tx_vfo = RIG_VFO_A;
}
else
{
*split = (p->tx_status & 0x20) ? RIG_SPLIT_ON : RIG_SPLIT_OFF;
+ *tx_vfo = RIG_VFO_B;
}
return RIG_OK;
@@ -1193,7 +1200,7 @@ static int ft817_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt)
}
}
- *ptt = ((p->tx_status & 0x20) == 0x20);
+ *ptt = p->tx_status != 0xff;
return RIG_OK;
}
@@ -1227,8 +1234,8 @@ static int ft817_get_tx_level(RIG *rig, value_t *val, unsigned char *tx_level,
if (ptt == RIG_PTT_OFF)
{
- rig_debug(RIG_DEBUG_VERBOSE, "%s: rig not keyed\n", __func__);
- return -RIG_ERJCTED; //Or return OK?
+ val->f = p->swr;
+ return RIG_OK;
}
n = ft817_get_status(rig, FT817_NATIVE_CAT_GET_TX_METERING);
@@ -1239,7 +1246,7 @@ static int ft817_get_tx_level(RIG *rig, value_t *val, unsigned char *tx_level,
}
}
- val->f = rig_raw2val_float(*tx_level, cal);
+ p->swr = val->f = rig_raw2val_float(*tx_level, cal);
rig_debug(RIG_DEBUG_VERBOSE, "%s: level %f\n", __func__, val->f);
return RIG_OK;
@@ -1333,6 +1340,10 @@ static int ft817_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
case RIG_LEVEL_SWR:
return ft817_get_tx_level(rig, val, &p->swr_level, &rig->caps->swr_cal);
+ case RIG_LEVEL_RFPOWER_METER_WATTS:
+ return ft817_get_tx_level(rig, val, &p->pwr_level,
+ &rig->caps->rfpower_meter_cal);
+
default:
return -RIG_EINVAL;
}
commit 2b10a3078e98682a0eeb689f8761bbf037f5f498
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sun Jul 28 17:30:37 2024 -0500
Allow FT817 to return prior SWR value when not in transmit
diff --git a/rigs/yaesu/ft817.c b/rigs/yaesu/ft817.c
index 802f5672b..590af3d48 100644
--- a/rigs/yaesu/ft817.c
+++ b/rigs/yaesu/ft817.c
@@ -128,6 +128,7 @@ struct ft817_priv_data
/* Digi mode is not part of regular fm_status response.
* So keep track of it in a separate variable. */
unsigned char dig_mode;
+ float swr;
};
static int ft817_init(RIG *rig);
@@ -309,7 +310,7 @@ struct rig_caps ft817_caps =
RIG_MODEL(RIG_MODEL_FT817),
.model_name = "FT-817",
.mfg_name = "Yaesu",
- .version = "20240728.2",
+ .version = "20240728.3",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
@@ -1227,8 +1228,9 @@ static int ft817_get_tx_level(RIG *rig, value_t *val, unsigned char *tx_level,
if (ptt == RIG_PTT_OFF)
{
- rig_debug(RIG_DEBUG_VERBOSE, "%s: rig not keyed\n", __func__);
- return -RIG_ERJCTED; //Or return OK?
+ val->f = p->swr;
+ //rig_debug(RIG_DEBUG_VERBOSE, "%s: rig not keyed\n", __func__);
+ return RIG_OK; // use known prior value
}
n = ft817_get_status(rig, FT817_NATIVE_CAT_GET_TX_METERING);
@@ -1240,6 +1242,7 @@ static int ft817_get_tx_level(RIG *rig, value_t *val, unsigned char *tx_level,
}
val->f = rig_raw2val_float(*tx_level, cal);
+ p->swr = val->f;
rig_debug(RIG_DEBUG_VERBOSE, "%s: level %f\n", __func__, val->f);
return RIG_OK;
commit 2668605fbd0968dce8126bcbd5357eade65fb9a9
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sun Jul 28 16:58:48 2024 -0500
Fix boo-boo on ft817.c
diff --git a/rigs/yaesu/ft817.c b/rigs/yaesu/ft817.c
index 744107b10..802f5672b 100644
--- a/rigs/yaesu/ft817.c
+++ b/rigs/yaesu/ft817.c
@@ -261,7 +261,7 @@ enum ft817_digi
// Thanks to Olivier Schmitt sc....@gm... for these tables
#define FT817_PWR_CAL { 9, \
{ \
- { 0x00, 0.ss }, \
+ { 0x00, 0.0f }, \
{ 0x01, 0.5f }, \
{ 0x02, 0.75f }, \
{ 0x03, 1.0f }, \
commit ae39040fb12d2366a4c2dca33c5361e271d9a250
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sun Jul 28 16:56:15 2024 -0500
Adjust PWR table for FT817
diff --git a/rigs/yaesu/ft817.c b/rigs/yaesu/ft817.c
index 42bc48ca9..744107b10 100644
--- a/rigs/yaesu/ft817.c
+++ b/rigs/yaesu/ft817.c
@@ -261,15 +261,15 @@ enum ft817_digi
// Thanks to Olivier Schmitt sc....@gm... for these tables
#define FT817_PWR_CAL { 9, \
{ \
- { 0x00, 0 }, \
- { 0x01, 10 }, \
- { 0x02, 14 }, \
- { 0x03, 20 }, \
- { 0x04, 34 }, \
- { 0x05, 50 }, \
- { 0x06, 66 }, \
- { 0x07, 82 }, \
- { 0x08, 100 } \
+ { 0x00, 0.ss }, \
+ { 0x01, 0.5f }, \
+ { 0x02, 0.75f }, \
+ { 0x03, 1.0f }, \
+ { 0x04, 1.7f }, \
+ { 0x05, 2.5f }, \
+ { 0x06, 3.3f }, \
+ { 0x07, 4.1f }, \
+ { 0x08, 5.0f } \
} }
#define FT817_ALC_CAL { 6, \
@@ -283,7 +283,7 @@ enum ft817_digi
} }
// SWR values from Christian WA4YA, DL4YA
-#define FT817_SWR_CAL { 2, \
+#define FT817_SWR_CAL { 16, \
{ \
{ 0, 1.0f }, \
{ 1, 1.4f }, \
@@ -309,7 +309,7 @@ struct rig_caps ft817_caps =
RIG_MODEL(RIG_MODEL_FT817),
.model_name = "FT-817",
.mfg_name = "Yaesu",
- .version = "20240728.0",
+ .version = "20240728.2",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
@@ -1193,7 +1193,7 @@ static int ft817_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt)
}
}
- *ptt = ((p->tx_status & 0x80) == 0);
+ *ptt = ((p->tx_status & 0x20) == 0x20);
return RIG_OK;
}
commit 6db44d6d497d6e1399fde1daaf65d1fcf36f11e3
Author: Christian Bayer <chr...@sa...>
Date: Sun Jul 28 20:00:35 2024 +0200
upstream 817
diff --git a/rigs/yaesu/ft817.c b/rigs/yaesu/ft817.c
index 0b0066b42..499e2c019 100644
--- a/rigs/yaesu/ft817.c
+++ b/rigs/yaesu/ft817.c
@@ -282,10 +282,25 @@ enum ft817_digi
{ 0x05, 100 } \
} }
-#define FT817_SWR_CAL { 2, \
+// SWR values from Christian WA4YA, DL4YA
+#define FT817_SWR_CAL { 16, \
{ \
- { 0, 0 }, \
- { 15, 100 } \
+ { 0, 1.0f }, \
+ { 1, 1.4f }, \
+ { 2, 1.8f }, \
+ { 3, 2.13f }, \
+ { 4, 2.25f }, \
+ { 5, 3.7f }, \
+ { 6, 6.0f }, \
+ { 7, 7.0f }, \
+ { 8, 8.0f }, \
+ { 9, 9.0f }, \
+ { 10, 10.0f }, \
+ { 11, 10.0f }, \
+ { 12, 10.0f }, \
+ { 13, 10.0f }, \
+ { 14, 10.0f }, \
+ { 15, 10.0f } \
} }
@@ -294,7 +309,7 @@ struct rig_caps ft817_caps =
RIG_MODEL(RIG_MODEL_FT817),
.model_name = "FT-817",
.mfg_name = "Yaesu",
- .version = "20240520.0",
+ .version = "20240728.1",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
@@ -1178,7 +1193,7 @@ static int ft817_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt)
}
}
- *ptt = ((p->tx_status & 0x80) == 0);
+ *ptt = ((p->tx_status & 0x20) == 0x20);
return RIG_OK;
}
commit 5ec0b8464572ee7290fe65d11b95e60bb5b76cd3
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sun Jul 28 06:57:54 2024 -0500
Update SWR values for FT817 thanks to Christian WA4YA, DL4YA
diff --git a/rigs/yaesu/ft817.c b/rigs/yaesu/ft817.c
index 0b0066b42..42bc48ca9 100644
--- a/rigs/yaesu/ft817.c
+++ b/rigs/yaesu/ft817.c
@@ -282,10 +282,25 @@ enum ft817_digi
{ 0x05, 100 } \
} }
+// SWR values from Christian WA4YA, DL4YA
#define FT817_SWR_CAL { 2, \
{ \
- { 0, 0 }, \
- { 15, 100 } \
+ { 0, 1.0f }, \
+ { 1, 1.4f }, \
+ { 2, 1.8f }, \
+ { 3, 2.13f }, \
+ { 4, 2.25f }, \
+ { 5, 3.7f }, \
+ { 6, 6.0f }, \
+ { 7, 7.0f }, \
+ { 8, 8.0f }, \
+ { 9, 9.0f }, \
+ { 10, 10.0f }, \
+ { 11, 10.0f }, \
+ { 12, 10.0f }, \
+ { 13, 10.0f }, \
+ { 14, 10.0f }, \
+ { 15, 10.0f } \
} }
@@ -294,7 +309,7 @@ struct rig_caps ft817_caps =
RIG_MODEL(RIG_MODEL_FT817),
.model_name = "FT-817",
.mfg_name = "Yaesu",
- .version = "20240520.0",
+ .version = "20240728.0",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
commit 647b477dc95d3d688e352a125e77993c1f46d652
Author: Mike Black W9MDB <mdb...@ya...>
Date: Fri Jul 26 15:48:44 2024 -0500
Fix x26cmdfails in icom.c
diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c
index 44b90e225..5bc76736d 100644
--- a/rigs/icom/icom.c
+++ b/rigs/icom/icom.c
@@ -2256,7 +2256,7 @@ static int icom_get_mode_x26(RIG *rig, vfo_t vfo, int *mode_len,
const struct icom_priv_caps *priv_caps = rig->caps->priv;
int retval;
- if (priv->x26cmdfails != 0 && priv_caps->x25x26_always==0)
+ if (priv->x26cmdfails > 0 && priv_caps->x25x26_always==0)
{
rig_debug(RIG_DEBUG_WARN, "%s: x26cmdfails=%d, x25x26_always=%d\n", __func__, priv->x26cmdfails, priv_caps->x25x26_always);
return -RIG_ENAVAIL;
diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h
index 370e4c19b..a0477319a 100644
--- a/rigs/icom/icom.h
+++ b/rigs/icom/icom.h
@@ -35,7 +35,7 @@
#include <sys/time.h>
#endif
-#define BACKEND_VER "20240725"
+#define BACKEND_VER "20240726"
#define ICOM_IS_ID31 rig_is_model(rig, RIG_MODEL_ID31)
#define ICOM_IS_ID51 rig_is_model(rig, RIG_MODEL_ID51)
commit 3f59e962e1060e517a10f25310cecff2ccca53d9
Author: Mike Black W9MDB <mdb...@ya...>
Date: Fri Jul 26 07:35:19 2024 -0500
Update simic7100
diff --git a/simulators/simic7100.c b/simulators/simic7100.c
index afeae7de2..213940684 100644
--- a/simulators/simic7100.c
+++ b/simulators/simic7100.c
@@ -25,6 +25,7 @@ struct ip_mreq
#include <termios.h>
#include <unistd.h>
+#undef ECHO
#define BUFSIZE 256
#define X25
@@ -61,7 +62,7 @@ void dumphex(const unsigned char *buf, int n)
int
frameGet(int fd, unsigned char *buf)
{
- int i = 0, n;
+ int i = 0;
memset(buf, 0, BUFSIZE);
unsigned char c;
@@ -77,10 +78,10 @@ again:
char mytime[256];
date_strget(mytime, sizeof(mytime), 1);
printf("%s:", mytime); dumphex(buf, i);
+#ifdef ECHO
// echo
n = write(fd, buf, i);
-
- if (n != i) { printf("%s: error on write: %s\n", __func__, strerror(errno)); }
+#endif
return i;
}
@@ -146,6 +147,13 @@ void frameParse(int fd, unsigned char *frame, int len)
if (powerstat)
{
+ unsigned char frame2[11];
+ memcpy(frame2,frame,11);
+ frame2[2] = 0xe1;
+ frame2[3] = 0x88;
+ dump_hex(frame2,11);
+ n = write(fd, frame2, 11);
+ dump_hex(frame,11);
n = write(fd, frame, 11);
}
@@ -223,8 +231,9 @@ void frameParse(int fd, unsigned char *frame, int len)
if (frame[5] == 0xfd)
{
printf("get split %d\n", 1);
- frame[7] = 0xfd;
- n = write(fd, frame, 8);
+ frame[5] = split;
+ frame[6] = 0xfd;
+ n = write(fd, frame, 7);
}
else
{
commit b718788c9ab46a7b370b74ef77436c9741f8b09b
Author: Mike Black W9MDB <mdb...@ya...>
Date: Thu Jul 25 12:08:23 2024 -0500
Echo detection is now dynamic so can be changed while running
Async packet is now handled correctly...may be tied to the ANT CI-V port
https://github.com/Hamlib/Hamlib/issues/1575
https://github.com/Hamlib/Hamlib/issues/1587
https://github.com/Hamlib/Hamlib/issues/1588
diff --git a/rigs/icom/frame.c b/rigs/icom/frame.c
index 30cfdd225..69ee33ba7 100644
--- a/rigs/icom/frame.c
+++ b/rigs/icom/frame.c
@@ -306,6 +306,7 @@ read_another_frame:
* FIXME: handle padding/collisions
* ACKFRMLEN is the smallest frame we can expect from the rig
*/
+ priv->serial_USB_echo_off = 1;
again2:
buf[0] = 0;
frm_len = read_icom_frame(rp, buf, sizeof(buf));
diff --git a/rigs/icom/ic7100.c b/rigs/icom/ic7100.c
index a7ff0288e..4c2cd7325 100644
--- a/rigs/icom/ic7100.c
+++ b/rigs/icom/ic7100.c
@@ -201,8 +201,8 @@ static const struct icom_priv_caps ic7100_priv_caps =
.extcmds = ic7100_extcmds,
.antack_len = 2,
.ant_count = 2,
- .x25x26_always = 1,
- .x25x26_possibly = 0,
+ .x25x26_always = 0,
+ .x25x26_possibly = 1,
.x1cx03_always = 0,
.x1cx03_possibly = 1,
.x1ax03_supported = 1,
@@ -327,7 +327,7 @@ struct rig_caps ic7100_caps =
RIG_MODEL(RIG_MODEL_IC7100),
.model_name = "IC-7100",
.mfg_name = "Icom",
- .version = BACKEND_VER ".7",
+ .version = BACKEND_VER ".8",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c
index 65f1cfa47..44b90e225 100644
--- a/rigs/icom/icom.c
+++ b/rigs/icom/icom.c
@@ -1152,7 +1152,7 @@ retry_open:
rig_debug(RIG_DEBUG_TRACE, "%s: echo status known, getting frequency\n",
__func__);
rp->retry = 0;
- rs->current_vfo = icom_current_vfo(rig);
+// rs->current_vfo = icom_current_vfo(rig);
// some rigs like the IC7100 still echo when in standby
// so asking for freq now should timeout if such a rig
freq_t tfreq;
@@ -1228,7 +1228,7 @@ retry_open:
rig_get_func(rig, RIG_VFO_CURR, RIG_FUNC_SATMODE, &satmode);
}
- rs->current_vfo = icom_current_vfo(rig);
+ //rs->current_vfo = icom_current_vfo(rig);
}
#if 0 // do not do this here -- needs to be done when ranges are requested instead as this is very slow
@@ -8995,6 +8995,7 @@ int icom_process_async_frame(RIG *rig, size_t frame_length,
*/
switch (frame[4])
{
+ case C_RD_FREQ:
case C_SND_FREQ:
{
// TODO: The freq length might be less than 4 or 5 bytes on older rigs!
diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h
index 2933748b4..370e4c19b 100644
--- a/rigs/icom/icom.h
+++ b/rigs/icom/icom.h
@@ -35,7 +35,7 @@
#include <sys/time.h>
#endif
-#define BACKEND_VER "20240717"
+#define BACKEND_VER "20240725"
#define ICOM_IS_ID31 rig_is_model(rig, RIG_MODEL_ID31)
#define ICOM_IS_ID51 rig_is_model(rig, RIG_MODEL_ID51)
commit 75783cb1255d184c13f13464322ce6ba3c234a4e
Author: Mike Black W9MDB <mdb...@ya...>
Date: Tue Jul 23 09:34:09 2024 -0500
Revert "Try to fix IC-7100 remote operation echo oddity"
Seems to break things severely
This reverts commit ed33a235f4acd515bc415556343b599698958387.
diff --git a/rigs/icom/frame.c b/rigs/icom/frame.c
index ff9ccf348..30cfdd225 100644
--- a/rigs/icom/frame.c
+++ b/rigs/icom/frame.c
@@ -221,10 +221,6 @@ again1:
rig_debug(RIG_DEBUG_VERBOSE, "%s: subcmd x%02d != buf x%02x so retry read\n", __func__, subcmd, buf[5]);
goto again1;
}
- if (sendbuf[3] != buf[2]) { // then the reply controller addr is not the same so skip it
- rig_debug(RIG_DEBUG_VERBOSE, "%s: subcmd x%02d != buf x%02x so retry read\n", __func__, subcmd, buf[5]);
- goto again1;
- }
// we might have 0xfe string during rig wakeup
rig_debug(RIG_DEBUG_TRACE, "%s: DEBUG retval=%d, frm_len=%d, cmd=0x%02x\n",
diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c
index d0cf8779c..65f1cfa47 100644
--- a/rigs/icom/icom.c
+++ b/rigs/icom/icom.c
@@ -8970,7 +8970,8 @@ int icom_is_async_frame(RIG *rig, size_t frame_length,
}
/* Spectrum scope data is not CI-V transceive data, but handled the same way as it is pushed by the rig */
- return frame[2] == BCASTID || (frame[2] == CTRLID && frame[4] == C_CTL_SCP
+ // IC-7100 sends 0xe1 for broadcast frame?
+ return frame[2] == 0xe1 || frame[2] == BCASTID || (frame[2] == CTRLID && frame[4] == C_CTL_SCP
&& frame[5] == S_SCP_DAT);
}
diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h
index 2d64d643d..2933748b4 100644
--- a/rigs/icom/icom.h
+++ b/rigs/icom/icom.h
@@ -35,7 +35,7 @@
#include <sys/time.h>
#endif
-#define BACKEND_VER "20240722"
+#define BACKEND_VER "20240717"
#define ICOM_IS_ID31 rig_is_model(rig, RIG_MODEL_ID31)
#define ICOM_IS_ID51 rig_is_model(rig, RIG_MODEL_ID51)
commit ed33a235f4acd515bc415556343b599698958387
Author: Mike Black W9MDB <mdb...@ya...>
Date: Mon Jul 22 16:57:14 2024 -0500
Try to fix IC-7100 remote operation echo oddity
https://github.com/Hamlib/Hamlib/issues/1575
diff --git a/rigs/icom/frame.c b/rigs/icom/frame.c
index 30cfdd225..ff9ccf348 100644
--- a/rigs/icom/frame.c
+++ b/rigs/icom/frame.c
@@ -221,6 +221,10 @@ again1:
rig_debug(RIG_DEBUG_VERBOSE, "%s: subcmd x%02d != buf x%02x so retry read\n", __func__, subcmd, buf[5]);
goto again1;
}
+ if (sendbuf[3] != buf[2]) { // then the reply controller addr is not the same so skip it
+ rig_debug(RIG_DEBUG_VERBOSE, "%s: subcmd x%02d != buf x%02x so retry read\n", __func__, subcmd, buf[5]);
+ goto again1;
+ }
// we might have 0xfe string during rig wakeup
rig_debug(RIG_DEBUG_TRACE, "%s: DEBUG retval=%d, frm_len=%d, cmd=0x%02x\n",
diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c
index 65f1cfa47..d0cf8779c 100644
--- a/rigs/icom/icom.c
+++ b/rigs/icom/icom.c
@@ -8970,8 +8970,7 @@ int icom_is_async_frame(RIG *rig, size_t frame_length,
}
/* Spectrum scope data is not CI-V transceive data, but handled the same way as it is pushed by the rig */
- // IC-7100 sends 0xe1 for broadcast frame?
- return frame[2] == 0xe1 || frame[2] == BCASTID || (frame[2] == CTRLID && frame[4] == C_CTL_SCP
+ return frame[2] == BCASTID || (frame[2] == CTRLID && frame[4] == C_CTL_SCP
&& frame[5] == S_SCP_DAT);
}
diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h
index 2933748b4..2d64d643d 100644
--- a/rigs/icom/icom.h
+++ b/rigs/icom/icom.h
@@ -35,7 +35,7 @@
#include <sys/time.h>
#endif
-#define BACKEND_VER "20240717"
+#define BACKEND_VER "20240722"
#define ICOM_IS_ID31 rig_is_model(rig, RIG_MODEL_ID31)
#define ICOM_IS_ID51 rig_is_model(rig, RIG_MODEL_ID51)
commit db74acc725aa86d9a153d012cf4fa2dec82e1037
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sun Jul 21 22:22:12 2024 -0500
Try to fix Hilberling PTT again
diff --git a/rigs/kenwood/ts480.c b/rigs/kenwood/ts480.c
index 34f04631a..2f9bc21c5 100644
--- a/rigs/kenwood/ts480.c
+++ b/rigs/kenwood/ts480.c
@@ -1838,7 +1838,7 @@ struct rig_caps pt8000a_caps =
RIG_MODEL(RIG_MODEL_PT8000A),
.model_name = "PT-8000A",
.mfg_name = "Hilberling",
- .version = BACKEND_VER ".2",
+ .version = BACKEND_VER ".3",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
@@ -1979,7 +1979,7 @@ struct rig_caps pt8000a_caps =
.set_split_vfo = kenwood_set_split_vfo,
.get_split_vfo = kenwood_get_split_vfo_if,
.get_ptt = kenwood_get_ptt,
- .set_ptt = qdx_set_ptt,
+ .set_ptt = kenwood_set_ptt,
.get_dcd = kenwood_get_dcd,
.set_powerstat = kenwood_set_powerstat,
.get_powerstat = kenwood_get_powerstat,
commit 673d031d5e6819ab7169ead9947e24b1a9b87476
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sun Jul 21 17:38:40 2024 -0500
Fix Hilbering TQ and AI commands
diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c
index 80216f4d1..22730dcad 100644
--- a/rigs/kenwood/kenwood.c
+++ b/rigs/kenwood/kenwood.c
@@ -378,7 +378,7 @@ transaction_write:
skip |= strncmp(cmdstr, "PS1", 3) == 0;
skip |= strncmp(cmdstr, "PS0", 3) == 0;
skip |= strncmp(cmdstr, "K22", 3) == 0;
- skip |= (rig->caps->rig_model == RIG_MODEL_PT8000A && (strlen(cmdstr) > 3) && (strncmp(cmdstr, "TQ", 2) == 0)); // Skip Hilberling TQn command check
+ skip |= (rig->caps->rig_model == RIG_MODEL_PT8000A && (strncmp(cmdstr, "TQ", 2) == 0)); // Skip Hilberling TQn command check
if (skip)
{
@@ -1083,7 +1083,10 @@ int kenwood_open(RIG *rig)
rig_debug(RIG_DEBUG_VERBOSE, "%s: found the right driver for %s(%u)\n",
__func__, rig->caps->model_name, rig->caps->rig_model);
/* get current AI state so it can be restored */
- kenwood_get_trn(rig, &priv->trn_state); /* ignore errors */
+ if (rig->caps->rig_model != RIG_MODEL_PT8000A) // doesn't know AI command
+ {
+ kenwood_get_trn(rig, &priv->trn_state); /* ignore errors */
+ }
/* Currently we cannot cope with AI mode so turn it off in
case last client left it on */
diff --git a/rigs/kenwood/kenwood.h b/rigs/kenwood/kenwood.h
index ac204d24b..4f9078639 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 "20240713"
+#define BACKEND_VER "20240712"
#define EOM_KEN ';'
#define EOM_TH '\r'
commit 979d2adccf7e7f76821d8c760808341b29f0fd2f
Author: Mike Black W9MDB <mdb...@ya...>
Date: Fri Jul 19 23:10:10 2024 -0500
On EBUSY write we'll do 2 retries with 200ms wait
diff --git a/src/rig.c b/src/rig.c
index d61f46831..4725e83fc 100644
--- a/src/rig.c
+++ b/src/rig.c
@@ -8601,6 +8601,8 @@ void *async_data_handler(void *arg)
}
else
{
+ static int busy_retry=2;
+again:
result = write_block_sync(RIGPORT(rig), frame, frame_length);
if (result < 0)
@@ -8608,6 +8610,10 @@ void *async_data_handler(void *arg)
// TODO: error handling? can writing to a pipe really fail in ways we can recover from?
rig_debug(RIG_DEBUG_ERR, "%s: write_block_sync() failed, result=%d\n", __func__,
result);
+ if (result == EBUSY && --busy_retry>0) { // we can try again
+ hl_usleep(200*1000);
+ goto again;
+ }
continue;
}
}
commit abd6d4f388cb7c236f14025e670e85d124f04655
Author: Mike Black W9MDB <mdb...@ya...>
Date: Fri Jul 19 22:39:12 2024 -0500
Avoid possible segfault
diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c
index 6361380f3..38efffaae 100644
--- a/tests/rigctl_parse.c
+++ b/tests/rigctl_parse.c
@@ -5628,19 +5628,19 @@ declare_proto_rig(set_clock)
&hour,
&min, &sec, &msec, &utc_offset);
}
- else if (arg1[16] == '+' || arg1[16] == '-')
+ else if (arg1 && (arg1[16] == '+' || arg1[16] == '-'))
{
// YYYY-MM-DDTHH:MM+ZZ
n = sscanf(arg1, "%04d-%02d-%02dT%02d:%02d%d", &year, &mon, &day, &hour,
&min, &utc_offset);
}
- else if (arg1[19] == '+' || arg1[19] == '-')
+ else if (arg1 && (arg1[19] == '+' || arg1[19] == '-'))
{
// YYYY-MM-DDTHH:MM:SS+ZZ
n = sscanf(arg1, "%04d-%02d-%02dT%02d:%02d:%02d%d", &year, &mon, &day, &hour,
&min, &sec, &utc_offset);
}
- else if (arg1[23] == '+' || arg1[23] == '-')
+ else if (arg1 && (arg1[23] == '+' || arg1[23] == '-'))
{
// YYYY-MM-DDTHH:MM:SS.SSS+ZZ
n = sscanf(arg1, "%04d-%02d-%02dT%02d:%02d:%02d%lf%d", &year, &mon, &day, &hour,
commit 2e96b91b04eece8b9aeee304a0cbd09002044607
Author: Mike Black W9MDB <mdb...@ya...>
Date: Wed Jul 17 22:43:35 2024 -0500
Add Xiegu X6200
diff --git a/NEWS b/NEWS
index 45f3ae855..e847ac75a 100644
--- a/NEWS
+++ b/NEWS
@@ -13,6 +13,7 @@ Version 5.x -- future
* Change FT1000MP Mark V model names to align with FT1000MP
Version 4.6
+ * Added Xeigu X6200
* Added Commradio CTX-10
* Added Guoehe PMR-171
* Added csntechnoligies.net S.A.T Satellite rotor control
diff --git a/include/hamlib/riglist.h b/include/hamlib/riglist.h
index 958ab1d1a..ad9114c78 100644
--- a/include/hamlib/riglist.h
+++ b/include/hamlib/riglist.h
@@ -296,6 +296,7 @@
#define RIG_MODEL_G90 RIG_MAKE_MODEL(RIG_ICOM, 88) /* Xiegu G90 */
#define RIG_MODEL_X5105 RIG_MAKE_MODEL(RIG_ICOM, 89) /* Xiegu X5105 -- G90 compatible */
#define RIG_MODEL_IC905 RIG_MAKE_MODEL(RIG_ICOM, 90)
+#define RIG_MODEL_X6200 RIG_MAKE_MODEL(RIG_ICOM, 91) /* Xiegu X6200 */
/*
* Optoelectronics (CI-V)
diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c
index 1dfedee7d..65f1cfa47 100644
--- a/rigs/icom/icom.c
+++ b/rigs/icom/icom.c
@@ -9924,6 +9924,7 @@ DECLARE_INITRIG_BACKEND(icom)
rig_register(&x6100_caps);
rig_register(&g90_caps);
rig_register(&x5105_caps);
+ rig_register(&x6200_caps);
return (RIG_OK);
}
diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h
index 575e8558c..2933748b4 100644
--- a/rigs/icom/icom.h
+++ b/rigs/icom/icom.h
@@ -517,6 +517,7 @@ extern struct rig_caps x108g_caps;
extern struct rig_caps x6100_caps;
extern struct rig_caps g90_caps;
extern struct rig_caps x5105_caps;
+extern struct rig_caps x6200_caps;
extern struct rig_caps icr8600_caps;
extern struct rig_caps icr30_caps;
diff --git a/rigs/icom/xiegu.c b/rigs/icom/xiegu.c
index 342250154..6b8301cc4 100644
--- a/rigs/icom/xiegu.c
+++ b/rigs/icom/xiegu.c
@@ -160,7 +160,7 @@ int xiegu_rig_open(RIG *rig)
case 0x0090: rig_debug(RIG_DEBUG_VERBOSE, "%s: Xiegu model %s\n", __func__, "G90S");break;
case 0x0106: rig_debug(RIG_DEBUG_VERBOSE, "%s: Xiegu model %s\n", __func__, "G106/G106C");break;
case 0x6100:
- case 0x00a4: rig_debug(RIG_DEBUG_VERBOSE, "%s: Xiegu model %s\n", __func__, "X6100");break;
+ ...
[truncated message content] |
|
From: n0nb <n0...@us...> - 2024-07-01 23:15:51
|
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 fee7007fb9031869ce38e09f3ce57745b1f32626 (commit)
via 98f6c1aea66f0e7e1090edd69e72aa66ff5cb3ed (commit)
via 85ab6944bd3a452c51aa42574811542b25572f66 (commit)
via 3f909be270a4bffef980d48d2e55cd0869e22771 (commit)
via dbd169a83f03fb837467546923f31ddb33767227 (commit)
via 6aec79b78aeffee6e7f7d339dfc579ee1fc48cb8 (commit)
via 8b0e35ff0ab6ef2037ee5b8bdbbb7fa11dc30f47 (commit)
via 0790f4d72e4947a9ba5c7c4d8747f7eecb6d0cd9 (commit)
via 6996a1222c021326ce34ff3ff760e4f4a1c5b4d8 (commit)
via 23e350ad23d3773e80bad7a614d53ffd370fc30b (commit)
via 8cdef7f4b1001640eef64a2b5fca22fb44b2527e (commit)
via c502556fdb0c9cc0b11d08f490d7c7643b2f0455 (commit)
via 096af1f592b369f314de84159f0aa39788afa456 (commit)
via 06301679d32507f58b3f746c5614f31071947eff (commit)
via cd135de590b2eb16ab06c64f69990de23427678e (commit)
via 1d8d41128a788d2c63ff122b227077a335535c99 (commit)
via 0fe15fa858d25c1f0b047bf93a20f2655456e182 (commit)
via da4f9fbc3e650590d9154af6d51fd24ac5e1b2aa (commit)
via 08c82ddbb5ea412be53edfa419eae76432b4d8b6 (commit)
via 25da0396c93540293afc1dc400699f97fdc999c9 (commit)
via 097f2bbeadca168805e9dbc97f28158169532c0d (commit)
via 81db5ffa5896864a8da083839f62a331e769709e (commit)
via a0be1bfb32ab92ab50a0e1f820e87c78b85e57ee (commit)
via 0b9ff1518c7a439bb96bfbebad62442b88a1947e (commit)
via 5f0fe34dad605d25277dfef11f5fc10d5246ebe5 (commit)
via e09d1611b2b9d73cbd0d713170b54d47c4a15a1e (commit)
via 142f22846c6ae2125c9befd6415e0c0e4d64ac7f (commit)
via 108f52806e1957a2de6ac6933e38c58f81dfc6d1 (commit)
via 0212db94eb34193e8c4927cd36a58264b2b414b4 (commit)
via a462bc19ae1f28a86bd8386ab2dceb3690592493 (commit)
via 697904c882d91c61cf571e3dafa56c0f2e376542 (commit)
via d1520aa166369548d3a0cb46781644e0c2c717e4 (commit)
via 81a8745fcaee0a9ffc296d49d4f710f94359cf38 (commit)
via 86a7a0636c278c5dfdc86baeb9fdb291e559fdc4 (commit)
via 341a205bd7e5765e64a2e5f35ed2264b2cf9e6e2 (commit)
from 5fc4e0b5d0efc8d6f2eaa634046ce2940406b705 (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 fee7007fb9031869ce38e09f3ce57745b1f32626
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sun Jun 30 16:25:58 2024 -0500
Add Android.mk file for commradio
diff --git a/rigs/commradio/Android.mk b/rigs/commradio/Android.mk
new file mode 100644
index 000000000..95bdd0861
--- /dev/null
+++ b/rigs/commradio/Android.mk
@@ -0,0 +1,12 @@
+LOCAL_PATH:= $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := commradio.c ctx10.c frame.c
+LOCAL_MODULE := commradio
+
+LOCAL_CFLAGS :=
+LOCAL_C_INCLUDES := android include src
+LOCAL_LDLIBS := -lhamlib -Lobj/local/$(TARGET_ARCH_ABI)
+
+include $(BUILD_STATIC_LIBRARY)
commit 98f6c1aea66f0e7e1090edd69e72aa66ff5cb3ed
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sun Jun 30 14:58:08 2024 -0500
Add Commradio CTX-10
diff --git a/NEWS b/NEWS
index 5eeb45879..45f3ae855 100644
--- a/NEWS
+++ b/NEWS
@@ -13,6 +13,7 @@ Version 5.x -- future
* Change FT1000MP Mark V model names to align with FT1000MP
Version 4.6
+ * Added Commradio CTX-10
* Added Guoehe PMR-171
* Added csntechnoligies.net S.A.T Satellite rotor control
* Added PSTRotator control
diff --git a/configure.ac b/configure.ac
index cfcd2eb1f..c65e1ac4f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -66,7 +66,7 @@ dnl added to AC_CONFIG_FILES near the end of this file. See README.developer
dnl Beware of duplication should a backend directory include both rig and
dnl rotor definitions, e.g. "dummy". Optional backends will not be listed
dnl here but will be added later, e.g. "winradio".
-RIG_BACKEND_LIST="rigs/adat rigs/alinco rigs/aor rigs/barrett rigs/codan rigs/dorji rigs/drake rigs/dummy rigs/elad rigs/flexradio rigs/icom rigs/icmarine rigs/jrc rigs/kachina rigs/kenwood rigs/kit rigs/lowe rigs/pcr rigs/prm80 rigs/racal rigs/rft rigs/rs rigs/skanti rigs/tapr rigs/tentec rigs/tuner rigs/uniden rigs/winradio rigs/wj rigs/yaesu rigs/gomspace rigs/mds rigs/anytone rigs/motorola"
+RIG_BACKEND_LIST="rigs/adat rigs/alinco rigs/aor rigs/barrett rigs/codan rigs/dorji rigs/drake rigs/dummy rigs/elad rigs/flexradio rigs/icom rigs/icmarine rigs/jrc rigs/kachina rigs/kenwood rigs/kit rigs/lowe rigs/pcr rigs/prm80 rigs/racal rigs/rft rigs/rs rigs/skanti rigs/tapr rigs/tentec rigs/tuner rigs/uniden rigs/winradio rigs/wj rigs/yaesu rigs/gomspace rigs/mds rigs/anytone rigs/motorola rigs/commradio"
ROT_BACKEND_LIST="rotators/amsat rotators/apex rotators/ars rotators/celestron rotators/cnctrk rotators/grbltrk rotators/easycomm rotators/ether6 rotators/flir rotators/fodtrack rotators/gs232a rotators/heathkit rotators/m2 rotators/meade rotators/rotorez rotators/sartek rotators/saebrtrack rotators/spid rotators/ts7400 rotators/prosistel rotators/ioptron rotators/satel rotators/radant"
# Amplifiers are all in the amplifiers directory
AMP_BACKEND_LIST="amplifiers/elecraft amplifiers/gemini amplifiers/expert"
@@ -904,6 +904,7 @@ rigs/alinco/Makefile
rigs/aor/Makefile
rigs/barrett/Makefile
rigs/codan/Makefile
+rigs/commradio/Makefile
rigs/dorji/Makefile
rigs/drake/Makefile
rigs/dummy/Makefile
diff --git a/include/hamlib/riglist.h b/include/hamlib/riglist.h
index c4775fe3d..d09c51aed 100644
--- a/include/hamlib/riglist.h
+++ b/include/hamlib/riglist.h
@@ -688,6 +688,12 @@
#define RIG_BACKEND_MOTOROLA "Motorola"
#define RIG_MODEL_MICOM2 RIG_MAKE_MODEL(RIG_MOTOROLA, 1)
+/*
+ * Commradio / AeroStream Communications
+ */
+#define RIG_COMMRADIO 39
+#define RIG_BACKEND_COMMRADIO "commradio"
+#define RIG_MODEL_CTX10 RIG_MAKE_MODEL(RIG_COMMRADIO, 1)
//! @endcond
diff --git a/rigs/commradio/Makefile.am b/rigs/commradio/Makefile.am
new file mode 100644
index 000000000..85a2d7fe1
--- /dev/null
+++ b/rigs/commradio/Makefile.am
@@ -0,0 +1,6 @@
+COMMRADIOSRC = commradio.c commradio.h frame.c frame.h ctx10.c
+
+noinst_LTLIBRARIES = libhamlib-commradio.la
+libhamlib_commradio_la_SOURCES = $(COMMRADIOSRC)
+
+EXTRA_DIST = Android.mk
diff --git a/rigs/commradio/commradio.c b/rigs/commradio/commradio.c
new file mode 100644
index 000000000..852aedc1b
--- /dev/null
+++ b/rigs/commradio/commradio.c
@@ -0,0 +1,226 @@
+/*
+ * Hamlib CommRadio backend
+ * idk, copyright and GPL here
+ */
+
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <hamlib/rig.h>
+#include <register.h>
+#include <serial.h>
+
+#include "misc.h"
+
+#include "commradio.h"
+#include "frame.h"
+
+
+/*
+ * As far as I can tell, the commands and their structure are the same for the
+ * CR-1a as they are for the CTX-10, but I don't have a CR1a to test with.
+ * I'm putting these functions here in case they are reusable.
+ */
+
+int commradio_transaction(RIG *rig, const unsigned char *cmd, int cmd_len,
+ unsigned char *data, int *data_len)
+{
+ int ret = -RIG_EINTERNAL;
+ struct rig_state *rs;
+
+ ENTERFUNC;
+
+ rs = &rig->state;
+ rs->transaction_active = 1;
+
+ /*
+ * Flush is needed until async mode is done. The CTX-10 sends frames every
+ * time the VFO changes.
+ */
+ rig_flush(&rs->rigport);
+
+ int frame_len;
+ unsigned char frame[3+2*(cmd_len+2)];
+ size_t rx_len = CR_FRAMELENGTH;
+ unsigned char rx[rx_len];
+ frame_len = frame_message(frame, cmd, cmd_len);
+ ret = write_block(&rs->rigport, frame, frame_len);
+ if (ret < RIG_OK)
+ {
+ goto transaction_quit;
+ }
+
+ const char stopset[] = { CR_EOF };
+ ret = read_string(&rs->rigport, rx, rx_len-1, stopset, 1, 0, 1);
+ if (ret < RIG_OK)
+ {
+ goto transaction_quit;
+ }
+ ret = unpack_frame(data, rx, ret);
+ if (ret < RIG_OK)
+ {
+ goto transaction_quit;
+ }
+ *data_len = ret;
+ //TODO: check for error response 0x11
+
+transaction_quit:
+ rs->transaction_active = 0;
+ RETURNFUNC(ret);
+}
+
+
+int commradio_init(RIG *rig)
+{
+ ENTERFUNC;
+ // I can't think of anything that goes in here yet.
+ RETURNFUNC(RIG_OK);
+}
+
+int commradio_cleanup(RIG *rig)
+{
+ ENTERFUNC;
+ // dealloc stuff if it gets added to _init
+ RETURNFUNC(RIG_OK);
+}
+
+int commradio_rig_open(RIG *rig)
+{
+ ENTERFUNC;
+ // Possibly check if our serial port is configured right and we are not
+ // doing bad things to the GPIO lines
+ RETURNFUNC(RIG_OK);
+}
+
+int commradio_rig_close(RIG *rig)
+{
+ ENTERFUNC;
+ // i don't really know
+ RETURNFUNC(RIG_OK);
+}
+
+/*
+ * The CTX-10 sends VFO frequency updates when the knob is turned by the
+ * operator, so this is really a good case for async events. Unfortunately
+ * I can't find any good examples of how to do that, so instead just flush
+ * and send a request...
+ */
+
+int commradio_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
+{
+ const unsigned char cmd[] = {0x32}; // Get frequency request
+ unsigned char data[CR_FRAMELENGTH];
+ int data_len;
+ int ret = -RIG_EINTERNAL;
+
+ ENTERFUNC;
+
+ ret = commradio_transaction(rig, cmd, 1, data, &data_len);
+ if(data_len == 5 && (data[0] == 0x33 || data[0] == 0x34))
+ {
+ *freq = (data[1] << 24 | data[2] << 16 | data[3] << 8 | data[4]);
+ ret = RIG_OK;
+ }
+ else
+ {
+ rig_debug(RIG_DEBUG_ERR, "%s: Unexpected response to 0x32\n", __func__);
+ }
+ RETURNFUNC(ret);
+}
+
+
+int commradio_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
+{
+ unsigned char data[CR_FRAMELENGTH];
+ int data_len;
+ int ret = -RIG_EINTERNAL;
+
+ ENTERFUNC;
+
+ if(freq < 150000 || freq > 30000000)
+ {
+ RETURNFUNC(-RIG_EINVAL);
+ }
+ uint32_t int_freq = freq;
+ rig_debug(RIG_DEBUG_VERBOSE, "%s: Got freq=%f, int_freq=%u\n", __func__,
+ freq, int_freq);
+ unsigned char cmd[] =
+ {
+ 0x30, // Set frequency request
+ 0xFF & (int_freq >> 24),
+ 0xFF & (int_freq >> 16),
+ 0xFF & (int_freq >> 8),
+ 0xFF & (int_freq)
+ };
+
+ ret = commradio_transaction(rig, cmd, 5, data, &data_len);
+ if(data_len == 5 && (data[0] == 0x31 || data[0] == 0x34))
+ {
+ uint32_t new_freq = (data[1] << 24 | data[2] << 16 | data[3] << 8 | data[4]);
+ if(int_freq == new_freq)
+ {
+ RETURNFUNC(RIG_OK);
+ }
+ else
+ {
+ RETURNFUNC(-RIG_ERJCTED);
+ }
+ }
+ // CTX-10 returns 11 02 30 00 00 00 01 if we try to go out of its
+ // general-coverage frequency range 150kHz - 30MHz. I'm not sure why Hamlib
+ // even tries to do this, since its defined in the caps...
+ else
+ {
+ rig_debug(RIG_DEBUG_ERR, "%s: Unexpected response to 0x30\n", __func__);
+ ret = -RIG_ERJCTED;
+ }
+ RETURNFUNC(ret);
+}
+
+/*
+ * Stubs. I'm not aware of a way to get or set the mode on the CTX-10.
+ */
+int commradio_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
+{
+ return (RIG_OK);
+}
+
+int commradio_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
+{
+ *mode = RIG_MODE_NONE;
+ return (RIG_OK);
+}
+
+/*
+ * Stubs. The CTX-10 has only one VFO and split mode doesn't change how it
+ * responds via the serial port.
+ */
+int commradio_set_vfo(RIG *rig, vfo_t vfo)
+{
+ return (RIG_OK);
+}
+
+int commradio_get_vfo(RIG *rig, vfo_t *vfo)
+{
+ *vfo = RIG_VFO_A;
+ return (RIG_OK);
+}
+
+
+DECLARE_INITRIG_BACKEND(commradio)
+{
+ rig_debug(RIG_DEBUG_VERBOSE, "%s: _init called\n", __func__);
+ rig_register(&ctx10_caps);
+
+ return (RIG_OK);
+}
+
+/*
+ * For some reason, I can't get this to even link without this function.
+ */
+DECLARE_PROBERIG_BACKEND(commradio)
+{
+ return (RIG_MODEL_NONE);
+}
+
diff --git a/rigs/commradio/commradio.h b/rigs/commradio/commradio.h
new file mode 100644
index 000000000..f17a8a085
--- /dev/null
+++ b/rigs/commradio/commradio.h
@@ -0,0 +1,21 @@
+
+#ifndef _COMMRADIO_H
+#define _COMMRADIO_H
+
+int commradio_transaction(RIG *rig, const unsigned char *cmd, int cmd_len,
+ unsigned char *data, int *data_len);
+int commradio_init(RIG *rig);
+int commradio_cleanup(RIG *rig);
+int commradio_rig_open(RIG *rig);
+int commradio_rig_close(RIG *rig);
+int commradio_get_freq(RIG *rig, vfo_t vfo, freq_t *freq);
+int commradio_set_freq(RIG *rig, vfo_t vfo, freq_t freq);
+int commradio_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width);
+int commradio_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width);
+int commradio_set_vfo(RIG *rig, vfo_t vfo);
+int commradio_get_vfo(RIG *rig, vfo_t *vfo);
+
+extern struct rig_caps ctx10_caps;
+
+#endif /* _COMMRADIO_H */
+
diff --git a/rigs/commradio/ctx10.c b/rigs/commradio/ctx10.c
new file mode 100644
index 000000000..10782fd1e
--- /dev/null
+++ b/rigs/commradio/ctx10.c
@@ -0,0 +1,95 @@
+
+#include <stdlib.h>
+
+#include "hamlib/rig.h"
+#include "bandplan.h"
+#include "commradio.h"
+
+/*
+ * The CTX-10 has only one VFO, but can be set into some sort of "split" mode
+ * where the screen shows two different frequencies.
+ * So far I have not figured out how to access these via serial.
+ */
+#define CTX10_VFO (RIG_VFO_A)
+
+#define CTX10_RX_MODES (RIG_MODE_CW|RIG_MODE_SSB|RIG_MODE_AM)
+#define CTX10_TX_MODES (RIG_MODE_CW|RIG_MODE_SSB)
+
+struct rig_caps ctx10_caps =
+{
+ RIG_MODEL(RIG_MODEL_CTX10),
+ .model_name = "CTX-10",
+ .mfg_name = "Commradio",
+ .version = "20240118" ".0",
+ .copyright = "LGPL",
+ .status = RIG_STATUS_STABLE,
+ .rig_type = RIG_TYPE_TRANSCEIVER,
+ .ptt_type = RIG_PTT_NONE,
+ .dcd_type = RIG_DCD_NONE,
+ .port_type = RIG_PORT_SERIAL,
+ .serial_rate_min = 3000000,
+ .serial_rate_max = 3000000,
+ .serial_data_bits = 8,
+ .serial_stop_bits = 1,
+ .serial_parity = RIG_PARITY_NONE,
+ .serial_handshake = RIG_HANDSHAKE_NONE,
+ .write_delay = 0,
+ .post_write_delay = 0,
+ .timeout = 1000,
+ .retry = 3,
+ .has_get_func = RIG_FUNC_NONE,
+ .has_set_func = RIG_FUNC_NONE,
+ .has_get_level = RIG_LEVEL_NONE,
+ .has_set_level = RIG_LEVEL_NONE,
+ .has_get_parm = RIG_PARM_NONE,
+ .has_set_parm = RIG_PARM_NONE,
+ .level_gran = {},
+ .parm_gran = {},
+ .ctcss_list = NULL,
+ .dcs_list = NULL,
+ .preamp = { RIG_DBLST_END, },
+ .attenuator = { RIG_DBLST_END, },
+ .max_rit = Hz(0),
+ .max_xit = Hz(0),
+ .max_ifshift = Hz(0),
+ .targetable_vfo = 0,
+ .vfo_ops = (RIG_OP_FROM_VFO|RIG_OP_TO_VFO),
+ .scan_ops = RIG_SCAN_NONE,
+ .transceive = RIG_TRN_OFF,
+ .bank_qty = 0,
+ .chan_desc_sz = 0,
+ .chan_list = { RIG_CHAN_END, },
+ .rx_range_list1 = {
+ {kHz(150), MHz(30), CTX10_RX_MODES, -1, -1, CTX10_VFO, 0},
+ RIG_FRNG_END,
+ },
+ .tx_range_list1 = {
+ FRQ_RNG_80m_REGION2(CTX10_TX_MODES, W(1), W(10), CTX10_VFO, 0),
+ FRQ_RNG_60m_REGION2(CTX10_TX_MODES, W(1), W(10), CTX10_VFO, 0),
+ FRQ_RNG_40m_REGION2(CTX10_TX_MODES, W(1), W(10), CTX10_VFO, 0),
+ FRQ_RNG_30m_REGION2(CTX10_TX_MODES, W(1), W(10), CTX10_VFO, 0),
+ FRQ_RNG_20m_REGION2(CTX10_TX_MODES, W(1), W(10), CTX10_VFO, 0),
+ FRQ_RNG_17m_REGION2(CTX10_TX_MODES, W(1), W(10), CTX10_VFO, 0),
+ FRQ_RNG_15m_REGION2(CTX10_TX_MODES, W(1), W(10), CTX10_VFO, 0),
+ FRQ_RNG_12m_REGION2(CTX10_TX_MODES, W(1), W(10), CTX10_VFO, 0),
+ FRQ_RNG_10m_REGION2(CTX10_TX_MODES, W(1), W(10), CTX10_VFO, 0),
+ },
+ .tuning_steps = {
+ {CTX10_RX_MODES, 10},
+ RIG_TS_END,
+ },
+// .async_data_supported = 1, //TODO: Revisit this
+// .decode_event = commradio_decode_event,
+ .rig_init = commradio_init,
+// .rig_cleanup = commradio_cleanup,
+// .rig_open = commradio_rig_open,
+// .rig_close = commradio_rig_close,
+ .get_freq = commradio_get_freq,
+ .set_freq = commradio_set_freq,
+ .get_mode = commradio_get_mode,
+ .set_mode = commradio_set_mode,
+ .get_vfo = commradio_get_vfo,
+ .set_vfo = commradio_set_vfo,
+ .hamlib_check_rig_caps = HAMLIB_CHECK_RIG_CAPS
+};
+
diff --git a/rigs/commradio/frame.c b/rigs/commradio/frame.c
new file mode 100644
index 000000000..fc1756ab4
--- /dev/null
+++ b/rigs/commradio/frame.c
@@ -0,0 +1,160 @@
+/*
+ * Hamlib CommRadio backend
+ * idk, copyright and GPL here
+ */
+
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <hamlib/rig.h>
+#include <serial.h>
+
+#include "frame.h"
+
+
+/*
+ * Brute-force determined to be polynomial = 0x1021.
+ * Seems to be the same CRC16 as Kermit. Initialized with 0.
+ */
+uint16_t crc16tab[] = {
+ 0, 4489, 8978, 12955, 17956, 22445, 25910, 29887, 35912, 40385,
+ 44890, 48851, 51820, 56293, 59774, 63735, 4225, 264, 13203, 8730,
+ 22181, 18220, 30135, 25662, 40137, 36160, 49115, 44626, 56045, 52068,
+ 63999, 59510, 8450, 12427, 528, 5017, 26406, 30383, 17460, 21949,
+ 44362, 48323, 36440, 40913, 60270, 64231, 51324, 55797, 12675, 8202,
+ 4753, 792, 30631, 26158, 21685, 17724, 48587, 44098, 40665, 36688,
+ 64495, 60006, 55549, 51572, 16900, 21389, 24854, 28831, 1056, 5545,
+ 10034, 14011, 52812, 57285, 60766, 64727, 34920, 39393, 43898, 47859,
+ 21125, 17164, 29079, 24606, 5281, 1320, 14259, 9786, 57037, 53060,
+ 64991, 60502, 39145, 35168, 48123, 43634, 25350, 29327, 16404, 20893,
+ 9506, 13483, 1584, 6073, 61262, 65223, 52316, 56789, 43370, 47331,
+ 35448, 39921, 29575, 25102, 20629, 16668, 13731, 9258, 5809, 1848,
+ 65487, 60998, 56541, 52564, 47595, 43106, 39673, 35696, 33800, 38273,
+ 42778, 46739, 49708, 54181, 57662, 61623, 2112, 6601, 11090, 15067,
+ 20068, 24557, 28022, 31999, 38025, 34048, 47003, 42514, 53933, 49956,
+ 61887, 57398, 6337, 2376, 15315, 10842, 24293, 20332, 32247, 27774,
+ 42250, 46211, 34328, 38801, 58158, 62119, 49212, 53685, 10562, 14539,
+ 2640, 7129, 28518, 32495, 19572, 24061, 46475, 41986, 38553, 34576,
+ 62383, 57894, 53437, 49460, 14787, 10314, 6865, 2904, 32743, 28270,
+ 23797, 19836, 50700, 55173, 58654, 62615, 32808, 37281, 41786, 45747,
+ 19012, 23501, 26966, 30943, 3168, 7657, 12146, 16123, 54925, 50948,
+ 62879, 58390, 37033, 33056, 46011, 41522, 23237, 19276, 31191, 26718,
+ 7393, 3432, 16371, 11898, 59150, 63111, 50204, 54677, 41258, 45219,
+ 33336, 37809, 27462, 31439, 18516, 23005, 11618, 15595, 3696, 8185,
+ 63375, 58886, 54429, 50452, 45483, 40994, 37561, 33584, 31687, 27214,
+ 22741, 18780, 15843, 11370, 7921, 3960
+ };
+
+static uint16_t crc16byte(const unsigned char byte, uint16_t crc)
+{
+ return crc16tab[(crc & 0xFF) ^ byte] ^ (crc >> 8);
+}
+
+static uint16_t crc16(const unsigned char *data, int data_len, uint16_t crc)
+{
+ for (int i = 0; i < data_len; i++)
+ {
+ crc = crc16byte(data[i], crc);
+ }
+ return crc;
+}
+
+static int esc_append(unsigned char frame[], int idx, const unsigned char a)
+{
+ switch(a)
+ {
+ case CR_SOF:
+ case CR_EOF:
+ case CR_ESC:
+ frame[idx] = CR_ESC;
+ frame[idx+1] = a ^ 20;
+ return idx+2;
+ break;
+ default:
+ frame[idx] = a;
+ return idx+1;
+ }
+}
+
+/*
+ * frame[] might be 2x the size of data and crc +3 bytes if it is just a long
+ * string of 0xFC, 0xFD, or 0xFE for some insane reason.
+ *
+ */
+int frame_message(unsigned char frame[], const unsigned char *data,
+ const int data_len)
+{
+ uint16_t crc = 0;
+ frame[0] = CR_SOF;
+ frame[1] = 0x21; /* Messages to the radio are always 0x21 */
+ crc = crc16byte(frame[1], crc);
+ frame[2] = data[0];
+ crc = crc16byte(frame[2], crc);
+ int frame_len = 3;
+ for (int i = 1; i < data_len; i++)
+ {
+ crc = crc16byte(data[i], crc);
+ frame_len = esc_append(frame, frame_len, data[i]);
+ }
+ frame_len = esc_append(frame, frame_len, crc >> 8);
+ frame_len = esc_append(frame, frame_len, crc & 0xFF);
+ frame[frame_len] = CR_EOF;
+ frame_len++;
+ return frame_len;
+}
+
+int unpack_frame(unsigned char msg[], const unsigned char *frame,
+ const int frame_len)
+{
+ if (frame_len < 5)
+ {
+ rig_debug(RIG_DEBUG_ERR,
+ "%s Got a frame that was too small (<5) to be valid\n",
+ __func__);
+ return -RIG_ETRUNC;
+ }
+ if ((frame[0] != CR_SOF) || (frame[frame_len-1] != CR_EOF))
+ {
+ rig_debug(RIG_DEBUG_ERR,
+ "%s Tried to unpack a frame without start or end\n", __func__);
+ return -RIG_EPROTO;
+ }
+ if (frame[1] != 0x11)
+ {
+ rig_debug(RIG_DEBUG_ERR,
+ "%s Message address is not for host (0x11)\n", __func__);
+ return -RIG_EPROTO;
+ }
+ int msg_len = 0;
+ for (int i = 2; i < frame_len; i++)
+ {
+ switch (frame[i])
+ {
+ case CR_SOF:
+ return -RIG_EPROTO;
+ break;
+ case CR_EOF:
+ i = frame_len;
+ break;
+ case CR_ESC:
+ i++;
+ msg[msg_len] = frame[i] ^ 20;
+ msg_len++;
+ break;
+ default:
+ msg[msg_len] = frame[i];
+ msg_len++;
+ }
+ }
+ uint16_t msg_crc = (msg[msg_len-2] << 8) | msg[msg_len-1];
+ msg_len = msg_len-2;
+ uint16_t crc = crc16(msg, msg_len, crc16byte(frame[1],0));
+ if (msg_crc != crc)
+ {
+ rig_debug(RIG_DEBUG_ERR, "%s CRC check failed. msg_crc=%x, crc=%x\n", __func__, msg_crc, crc);
+ }
+ return msg_len;
+}
+
+
diff --git a/rigs/commradio/frame.h b/rigs/commradio/frame.h
new file mode 100644
index 000000000..14458e412
--- /dev/null
+++ b/rigs/commradio/frame.h
@@ -0,0 +1,22 @@
+/*
+ * Hamlib CommRadio backend
+ * idk, copyright and GPL here
+ */
+
+#ifndef _FRAME_H
+#define _FRAME_H
+
+#define CR_SOF 0xFE
+#define CR_EOF 0xFD
+#define CR_ESC 0xFC
+
+//TODO: Find out what the frame length actually is for IQ/spectrum data
+#define CR_FRAMELENGTH 256
+
+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);
+
+#endif /* _FRAME_H */
+
diff --git a/src/register.c b/src/register.c
index e011c0294..68bb96ebe 100644
--- a/src/register.c
+++ b/src/register.c
@@ -91,6 +91,7 @@ DEFINE_INITRIG_BACKEND(gomspace);
DEFINE_INITRIG_BACKEND(mds);
DEFINE_INITRIG_BACKEND(anytone);
DEFINE_INITRIG_BACKEND(motorola);
+DEFINE_INITRIG_BACKEND(commradio);
//! @endcond
#ifdef HAVE_WINRADIO
@@ -152,6 +153,7 @@ static struct
{ RIG_MDS, RIG_BACKEND_MDS, RIG_FUNCNAMA(mds) },
{ RIG_ANYTONE, RIG_BACKEND_ANYTONE, RIG_FUNCNAMA(anytone) },
{ RIG_MOTOROLA, RIG_BACKEND_MOTOROLA, RIG_FUNCNAMA(motorola) },
+ { RIG_COMMRADIO, RIG_BACKEND_COMMRADIO, RIG_FUNCNAM(commradio) },
{ 0, NULL }, /* end */
};
commit 85ab6944bd3a452c51aa42574811542b25572f66
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sat Jun 29 15:40:30 2024 -0500
Add 100ms delay to qdx_set_ptt to flush whatever response the Hilbering PT8000A is sending
diff --git a/rigs/kenwood/ts480.c b/rigs/kenwood/ts480.c
index 2a72bbab0..34f04631a 100644
--- a/rigs/kenwood/ts480.c
+++ b/rigs/kenwood/ts480.c
@@ -1219,6 +1219,7 @@ int ts480_init(RIG *rig)
int qdx_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt)
{
const char *ptt_cmd;
+ struct hamlib_port *rp = RIGPORT(rig);
ENTERFUNC;
rig_debug(RIG_DEBUG_VERBOSE, "%s: ptt=%d\n", __func__, ptt);
@@ -1234,7 +1235,8 @@ int qdx_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt)
int retval = kenwood_transaction(rig, ptt_cmd, NULL, 0);
- //if (ptt == RIG_PTT_OFF) { hl_usleep(100 * 1000); } // a little time for PTT to turn off
+ hl_usleep(100 * 1000); // a little time for PTT to return whatever it returns which we ignore
+ rig_flush(rp);
RETURNFUNC(retval);
}
@@ -1836,7 +1838,7 @@ struct rig_caps pt8000a_caps =
RIG_MODEL(RIG_MODEL_PT8000A),
.model_name = "PT-8000A",
.mfg_name = "Hilberling",
- .version = BACKEND_VER ".1",
+ .version = BACKEND_VER ".2",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
commit 3f909be270a4bffef980d48d2e55cd0869e22771
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sat Jun 29 15:36:49 2024 -0500
Fix Hilberling TQ command by ignoring ID check
diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c
index d88a2000a..be3302a2c 100644
--- a/rigs/kenwood/kenwood.c
+++ b/rigs/kenwood/kenwood.c
@@ -378,6 +378,7 @@ transaction_write:
skip |= strncmp(cmdstr, "PS1", 3) == 0;
skip |= strncmp(cmdstr, "PS0", 3) == 0;
skip |= strncmp(cmdstr, "K22", 3) == 0;
+ skip |= strncmp(cmdstr, "TQ", 2) == 0; // Skip Hilberling TQ command check
if (skip)
{
diff --git a/rigs/kenwood/kenwood.h b/rigs/kenwood/kenwood.h
index bbbeac31b..70ee75608 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 "20240511"
+#define BACKEND_VER "20240629"
#define EOM_KEN ';'
#define EOM_TH '\r'
commit dbd169a83f03fb837467546923f31ddb33767227
Merge: 6aec79b78 8b0e35ff0
Author: Mike Black W9MDB <mdb...@ya...>
Date: Wed Jun 26 22:13:06 2024 -0500
Merge branch 'master' of https://github.com/Hamlib/Hamlib
commit 6aec79b78aeffee6e7f7d339dfc579ee1fc48cb8
Author: Mike Black W9MDB <mdb...@ya...>
Date: Wed Jun 26 22:12:36 2024 -0500
Avoid segfault on 32-bit RigPi -- time_t size may be 32-bit
diff --git a/src/misc.c b/src/misc.c
index 4b4398230..24e604fab 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -3098,8 +3098,10 @@ int rig_test_2038(RIG *rig)
if (s == NULL) { failed = 1; }
+#if 0 // this fails on 32-bit RigPi -- time_t 32-bit maybe?
else rig_debug(RIG_DEBUG_VERBOSE, "%s: time_t 2038 test = 0x%08lx:%s", __func__, x,
s == NULL ? "NULL" : s);
+#endif
#endif
commit 8b0e35ff0ab6ef2037ee5b8bdbbb7fa11dc30f47
Merge: da4f9fbc3 0790f4d72
Author: Michael Black <mdb...@ya...>
Date: Wed Jun 26 16:07:21 2024 -0500
Merge pull request #1570 from GeoBaltz/fix15
Balance ENTERFUNC/RETURNFUNC calls
commit 0790f4d72e4947a9ba5c7c4d8747f7eecb6d0cd9
Author: George Baltz N3GB <Geo...@gm...>
Date: Wed Jun 26 16:44:04 2024 -0400
Fix ENTERFUNC/RETURNFUNC imbalances found by repaired func_chk
diff --git a/rigs/dummy/dummy.c b/rigs/dummy/dummy.c
index 3c2d8c662..044d7c972 100644
--- a/rigs/dummy/dummy.c
+++ b/rigs/dummy/dummy.c
@@ -435,7 +435,7 @@ static int dummy_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
if (rig == NULL)
{
rig_debug(RIG_DEBUG_ERR, "%s: rig is NULL!!!\n", __func__);
- return -RIG_EINVAL;
+ RETURNFUNC(-RIG_EINVAL);
}
priv = (struct dummy_priv_data *)STATE(rig)->priv;
diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c
index f3fe13e9a..eea6eae27 100644
--- a/rigs/icom/icom.c
+++ b/rigs/icom/icom.c
@@ -2134,12 +2134,12 @@ int icom_set_dsp_flt(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
if (priv->no_1a_03_cmd == ENUM_1A_03_UNK)
{
priv->no_1a_03_cmd = ENUM_1A_03_NO; /* do not keep asking */
- return (RIG_OK);
+ RETURNFUNC(RIG_OK);
}
else
{
rig_debug(RIG_DEBUG_ERR, "%s: 1A 03 %02x failed\n", __func__, flt_ext);
- return (retval);
+ RETURNFUNC(retval);
}
}
@@ -5219,7 +5219,7 @@ int icom_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt)
if ((retval = icom_check_ack(ack_len, ackbuf)) != RIG_OK)
{
- RETURNFUNC2(retval);
+ RETURNFUNC(retval);
}
RETURNFUNC(RIG_OK);
@@ -5347,7 +5347,7 @@ int icom_set_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t rptr_shift)
if ((retval = icom_check_ack(ack_len, ackbuf)) != RIG_OK)
{
- RETURNFUNC2(retval);
+ RETURNFUNC(retval);
}
RETURNFUNC(RIG_OK);
@@ -5446,7 +5446,7 @@ int icom_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t rptr_offs)
if ((retval = icom_check_ack(ack_len, ackbuf)) != RIG_OK)
{
- RETURNFUNC2(retval);
+ RETURNFUNC(retval);
}
RETURNFUNC(RIG_OK);
@@ -7549,7 +7549,7 @@ int icom_set_ctcss_tone(RIG *rig, vfo_t vfo, tone_t tone)
if ((retval = icom_check_ack(ack_len, ackbuf)) != RIG_OK)
{
- RETURNFUNC2(retval);
+ RETURNFUNC(retval);
}
RETURNFUNC(RIG_OK);
@@ -7740,7 +7740,7 @@ int icom_set_dcs_code(RIG *rig, vfo_t vfo, tone_t code)
if ((retval = icom_check_ack(ack_len, ackbuf)) != RIG_OK)
{
- RETURNFUNC2(retval);
+ RETURNFUNC(retval);
}
RETURNFUNC(RIG_OK);
@@ -7837,7 +7837,7 @@ int icom_set_dcs_sql(RIG *rig, vfo_t vfo, tone_t code)
if ((retval = icom_check_ack(ack_len, ackbuf)) != RIG_OK)
{
- RETURNFUNC2(retval);
+ RETURNFUNC(retval);
}
RETURNFUNC(RIG_OK);
@@ -8248,7 +8248,7 @@ int icom_set_bank(RIG *rig, vfo_t vfo, int bank)
if ((retval = icom_check_ack(ack_len, ackbuf)) != RIG_OK)
{
- RETURNFUNC2(retval);
+ RETURNFUNC(retval);
}
RETURNFUNC(RIG_OK);
@@ -8671,7 +8671,7 @@ int icom_scan(RIG *rig, vfo_t vfo, scan_t scan, int ch)
if ((retval = icom_check_ack(ack_len, ackbuf)) != RIG_OK)
{
- RETURNFUNC2(retval);
+ RETURNFUNC(retval);
}
RETURNFUNC(RIG_OK);
@@ -8719,7 +8719,7 @@ morse_retry:
}
}
- RETURNFUNC2(retval);
+ RETURNFUNC(retval);
}
RETURNFUNC(RIG_OK);
diff --git a/rigs/kenwood/ts2000.c b/rigs/kenwood/ts2000.c
index feed1ecf1..6936b7a68 100644
--- a/rigs/kenwood/ts2000.c
+++ b/rigs/kenwood/ts2000.c
@@ -620,7 +620,7 @@ static int ts2000_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
}
val->f = levelint / (float) 255;
- return RIG_OK;
+ RETURNFUNC(RIG_OK);
case RIG_LEVEL_SQL:
SNPRINTF(cmdbuf, sizeof(cmdbuf), "SQ%c", vfo_num);
diff --git a/rigs/kenwood/ts480.c b/rigs/kenwood/ts480.c
index 0ecefc1af..2a72bbab0 100644
--- a/rigs/kenwood/ts480.c
+++ b/rigs/kenwood/ts480.c
@@ -742,7 +742,7 @@ kenwood_ts480_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
}
default:
- return kenwood_get_level(rig, vfo, level, val);
+ RETURNFUNC(kenwood_get_level(rig, vfo, level, val));
}
RETURNFUNC(RIG_OK);
diff --git a/rigs/kenwood/ts590.c b/rigs/kenwood/ts590.c
index b647f9554..6acc9f17f 100644
--- a/rigs/kenwood/ts590.c
+++ b/rigs/kenwood/ts590.c
@@ -610,7 +610,7 @@ static int ts590_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
default:
rig_debug(RIG_DEBUG_ERR, "%s: unsupported agc value", __func__);
- return -RIG_EINVAL;
+ RETURNFUNC(-RIG_EINVAL);
}
SNPRINTF(levelbuf, sizeof(levelbuf), "GT%02d", kenwood_val);
@@ -1004,7 +1004,7 @@ static int ts590_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
break;
default:
- return -RIG_ENAVAIL;
+ RETURNFUNC(-RIG_ENAVAIL);
}
break;
diff --git a/rigs/motorola/micom.c b/rigs/motorola/micom.c
index 7d26a30f4..9734316e6 100644
--- a/rigs/motorola/micom.c
+++ b/rigs/motorola/micom.c
@@ -170,7 +170,7 @@ static int micom_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
write_block(rp, ack, sizeof(ack));
set_transaction_inactive(rig);
*freq = (reply[4] << 24) | (reply[5] << 16) | (reply[6] << 8) | reply[7];
- RETURNFUNC(RIG_OK);
+ RETURNFUNC2(RIG_OK);
}
static int micom_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt)
diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c
index 3c7e9b067..e87ac16ae 100644
--- a/rigs/yaesu/newcat.c
+++ b/rigs/yaesu/newcat.c
@@ -1037,12 +1037,12 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
__func__, rig_strvfo(vfo), rig_strvfo(rig_s->tx_vfo));
// when in split we can change VFOB but not VFOA
- if (cachep->split == RIG_SPLIT_ON && target_vfo == '0') { return -RIG_ENTARGET; }
+ if (cachep->split == RIG_SPLIT_ON && target_vfo == '0') { RETURNFUNC(-RIG_ENTARGET); }
// when not in split we can't change VFOA at all
- if (cachep->split == RIG_SPLIT_OFF && target_vfo == '0') { return -RIG_ENTARGET; }
+ if (cachep->split == RIG_SPLIT_OFF && target_vfo == '0') { RETURNFUNC(-RIG_ENTARGET); }
- if (vfo != rig_s->tx_vfo) { return -RIG_ENTARGET; }
+ if (vfo != rig_s->tx_vfo) { RETURNFUNC(-RIG_ENTARGET); }
}
if (is_ftdx3000 || is_ftdx3000dm || is_ftdx5000 || is_ftdx1200)
@@ -1069,7 +1069,7 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
}
while (err == RIG_OK && ptt == RIG_PTT_ON && retry-- > 0);
- if (ptt) { return -RIG_ENTARGET; }
+ if (ptt) { RETURNFUNC(-RIG_ENTARGET); }
}
if (RIG_MODEL_FT450 == caps->rig_model)
@@ -5129,7 +5129,7 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
{
rig_debug(RIG_DEBUG_VERBOSE, "%s: rig cannot read MG in CW/RTTY modes\n",
__func__);
- return RIG_OK;
+ RETURNFUNC(RIG_OK);
}
if (is_ft991 || is_ft710 || is_ftdx3000 || is_ftdx3000dm || is_ftdx5000
@@ -6961,7 +6961,7 @@ int newcat_set_parm(RIG *rig, setting_t parm, value_t val)
default:
rig_debug(RIG_DEBUG_ERR, "%s: Unknown band %s=%d\n", __func__, val.s, rigband);
- return -RIG_EINVAL;
+ RETURNFUNC(-RIG_EINVAL);
}
SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "BS%02d%c", band, cat_term);
@@ -7646,7 +7646,7 @@ int newcat_scan(RIG *rig, vfo_t vfo, scan_t scan, int ch)
ENTERFUNC;
- if (scan != RIG_SCAN_VFO) { RETURNFUNC2(-RIG_EINVAL); }
+ if (scan != RIG_SCAN_VFO) { RETURNFUNC(-RIG_EINVAL); }
SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "SC%d%c",
scan == RIG_SCAN_STOP ? 0 : ch, cat_term);
@@ -7655,10 +7655,10 @@ int newcat_scan(RIG *rig, vfo_t vfo, scan_t scan, int ch)
{
rig_debug(RIG_DEBUG_VERBOSE, "%s:%d command err = %d\n", __func__, __LINE__,
retval);
- RETURNFUNC2(retval);
+ RETURNFUNC(retval);
}
- RETURNFUNC2(retval);
+ RETURNFUNC(retval);
}
commit 6996a1222c021326ce34ff3ff760e4f4a1c5b4d8
Author: George Baltz N3GB <Geo...@gm...>
Date: Wed Jun 26 10:08:40 2024 -0400
Fix func_chk to do useful things
Allow multiple input files
Do analysis on function-by-function basis
Add 'return' to processing
Fix some false positives in comments
diff --git a/tests/func_chk.c b/tests/func_chk.c
index 76161f32a..31dfd19ed 100644
--- a/tests/func_chk.c
+++ b/tests/func_chk.c
@@ -1,48 +1,93 @@
-/* this can change for balanced ENTERFUNC/RETURNFUNC statements */
+/* This can check for balanced ENTERFUNC/RETURNFUNC statements */
/* RETURNFUNC2 is used when ENTERFUNC is not used in a function */
+//
+// Still may give false positives for /* */ comments or string literals
+// Have to live with them until we can "borrow" a C parser/tokenizer
+// that doesn't bloat the build requirements.
+//
+// Note that this is very dependent on the Hamlib coding style
#include <stdio.h>
#include <string.h>
int main(int argc, const char *argv[])
{
char buf[4096];
- char buf2[4096];
- FILE *fp = fopen(argv[1], "r");
- int linenum = 0;
- int enterfunc = 0;
+ const char *fname;
+ char *s;
+ FILE *fp;
+ int idx, inafunc;
+ int linenum;
+ int enterfunc;
int retval = 0;
- retval = 0;
- while (fgets(buf, sizeof(buf), fp))
- {
- ++linenum;
- buf[16] = 0;
+ for (idx = 1; idx < argc; idx++)
+ {
+ fp = fopen(argv[idx], "r");
+ if (fp == NULL) { fprintf(stderr, "Can't open %s\n", argv[idx]); continue;}
+#if 0
+ if (!(fname = strrchr(argv[idx], '/')))
+ {
+ fname = argv[idx];
+ }
+ else
+ {
+ fname++;
+ }
+#else
+ fname = argv[idx];
+#endif
+ linenum = enterfunc = inafunc = 0;
- if (strstr(buf, "ENTERFUNC;")) { enterfunc = 1; }
+ while (fgets(buf, sizeof(buf), fp))
+ {
+ ++linenum;
- if (enterfunc && strstr(buf, "RETURNFUNC2"))
- {
- printf("Line#%d need RETURNFUNC %s\n", linenum, argv[1]);
- retval = 1;
- }
+ if (buf[0] == '{')
+ { //start of a function definition
+ inafunc = 1;
+ enterfunc = 0;
+ continue;
+ }
+ else if (buf[0] == '}')
+ { // end of function definition; back to comments
+ inafunc = 0;
+ }
- strcpy(buf2, buf);
- buf2[15] = 0; // truncate the string
+ if (!inafunc)
+ { // Not in a function, ignore everything
+ continue;
+ }
- if (!enterfunc && strstr(buf2, "RETURNFUNC("))
- {
- printf("Line#%d need RETURNFUNC2 %s\n", linenum, argv[1]);
- retval = 1;
- }
+ // Take care of // comments
+ if ((s = strstr(buf, "//")))
+ {
+ *s = '\0';
+ }
- if (strstr(buf2, "RETURNFUNC("))
- {
- if (enterfunc == 0) { printf("Line#%d no matching ENTERFUNC %s\n", linenum, argv[1]); }
+ if (strstr(buf, "ENTERFUNC;")) { enterfunc = 1; }
- enterfunc = 0;
- }
- }
+ if (enterfunc && (strstr(buf, "RETURNFUNC2") || strstr(buf, "return ")
+ || strstr(buf, "return;")))
+ {
+ printf("%s:%d need RETURNFUNC\n", fname, linenum);
+ retval = 1;
+ }
- fclose(fp);
+ //TODO: Fix next to make a better guess at what's missing
+ if (!enterfunc && strstr(buf, "RETURNFUNC("))
+ {
+ printf("%s:%d need RETURNFUNC2\n", fname, linenum);
+ retval = 1;
+ }
+
+ if (strstr(buf, "RETURNFUNC("))
+ {
+ if (enterfunc == 0) { printf("%s:%d no matching ENTERFUNC\n", fname, linenum); }
+ }
+ }
+
+ //printf("%s:%d Done\n", fname, linenum);
+ fclose(fp);
+ }
return retval;
}
commit 23e350ad23d3773e80bad7a614d53ffd370fc30b
Author: George Baltz N3GB <Geo...@gm...>
Date: Tue Jun 25 20:53:29 2024 -0400
Get rid of some false positives for func_chk
Comments only.
diff --git a/src/rig.c b/src/rig.c
index d0f519eea..c42bde1b5 100644
--- a/src/rig.c
+++ b/src/rig.c
@@ -2609,7 +2609,7 @@ int HAMLIB_API rig_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
rig_cache_show(rig, __func__, __LINE__);
rig_set_cache_freq(rig, vfo, *freq);
rig_cache_show(rig, __func__, __LINE__);
- /* return the first error code */
+ /* Return the first error code */
retcode = rc2;
}
}
@@ -2850,7 +2850,7 @@ int HAMLIB_API rig_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
/* try and revert even if we had an error above */
rc2 = caps->set_vfo(rig, curr_vfo);
- /* return the first error code */
+ /* Return the first error code */
if (retcode == RIG_OK)
{
retcode = rc2;
@@ -3019,7 +3019,7 @@ int HAMLIB_API rig_get_mode(RIG *rig,
if (RIG_OK == retcode)
{
- /* return the first error code */
+ /* Return the first error code */
retcode = rc2;
}
}
@@ -3613,7 +3613,7 @@ int HAMLIB_API rig_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt)
rc2 = caps->set_vfo(rig, curr_vfo);
}
- /* return the first error code */
+ /* Return the first error code */
if (RIG_OK == retcode)
{
retcode = rc2;
@@ -3908,7 +3908,7 @@ int HAMLIB_API rig_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt)
if (RIG_OK == retcode)
{
- /* return the first error code */
+ /* Return the first error code */
retcode = rc2;
cachep->ptt = *ptt;
elapsed_ms(&cachep->time_ptt, HAMLIB_ELAPSED_SET);
@@ -4173,7 +4173,7 @@ int HAMLIB_API rig_get_dcd(RIG *rig, vfo_t vfo, dcd_t *dcd)
if (RIG_OK == retcode)
{
- /* return the first error code */
+ /* Return the first error code */
retcode = rc2;
}
@@ -4305,7 +4305,7 @@ int HAMLIB_API rig_set_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t rptr_shift)
if (RIG_OK == retcode)
{
- /* return the first error code */
+ /* Return the first error code */
retcode = rc2;
}
@@ -4389,7 +4389,7 @@ int HAMLIB_API rig_get_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t *rptr_shift)
if (RIG_OK == retcode)
{
- /* return the first error code */
+ /* Return the first error code */
retcode = rc2;
}
@@ -4466,7 +4466,7 @@ int HAMLIB_API rig_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t rptr_offs)
if (RIG_OK == retcode)
{
- /* return the first error code */
+ /* Return the first error code */
retcode = rc2;
}
@@ -4549,7 +4549,7 @@ int HAMLIB_API rig_get_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t *rptr_offs)
if (RIG_OK == retcode)
{
- /* return the first error code */
+ /* Return the first error code */
retcode = rc2;
}
@@ -4738,7 +4738,7 @@ int HAMLIB_API rig_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq)
if (RIG_OK == retcode)
{
- /* return the first error code */
+ /* Return the first error code */
retcode = rc2;
}
@@ -4908,7 +4908,7 @@ int HAMLIB_API rig_get_split_freq(RIG *rig, vfo_t vfo, freq_t *tx_freq)
if (RIG_OK == retcode)
{
- /* return the first error code */
+ /* Return the first error code */
retcode = rc2;
}
@@ -5144,7 +5144,7 @@ int HAMLIB_API rig_set_split_mode(RIG *rig,
if (RIG_OK == retcode)
{
- /* return the first error code */
+ /* Return the first error code */
retcode = rc2;
}
@@ -5299,7 +5299,7 @@ int HAMLIB_API rig_get_split_mode(RIG *rig, vfo_t vfo, rmode_t *tx_mode,
if (RIG_OK == retcode)
{
- /* return the first error code */
+ /* Return the first error code */
retcode = rc2;
}
@@ -5761,7 +5761,7 @@ int HAMLIB_API rig_set_split_vfo(RIG *rig,
if (RIG_OK == retcode)
{
- /* return the first error code */
+ /* Return the first error code */
retcode = rc2;
}
}
@@ -5962,7 +5962,7 @@ int HAMLIB_API rig_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit)
if (RIG_OK == retcode)
{
- /* return the first error code */
+ /* Return the first error code */
retcode = rc2;
}
@@ -6040,7 +6040,7 @@ int HAMLIB_API rig_get_rit(RIG *rig, vfo_t vfo, shortfreq_t *rit)
if (RIG_OK == retcode)
{
- /* return the first error code */
+ /* Return the first error code */
retcode = rc2;
}
@@ -6112,7 +6112,7 @@ int HAMLIB_API rig_set_xit(RIG *rig, vfo_t vfo, shortfreq_t xit)
if (RIG_OK == retcode)
{
- /* return the first error code */
+ /* Return the first error code */
retcode = rc2;
}
@@ -6190,7 +6190,7 @@ int HAMLIB_API rig_get_xit(RIG *rig, vfo_t vfo, shortfreq_t *xit)
if (RIG_OK == retcode)
{
- /* return the first error code */
+ /* Return the first error code */
retcode = rc2;
}
@@ -6262,7 +6262,7 @@ int HAMLIB_API rig_set_ts(RIG *rig, vfo_t vfo, shortfreq_t ts)
if (RIG_OK == retcode)
{
- /* return the first error code */
+ /* Return the first error code */
retcode = rc2;
}
@@ -6339,7 +6339,7 @@ int HAMLIB_API rig_get_ts(RIG *rig, vfo_t vfo, shortfreq_t *ts)
if (RIG_OK == retcode)
{
- /* return the first error code */
+ /* Return the first error code */
retcode = rc2;
}
@@ -6417,7 +6417,7 @@ int HAMLIB_API rig_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option)
if (RIG_OK == retcode)
{
- /* return the first error code */
+ /* Return the first error code */
retcode = rc2;
}
@@ -6511,7 +6511,7 @@ int HAMLIB_API rig_get_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t *option,
if (RIG_OK == retcode)
{
- /* return the first error code */
+ /* Return the first error code */
retcode = rc2;
}
@@ -7018,7 +7018,7 @@ int HAMLIB_API rig_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op)
if (RIG_OK == retcode)
{
- /* return the first error code */
+ /* Return the first error code */
retcode = rc2;
}
@@ -7126,7 +7126,7 @@ int HAMLIB_API rig_scan(RIG *rig, vfo_t vfo, scan_t scan, int ch)
if (RIG_OK == retcode)
{
- /* return the first error code */
+ /* Return the first error code */
retcode = rc2;
}
@@ -7202,7 +7202,7 @@ int HAMLIB_API rig_send_dtmf(RIG *rig, vfo_t vfo, const char *digits)
if (RIG_OK == retcode)
{
- /* return the first error code */
+ /* Return the first error code */
retcode = rc2;
}
@@ -7279,7 +7279,7 @@ int HAMLIB_API rig_recv_dtmf(RIG *rig, vfo_t vfo, char *digits, int *length)
if (RIG_OK == retcode)
{
- /* return the first error code */
+ /* Return the first error code */
retcode = rc2;
}
@@ -7376,7 +7376,7 @@ int HAMLIB_API rig_send_morse(RIG *rig, vfo_t vfo, const char *msg)
if (RIG_OK == retcode)
{
- /* return the first error code */
+ /* Return the first error code */
retcode = rc2;
}
@@ -7445,7 +7445,7 @@ int HAMLIB_API rig_stop_morse(RIG *rig, vfo_t vfo)
if (RIG_OK == retcode)
{
- /* return the first error code */
+ /* Return the first error code */
retcode = rc2;
}
@@ -7545,7 +7545,7 @@ int HAMLIB_API rig_wait_morse(RIG *rig, vfo_t vfo)
if (RIG_OK == retcode)
{
- /* return the first error code */
+ /* Return the first error code */
retcode = rc2;
}
@@ -7616,7 +7616,7 @@ int HAMLIB_API rig_send_voice_mem(RIG *rig, vfo_t vfo, int ch)
if (RIG_OK == retcode)
{
- /* return the first error code */
+ /* Return the first error code */
retcode = rc2;
}
commit 8cdef7f4b1001640eef64a2b5fca22fb44b2527e
Author: George Baltz N3GB <Geo...@gm...>
Date: Tue Jun 25 03:25:56 2024 -0400
Finish balancing
diff --git a/rigs/yaesu/ft1000mp.c b/rigs/yaesu/ft1000mp.c
index c15f77d88..0c177b2b4 100644
--- a/rigs/yaesu/ft1000mp.c
+++ b/rigs/yaesu/ft1000mp.c
@@ -1792,6 +1792,7 @@ static int ft1000mp_set_split_mode(RIG *rig, vfo_t vfo, rmode_t tx_mode,
pbwidth_t tx_width)
{
int retval;
+ ENTERFUNC;
retval = rig_set_mode(rig, RIG_VFO_B, tx_mode, tx_width);
RETURNFUNC(retval);
}
@@ -1800,6 +1801,7 @@ static int ft1000mp_get_split_mode(RIG *rig, vfo_t vfo, rmode_t *tx_mode,
pbwidth_t *tx_width)
{
int retval;
+ ENTERFUNC;
retval = rig_get_mode(rig, RIG_VFO_B, tx_mode, tx_width);
RETURNFUNC(retval);
}
@@ -1808,6 +1810,7 @@ static int ft1000mp_set_split_freq_mode(RIG *rig, vfo_t vfo, freq_t freq,
rmode_t mode, pbwidth_t width)
{
int retval;
+ ENTERFUNC;
retval = rig_set_mode(rig, RIG_VFO_B, mode, width);
if (retval != RIG_OK)
@@ -1832,6 +1835,7 @@ static int ft1000mp_get_split_freq_mode(RIG *rig, vfo_t vfo, freq_t *freq,
rmode_t *mode, pbwidth_t *width)
{
int retval;
+ ENTERFUNC;
retval = rig_get_mode(rig, RIG_VFO_B, mode, width);
if (retval != RIG_OK)
diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c
index 2219f18aa..3c7e9b067 100644
--- a/rigs/yaesu/newcat.c
+++ b/rigs/yaesu/newcat.c
@@ -1628,7 +1628,7 @@ int newcat_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
{
rig_debug(RIG_DEBUG_WARN, "%s: Cannot get from rig when power is off\n",
__func__);
- return RIG_OK; // to prevent repeats
+ RETURNFUNC(RIG_OK); // to prevent repeats
}
err = newcat_set_vfo_from_alias(rig, &vfo);
@@ -2749,6 +2749,7 @@ int newcat_get_split_mode(RIG *rig, vfo_t vfo, rmode_t *tx_mode,
int newcat_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo)
{
int err;
+ ENTERFUNC;
vfo_t rx_vfo = RIG_VFO_NONE;
rig_debug(RIG_DEBUG_TRACE, "%s: entered, rxvfo=%s, txvfo=%s, split=%d\n",
@@ -2767,7 +2768,7 @@ int newcat_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo)
rig_debug(RIG_DEBUG_VERBOSE,
"%s: force set_split off since we're on 60M exception\n", __func__);
split = RIG_SPLIT_OFF;
- //return RIG_OK; // fake the return code to make things happy
+ //RETURNFUNC(RIG_OK); // fake the return code to make things happy
}
if (is_ft991)
@@ -4310,7 +4311,7 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
{
rig_debug(RIG_DEBUG_VERBOSE, "%s: rig cannot set MG in CW/RTTY modes\n",
__func__);
- return RIG_OK;
+ RETURNFUNC(RIG_OK);
}
@@ -11081,7 +11082,7 @@ int newcat_get_vfo_mode(RIG *rig, vfo_t vfo, vfo_t *vfo_mode)
{
rig_debug(RIG_DEBUG_WARN, "%s: Cannot get from rig when power is off\n",
__func__);
- return RIG_OK; // to prevent repeats
+ RETURNFUNC(RIG_OK); // to prevent repeats
}
/* vfo, mem, P7 ************************** */
@@ -11179,7 +11180,7 @@ int newcat_get_cmd(RIG *rig)
{
rig_debug(RIG_DEBUG_WARN, "%s: Cannot get from rig when power is off\n",
__func__);
- return RIG_OK; // to prevent repeats
+ RETURNFUNC(RIG_OK); // to prevent repeats
}
// try to cache rapid repeats of the IF command
@@ -11599,7 +11600,7 @@ repeat:
if (strncmp(priv->cmd_str, "FA", 2) == 0
|| strncmp(priv->cmd_str, "FB", 2) == 0)
{
- return RIG_OK;
+ RETURNFUNC(RIG_OK);
}
if (strncmp(priv->cmd_str, "PC", 2) == 0 && priv->ret_data[0] == '?')
@@ -11961,7 +11962,7 @@ int newcat_send_voice_mem(RIG *rig, vfo_t vfo, int ch)
if (!newcat_valid_command(rig, "PB"))
{
- RETURNFUNC(-RIG_ENAVAIL);
+ RETURNFUNC2(-RIG_ENAVAIL);
}
// we don't do any channel checking -- varies by rig -- could do it but not critical
@@ -12185,7 +12186,7 @@ static int newcat_get_apf_frequency(RIG *rig, vfo_t vfo, int *freq)
if (!newcat_valid_command(rig, "CO"))
{
- RETURNFUNC(-RIG_ENAVAIL);
+ RETURNFUNC2(-RIG_ENAVAIL);
}
if (is_ftdx101d || is_ftdx101mp)
@@ -12203,12 +12204,12 @@ static int newcat_get_apf_frequency(RIG *rig, vfo_t vfo, int *freq)
}
else
{
- RETURNFUNC(-RIG_ENIMPL);
+ RETURNFUNC2(-RIG_ENIMPL);
}
if ((err = newcat_get_cmd(rig)) != RIG_OK)
{
- RETURNFUNC(err);
+ RETURNFUNC2(err);
}
ret_data_len = strlen(priv->ret_data);
diff --git a/src/network.c b/src/network.c
index 2c08c2cb2..417f44dc1 100644
--- a/src/network.c
+++ b/src/network.c
@@ -1601,7 +1601,7 @@ int network_multicast_publisher_start(RIG *rig, const char *multicast_addr,
{
rig_debug(RIG_DEBUG_WARN, "%s: No network found...multicast disabled\n",
__func__);
- return RIG_OK;
+ RETURNFUNC(RIG_OK);
}
#endif
@@ -1610,7 +1610,7 @@ int network_multicast_publisher_start(RIG *rig, const char *multicast_addr,
{
rig_debug(RIG_DEBUG_TRACE, "%s(%d): not starting multicast publisher\n",
__FILE__, __LINE__);
- return RIG_OK;
+ RETURNFUNC(RIG_OK);
}
status = network_init();
commit c502556fdb0c9cc0b11d08f490d7c7643b2f0455
Author: George Baltz N3GB <Geo...@gm...>
Date: Mon Jun 24 16:06:36 2024 -0400
More balancing
In rigs/kenwood/*
diff --git a/rigs/kenwood/flex6xxx.c b/rigs/kenwood/flex6xxx.c
index 23042a812..1be7c3269 100644
--- a/rigs/kenwood/flex6xxx.c
+++ b/rigs/kenwood/flex6xxx.c
@@ -1294,7 +1294,7 @@ int powersdr_get_parm(RIG *rig, setting_t parm, value_t *val)
if (n != 1)
{
rig_debug(RIG_DEBUG_ERR, "%s: unknown band=%s\n", __func__, buf);
- return (-RIG_EPROTO);
+ RETURNFUNC(-RIG_EPROTO);
}
switch (band)
diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c
index 4c6069c26..d88a2000a 100644
--- a/rigs/kenwood/kenwood.c
+++ b/rigs/kenwood/kenwood.c
@@ -536,7 +536,7 @@ transaction_read:
{
rig_debug(RIG_DEBUG_ERR, "%s: Command rejected by the rig (get): '%s'\n",
__func__, cmdstr);
- RETURNFUNC(-RIG_ERJCTED);
+ RETURNFUNC2(-RIG_ERJCTED);
}
/* Command not understood by rig or rig busy */
@@ -1242,7 +1242,7 @@ int kenwood_set_vfo(RIG *rig, vfo_t vfo)
if (vfo == RIG_VFO_B && priv->is_emulation && priv->curr_mode > 0)
{
HAMLIB_TRACE;
- RETURNFUNC2(RIG_OK);
+ RETURNFUNC(RIG_OK);
}
#if 0
@@ -1251,7 +1251,7 @@ int kenwood_set_vfo(RIG *rig, vfo_t vfo)
{
rig_debug(RIG_DEBUG_VERBOSE, "%s: vfo already is %s...skipping\n", __func__,
rig_strvfo(vfo));
- RETURNFUNC2(RIG_OK);
+ RETURNFUNC(RIG_OK);
}
#endif
@@ -1284,11 +1284,11 @@ int kenwood_set_vfo(RIG *rig, vfo_t vfo)
case RIG_VFO_CURR:
HAMLIB_TRACE;
STATE(rig)->current_vfo = RIG_VFO_CURR;
- RETURNFUNC2(RIG_OK);
+ RETURNFUNC(RIG_OK);
default:
rig_debug(RIG_DEBUG_ERR, "%s: unsupported VFO %s\n", __func__, rig_strvfo(vfo));
- RETURNFUNC2(-RIG_EINVAL);
+ RETURNFUNC(-RIG_EINVAL);
}
//if rig=ts2000 then check Satellite mode status
@@ -1302,7 +1302,7 @@ int kenwood_set_vfo(RIG *rig, vfo_t vfo)
if (retval != RIG_OK)
{
- RETURNFUNC2(retval);
+ RETURNFUNC(retval);
}
rig_debug(RIG_DEBUG_VERBOSE, "%s: satellite mode status %s\n", __func__,
@@ -1313,7 +1313,7 @@ int kenwood_set_vfo(RIG *rig, vfo_t vfo)
{
//SAT mode doesn't allow FR command (cannot select VFO)
//selecting VFO is useless in SAT MODE
- RETURNFUNC2(RIG_OK);
+ RETURNFUNC(RIG_OK);
}
}
@@ -1344,7 +1344,7 @@ int kenwood_set_vfo(RIG *rig, vfo_t vfo)
if (retval != RIG_OK)
{
- RETURNFUNC2(retval);
+ RETURNFUNC(retval);
}
HAMLIB_TRACE;
@@ -1354,7 +1354,7 @@ int kenwood_set_vfo(RIG *rig, vfo_t vfo)
/* If split mode on, the don't change TxVFO */
if ('N' == cmdbuf[1] || priv->split != RIG_SPLIT_OFF)
{
- RETURNFUNC2(RIG_OK);
+ RETURNFUNC(RIG_OK);
}
HAMLIB_TRACE;
@@ -1406,7 +1406,7 @@ int kenwood_set_vfo(RIG *rig, vfo_t vfo)
cmdbuf[1] = 'T';
RETURNFUNC(kenwood_transaction(rig, cmdbuf, NULL, 0));
#else
- RETURNFUNC2(retval);
+ RETURNFUNC(retval);
#endif
}
@@ -2262,7 +2262,7 @@ int kenwood_set_xit(RIG *rig, vfo_t vfo, shortfreq_t rit)
int kenwood_scan(RIG *rig, vfo_t vfo, scan_t scan, int ch)
{
- rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
+ ENTERFUNC;
if (RIG_IS_TS990S)
{
@@ -2751,7 +2751,7 @@ static int kenwood_get_filter_width(RIG *rig, rmode_t mode, pbwidth_t *width)
if (filter_value >= 50) // then it's probably a custom filter width
{
*width = filter_value;
- return (RIG_OK);
+ RETURNFUNC(RIG_OK);
}
RETURNFUNC(-RIG_EINVAL);
@@ -3788,23 +3788,23 @@ int kenwood_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
if (retval != RIG_OK)
{
- return retval;
+ RETURNFUNC(retval);
}
ack_len = strlen(lvlbuf);
if (ack_len != len)
{
- return -RIG_EPROTO;
+ RETURNFUNC(-RIG_EPROTO);
}
if (sscanf(&lvlbuf[len - 3], "%d", &lvl) != 1)
{
- return -RIG_EPROTO;
+ RETURNFUNC(-RIG_EPROTO);
}
val->f = (float) lvl / 255.f;
- return RIG_OK;
+ RETURNFUNC(RIG_OK);
}
case RIG_LEVEL_ATT:
@@ -5547,7 +5547,7 @@ int kenwood_send_voice_mem(RIG *rig, vfo_t vfo, int bank)
|| rig->caps->rig_model == RIG_MODEL_TS480))
{
rig_debug(RIG_DEBUG_ERR, "%s: TS2000/TS480 channel is from 1 to 3\n", __func__);
- return -RIG_EINVAL;
+ RETURNFUNC(-RIG_EINVAL);
}
// some rigs have 5 channels -- newew ones have 10 channels
@@ -5556,7 +5556,7 @@ int kenwood_send_voice_mem(RIG *rig, vfo_t vfo, int bank)
|| rig->caps->rig_model == RIG_MODEL_TS590S))
{
rig_debug(RIG_DEBUG_ERR, "%s: TS590S/SG channel is from 1 to 5\n", __func__);
- return -RIG_EINVAL;
+ RETURNFUNC(-RIG_EINVAL);
}
if (rig->caps->rig_model == RIG_MODEL_TS2000
@@ -6070,7 +6070,7 @@ const char *kenwood_get_info(RIG *rig)
char firmbuf[10];
int retval;
- ENTERFUNC;
+ ENTERFUNC2;
if (!rig)
{
diff --git a/rigs/kenwood/ts2000.c b/rigs/kenwood/ts2000.c
index 477b541c7..feed1ecf1 100644
--- a/rigs/kenwood/ts2000.c
+++ b/rigs/kenwood/ts2000.c
@@ -272,7 +272,7 @@ int ts2000_init(RIG *rig)
if (retval != RIG_OK)
{
- return retval;
+ RETURNFUNC(retval);
}
priv = (struct kenwood_priv_data *) STATE(rig)->priv;
@@ -328,12 +328,12 @@ static int ts2000_set_func(RIG *rig, vfo_t vfo, setting_t func, int status)
{
case RIG_FUNC_MON:
SNPRINTF(buf, sizeof(buf), "ML00%c", (status == 0) ? '0' : '1');
- RETURNFUNC(kenwood_transaction(rig, buf, NULL, 0));
+ RETURNFUNC2(kenwood_transaction(rig, buf, NULL, 0));
case RIG_FUNC_LOCK:
SNPRINTF(buf, sizeof(buf), "LK%c%c", (status == 0) ? '0' : '1',
(status == 0) ? '0' : '1');
- RETURNFUNC(kenwood_transaction(rig, buf, NULL, 0));
+ RETURNFUNC2(kenwood_transaction(rig, buf, NULL, 0));
default:
return kenwood_set_func(rig, vfo, func, status);
@@ -377,7 +377,7 @@ static int ts2000_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status)
break;
default:
- return kenwood_get_func(rig, vfo, func, status);
+ RETURNFUNC(kenwood_get_func(rig, vfo, func, status));
}
RETURNFUNC(RIG_OK);
@@ -462,7 +462,7 @@ static int ts2000_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
case RIG_LEVEL_PREAMP:
if (val.i != 12 && val.i != 0)
{
- RETURNFUNC(-RIG_EINVAL);
+ RETURNFUNC2(-RIG_EINVAL);
}
SNPRINTF(levelbuf, sizeof(levelbuf), "PA%c", (val.i == 12) ? '1' : '0');
@@ -471,7 +471,7 @@ static int ts2000_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
case RIG_LEVEL_ATT:
if (val.i != 12 && val.i != 0)
{
- RETURNFUNC(-RIG_EINVAL);
+ RETURNFUNC2(-RIG_EINVAL);
}
SNPRINTF(levelbuf, sizeof(levelbuf), "RA%02d", (val.i == 12) ? 1 : 0);
@@ -493,7 +493,7 @@ static int ts2000_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
break;
default:
- RETURNFUNC(-RIG_EINVAL);
+ RETURNFUNC2(-RIG_EINVAL);
}
SNPRINTF(levelbuf, sizeof(levelbuf), "RM%d", kenwood_val);
@@ -502,10 +502,10 @@ static int ts2000_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
case RIG_LEVEL_CWPITCH:
if (val.i > 1000 || val.i < 400)
{
- RETURNFUNC(-RIG_EINVAL);
+ RETURNFUNC2(-RIG_EINVAL);
}
- RETURNFUNC(ts2000_set_ex_menu(rig, 31, 2, (val.i - 400) / 50));
+ RETURNFUNC2(ts2000_set_ex_menu(rig, 31, 2, (val.i - 400) / 50));
default:
return kenwood_set_level(rig, vfo, level, val);
@@ -597,26 +597,26 @@ static int ts2000_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
switch (level)
{
case RIG_LEVEL_AF:
- return kenwood_get_level(rig, vfo, level, val);
+ RETURNFUNC(kenwood_get_level(rig, vfo, level, val));
case RIG_LEVEL_RF:
retval = kenwood_transaction(rig, "RG", ackbuf, sizeof(ackbuf));
if (RIG_OK != retval)
{
- return retval;
+ RETURNFUNC(retval);
}
ack_len = strlen(ackbuf);
if (5 != ack_len)
{
- return -RIG_EPROTO;
+ RETURNFUNC(-RIG_EPROTO);
}
if (1 != sscanf(&ackbuf[2], "%d", &levelint))
{
- return -RIG_EPROTO;
+ RETURNFUNC(-RIG_EPROTO);
}
...
[truncated message content] |
|
From: n0nb <n0...@us...> - 2024-06-15 13:19:19
|
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 5fc4e0b5d0efc8d6f2eaa634046ce2940406b705 (commit)
via 096f29cfd9adf7ce9f1e31193b4d6a4136a360ea (commit)
via ce84fc68a5d7657d49170d3d0b60dd0a0f2b243f (commit)
via eae88631733af0b7c8f290bfc9e84a73ce3c20e0 (commit)
via 661efce725a61431d031e47682ac348674615ce7 (commit)
via d160c620642125c66526beaf8d0d1c96d52886c3 (commit)
via db73ef20e50907f017c26008098674f9d7467372 (commit)
via b19c179ce7d455e6b2f294145e9614623d91dcf2 (commit)
via 305e20948e1ada3b0a8db2e5a92dd2f27b4c3208 (commit)
from ff0ed58edf3955596892ed5082ee44da89d94cf9 (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 5fc4e0b5d0efc8d6f2eaa634046ce2940406b705
Author: Mike Black W9MDB <mdb...@ya...>
Date: Fri Jun 14 10:30:05 2024 -0500
Reduce timing on ts890
diff --git a/rigs/kenwood/ts890s.c b/rigs/kenwood/ts890s.c
index ede63c181..a4dbd6182 100644
--- a/rigs/kenwood/ts890s.c
+++ b/rigs/kenwood/ts890s.c
@@ -491,7 +491,7 @@ struct rig_caps ts890s_caps =
RIG_MODEL(RIG_MODEL_TS890S),
.model_name = "TS-890S",
.mfg_name = "Kenwood",
- .version = BACKEND_VER ".15",
+ .version = BACKEND_VER ".16",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
@@ -506,8 +506,8 @@ struct rig_caps ts890s_caps =
.serial_handshake = RIG_HANDSHAKE_NONE,
.write_delay = 0,
.post_write_delay = 0,
- .timeout = 500,
- .retry = 10,
+ .timeout = 200,
+ .retry = 1,
.preamp = {12, RIG_DBLST_END,},
.attenuator = {6, 12, 18, RIG_DBLST_END,},
.max_rit = kHz(9.99),
commit 096f29cfd9adf7ce9f1e31193b4d6a4136a360ea
Author: Mike Black W9MDB <mdb...@ya...>
Date: Fri Jun 14 10:28:44 2024 -0500
Show flrig agc labels but don't do anything with them yet.
Mapping to Hamlib AGC levels is a bit complicated so deferring this until somebody needs it.
diff --git a/rigs/dummy/flrig.c b/rigs/dummy/flrig.c
index ff3e9e85a..29432c4ac 100644
--- a/rigs/dummy/flrig.c
+++ b/rigs/dummy/flrig.c
@@ -143,7 +143,7 @@ struct rig_caps flrig_caps =
RIG_MODEL(RIG_MODEL_FLRIG),
.model_name = "",
.mfg_name = "FLRig",
- .version = "20240418.0",
+ .version = "20240612.0",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
@@ -1119,6 +1119,13 @@ static int flrig_open(RIG *rig)
rig_get_split_vfo(rig, RIG_VFO_A, &split, &tx_vfo);
+ retval = flrig_transaction(rig, "rig.get_agc_labels", NULL, value, sizeof(value));
+
+ if (retval != RIG_OK) { RETURNFUNC(retval); }
+
+ rig_debug(RIG_DEBUG_ERR, "%s: agc_labels=%s\n", __func__, value);
+
+
RETURNFUNC(retval);
}
commit ce84fc68a5d7657d49170d3d0b60dd0a0f2b243f
Author: Mike Black W9MDB <mdb...@ya...>
Date: Fri Jun 14 09:57:05 2024 -0500
Remove debug from conf.c
diff --git a/src/conf.c b/src/conf.c
index 2807710b2..26273ef58 100644
--- a/src/conf.c
+++ b/src/conf.c
@@ -1469,7 +1469,6 @@ int HAMLIB_API rig_set_conf(RIG *rig, hamlib_token_t token, const char *val)
*/
int HAMLIB_API rig_get_conf(RIG *rig, hamlib_token_t token, char *val)
{
- printf("tokendid=%lx, %s\n", token, val);
return rig_get_conf2(rig, token, val, 128);
}
commit eae88631733af0b7c8f290bfc9e84a73ce3c20e0
Author: Mike Black W9MDB <mdb...@ya...>
Date: Fri Jun 14 09:40:55 2024 -0500
Improve orion.h behavior on timeouts
diff --git a/rigs/tentec/orion.h b/rigs/tentec/orion.h
index 4daf547b1..1f8abbfed 100644
--- a/rigs/tentec/orion.h
+++ b/rigs/tentec/orion.h
@@ -36,7 +36,7 @@
#include "rig.h"
#include "riglist.h"
-#define BACKEND_VER "20240612"
+#define BACKEND_VER "20240613"
#define TRUE 1
#define FALSE 0
@@ -214,10 +214,10 @@ RIG_MODEL(RIG_MODEL_TT565),
.serial_stop_bits = 1,
.serial_parity = RIG_PARITY_NONE,
.serial_handshake = RIG_HANDSHAKE_HARDWARE,
-.write_delay = 0, /* no delay between characters written */
+.write_delay = 1, /* no delay between characters written */
.post_write_delay = 0, /* ms delay between writes DEBUGGING HERE */
-.timeout = 2000, /* ms */
-.retry = 4,
+.timeout = 200, /* ms */
+.retry = 1,
.has_get_func = TT565_FUNCS,
.has_set_func = TT565_FUNCS,
commit 661efce725a61431d031e47682ac348674615ce7
Author: Mike Black W9MDB <mdb...@ya...>
Date: Thu Jun 13 07:18:33 2024 -0500
Allow pstrotator to return az/el on 1st call to get_pos and add status values
diff --git a/rigs/dummy/rot_pstrotator.c b/rigs/dummy/rot_pstrotator.c
index caf1f911e..7beb58065 100644
--- a/rigs/dummy/rot_pstrotator.c
+++ b/rigs/dummy/rot_pstrotator.c
@@ -1,7 +1,6 @@
/*
- i Hamlib Dummy backend - main file
- * Copyright (c) 2001-2009 by Stephane Fillod
- *
+ i Hamlib PSTRotator backend
+ * Copyright (c) 2024 Michael Black W9MDB
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -41,8 +40,7 @@
#define PSTROTATOR_ROT_PARM 0
#define PSTROTATOR_ROT_STATUS (ROT_STATUS_MOVING | ROT_STATUS_MOVING_AZ | ROT_STATUS_MOVING_LEFT | ROT_STATUS_MOVING_RIGHT | \
- ROT_STATUS_MOVING_EL | ROT_STATUS_MOVING_UP | ROT_STATUS_MOVING_DOWN | \
- ROT_STATUS_LIMIT_UP | ROT_STATUS_LIMIT_DOWN | ROT_STATUS_LIMIT_LEFT | ROT_STATUS_LIMIT_RIGHT)
+ ROT_STATUS_MOVING_EL | ROT_STATUS_MOVING_UP | ROT_STATUS_MOVING_DOWN )
struct pstrotator_rot_priv_data
{
@@ -57,6 +55,8 @@ struct pstrotator_rot_priv_data
int sockfd2; // the reply port for PSTRotator which is port+1
pthread_t threadid;
+
+ int receiving; // true if we are receiving az/el data
};
static int write_transaction(ROT *rot, char *cmd)
@@ -213,9 +213,11 @@ static void *pstrotator_handler_start(void *arg)
rs->pstrotator_handler_priv_data;
pstrotator_handler_priv->args.rot = rot;
pstrotator_handler_priv->pstrotator_handler_thread_run = 1;
+ priv->receiving = 0;
while (pstrotator_handler_priv->pstrotator_handler_thread_run)
{
+ int az = 0, el = 0;
char buf[256];
readPacket(priv->sockfd2, buf, sizeof(buf), 1);
@@ -228,6 +230,16 @@ static void *pstrotator_handler_start(void *arg)
//dump_hex((unsigned char *)buf, strlen(buf));
int n = sscanf(buf, "AZ:%g", &priv->az);
n += sscanf(buf, "EL:%g", &priv->el);
+
+ if (n > 0) { priv->receiving = 1; }
+
+ if (priv->az != az && priv->el != el) { priv->status = ROT_STATUS_MOVING; }
+ else if (priv->az < az) { priv->status = ROT_STATUS_MOVING_LEFT; }
+ else if (priv->az > az) { priv->status = ROT_STATUS_MOVING_RIGHT; }
+ else if (priv->el < el) { priv->status = ROT_STATUS_MOVING_DOWN; }
+ else if (priv->el > el) { priv->status = ROT_STATUS_MOVING_UP; }
+ else { priv->status = ROT_STATUS_NONE; }
+
//if (n > 0) rig_debug(RIG_DEBUG_CACHE, "%s: az=%.1f, el=%.1f\n", __func__, priv->az, priv->el);
}
@@ -267,10 +279,6 @@ static int pstrotator_rot_init(ROT *rot)
static int pstrotator_rot_cleanup(ROT *rot)
{
struct rot_state *rs = ROTSTATE(rot);
-#if 0
- struct pstrotator_rot_priv_data *priv = (struct pstrotator_rot_priv_data *)
- rs->priv;
-#endif
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
@@ -341,14 +349,26 @@ static int pstrotator_rot_open(ROT *rot)
static int pstrotator_rot_close(ROT *rot)
{
+ struct pstrotator_rot_priv_data *priv;
+ priv = (struct pstrotator_rot_priv_data *)ROTSTATE(rot)->priv;
+ pstrotator_handler_priv_data *pstrotator_handler_priv;
+ pstrotator_handler_priv = (pstrotator_handler_priv_data *)
+ rot->state.pstrotator_handler_priv_data;
+
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
+ pstrotator_handler_priv->pstrotator_handler_thread_run = 0;
+ rig_debug(RIG_DEBUG_VERBOSE, "%s: waiting for thread to stop\n", __func__);
+ pthread_join(priv->threadid, NULL);
+ rig_debug(RIG_DEBUG_VERBOSE, "%s: thread stopped\n", __func__);
+ priv->threadid = 0;
+
return RIG_OK;
}
+#if 0
static int pstrotator_set_conf(ROT *rot, hamlib_token_t token, const char *val)
{
-#if 0
struct pstrotator_rot_priv_data *priv;
priv = (struct pstrotator_rot_priv_data *)ROTSTATE(rot)->priv;
@@ -369,16 +389,14 @@ static int pstrotator_set_conf(ROT *rot, hamlib_token_t token, const char *val)
}
return RIG_OK;
-#else
- return -RIG_ENIMPL;
-#endif
}
+#endif
+#if 0
static int pstrotator_get_conf2(ROT *rot, hamlib_token_t token, char *val,
int val_len)
{
-#if 0
struct pstrotator_rot_priv_data *priv;
priv = (struct pstrotator_rot_priv_data *)ROTSTATE(rot)->priv;
@@ -394,15 +412,15 @@ static int pstrotator_get_conf2(ROT *rot, hamlib_token_t token, char *val,
}
return RIG_OK;
-#else
- return -RIG_ENIMPL;
-#endif
}
+#endif
+#if 0
static int pstrotator_get_conf(ROT *rot, hamlib_token_t token, char *val)
{
return pstrotator_get_conf2(rot, token, val, 128);
}
+#endif
@@ -433,62 +451,12 @@ static int pstrotator_rot_get_position(ROT *rot, azimuth_t *az, elevation_t *el)
{
struct pstrotator_rot_priv_data *priv = (struct pstrotator_rot_priv_data *)
ROTSTATE(rot)->priv;
-#if 0
- char buf[64];
- int n = 0;
- fd_set rfds, efds;
- int select_result;
- struct timeval timeout;
-#endif
-
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
+
write_transaction(rot, "<PST>AZ?</PST>");
write_transaction(rot, "<PST>EL?</PST>");
-#if 0
-
- do
- {
- //read_string(&priv->port2, (unsigned char*)buf, sizeof(buf), stopset, stopset_len, 1, 1);
- buf[0] = 0;
-
- // if moving we need to keep polling for updates until there are none
- if (n == 2)
- {
- timeout.tv_sec = 0;
- timeout.tv_usec = 0;
-
- FD_ZERO(&rfds);
- FD_SET(priv->sockfd2, &rfds);
- efds = rfds;
- select_result = select(priv->sockfd2, &rfds, NULL, &efds, &timeout);
-
- if (select_result == 0)
- {
- //rig_debug(RIG_DEBUG_VERBOSE, "%s: timeout\n", __func__);
- break;
- }
- else
- {
- rig_debug(RIG_DEBUG_VERBOSE, "%s: select_result=%d\n", __func__, select_result);
- readPacket(priv->sockfd2, buf, sizeof(buf), 0);
- }
- }
- else
- {
- readPacket(priv->sockfd2, buf, sizeof(buf), 1);
- }
-
- dump_hex((unsigned char *)buf, strlen(buf));
- n += sscanf(buf, "AZ:%g", &priv->az);
- n += sscanf(buf, "EL:%g", &priv->el);
-
- if (n > 2) { n = 2; }
- }
- while (strlen(buf) > 0);
-
-#endif
-
+ hl_usleep(10 * 1000);
*az = priv->az;
*el = priv->el;
@@ -532,7 +500,7 @@ struct rot_caps pstrotator_caps =
ROT_MODEL(ROT_MODEL_PSTROTATOR),
.model_name = "PstRotator",
.mfg_name = "YO3DMU",
- .version = "20240607.0",
+ .version = "20240613.0",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rot_type = ROT_TYPE_AZEL,
@@ -562,9 +530,6 @@ struct rot_caps pstrotator_caps =
.rot_open = pstrotator_rot_open,
.rot_close = pstrotator_rot_close,
- .set_conf = pstrotator_set_conf,
- .get_conf = pstrotator_get_conf,
-
.set_position = pstrotator_rot_set_position,
.get_position = pstrotator_rot_get_position,
.park = pstrotator_rot_park,
commit d160c620642125c66526beaf8d0d1c96d52886c3
Author: Mike Black W9MDB <mdb...@ya...>
Date: Wed Jun 12 15:32:21 2024 -0500
Make Origin width timeout behave better
diff --git a/rigs/tentec/orion.c b/rigs/tentec/orion.c
index 89cf4d157..7edc53910 100644
--- a/rigs/tentec/orion.c
+++ b/rigs/tentec/orion.c
@@ -694,6 +694,7 @@ int tt565_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
char ttmode, ttreceiver;
int retry;
int timeout;
+ int widthOld = rig->state.cache.widthMainA;
struct rig_state *rs = STATE(rig);
ttreceiver = which_receiver(rig, vfo);
@@ -739,8 +740,6 @@ int tt565_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
return -RIG_EPROTO;
}
- /* Orion may need some time to "recover" from ?RxM before ?RxF */
- hl_usleep(100*1000); // was 80, now 100 -- still seeing infrequent failure
/* Query passband width (filter) */
// since this fails at 80ms sometimes we won't retry and will reduce the timeout
// Normally this comes back in about 30ms
@@ -756,7 +755,9 @@ int tt565_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
if (retval != RIG_OK)
{
- return retval;
+ // if the width call fails we will just reuse the old width
+ *width = widthOld;
+ return RIG_OK;
}
if (respbuf[1] != 'R' || respbuf[3] != 'F' || resp_len <= 4)
diff --git a/rigs/tentec/orion.h b/rigs/tentec/orion.h
index ac43d3543..4daf547b1 100644
--- a/rigs/tentec/orion.h
+++ b/rigs/tentec/orion.h
@@ -36,7 +36,7 @@
#include "rig.h"
#include "riglist.h"
-#define BACKEND_VER "20240606"
+#define BACKEND_VER "20240612"
#define TRUE 1
#define FALSE 0
commit db73ef20e50907f017c26008098674f9d7467372
Author: Mike Black W9MDB <mdb...@ya...>
Date: Mon Jun 10 22:26:21 2024 -0500
Add csntechnologies.net S.A.T. satellite rotor
Thanks to Randy KB0NAV
diff --git a/NEWS b/NEWS
index b91c026ac..7a3747187 100644
--- a/NEWS
+++ b/NEWS
@@ -13,6 +13,7 @@ Version 5.x -- future
* Change FT1000MP Mark V model names to align with FT1000MP
Version 4.6
+ * Added csntechnoligies.net S.A.T Satellite rotor control
* Added PSTRotator control
* Added Flex SmartSDR slices A-H
* Added Motorola Micom M2/M3
diff --git a/include/hamlib/rotlist.h b/include/hamlib/rotlist.h
index a8ae9f754..cd49c7c10 100644
--- a/include/hamlib/rotlist.h
+++ b/include/hamlib/rotlist.h
@@ -87,6 +87,7 @@
#define ROT_MODEL_DUMMY ROT_MAKE_MODEL(ROT_DUMMY, 1)
#define ROT_MODEL_NETROTCTL ROT_MAKE_MODEL(ROT_DUMMY, 2)
#define ROT_MODEL_PSTROTATOR ROT_MAKE_MODEL(ROT_DUMMY, 3)
+#define ROT_MODEL_SATROTCTL ROT_MAKE_MODEL(ROT_DUMMY, 4)
/**
diff --git a/rigs/dummy/netrotctl.c b/rigs/dummy/netrotctl.c
index 27f4947f7..0b18c6357 100644
--- a/rigs/dummy/netrotctl.c
+++ b/rigs/dummy/netrotctl.c
@@ -373,3 +373,39 @@ struct rot_caps netrotctl_caps =
.get_info = netrotctl_get_info,
};
+/*
+ * S.A.T. rotator mimics net rotor but only minimal capabilities.
+ * Fails to work with net rotor since it fails dump_state.
+ */
+
+static int satrotcrl_rot_init(ROT *rot)
+{
+ rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
+
+ return RIG_OK;
+}
+
+struct rot_caps satrotctl_caps =
+{
+ ROT_MODEL(ROT_MODEL_SATROTCTL),
+ .model_name = "S.A.T. Satellite ctl",
+ .mfg_name = "csntechnologies.net",
+ .version = "20240609.0",
+ .copyright = "LGPL",
+ .status = RIG_STATUS_UNTESTED,
+ .rot_type = ROT_TYPE_AZEL,
+ .port_type = RIG_PORT_NETWORK,
+ .timeout = 400,
+
+ .min_az = -180.,
+ .max_az = 450.,
+ .min_el = 0.,
+ .max_el = 90.,
+
+ .priv = NULL, /* priv */
+
+ .rot_init = satrotcrl_rot_init,
+ .set_position = netrotctl_set_position,
+ .get_position = netrotctl_get_position,
+};
+
diff --git a/rigs/dummy/rot_dummy.c b/rigs/dummy/rot_dummy.c
index ae761b93f..ed1a96136 100644
--- a/rigs/dummy/rot_dummy.c
+++ b/rigs/dummy/rot_dummy.c
@@ -1011,6 +1011,7 @@ DECLARE_INITROT_BACKEND(dummy)
rot_register(&dummy_rot_caps);
rot_register(&netrotctl_caps);
rot_register(&pstrotator_caps);
+ rot_register(&satrotctl_caps);
return RIG_OK;
}
diff --git a/rigs/dummy/rot_dummy.h b/rigs/dummy/rot_dummy.h
index 8106b40dc..a71204843 100644
--- a/rigs/dummy/rot_dummy.h
+++ b/rigs/dummy/rot_dummy.h
@@ -40,5 +40,6 @@
extern struct rot_caps dummy_rot_caps;
extern struct rot_caps netrotctl_caps;
extern struct rot_caps pstrotator;
+extern struct rot_caps satrotctl_caps;
#endif /* _ROT_DUMMY_H */
commit b19c179ce7d455e6b2f294145e9614623d91dcf2
Author: Mike Black W9MDB <mdb...@ya...>
Date: Mon Jun 10 17:29:51 2024 -0500
Move pstrotator read to a separate thread so that get_pos can see real-time movement
diff --git a/include/hamlib/rotator.h b/include/hamlib/rotator.h
index 82bc634e2..9d4ccf824 100644
--- a/include/hamlib/rotator.h
+++ b/include/hamlib/rotator.h
@@ -628,6 +628,7 @@ struct rot_state {
int current_speed; /*!< Current speed 1-100, to be used when no change to speed is requested. */
hamlib_port_t rotport; /*!< Rotator port (internal use). */
hamlib_port_t rotport2; /*!< 2nd Rotator port (internal use). */
+ rig_ptr_t *pstrotator_handler_priv_data;
};
diff --git a/rigs/dummy/rot_pstrotator.c b/rigs/dummy/rot_pstrotator.c
index d89d34fab..caf1f911e 100644
--- a/rigs/dummy/rot_pstrotator.c
+++ b/rigs/dummy/rot_pstrotator.c
@@ -44,8 +44,6 @@
ROT_STATUS_MOVING_EL | ROT_STATUS_MOVING_UP | ROT_STATUS_MOVING_DOWN | \
ROT_STATUS_LIMIT_UP | ROT_STATUS_LIMIT_DOWN | ROT_STATUS_LIMIT_LEFT | ROT_STATUS_LIMIT_RIGHT)
-static int simulating = 0; // do we need rotator emulation for debug?
-
struct pstrotator_rot_priv_data
{
azimuth_t az;
@@ -56,67 +54,9 @@ struct pstrotator_rot_priv_data
elevation_t target_el;
rot_status_t status;
- setting_t funcs;
- value_t levels[RIG_SETTING_MAX];
- value_t parms[RIG_SETTING_MAX];
-
- struct ext_list *ext_funcs;
- struct ext_list *ext_levels;
- struct ext_list *ext_parms;
-
- char *magic_conf;
-
-// hamlib_port_t port2; // the reply port for PSTRotator which is port+1
int sockfd2; // the reply port for PSTRotator which is port+1
-};
-
-static const struct confparams pstrotator_ext_levels[] =
-{
- {
- TOK_EL_ROT_MAGICLEVEL, "MGL", "Magic level", "Magic level, as an example",
- NULL, RIG_CONF_NUMERIC, { .n = { 0, 1, .001 } }
- },
- {
- TOK_EL_ROT_MAGICFUNC, "MGF", "Magic func", "Magic function, as an example",
- NULL, RIG_CONF_CHECKBUTTON
- },
- {
- TOK_EL_ROT_MAGICOP, "MGO", "Magic Op", "Magic Op, as an example",
- NULL, RIG_CONF_BUTTON
- },
- {
- TOK_EL_ROT_MAGICCOMBO, "MGC", "Magic combo", "Magic combo, as an example",
- "VALUE1", RIG_CONF_COMBO, { .c = { .combostr = { "VALUE1", "VALUE2", "NONE", NULL } } }
- },
- { RIG_CONF_END, NULL, }
-};
-
-static const struct confparams pstrotator_ext_funcs[] =
-{
- {
- TOK_EL_ROT_MAGICEXTFUNC, "MGEF", "Magic ext func", "Magic ext function, as an example",
- NULL, RIG_CONF_CHECKBUTTON
- },
- { RIG_CONF_END, NULL, }
-};
-static const struct confparams pstrotator_ext_parms[] =
-{
- {
- TOK_EP_ROT_MAGICPARM, "MGP", "Magic parm", "Magic parameter, as an example",
- NULL, RIG_CONF_NUMERIC, { .n = { 0, 1, .001 } }
- },
- { RIG_CONF_END, NULL, }
-};
-
-/* cfgparams are configuration item generally used by the backend's open() method */
-static const struct confparams pstrotator_cfg_params[] =
-{
- {
- TOK_CFG_ROT_MAGICCONF, "mcfg", "Magic conf", "Magic parameter, as an example",
- "ROTATOR", RIG_CONF_STRING, { }
- },
- { RIG_CONF_END, NULL, }
+ pthread_t threadid;
};
static int write_transaction(ROT *rot, char *cmd)
@@ -160,53 +100,166 @@ static int write_transaction(ROT *rot, char *cmd)
return RIG_OK;
}
-static int pstrotator_rot_init(ROT *rot)
+static void set_timeout(int fd, int sec, int usec)
{
- struct pstrotator_rot_priv_data *priv;
- struct rot_state *rs = ROTSTATE(rot);
+ struct timeval timeout;
+ timeout.tv_sec = sec;
+ timeout.tv_usec = usec;
+ //rig_debug(RIG_DEBUG_VERBOSE, "%s: sec=%d, usec=%d, timeout = %.6lf\n", __func__,
+ // sec, usec, sec + usec / 1e6);
- rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
+ if (setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, (const char *)&timeout,
+ sizeof(timeout)) < 0)
+ {
+ rig_debug(RIG_DEBUG_ERR, "%s: setsockopt failed: %s\n", __func__,
+ strerror(errno));
+ }
+}
- rs->priv = (struct pstrotator_rot_priv_data *)
- calloc(1, sizeof(struct pstrotator_rot_priv_data));
+void readPacket(int sockfd, char *buf, int buf_len, int expected)
+{
+ struct sockaddr_in serverAddr;
+ socklen_t addrLen = sizeof(serverAddr);
- if (!rs->priv)
+ buf[0] = 0;
+
+ if (expected)
{
- return -RIG_ENOMEM;
+ set_timeout(sockfd, 1, 0);
+ }
+ else
+ {
+ set_timeout(sockfd, 0, 0);
}
- priv = rs->priv;
+ ssize_t n = recvfrom(sockfd, buf, buf_len, 0, (struct sockaddr *)&serverAddr,
+ &addrLen);
- priv->ext_funcs = alloc_init_ext(pstrotator_ext_funcs);
+ if (n < 0)
+ {
+#ifdef _WIN32
+ int err = WSAGetLastError();
+
+ if (err == WSAEWOULDBLOCK || err == WSAETIMEDOUT)
+ {
+#if 0
+
+ if (expected)
+ rig_debug(RIG_DEBUG_ERR,
+ "%s: recvfrom timed out. Is PSTRotator Setup/UDP Control enabled?\n", __func__);
+
+#endif
+ }
+ else
+ {
+ rig_debug(RIG_DEBUG_ERR, "%s: recvfrom error %d: %s\n", __func__, err,
+ strerror(errno));
+ }
- if (!priv->ext_funcs)
+#else
+
+ if (errno == EWOULDBLOCK || errno == EAGAIN)
+ {
+ if (expected)
+ rig_debug(RIG_DEBUG_ERR,
+ "%s: recvfrom timed out. Is PSTRotator Setup/UDP Control checked?\n", __func__);
+ }
+ else
+ {
+ rig_debug(RIG_DEBUG_ERR, "%s: recvfrom error: %s\n", __func__, strerror(errno));
+ }
+
+#endif
+ n = 0;
+ }
+
+ buf[n] = '\0'; // Null-terminate the received data
+ strtok(buf, "\r\n"); // get rid of CRs and such
+
+ //if (n > 0) { rig_debug(RIG_DEBUG_VERBOSE, "%s: buf=%s\n", __func__, buf); }
+}
+
+#if defined(HAVE_PTHREAD)
+#if 0
+typedef struct pstrotator_handler_args_sw
+{
+ int port; // port for reading PstRotator messages -- always +1 from base port
+} pstrotator_handler_args;
+
+typedef struct pstrotator_handler_priv_data_s
+{
+ pthread_t thread_id;
+ pstrotator_handler_args args;
+} pstrotator_handler_priv_data;
+#endif
+
+static void *pstrotator_handler_start(void *arg)
+{
+ ROT *rot = (ROT *)arg;
+ struct rot_state *rs = STATE(rot);
+ struct pstrotator_rot_priv_data *priv = rs->priv;
+ pstrotator_handler_priv_data *pstrotator_handler_priv;
+
+ rs->pstrotator_handler_priv_data = calloc(1,
+ sizeof(pstrotator_handler_priv_data));
+
+ if (rs->pstrotator_handler_priv_data == NULL)
{
- return -RIG_ENOMEM;
+ rig_debug(RIG_DEBUG_ERR, "%s: priv is NULL?\n", __func__);
+ return NULL;
}
- priv->ext_levels = alloc_init_ext(pstrotator_ext_levels);
+ pstrotator_handler_priv = (pstrotator_handler_priv_data *)
+ rs->pstrotator_handler_priv_data;
+ pstrotator_handler_priv->args.rot = rot;
+ pstrotator_handler_priv->pstrotator_handler_thread_run = 1;
- if (!priv->ext_levels)
+ while (pstrotator_handler_priv->pstrotator_handler_thread_run)
{
- return -RIG_ENOMEM;
+ char buf[256];
+ readPacket(priv->sockfd2, buf, sizeof(buf), 1);
+
+ if (strlen(buf) == 0)
+ {
+ hl_usleep(20 * 1000);
+ continue;
+ }
+
+ //dump_hex((unsigned char *)buf, strlen(buf));
+ int n = sscanf(buf, "AZ:%g", &priv->az);
+ n += sscanf(buf, "EL:%g", &priv->el);
+ //if (n > 0) rig_debug(RIG_DEBUG_CACHE, "%s: az=%.1f, el=%.1f\n", __func__, priv->az, priv->el);
}
- priv->ext_parms = alloc_init_ext(pstrotator_ext_parms);
+ return RIG_OK;
+}
+
+#endif
+
+static int pstrotator_rot_init(ROT *rot)
+{
+ struct pstrotator_rot_priv_data *priv;
+ struct rot_state *rs = ROTSTATE(rot);
+
+ rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
- if (!priv->ext_parms)
+ rs->priv = (struct pstrotator_rot_priv_data *)
+ calloc(1, sizeof(struct pstrotator_rot_priv_data));
+
+ if (!rs->priv)
{
return -RIG_ENOMEM;
}
+ priv = rs->priv;
+
ROTPORT(rot)->type.rig = RIG_PORT_UDP_NETWORK;
priv->az = priv->el = 0;
priv->target_az = priv->target_el = 0;
- priv->magic_conf = strdup("ROTATOR");
-
- strcpy(ROTPORT(rot)->pathname, "192.0.0.1:12000");
+ strcpy(ROTPORT(rot)->pathname, "192.168.56.1:12000");
return RIG_OK;
}
@@ -214,15 +267,13 @@ static int pstrotator_rot_init(ROT *rot)
static int pstrotator_rot_cleanup(ROT *rot)
{
struct rot_state *rs = ROTSTATE(rot);
+#if 0
struct pstrotator_rot_priv_data *priv = (struct pstrotator_rot_priv_data *)
rs->priv;
+#endif
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
- free(priv->ext_funcs);
- free(priv->ext_levels);
- free(priv->ext_parms);
- free(priv->magic_conf);
free(rs->priv);
rs->priv = NULL;
@@ -230,30 +281,16 @@ static int pstrotator_rot_cleanup(ROT *rot)
return RIG_OK;
}
-static void set_timeout(int fd, int sec, int usec)
-{
- struct timeval timeout;
- timeout.tv_sec = sec;
- timeout.tv_usec = usec;
- rig_debug(RIG_DEBUG_VERBOSE, "%s: sec=%d, usec=%d, timeout = %.6lf\n", __func__,
- sec, usec, sec + usec / 1e6);
-
- if (setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, (const char *)&timeout,
- sizeof(timeout)) < 0)
- {
- rig_debug(RIG_DEBUG_ERR, "%s: setsockopt failed: %s\n", __func__,
- strerror(errno));
- }
-}
-
static int pstrotator_rot_open(ROT *rot)
{
struct pstrotator_rot_priv_data *priv;
int port = 0;
int n1, n2, n3, n4;
int sockfd;
+ int retval;
struct sockaddr_in clientAddr;
struct rot_state *rs = ROTSTATE(rot);
+ pthread_attr_t attr;
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
@@ -289,6 +326,16 @@ static int pstrotator_rot_open(ROT *rot)
priv->sockfd2 = sockfd;
set_timeout(priv->sockfd2, 1, 0);
+ pthread_attr_init(&attr);
+ retval = pthread_create(&priv->threadid, &attr, pstrotator_handler_start, rot);
+
+ if (retval != 0)
+ {
+ rig_debug(RIG_DEBUG_ERR, "%s; pthread_create error: %s\n", __func__,
+ strerror(errno));
+ return -RIG_EINTERNAL;
+ }
+
return RIG_OK;
}
@@ -301,6 +348,7 @@ static int pstrotator_rot_close(ROT *rot)
static int pstrotator_set_conf(ROT *rot, hamlib_token_t token, const char *val)
{
+#if 0
struct pstrotator_rot_priv_data *priv;
priv = (struct pstrotator_rot_priv_data *)ROTSTATE(rot)->priv;
@@ -321,12 +369,16 @@ static int pstrotator_set_conf(ROT *rot, hamlib_token_t token, const char *val)
}
return RIG_OK;
+#else
+ return -RIG_ENIMPL;
+#endif
}
static int pstrotator_get_conf2(ROT *rot, hamlib_token_t token, char *val,
int val_len)
{
+#if 0
struct pstrotator_rot_priv_data *priv;
priv = (struct pstrotator_rot_priv_data *)ROTSTATE(rot)->priv;
@@ -342,6 +394,9 @@ static int pstrotator_get_conf2(ROT *rot, hamlib_token_t token, char *val,
}
return RIG_OK;
+#else
+ return -RIG_ENIMPL;
+#endif
}
static int pstrotator_get_conf(ROT *rot, hamlib_token_t token, char *val)
@@ -359,85 +414,17 @@ static int pstrotator_rot_set_position(ROT *rot, azimuth_t az, elevation_t el)
rig_debug(RIG_DEBUG_VERBOSE, "%s called: %.2f %.2f\n", __func__,
az, el);
- if (simulating)
- {
- priv->target_az = az;
- priv->target_el = el;
- gettimeofday(&priv->tv, NULL);
- }
- else
- {
- char cmd[64];
- sprintf(cmd, "<PST><AZIMUTH>%f.2</AZIMUTH></PST>", az);
- write_transaction(rot, cmd);
- sprintf(cmd, "<PST><ELEVATION>%f.2</ELEVATION></PST>", el);
- write_transaction(rot, cmd);
- priv->az = az;
- priv->el = el;
- }
-
+ char cmd[64];
+ sprintf(cmd, "<PST><AZIMUTH>%f.2</AZIMUTH></PST>", az);
+ write_transaction(rot, cmd);
+ sprintf(cmd, "<PST><ELEVATION>%f.2</ELEVATION></PST>", el);
+ write_transaction(rot, cmd);
+ priv->az = az;
+ priv->el = el;
return RIG_OK;
}
-void readPacket(int sockfd, char *buf, int buf_len, int expected)
-{
- struct sockaddr_in serverAddr;
- socklen_t addrLen = sizeof(serverAddr);
-
- buf[0] = 0;
-
- if (expected)
- {
- set_timeout(sockfd, 1, 0);
- }
- else
- {
- set_timeout(sockfd, 0, 0);
- }
-
- ssize_t n = recvfrom(sockfd, buf, buf_len, 0, (struct sockaddr *)&serverAddr,
- &addrLen);
-
- if (n < 0)
- {
-#ifdef _WIN32
- int err = WSAGetLastError();
-
- if (err == WSAEWOULDBLOCK || err == WSAETIMEDOUT)
- {
- if (expected)
- rig_debug(RIG_DEBUG_ERR,
- "%s: recvfrom timed out. Is PSTRotator Setup/UDP Control enabled?\n", __func__);
- }
- else
- {
- rig_debug(RIG_DEBUG_ERR, "%s: recvfrom error %d: %s\n", __func__, err,
- strerror(errno));
- }
-
-#else
-
- if (errno == EWOULDBLOCK || errno == EAGAIN)
- {
- if (expected)
- rig_debug(RIG_DEBUG_ERR,
- "%s: recvfrom timed out. Is PSTRotator Setup/UDP Control checked?\n", __func__);
- }
- else
- {
- rig_debug(RIG_DEBUG_ERR, "%s: recvfrom error: %s\n", __func__, strerror(errno));
- }
-
-#endif
- n = 0;
- }
-
- buf[n] = '\0'; // Null-terminate the received data
- strtok(buf, "\r\n"); // get rid of CRs and such
-
- if (n > 0) { rig_debug(RIG_DEBUG_VERBOSE, "%s: buf=%s\n", __func__, buf); }
-}
/*
* Get position of rotor, simulating slow rotation
@@ -446,16 +433,20 @@ static int pstrotator_rot_get_position(ROT *rot, azimuth_t *az, elevation_t *el)
{
struct pstrotator_rot_priv_data *priv = (struct pstrotator_rot_priv_data *)
ROTSTATE(rot)->priv;
+#if 0
char buf[64];
int n = 0;
fd_set rfds, efds;
int select_result;
struct timeval timeout;
+#endif
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
write_transaction(rot, "<PST>AZ?</PST>");
write_transaction(rot, "<PST>EL?</PST>");
+#if 0
+
do
{
//read_string(&priv->port2, (unsigned char*)buf, sizeof(buf), stopset, stopset_len, 1, 1);
@@ -491,10 +482,13 @@ static int pstrotator_rot_get_position(ROT *rot, azimuth_t *az, elevation_t *el)
dump_hex((unsigned char *)buf, strlen(buf));
n += sscanf(buf, "AZ:%g", &priv->az);
n += sscanf(buf, "EL:%g", &priv->el);
- if (n > 2) n = 2;
+
+ if (n > 2) { n = 2; }
}
while (strlen(buf) > 0);
+#endif
+
*az = priv->az;
*el = priv->el;
@@ -559,12 +553,7 @@ struct rot_caps pstrotator_caps =
.has_get_parm = PSTROTATOR_ROT_PARM,
.has_set_parm = ROT_PARM_SET(PSTROTATOR_ROT_PARM),
- .level_gran = { [ROT_LVL_SPEED] = { .min = { .i = 1 }, .max = { .i = 4 }, .step = { .i = 1 } } },
-
- .extlevels = pstrotator_ext_levels,
- .extfuncs = pstrotator_ext_funcs,
- .extparms = pstrotator_ext_parms,
- .cfgparams = pstrotator_cfg_params,
+ //.level_gran = { [ROT_LVL_SPEED] = { .min = { .i = 1 }, .max = { .i = 4 }, .step = { .i = 1 } } },
.has_status = PSTROTATOR_ROT_STATUS,
diff --git a/rigs/dummy/rot_pstrotator.h b/rigs/dummy/rot_pstrotator.h
index 6e8d5e3c1..9375549a3 100644
--- a/rigs/dummy/rot_pstrotator.h
+++ b/rigs/dummy/rot_pstrotator.h
@@ -40,4 +40,23 @@
extern struct rot_caps pstrotator_caps;
extern struct rot_caps netrotctl_caps;
+#if defined(HAVE_PTHREAD)
+typedef struct pstrotator_handler_args_sw
+{
+ ROT *rot;
+ int port; // port for reading PstRotator messages -- always +1 from base port
+} pstrotator_handler_args;
+
+typedef struct pstrotator_handler_priv_data_s
+{
+ pthread_t thread_id;
+ pstrotator_handler_args args;
+ int pstrotator_handler_thread_run;
+ int sockfd2;
+
+} pstrotator_handler_priv_data;
+#endif
+
+
+
#endif /* _ROT_PSTROTATOR_H */
commit 305e20948e1ada3b0a8db2e5a92dd2f27b4c3208
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sun Jun 9 23:40:52 2024 -0500
Fix ptt for smartsdr slice so only the active slice gets positive ptt
diff --git a/rigs/flexradio/smartsdr.c b/rigs/flexradio/smartsdr.c
index b0f152545..dd7b04860 100644
--- a/rigs/flexradio/smartsdr.c
+++ b/rigs/flexradio/smartsdr.c
@@ -52,6 +52,7 @@ struct smartsdr_priv_data
int slicenum; // slice 0-7 maps to A-H
int seqnum;
int ptt;
+ int tx; // when 1 this slice has PTT control
double freqA;
double freqB;
rmode_t modeA;
@@ -178,6 +179,7 @@ int smartsdr_init(RIG *rig)
rs->model_name);
RETURNFUNC(-RIG_ENIMPL);
}
+
priv->ptt = 0;
RETURNFUNC(RIG_OK);
@@ -261,11 +263,14 @@ int smartsdr_open(RIG *rig)
sprintf(cmd, "sub slice %d", priv->slicenum);
//sprintf(cmd, "sub slice all");
smartsdr_transaction(rig, cmd);
- do
+
+ do
{
- hl_usleep(100*1000);
- smartsdr_transaction(rig, NULL);
- } while (priv->freqA == 0 && --loops > 0);
+ hl_usleep(100 * 1000);
+ smartsdr_transaction(rig, NULL);
+ }
+ while (priv->freqA == 0 && --loops > 0);
+
//smartsdr_transaction(rig, "info", buf, sizeof(buf));
//rig_debug(RIG_DEBUG_VERBOSE, "%s: info=%s", __func__, buf);
@@ -453,7 +458,13 @@ static int smartsdr_parse_S(RIG *rig, char *s)
{
if (strcmp(state, "TRANSMITTING") == 0) { priv->ptt = 1; }
else { priv->ptt = 0; }
- rig_debug(RIG_DEBUG_VERBOSE, "%s: PTT state=%s, ptt=%d\n", __func__, state, priv->ptt);
+
+ rig_debug(RIG_DEBUG_VERBOSE, "%s: PTT state=%s, ptt=%d\n", __func__, state,
+ priv->ptt);
+ }
+ else if (sscanf(p, "tx=%d\n", &priv->tx))
+ {
+ rig_debug(RIG_DEBUG_VERBOSE, "%s: tx=%d\n", __func__, priv->tx);
}
}
while ((p = strtok(NULL, sep)));
@@ -519,7 +530,13 @@ int smartsdr_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt)
struct smartsdr_priv_data *priv = (struct smartsdr_priv_data *)STATE(rig)->priv;
ENTERFUNC;
smartsdr_transaction(rig, NULL);
- *ptt = priv->ptt;
+ *ptt = 0;
+
+ if (priv->tx)
+ {
+ *ptt = priv->ptt;
+ }
+
rig_debug(RIG_DEBUG_VERBOSE, "%s: ptt=%d\n", __func__, *ptt);
RETURNFUNC(RIG_OK);
}
diff --git a/rigs/flexradio/smartsdr_caps.h b/rigs/flexradio/smartsdr_caps.h
index 75b563a3d..b00ca4e91 100644
--- a/rigs/flexradio/smartsdr_caps.h
+++ b/rigs/flexradio/smartsdr_caps.h
@@ -1,5 +1,5 @@
.mfg_name = "Flex-radio",
- .version = "20240606.0",
+ .version = "20240609.0",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
-----------------------------------------------------------------------
Summary of changes:
NEWS | 1 +
include/hamlib/rotator.h | 1 +
include/hamlib/rotlist.h | 1 +
rigs/dummy/flrig.c | 9 +-
rigs/dummy/netrotctl.c | 36 ++++
rigs/dummy/rot_dummy.c | 1 +
rigs/dummy/rot_dummy.h | 1 +
rigs/dummy/rot_pstrotator.c | 428 ++++++++++++++++++-----------------------
rigs/dummy/rot_pstrotator.h | 19 ++
rigs/flexradio/smartsdr.c | 29 ++-
rigs/flexradio/smartsdr_caps.h | 2 +-
rigs/kenwood/ts890s.c | 6 +-
rigs/tentec/orion.c | 7 +-
rigs/tentec/orion.h | 8 +-
src/conf.c | 1 -
15 files changed, 294 insertions(+), 256 deletions(-)
hooks/post-receive
--
Hamlib -- Ham radio control libraries
|
|
From: n0nb <n0...@us...> - 2024-06-09 14:03: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 ff0ed58edf3955596892ed5082ee44da89d94cf9 (commit)
via c4e5f54bbfbd7c28f55234bc589f2e953dd7b51f (commit)
via 5790af8cc662ed9ceab69740d43813ccf5522b41 (commit)
via eeba884c7ef55eb8e5e4a052d7a5c74c3d8c39ff (commit)
via 494787cb3c53686e9974f61a5fff6f7a77e7feb4 (commit)
via aa94298a098535a841ded77cd22899ad40e5cb6b (commit)
via f5870c84ef844aa60be0d710e8b6401214621141 (commit)
via 1557ad70f752f7217c1eff963af1a1f3c4f96026 (commit)
via c112a5f6a94703f59a9d74d421a25b1b4e606e22 (commit)
via efcea5ddcdf28bbef703a37968e6cfd815208292 (commit)
via 83583b6c0ae25d10c51991358c0ff7555a743688 (commit)
via 967efefabef228ad44de7f8a9bc898c9c82ad05f (commit)
via 07e50854486178270e286b1bbd81fe4c087adbce (commit)
via 0884532e97a37af7227dcf6392ce85a5b46dec1e (commit)
via 2c863c732298a46b97a9f3d48b0df26a327dc690 (commit)
via 53287de4878e0bc53199dc9ce9aefbf7b2cf973f (commit)
via 5b84c02b807babd12406826e0af75fed5576b7e1 (commit)
via d17290b835c502b98936a107e11ef1fc261b3894 (commit)
via d6dcd4aad43a791d34ecedac024fd00b32d270d6 (commit)
via 9e4bacbec92d7f9e68b26b87a9736873df05baae (commit)
via 9eda0628f6a68191a816706cb829afcc0c47af43 (commit)
via a42d408094d89599529abae3be84c5b6415a3792 (commit)
via 95cfde24f4582e38eac9a81c46e19220d23fc4c4 (commit)
via b0df007d6b33d46f01bfb03d7c1c92f9f713f035 (commit)
via 0dce1e478f7f63f511be43596ae33bc760f865cf (commit)
via 3e6b9da1ebec41f9fd92045f603dfa7d33c34d88 (commit)
via da264c2732c206dfe589770fd29f35f3dec800bf (commit)
via a9c2569b69959fadb099801773ad65fa72dc34e2 (commit)
from 4058b021d45946c8ff92c0ec6313cafa9e0c0507 (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 ff0ed58edf3955596892ed5082ee44da89d94cf9
Merge: 1557ad70f c4e5f54bb
Author: Michael Black <mdb...@ya...>
Date: Sat Jun 8 11:09:02 2024 -0500
Merge pull request #1563 from GeoBaltz/rp11
Convert all rig->state references in rigs/*/* to macro calls
commit c4e5f54bbfbd7c28f55234bc589f2e953dd7b51f
Author: George Baltz N3GB <Geo...@gm...>
Date: Sat Jun 8 03:53:17 2024 -0400
FIx the stragglers
Comments/false postitives
New code
diff --git a/rigs/dummy/rot_pstrotator.c b/rigs/dummy/rot_pstrotator.c
index 2de2d9f81..d89d34fab 100644
--- a/rigs/dummy/rot_pstrotator.c
+++ b/rigs/dummy/rot_pstrotator.c
@@ -163,18 +163,19 @@ static int write_transaction(ROT *rot, char *cmd)
static int pstrotator_rot_init(ROT *rot)
{
struct pstrotator_rot_priv_data *priv;
+ struct rot_state *rs = ROTSTATE(rot);
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
- rot->state.priv = (struct pstrotator_rot_priv_data *)
+ rs->priv = (struct pstrotator_rot_priv_data *)
calloc(1, sizeof(struct pstrotator_rot_priv_data));
- if (!rot->state.priv)
+ if (!rs->priv)
{
return -RIG_ENOMEM;
}
- priv = rot->state.priv;
+ priv = rs->priv;
priv->ext_funcs = alloc_init_ext(pstrotator_ext_funcs);
@@ -212,8 +213,9 @@ static int pstrotator_rot_init(ROT *rot)
static int pstrotator_rot_cleanup(ROT *rot)
{
+ struct rot_state *rs = ROTSTATE(rot);
struct pstrotator_rot_priv_data *priv = (struct pstrotator_rot_priv_data *)
- rot->state.priv;
+ rs->priv;
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
@@ -221,9 +223,9 @@ static int pstrotator_rot_cleanup(ROT *rot)
free(priv->ext_levels);
free(priv->ext_parms);
free(priv->magic_conf);
- free(rot->state.priv);
+ free(rs->priv);
- rot->state.priv = NULL;
+ rs->priv = NULL;
return RIG_OK;
}
@@ -251,11 +253,12 @@ static int pstrotator_rot_open(ROT *rot)
int n1, n2, n3, n4;
int sockfd;
struct sockaddr_in clientAddr;
+ struct rot_state *rs = ROTSTATE(rot);
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
- priv = (struct pstrotator_rot_priv_data *)rot->state.priv;
- //priv->port2 = rot->state.rotport;
+ priv = (struct pstrotator_rot_priv_data *)rs->priv;
+ //priv->port2 = rs->rotport;
//priv->port2.type.rig = RIG_PORT_UDP_NETWORK;
rig_debug(RIG_DEBUG_VERBOSE, "%s: pathname=%s\n", __func__,
@@ -300,7 +303,7 @@ static int pstrotator_set_conf(ROT *rot, hamlib_token_t token, const char *val)
{
struct pstrotator_rot_priv_data *priv;
- priv = (struct pstrotator_rot_priv_data *)rot->state.priv;
+ priv = (struct pstrotator_rot_priv_data *)ROTSTATE(rot)->priv;
switch (token)
{
@@ -326,7 +329,7 @@ static int pstrotator_get_conf2(ROT *rot, hamlib_token_t token, char *val,
{
struct pstrotator_rot_priv_data *priv;
- priv = (struct pstrotator_rot_priv_data *)rot->state.priv;
+ priv = (struct pstrotator_rot_priv_data *)ROTSTATE(rot)->priv;
switch (token)
{
@@ -351,7 +354,7 @@ static int pstrotator_get_conf(ROT *rot, hamlib_token_t token, char *val)
static int pstrotator_rot_set_position(ROT *rot, azimuth_t az, elevation_t el)
{
struct pstrotator_rot_priv_data *priv = (struct pstrotator_rot_priv_data *)
- rot->state.priv;
+ ROTSTATE(rot)->priv;
rig_debug(RIG_DEBUG_VERBOSE, "%s called: %.2f %.2f\n", __func__,
az, el);
@@ -442,7 +445,7 @@ void readPacket(int sockfd, char *buf, int buf_len, int expected)
static int pstrotator_rot_get_position(ROT *rot, azimuth_t *az, elevation_t *el)
{
struct pstrotator_rot_priv_data *priv = (struct pstrotator_rot_priv_data *)
- rot->state.priv;
+ ROTSTATE(rot)->priv;
char buf[64];
int n = 0;
fd_set rfds, efds;
@@ -519,7 +522,7 @@ static int pstrotator_rot_get_status(ROT *rot, rot_status_t *status)
{
const struct pstrotator_rot_priv_data *priv = (struct pstrotator_rot_priv_data
*)
- rot->state.priv;
+ ROTSTATE(rot)->priv;
*status = priv->status;
diff --git a/rigs/tentec/orion.c b/rigs/tentec/orion.c
index 6873cd68b..89cf4d157 100644
--- a/rigs/tentec/orion.c
+++ b/rigs/tentec/orion.c
@@ -694,6 +694,7 @@ int tt565_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
char ttmode, ttreceiver;
int retry;
int timeout;
+ struct rig_state *rs = STATE(rig);
ttreceiver = which_receiver(rig, vfo);
@@ -743,15 +744,15 @@ int tt565_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
/* Query passband width (filter) */
// since this fails at 80ms sometimes we won't retry and will reduce the timeout
// Normally this comes back in about 30ms
- retry = rig->state.retry;
- timeout = rig->state.timeout;
- rig->state.retry = 0;
- rig->state.timeout = 100;
+ retry = rs->retry;
+ timeout = rs->timeout;
+ rs->retry = 0;
+ rs->timeout = 100;
SNPRINTF(cmdbuf, sizeof(cmdbuf), "?R%cF" EOM, ttreceiver);
resp_len = sizeof(respbuf);
retval = tt565_transaction(rig, cmdbuf, strlen(cmdbuf), respbuf, &resp_len);
- rig->state.retry = retry;
- rig->state.timeout = timeout;
+ rs->retry = retry;
+ rs->timeout = timeout;
if (retval != RIG_OK)
{
diff --git a/rigs/yaesu/ft1000d.c b/rigs/yaesu/ft1000d.c
index 2f2b479ac..84ccbf3ff 100644
--- a/rigs/yaesu/ft1000d.c
+++ b/rigs/yaesu/ft1000d.c
@@ -2439,7 +2439,7 @@ static int ft1000d_set_vfo(RIG *rig, vfo_t vfo)
}
priv = (struct ft1000d_priv_data *)STATE(rig)->priv;
- rig_debug(RIG_DEBUG_TRACE, "%s: MADE IT TO rig.state.priv = 0x%02x\n", __func__,
+ rig_debug(RIG_DEBUG_TRACE, "%s: MADE IT TO STATE(rig)->priv = 0x%02x\n", __func__,
RIG_VFO_CURR);
// if (vfo == RIG_VFO_CURR) {
diff --git a/rigs/yaesu/ft847.c b/rigs/yaesu/ft847.c
index b4ebe6d0a..4dfba1c28 100644
--- a/rigs/yaesu/ft847.c
+++ b/rigs/yaesu/ft847.c
@@ -1005,7 +1005,7 @@ struct rig_caps ft847uni_caps =
/*
* setup *priv
- * serial port is already open (rig->state->fd)
+ * serial port is already open (STATE(rig)->fd)
*/
static int ft847_init(RIG *rig)
commit 5790af8cc662ed9ceab69740d43813ccf5522b41
Author: George Baltz N3GB <Geo...@gm...>
Date: Sat Jun 8 03:27:18 2024 -0400
Convert newcat.c
diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c
index 85a20865c..2219f18aa 100644
--- a/rigs/yaesu/newcat.c
+++ b/rigs/yaesu/newcat.c
@@ -476,15 +476,15 @@ int newcat_init(RIG *rig)
ENTERFUNC;
- rig->state.priv = (struct newcat_priv_data *) calloc(1,
+ STATE(rig)->priv = (struct newcat_priv_data *) calloc(1,
sizeof(struct newcat_priv_data));
- if (!rig->state.priv) /* whoops! memory shortage! */
+ if (!STATE(rig)->priv) /* whoops! memory shortage! */
{
RETURNFUNC(-RIG_ENOMEM);
}
- priv = rig->state.priv;
+ priv = STATE(rig)->priv;
// priv->current_vfo = RIG_VFO_MAIN; /* default to whatever */
// priv->current_vfo = RIG_VFO_A;
@@ -534,12 +534,12 @@ int newcat_cleanup(RIG *rig)
ENTERFUNC;
- if (rig->state.priv)
+ if (STATE(rig)->priv)
{
- free(rig->state.priv);
+ free(STATE(rig)->priv);
}
- rig->state.priv = NULL;
+ STATE(rig)->priv = NULL;
RETURNFUNC(RIG_OK);
}
@@ -554,8 +554,8 @@ int newcat_cleanup(RIG *rig)
int newcat_open(RIG *rig)
{
- struct newcat_priv_data *priv = rig->state.priv;
- struct rig_state *rig_s = &rig->state;
+ struct rig_state *rig_s = STATE(rig);
+ struct newcat_priv_data *priv = rig_s->priv;
hamlib_port_t *rp = RIGPORT(rig);
const char *handshake[3] = {"None", "Xon/Xoff", "Hardware"};
int err;
@@ -659,7 +659,7 @@ int newcat_open(RIG *rig)
if (priv->rig_id == NC_RIGID_FTDX3000 || priv->rig_id == NC_RIGID_FTDX3000DM)
{
- rig->state.disable_yaesu_bandselect = 1;
+ rig_s->disable_yaesu_bandselect = 1;
rig_debug(RIG_DEBUG_VERBOSE, "%s: disabling FTDX3000 band select\n", __func__);
}
@@ -703,8 +703,8 @@ int newcat_open(RIG *rig)
int newcat_close(RIG *rig)
{
- struct newcat_priv_data *priv = rig->state.priv;
- struct rig_state *rig_s = &rig->state;
+ struct rig_state *rig_s = STATE(rig);
+ struct newcat_priv_data *priv = rig_s->priv;
ENTERFUNC;
@@ -753,7 +753,7 @@ int newcat_set_conf(RIG *rig, hamlib_token_t token, const char *val)
ENTERFUNC;
- priv = (struct newcat_priv_data *)rig->state.priv;
+ priv = (struct newcat_priv_data *)STATE(rig)->priv;
if (priv == NULL)
{
@@ -806,7 +806,7 @@ int newcat_get_conf2(RIG *rig, hamlib_token_t token, char *val, int val_len)
ENTERFUNC;
- priv = (struct newcat_priv_data *)rig->state.priv;
+ priv = (struct newcat_priv_data *)STATE(rig)->priv;
if (priv == NULL)
{
@@ -836,7 +836,7 @@ static int freq_60m[] = { 5332000, 5348000, 5358500, 5373000, 5405000 };
/* returns 0 if no exception or 1 if rig needs special handling */
int newcat_60m_exception(RIG *rig, freq_t freq, mode_t mode)
{
- struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
+ struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv;
int err;
int channel = -1;
int i;
@@ -937,6 +937,7 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
int err;
struct rig_caps *caps;
struct rig_cache *cachep = CACHE(rig);
+ struct rig_state *rig_s = STATE(rig);
struct newcat_priv_data *priv;
int special_60m = 0;
vfo_t vfo_mode;
@@ -965,7 +966,7 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
RETURNFUNC(-RIG_ENAVAIL);
}
- priv = (struct newcat_priv_data *)rig->state.priv;
+ priv = (struct newcat_priv_data *)rig_s->priv;
caps = rig->caps;
newcat_get_vfo_mode(rig, RIG_VFO_A, &vfo_mode);
@@ -1033,7 +1034,7 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
if ((is_ftdx101d || is_ftdx101mp) && cachep->ptt == RIG_PTT_ON)
{
rig_debug(RIG_DEBUG_TRACE, "%s: ftdx101 check vfo OK, vfo=%s, tx_vfo=%s\n",
- __func__, rig_strvfo(vfo), rig_strvfo(rig->state.tx_vfo));
+ __func__, rig_strvfo(vfo), rig_strvfo(rig_s->tx_vfo));
// when in split we can change VFOB but not VFOA
if (cachep->split == RIG_SPLIT_ON && target_vfo == '0') { return -RIG_ENTARGET; }
@@ -1041,7 +1042,7 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
// when not in split we can't change VFOA at all
if (cachep->split == RIG_SPLIT_OFF && target_vfo == '0') { return -RIG_ENTARGET; }
- if (vfo != rig->state.tx_vfo) { return -RIG_ENTARGET; }
+ if (vfo != rig_s->tx_vfo) { return -RIG_ENTARGET; }
}
if (is_ftdx3000 || is_ftdx3000dm || is_ftdx5000 || is_ftdx1200)
@@ -1119,8 +1120,8 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
// And only when not in split mode (note this check has been removed for testing)
int changing;
- rig_debug(RIG_DEBUG_TRACE, "%s(%d)%s: rig->state.current_vfo=%s\n", __FILE__,
- __LINE__, __func__, rig_strvfo(rig->state.current_vfo));
+ rig_debug(RIG_DEBUG_TRACE, "%s(%d)%s: STATE(rig)->current_vfo=%s\n", __FILE__,
+ __LINE__, __func__, rig_strvfo(rig_s->current_vfo));
CACHE_RESET;
@@ -1146,7 +1147,7 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
}
if (newcat_valid_command(rig, "BS") && changing
- && !rig->state.disable_yaesu_bandselect
+ && !rig_s->disable_yaesu_bandselect
// remove the split check here -- hopefully works OK
//&& !cachep->split
// seems some rigs are problematic
@@ -1161,7 +1162,7 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
&& rig->caps->set_vfo != NULL) // gotta' have get_vfo too
{
- if (rig->state.current_vfo != vfo)
+ if (rig_s->current_vfo != vfo)
{
int vfo1 = 1, vfo2 = 0;
@@ -1229,7 +1230,7 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
if (err != RIG_OK) { RETURNFUNC(err); }
- if (rig->state.vfo_list & RIG_VFO_MAIN)
+ if (rig_s->vfo_list & RIG_VFO_MAIN)
{
err = rig_set_vfo(rig, vfotmp == RIG_VFO_MAIN ? RIG_VFO_SUB : RIG_VFO_MAIN);
}
@@ -1263,7 +1264,7 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
}
// switch back to the starting vfo
- if (rig->state.vfo_list & RIG_VFO_MAIN)
+ if (rig_s->vfo_list & RIG_VFO_MAIN)
{
err = rig_set_vfo(rig, vfotmp == RIG_VFO_MAIN ? RIG_VFO_MAIN : RIG_VFO_SUB);
}
@@ -1387,7 +1388,7 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
}
rig_debug(RIG_DEBUG_TRACE, "%s: band changing? old=%d, new=%d\n", __func__,
- newcat_band_index(freq), newcat_band_index(rig->state.current_freq));
+ newcat_band_index(freq), newcat_band_index(rig_s->current_freq));
if (RIG_MODEL_FT450 == caps->rig_model && priv->ret_data[2] != target_vfo)
{
@@ -1418,7 +1419,7 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
int newcat_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
{
char command[3];
- struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
+ struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv;
char c;
int err;
@@ -1500,7 +1501,7 @@ int newcat_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
pbwidth_t twidth;
split_t split_save = cachep->split;
- priv = (struct newcat_priv_data *)rig->state.priv;
+ priv = (struct newcat_priv_data *)STATE(rig)->priv;
ENTERFUNC;
@@ -1611,7 +1612,7 @@ int newcat_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
int newcat_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
{
- struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
+ struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv;
char c;
int err;
char main_sub_vfo = '0';
@@ -1623,7 +1624,7 @@ int newcat_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
RETURNFUNC(-RIG_ENAVAIL);
}
- if (rig->state.powerstat == 0)
+ if (STATE(rig)->powerstat == 0)
{
rig_debug(RIG_DEBUG_WARN, "%s: Cannot get from rig when power is off\n",
__func__);
@@ -1697,8 +1698,8 @@ int newcat_set_vfo(RIG *rig, vfo_t vfo)
vfo_t vfo_mode;
char command[] = "VS";
- priv = (struct newcat_priv_data *)rig->state.priv;
- state = &rig->state;
+ state = STATE(rig);
+ priv = (struct newcat_priv_data *)state->priv;
priv->cache_start.tv_sec = 0; // invalidate the cache
@@ -1805,7 +1806,7 @@ int newcat_set_vfo(RIG *rig, vfo_t vfo)
state->current_vfo = vfo; /* if set_vfo worked, set current_vfo */
- rig_debug(RIG_DEBUG_TRACE, "%s: rig->state.current_vfo = %s\n", __func__,
+ rig_debug(RIG_DEBUG_TRACE, "%s: STATE(rig)->current_vfo = %s\n", __func__,
rig_strvfo(vfo));
RETURNFUNC(RIG_OK);
@@ -1814,7 +1815,7 @@ int newcat_set_vfo(RIG *rig, vfo_t vfo)
// Either returns a valid RIG_VFO* or if < 0 an error code
static vfo_t newcat_set_vfo_if_needed(RIG *rig, vfo_t vfo)
{
- vfo_t oldvfo = rig->state.current_vfo;
+ vfo_t oldvfo = STATE(rig)->current_vfo;
ENTERFUNC;
rig_debug(RIG_DEBUG_TRACE, "%s: vfo=%s, oldvfo=%s\n", __func__, rig_strvfo(vfo),
@@ -1847,8 +1848,8 @@ static vfo_t newcat_set_vfo_if_needed(RIG *rig, vfo_t vfo)
int newcat_get_vfo(RIG *rig, vfo_t *vfo)
{
- struct rig_state *state = &rig->state;
- struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
+ struct rig_state *state = STATE(rig);
+ struct newcat_priv_data *priv = (struct newcat_priv_data *)state->priv;
int err;
vfo_t vfo_mode;
char const *command = "VS";
@@ -1882,13 +1883,13 @@ int newcat_get_vfo(RIG *rig, vfo_t *vfo)
switch (priv->ret_data[2])
{
case '0':
- if (rig->state.vfo_list & RIG_VFO_MAIN) { *vfo = RIG_VFO_MAIN; }
+ if (state->vfo_list & RIG_VFO_MAIN) { *vfo = RIG_VFO_MAIN; }
else { *vfo = RIG_VFO_A; }
break;
case '1':
- if (rig->state.vfo_list & RIG_VFO_SUB) { *vfo = RIG_VFO_SUB; }
+ if (state->vfo_list & RIG_VFO_SUB) { *vfo = RIG_VFO_SUB; }
else { *vfo = RIG_VFO_B; }
break;
@@ -1912,7 +1913,7 @@ int newcat_get_vfo(RIG *rig, vfo_t *vfo)
state->current_vfo = *vfo; /* set now */
- rig_debug(RIG_DEBUG_TRACE, "%s: rig->state.current_vfo = %s\n", __func__,
+ rig_debug(RIG_DEBUG_TRACE, "%s: STATE(rig)->current_vfo = %s\n", __func__,
rig_strvfo(state->current_vfo));
RETURNFUNC(RIG_OK);
@@ -1921,7 +1922,7 @@ int newcat_get_vfo(RIG *rig, vfo_t *vfo)
int newcat_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt)
{
- struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
+ struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv;
int err = -RIG_EPROTO;
char txon[] = "TX1;";
@@ -1986,9 +1987,9 @@ int newcat_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt)
// some rigs like the FT991 need time before doing anything else like set_freq
// We won't mess with CW mode -- no freq change expected hopefully
- if (rig->state.current_mode != RIG_MODE_CW
- && rig->state.current_mode != RIG_MODE_CWR
- && rig->state.current_mode != RIG_MODE_CWN
+ if (STATE(rig)->current_mode != RIG_MODE_CW
+ && STATE(rig)->current_mode != RIG_MODE_CWR
+ && STATE(rig)->current_mode != RIG_MODE_CWN
&& (is_ftdx3000 || is_ftdx3000dm)
)
{
@@ -2010,7 +2011,7 @@ int newcat_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt)
int newcat_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt)
{
- struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
+ struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv;
char c;
int err;
@@ -2063,7 +2064,7 @@ int newcat_get_dcd(RIG *rig, vfo_t vfo, dcd_t *dcd)
int newcat_set_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t rptr_shift)
{
- struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
+ struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv;
int err;
char c;
char command[] = "OS";
@@ -2116,7 +2117,7 @@ int newcat_set_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t rptr_shift)
int newcat_get_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t *rptr_shift)
{
- struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
+ struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv;
int err;
char c;
char command[] = "OS";
@@ -2177,7 +2178,7 @@ int newcat_get_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t *rptr_shift)
int newcat_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t offs)
{
- struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
+ struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv;
int err;
char command[32];
freq_t freq = 0;
@@ -2422,7 +2423,7 @@ int newcat_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t offs)
int newcat_get_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t *offs)
{
- struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
+ struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv;
int err;
int ret_data_len;
char *retoffs;
@@ -2897,9 +2898,9 @@ int newcat_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo)
}
rig_debug(RIG_DEBUG_TRACE, "%s: tx_vfo=%s, curr_vfo=%s\n", __func__,
- rig_strvfo(*tx_vfo), rig_strvfo(rig->state.current_vfo));
+ rig_strvfo(*tx_vfo), rig_strvfo(STATE(rig)->current_vfo));
- if (*tx_vfo != rig->state.current_vfo)
+ if (*tx_vfo != STATE(rig)->current_vfo)
{
*split = RIG_SPLIT_ON;
}
@@ -2918,7 +2919,7 @@ int newcat_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo)
int newcat_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit)
{
- struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
+ struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv;
int oldvfo;
int ret;
@@ -2970,7 +2971,7 @@ int newcat_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit)
int newcat_get_rit(RIG *rig, vfo_t vfo, shortfreq_t *rit)
{
- struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
+ struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv;
char *retval;
int err;
int offset = 0;
@@ -3034,7 +3035,7 @@ int newcat_get_rit(RIG *rig, vfo_t vfo, shortfreq_t *rit)
int newcat_set_xit(RIG *rig, vfo_t vfo, shortfreq_t xit)
{
- struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
+ struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv;
int oldvfo;
int ret;
@@ -3087,7 +3088,7 @@ int newcat_set_xit(RIG *rig, vfo_t vfo, shortfreq_t xit)
int newcat_get_xit(RIG *rig, vfo_t vfo, shortfreq_t *xit)
{
- struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
+ struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv;
char *retval;
int err;
int offset = 0;
@@ -3293,7 +3294,7 @@ int newcat_get_tone(RIG *rig, vfo_t vfo, tone_t *tone)
int newcat_set_ctcss_tone(RIG *rig, vfo_t vfo, tone_t tone)
{
- struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
+ struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv;
int err;
int i;
ncboolean tone_match;
@@ -3363,7 +3364,7 @@ int newcat_set_ctcss_tone(RIG *rig, vfo_t vfo, tone_t tone)
int newcat_get_ctcss_tone(RIG *rig, vfo_t vfo, tone_t *tone)
{
- struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
+ struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv;
int err;
int t;
int ret_data_len;
@@ -3675,7 +3676,7 @@ int newcat_mW2power(RIG *rig, float *power, unsigned int mwpower, freq_t freq,
int newcat_set_powerstat(RIG *rig, powerstat_t status)
{
hamlib_port_t *rp = RIGPORT(rig);
- struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
+ struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv;
int retval;
int i = 0;
int retry_save;
@@ -3768,7 +3769,7 @@ int newcat_set_powerstat(RIG *rig, powerstat_t status)
*/
int newcat_get_powerstat(RIG *rig, powerstat_t *status)
{
- struct newcat_priv_data *priv = (struct newcat_priv_data *) rig->state.priv;
+ struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv;
hamlib_port_t *rp = RIGPORT(rig);
int result;
char ps;
@@ -3881,7 +3882,7 @@ EX0301033 => RX-ANT => MONITOR [RANT]
*/
int newcat_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option)
{
- struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
+ struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv;
int err;
char which_ant;
char command[] = "AN";
@@ -3973,7 +3974,7 @@ int newcat_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option)
int newcat_get_ant(RIG *rig, vfo_t vfo, ant_t dummy, value_t *option,
ant_t *ant_curr, ant_t *ant_tx, ant_t *ant_rx)
{
- struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
+ struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv;
int err;
char c;
char command[] = "AN";
@@ -4092,7 +4093,7 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
{
struct rig_state *state = STATE(rig);
struct rig_cache *cachep = CACHE(rig);
- struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
+ struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv;
int err;
int i;
int fpf;
@@ -4303,9 +4304,9 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
rmode_t exclude = RIG_MODE_CW | RIG_MODE_CWR | RIG_MODE_RTTY | RIG_MODE_RTTYR;
- if ((rig->state.tx_vfo == RIG_VFO_A && (cachep->modeMainA & exclude))
- || (rig->state.tx_vfo == RIG_VFO_B && (cachep->modeMainB & exclude))
- || (rig->state.tx_vfo == RIG_VFO_C && (cachep->modeMainC & exclude)))
+ if ((STATE(rig)->tx_vfo == RIG_VFO_A && (cachep->modeMainA & exclude))
+ || (STATE(rig)->tx_vfo == RIG_VFO_B && (cachep->modeMainB & exclude))
+ || (STATE(rig)->tx_vfo == RIG_VFO_C && (cachep->modeMainC & exclude)))
{
rig_debug(RIG_DEBUG_VERBOSE, "%s: rig cannot set MG in CW/RTTY modes\n",
__func__);
@@ -4908,7 +4909,7 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
case RIG_LEVEL_USB_AF:
if (is_ftdx101d || is_ftdx101mp)
{
- rmode_t curmode = rig->state.current_vfo == RIG_VFO_A ?
+ rmode_t curmode = STATE(rig)->current_vfo == RIG_VFO_A ?
cachep->modeMainA : cachep->modeMainB;
float valf = val.f / level_info->step.f;
@@ -4965,7 +4966,7 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
{
struct rig_state *state = STATE(rig);
struct rig_cache *cachep = CACHE(rig);
- struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
+ struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv;
int err;
int ret_data_len;
char *retlvl;
@@ -5121,9 +5122,9 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
rmode_t exclude = RIG_MODE_CW | RIG_MODE_CWR | RIG_MODE_RTTY | RIG_MODE_RTTYR;
- if ((rig->state.tx_vfo == RIG_VFO_A && (cachep->modeMainA & exclude))
- || (rig->state.tx_vfo == RIG_VFO_B && (cachep->modeMainB & exclude))
- || (rig->state.tx_vfo == RIG_VFO_C && (cachep->modeMainC & exclude)))
+ if ((STATE(rig)->tx_vfo == RIG_VFO_A && (cachep->modeMainA & exclude))
+ || (STATE(rig)->tx_vfo == RIG_VFO_B && (cachep->modeMainB & exclude))
+ || (STATE(rig)->tx_vfo == RIG_VFO_C && (cachep->modeMainC & exclude)))
{
rig_debug(RIG_DEBUG_VERBOSE, "%s: rig cannot read MG in CW/RTTY modes\n",
__func__);
@@ -5505,7 +5506,7 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
case RIG_LEVEL_USB_AF_INPUT:
if (is_ftdx101d || is_ftdx101mp)
{
- rmode_t curmode = rig->state.current_vfo == RIG_VFO_A ?
+ rmode_t curmode = STATE(rig)->current_vfo == RIG_VFO_A ?
cachep->modeMainA : cachep->modeMainB;
switch (curmode)
@@ -5547,7 +5548,7 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
case RIG_LEVEL_USB_AF:
if (is_ftdx101d || is_ftdx101mp)
{
- rmode_t curmode = rig->state.current_vfo == RIG_VFO_A ?
+ rmode_t curmode = STATE(rig)->current_vfo == RIG_VFO_A ?
cachep->modeMainA : cachep->modeMainB;
switch (curmode)
@@ -6058,7 +6059,7 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status)
{
- struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
+ struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv;
int err;
char main_sub_vfo = '0';
@@ -6497,7 +6498,7 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status)
int newcat_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status)
{
- struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
+ struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv;
int err;
int ret_data_len;
int last_char_index;
@@ -6912,7 +6913,7 @@ int newcat_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status)
int newcat_set_parm(RIG *rig, setting_t parm, value_t val)
{
- struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
+ struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv;
int retval;
int rigband = 0;
int band = 0;
@@ -6982,7 +6983,7 @@ int newcat_set_parm(RIG *rig, setting_t parm, value_t val)
int newcat_get_parm(RIG *rig, setting_t parm, value_t *val)
{
- struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
+ struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv;
int retval;
ENTERFUNC;
@@ -7024,7 +7025,7 @@ static int newcat_set_maxpower(RIG *rig, vfo_t vfo, hamlib_token_t token,
static int newcat_get_maxpower(RIG *rig, vfo_t vfo, hamlib_token_t token,
value_t *val)
{
- struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
+ struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv;
int retval;
int code = 0;
int offset = 0;
@@ -7086,7 +7087,7 @@ static int newcat_get_maxpower(RIG *rig, vfo_t vfo, hamlib_token_t token,
int newcat_set_ext_level(RIG *rig, vfo_t vfo, hamlib_token_t token, value_t val)
{
- struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
+ struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv;
ENTERFUNC;
@@ -7140,7 +7141,7 @@ int newcat_set_ext_level(RIG *rig, vfo_t vfo, hamlib_token_t token, value_t val)
int newcat_get_ext_level(RIG *rig, vfo_t vfo, hamlib_token_t token,
value_t *val)
{
- struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
+ struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv;
char *result;
int retval;
int value;
@@ -7301,7 +7302,7 @@ int newcat_recv_dtmf(RIG *rig, vfo_t vfo, char *digits, int *length)
int newcat_send_morse(RIG *rig, vfo_t vfo, const char *msg)
{
- struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
+ struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv;
int rc;
ENTERFUNC;
@@ -7398,7 +7399,7 @@ int newcat_set_bank(RIG *rig, vfo_t vfo, int bank)
int newcat_set_mem(RIG *rig, vfo_t vfo, int ch)
{
- struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
+ struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv;
int err, i;
ncboolean restore_vfo;
chan_t *chan_list;
@@ -7510,7 +7511,7 @@ int newcat_set_mem(RIG *rig, vfo_t vfo, int ch)
int newcat_get_mem(RIG *rig, vfo_t vfo, int *ch)
{
- struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
+ struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv;
int err;
ENTERFUNC;
@@ -7537,7 +7538,7 @@ int newcat_get_mem(RIG *rig, vfo_t vfo, int *ch)
int newcat_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op)
{
- struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
+ struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv;
int err;
char main_sub_vfo = '0';
@@ -7639,7 +7640,7 @@ int newcat_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op)
int newcat_scan(RIG *rig, vfo_t vfo, scan_t scan, int ch)
{
- struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
+ struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv;
int retval;
ENTERFUNC;
@@ -7662,7 +7663,7 @@ int newcat_scan(RIG *rig, vfo_t vfo, scan_t scan, int ch)
int newcat_set_trn(RIG *rig, int trn)
{
- struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
+ struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv;
char c;
ENTERFUNC;
@@ -7691,7 +7692,7 @@ int newcat_set_trn(RIG *rig, int trn)
int newcat_get_trn(RIG *rig, int *trn)
{
- struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
+ struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv;
int err;
char c;
char command[] = "AI";
@@ -7742,8 +7743,8 @@ int newcat_decode_event(RIG *rig)
int newcat_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan)
{
- struct rig_state *state = &rig->state;
- struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
+ struct rig_state *state = STATE(rig);
+ struct newcat_priv_data *priv = (struct newcat_priv_data *)state->priv;
int err, i;
int rxit;
char c_rit, c_xit, c_mode, c_vfo, c_tone, c_rptr_shift;
@@ -7910,7 +7911,7 @@ int newcat_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan)
int newcat_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only)
{
- struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
+ struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv;
char *retval;
char c, c2;
int err, i;
@@ -8102,7 +8103,7 @@ int newcat_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only)
const char *newcat_get_info(RIG *rig)
{
- struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
+ struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv;
static char idbuf[129]; /* extra large static string array */
/* Build the command string */
@@ -8270,7 +8271,7 @@ ncboolean newcat_is_rig(RIG *rig, rig_model_t model)
int newcat_set_tx_vfo(RIG *rig, vfo_t tx_vfo)
{
- struct newcat_priv_data *priv = (struct newcat_priv_data *) rig->state.priv;
+ struct newcat_priv_data *priv = (struct newcat_priv_data *) STATE(rig)->priv;
char *command = "FT";
int result;
char p1;
@@ -8340,7 +8341,7 @@ int newcat_set_tx_vfo(RIG *rig, vfo_t tx_vfo)
RETURNFUNC(result);
}
- rig->state.tx_vfo = tx_vfo;
+ STATE(rig)->tx_vfo = tx_vfo;
RETURNFUNC(result);
}
@@ -8348,7 +8349,7 @@ int newcat_set_tx_vfo(RIG *rig, vfo_t tx_vfo)
int newcat_get_tx_vfo(RIG *rig, vfo_t *tx_vfo)
{
- struct newcat_priv_data *priv = (struct newcat_priv_data *) rig->state.priv;
+ struct newcat_priv_data *priv = (struct newcat_priv_data *) STATE(rig)->priv;
char const *command = "FT";
vfo_t vfo_mode;
int result;
@@ -8373,7 +8374,7 @@ int newcat_get_tx_vfo(RIG *rig, vfo_t *tx_vfo)
switch (c)
{
case '0':
- if (rig->state.vfo_list & RIG_VFO_MAIN)
+ if (STATE(rig)->vfo_list & RIG_VFO_MAIN)
{
*tx_vfo = RIG_VFO_MAIN;
}
@@ -8385,7 +8386,7 @@ int newcat_get_tx_vfo(RIG *rig, vfo_t *tx_vfo)
break;
case '1' :
- if (rig->state.vfo_list & RIG_VFO_SUB)
+ if (STATE(rig)->vfo_list & RIG_VFO_SUB)
{
*tx_vfo = RIG_VFO_SUB;
}
@@ -8424,7 +8425,7 @@ int newcat_get_tx_vfo(RIG *rig, vfo_t *tx_vfo)
static int newcat_set_split(RIG *rig, split_t split, vfo_t *rx_vfo,
vfo_t *tx_vfo)
{
- struct newcat_priv_data *priv = (struct newcat_priv_data *) rig->state.priv;
+ struct newcat_priv_data *priv = (struct newcat_priv_data *) STATE(rig)->priv;
char *command = "ST";
char p1;
int result;
@@ -8474,8 +8475,8 @@ static int newcat_set_split(RIG *rig, split_t split, vfo_t *rx_vfo,
switch (split)
{
case RIG_SPLIT_OFF:
- *rx_vfo = rig->state.current_vfo;
- *tx_vfo = rig->state.current_vfo;
+ *rx_vfo = STATE(rig)->current_vfo;
+ *tx_vfo = STATE(rig)->current_vfo;
break;
case RIG_SPLIT_ON:
@@ -8493,7 +8494,7 @@ static int newcat_set_split(RIG *rig, split_t split, vfo_t *rx_vfo,
}
else
{
- *rx_vfo = rig->state.current_vfo;
+ *rx_vfo = STATE(rig)->current_vfo;
result = newcat_get_tx_vfo(rig, tx_vfo);
@@ -8515,7 +8516,7 @@ static int newcat_set_split(RIG *rig, split_t split, vfo_t *rx_vfo,
static int newcat_get_split(RIG *rig, split_t *split, vfo_t *tx_vfo)
{
- struct newcat_priv_data *priv = (struct newcat_priv_data *) rig->state.priv;
+ struct newcat_priv_data *priv = (struct newcat_priv_data *) STATE(rig)->priv;
char const *command = "ST";
int result;
char c;
@@ -8621,19 +8622,19 @@ int newcat_set_vfo_from_alias(RIG *rig, vfo_t *vfo)
case RIG_VFO_CURR: /* RIG_VFO_RX == RIG_VFO_CURR */
case RIG_VFO_VFO:
- *vfo = rig->state.current_vfo;
+ *vfo = STATE(rig)->current_vfo;
break;
case RIG_VFO_TX:
/* set to another vfo for split or uplink */
- if (rig->state.vfo_list & RIG_VFO_MAIN)
+ if (STATE(rig)->vfo_list & RIG_VFO_MAIN)
{
- *vfo = (rig->state.current_vfo == RIG_VFO_SUB) ? RIG_VFO_MAIN : RIG_VFO_SUB;
+ *vfo = (STATE(rig)->current_vfo == RIG_VFO_SUB) ? RIG_VFO_MAIN : RIG_VFO_SUB;
}
else
{
- *vfo = (rig->state.current_vfo == RIG_VFO_B) ? RIG_VFO_A : RIG_VFO_B;
+ *vfo = (STATE(rig)->current_vfo == RIG_VFO_B) ? RIG_VFO_A : RIG_VFO_B;
}
break;
@@ -8656,7 +8657,7 @@ int newcat_set_vfo_from_alias(RIG *rig, vfo_t *vfo)
int newcat_set_narrow(RIG *rig, vfo_t vfo, ncboolean narrow)
{
- struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
+ struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv;
int err;
char c;
char main_sub_vfo = '0';
@@ -8700,7 +8701,7 @@ int newcat_set_narrow(RIG *rig, vfo_t vfo, ncboolean narrow)
int newcat_get_narrow(RIG *rig, vfo_t vfo, ncboolean *narrow)
{
- struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
+ struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv;
int err;
char c;
char command[] = "NA";
@@ -8752,7 +8753,7 @@ int newcat_get_narrow(RIG *rig, vfo_t vfo, ncboolean *narrow)
// if vfo != RIG_VFO_NONE then will use NA0 or NA1 depending on vfo Main or Sub
static int get_narrow(RIG *rig, vfo_t vfo)
{
- struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
+ struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv;
int narrow = 0;
int err;
@@ -8779,7 +8780,7 @@ static int get_narrow(RIG *rig, vfo_t vfo)
int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
{
- struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
+ struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv;
int err;
int w = 0;
char main_sub_vfo = '0';
@@ -9642,7 +9643,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
static int set_roofing_filter(RIG *rig, vfo_t vfo, int index)
{
- struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
+ struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv;
struct newcat_priv_caps *priv_caps = (struct newcat_priv_caps *)rig->caps->priv;
struct newcat_roofing_filter *roofing_filters;
char main_sub_vfo = '0';
@@ -9747,7 +9748,7 @@ static int set_roofing_filter_for_width(RIG *rig, vfo_t vfo, int width)
static int get_roofing_filter(RIG *rig, vfo_t vfo,
struct newcat_roofing_filter **roofing_filter)
{
- struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
+ struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv;
struct newcat_priv_caps *priv_caps = (struct newcat_priv_caps *)rig->caps->priv;
struct newcat_roofing_filter *roofing_filters;
char roofing_filter_choice;
@@ -9809,7 +9810,7 @@ static int get_roofing_filter(RIG *rig, vfo_t vfo,
int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width)
{
- struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
+ struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv;
int err;
int w;
int sh_command_valid = 1;
@@ -10946,7 +10947,7 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width)
int newcat_set_faststep(RIG *rig, ncboolean fast_step)
{
- struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
+ struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv;
char c;
ENTERFUNC;
@@ -10975,7 +10976,7 @@ int newcat_set_faststep(RIG *rig, ncboolean fast_step)
int newcat_get_faststep(RIG *rig, ncboolean *fast_step)
{
- struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
+ struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv;
int err;
char c;
char command[] = "FS";
@@ -11012,7 +11013,7 @@ int newcat_get_faststep(RIG *rig, ncboolean *fast_step)
int newcat_get_rigid(RIG *rig)
{
- struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
+ struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv;
const char *s = NULL;
ENTERFUNC;
@@ -11050,7 +11051,7 @@ int newcat_get_rigid(RIG *rig)
*/
int newcat_get_vfo_mode(RIG *rig, vfo_t vfo, vfo_t *vfo_mode)
{
- struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
+ struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv;
int err;
int offset = 0;
char *cmd = "IF";
@@ -11076,7 +11077,7 @@ int newcat_get_vfo_mode(RIG *rig, vfo_t vfo, vfo_t *vfo_mode)
RETURNFUNC(err);
}
- if (rig->state.powerstat == 0)
+ if (STATE(rig)->powerstat == 0)
{
rig_debug(RIG_DEBUG_WARN, "%s: Cannot get from rig when power is off\n",
__func__);
@@ -11132,7 +11133,7 @@ int newcat_get_vfo_mode(RIG *rig, vfo_t vfo, vfo_t *vfo_mode)
int newcat_vfomem_toggle(RIG *rig)
{
- struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
+ struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv;
char command[] = "VM";
ENTERFUNC;
@@ -11163,9 +11164,9 @@ int newcat_vfomem_toggle(RIG *rig)
*/
int newcat_get_cmd(RIG *rig)
{
- struct rig_state *state = &rig->state;
+ struct rig_state *state = STATE(rig);
hamlib_port_t *rp = RIGPORT(rig);
- struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
+ struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv;
int retry_count = 0;
int rc = -RIG_EPROTO;
int is_read_cmd = 0;
@@ -11413,7 +11414,7 @@ int newcat_get_cmd(RIG *rig)
*/
int newcat_set_cmd_validate(RIG *rig)
{
- struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
+ struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv;
char valcmd[16];
int retries = 8;
int retry = 0;
@@ -11659,7 +11660,7 @@ repeat:
int newcat_set_cmd(RIG *rig)
{
hamlib_port_t *rp = RIGPORT(rig);
- struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
+ struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv;
int retry_count = 0;
int rc = -RIG_EPROTO;
@@ -11956,7 +11957,7 @@ rmode_t newcat_rmode_width(RIG *rig, vfo_t vfo, char mode, pbwidth_t *width)
int newcat_send_voice_mem(RIG *rig, vfo_t vfo, int ch)
{
char *p1 = "0"; // newer rigs have 2 bytes where is fixed at zero e.g. FT991
- struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
+ struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv;
if (!newcat_valid_command(rig, "PB"))
{
@@ -11971,7 +11972,7 @@ int newcat_send_voice_mem(RIG *rig, vfo_t vfo, int ch)
static int newcat_set_clarifier(RIG *rig, vfo_t vfo, int rx, int tx)
{
- struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
+ struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv;
char main_sub_vfo = '0';
if (!newcat_valid_command(rig, "CF"))
@@ -12024,7 +12025,7 @@ static int newcat_set_clarifier(RIG *rig, vfo_t vfo, int rx, int tx)
static int newcat_get_clarifier(RIG *rig, vfo_t vfo, int *rx, int *tx)
{
- struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
+ struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv;
char main_sub_vfo = '0';
int err;
int ret_data_len;
@@ -12071,7 +12072,7 @@ static int newcat_get_clarifier(RIG *rig, vfo_t vfo, int *rx, int *tx)
int newcat_set_clarifier_frequency(RIG *rig, vfo_t vfo, shortfreq_t freq)
{
- struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
+ struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv;
char main_sub_vfo = '0';
if (!newcat_valid_command(rig, "CF"))
@@ -12092,7 +12093,7 @@ int newcat_set_clarifier_frequency(RIG *rig, vfo_t vfo, shortfreq_t freq)
int newcat_get_clarifier_frequency(RIG *rig, vfo_t vfo, shortfreq_t *freq)
{
- struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
+ struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv;
char main_sub_vfo = '0';
int err;
int ret_data_len;
@@ -12142,7 +12143,7 @@ int newcat_get_clarifier_frequency(RIG *rig, vfo_t vfo, shortfreq_t *freq)
static int newcat_set_apf_frequency(RIG *rig, vfo_t vfo, int freq)
{
- struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
+ struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv;
char main_sub_vfo = (RIG_VFO_B == vfo || RIG_VFO_SUB == vfo) ? '1' : '0';
if (!newcat_valid_command(rig, "CO"))
@@ -12176,7 +12177,7 @@ static int newcat_set_apf_frequency(RIG *rig, vfo_t vfo, int freq)
static int newcat_get_apf_frequency(RIG *rig, vfo_t vfo, int *freq)
{
- struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
+ struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv;
char main_sub_vfo = (RIG_VFO_B == vfo || RIG_VFO_SUB == vfo) ? '1' : '0';
int err;
int ret_data_len;
@@ -12228,7 +12229,7 @@ static int newcat_get_apf_frequency(RIG *rig, vfo_t vfo, int *freq)
static int newcat_set_apf_width(RIG *rig, vfo_t vfo, int choice)
{
- struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
+ struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv;
if (!newcat_valid_command(rig, "EX"))
{
@@ -12271,7 +12272,7 @@ static int newcat_set_apf_width(RIG *rig, vfo_t vfo, int choice)
static int newcat_get_apf_width(RIG *rig, vfo_t vfo, int *choice)
{
- struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
+ struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv;
int err;
int ret_data_len;
char *ret_data;
@@ -12330,7 +12331,7 @@ static int newcat_get_apf_width(RIG *rig, vfo_t vfo, int *choice)
static int newcat_set_contour(RIG *rig, vfo_t vfo, int status)
{
- struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
+ struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv;
char main_sub_vfo = (RIG_VFO_B == vfo || RIG_VFO_SUB == vfo) ? '1' : '0';
if (!newcat_valid_command(rig, "CO"))
@@ -12368,7 +12369,7 @@ static int newcat_set_contour(RIG *rig, vfo_t vfo, int status)
static int newcat_get_contour(RIG *rig, vfo_t vfo, int *status)
{
- struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
+ struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv;
char main_sub_vfo = (RIG_VFO_B == vfo || RIG_VFO_SUB == vfo) ? '1' : '0';
int err;
int ret_data_len;
@@ -12425,7 +12426,7 @@ static int newcat_get_contour(RIG *rig, vfo_t vfo, int *status)
static int newcat_set_contour_frequency(RIG *rig, vfo_t vfo, int freq)
{
- struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
+ struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv;
char main_sub_vfo = (RIG_VFO_B == vfo || RIG_VFO_SUB == vfo) ? '1' : '0';
if (!newcat_valid_command(rig, "CO"))
@@ -12466,7 +12467,7 @@ static int newcat_set_contour_frequency(RIG *rig, vfo_t vfo, int freq)
static int newcat_get_contour_frequency(RIG *rig, vfo_t vfo, int *freq)
{
- struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
+ struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv;
char main_sub_vfo = (RIG_VFO_B == vfo || RIG_VFO_SUB == vfo) ? '1' : '0';
int err;
int ret_data_len;
@@ -12533,7 +12534,7 @@ static int newcat_get_contour_frequency(RIG *rig, vfo_t vfo, int *freq)
static int newcat_set_contour_level(RIG *rig, vfo_t vfo, int level)
{
- struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
+ struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv;
if (!newcat_valid_command(rig, "EX"))
{
@@ -12577,7 +12578,7 @@ static int newcat_set_contour_level(RIG *rig, vfo_t vfo, int level)
static int newcat_get_contour_level(RIG *rig, vfo_t vfo, int *level)
{
- struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
+ struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv;
int err;
int ret_data_len;
char *ret_data;
@@ -12636,7 +12637,7 @@ static int newcat_get_contour_level(RIG *rig, vfo_t vfo, int *level)
static int newcat_set_contour_width(RIG *rig, vfo_t vfo, int width)
{
- struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
+ struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv;
if (!newcat_valid_command(rig, "EX"))
{
@@ -12679,7 +12680,7 @@ static int newcat_set_contour_width(RIG *rig, vfo_t vfo, int width)
static int newcat_get_contour_width(RIG *rig, vfo_t vfo, int *width)
{
- struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
+ struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv;
int err;
int ret_data_len;
char *ret_data;
@@ -12741,7 +12742,7 @@ int newcat_set_clock(RIG *rig, int year, int month, int day, int hour, int min,
{
int retval = RIG_OK;
int err;
- struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
+ struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv;
if (!newcat_valid_command(rig, "DT"))
{
@@ -12789,7 +12790,7 @@ int newcat_get_clock(RIG *rig, int *year, int *month, int *day, int *hour,
int retval = RIG_OK;
int err;
int n;
- struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
+ struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv;
if (!newcat_valid_command(rig, "DT"))
{
commit eeba884c7ef55eb8e5e4a052d7a5c74c3d8c39ff
Author: George Baltz N3GB <Geo...@gm...>
Date: Fri Jun 7 16:58:26 2024 -0400
Next batch of state pointers
diff --git a/rigs/yaesu/ft736.c b/rigs/yaesu/ft736.c
index 68f62d43a..1b24e3b0c 100644
--- a/rigs/yaesu/ft736.c
+++ b/rigs/yaesu/ft736.c
@@ -226,15 +226,15 @@ int ft736_open(RIG *rig)
rig_debug(RIG_DEBUG_TRACE, "%s called\n", __func__);
- rig->state.priv = (struct ft736_priv_data *) calloc(1,
+ STATE(rig)->priv = (struct ft736_priv_data *) calloc(1,
sizeof(struct ft736_priv_data));
- if (!rig->state.priv)
+ if (!STATE(rig)->priv)
{
return -RIG_ENOMEM;
}
- priv = rig->state.priv;
+ priv = STATE(rig)->priv;
priv->split = RIG_SPLIT_OFF;
@@ -256,7 +256,7 @@ int ft736_close(RIG *rig)
rig_debug(RIG_DEBUG_TRACE, "%s called\n", __func__);
- free(rig->state.priv);
+ free(STATE(rig)->priv);
/* send Ext Cntl OFF: Deactivate CAT */
return write_block(RIGPORT(rig), cmd, YAESU_CMD_LENGTH);
@@ -267,7 +267,7 @@ int ft736_close(RIG *rig)
int ft736_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
{
unsigned char cmd[YAESU_CMD_LENGTH] = { 0x00, 0x00, 0x00, 0x00, 0x01};
- const struct ft736_priv_data *priv = (struct ft736_priv_data *)rig->state.priv;
+ const struct ft736_priv_data *priv = (struct ft736_priv_data *)STATE(rig)->priv;
int retval;
// we will assume requesting to set VFOB is split mode
@@ -318,7 +318,7 @@ int ft736_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
{
unsigned char cmd[YAESU_CMD_LENGTH] = { 0x00, 0x00, 0x00, 0x00, 0x07};
unsigned char md;
- const struct ft736_priv_data *priv = (struct ft736_priv_data *)rig->state.priv;
+ const struct ft736_priv_data *priv = (struct ft736_priv_data *)STATE(rig)->priv;
if (vfo == RIG_VFO_B) { return ft736_set_split_mode(rig, vfo, mode, width); }
@@ -366,7 +366,7 @@ int ft736_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
int ft736_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo)
{
unsigned char cmd[YAESU_CMD_LENGTH] = { 0x00, 0x00, 0x00, 0x00, 0x8e};
- struct ft736_priv_data *priv = (struct ft736_priv_data *)rig->state.priv;
+ struct ft736_priv_data *priv = (struct ft736_priv_data *)STATE(rig)->priv;
int ret;
/*
diff --git a/rigs/yaesu/ft747.c b/rigs/yaesu/ft747.c
index 74a45c7d0..0922f0a8b 100644
--- a/rigs/yaesu/ft747.c
+++ b/rigs/yaesu/ft747.c
@@ -441,10 +441,10 @@ struct rig_caps ft747_caps =
int ft747_init(RIG *rig)
{
- rig->state.priv = (struct ft747_priv_data *) calloc(1,
+ STATE(rig)->priv = (struct ft747_priv_data *) calloc(1,
sizeof(struct ft747_priv_data));
- if (!rig->state.priv) /* whoops! memory shortage! */
+ if (!STATE(rig)->priv) /* whoops! memory shortage! */
{
return -RIG_ENOMEM;
}
@@ -465,12 +465,12 @@ int ft747_cleanup(RIG *rig)
rig_debug(RIG_DEBUG_VERBOSE, "%s: called\n", __func__);
- if (rig->state.priv)
+ if (STATE(rig)->priv)
{
- free(rig->state.priv);
+ free(STATE(rig)->priv);
}
- rig->state.priv = NULL;
+ STATE(rig)->priv = NULL;
return RIG_OK;
}
@@ -487,7 +487,7 @@ int ft747_open(RIG *rig)
struct ft747_priv_data *p;
int ret;
- rig_s = &rig->state;
+ rig_s = STATE(rig);
p = (struct ft747_priv_data *)rig_s->priv;
rig_debug(RIG_DEBUG_VERBOSE, "ft747:rig_open: write_delay = %i msec \n",
@@ -547,7 +547,7 @@ int ft747_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
// cppcheck-suppress *
char *fmt = "%s: requested freq after conversion = %"PRIll" Hz \n";
- p = (struct ft747_priv_data *)rig->state.priv;
+ p = (struct ft747_priv_data *)STATE(rig)->priv;
rig_debug(RIG_DEBUG_VERBOSE,
"ft747: requested freq = %"PRIfreq" Hz vfo = %s \n", freq, rig_strvfo(vfo));
@@ -595,7 +595,7 @@ int ft747_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
return RIG_OK;
}
- p = (struct ft747_priv_data *)rig->state.priv;
+ p = (struct ft747_priv_data *)STATE(rig)->priv;
ret = ft747_get_update_data(rig); /* get whole shebang from rig */
if (ret < 0)
@@ -712,7 +712,7 @@ int ft747_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
rig_debug(RIG_DEBUG_VERBOSE, "ft747: cmd_index = %i \n", cmd_index);
rig_force_cache_timeout(&((struct ft747_priv_data *)
- rig->state.priv)->status_tv);
+ STATE(rig)->priv)->status_tv);
/*
* phew! now send cmd to rig
@@ -728,7 +728,7 @@ int ft747_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
unsigned char mymode; /* ft747 mode */
int ret;
- p = (struct ft747_priv_data *)rig->state.priv;
+ p = (struct ft747_priv_data *)STATE(rig)->priv;
ret = ft747_get_update_data(rig); /* get whole shebang from rig */
@@ -798,7 +798,7 @@ int ft747_set_vfo(RIG *rig, vfo_t vfo)
struct ft747_priv_data *p;
unsigned char cmd_index; /* index of sequence to send */
- p = (struct ft747_priv_data *)rig->state.priv;
+ p = (struct ft747_priv_data *)STATE(rig)->priv;
switch (vfo)
{
@@ -831,7 +831,7 @@ int ft747_get_vfo(RIG *rig, vfo_t *vfo)
unsigned char status; /* ft747 status flag */
int ret;
- p = (struct ft747_priv_data *)rig->state.priv;
+ p = (struct ft747_priv_data *)STATE(rig)->priv;
ret = ft747_get_update_data(rig); /* get whole shebang from rig */
@@ -872,7 +872,7 @@ int ft747_set_split(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo)
FT_747_NATIVE_SPLIT_OFF;
rig_force_cache_timeout(&((struct ft747_priv_data *)
- rig->state.priv)->status_tv);
+ STATE(rig)->priv)->status_tv);
return ft747_send_priv_cmd(rig, cmd_index);
@@ -884,7 +884,7 @@ int ft747_get_split(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo)
unsigned char status; /* ft747 status flag */
int ret;
- p = (struct ft747_priv_data *)rig->state.priv;
+ p = (struct ft747_priv_data *)STATE(rig)->priv;
ret = ft747_get_update_data(rig); /* get whole sheban...
[truncated message content] |
|
From: n0nb <n0...@us...> - 2024-06-02 21:28:22
|
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 4058b021d45946c8ff92c0ec6313cafa9e0c0507 (commit)
via 2f97b4bf82d7e9f770ea21ca4d5a73cce4083c97 (commit)
via 3549dfe22c5d4a1f29bebde5db2b4429d4a18cd6 (commit)
via 205e03bc57cee4d643bf2dff3411973a78e6daa2 (commit)
via 3ce55b2a9474b3601e3417f9ddfb8cc33796f328 (commit)
via 2794d2dfe143e88452d58f5a3924c1bce52390de (commit)
via ce25f638434f20d789d0aecb4dd5a9bbadbfa30e (commit)
via a63e518393264d2f4c31ab20b3bb33be5965c691 (commit)
via c9cc7f0792b894c21c861695feca5e91a555fcc4 (commit)
via c16ef021964fcd741d8f7d1fcce4b23cdf6b311a (commit)
from 745e72a6cf7023cfd26c282207803e4c62897668 (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 4058b021d45946c8ff92c0ec6313cafa9e0c0507
Merge: 3549dfe22 2f97b4bf8
Author: Michael Black <mdb...@ya...>
Date: Sun Jun 2 14:55:00 2024 -0500
Merge pull request #1561 from GeoBaltz/rp9
Still more conversion of state references to use pointers
commit 2f97b4bf82d7e9f770ea21ca4d5a73cce4083c97
Author: George Baltz N3GB <Geo...@gm...>
Date: Sun Jun 2 13:26:01 2024 -0400
Still more state pointer conversions.
diff --git a/tests/README b/tests/README
index 665709d4b..5a80db30d 100644
--- a/tests/README
+++ b/tests/README
@@ -17,7 +17,7 @@ If you don't know the number, listrigs can give it to you,
In any case, you are encouraged to check for correct initialization
by reading the source code, at the beginning of the main(). Check also
-that the program is setup for your rig path strncpy(my_rig->state.rig_path...
+that the program is setup for your rig path strncpy(HAMLIB_STATE(my_rig)->rig_path...
dumpcaps - Output the caps contents of a rig
dumpmem - Dump the memory contents of the rig
diff --git a/tests/dumpmem.c b/tests/dumpmem.c
index 978e0f556..c021c5030 100644
--- a/tests/dumpmem.c
+++ b/tests/dumpmem.c
@@ -83,11 +83,12 @@ int main(int argc, const char *argv[])
* RIG_CHAN_END
* }
*/
+ struct rig_state *rs = STATE(my_rig);
- for (i = 0; my_rig->state.chan_list[i].type; i++)
+ for (i = 0; rs->chan_list[i].type; i++)
{
- for (j = my_rig->state.chan_list[i].startc;
- j <= my_rig->state.chan_list[i].endc; j++)
+ for (j = rs->chan_list[i].startc;
+ j <= rs->chan_list[i].endc; j++)
{
dump_chan(my_rig, j);
}
diff --git a/tests/memcsv.c b/tests/memcsv.c
index e4c24581a..aa9cdcff4 100644
--- a/tests/memcsv.c
+++ b/tests/memcsv.c
@@ -343,7 +343,7 @@ int csv_parm_save(RIG *rig, const char *outfilename)
{
int i, ret;
FILE *f;
- setting_t get_parm = all ? 0x7fffffff : rig->state.has_get_parm;
+ setting_t get_parm = all ? 0x7fffffff : STATE(rig)->has_get_parm;
f = fopen(outfilename, "w");
@@ -742,6 +742,7 @@ int set_channel_data(RIG *rig,
int i, j, n;
const channel_cap_t *mem_caps;
+ struct rig_state *rs = STATE(rig);
memset(chan, 0, sizeof(channel_t));
chan->vfo = RIG_VFO_CURR;
@@ -759,7 +760,7 @@ int set_channel_data(RIG *rig,
/* find channel caps of appropriate memory group? */
for (j = 0; j < HAMLIB_CHANLSTSIZ; j++)
{
- if (rig->state.chan_list[j].startc <= n && rig->state.chan_list[j].endc >= n)
+ if (rs->chan_list[j].startc <= n && rs->chan_list[j].endc >= n)
{
break;
}
@@ -772,7 +773,7 @@ int set_channel_data(RIG *rig,
printf("Requested channel number %d, list number %d\n", n, j);
- mem_caps = &rig->state.chan_list[j].mem_caps;
+ mem_caps = &rs->chan_list[j].mem_caps;
if (mem_caps->bank_num)
{
diff --git a/tests/rigctl.c b/tests/rigctl.c
index ae1e27182..12ddff9ee 100644
--- a/tests/rigctl.c
+++ b/tests/rigctl.c
@@ -564,6 +564,7 @@ int main(int argc, char *argv[])
}
char *token = strtok(conf_parms, ",");
+ struct rig_state *rs = STATE(my_rig);
while (token)
{
@@ -630,7 +631,7 @@ int main(int argc, char *argv[])
if (serial_rate != 0)
{
RIGPORT(my_rig)->parm.serial.rate = serial_rate;
- my_rig->state.rigport_deprecated.parm.serial.rate = serial_rate;
+ rs->rigport_deprecated.parm.serial.rate = serial_rate;
}
if (civaddr)
@@ -697,14 +698,14 @@ int main(int argc, char *argv[])
if (!skip_init && my_rig->caps->get_powerstat)
{
rig_get_powerstat(my_rig, &rig_powerstat);
- my_rig->state.powerstat = rig_powerstat;
+ rs->powerstat = rig_powerstat;
}
if (my_rig->caps->rig_model == RIG_MODEL_NETRIGCTL)
{
/* We automatically detect if we need to be in vfo mode or not */
int rigctld_vfo_opt = netrigctl_get_vfo_mode(my_rig);
- vfo_opt = my_rig->state.vfo_opt = rigctld_vfo_opt;
+ vfo_opt = rs->vfo_opt = rigctld_vfo_opt;
rig_debug(RIG_DEBUG_TRACE, "%s vfo_opt=%d\n", __func__, vfo_opt);
}
diff --git a/tests/rigctld.c b/tests/rigctld.c
index 572a6be6f..8a7103ecf 100644
--- a/tests/rigctld.c
+++ b/tests/rigctld.c
@@ -663,6 +663,7 @@ int main(int argc, char *argv[])
}
char *token = strtok(conf_parms, ",");
+ struct rig_state *rs = STATE(my_rig);
while (token)
{
@@ -696,12 +697,12 @@ int main(int argc, char *argv[])
rig_set_conf(my_rig, TOK_PATHNAME, rig_file);
}
- my_rig->state.twiddle_timeout = twiddle_timeout;
- my_rig->state.twiddle_rit = twiddle_rit;
- my_rig->state.uplink = uplink;
+ rs->twiddle_timeout = twiddle_timeout;
+ rs->twiddle_rit = twiddle_rit;
+ rs->uplink = uplink;
rig_debug(RIG_DEBUG_TRACE, "%s: twiddle=%d, uplink=%d, twiddle_rit=%d\n",
__func__,
- my_rig->state.twiddle_timeout, my_rig->state.uplink, my_rig->state.twiddle_rit);
+ rs->twiddle_timeout, rs->uplink, rs->twiddle_rit);
/*
* ex: RIG_PTT_PARALLEL and /dev/parport0
@@ -709,22 +710,22 @@ int main(int argc, char *argv[])
if (ptt_type != RIG_PTT_NONE)
{
PTTPORT(my_rig)->type.ptt = ptt_type;
- my_rig->state.pttport_deprecated.type.ptt = ptt_type;
+ rs->pttport_deprecated.type.ptt = ptt_type;
// This causes segfault since backend rig_caps are const
- // rigctld will use the rig->state version of this for clients
+ // rigctld will use the STATE(rig) version of this for clients
//my_rig->caps->ptt_type = ptt_type;
}
if (dcd_type != RIG_DCD_NONE)
{
DCDPORT(my_rig)->type.dcd = dcd_type;
- my_rig->state.dcdport_deprecated.type.dcd = dcd_type;
+ rs->dcdport_deprecated.type.dcd = dcd_type;
}
if (ptt_file)
{
strncpy(PTTPORT(my_rig)->pathname, ptt_file, HAMLIB_FILPATHLEN - 1);
- strncpy(my_rig->state.pttport_deprecated.pathname, ptt_file,
+ strncpy(rs->pttport_deprecated.pathname, ptt_file,
HAMLIB_FILPATHLEN - 1);
// default to RTS when ptt_type is not specified
if (ptt_type == RIG_PTT_NONE)
@@ -737,7 +738,7 @@ int main(int argc, char *argv[])
if (dcd_file)
{
strncpy(DCDPORT(my_rig)->pathname, dcd_file, HAMLIB_FILPATHLEN - 1);
- strncpy(my_rig->state.dcdport_deprecated.pathname, dcd_file,
+ strncpy(rs->dcdport_deprecated.pathname, dcd_file,
HAMLIB_FILPATHLEN - 1);
}
@@ -745,7 +746,7 @@ int main(int argc, char *argv[])
if (serial_rate != 0)
{
RIGPORT(my_rig)->parm.serial.rate = serial_rate;
- my_rig->state.rigport_deprecated.parm.serial.rate = serial_rate;
+ rs->rigport_deprecated.parm.serial.rate = serial_rate;
}
if (civaddr)
@@ -1306,7 +1307,7 @@ void *handle_socket(void *arg)
mutex_rigctld(1);
rig_get_powerstat(my_rig, &rig_powerstat);
mutex_rigctld(0);
- my_rig->state.powerstat = rig_powerstat;
+ STATE(my_rig)->powerstat = rig_powerstat;
}
elapsed_ms(&powerstat_check_time, HAMLIB_ELAPSED_SET);
commit 3549dfe22c5d4a1f29bebde5db2b4429d4a18cd6
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sun Jun 2 08:47:27 2024 -0500
Revert "Move rot_dummy to rotators/dummy -- in preparation for PSKRotator dummy device"
This reverts commit 205e03bc57cee4d643bf2dff3411973a78e6daa2.
diff --git a/configure.ac b/configure.ac
index f513bbf68..cfcd2eb1f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -67,7 +67,7 @@ dnl Beware of duplication should a backend directory include both rig and
dnl rotor definitions, e.g. "dummy". Optional backends will not be listed
dnl here but will be added later, e.g. "winradio".
RIG_BACKEND_LIST="rigs/adat rigs/alinco rigs/aor rigs/barrett rigs/codan rigs/dorji rigs/drake rigs/dummy rigs/elad rigs/flexradio rigs/icom rigs/icmarine rigs/jrc rigs/kachina rigs/kenwood rigs/kit rigs/lowe rigs/pcr rigs/prm80 rigs/racal rigs/rft rigs/rs rigs/skanti rigs/tapr rigs/tentec rigs/tuner rigs/uniden rigs/winradio rigs/wj rigs/yaesu rigs/gomspace rigs/mds rigs/anytone rigs/motorola"
-ROT_BACKEND_LIST="rotators/amsat rotators/apex rotators/ars rotators/celestron rotators/cnctrk rotators/dummy rotators/grbltrk rotators/easycomm rotators/ether6 rotators/flir rotators/fodtrack rotators/gs232a rotators/heathkit rotators/m2 rotators/meade rotators/rotorez rotators/sartek rotators/saebrtrack rotators/spid rotators/ts7400 rotators/prosistel rotators/ioptron rotators/satel rotators/radant"
+ROT_BACKEND_LIST="rotators/amsat rotators/apex rotators/ars rotators/celestron rotators/cnctrk rotators/grbltrk rotators/easycomm rotators/ether6 rotators/flir rotators/fodtrack rotators/gs232a rotators/heathkit rotators/m2 rotators/meade rotators/rotorez rotators/sartek rotators/saebrtrack rotators/spid rotators/ts7400 rotators/prosistel rotators/ioptron rotators/satel rotators/radant"
# Amplifiers are all in the amplifiers directory
AMP_BACKEND_LIST="amplifiers/elecraft amplifiers/gemini amplifiers/expert"
@@ -880,7 +880,6 @@ rotators/apex/Makefile
rotators/ars/Makefile
rotators/celestron/Makefile
rotators/cnctrk/Makefile
-rotators/dummy/Makefile
rotators/grbltrk/Makefile
rotators/easycomm/Makefile
rotators/ether6/Makefile
diff --git a/rigs/dummy/Makefile.am b/rigs/dummy/Makefile.am
index 7d092e7a0..4792a8fc3 100644
--- a/rigs/dummy/Makefile.am
+++ b/rigs/dummy/Makefile.am
@@ -1,4 +1,4 @@
-DUMMYSRC = dummy_common.c dummy_common.h dummy.c dummy.h dummy.c netrigctl.c netrotctl.c flrig.c flrig.h trxmanager.c trxmanager.h amp_dummy.c amp_dummy.h netampctl.c tci1x.c aclog.c sdrsharp.c quisk.c
+DUMMYSRC = dummy_common.c dummy_common.h dummy.c dummy.h rot_dummy.c rot_dummy.h netrigctl.c netrotctl.c flrig.c flrig.h trxmanager.c trxmanager.h amp_dummy.c amp_dummy.h netampctl.c tci1x.c aclog.c sdrsharp.c quisk.c
noinst_LTLIBRARIES = libhamlib-dummy.la
libhamlib_dummy_la_SOURCES = $(DUMMYSRC)
diff --git a/rotators/dummy/rot_dummy.c b/rigs/dummy/rot_dummy.c
similarity index 99%
rename from rotators/dummy/rot_dummy.c
rename to rigs/dummy/rot_dummy.c
index a41441714..dec0f8cfc 100644
--- a/rotators/dummy/rot_dummy.c
+++ b/rigs/dummy/rot_dummy.c
@@ -25,7 +25,7 @@
#include <sys/time.h>
#include "hamlib/rotator.h"
-#include "../../rigs/dummy/dummy_common.h"
+#include "dummy_common.h"
#include "rig.h"
#include "register.h"
#include "idx_builtin.h"
diff --git a/rotators/dummy/rot_dummy.h b/rigs/dummy/rot_dummy.h
similarity index 100%
rename from rotators/dummy/rot_dummy.h
rename to rigs/dummy/rot_dummy.h
diff --git a/rotators/dummy/Android.mk b/rotators/dummy/Android.mk
deleted file mode 100644
index 43e2f7ad4..000000000
--- a/rotators/dummy/Android.mk
+++ /dev/null
@@ -1,12 +0,0 @@
-LOCAL_PATH:= $(call my-dir)
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := rot_dummy.c
-LOCAL_MODULE := rot_dummy
-
-LOCAL_CFLAGS :=
-LOCAL_C_INCLUDES := android include src
-LOCAL_LDLIBS := -lhamlib -Lobj/local/$(TARGET_ARCH_ABI)
-
-include $(BUILD_STATIC_LIBRARY)
diff --git a/rotators/dummy/Makefile.am b/rotators/dummy/Makefile.am
deleted file mode 100644
index 7bcf0a988..000000000
--- a/rotators/dummy/Makefile.am
+++ /dev/null
@@ -1,5 +0,0 @@
-
-noinst_LTLIBRARIES = libhamlib-rot_dummy.la
-libhamlib_rot_dummy_la_SOURCES = rot_dummy.c rot_dummy.h
-
-EXTRA_DIST = Android.mk
commit 205e03bc57cee4d643bf2dff3411973a78e6daa2
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sun Jun 2 08:29:54 2024 -0500
Move rot_dummy to rotators/dummy -- in preparation for PSKRotator dummy device
diff --git a/configure.ac b/configure.ac
index cfcd2eb1f..f513bbf68 100644
--- a/configure.ac
+++ b/configure.ac
@@ -67,7 +67,7 @@ dnl Beware of duplication should a backend directory include both rig and
dnl rotor definitions, e.g. "dummy". Optional backends will not be listed
dnl here but will be added later, e.g. "winradio".
RIG_BACKEND_LIST="rigs/adat rigs/alinco rigs/aor rigs/barrett rigs/codan rigs/dorji rigs/drake rigs/dummy rigs/elad rigs/flexradio rigs/icom rigs/icmarine rigs/jrc rigs/kachina rigs/kenwood rigs/kit rigs/lowe rigs/pcr rigs/prm80 rigs/racal rigs/rft rigs/rs rigs/skanti rigs/tapr rigs/tentec rigs/tuner rigs/uniden rigs/winradio rigs/wj rigs/yaesu rigs/gomspace rigs/mds rigs/anytone rigs/motorola"
-ROT_BACKEND_LIST="rotators/amsat rotators/apex rotators/ars rotators/celestron rotators/cnctrk rotators/grbltrk rotators/easycomm rotators/ether6 rotators/flir rotators/fodtrack rotators/gs232a rotators/heathkit rotators/m2 rotators/meade rotators/rotorez rotators/sartek rotators/saebrtrack rotators/spid rotators/ts7400 rotators/prosistel rotators/ioptron rotators/satel rotators/radant"
+ROT_BACKEND_LIST="rotators/amsat rotators/apex rotators/ars rotators/celestron rotators/cnctrk rotators/dummy rotators/grbltrk rotators/easycomm rotators/ether6 rotators/flir rotators/fodtrack rotators/gs232a rotators/heathkit rotators/m2 rotators/meade rotators/rotorez rotators/sartek rotators/saebrtrack rotators/spid rotators/ts7400 rotators/prosistel rotators/ioptron rotators/satel rotators/radant"
# Amplifiers are all in the amplifiers directory
AMP_BACKEND_LIST="amplifiers/elecraft amplifiers/gemini amplifiers/expert"
@@ -880,6 +880,7 @@ rotators/apex/Makefile
rotators/ars/Makefile
rotators/celestron/Makefile
rotators/cnctrk/Makefile
+rotators/dummy/Makefile
rotators/grbltrk/Makefile
rotators/easycomm/Makefile
rotators/ether6/Makefile
diff --git a/rigs/dummy/Makefile.am b/rigs/dummy/Makefile.am
index 4792a8fc3..7d092e7a0 100644
--- a/rigs/dummy/Makefile.am
+++ b/rigs/dummy/Makefile.am
@@ -1,4 +1,4 @@
-DUMMYSRC = dummy_common.c dummy_common.h dummy.c dummy.h rot_dummy.c rot_dummy.h netrigctl.c netrotctl.c flrig.c flrig.h trxmanager.c trxmanager.h amp_dummy.c amp_dummy.h netampctl.c tci1x.c aclog.c sdrsharp.c quisk.c
+DUMMYSRC = dummy_common.c dummy_common.h dummy.c dummy.h dummy.c netrigctl.c netrotctl.c flrig.c flrig.h trxmanager.c trxmanager.h amp_dummy.c amp_dummy.h netampctl.c tci1x.c aclog.c sdrsharp.c quisk.c
noinst_LTLIBRARIES = libhamlib-dummy.la
libhamlib_dummy_la_SOURCES = $(DUMMYSRC)
diff --git a/rotators/dummy/Android.mk b/rotators/dummy/Android.mk
new file mode 100644
index 000000000..43e2f7ad4
--- /dev/null
+++ b/rotators/dummy/Android.mk
@@ -0,0 +1,12 @@
+LOCAL_PATH:= $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := rot_dummy.c
+LOCAL_MODULE := rot_dummy
+
+LOCAL_CFLAGS :=
+LOCAL_C_INCLUDES := android include src
+LOCAL_LDLIBS := -lhamlib -Lobj/local/$(TARGET_ARCH_ABI)
+
+include $(BUILD_STATIC_LIBRARY)
diff --git a/rotators/dummy/Makefile.am b/rotators/dummy/Makefile.am
new file mode 100644
index 000000000..7bcf0a988
--- /dev/null
+++ b/rotators/dummy/Makefile.am
@@ -0,0 +1,5 @@
+
+noinst_LTLIBRARIES = libhamlib-rot_dummy.la
+libhamlib_rot_dummy_la_SOURCES = rot_dummy.c rot_dummy.h
+
+EXTRA_DIST = Android.mk
diff --git a/rigs/dummy/rot_dummy.c b/rotators/dummy/rot_dummy.c
similarity index 99%
rename from rigs/dummy/rot_dummy.c
rename to rotators/dummy/rot_dummy.c
index dec0f8cfc..a41441714 100644
--- a/rigs/dummy/rot_dummy.c
+++ b/rotators/dummy/rot_dummy.c
@@ -25,7 +25,7 @@
#include <sys/time.h>
#include "hamlib/rotator.h"
-#include "dummy_common.h"
+#include "../../rigs/dummy/dummy_common.h"
#include "rig.h"
#include "register.h"
#include "idx_builtin.h"
diff --git a/rigs/dummy/rot_dummy.h b/rotators/dummy/rot_dummy.h
similarity index 100%
rename from rigs/dummy/rot_dummy.h
rename to rotators/dummy/rot_dummy.h
commit 3ce55b2a9474b3601e3417f9ddfb8cc33796f328
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sun Jun 2 08:15:16 2024 -0500
Fix mingw compilation
diff --git a/src/network.c b/src/network.c
index 41461c20c..1d780f615 100644
--- a/src/network.c
+++ b/src/network.c
@@ -384,7 +384,12 @@ int network_open(hamlib_port_t *rp, int default_port)
// return # of bytes read
int network_flush2(hamlib_port_t *rp, unsigned char *stopset, char *buf, int buf_len)
{
- unsigned int len = 0;
+#ifdef __MINGW32__
+ ULONG len;
+#else
+ uint len;
+#endif
+
#ifdef __MINGW32__
int ret = ioctlsocket(rp->fd, FIONREAD, &len);
#else
commit 2794d2dfe143e88452d58f5a3924c1bce52390de
Author: George Baltz N3GB <Geo...@gm...>
Date: Fri May 31 09:48:30 2024 -0400
More state pointer changes
Done with search/replace
Less than 2300 left to do
diff --git a/tests/dumpstate.c b/tests/dumpstate.c
index d2fb9a794..fdae1a376 100644
--- a/tests/dumpstate.c
+++ b/tests/dumpstate.c
@@ -70,6 +70,7 @@ static int print_ext(RIG *rig, const struct confparams *cfp, rig_ptr_t ptr)
int dumpstate(RIG *rig, FILE *fout)
{
const struct rig_caps *caps;
+ struct rig_state *rs = STATE(rig);
int status, i;
int can_esplit, can_echannel;
char freqbuf[20];
@@ -89,20 +90,20 @@ int dumpstate(RIG *rig, FILE *fout)
caps = rig->caps;
- fprintf(fout, "Caps dump for model: %u\n", rig->state.rig_model);
- fprintf(fout, "Model name:\t%s\n", rig->state.model_name);
- fprintf(fout, "Mfg name:\t%s\n", rig->state.mfg_name);
+ fprintf(fout, "Caps dump for model: %u\n", rs->rig_model);
+ fprintf(fout, "Model name:\t%s\n", rs->model_name);
+ fprintf(fout, "Mfg name:\t%s\n", rs->mfg_name);
fprintf(fout, "Hamlib version:\t%s\n", hamlib_version2);
- fprintf(fout, "Backend version:\t%s\n", rig->state.version);
- fprintf(fout, "Backend copyright:\t%s\n", rig->state.copyright);
- fprintf(fout, "Backend status:\t%s\n", rig_strstatus(rig->state.status));
+ fprintf(fout, "Backend version:\t%s\n", rs->version);
+ fprintf(fout, "Backend copyright:\t%s\n", rs->copyright);
+ fprintf(fout, "Backend status:\t%s\n", rig_strstatus(rs->status));
fprintf(fout, "Rig type:\t");
char *unknown = "Unknown";
for (i = 0; rig_type[i].type != -1; ++i)
{
- if ((rig_type[i].type & rig->state.rig_type) == rig_type[i].type)
+ if ((rig_type[i].type & rs->rig_type) == rig_type[i].type)
{
fprintf(fout, "%s ", rig_type[i].description);
unknown = "";
@@ -119,7 +120,7 @@ int dumpstate(RIG *rig, FILE *fout)
fprintf(fout, "PTT type:\t");
- switch (rig->state.ptt_type)
+ switch (rs->ptt_type)
{
case RIG_PTT_RIG:
fprintf(fout, "Rig capable\n");
@@ -153,7 +154,7 @@ int dumpstate(RIG *rig, FILE *fout)
fprintf(fout, "DCD type:\t");
- switch (rig->state.dcd_type)
+ switch (rs->dcd_type)
{
case RIG_DCD_RIG:
fprintf(fout, "Rig capable\n");
@@ -187,22 +188,22 @@ int dumpstate(RIG *rig, FILE *fout)
fprintf(fout, "Port type:\t");
- switch (rig->state.port_type)
+ switch (rs->port_type)
{
case RIG_PORT_SERIAL:
fprintf(fout, "RS-232\n");
fprintf(fout,
"Serial speed: %d..%d baud, %d%c%d, ctrl=%s\n",
- rig->state.serial_rate_min,
- rig->state.serial_rate_max,
- rig->state.serial_data_bits,
- rig->state.serial_parity == RIG_PARITY_NONE ? 'N' :
- rig->state.serial_parity == RIG_PARITY_ODD ? 'O' :
- rig->state.serial_parity == RIG_PARITY_EVEN ? 'E' :
- rig->state.serial_parity == RIG_PARITY_MARK ? 'M' : 'S',
- rig->state.serial_stop_bits,
- rig->state.serial_handshake == RIG_HANDSHAKE_NONE ? "NONE" :
- (rig->state.serial_handshake == RIG_HANDSHAKE_XONXOFF ? "XONXOFF" : "CTS/RTS")
+ rs->serial_rate_min,
+ rs->serial_rate_max,
+ rs->serial_data_bits,
+ rs->serial_parity == RIG_PARITY_NONE ? 'N' :
+ rs->serial_parity == RIG_PARITY_ODD ? 'O' :
+ rs->serial_parity == RIG_PARITY_EVEN ? 'E' :
+ rs->serial_parity == RIG_PARITY_MARK ? 'M' : 'S',
+ rs->serial_stop_bits,
+ rs->serial_handshake == RIG_HANDSHAKE_NONE ? "NONE" :
+ (rs->serial_handshake == RIG_HANDSHAKE_XONXOFF ? "XONXOFF" : "CTS/RTS")
);
break;
@@ -238,40 +239,40 @@ int dumpstate(RIG *rig, FILE *fout)
fprintf(fout,
"Write delay: %dms, timeout %dms, %d retry\n",
- rig->state.write_delay, rig->state.timeout, rig->state.retry);
+ rs->write_delay, rs->timeout, rs->retry);
fprintf(fout,
"Post write delay: %dms\n",
- rig->state.post_write_delay);
+ rs->post_write_delay);
fprintf(fout,
"Has targetable VFO: %s\n",
- rig->state.targetable_vfo ? "Y" : "N");
+ rs->targetable_vfo ? "Y" : "N");
fprintf(fout,
"Has async data support: %s\n",
- rig->state.async_data_supported ? "Y" : "N");
+ rs->async_data_supported ? "Y" : "N");
- fprintf(fout, "Announce: 0x%x\n", rig->state.announces);
+ fprintf(fout, "Announce: 0x%x\n", rs->announces);
fprintf(fout,
"Max RIT: -%ld.%ldkHz/+%ld.%ldkHz\n",
- rig->state.max_rit / 1000, rig->state.max_rit % 1000,
- rig->state.max_rit / 1000, rig->state.max_rit % 1000);
+ rs->max_rit / 1000, rs->max_rit % 1000,
+ rs->max_rit / 1000, rs->max_rit % 1000);
fprintf(fout,
"Max XIT: -%ld.%ldkHz/+%ld.%ldkHz\n",
- rig->state.max_xit / 1000, rig->state.max_xit % 1000,
- rig->state.max_xit / 1000, rig->state.max_xit % 1000);
+ rs->max_xit / 1000, rs->max_xit % 1000,
+ rs->max_xit / 1000, rs->max_xit % 1000);
fprintf(fout,
"Max IF-SHIFT: -%ld.%ldkHz/+%ld.%ldkHz\n",
- rig->state.max_ifshift / 1000, rig->state.max_ifshift % 1000,
- rig->state.max_ifshift / 1000, rig->state.max_ifshift % 1000);
+ rs->max_ifshift / 1000, rs->max_ifshift % 1000,
+ rs->max_ifshift / 1000, rs->max_ifshift % 1000);
fprintf(fout, "Preamp:");
- for (i = 0; i < HAMLIB_MAXDBLSTSIZ && rig->state.preamp[i] != 0; i++)
+ for (i = 0; i < HAMLIB_MAXDBLSTSIZ && rs->preamp[i] != 0; i++)
{
- fprintf(fout, " %ddB", rig->state.preamp[i]);
+ fprintf(fout, " %ddB", rs->preamp[i]);
}
if (i == 0)
@@ -282,9 +283,9 @@ int dumpstate(RIG *rig, FILE *fout)
fprintf(fout, "\n");
fprintf(fout, "Attenuator:");
- for (i = 0; i < HAMLIB_MAXDBLSTSIZ && rig->state.attenuator[i] != 0; i++)
+ for (i = 0; i < HAMLIB_MAXDBLSTSIZ && rs->attenuator[i] != 0; i++)
{
- fprintf(fout, " %ddB", rig->state.attenuator[i]);
+ fprintf(fout, " %ddB", rs->attenuator[i]);
}
if (i == 0)
@@ -297,9 +298,9 @@ int dumpstate(RIG *rig, FILE *fout)
fprintf(fout, "AGC levels:");
const struct icom_priv_caps *priv_caps =
- (const struct icom_priv_caps *) rig->state.priv;
+ (const struct icom_priv_caps *) rs->priv;
- if (priv_caps && RIG_BACKEND_NUM(rig->state.rig_model) == RIG_ICOM
+ if (priv_caps && RIG_BACKEND_NUM(rs->rig_model) == RIG_ICOM
&& priv_caps->agc_levels_present)
{
for (i = 0; i < HAMLIB_MAX_AGC_LEVELS
@@ -311,10 +312,10 @@ int dumpstate(RIG *rig, FILE *fout)
}
else
{
- for (i = 0; i < HAMLIB_MAX_AGC_LEVELS && i < rig->state.agc_level_count; i++)
+ for (i = 0; i < HAMLIB_MAX_AGC_LEVELS && i < rs->agc_level_count; i++)
{
- fprintf(fout, " %d=%s", rig->state.agc_levels[i],
- rig_stragclevel(rig->state.agc_levels[i]));
+ fprintf(fout, " %d=%s", rs->agc_levels[i],
+ rig_stragclevel(rs->agc_levels[i]));
}
}
@@ -327,12 +328,12 @@ int dumpstate(RIG *rig, FILE *fout)
fprintf(fout, "CTCSS:");
- for (i = 0; rig->state.ctcss_list && i < 60
- && rig->state.ctcss_list[i] != 0; i++)
+ for (i = 0; rs->ctcss_list && i < 60
+ && rs->ctcss_list[i] != 0; i++)
{
fprintf(fout,
" %u.%1u",
- rig->state.ctcss_list[i] / 10, rig->state.ctcss_list[i] % 10);
+ rs->ctcss_list[i] / 10, rs->ctcss_list[i] % 10);
}
if (i == 0)
@@ -348,9 +349,9 @@ int dumpstate(RIG *rig, FILE *fout)
fprintf(fout, "DCS:");
- for (i = 0; rig->state.dcs_list && i < 128 && rig->state.dcs_list[i] != 0; i++)
+ for (i = 0; rs->dcs_list && i < 128 && rs->dcs_list[i] != 0; i++)
{
- fprintf(fout, " %u", rig->state.dcs_list[i]);
+ fprintf(fout, " %u", rs->dcs_list[i]);
}
if (i == 0)
@@ -364,22 +365,22 @@ int dumpstate(RIG *rig, FILE *fout)
fprintf(fout, "\n");
- rig_sprintf_func(prntbuf, sizeof(prntbuf), rig->state.has_get_func);
+ rig_sprintf_func(prntbuf, sizeof(prntbuf), rs->has_get_func);
fprintf(fout, "Get functions: %s\n", prntbuf);
- rig_sprintf_func(prntbuf, sizeof(prntbuf), rig->state.has_set_func);
+ rig_sprintf_func(prntbuf, sizeof(prntbuf), rs->has_set_func);
fprintf(fout, "Set functions: %s\n", prntbuf);
fprintf(fout, "Extra functions:\n");
rig_ext_func_foreach(rig, print_ext, fout);
- rig_sprintf_level_gran(prntbuf, sizeof(prntbuf), rig->state.has_get_level,
- rig->state.level_gran);
+ rig_sprintf_level_gran(prntbuf, sizeof(prntbuf), rs->has_get_level,
+ rs->level_gran);
fprintf(fout, "Get level: %s\n", prntbuf);
- if ((rig->state.has_get_level & RIG_LEVEL_RAWSTR)
- && rig->state.str_cal.size == 0
- && !(rig->state.has_get_level & RIG_LEVEL_STRENGTH))
+ if ((rs->has_get_level & RIG_LEVEL_RAWSTR)
+ && rs->str_cal.size == 0
+ && !(rs->has_get_level & RIG_LEVEL_STRENGTH))
{
fprintf(fout,
@@ -388,14 +389,14 @@ int dumpstate(RIG *rig, FILE *fout)
backend_warnings++;
}
- rig_sprintf_level_gran(prntbuf, sizeof(prntbuf), rig->state.has_set_level,
- rig->state.level_gran);
+ rig_sprintf_level_gran(prntbuf, sizeof(prntbuf), rs->has_set_level,
+ rs->level_gran);
fprintf(fout, "Set level: %s\n", prntbuf);
- if (rig->state.has_set_level & RIG_LEVEL_READONLY_LIST)
+ if (rs->has_set_level & RIG_LEVEL_READONLY_LIST)
{
- //fprintf(fout, "Warning--backend can set readonly levels=0x%0llx\n", rig->state.has_set_level & RIG_LEVEL_READONLY_LIST);
+ //fprintf(fout, "Warning--backend can set readonly levels=0x%0llx\n", rs->has_set_level & RIG_LEVEL_READONLY_LIST);
fprintf(fout, "Warning--backend can set readonly levels\n");
strcat(warnbuf, " READONLY_LEVEL");
backend_warnings++;
@@ -404,15 +405,15 @@ int dumpstate(RIG *rig, FILE *fout)
fprintf(fout, "Extra levels:\n");
rig_ext_level_foreach(rig, print_ext, fout);
- rig_sprintf_parm_gran(prntbuf, sizeof(prntbuf), rig->state.has_get_parm,
- rig->state.parm_gran);
+ rig_sprintf_parm_gran(prntbuf, sizeof(prntbuf), rs->has_get_parm,
+ rs->parm_gran);
fprintf(fout, "Get parameters: %s\n", prntbuf);
- rig_sprintf_parm_gran(prntbuf, sizeof(prntbuf), rig->state.has_set_parm,
- rig->state.parm_gran);
+ rig_sprintf_parm_gran(prntbuf, sizeof(prntbuf), rs->has_set_parm,
+ rs->parm_gran);
fprintf(fout, "Set parameters: %s\n", prntbuf);
- if (rig->state.has_set_parm & RIG_PARM_READONLY_LIST)
+ if (rs->has_set_parm & RIG_PARM_READONLY_LIST)
{
fprintf(fout, "Warning--backend can set readonly parms!\n");
strcat(warnbuf, " READONLY_PARM");
@@ -423,9 +424,9 @@ int dumpstate(RIG *rig, FILE *fout)
rig_ext_parm_foreach(rig, print_ext, fout);
- if (rig->state.mode_list != 0)
+ if (rs->mode_list != 0)
{
- rig_sprintf_mode(prntbuf, sizeof(prntbuf), rig->state.mode_list);
+ rig_sprintf_mode(prntbuf, sizeof(prntbuf), rs->mode_list);
}
else
{
@@ -436,9 +437,9 @@ int dumpstate(RIG *rig, FILE *fout)
fprintf(fout, "Mode list: %s\n", prntbuf);
- if (rig->state.vfo_list != 0)
+ if (rs->vfo_list != 0)
{
- rig_sprintf_vfo(prntbuf, sizeof(prntbuf), rig->state.vfo_list);
+ rig_sprintf_vfo(prntbuf, sizeof(prntbuf), rs->vfo_list);
}
else
{
@@ -449,26 +450,26 @@ int dumpstate(RIG *rig, FILE *fout)
fprintf(fout, "VFO list: %s\n", prntbuf);
- rig_sprintf_vfop(prntbuf, sizeof(prntbuf), rig->state.vfo_ops);
+ rig_sprintf_vfop(prntbuf, sizeof(prntbuf), rs->vfo_ops);
fprintf(fout, "VFO Ops: %s\n", prntbuf);
- rig_sprintf_scan(prntbuf, sizeof(prntbuf), rig->state.scan_ops);
+ rig_sprintf_scan(prntbuf, sizeof(prntbuf), rs->scan_ops);
fprintf(fout, "Scan Ops: %s\n", prntbuf);
- fprintf(fout, "Number of banks:\t%d\n", rig->state.bank_qty);
- fprintf(fout, "Memory name desc size:\t%d\n", rig->state.chan_desc_sz);
+ fprintf(fout, "Number of banks:\t%d\n", rs->bank_qty);
+ fprintf(fout, "Memory name desc size:\t%d\n", rs->chan_desc_sz);
fprintf(fout, "Memories:");
- for (i = 0; i < HAMLIB_CHANLSTSIZ && rig->state.chan_list[i].type; i++)
+ for (i = 0; i < HAMLIB_CHANLSTSIZ && rs->chan_list[i].type; i++)
{
fprintf(fout,
"\n\t%d..%d: \t%s",
- rig->state.chan_list[i].startc,
- rig->state.chan_list[i].endc,
- rig_strmtype(rig->state.chan_list[i].type));
+ rs->chan_list[i].startc,
+ rs->chan_list[i].endc,
+ rig_strmtype(rs->chan_list[i].type));
fprintf(fout, "\n\t Mem caps: ");
- dump_chan_caps(&rig->state.chan_list[i].mem_caps, fout);
+ dump_chan_caps(&rs->chan_list[i].mem_caps, fout);
}
if (i == 0)
@@ -478,57 +479,57 @@ int dumpstate(RIG *rig, FILE *fout)
fprintf(fout, "\n");
- label1 = rig->state.tx_range_list1->label;
+ label1 = rs->tx_range_list1->label;
label1 = label1 == NULL ? "TBD" : label1;
fprintf(fout, "TX ranges #1 for %s:\n", label1);
- range_print(fout, rig->state.tx_range_list1, 0);
+ range_print(fout, rs->tx_range_list1, 0);
- labelrx1 = rig->state.rx_range_list1->label;
+ labelrx1 = rs->rx_range_list1->label;
labelrx1 = labelrx1 == NULL ? "TBD" : labelrx1;
fprintf(fout, "RX ranges #1 for %s:\n", labelrx1);
- range_print(fout, rig->state.rx_range_list1, 1);
+ range_print(fout, rs->rx_range_list1, 1);
- label2 = rig->state.rx_range_list2->label;
+ label2 = rs->rx_range_list2->label;
label2 = label2 == NULL ? "TBD" : label2;
fprintf(fout, "TX ranges #2 for %s:\n", label2);
- range_print(fout, rig->state.tx_range_list2, 0);
+ range_print(fout, rs->tx_range_list2, 0);
- label2 = rig->state.rx_range_list2->label;
+ label2 = rs->rx_range_list2->label;
label2 = label2 == NULL ? "TBD" : label2;
fprintf(fout, "RX ranges #2 for %s:\n", label2);
- range_print(fout, rig->state.rx_range_list2, 1);
+ range_print(fout, rs->rx_range_list2, 1);
- label3 = rig->state.rx_range_list3->label;
+ label3 = rs->rx_range_list3->label;
label3 = label3 == NULL ? "TBD" : label3;
fprintf(fout, "TX ranges #3 for %s:\n", label3);
- range_print(fout, rig->state.tx_range_list3, 0);
+ range_print(fout, rs->tx_range_list3, 0);
- label3 = rig->state.rx_range_list3->label;
+ label3 = rs->rx_range_list3->label;
label3 = label3 == NULL ? "TBD" : label3;
fprintf(fout, "RX ranges #3 for %s:\n", label3);
- range_print(fout, rig->state.rx_range_list3, 1);
+ range_print(fout, rs->rx_range_list3, 1);
- label4 = rig->state.rx_range_list4->label;
+ label4 = rs->rx_range_list4->label;
label4 = label4 == NULL ? "TBD" : label4;
fprintf(fout, "TX ranges #4 for %s:\n", label4);
- range_print(fout, rig->state.tx_range_list5, 0);
+ range_print(fout, rs->tx_range_list5, 0);
- label4 = rig->state.rx_range_list4->label;
+ label4 = rs->rx_range_list4->label;
label4 = label4 == NULL ? "TBD" : label4;
fprintf(fout, "RX ranges #4 for %s:\n", label4);
- range_print(fout, rig->state.rx_range_list5, 1);
+ range_print(fout, rs->rx_range_list5, 1);
- label5 = rig->state.rx_range_list5->label;
+ label5 = rs->rx_range_list5->label;
label5 = label5 == NULL ? "TBD" : label5;
fprintf(fout, "TX ranges #5 for %s:\n", label5);
- range_print(fout, rig->state.tx_range_list5, 0);
+ range_print(fout, rs->tx_range_list5, 0);
- label5 = rig->state.rx_range_list5->label;
+ label5 = rs->rx_range_list5->label;
label5 = label5 == NULL ? "TBD" : label5;
fprintf(fout, "RX ranges #5 for %s:\n", label5);
- range_print(fout, rig->state.rx_range_list5, 1);
+ range_print(fout, rs->rx_range_list5, 1);
- status = range_sanity_check(rig->state.tx_range_list1, 0);
+ status = range_sanity_check(rs->tx_range_list1, 0);
fprintf(fout,
"TX ranges #1 status for %s:\t%s (%d)\n", label1,
status ? "Bad" : "OK",
@@ -540,7 +541,7 @@ int dumpstate(RIG *rig, FILE *fout)
backend_warnings++;
}
- status = range_sanity_check(rig->state.rx_range_list1, 1);
+ status = range_sanity_check(rs->rx_range_list1, 1);
fprintf(fout,
"RX ranges #1 status for %s:\t%s (%d)\n", labelrx1,
status ? "Bad" : "OK",
@@ -552,7 +553,7 @@ int dumpstate(RIG *rig, FILE *fout)
backend_warnings++;
}
- status = range_sanity_check(rig->state.tx_range_list2, 0);
+ status = range_sanity_check(rs->tx_range_list2, 0);
fprintf(fout,
"TX ranges #2 status for %s:\t%s (%d)\n", label2,
status ? "Bad" : "OK",
@@ -564,7 +565,7 @@ int dumpstate(RIG *rig, FILE *fout)
backend_warnings++;
}
- status = range_sanity_check(rig->state.rx_range_list2, 1);
+ status = range_sanity_check(rs->rx_range_list2, 1);
fprintf(fout,
"RX ranges #2 status for %s:\t%s (%d)\n", label2,
status ? "Bad" : "OK",
@@ -576,7 +577,7 @@ int dumpstate(RIG *rig, FILE *fout)
backend_warnings++;
}
- status = range_sanity_check(rig->state.tx_range_list3, 0);
+ status = range_sanity_check(rs->tx_range_list3, 0);
fprintf(fout,
"TX ranges #3 status for %s:\t%s (%d)\n", label3,
status ? "Bad" : "OK",
@@ -588,7 +589,7 @@ int dumpstate(RIG *rig, FILE *fout)
backend_warnings++;
}
- status = range_sanity_check(rig->state.rx_range_list3, 1);
+ status = range_sanity_check(rs->rx_range_list3, 1);
fprintf(fout,
"RX ranges #3 status for %s:\t%s (%d)\n", label3,
status ? "Bad" : "OK",
@@ -600,7 +601,7 @@ int dumpstate(RIG *rig, FILE *fout)
backend_warnings++;
}
- status = range_sanity_check(rig->state.tx_range_list4, 0);
+ status = range_sanity_check(rs->tx_range_list4, 0);
fprintf(fout,
"TX ranges #4 status for %s:\t%s (%d)\n", label4,
status ? "Bad" : "OK",
@@ -612,7 +613,7 @@ int dumpstate(RIG *rig, FILE *fout)
backend_warnings++;
}
- status = range_sanity_check(rig->state.rx_range_list4, 1);
+ status = range_sanity_check(rs->rx_range_list4, 1);
fprintf(fout,
"RX ranges #4 status for %s:\t%s (%d)\n", label4,
status ? "Bad" : "OK",
@@ -624,7 +625,7 @@ int dumpstate(RIG *rig, FILE *fout)
backend_warnings++;
}
- status = range_sanity_check(rig->state.tx_range_list5, 0);
+ status = range_sanity_check(rs->tx_range_list5, 0);
fprintf(fout,
"TX ranges #5 status for %s:\t%s (%d)\n", label5,
status ? "Bad" : "OK",
@@ -636,7 +637,7 @@ int dumpstate(RIG *rig, FILE *fout)
backend_warnings++;
}
- status = range_sanity_check(rig->state.rx_range_list5, 1);
+ status = range_sanity_check(rs->rx_range_list5, 1);
fprintf(fout,
"RX ranges #5 status for %s:\t%s (%d)\n", label5,
status ? "Bad" : "OK",
@@ -651,18 +652,18 @@ int dumpstate(RIG *rig, FILE *fout)
fprintf(fout, "Tuning steps:");
for (i = 0; i < HAMLIB_TSLSTSIZ
- && !RIG_IS_TS_END(rig->state.tuning_steps[i]); i++)
+ && !RIG_IS_TS_END(rs->tuning_steps[i]); i++)
{
- if (rig->state.tuning_steps[i].ts == RIG_TS_ANY)
+ if (rs->tuning_steps[i].ts == RIG_TS_ANY)
{
strcpy(freqbuf, "ANY"); /* strcpy! Looks safe for now */
}
else
{
- sprintf_freq(freqbuf, sizeof(freqbuf), rig->state.tuning_steps[i].ts);
+ sprintf_freq(freqbuf, sizeof(freqbuf), rs->tuning_steps[i].ts);
}
- rig_sprintf_mode(prntbuf, sizeof(prntbuf), rig->state.tuning_steps[i].modes);
+ rig_sprintf_mode(prntbuf, sizeof(prntbuf), rs->tuning_steps[i].modes);
fprintf(fout, "\n\t%s: \t%s", freqbuf, prntbuf);
}
@@ -674,7 +675,7 @@ int dumpstate(RIG *rig, FILE *fout)
}
fprintf(fout, "\n");
- status = ts_sanity_check(rig->state.tuning_steps);
+ status = ts_sanity_check(rs->tuning_steps);
fprintf(fout, "Tuning steps status:\t%s (%d)\n", status ? "Bad" : "OK", status);
if (status)
@@ -685,18 +686,18 @@ int dumpstate(RIG *rig, FILE *fout)
fprintf(fout, "Filters:");
- for (i = 0; i < HAMLIB_FLTLSTSIZ && !RIG_IS_FLT_END(rig->state.filters[i]); i++)
+ for (i = 0; i < HAMLIB_FLTLSTSIZ && !RIG_IS_FLT_END(rs->filters[i]); i++)
{
- if (rig->state.filters[i].width == RIG_FLT_ANY)
+ if (rs->filters[i].width == RIG_FLT_ANY)
{
strcpy(freqbuf, "ANY");
}
else
{
- sprintf_freq(freqbuf, sizeof(freqbuf), rig->state.filters[i].width);
+ sprintf_freq(freqbuf, sizeof(freqbuf), rs->filters[i].width);
}
- rig_sprintf_mode(prntbuf, sizeof(prntbuf), rig->state.filters[i].modes);
+ rig_sprintf_mode(prntbuf, sizeof(prntbuf), rs->filters[i].modes);
fprintf(fout, "\n\t%s: \t%s", freqbuf, prntbuf);
}
@@ -735,10 +736,10 @@ int dumpstate(RIG *rig, FILE *fout)
fprintf(fout, "Spectrum scopes:");
for (i = 0; i < HAMLIB_MAX_SPECTRUM_SCOPES
- && rig->state.spectrum_scopes[i].name != NULL; i++)
+ && rs->spectrum_scopes[i].name != NULL; i++)
{
- fprintf(fout, " %d=\"%s\"", rig->state.spectrum_scopes[i].id,
- rig->state.spectrum_scopes[i].name);
+ fprintf(fout, " %d=\"%s\"", rs->spectrum_scopes[i].id,
+ rs->spectrum_scopes[i].name);
}
if (i == 0)
@@ -748,22 +749,22 @@ int dumpstate(RIG *rig, FILE *fout)
fprintf(fout, "\n");
- rig_sprintf_spectrum_modes(prntbuf, sizeof(prntbuf), rig->state.spectrum_modes);
+ rig_sprintf_spectrum_modes(prntbuf, sizeof(prntbuf), rs->spectrum_modes);
fprintf(fout, "Spectrum modes: %s\n", prntbuf);
- rig_sprintf_spectrum_spans(prntbuf, sizeof(prntbuf), rig->state.spectrum_spans);
+ rig_sprintf_spectrum_spans(prntbuf, sizeof(prntbuf), rs->spectrum_spans);
fprintf(fout, "Spectrum spans: %s\n", prntbuf);
rig_sprintf_spectrum_avg_modes(prntbuf, sizeof(prntbuf),
- rig->state.spectrum_avg_modes);
+ rs->spectrum_avg_modes);
fprintf(fout, "Spectrum averaging modes: %s\n", prntbuf);
fprintf(fout, "Spectrum attenuator:");
for (i = 0; i < HAMLIB_MAXDBLSTSIZ
- && rig->state.spectrum_attenuator[i] != 0; i++)
+ && rs->spectrum_attenuator[i] != 0; i++)
{
- fprintf(fout, " %ddB", rig->state.spectrum_attenuator[i]);
+ fprintf(fout, " %ddB", rs->spectrum_attenuator[i]);
}
if (i == 0)
@@ -773,7 +774,7 @@ int dumpstate(RIG *rig, FILE *fout)
fprintf(fout, "\n");
- fprintf(fout, "Has priv data:\t%c\n", rig->state.priv != NULL ? 'Y' : 'N');
+ fprintf(fout, "Has priv data:\t%c\n", rs->priv != NULL ? 'Y' : 'N');
/*
* Status is either 'Y'es, 'E'mulated, 'N'o
*
@@ -920,7 +921,7 @@ int dumpstate(RIG *rig, FILE *fout)
can_echannel = rig->caps->set_mem
&& ((rig->caps->set_vfo
- && ((rig->state.vfo_list & RIG_VFO_MEM) == RIG_VFO_MEM))
+ && ((rs->vfo_list & RIG_VFO_MEM) == RIG_VFO_MEM))
|| (rig->caps->vfo_op
&& rig_has_vfo_op(rig, RIG_OP_TO_VFO | RIG_OP_FROM_VFO)));
diff --git a/tests/memload.c b/tests/memload.c
index a37c6af28..e4e4eb689 100644
--- a/tests/memload.c
+++ b/tests/memload.c
@@ -120,6 +120,7 @@ int set_chan(RIG *rig, channel_t *chan, xmlNodePtr node)
{
xmlChar *prop;
int i, n;
+ struct rig_state *rs = STATE(rig);
memset(chan, 0, sizeof(channel_t));
chan->vfo = RIG_VFO_MEM;
@@ -138,8 +139,8 @@ int set_chan(RIG *rig, channel_t *chan, xmlNodePtr node)
/* find channel caps */
for (i = 0; i < HAMLIB_CHANLSTSIZ ; i++)
{
- if (rig->state.chan_list[i].startc <= n
- && rig->state.chan_list[i].endc >= n)
+ if (rs->chan_list[i].startc <= n
+ && rs->chan_list[i].endc >= n)
{
break;
@@ -150,7 +151,7 @@ int set_chan(RIG *rig, channel_t *chan, xmlNodePtr node)
fprintf(stderr, "node %d %d\n", n, i);
- if (rig->state.chan_list[i].mem_caps.bank_num)
+ if (rs->chan_list[i].mem_caps.bank_num)
{
prop = xmlGetProp(node, (unsigned char *) "bank_num");
@@ -160,7 +161,7 @@ int set_chan(RIG *rig, channel_t *chan, xmlNodePtr node)
}
}
- if (rig->state.chan_list[i].mem_caps.channel_desc)
+ if (rs->chan_list[i].mem_caps.channel_desc)
{
prop = xmlGetProp(node, (unsigned char *) "channel_desc");
@@ -170,7 +171,7 @@ int set_chan(RIG *rig, channel_t *chan, xmlNodePtr node)
}
}
- if (rig->state.chan_list[i].mem_caps.ant)
+ if (rs->chan_list[i].mem_caps.ant)
{
prop = xmlGetProp(node, (unsigned char *) "ant");
@@ -180,7 +181,7 @@ int set_chan(RIG *rig, channel_t *chan, xmlNodePtr node)
}
}
- if (rig->state.chan_list[i].mem_caps.freq)
+ if (rs->chan_list[i].mem_caps.freq)
{
prop = xmlGetProp(node, (unsigned char *) "freq");
@@ -190,7 +191,7 @@ int set_chan(RIG *rig, channel_t *chan, xmlNodePtr node)
}
}
- if (rig->state.chan_list[i].mem_caps.mode)
+ if (rs->chan_list[i].mem_caps.mode)
{
prop = xmlGetProp(node, (unsigned char *) "mode");
@@ -200,7 +201,7 @@ int set_chan(RIG *rig, channel_t *chan, xmlNodePtr node)
}
}
- if (rig->state.chan_list[i].mem_caps.width)
+ if (rs->chan_list[i].mem_caps.width)
{
prop = xmlGetProp(node, (unsigned char *) "width");
@@ -210,7 +211,7 @@ int set_chan(RIG *rig, channel_t *chan, xmlNodePtr node)
}
}
- if (rig->state.chan_list[i].mem_caps.tx_freq)
+ if (rs->chan_list[i].mem_caps.tx_freq)
{
prop = xmlGetProp(node, (unsigned char *) "tx_freq");
@@ -220,7 +221,7 @@ int set_chan(RIG *rig, channel_t *chan, xmlNodePtr node)
}
}
- if (rig->state.chan_list[i].mem_caps.tx_mode)
+ if (rs->chan_list[i].mem_caps.tx_mode)
{
prop = xmlGetProp(node, (unsigned char *)"tx_mode");
@@ -230,7 +231,7 @@ int set_chan(RIG *rig, channel_t *chan, xmlNodePtr node)
}
}
- if (rig->state.chan_list[i].mem_caps.tx_width)
+ if (rs->chan_list[i].mem_caps.tx_width)
{
prop = xmlGetProp(node, (unsigned char *)"tx_width");
@@ -240,7 +241,7 @@ int set_chan(RIG *rig, channel_t *chan, xmlNodePtr node)
}
}
- if (rig->state.chan_list[i].mem_caps.split)
+ if (rs->chan_list[i].mem_caps.split)
{
chan->split = RIG_SPLIT_OFF;
prop = xmlGetProp(node, (unsigned char *)"split");
@@ -251,7 +252,7 @@ int set_chan(RIG *rig, channel_t *chan, xmlNodePtr node)
{
chan->split = RIG_SPLIT_ON;
- if (rig->state.chan_list[i].mem_caps.tx_vfo)
+ if (rs->chan_list[i].mem_caps.tx_vfo)
{
prop = xmlGetProp(node, (unsigned char *)"tx_vfo");
@@ -264,7 +265,7 @@ int set_chan(RIG *rig, channel_t *chan, xmlNodePtr node)
}
}
- if (rig->state.chan_list[i].mem_caps.rptr_shift)
+ if (rs->chan_list[i].mem_caps.rptr_shift)
{
prop = xmlGetProp(node, (unsigned char *)"rptr_shift");
@@ -286,7 +287,7 @@ int set_chan(RIG *rig, channel_t *chan, xmlNodePtr node)
}
}
- if (rig->state.chan_list[i].mem_caps.rptr_offs
+ if (rs->chan_list[i].mem_caps.rptr_offs
&& chan->rptr_shift != RIG_RPT_SHIFT_NONE)
{
prop = xmlGetProp(node, (unsigned char *)"rptr_offs");
@@ -298,7 +299,7 @@ int set_chan(RIG *rig, channel_t *chan, xmlNodePtr node)
}
}
- if (rig->state.chan_list[i].mem_caps.tuning_step)
+ if (rs->chan_list[i].mem_caps.tuning_step)
{
prop = xmlGetProp(node, (unsigned char *)"tuning_step");
@@ -308,7 +309,7 @@ int set_chan(RIG *rig, channel_t *chan, xmlNodePtr node)
}
}
- if (rig->state.chan_list[i].mem_caps.rit)
+ if (rs->chan_list[i].mem_caps.rit)
{
prop = xmlGetProp(node, (unsigned char *)"rit");
@@ -318,7 +319,7 @@ int set_chan(RIG *rig, channel_t *chan, xmlNodePtr node)
}
}
- if (rig->state.chan_list[i].mem_caps.xit)
+ if (rs->chan_list[i].mem_caps.xit)
{
prop = xmlGetProp(node, (unsigned char *)"xit");
@@ -328,7 +329,7 @@ int set_chan(RIG *rig, channel_t *chan, xmlNodePtr node)
}
}
- if (rig->state.chan_list[i].mem_caps.funcs)
+ if (rs->chan_list[i].mem_caps.funcs)
{
prop = xmlGetProp(node, (unsigned char *)"funcs");
@@ -338,7 +339,7 @@ int set_chan(RIG *rig, channel_t *chan, xmlNodePtr node)
}
}
- if (rig->state.chan_list[i].mem_caps.ctcss_tone)
+ if (rs->chan_list[i].mem_caps.ctcss_tone)
{
prop = xmlGetProp(node, (unsigned char *)"ctcss_tone");
@@ -348,7 +349,7 @@ int set_chan(RIG *rig, channel_t *chan, xmlNodePtr node)
}
}
- if (rig->state.chan_list[i].mem_caps.ctcss_sql)
+ if (rs->chan_list[i].mem_caps.ctcss_sql)
{
prop = xmlGetProp(node, (unsigned char *)"ctcss_sql");
@@ -358,7 +359,7 @@ int set_chan(RIG *rig, channel_t *chan, xmlNodePtr node)
}
}
- if (rig->state.chan_list[i].mem_caps.dcs_code)
+ if (rs->chan_list[i].mem_caps.dcs_code)
{
prop = xmlGetProp(node, (unsigned char *)"dcs_code");
@@ -368,7 +369,7 @@ int set_chan(RIG *rig, channel_t *chan, xmlNodePtr node)
}
}
- if (rig->state.chan_list[i].mem_caps.dcs_sql)
+ if (rs->chan_list[i].mem_caps.dcs_sql)
{
prop = xmlGetProp(node, (unsigned char *)"dcs_sql");
@@ -378,7 +379,7 @@ int set_chan(RIG *rig, channel_t *chan, xmlNodePtr node)
}
}
- if (rig->state.chan_list[i].mem_caps.scan_group)
+ if (rs->chan_list[i].mem_caps.scan_group)
{
prop = xmlGetProp(node, (unsigned char *)"scan_group");
@@ -388,7 +389,7 @@ int set_chan(RIG *rig, channel_t *chan, xmlNodePtr node)
}
}
- if (rig->state.chan_list[i].mem_caps.flags)
+ if (rs->chan_list[i].mem_caps.flags)
{
prop = xmlGetProp(node, (unsigned char *)"flags");
diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c
index 5b8333c12..cc2c3f761 100644
--- a/tests/rigctl_parse.c
+++ b/tests/rigctl_parse.c
@@ -706,6 +706,7 @@ int rigctl_parse(RIG *my_rig, FILE *fin, FILE *fout, char *argv[], int argc,
int retcode = -RIG_EINTERNAL; /* generic return code from functions */
unsigned char cmd;
struct test_table *cmd_entry = NULL;
+ struct rig_state *rs = STATE(my_rig);
char command[MAXARGSZ + 1];
char arg1[MAXARGSZ + 1], *p1 = NULL;
@@ -868,7 +869,7 @@ int rigctl_parse(RIG *my_rig, FILE *fin, FILE *fout, char *argv[], int argc,
return (RIG_OK);
}
- my_rig->state.vfo_opt = *vfo_opt;
+ rs->vfo_opt = *vfo_opt;
if (cmd == 'Q' || cmd == 'q')
{
@@ -1779,10 +1780,10 @@ readline_repeat:
rig_debug(RIG_DEBUG_TRACE, "%s: vfo_opt=%d\n", __func__, *vfo_opt);
- if (my_rig->state.comm_state == 0)
+ if (rs->comm_state == 0)
{
rig_debug(RIG_DEBUG_WARN, "%s: %p rig not open...trying to reopen\n", __func__,
- &my_rig->state.comm_state);
+ &rs->comm_state);
rig_open(my_rig);
}
@@ -1808,7 +1809,7 @@ readline_repeat:
else
{
// Allow only certain commands when the rig is powered off
- if (my_rig->state.powerstat == RIG_POWER_OFF && (rig_powerstat == RIG_POWER_OFF
+ if (rs->powerstat == RIG_POWER_OFF && (rig_powerstat == RIG_POWER_OFF
|| rig_powerstat == RIG_POWER_STANDBY)
&& cmd_entry->cmd != '1' // dump_caps
&& cmd_entry->cmd != '3' // dump_conf
@@ -1846,7 +1847,7 @@ readline_repeat:
// we need to copy client_version to our thread in case there are multiple client versions
// client_version is used to determine any backward compatibility requirements or problems
- strncpy(client_version, my_rig->state.client_version, sizeof(client_version));
+ strncpy(client_version, rs->client_version, sizeof(client_version));
}
@@ -1927,15 +1928,16 @@ declare_proto_rig(hamlib_version)
declare_proto_rig(client_version)
{
+ struct rig_state *rs = STATE(rig);
if ((interactive && prompt) || (interactive && !prompt && ext_resp))
{
fprintf(fout, "%s: ", cmd->arg1);
}
fprintf(fout, "%s%c", arg1, resp_sep);
- strncpy(rig->state.client_version, arg1, sizeof(rig->state.client_version) - 1);
+ strncpy(rs->client_version, arg1, sizeof(rs->client_version) - 1);
rig_debug(RIG_DEBUG_VERBOSE, "%s: client_version=%s\n", __func__,
- rig->state.client_version);
+ rs->client_version);
return RIG_OK;
}
@@ -2270,15 +2272,16 @@ declare_proto_rig(set_mode)
{
rmode_t mode;
pbwidth_t width;
+ struct rig_state *rs = STATE(rig);
ENTERFUNC2;
- if (rig->state.lock_mode || lock_mode) { RETURNFUNC2(RIG_OK); }
+ if (rs->lock_mode || lock_mode) { RETURNFUNC2(RIG_OK); }
if (!strcmp(arg1, "?"))
{
char s[SPRINTF_MAX_SIZE];
- rig_sprintf_mode(s, sizeof(s), rig->state.mode_list);
+ rig_sprintf_mode(s, sizeof(s), rs->mode_list);
fprintf(fout, "%s\n", s);
RETURNFUNC2(RIG_OK);
}
@@ -2286,7 +2289,7 @@ declare_proto_rig(set_mode)
mode = rig_parse_mode(arg1);
CHKSCN1ARG(sscanf(arg2, "%ld", &width));
- if (rig->state.lock_mode) { RETURNFUNC2(RIG_OK); }
+ if (rs->lock_mode) { RETURNFUNC2(RIG_OK); }
RETURNFUNC2(rig_set_mode(rig, vfo, mode, width));
}
@@ -2336,7 +2339,7 @@ declare_proto_rig(set_vfo)
if (!strcmp(arg1, "?"))
{
char s[SPRINTF_MAX_SIZE];
- rig_sprintf_vfo(s, sizeof(s), rig->state.vfo_list);
+ rig_sprintf_vfo(s, sizeof(s), STATE(rig)->vfo_list);
fprintf(fout, "%s\n", s);
RETURNFUNC2(RIG_OK);
}
@@ -2426,7 +2429,7 @@ declare_proto_rig(get_vfo_info)
if (!strcmp(arg1, "?"))
{
char s[SPRINTF_MAX_SIZE];
- rig_sprintf_vfo(s, sizeof(s), rig->state.vfo_list);
+ rig_sprintf_vfo(s, sizeof(s), STATE(rig)->vfo_list);
fprintf(fout, "%s\n", s);
RETURNFUNC2(RIG_OK);
}
@@ -2474,7 +2477,7 @@ declare_proto_rig(get_vfo_list)
ENTERFUNC2;
- rig_sprintf_vfo(prntbuf, sizeof(prntbuf), rig->state.vfo_list);
+ rig_sprintf_vfo(prntbuf, sizeof(prntbuf), STATE(rig)->vfo_list);
if ((interactive && prompt) || (interactive && !prompt && ext_resp))
{
@@ -2511,7 +2514,7 @@ declare_proto_rig(get_modes)
ENTERFUNC2;
- rig_strrmodes(rig->state.mode_list, prntbuf, sizeof(prntbuf));
+ rig_strrmodes(STATE(rig)->mode_list, prntbuf, sizeof(prntbuf));
if ((interactive && prompt) || (interactive && !prompt && ext_resp))
{
@@ -2986,7 +2989,7 @@ declare_proto_rig(set_split_mode)
if (!strcmp(arg1, "?"))
{
char s[SPRINTF_MAX_SIZE];
- rig_sprintf_mode(s, sizeof(s), rig->state.mode_list);
+ rig_sprintf_mode(s, sizeof(s), STATE(rig)->mode_list);
fprintf(fout, "%s\n", s);
RETURNFUNC2(RIG_OK);
}
@@ -3048,7 +3051,7 @@ declare_proto_rig(set_split_freq_mode)
if (!strcmp(arg1, "?"))
{
char s[SPRINTF_MAX_SIZE];
- rig_sprintf_mode(s, sizeof(s), rig->state.mode_list);
+ rig_sprintf_mode(s, sizeof(s), STATE(rig)->mode_list);
fprintf(fout, "%s\n", s);
RETURNFUNC2(RIG_OK);
}
@@ -3116,7 +3119,7 @@ declare_proto_rig(set_split_vfo)
if (!strcmp(arg2, "?"))
{
char s[SPRINTF_MAX_SIZE];
- rig_sprintf_vfo(s, sizeof(s), rig->state.vfo_list);
+ rig_sprintf_vfo(s, sizeof(s), STATE(rig)->vfo_list);
fprintf(fout, "%s\n", s);
RETURNFUNC2(RIG_OK);
}
@@ -3293,7 +3296,7 @@ declare_proto_rig(set_level)
if (!strcmp(arg1, "?"))
{
char s[SPRINTF_MAX_SIZE];
- rig_sprintf_level(s, sizeof(s), rig->state.has_set_level);
+ rig_sprintf_level(s, sizeof(s), STATE(rig)->has_set_level);
fputs(s, fout);
if (rig->caps->set_ext_level)
@@ -3409,7 +3412,7 @@ declare_proto_rig(get_level)
if (!strcmp(arg1, "?"))
{
char s[SPRINTF_MAX_SIZE];
- rig_sprintf_level(s, sizeof(s), rig->state.has_get_level);
+ rig_sprintf_level(s, sizeof(s), STATE(rig)->has_get_level);
fputs(s, fout);
if (rig->caps->get_ext_level)
@@ -3546,7 +3549,7 @@ declare_proto_rig(set_func)
if (!strcmp(arg1, "?"))
{
char s[SPRINTF_MAX_SIZE];
- rig_sprintf_func(s, sizeof(s), rig->state.has_set_func);
+ rig_sprintf_func(s, sizeof(s), STATE(rig)->has_set_func);
fprintf(fout, "%s\n", s);
RETURNFUNC2(RIG_OK);
}
@@ -3586,7 +3589,7 @@ declare_proto_rig(get_func)
if (!strcmp(arg1, "?"))
{
char s[SPRINTF_MAX_SIZE];
- rig_sprintf_func(s, sizeof(s), rig->state.has_get_func);
+ rig_sprintf_func(s, sizeof(s), STATE(rig)->has_get_func);
fprintf(fout, "%s\n", s);
RETURNFUNC2(RIG_OK);
}
@@ -3650,7 +3653,7 @@ declare_proto_rig(set_parm)
if (!strcmp(arg1, "?"))
{
char s[SPRINTF_MAX_SIZE];
- rig_sprintf_parm(s, sizeof(s), rig->state.has_set_parm);
+ rig_sprintf_parm(s, sizeof(s), STATE(rig)->has_set_parm);
fprintf(fout, "%s\n", s);
RETURNFUNC2(RIG_OK);
}
@@ -3778,7 +3781,7 @@ declare_proto_rig(get_parm)
if (!strcmp(arg1, "?"))
{
char s[SPRINTF_MAX_SIZE];
- rig_sprintf_parm(s, sizeof(s), rig->state.has_get_parm);
+ rig_sprintf_parm(s, sizeof(s), STATE(rig)->has_get_parm);
fprintf(fout, "%s\n", s);
RETURNFUNC2(RIG_OK);
}
@@ -3964,7 +3967,7 @@ declare_proto_rig(vfo_op)
if (!strcmp(arg1, "?"))
{
char s[SPRINTF_MAX_SIZE];
- rig_sprintf_vfop(s, sizeof(s), rig->state.vfo_ops);
+ rig_sprintf_vfop(s, sizeof(s), STATE(rig)->vfo_ops);
fprintf(fout, "%s\n", s);
RETURNFUNC2(RIG_OK);
}
@@ -4589,7 +4592,7 @@ declare_proto_rig(dump_caps)
declare_proto_rig(dump_state)
{
int i;
- struct rig_state *rs = &rig->state;
+ struct rig_state *rs = STATE(rig);
char buf[1024];
ENTERFUNC2;
@@ -4761,13 +4764,13 @@ declare_proto_rig(dump_state)
{
if (RIG_LEVEL_IS_FLOAT(i))
{
- fprintf(fout, "%d=%g,%g,%g;", i, rig->state.level_gran[i].min.f,
- rig->state.level_gran[i].max.f, rig->state.level_gran[i].step.f);
+ fprintf(fout, "%d=%g,%g,%g;", i, rs->level_gran[i].min.f,
+ rs->level_gran[i].max.f, rs->level_gran[i].step.f);
}
else
{
- fprintf(fout, "%d=%d,%d,%d;", i, rig->state.level_gran[i].min.i,
- rig->state.level_gran[i].max.i, rig->state.level_gran[i].step.i);
+ fprintf(fout, "%d=%d,%d,%d;", i, rs->level_gran[i].min.i,
+ rs->level_gran[i].max.i, rs->level_gran[i].step.i);
}
}
@@ -4777,20 +4780,20 @@ declare_proto_rig(dump_state)
{
if (RIG_LEVEL_IS_FLOAT(i))
{
- fprintf(fout, "%d=%g,%g,%g;", i, rig->state.parm_gran[i].min.f,
- rig->state.parm_gran[i].max.f, rig->state.parm_gran[i].step.f);
+ fprintf(fout, "%d=%g,%g,%g;", i, rs->parm_gran[i].min.f,
+ rs->parm_gran[i].max.f, rs->parm_gran[i].step.f);
}
else
{
- fprintf(fout, "%d=%d,%d,%d;", i, rig->state.level_gran[i].min.i,
- rig->state.level_gran[i].max.i, rig->state.level_gran[i].step.i);
+ fprintf(fout, "%d=%d,%d,%d;", i, rs->level_gran[i].min.i,
+ rs->level_gran[i].max.i, rs->level_gran[i].step.i);
}
}
fprintf(fout, "\n");
- rig->state.rig_model = rig->caps->rig_model;
- fprintf(fout, "rig_model=%d\n", rig->state.rig_model);
+ rs->rig_model = rig->caps->rig_model;
+ fprintf(fout, "rig_model=%d\n", rs->rig_model);
fprintf(fout, "hamlib_version=%s\n", hamlib_version2);
fprintf(fout, "done\n");
}
@@ -5400,7 +5403,7 @@ declare_proto_rig(chk_vfo)
fprintf(fout, "%s: ", cmd->arg1); /* i.e. "Frequency" */
}
- fprintf(fout, "%d\n", rig->state.vfo_opt);
+ fprintf(fout, "%d\n", STATE(rig)->vfo_opt);
chk_vfo_executed = 1; // this allows us to control dump_state version
@@ -5414,7 +5417,7 @@ declare_proto_rig(set_vfo_opt)
ENTERFUNC2;
CHKSCN1ARG(sscanf(arg1, "%d", &opt));
- *vfo_opt = rig->state.vfo_opt = opt;
+ *vfo_opt = STATE(rig)->vfo_opt = opt;
RETURNFUNC2(rig_set_vfo_opt(rig, opt));
}
commit ce25f638434f20d789d0aecb4dd5a9bbadbfa30e
Author: George Baltz N3GB <Geo...@gm...>
Date: Thu May 30 17:55:54 2024 -0400
Convert macros in rig.h to use STATE()
Note that the other pointer macros are NOT converted - they should be changed
one-by-one as any are moved.
diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h
index 6e8419cd6..dd0cb43ab 100644
--- a/include/hamlib/rig.h
+++ b/include/hamlib/rig.h
@@ -33,7 +33,7 @@
// Our shared secret password
#define HAMLIB_SECRET_LENGTH 32
-#define HAMLIB_TRACE rig_debug(RIG_DEBUG_TRACE,"%s%s(%d) trace\n",spaces(rig->state.depth), __FILE__, __LINE__)
+#define HAMLIB_TRACE rig_debug(RIG_DEBUG_TRACE,"%s%s(%d) trace\n",spaces(STATE(rig)->depth), __FILE__, __LINE__)
#define __FILENAME__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
#include <stdio.h>
@@ -618,13 +618,13 @@ ...
[truncated message content] |
|
From: n0nb <n0...@us...> - 2024-05-31 13:39:39
|
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 745e72a6cf7023cfd26c282207803e4c62897668 (commit)
via 88439f8f12c3011751e995e01b2b09a4fa77dd66 (commit)
via befb2ffcdf0965709055262fb5dad3e00d647d5c (commit)
via 218385a76c0a82ef040be0a1eb5502b25c5664ed (commit)
via 1e3be1a88fd96e59a9715b5f04079c782eccd05d (commit)
via 3583b077e823f0b9474353f36fee4781c1bb4940 (commit)
via be0f7407f2857ccc55ec1f18550b16644421dfb0 (commit)
via a300a73f1d584c28c0e17414445be00c716740f3 (commit)
via 86dc5c8d6fab469ab6191502ad4f4cd7bb0b7326 (commit)
via c730e445a14b8faf1c6112cc8fb1c2217e6c1374 (commit)
via 04c3c03334dd250cccee9b99c808e7b9dfdf5dcb (commit)
via 2de9778f27a7d614cfe33d8af6f6ff2d1b78e444 (commit)
via a721c04c536c0f7301608f49dcccbb1c03152f58 (commit)
via f53dc99057869642b896c4743a99335900cfb39b (commit)
via a5f53bbcf68ba5fea29a40efbda357f109897663 (commit)
via 18568986f85688a6a2d6ae89c950af94dea6be2f (commit)
from 461f3c4172ded779cf258cd5ea4d1c0179c4586f (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 745e72a6cf7023cfd26c282207803e4c62897668
Author: Mike Black W9MDB <mdb...@ya...>
Date: Thu May 30 17:34:02 2024 -0500
Add
ROT_MOVE_UP_LEFT, ROT_MOVE_UP_CCW
ROT_MOVE_UP_RIGHT, ROT_MOVE_UP_CW
ROT_MOVE_DOWN_LEFT, ROT_MOVE_DOWN_CCW
ROT_MOVE_DOWN_RIGHT, ROT_MOVE_DOWN_CW
Supported by SPID rotators
diff --git a/doc/man1/rotctl.1 b/doc/man1/rotctl.1
index f947223a2..93c925883 100644
--- a/doc/man1/rotctl.1
+++ b/doc/man1/rotctl.1
@@ -410,8 +410,9 @@ are returned as double precision floating point values.
Move the rotator in a specific direction at the given rate.
.IP
.RI \(aq Direction \(aq
-is an integer or keyword defined as \(oq2\(cq = UP, \(oq4\(cq = DOWN, \(oq8\(cq = LEFT or CCW
-and \(oq16\(cq = RIGHT or CW
+is an integer or keyword defined as \(oq2\(cq = UP, \(oq4\(cq = DOWN, \(oq8\(cq = LEFT or CCW,
+\(oq16\(cq = RIGHT or CW, \(oq32\(cq = UP_LEFT or UP_CCW, \(oqR64\(cq = UP_RIGHT = UP_CW,
+\(oq128\(cq = DOWN_LEFT or DOWN_CCW, \(oq256\(cq = DOWN_RIGHT or DOWN_CW
.IP
.RI \(aq Speed \(aq
is an integer between 1 and 100. Use -1 for no change to current speed.
diff --git a/doc/man1/rotctld.1 b/doc/man1/rotctld.1
index 852831c1e..f65bbcf3d 100644
--- a/doc/man1/rotctld.1
+++ b/doc/man1/rotctld.1
@@ -322,8 +322,9 @@ are returned as double precision floating point values.
Move the rotator in a specific direction at the given rate.
.IP
.RI \(aq Direction \(aq
-is an integer defined as \(oq2\(cq = Up, \(oq4\(cq = Down, \(oq8\(cq = Left,
-and \(oq16\(cq = Right.
+is an integer or keyword defined as \(oq2\(cq = UP, \(oq4\(cq = DOWN, \(oq8\(cq = LEFT or CCW,
+\(oq16\(cq = RIGHT or CW, \(oq32\(cq = UP_LEFT or UP_CCW, \(oqR64\(cq = UP_RIGHT = UP_CW,
+\(oq128\(cq = DOWN_LEFT or DOWN_CCW, \(oq256\(cq = DOWN_RIGHT or DOWN_CW
.IP
.RI \(aq Speed \(aq
is an integer between 1 and 100. Use -1 for no change to current speed.
diff --git a/include/hamlib/rotator.h b/include/hamlib/rotator.h
index 6427001c3..82bc634e2 100644
--- a/include/hamlib/rotator.h
+++ b/include/hamlib/rotator.h
@@ -215,6 +215,126 @@ typedef enum {
*/
#define ROT_MOVE_CW ROT_MOVE_RIGHT
+/**
+ * \def ROT_MOVE_UP_LEFT
+ * \brief A macro that returns the flag for the \b clockwise direction.
+ *
+ * This macro defines the value of the \b clockwise direction which can be
+ * used with the rot_move() function. This value is equivalent to
+ * ROT_MOVE_UP_CCW.
+ *
+ * \sa rot_move(), ROT_MOVE_UP, ROT_MOVE_DOWN, ROT_MOVE_LEFT, ROT_MOVE_CCW,
+ * ROT_MOVE_RIGHT, ROT_MOVE_CW, ROT_MOVE_UP_CCW,
+ * ROT_MOVE_UP_RIGHT, ROT_MOVE_UP_CW, ROT_MOVE_DOWN_LEFT, ROT_MOVE_DOWN_CCW,
+ * ROT_MOVE_DOWN_RIGHT, ROT_MOVE_DOWN_CW
+ */
+#define ROT_MOVE_UP_LEFT (1<<5)
+
+/**
+ * \def ROT_MOVE_UP_CCW
+ * \brief A macro that returns the flag for the \b clockwise direction.
+ *
+ * This macro defines the value of the \b clockwise direction which can be
+ * used with the rot_move() function. This value is equivalent to
+ * ROT_MOVE_UP_LEFT.
+ *
+ * \sa rot_move(), ROT_MOVE_UP, ROT_MOVE_DOWN, ROT_MOVE_LEFT, ROT_MOVE_CCW,
+ * ROT_MOVE_RIGHT, ROT_MOVE_CW, ROT_MOVE_UP_LEFT,
+ * ROT_MOVE_UP_RIGHT, ROT_MOVE_UP_CW, ROT_MOVE_DOWN_LEFT, ROT_MOVE_DOWN_CCW,
+ * ROT_MOVE_DOWN_RIGHT, ROT_MOVE_DOWN_CW
+ */
+#define ROT_MOVE_UP_CCW ROT_MOVE_UP_LEFT
+
+/**
+ * \def ROT_MOVE_UP_RIGHT
+ * \brief A macro that returns the flag for the \b clockwise direction.
+ *
+ * This macro defines the value of the \b clockwise direction which can be
+ * used with the rot_move() function. This value is equivalent to
+ * ROT_MOVE_UP_CW.
+ *
+ * \sa rot_move(), ROT_MOVE_UP, ROT_MOVE_DOWN, ROT_MOVE_LEFT, ROT_MOVE_CCW,
+ * ROT_MOVE_RIGHT, ROT_MOVE_CW, ROT_MOVE_UP_LEFT, ROT_MOVE_UP_CCW,
+ * ROT_MOVE_UP_CW, ROT_MOVE_DOWN_LEFT, ROT_MOVE_DOWN_CCW,
+ * ROT_MOVE_DOWN_RIGHT, ROT_MOVE_DOWN_CW
+ */
+#define ROT_MOVE_UP_RIGHT (1<<6)
+
+/**
+ * \def ROT_MOVE_UP_CW
+ * \brief A macro that returns the flag for the \b clockwise direction.
+ *
+ * This macro defines the value of the \b clockwise direction which can be
+ * used with the rot_move() function. This value is equivalent to
+ * ROT_MOVE_UP_RIGHT.
+ *
+ * \sa rot_move(), ROT_MOVE_UP, ROT_MOVE_DOWN, ROT_MOVE_LEFT, ROT_MOVE_CCW,
+ * ROT_MOVE_RIGHT, ROT_MOVE_CW, ROT_MOVE_UP_LEFT, ROT_MOVE_UP_CCW,
+ * ROT_MOVE_UP_RIGHT, ROT_MOVE_DOWN_LEFT, ROT_MOVE_DOWN_CCW,
+ * ROT_MOVE_DOWN_RIGHT, ROT_MOVE_DOWN_CW
+ */
+#define ROT_MOVE_UP_CW ROT_MOVE_UP_RIGHT
+
+/**
+ * \def ROT_MOVE_DOWN_LEFT
+ * \brief A macro that returns the flag for the \b clockwise direction.
+ *
+ * This macro defines the value of the \b clockwise direction which can be
+ * used with the rot_move() function. This value is equivalent to
+ * ROT_MOVE_DOWN_CCW.
+ *
+ * \sa rot_move(), ROT_MOVE_UP, ROT_MOVE_DOWN, ROT_MOVE_LEFT, ROT_MOVE_CCW,
+ * ROT_MOVE_RIGHT, ROT_MOVE_CW, ROT_MOVE_UP_LEFT, ROT_MOVE_UP_CCW,
+ * ROT_MOVE_UP_RIGHT, ROT_MOVE_UP_CW, ROT_MOVE_DOWN_CCW,
+ * ROT_MOVE_DOWN_RIGHT, ROT_MOVE_DOWN_CW
+ */
+#define ROT_MOVE_DOWN_LEFT (1 << 7)
+
+
+/**
+ * \def ROT_MOVE_DOWN_CCW
+ * \brief A macro that returns the flag for the \b clockwise direction.
+ *
+ * This macro defines the value of the \b clockwise direction which can be
+ * used with the rot_move() function. This value is equivalent to
+ * ROT_MOVE_DOWN_LEFT.
+ *
+ * \sa rot_move(), ROT_MOVE_UP, ROT_MOVE_DOWN, ROT_MOVE_LEFT, ROT_MOVE_CCW,
+ * ROT_MOVE_RIGHT, ROT_MOVE_CW, ROT_MOVE_UP_LEFT, ROT_MOVE_UP_CCW,
+ * ROT_MOVE_UP_RIGHT, ROT_MOVE_UP_CW, ROT_MOVE_DOWN_LEFT,
+ * ROT_MOVE_DOWN_RIGHT, ROT_MOVE_DOWN_CW
+ */
+#define ROT_MOVE_DOWN_CCW ROT_MOVE_DOWN_LEFT
+
+/**
+ * \def ROT_MOVE_DOWN_RIGHT
+ * \brief A macro that returns the flag for the \b clockwise direction.
+ *
+ * This macro defines the value of the \b clockwise direction which can be
+ * used with the rot_move() function. This value is equivalent to
+ * ROT_MOVE_DOWN_CW.
+ *
+ * \sa rot_move(), ROT_MOVE_UP, ROT_MOVE_DOWN, ROT_MOVE_LEFT, ROT_MOVE_CCW,
+ * ROT_MOVE_RIGHT, ROT_MOVE_CW, ROT_MOVE_UP_LEFT, ROT_MOVE_UP_CCW,
+ * ROT_MOVE_UP_RIGHT, ROT_MOVE_UP_CW, ROT_MOVE_DOWN_LEFT, ROT_MOVE_DOWN_CCW,
+ * ROT_MOVE_DOWN_CW
+ */
+#define ROT_MOVE_DOWN_RIGHT (1 << 8)
+
+/**
+ * \def ROT_MOVE_DOWN_CW
+ * \brief A macro that returns the flag for the \b clockwise direction.
+ *
+ * This macro defines the value of the \b clockwise direction which can be
+ * used with the rot_move() function. This value is equivalent to
+ * ROT_MOVE_DOWN_RIGHT.
+ *
+ * \sa rot_move(), ROT_MOVE_UP, ROT_MOVE_DOWN, ROT_MOVE_LEFT, ROT_MOVE_CCW,
+ * ROT_MOVE_RIGHT, ROT_MOVE_CW, ROT_MOVE_UP_LEFT, ROT_MOVE_UP_CCW,
+ * ROT_MOVE_UP_RIGHT, ROT_MOVE_UP_CW, ROT_MOVE_DOWN_LEFT, ROT_MOVE_DOWN_CCW,
+ * ROT_MOVE_DOWN_RIGHT,
+ */
+#define ROT_MOVE_DOWN_CW ROT_MOVE_DOWN_RIGHT
/**
* \brief Rotator status flags
diff --git a/rigs/dummy/rot_dummy.c b/rigs/dummy/rot_dummy.c
index 1bf2b2d4e..dec0f8cfc 100644
--- a/rigs/dummy/rot_dummy.c
+++ b/rigs/dummy/rot_dummy.c
@@ -436,6 +436,22 @@ static int dummy_rot_move(ROT *rot, int direction, int speed)
case ROT_MOVE_CW:
return dummy_rot_set_position(rot, 180, priv->target_el);
+ case ROT_MOVE_UP_LEFT:
+ dummy_rot_set_position(rot, priv->target_az, 90);
+ return dummy_rot_set_position(rot, -180, priv->target_el);
+
+ case ROT_MOVE_UP_RIGHT:
+ dummy_rot_set_position(rot, priv->target_az, 90);
+ return dummy_rot_set_position(rot, 180, priv->target_el);
+
+ case ROT_MOVE_DOWN_LEFT:
+ dummy_rot_set_position(rot, priv->target_az, 0);
+ return dummy_rot_set_position(rot, -180, priv->target_el);
+
+ case ROT_MOVE_DOWN_RIGHT:
+ dummy_rot_set_position(rot, priv->target_az, 0);
+ return dummy_rot_set_position(rot, 180, priv->target_el);
+
default:
return -RIG_EINVAL;
}
diff --git a/rigs/flexradio/README b/rigs/flexradio/README
new file mode 100644
index 000000000..4e9fcf2a6
--- /dev/null
+++ b/rigs/flexradio/README
@@ -0,0 +1 @@
+See https://github.com/flexradio/smartsdr-api-docs/wiki/SmartSDR-TCPIP-API
diff --git a/rotators/spid/spid.c b/rotators/spid/spid.c
index e0dd0d712..c9ef0b3e7 100644
--- a/rotators/spid/spid.c
+++ b/rotators/spid/spid.c
@@ -37,6 +37,7 @@ struct spid_rot2prog_priv_data
{
int az_resolution;
int el_resolution;
+ int dir; // current direction
};
enum spid_rot2prog_framemagic
@@ -213,6 +214,7 @@ static int spid_rot_init(ROT *rot)
priv->az_resolution = 0;
priv->el_resolution = 0;
+ priv->dir = 0;
}
return RIG_OK;
@@ -238,9 +240,10 @@ static int spid_rot_cleanup(ROT *rot)
return RIG_OK;
}
-static int spid_get_conf2(ROT *rot, hamlib_token_t token, char *val, int val_len)
+static int spid_get_conf2(ROT *rot, hamlib_token_t token, char *val,
+ int val_len)
{
- const struct spid_rot2prog_priv_data *priv = (struct spid_rot2prog_priv_data *)
+ const struct spid_rot2prog_priv_data *priv = (struct spid_rot2prog_priv_data *)
rot->state.priv;
rig_debug(RIG_DEBUG_TRACE, "%s called %d\n", __func__, (int)token);
@@ -343,7 +346,7 @@ static int spid_rot2prog_rot_set_position(ROT *rot, azimuth_t az,
{
struct rot_state *rs = &rot->state;
hamlib_port_t *rotp = ROTPORT(rot);
- const struct spid_rot2prog_priv_data *priv = (struct spid_rot2prog_priv_data *)
+ const struct spid_rot2prog_priv_data *priv = (struct spid_rot2prog_priv_data *)
rs->priv;
int retval;
int retry_read = 0;
@@ -494,6 +497,8 @@ static int spid_rot_get_position(ROT *rot, azimuth_t *az, elevation_t *el)
static int spid_rot_stop(ROT *rot)
{
+ struct spid_rot2prog_priv_data *priv = (struct spid_rot2prog_priv_data *)
+ rot->state.priv;
hamlib_port_t *rotp = ROTPORT(rot);
int retval;
int retry_read = 0;
@@ -530,36 +535,68 @@ static int spid_rot_stop(ROT *rot)
return retval;
}
+ priv->dir = 0;
+
return RIG_OK;
}
static int spid_md01_rot2prog_rot_move(ROT *rot, int direction, int speed)
{
+ struct spid_rot2prog_priv_data *priv = (struct spid_rot2prog_priv_data *)
+ rot->state.priv;
char dir = 0x00;
int retval;
char cmdstr[13];
rig_debug(RIG_DEBUG_TRACE, "%s called\n", __func__);
+ dir = priv->dir;
+
switch (direction)
{
case ROT_MOVE_UP:
- dir = 0x04;
+ if (dir != 0x01 || dir != 0x02) { dir = 0; }
+
+ dir |= 0x04;
break;
case ROT_MOVE_DOWN:
+ if (dir != 0x01 || dir != 0x02) { dir = 0; }
+
dir = 0x08;
break;
case ROT_MOVE_LEFT:
+ if (dir != 0x04 || dir != 0x08) { dir = 0; }
+
dir = 0x01;
break;
case ROT_MOVE_RIGHT:
+ if (dir != 0x04 || dir != 0x08) { dir = 0; }
+
dir = 0x02;
break;
+
+ case ROT_MOVE_UP_RIGHT:
+ dir = 0x06;
+ break;
+
+ case ROT_MOVE_DOWN_RIGHT:
+ dir = 0x0a;
+ break;
+
+ case ROT_MOVE_UP_LEFT:
+ dir = 0x05;
+ break;
+
+ case ROT_MOVE_DOWN_LEFT:
+ dir = 0x09;
+ break;
}
+ priv->dir = dir;
+
cmdstr[0] = 0x57; /* S */
cmdstr[1] = dir; /* H1 */
cmdstr[2] = 0x00; /* H2 */
@@ -599,7 +636,7 @@ const struct rot_caps spid_rot1prog_rot_caps =
ROT_MODEL(ROT_MODEL_SPID_ROT1PROG),
.model_name = "Rot1Prog",
.mfg_name = "SPID",
- .version = "20220109.0",
+ .version = "20240530.0",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rot_type = ROT_TYPE_AZIMUTH,
diff --git a/src/rotator.c b/src/rotator.c
index c601f402d..f82702e62 100644
--- a/src/rotator.c
+++ b/src/rotator.c
@@ -949,8 +949,9 @@ int HAMLIB_API rot_reset(ROT *rot, rot_reset_t reset)
*
* Move the rotator in the specified direction. The \a direction is one of
* #ROT_MOVE_CCW, #ROT_MOVE_CW, #ROT_MOVE_LEFT, #ROT_MOVE_RIGHT, #ROT_MOVE_UP,
- * or #ROT_MOVE_DOWN. The \a speed is a value between 1 and 100 or
- * #ROT_SPEED_NOCHANGE.
+ * #ROT_MOVE_DOWN, #ROT_MOVE_UP_LEFT, #ROT_MOVE_CCW, #ROT_MOVE_UP_RIGHT, #ROT_MOVE_UP_CW,
+ * #ROT_MOVE_DOWN_LEFT, #ROT_MOVE_DOWN_CCW, #ROT_MOVE_DOWN_RIGHT, #ROT_MOVE_DOWN_CW.
+ * The \a speed is a value between 1 and 100 or #ROT_SPEED_NOCHANGE.
*
* \retval RIG_OK The rotator move was successful.
* \retval RIG_EINVAL \a rot is NULL or inconsistent.
diff --git a/tests/rotctl_parse.c b/tests/rotctl_parse.c
index d266cf3c0..af07cc736 100644
--- a/tests/rotctl_parse.c
+++ b/tests/rotctl_parse.c
@@ -1897,6 +1897,22 @@ declare_proto_rot(move)
{
direction = ROT_MOVE_DOWN;
}
+ else if (!strcmp(arg1, "DOWN_RIGHT") || !strcmp(arg1, "DOWN_CW"))
+ {
+ direction = ROT_MOVE_DOWN_CW;
+ }
+ else if (!strcmp(arg1, "DOWN_LEFT") || !strcmp(arg1, "DOWN_CCW"))
+ {
+ direction = ROT_MOVE_DOWN_CCW;
+ }
+ else if (!strcmp(arg1, "UP_RIGHT") || !strcmp(arg1, "UP_CW"))
+ {
+ direction = ROT_MOVE_UP_CW;
+ }
+ else if (!strcmp(arg1, "UP_LEFT") || !strcmp(arg1, "UP_CCW"))
+ {
+ direction = ROT_MOVE_UP_CCW;
+ }
else
{
CHKSCN1ARG(sscanf(arg1, "%d", &direction));
commit 88439f8f12c3011751e995e01b2b09a4fa77dd66
Author: Mike Black W9MDB <mdb...@ya...>
Date: Thu May 30 17:22:00 2024 -0500
Update simflex.c
diff --git a/simulators/simflex.c b/simulators/simflex.c
index 3ee3113f2..d006348b1 100644
--- a/simulators/simflex.c
+++ b/simulators/simflex.c
@@ -93,6 +93,7 @@ int main() {
printf("Server is listening on port %d\n", PORT);
+ while (1) {
// Accept incoming connection
if ((new_socket = accept(server_fd, (struct sockaddr *)&address, (socklen_t*)&addrlen)) < 0) {
perror("accept");
@@ -154,6 +155,7 @@ int main() {
}
close(new_socket);
+ }
close(server_fd);
#if defined(WIN32) || defined(_WIN32)
WSACleanup();
commit befb2ffcdf0965709055262fb5dad3e00d647d5c
Author: Mike Black W9MDB <mdb...@ya...>
Date: Thu May 30 10:03:01 2024 -0500
Add a bit more debug to rigctlcom.c
diff --git a/tests/rigctlcom.c b/tests/rigctlcom.c
index 2716b98fe..4bf136ec3 100644
--- a/tests/rigctlcom.c
+++ b/tests/rigctlcom.c
@@ -502,6 +502,7 @@ int main(int argc, char *argv[])
fprintf(stderr, "Config parameter error: %s\n", rigerror(retcode));
exit(2);
}
+
#endif
if (my_model > 5 && !rig_file)
@@ -654,6 +655,9 @@ int main(int argc, char *argv[])
}
while (retcode == 0 && !ctrl_c);
+ rig_debug(RIG_DEBUG_VERBOSE, "%s: rigctlcom exiting, retcode=%d, ctrl_c=%d\n",
+ __func__, retcode, ctrl_c);
+
rig_close(my_rig); /* close port */
rig_cleanup(my_rig); /* if you care about memory */
@@ -705,6 +709,7 @@ static rmode_t ts2000_get_mode()
default: mode = 0; break;
}
+
#else
// Perhaps we should emulate a rig that has PKT modes instead??
//int kwidth_ssb[] = { 10, 50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 1000 };
@@ -717,7 +722,7 @@ static rmode_t ts2000_get_mode()
case RIG_MODE_USB: mode = 2; break;
- case RIG_MODE_CW: mode = 3;
+ case RIG_MODE_CW: mode = 3;
break; // is this correct?
case RIG_MODE_FM: mode = 4; break;
@@ -742,6 +747,7 @@ static rmode_t ts2000_get_mode()
default: mode = 0; break;
}
+
#endif
@@ -802,8 +808,9 @@ static int handle_ts2000(void *arg)
int p13 = 0; // P13(1) Tone dummy value for now
int p14 = 0; // P14(2) Tone Freq dummy value for now
int p15 = 0; // P15(1) Shift status dummy value for now
- int retval = rig_get_freq(my_rig, vfo_fixup(my_rig, RIG_VFO_A, CACHE(my_rig)->split),
- &freq);
+ int retval = rig_get_freq(my_rig, vfo_fixup(my_rig, RIG_VFO_A,
+ CACHE(my_rig)->split),
+ &freq);
char response[64];
char *fmt =
// cppcheck-suppress *
@@ -816,7 +823,7 @@ static int handle_ts2000(void *arg)
mode = ts2000_get_mode();
retval = rig_get_ptt(my_rig, vfo_fixup(my_rig, RIG_VFO_A, CACHE(my_rig)->split),
- &ptt);
+ &ptt);
if (retval != RIG_OK)
{
@@ -900,8 +907,9 @@ static int handle_ts2000(void *arg)
freq_t freq = 0;
char response[32];
- int retval = rig_get_freq(my_rig, vfo_fixup(my_rig, RIG_VFO_A, CACHE(my_rig)->split),
- &freq);
+ int retval = rig_get_freq(my_rig, vfo_fixup(my_rig, RIG_VFO_A,
+ CACHE(my_rig)->split),
+ &freq);
if (retval != RIG_OK)
{
@@ -917,8 +925,9 @@ static int handle_ts2000(void *arg)
{
char response[32];
freq_t freq = 0;
- int retval = rig_get_freq(my_rig, vfo_fixup(my_rig, RIG_VFO_B, CACHE(my_rig)->split),
- &freq);
+ int retval = rig_get_freq(my_rig, vfo_fixup(my_rig, RIG_VFO_B,
+ CACHE(my_rig)->split),
+ &freq);
if (retval != RIG_OK)
{
@@ -972,7 +981,8 @@ static int handle_ts2000(void *arg)
}
else if (strcmp(arg, "TX;") == 0)
{
- return rig_set_ptt(my_rig, vfo_fixup(my_rig, RIG_VFO_A, CACHE(my_rig)->split), 1);
+ return rig_set_ptt(my_rig, vfo_fixup(my_rig, RIG_VFO_A, CACHE(my_rig)->split),
+ 1);
}
else if (strcmp(arg, "AI0;") == 0)
{
@@ -1089,8 +1099,9 @@ static int handle_ts2000(void *arg)
{
char response[32];
int valA;
- int retval = rig_get_func(my_rig, vfo_fixup(my_rig, RIG_VFO_A, CACHE(my_rig)->split),
- RIG_FUNC_AIP, &valA);
+ int retval = rig_get_func(my_rig, vfo_fixup(my_rig, RIG_VFO_A,
+ CACHE(my_rig)->split),
+ RIG_FUNC_AIP, &valA);
int valB;
if (retval != RIG_OK)
@@ -1108,8 +1119,9 @@ static int handle_ts2000(void *arg)
return retval;
}
- retval = rig_get_func(my_rig, vfo_fixup(my_rig, RIG_VFO_B, CACHE(my_rig)->split),
- RIG_FUNC_AIP, &valB);
+ retval = rig_get_func(my_rig, vfo_fixup(my_rig, RIG_VFO_B,
+ CACHE(my_rig)->split),
+ RIG_FUNC_AIP, &valB);
if (retval != RIG_OK)
{
@@ -1134,8 +1146,9 @@ static int handle_ts2000(void *arg)
(char *)arg);
}
- retval = rig_set_func(my_rig, vfo_fixup(my_rig, RIG_VFO_A, CACHE(my_rig)->split),
- RIG_FUNC_AIP, valA);
+ retval = rig_set_func(my_rig, vfo_fixup(my_rig, RIG_VFO_A,
+ CACHE(my_rig)->split),
+ RIG_FUNC_AIP, valA);
if (retval != RIG_OK)
{
@@ -1144,8 +1157,9 @@ static int handle_ts2000(void *arg)
return retval;
}
- retval = rig_set_func(my_rig, vfo_fixup(my_rig, RIG_VFO_B, CACHE(my_rig)->split),
- RIG_FUNC_AIP, valB);
+ retval = rig_set_func(my_rig, vfo_fixup(my_rig, RIG_VFO_B,
+ CACHE(my_rig)->split),
+ RIG_FUNC_AIP, valB);
if (retval != RIG_OK)
{
@@ -1560,13 +1574,15 @@ static int handle_ts2000(void *arg)
}
else if (strcmp(arg, "FT0;") == 0)
{
- return rig_set_split_vfo(my_rig, vfo_fixup(my_rig, RIG_VFO_A, CACHE(my_rig)->split),
- vfo_fixup(my_rig, RIG_VFO_A, CACHE(my_rig)->split), 0);
+ return rig_set_split_vfo(my_rig, vfo_fixup(my_rig, RIG_VFO_A,
+ CACHE(my_rig)->split),
+ vfo_fixup(my_rig, RIG_VFO_A, CACHE(my_rig)->split), 0);
}
else if (strcmp(arg, "FT1;") == 0)
{
- return rig_set_split_vfo(my_rig, vfo_fixup(my_rig, RIG_VFO_B, CACHE(my_rig)->split),
- vfo_fixup(my_rig, RIG_VFO_B, CACHE(my_rig)->split), 0);
+ return rig_set_split_vfo(my_rig, vfo_fixup(my_rig, RIG_VFO_B,
+ CACHE(my_rig)->split),
+ vfo_fixup(my_rig, RIG_VFO_B, CACHE(my_rig)->split), 0);
}
else if (strncmp(arg, "FA0", 3) == 0)
{
@@ -1583,7 +1599,8 @@ static int handle_ts2000(void *arg)
freq_t freq;
sscanf((char *)arg + 2, "%"SCNfreq, &freq);
- return rig_set_freq(my_rig, vfo_fixup(my_rig, RIG_VFO_B, CACHE(my_rig)->split), freq);
+ return rig_set_freq(my_rig, vfo_fixup(my_rig, RIG_VFO_B, CACHE(my_rig)->split),
+ freq);
}
else if (strncmp(arg, "MD", 2) == 0)
{
commit 218385a76c0a82ef040be0a1eb5502b25c5664ed
Author: Mike Black W9MDB <mdb...@ya...>
Date: Wed May 29 17:50:10 2024 -0500
Fix ID for Xiegu X6100
diff --git a/rigs/icom/xiegu.c b/rigs/icom/xiegu.c
index 46e0ad00e..d70de0f4a 100644
--- a/rigs/icom/xiegu.c
+++ b/rigs/icom/xiegu.c
@@ -148,10 +148,10 @@ int xiegu_rig_open(RIG *rig)
if (retval == RIG_OK)
{
dump_hex(id,id_len);
- iid = (int)id[2];
- if (id[3] != 0xfd)
+ iid = (int)id[1];
+ if (id_len > 2)
{
- iid = (iid << 8) + id[3];
+ iid = (iid << 8) + id[2];
}
rig_debug(RIG_DEBUG_VERBOSE, "%s: Xiegu Radio ID=0x%04x\n", __func__, iid);
switch(iid)
@@ -160,7 +160,7 @@ int xiegu_rig_open(RIG *rig)
case 0x0090: rig_debug(RIG_DEBUG_VERBOSE, "%s: Xiegu model %s\n", __func__, "G90S");break;
case 0x0106: rig_debug(RIG_DEBUG_VERBOSE, "%s: Xiegu model %s\n", __func__, "G106/G106C");break;
case 0x6100:
- case 0xa400: rig_debug(RIG_DEBUG_VERBOSE, "%s: Xiegu model %s\n", __func__, "X6100");break;
+ case 0x00a4: rig_debug(RIG_DEBUG_VERBOSE, "%s: Xiegu model %s\n", __func__, "X6100");break;
default: rig_debug(RIG_DEBUG_VERBOSE, "%s: Xiegu model %s\n", __func__, "Unknown");break;
}
}
commit 1e3be1a88fd96e59a9715b5f04079c782eccd05d
Author: Mike Black W9MDB <mdb...@ya...>
Date: Wed May 29 17:06:36 2024 -0500
Fix Xiegu ID for G90 1-byte answer
diff --git a/rigs/icom/xiegu.c b/rigs/icom/xiegu.c
index fad83abdc..46e0ad00e 100644
--- a/rigs/icom/xiegu.c
+++ b/rigs/icom/xiegu.c
@@ -148,7 +148,11 @@ int xiegu_rig_open(RIG *rig)
if (retval == RIG_OK)
{
dump_hex(id,id_len);
- iid = (((int)id[2]) << 8) + id[3];
+ iid = (int)id[2];
+ if (id[3] != 0xfd)
+ {
+ iid = (iid << 8) + id[3];
+ }
rig_debug(RIG_DEBUG_VERBOSE, "%s: Xiegu Radio ID=0x%04x\n", __func__, iid);
switch(iid)
{
@@ -374,7 +378,7 @@ struct rig_caps x6100_caps =
RIG_MODEL(RIG_MODEL_X6100),
.model_name = "X6100",
.mfg_name = "Xiegu",
- .version = BACKEND_VER ".5",
+ .version = BACKEND_VER ".6",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
@@ -565,7 +569,7 @@ struct rig_caps g90_caps =
RIG_MODEL(RIG_MODEL_G90),
.model_name = "G90",
.mfg_name = "Xiegu",
- .version = BACKEND_VER ".10",
+ .version = BACKEND_VER ".11",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
@@ -740,7 +744,7 @@ struct rig_caps x5105_caps =
RIG_MODEL(RIG_MODEL_X5105),
.model_name = "X5105",
.mfg_name = "Xiegu",
- .version = BACKEND_VER ".1",
+ .version = BACKEND_VER ".2",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
commit 3583b077e823f0b9474353f36fee4781c1bb4940
Author: Mike Black W9MDB <mdb...@ya...>
Date: Wed May 29 06:13:59 2024 -0500
Add network_flush2 to support async messages from Flex TCP
This allow one to send a command to the Flex and process all the messages returned in the backend rather than thread.
This then gives a synchronous behavior which clients expect
diff --git a/src/network.c b/src/network.c
index 1e76c0cd3..41461c20c 100644
--- a/src/network.c
+++ b/src/network.c
@@ -379,6 +379,31 @@ int network_open(hamlib_port_t *rp, int default_port)
}
+// flush and keep what gets flushed based on stopset
+// Used by SmartSDR backend for example
+// return # of bytes read
+int network_flush2(hamlib_port_t *rp, unsigned char *stopset, char *buf, int buf_len)
+{
+ unsigned int len = 0;
+#ifdef __MINGW32__
+ int ret = ioctlsocket(rp->fd, FIONREAD, &len);
+#else
+ int ret = ioctl(rp->fd, FIONREAD, &len);
+#endif
+ if (ret != 0)
+ {
+ rig_debug(RIG_DEBUG_ERR, "%s: ioctl err '%s'\n", __func__, strerror(errno));
+ return 0;
+ }
+
+ if (len > 0) {
+ buf[0] = 0;
+ if (len > buf_len) len = buf_len-1;
+ read_string(rp, (unsigned char *)buf, len+1, (char*)stopset, 1, 0, 1);
+ }
+
+ return len;
+}
/**
* \brief Clears any data in the read buffer of the socket
*
diff --git a/src/network.h b/src/network.h
index 7dc9c517c..18ed720e7 100644
--- a/src/network.h
+++ b/src/network.h
@@ -31,6 +31,7 @@ __BEGIN_DECLS
int network_open(hamlib_port_t *p, int default_port);
int network_close(hamlib_port_t *rp);
void network_flush(hamlib_port_t *rp);
+int network_flush2(hamlib_port_t *rp, unsigned char *stopset, char *buf, int buf_len);
int network_publish_rig_poll_data(RIG *rig);
int network_publish_rig_transceive_data(RIG *rig);
int network_publish_rig_spectrum_data(RIG *rig, struct rig_spectrum_line *line);
commit be0f7407f2857ccc55ec1f18550b16644421dfb0
Author: Mike Black W9MDB <mdb...@ya...>
Date: Wed May 29 06:12:00 2024 -0500
Fix RFMETER_POWER_WATTS in dummy.c
diff --git a/rigs/dummy/dummy.c b/rigs/dummy/dummy.c
index 9f8da3406..882f30581 100644
--- a/rigs/dummy/dummy.c
+++ b/rigs/dummy/dummy.c
@@ -1258,6 +1258,7 @@ static int dummy_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv;
channel_t *curr = priv->curr;
int idx;
+ static float rfpower = 0;
ENTERFUNC;
idx = rig_setting2idx(level);
@@ -1311,6 +1312,7 @@ static int dummy_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
{
curr->levels[idx].f = (float)(time(NULL) % 32) / 64.0f + (float)(
rand() % 4) / 8.0f;
+ rfpower = curr->levels[idx].f;
}
break;
@@ -1322,9 +1324,11 @@ static int dummy_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
}
else
{
+#if 0
curr->levels[idx].f = (float)(time(NULL) % 32) / 64.0f + (float)(
rand() % 4) / 8.0f;
- curr->levels[idx].f *= 100.0f;
+#endif
+ curr->levels[idx].f = 100.0f * rfpower;
}
break;
@@ -2377,7 +2381,7 @@ struct rig_caps dummy_caps =
RIG_MODEL(RIG_MODEL_DUMMY),
.model_name = "Dummy",
.mfg_name = "Hamlib",
- .version = "20230611.0",
+ .version = "20240529.0",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_OTHER,
commit a300a73f1d584c28c0e17414445be00c716740f3
Author: Mike Black W9MDB <mdb...@ya...>
Date: Tue May 28 22:41:10 2024 -0500
Fix RIG_ELIMIT error
diff --git a/src/rotator.c b/src/rotator.c
index 51765ea5c..c601f402d 100644
--- a/src/rotator.c
+++ b/src/rotator.c
@@ -748,7 +748,7 @@ int HAMLIB_API rot_set_position(ROT *rot,
rot_debug(RIG_DEBUG_TRACE,
"%s: range problem az=%.02f(min=%.02f,max=%.02f), el=%02f(min=%.02f,max=%02f)\n",
__func__, azimuth, rs->min_az, rs->max_az, elevation, rs->min_el, rs->max_el);
- return -RIG_LIMIT;
+ return -RIG_ELIMIT;
}
if (caps->set_position == NULL)
commit 86dc5c8d6fab469ab6191502ad4f4cd7bb0b7326
Author: Mike Black W9MDB <mdb...@ya...>
Date: Tue May 28 22:36:39 2024 -0500
Add new error message for ELIMIT
diff --git a/src/rig.c b/src/rig.c
index f42aace5a..22d2363bc 100644
--- a/src/rig.c
+++ b/src/rig.c
@@ -242,7 +242,8 @@ static const char *const rigerror_table[] =
"Argument out of domain of func",
"Function deprecated",
"Security error password not provided or crypto failure",
- "Rig is not powered on"
+ "Rig is not powered on",
+ "Limit exceeded"
};
commit c730e445a14b8faf1c6112cc8fb1c2217e6c1374
Author: Mike Black W9MDB <mdb...@ya...>
Date: Tue May 28 22:35:46 2024 -0500
Add new error ELIMIT for things like rot_move that exceed set limits
diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h
index 9f52d271d..6e8419cd6 100644
--- a/include/hamlib/rig.h
+++ b/include/hamlib/rig.h
@@ -205,6 +205,7 @@ enum rig_errcode_e {
RIG_EDEPRECATED,/*!< 18 Function deprecated */
RIG_ESECURITY, /*!< 19 Security error */
RIG_EPOWER, /*!< 20 Rig not powered on */
+ RIG_ELIMIT, /*!< 21 Limit exceeded */
RIG_EEND // MUST BE LAST ITEM IN LAST
};
/**
diff --git a/src/rotator.c b/src/rotator.c
index 5dd492b18..51765ea5c 100644
--- a/src/rotator.c
+++ b/src/rotator.c
@@ -748,7 +748,7 @@ int HAMLIB_API rot_set_position(ROT *rot,
rot_debug(RIG_DEBUG_TRACE,
"%s: range problem az=%.02f(min=%.02f,max=%.02f), el=%02f(min=%.02f,max=%02f)\n",
__func__, azimuth, rs->min_az, rs->max_az, elevation, rs->min_el, rs->max_el);
- return -RIG_EINVAL;
+ return -RIG_LIMIT;
}
if (caps->set_position == NULL)
commit 04c3c03334dd250cccee9b99c808e7b9dfdf5dcb
Author: Mike Black W9MDB <mdb...@ya...>
Date: Mon May 27 23:06:37 2024 -0500
Add simft710.c
diff --git a/simulators/Makefile.am b/simulators/Makefile.am
index c08b82e17..05432a4d2 100644
--- a/simulators/Makefile.am
+++ b/simulators/Makefile.am
@@ -8,7 +8,7 @@ DISTCLEANFILES =
bin_PROGRAMS =
-check_PROGRAMS = simelecraft simicgeneric simkenwood simyaesu simic9100 simic9700 simft991 simftdx1200 simftdx3000 simjupiter simpowersdr simid5100 simft736 simftdx5000 simtmd700 simrotorez simspid simft817 simts590 simft847 simic7300 simic7000 simic7100 simic7200 simatd578 simic905 simts450 simic7600 simic7610 simic705 simts950 simts990 simic7851 simftdx101 simxiegug90 simqrplabs simft818 simic275 simtrusdx simft1000 simtmd710 simts890 simxiegux108g simxiegux6100 simic910 simft450 simelecraftk4 simmicom simflex
+check_PROGRAMS = simelecraft simicgeneric simkenwood simyaesu simic9100 simic9700 simft991 simftdx1200 simftdx3000 simjupiter simpowersdr simid5100 simft736 simftdx5000 simtmd700 simrotorez simspid simft817 simts590 simft847 simic7300 simic7000 simic7100 simic7200 simatd578 simic905 simts450 simic7600 simic7610 simic705 simts950 simts990 simic7851 simftdx101 simxiegug90 simqrplabs simft818 simic275 simtrusdx simft1000 simtmd710 simts890 simxiegux108g simxiegux6100 simic910 simft450 simelecraftk4 simmicom simflex simft710
simelecraft_SOURCES = simelecraft.c
simkenwood_SOURCES = simkenwood.c
diff --git a/simulators/simft710.c b/simulators/simft710.c
new file mode 100644
index 000000000..e136e8eab
--- /dev/null
+++ b/simulators/simft710.c
@@ -0,0 +1,624 @@
+// can run this using rigctl/rigctld and socat pty devices
+// gcc -o simyaesu simyaesu.c
+#define _XOPEN_SOURCE 700
+// since we are POSIX here we need this
+#if 0
+struct ip_mreq
+{
+ int dummy;
+};
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <fcntl.h>
+#include <string.h>
+#include <unistd.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';
+int ks = 20;
+int bandselect = 5;
+int width = 21;
+int narrow = 0;
+int vd = 0;
+int sm0 = 0;
+int sm1 = 0;
+int vs = 0;
+int vx = 0;
+int pa = 0;
+int ra = 0;
+int ag = 0;
+int pc = 100;
+int is = 0;
+int bp_on = 0;
+int bp_pos = 0;
+int rl = 0;
+int nb = 0;
+int nr = 0;
+int tx = 0;
+int mg = 0;
+int rg = 100;
+int vg = 0;
+int kr = 0;
+int bi = 0;
+int gt = 0;
+int ex016 = 0;
+int ex020 = 0;
+int st = 0;
+
+// ID 0310 == 310, Must drop leading zero
+typedef enum nc_rigid_e
+{
+ NC_RIGID_NONE = 0,
+ NC_RIGID_FT450 = 241,
+ NC_RIGID_FT450D = 244,
+ NC_RIGID_FT950 = 310,
+ NC_RIGID_FT891 = 135,
+ NC_RIGID_FT991 = 135,
+ NC_RIGID_FT2000 = 251,
+ NC_RIGID_FT2000D = 252,
+ NC_RIGID_FTDX1200 = 583,
+ NC_RIGID_FTDX9000D = 101,
+ NC_RIGID_FTDX9000Contest = 102,
+ NC_RIGID_FTDX9000MP = 103,
+ NC_RIGID_FTDX5000 = 362,
+ NC_RIGID_FTDX3000 = 460,
+ NC_RIGID_FTDX101D = 681,
+ NC_RIGID_FTDX101MP = 682,
+ NC_RIGID_FT710 = 800
+} nc_rigid_t;
+
+int
+getmyline(int fd, char *buf)
+{
+ char c;
+ int i = 0;
+ memset(buf, 0, BUFSIZE);
+
+ while (read(fd, &c, 1) > 0)
+ {
+ buf[i++] = c;
+
+ if (c == ';') { return strlen(buf); }
+ }
+
+ if (strlen(buf) == 0) { hl_usleep(10 * 1000); }
+
+ return strlen(buf);
+}
+
+#if defined(WIN32) || defined(_WIN32)
+int openPort(char *comport) // doesn't matter for using pts devices
+{
+ int fd;
+ fd = open(comport, O_RDWR);
+
+ if (fd < 0)
+ {
+ perror(comport);
+ }
+
+ return fd;
+}
+
+#else
+int openPort(char *comport) // doesn't matter for using pts devices
+{
+ int fd = posix_openpt(O_RDWR);
+ char *name = ptsname(fd);
+
+ if (name == NULL)
+ {
+ perror("pstname");
+ return -1;
+ }
+
+ printf("name=%s\n", name);
+
+ if (fd == -1 || grantpt(fd) == -1 || unlockpt(fd) == -1)
+ {
+ perror("posix_openpt");
+ return -1;
+ }
+
+ return fd;
+}
+#endif
+
+
+
+int main(int argc, char *argv[])
+{
+ char buf[256];
+ char *pbuf;
+ int n;
+ int fd = openPort(argv[1]);
+
+ while (1)
+ {
+ if (getmyline(fd, buf))
+ {
+// printf("Cmd:%s\n", buf);
+ }
+ else { continue; }
+
+ if (strcmp(buf, ";") == 0)
+ {
+ pbuf = "?;";
+ n = write(fd, pbuf, strlen(pbuf));
+ }
+ else if (strcmp(buf, "RM4;") == 0)
+ {
+ hl_usleep(50 * 1000);
+ pbuf = "RM4100;";
+ n = write(fd, pbuf, strlen(pbuf));
+
+ if (n <= 0) { perror("RM4"); }
+ }
+ else if (strcmp(buf, "RM5;") == 0)
+ {
+ static int power = 0;
+ power+=5;
+ if (power > 255) power = 0;
+ hl_usleep(50 * 1000);
+ snprintf(buf,sizeof(buf),"RM5%03d000;", power);
+ n = write(fd, buf, strlen(buf));
+
+ if (n <= 0) { perror("RM5"); }
+ }
+ else if (strcmp(buf, "RM6;") == 0)
+ {
+ hl_usleep(50 * 1000);
+ pbuf = "AN030;";
+ n = write(fd, pbuf, strlen(pbuf));
+
+ if (n <= 0) { perror("AN"); }
+ }
+ else if (strcmp(buf, "IF;") == 0)
+ {
+ hl_usleep(50 * 1000);
+ pbuf = "IF059014200000+000000700000;";
+ n = write(fd, pbuf, strlen(pbuf));
+
+ if (n <= 0) { perror("IF"); }
+ }
+ else if (strcmp(buf, "FA;") == 0)
+ {
+ SNPRINTF(buf, sizeof(buf), "FA%08.0f;", freqA);
+ n = write(fd, buf, strlen(buf));
+ }
+ else if (strncmp(buf, "FA", 2) == 0)
+ {
+ sscanf(buf, "FA%f", &freqA);
+ }
+ else if (strcmp(buf, "FB;") == 0)
+ {
+ SNPRINTF(buf, sizeof(buf), "FB%08.0f;", freqB);
+ n = write(fd, buf, strlen(buf));
+ }
+ else if (strncmp(buf, "FB", 2) == 0)
+ {
+ sscanf(buf, "FB%f", &freqB);
+ }
+ else if (strcmp(buf, "ID;") == 0)
+ {
+ hl_usleep(50 * 1000);
+ int id = NC_RIGID_FT710;
+ SNPRINTF(buf, sizeof(buf), "ID%03d;", id);
+ n = write(fd, buf, strlen(buf));
+
+ if (n <= 0) { perror("ID"); }
+ }
+ else if (strcmp(buf, "PS;") == 0)
+ {
+ SNPRINTF(buf, sizeof(buf), "PS1;");
+ n = write(fd, buf, strlen(buf));
+ }
+ else if (strcmp(buf, "AI;") == 0)
+ {
+ hl_usleep(50 * 1000);
+ SNPRINTF(buf, sizeof(buf), "AI0;");
+ n = write(fd, buf, strlen(buf));
+
+ if (n <= 0) { perror("ID"); }
+ }
+ else if (strcmp(buf, "AI0;") == 0)
+ {
+ hl_usleep(50 * 1000);
+ }
+ else if (strcmp(buf, "FT;") == 0)
+ {
+ hl_usleep(50 * 1000);
+ SNPRINTF(buf, sizeof(buf), "FT%c;", tx_vfo);
+ n = write(fd, buf, strlen(buf));
+
+ if (n < 0) { perror("FT"); }
+ }
+ else if (strncmp(buf, "FT", 2) == 0)
+ {
+ tx_vfo = buf[2];
+ }
+ else if (strcmp(buf, "MD0;") == 0)
+ {
+ printf("MD=%s\n", buf);
+ hl_usleep(50 * 1000);
+ SNPRINTF(buf, sizeof(buf), "MD0%c;", modeA);
+ n = write(fd, buf, strlen(buf));
+
+ if (n < 0) { perror("MD0;"); }
+ }
+ else if (strncmp(buf, "MD0", 3) == 0)
+ {
+ modeA = buf[3];
+ }
+ else if (strcmp(buf, "MD1;") == 0)
+ {
+ hl_usleep(50 * 1000);
+ SNPRINTF(buf, sizeof(buf), "MD1%c;", modeB);
+ n = write(fd, buf, strlen(buf));
+
+ if (n < 0) { perror("MD0;"); }
+ }
+ else if (strncmp(buf, "MD1", 3) == 0)
+ {
+ modeB = buf[3];
+ }
+
+
+
+#if 0
+ else if (strncmp(buf, "AI", 2) == 0)
+ {
+ if (strcmp(buf, "AI;"))
+ {
+ hl_usleep(50 * 1000);
+ n = fprintf(fp, "%s", "AI0;");
+
+ if (n <= 0) { perror("AI"); }
+ }
+ }
+
+#endif
+ else if (strcmp(buf, "VS;") == 0)
+ {
+ hl_usleep(50 * 1000);
+ SNPRINTF(buf, sizeof(buf), "VS%d;", vs);
+ n = write(fd, buf, strlen(buf));
+
+ if (n < 0) { perror("VS"); }
+ }
+ else if (strncmp(buf, "VS", 2) == 0)
+ {
+ sscanf(buf, "VS%d", &vs);
+ }
+ else if (strcmp(buf, "KR;") == 0)
+ {
+ hl_usleep(50 * 1000);
+ SNPRINTF(buf, sizeof(buf), "KR%d;", kr);
+ n = write(fd, buf, strlen(buf));
+
+ if (n < 0) { perror("KR"); }
+ }
+ else if (strncmp(buf, "KR", 2) == 0)
+ {
+ sscanf(buf, "KR%d", &kr);
+ }
+ else if (strcmp(buf, "BI;") == 0)
+ {
+ hl_usleep(50 * 1000);
+ SNPRINTF(buf, sizeof(buf), "BI%d;", bi);
+ n = write(fd, buf, strlen(buf));
+
+ if (n < 0) { perror("BI"); }
+ }
+ else if (strncmp(buf, "BI", 2) == 0)
+ {
+ sscanf(buf, "BI%d", &bi);
+ }
+ else if (strcmp(buf, "VX;") == 0)
+ {
+ hl_usleep(50 * 1000);
+ SNPRINTF(buf, sizeof(buf), "VX%d;", vx);
+ n = write(fd, buf, strlen(buf));
+
+ if (n < 0) { perror("VX"); }
+ }
+ else if (strncmp(buf, "VX", 2) == 0)
+ {
+ sscanf(buf, "VX%d", &vx);
+ }
+
+ else if (strcmp(buf, "PA;") == 0)
+ {
+ hl_usleep(50 * 1000);
+ SNPRINTF(buf, sizeof(buf), "PA%d;", pa);
+ n = write(fd, buf, strlen(buf));
+
+ if (n < 0) { perror("PA"); }
+ }
+ else if (strncmp(buf, "PA", 2) == 0)
+ {
+ sscanf(buf, "PA%d", &vs);
+ }
+ else if (strcmp(buf, "RA;") == 0)
+ {
+ hl_usleep(50 * 1000);
+ SNPRINTF(buf, sizeof(buf), "RA%d;", ra);
+ n = write(fd, buf, strlen(buf));
+
+ if (n < 0) { perror("RA"); }
+ }
+ else if (strncmp(buf, "RA", 2) == 0)
+ {
+ sscanf(buf, "RA%d", &ra);
+ }
+ else if (strcmp(buf, "AG;") == 0)
+ {
+ hl_usleep(50 * 1000);
+ SNPRINTF(buf, sizeof(buf), "AG%d;", ag);
+ n = write(fd, buf, strlen(buf));
+
+ if (n < 0) { perror("AG"); }
+ }
+ else if (strncmp(buf, "AG", 2) == 0)
+ {
+ sscanf(buf, "AG%d", &ag);
+ }
+ else if (strcmp(buf, "PC;") == 0)
+ {
+ hl_usleep(50 * 1000);
+ SNPRINTF(buf, sizeof(buf), "PC%03d;", pc);
+ n = write(fd, buf, strlen(buf));
+
+ if (n < 0) { perror("PC"); }
+ }
+ else if (strncmp(buf, "PC", 2) == 0)
+ {
+ sscanf(buf, "PC%d", &pc);
+ }
+ else if (strcmp(buf, "VG;") == 0)
+ {
+ hl_usleep(50 * 1000);
+ SNPRINTF(buf, sizeof(buf), "VG%03d;", vg);
+ n = write(fd, buf, strlen(buf));
+
+ if (n < 0) { perror("VG"); }
+ }
+ else if (strncmp(buf, "VG", 2) == 0)
+ {
+ sscanf(buf, "VG%d", &vg);
+ }
+ else if (strcmp(buf, "RG0;") == 0)
+ {
+ hl_usleep(50 * 1000);
+ SNPRINTF(buf, sizeof(buf), "RG0%03d;", rg);
+ n = write(fd, buf, strlen(buf));
+
+ if (n < 0) { perror("RG"); }
+ }
+ else if (strncmp(buf, "RG", 2) == 0)
+ {
+ sscanf(buf, "RG0%d", &rg);
+ }
+ else if (strcmp(buf, "GT0;") == 0)
+ {
+ hl_usleep(50 * 1000);
+ SNPRINTF(buf, sizeof(buf), "GT0%0d;", gt);
+ n = write(fd, buf, strlen(buf));
+
+ if (n < 0) { perror("GT"); }
+ }
+ else if (strncmp(buf, "GT", 2) == 0)
+ {
+ sscanf(buf, "GT0%d", >);
+ }
+ else if (strcmp(buf, "TX;") == 0)
+ {
+ hl_usleep(50 * 1000);
+ SNPRINTF(buf, sizeof(buf), "TX+%04d;", tx);
+ n = write(fd, buf, strlen(buf));
+
+ if (n < 0) { perror("TX"); }
+ }
+ else if (strncmp(buf, "TX", 2) == 0)
+ {
+ sscanf(buf, "TX%d", &tx);
+ }
+ else if (strcmp(buf, "IS;") == 0)
+ {
+ hl_usleep(50 * 1000);
+ SNPRINTF(buf, sizeof(buf), "IS+%04d;", is);
+ n = write(fd, buf, strlen(buf));
+
+ if (n < 0) { perror("IS"); }
+ }
+ else if (strncmp(buf, "IS", 2) == 0)
+ {
+ sscanf(buf, "IS%d", &is);
+ }
+ else if (strcmp(buf, "RL0;") == 0)
+ {
+ hl_usleep(50 * 1000);
+ SNPRINTF(buf, sizeof(buf), "RL0%d;", rl);
+ n = write(fd, buf, strlen(buf));
+
+ if (n < 0) { perror("RL"); }
+ }
+ else if (strncmp(buf, "RL", 2) == 0)
+ {
+ sscanf(buf, "RL0%02d", &rl);
+ }
+ else if (strcmp(buf, "BP00;") == 0)
+ {
+ hl_usleep(50 * 1000);
+ SNPRINTF(buf, sizeof(buf), "BP0%d;", bp_on);
+ n = write(fd, buf, strlen(buf));
+
+ if (n < 0) { perror("BP"); }
+ }
+ else if (strncmp(buf, "BP00", 4) == 0)
+ {
+ sscanf(buf, "BP00%d", &bp_on);
+ }
+ else if (strcmp(buf, "BP01;") == 0)
+ {
+ hl_usleep(50 * 1000);
+ SNPRINTF(buf, sizeof(buf), "BP0%d;", bp_pos);
+ n = write(fd, buf, strlen(buf));
+
+ if (n < 0) { perror("BP"); }
+ }
+ else if (strncmp(buf, "BP01", 4) == 0)
+ {
+ sscanf(buf, "BP01%d", &bp_pos);
+ }
+ else if (strcmp(buf, "NB0;") == 0)
+ {
+ hl_usleep(50 * 1000);
+ SNPRINTF(buf, sizeof(buf), "NB0%d;", nb);
+ n = write(fd, buf, strlen(buf));
+
+ if (n < 0) { perror("NB"); }
+ }
+ else if (strncmp(buf, "NB0", 3) == 0)
+ {
+ sscanf(buf, "NB0%d", &nb);
+ }
+ else if (strcmp(buf, "NR0;") == 0)
+ {
+ hl_usleep(50 * 1000);
+ SNPRINTF(buf, sizeof(buf), "NR0%d;", nr);
+ n = write(fd, buf, strlen(buf));
+
+ if (n < 0) { perror("NR"); }
+ }
+ else if (strncmp(buf, "NR0", 3) == 0)
+ {
+ sscanf(buf, "NR0%d", &nr);
+ }
+
+
+ else if (strcmp(buf, "EX032;") == 0)
+ {
+ static int ant = 0;
+ ant = (ant + 1) % 3;
+ hl_usleep(50 * 1000);
+ SNPRINTF(buf, sizeof(buf), "EX032%1d;", ant);
+ n = write(fd, buf, strlen(buf));
+
+ if (n < 0) { perror("EX032"); }
+ }
+ else if (strcmp(buf, "EX016;") == 0)
+ {
+ hl_usleep(50 * 1000);
+ SNPRINTF(buf, sizeof(buf), "EX016%04d;", ex016);
+ n = write(fd, buf, strlen(buf));
+
+ if (n < 0) { perror("EX016"); }
+ }
+ else if (strcmp(buf, "EX020;") == 0)
+ {
+ hl_usleep(50 * 1000);
+ SNPRINTF(buf, sizeof(buf), "EX020%04d;", ex020);
+ n = write(fd, buf, strlen(buf));
+
+ if (n < 0) { perror("EX016"); }
+ }
+ else if (strncmp(buf, "EX020", 5) == 0)
+ {
+ sscanf(buf, "EX020%d\n", &ex020);
+ }
+ else if (strncmp(buf, "KS;", 3) == 0)
+ {
+ sprintf(buf, "KS%d;", ks);
+ n = write(fd, buf, strlen(buf));
+ }
+ else if (strncmp(buf, "KS", 2) == 0)
+ {
+ sscanf(buf, "KS%03d", &ks);
+ }
+ else if (strncmp(buf, "MG;", 3) == 0)
+ {
+ sprintf(buf, "MG%03d;", mg);
+ n = write(fd, buf, strlen(buf));
+ }
+ else if (strncmp(buf, "MG", 2) == 0)
+ {
+ sscanf(buf, "MG%03d", &mg);
+ }
+ else if (strncmp(buf, "BS;", 3) == 0) // cannot query BS
+ {
+ sprintf(buf, "BS%02d;", bandselect);
+ n = write(fd, buf, strlen(buf));
+ }
+ else if (strncmp(buf, "SH0;", 4) == 0)
+ {
+ sprintf(buf, "SH0%02d;", width);
+ n = write(fd, buf, strlen(buf));
+ }
+ else if (strncmp(buf, "SH0", 3) == 0)
+ {
+ sscanf(buf, "SH0%02d", &width);
+ }
+ else if (strncmp(buf, "NA0;", 4) == 0)
+ {
+ sprintf(buf, "NA0%d;", narrow);
+ n = write(fd, buf, strlen(buf));
+ }
+ else if (strncmp(buf, "NA0", 3) == 0)
+ {
+ sscanf(buf, "NA0%d", &narrow);
+ }
+ else if (strncmp(buf, "VD;", 3) == 0)
+ {
+ sprintf(buf, "VD%d;", vd);
+ n = write(fd, buf, strlen(buf));
+ }
+ else if (strncmp(buf, "VD", 2) == 0)
+ {
+ sscanf(buf, "VD%d", &vd);
+ }
+ else if (strncmp(buf, "SM0;", 4) == 0)
+ {
+ sprintf(buf, "SM0%d;", sm0);
+ n = write(fd, buf, strlen(buf));
+ }
+ else if (strncmp(buf, "SM0", 3) == 0)
+ {
+ sscanf(buf, "SM0%3d", &sm0);
+ }
+ else if (strncmp(buf, "SM1;", 4) == 0)
+ {
+ sprintf(buf, "SM1%d;", sm1);
+ n = write(fd, buf, strlen(buf));
+ }
+ else if (strncmp(buf, "SM1", 3) == 0)
+ {
+ sscanf(buf, "SM1%3d", &sm1);
+ }
+ else if (strncmp(buf, "ST1", 3) == 0)
+ {
+ sscanf(buf, "ST1%3d", &st);
+ }
+ else if (strncmp(buf, "ST;", 3) == 0)
+ {
+ sprintf(buf,"ST%d;", st);
+ n = write(fd, buf, strlen(buf));
+ }
+ else if (strlen(buf) > 0)
+ {
+ fprintf(stderr, "Unknown command: %s\n", buf);
+ }
+
+ }
+
+ return 0;
+}
commit 2de9778f27a7d614cfe33d8af6f6ff2d1b78e444
Author: Mike Black W9MDB <mdb...@ya...>
Date: Mon May 27 22:59:54 2024 -0500
Add RFPOWER_METER and WATTS to py3test.py
diff --git a/bindings/py3test.py b/bindings/py3test.py
index 91b7e2f14..52f85e1e7 100755
--- a/bindings/py3test.py
+++ b/bindings/py3test.py
@@ -73,6 +73,8 @@ def StartUp():
Hamlib.rigerror(my_rig.error_status)))
print("AF level:\t\t%0.2f" % my_rig.get_level_f(Hamlib.RIG_LEVEL_AF))
+ print("Power level:\t\t%0.2f" % my_rig.get_level_f(Hamlib.RIG_LEVEL_RFPOWER_METER))
+ print("Power level Watts:\t\t%0.2f" % my_rig.get_level_f(Hamlib.RIG_LEVEL_RFPOWER_METER_WATTS))
print("strength:\t\t%s" % my_rig.get_level_i(Hamlib.RIG_LEVEL_STRENGTH))
print("status:\t\t\t%s" % my_rig.error_status)
print("status(str):\t\t%s" % Hamlib.rigerror(my_rig.error_status))
commit a721c04c536c0f7301608f49dcccbb1c03152f58
Merge: a5f53bbcf f53dc9905
Author: Michael Black <mdb...@ya...>
Date: Mon May 27 22:13:00 2024 -0500
Merge pull request #1557 from GeoBaltz/fix12
Normalize some debug/trace output.
commit f53dc99057869642b896c4743a99335900cfb39b
Author: George Baltz N3GB <Geo...@gm...>
Date: Mon May 27 20:31:46 2024 -0400
Normalize some debug/trace output.
Make spaces(len) actually return a string of length 'len', not len + 1.
Eliminate static writable memory and a 256 byte write on each debug/trace
call.
Make the depth stars line up.
diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h
index fc360c692..9f52d271d 100644
--- a/include/hamlib/rig.h
+++ b/include/hamlib/rig.h
@@ -33,7 +33,7 @@
// Our shared secret password
#define HAMLIB_SECRET_LENGTH 32
-#define HAMLIB_TRACE rig_debug(RIG_DEBUG_TRACE,"%s%s(%d) trace\n",spaces(rig->state.depth-1), __FILE__, __LINE__)
+#define HAMLIB_TRACE rig_debug(RIG_DEBUG_TRACE,"%s%s(%d) trace\n",spaces(rig->state.depth), __FILE__, __LINE__)
#define __FILENAME__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
#include <stdio.h>
@@ -3738,7 +3738,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(rig->state.depth-1), rig->state.depth, __func__, elapsed_ms(&__begin, HAMLIB_ELAPSED_GET));
+#define ELAPSED2 rig_debug(RIG_DEBUG_VERBOSE, "%s%d:%s: elapsed=%.0lfms\n", spaces(rig->state.depth), rig->state.depth, __func__, elapsed_ms(&__begin, HAMLIB_ELAPSED_GET));
// use this instead of snprintf for automatic detection of buffer limit
#define SNPRINTF(s,n,...) { snprintf(s,n,##__VA_ARGS__);if (strlen(s) > n-1) fprintf(stderr,"****** %s(%d): buffer overflow ******\n", __func__, __LINE__); }
diff --git a/src/misc.c b/src/misc.c
index e7bdb2c02..8d17baf6b 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -2857,26 +2857,21 @@ 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 char s[256];
- memset(s, '*', sizeof(s));
+ static const char s[MAX_SPACES + 1] =
+ "****************************************************************"
+ "****************************************************************"
+ "****************************************************************"
+ "****************************************************************";
- if (len > 255)
+ if (len < 0 || len > MAX_SPACES)
{
len = 0;
}
- if (len > 0)
- {
- s[len + 1] = 0;
- }
- else
- {
- s[1] = 0;
- }
-
- return s;
+ return &s[MAX_SPACES - len];
}
// if which==0 rig_band_select str will be returned
commit a5f53bbcf68ba5fea29a40efbda357f109897663
Author: Mike Black W9MDB <mdb...@ya...>
Date: Mon May 27 16:11:38 2024 -0500
Change TS590 to Handshake=None -- it's not required and the rig can be in a state where RTS causes transmit.
diff --git a/rigs/kenwood/ts590.c b/rigs/kenwood/ts590.c
index f38b46418..b71181518 100644
--- a/rigs/kenwood/ts590.c
+++ b/rigs/kenwood/ts590.c
@@ -1725,7 +1725,7 @@ struct rig_caps ts590_caps =
.serial_data_bits = 8,
.serial_stop_bits = 1,
.serial_parity = RIG_PARITY_NONE,
- .serial_handshake = RIG_HANDSHAKE_HARDWARE,
+ .serial_handshake = RIG_HANDSHAKE_NONE,
.write_delay = 0,
.post_write_delay = 0,
.timeout = 500,
@@ -2119,7 +2119,7 @@ struct rig_caps ts590sg_caps =
.serial_data_bits = 8,
.serial_stop_bits = 1,
.serial_parity = RIG_PARITY_NONE,
- .serial_handshake = RIG_HANDSHAKE_HARDWARE,
+ .serial_handshake = RIG_HANDSHAKE_NONE,
.write_delay = 0,
.post_write_delay = 0,
.timeout = 500,
commit 18568986f85688a6a2d6ae89c950af94dea6be2f
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sat May 25 11:38:16 2024 -0500
Fix port override
diff --git a/src/conf.c b/src/conf.c
index 9e1e83e2a..2807710b2 100644
--- a/src/conf.c
+++ b/src/conf.c
@@ -262,7 +262,7 @@ static int frontend_set_conf(RIG *rig, hamlib_token_t token, const char *val)
char *val2 = strdup(val);
char *p = strchr(val2,':'); // port in here?
if (p) {
- p = 0; // terminate it
+ *p = 0; // terminate it
rig_debug(RIG_DEBUG_WARN, "%s: overriding port and changing to 4992\n", __func__);
}
sprintf(rs->rigport_deprecated.pathname, "%s:%s", val2, "4992");
-----------------------------------------------------------------------
Summary of changes:
bindings/py3test.py | 2 +
doc/man1/rotctl.1 | 5 +-
doc/man1/rotctld.1 | 5 +-
include/hamlib/rig.h | 5 +-
include/hamlib/rotator.h | 120 ++++++++++++++++++++++++++++++++++
rigs/dummy/dummy.c | 8 ++-
rigs/dummy/rot_dummy.c | 16 +++++
rigs/flexradio/README | 1 +
rigs/icom/xiegu.c | 14 ++--
rigs/kenwood/ts590.c | 4 +-
rotators/spid/spid.c | 47 +++++++++++--
simulators/Makefile.am | 2 +-
simulators/simflex.c | 2 +
simulators/{simft450.c => simft710.c} | 23 +++++--
src/conf.c | 2 +-
src/misc.c | 21 +++---
src/network.c | 25 +++++++
src/network.h | 1 +
src/rig.c | 3 +-
src/rotator.c | 7 +-
tests/rigctlcom.c | 61 ++++++++++-------
tests/rotctl_parse.c | 16 +++++
22 files changed, 324 insertions(+), 66 deletions(-)
create mode 100644 rigs/flexradio/README
copy simulators/{simft450.c => simft710.c} (96%)
hooks/post-receive
--
Hamlib -- Ham radio control libraries
|
|
From: n0nb <n0...@us...> - 2024-05-15 21:41:21
|
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 cd453b5b7167392cfdfd2e748bafc74334af4c7f (commit)
from 9e816e37ff87c4a6b434014b49dc2d8d7a6d60a3 (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 cd453b5b7167392cfdfd2e748bafc74334af4c7f
Author: Mike Black W9MDB <mdb...@ya...>
Date: Tue May 14 10:27:39 2024 -0500
Reduce verbose level on debug to VERBOSE instead of ERR in newcat.c
diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c
index 5b5665543..85a20865c 100644
--- a/rigs/yaesu/newcat.c
+++ b/rigs/yaesu/newcat.c
@@ -1332,7 +1332,7 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
// just drop through
}
- rig_debug(RIG_DEBUG_ERR, "%s: is_ft991=%d, CACHE(rig)->split=%d, vfo=%s\n",
+ rig_debug(RIG_DEBUG_VERBOSE, "%s: is_ft991=%d, CACHE(rig)->split=%d, vfo=%s\n",
__func__, is_ft991, cachep->split, rig_strvfo(vfo));
if (priv->band_index < 0) { priv->band_index = newcat_band_index(freq); }
-----------------------------------------------------------------------
Summary of changes:
rigs/yaesu/newcat.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
hooks/post-receive
--
Hamlib -- Ham radio control libraries
|
|
From: n0nb <n0...@us...> - 2024-05-13 20:27:15
|
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 9e816e37ff87c4a6b434014b49dc2d8d7a6d60a3 (commit)
via efbe36570148bb17da5f44af6c1482d77166d8ba (commit)
via c06255d364574b312858200fd11d3710708edf5b (commit)
via 1988b7cf4fa901687635f4463f2bf959e288b493 (commit)
via ee6b89d45bd2f0e42d40cd974d79d6ae697e50bc (commit)
via 3c4b1a83f8f5afa5af2c838bc5a3bb4c4ebb1d3e (commit)
via 37df9e93bd0267b2dd967ccb40741154430476cf (commit)
via 2d30291caa23b17b1177b3f219e5ba37d3be5f25 (commit)
via 64a119367d1fd156088e865c7108ba8d85e600ad (commit)
via d71f7a93857a2eb1b551b13b5b6add03cbbe0b4e (commit)
via 09fbc4cb64895925e3a00ec8d314f6b3e275ad7f (commit)
via cf91e96333979368a0bde89d5c31b7ed4f39bce5 (commit)
from 8221961de2e24121482e72959c77c27edaa74740 (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 9e816e37ff87c4a6b434014b49dc2d8d7a6d60a3
Merge: c06255d36 efbe36570
Author: Michael Black <mdb...@ya...>
Date: Sun May 12 14:37:50 2024 -0500
Merge pull request #1551 from Hamlib/revert-1539-libgpiod
Revert "Refactoring GPIO push-to-talk logic to use libgpiod rather than the d…"
commit efbe36570148bb17da5f44af6c1482d77166d8ba
Author: Michael Black <mdb...@ya...>
Date: Sun May 12 14:37:23 2024 -0500
Revert "Refactoring GPIO push-to-talk logic to use libgpiod rather than the d…"
diff --git a/configure.ac b/configure.ac
index 77bb0cc4b..cfcd2eb1f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -529,9 +529,6 @@ AS_IF([test x"${cf_with_xml_support}" = "xyes"], [
AC_SUBST([LIBXML2_LIBS])
AC_SUBST([LIBXML2_CFLAGS])
-# TODO: I don't know how to use autoconf
-LIBS="$LIBS -lgpiod"
-
## ----------------- ##
## Language bindings ##
diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h
index a03890f8e..fc360c692 100644
--- a/include/hamlib/rig.h
+++ b/include/hamlib/rig.h
@@ -2340,7 +2340,6 @@ typedef struct hamlib_port {
int fd; /*!< File descriptor */
void *handle; /*!< handle for USB */
- void *gpio; /*!< handle for GPIO */
int write_delay; /*!< Delay between each byte sent out, in mS */
int post_write_delay; /*!< Delay between each commands send out, in mS */
diff --git a/src/gpio.c b/src/gpio.c
index 88bfd305f..e5fcfb597 100644
--- a/src/gpio.c
+++ b/src/gpio.c
@@ -19,91 +19,135 @@
*
*/
-#include "gpio.h"
-
-#include <errno.h>
-#include <fcntl.h>
#include <string.h>
-#include <sys/stat.h>
-#include <sys/types.h>
+#include <errno.h>
#include <unistd.h>
-#include <gpiod.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
-#ifndef GPIOD_PATH
-// This is what's used on the Raspberry Pi 4; I'm not sure about others
-#define GPIO_CHIP_NAME "gpiochip0"
-#endif
+#include "gpio.h"
-#define GPIO_CHIP_CONSUMER "Hamlib"
int gpio_open(hamlib_port_t *port, int output, int on_value)
{
- struct gpiod_chip *chip;
- struct gpiod_line *line;
+ char pathname[HAMLIB_FILPATHLEN * 2];
+ FILE *fexp, *fdir;
+ int fd;
+ char *dir;
port->parm.gpio.on_value = on_value;
- chip = gpiod_chip_open_by_name(GPIO_CHIP_NAME);
+ SNPRINTF(pathname, HAMLIB_FILPATHLEN, "/sys/class/gpio/export");
+ fexp = fopen(pathname, "w");
- if (!chip)
+ if (!fexp)
{
- rig_debug(RIG_DEBUG_ERR, "Failed to open GPIO chip %s: %s\n", GPIO_CHIP_NAME, strerror(errno));
+ rig_debug(RIG_DEBUG_ERR,
+ "Export GPIO%s (using %s): %s\n",
+ port->pathname,
+ pathname,
+ strerror(errno));
return -RIG_EIO;
}
- line = gpiod_chip_get_line(chip, atoi(port->pathname));
- if (!line)
+ fprintf(fexp, "%s\n", port->pathname);
+ fclose(fexp);
+
+ SNPRINTF(pathname,
+ sizeof(pathname),
+ "/sys/class/gpio/gpio%s/direction",
+ port->pathname);
+ fdir = fopen(pathname, "w");
+
+ if (!fdir)
{
- rig_debug(RIG_DEBUG_ERR, "Failed to acquire GPIO%s: %s\n", port->pathname, strerror(errno));
- gpiod_chip_close(chip);
+ rig_debug(RIG_DEBUG_ERR,
+ "GPIO%s direction (using %s): %s\n",
+ port->pathname,
+ pathname,
+ strerror(errno));
return -RIG_EIO;
}
- if ((output && gpiod_line_request_output(line, GPIO_CHIP_CONSUMER, 0) < 0) ||
- (!output && gpiod_line_request_input(line, GPIO_CHIP_CONSUMER) < 0))
+ dir = output ? "out" : "in";
+ rig_debug(RIG_DEBUG_VERBOSE, "Setting direction of GPIO%s to %s\n",
+ port->pathname, dir);
+ fprintf(fdir, "%s\n", dir);
+ fclose(fdir);
+
+ SNPRINTF(pathname,
+ sizeof(pathname),
+ "/sys/class/gpio/gpio%s/value",
+ port->pathname);
+ fd = open(pathname, O_RDWR);
+
+ if (fd < 0)
{
- rig_debug(RIG_DEBUG_ERR, "Failed to set GPIO%s to %s mode: %s\n",
- port->pathname, (output ? "OUTPUT" : "INPUT"), strerror(errno));
- gpiod_line_release(line);
- gpiod_chip_close(chip);
+ rig_debug(RIG_DEBUG_ERR,
+ "GPIO%s opening value file %s: %s\n",
+ port->pathname,
+ pathname,
+ strerror(errno));
return -RIG_EIO;
}
- port->gpio = line;
-
- return RIG_OK;
+ port->fd = fd;
+ return fd;
}
+
int gpio_close(hamlib_port_t *port)
{
- gpiod_line_close_chip((struct gpiod_line*)port->gpio);
- return RIG_OK;
+ int retval;
+ char pathname[HAMLIB_FILPATHLEN * 2];
+ FILE *fexp;
+
+ retval = close(port->fd);
+
+ SNPRINTF(pathname, HAMLIB_FILPATHLEN, "/sys/class/gpio/unexport");
+ fexp = fopen(pathname, "w");
+
+ if (!fexp)
+ {
+ rig_debug(RIG_DEBUG_ERR,
+ "Export GPIO%s (using %s): %s\n",
+ port->pathname,
+ pathname,
+ strerror(errno));
+ return -RIG_EIO;
+ }
+
+ fprintf(fexp, "%s\n", port->pathname);
+ fclose(fexp);
+ return retval;
}
+
int gpio_ptt_set(hamlib_port_t *port, ptt_t pttx)
{
- int result = 0;
+ char *val;
port->parm.gpio.value = pttx != RIG_PTT_OFF;
- if ((port->parm.gpio.value && port->parm.gpio.on_value) ||
- (!port->parm.gpio.value && !port->parm.gpio.on_value))
+ if ((port->parm.gpio.value && port->parm.gpio.on_value)
+ || (!port->parm.gpio.value && !port->parm.gpio.on_value))
{
- result = gpiod_line_set_value((struct gpiod_line*)port->gpio, 1);
+ val = "1\n";
}
else
{
- result = gpiod_line_set_value((struct gpiod_line*)port->gpio, 0);
+ val = "0\n";
}
- if (result)
+ if (write(port->fd, val, strlen(val)) <= 0)
{
- rig_debug(RIG_DEBUG_ERR, "Failed to set the value of GPIO%s: %s\n", port->pathname, strerror(errno));
return -RIG_EIO;
}
return RIG_OK;
}
+
int gpio_ptt_get(hamlib_port_t *port, ptt_t *pttx)
{
if (port->parm.gpio.value)
@@ -120,15 +164,21 @@ int gpio_ptt_get(hamlib_port_t *port, ptt_t *pttx)
int gpio_dcd_get(hamlib_port_t *port, dcd_t *dcdx)
{
- int val = gpiod_line_get_value((struct gpiod_line*)port->gpio);
- if (val < 0)
+ char val;
+ int port_value;
+
+ lseek(port->fd, 0, SEEK_SET);
+
+ if (read(port->fd, &val, sizeof(val)) <= 0)
{
- rig_debug(RIG_DEBUG_ERR, "Failed to read the value of GPIO%s: %s\n", port->pathname, strerror(errno));
+ return -RIG_EIO;
}
rig_debug(RIG_DEBUG_VERBOSE, "DCD GPIO pin value: %c\n", val);
- if (val == port->parm.gpio.on_value)
+ port_value = val - '0';
+
+ if (port_value == port->parm.gpio.on_value)
{
*dcdx = RIG_DCD_ON;
}
commit c06255d364574b312858200fd11d3710708edf5b
Merge: 1988b7cf4 cf91e9633
Author: Michael Black <mdb...@ya...>
Date: Sun May 12 11:41:31 2024 -0500
Merge pull request #1539 from aschuhardt/libgpiod
Refactoring GPIO push-to-talk logic to use libgpiod rather than the d…
commit 1988b7cf4fa901687635f4463f2bf959e288b493
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sat May 11 17:31:38 2024 -0500
Update simelecraft.c
diff --git a/simulators/simelecraft.c b/simulators/simelecraft.c
index 10fbee1f2..3fe6d53a7 100644
--- a/simulators/simelecraft.c
+++ b/simulators/simelecraft.c
@@ -37,6 +37,7 @@ int ai = 0;
int dt = 0;
int modea = 2;
int modeb = 2;
+int ptt = 0;
// ID 0310 == 310, Must drop leading zero
typedef enum nc_rigid_e
@@ -162,8 +163,10 @@ int main(int argc, char *argv[])
printf("%s\n", buf);
hl_usleep(50 * 1000);
//pbuf = "IF059014200000+000000700000;";
- pbuf = "IF00007230000 -000000 0001000001 ;" ;
+ pbuf = strdup("IF00007230000 -000000 00?1000001 ;") ;
+ pbuf[28] = ptt == 0 ? '0' : '1';
WRITE(fd, pbuf, strlen(pbuf));
+ free(pbuf);
}
else if (strcmp(buf, "ID;") == 0)
{
@@ -312,9 +315,13 @@ int main(int argc, char *argv[])
{
WRITE(fd, "K30;", 4);
}
+ else if (strcmp(buf, "RVD;") == 0)
+ {
+ WRITE(fd, "RVD02.36;", 9);
+ }
else if (strcmp(buf, "RVM;") == 0)
{
- WRITE(fd, "RV02.37;", 8);
+ WRITE(fd, "RVM02.37;", 9);
}
else if (strcmp(buf, "MD;") == 0)
{
@@ -430,6 +437,14 @@ int main(int argc, char *argv[])
{
printf("Morse: %s\n", 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 ee6b89d45bd2f0e42d40cd974d79d6ae697e50bc
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sat May 11 17:30:10 2024 -0500
Fix currvfo warning message in kenwood.c
diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c
index e0f029721..4c6069c26 100644
--- a/rigs/kenwood/kenwood.c
+++ b/rigs/kenwood/kenwood.c
@@ -1745,6 +1745,7 @@ int kenwood_get_split_vfo_if(RIG *rig, vfo_t rxvfo, split_t *split,
switch (priv->info[30])
{
case '0':
+ rs->rx_vfo = STATE(rig)->current_vfo;
if (rs->rx_vfo == RIG_VFO_A)
{
HAMLIB_TRACE;
@@ -1757,6 +1758,12 @@ int kenwood_get_split_vfo_if(RIG *rig, vfo_t rxvfo, split_t *split,
*txvfo = rs->tx_vfo = priv->tx_vfo = (*split
&& !transmitting) ? RIG_VFO_B : RIG_VFO_A;
}
+ else if (rs->rx_vfo == RIG_VFO_CURR)
+ {
+ HAMLIB_TRACE;
+ *txvfo = rs->tx_vfo = priv->tx_vfo = (*split
+ && !transmitting) ? RIG_VFO_B : RIG_VFO_A;
+ }
else
{
rig_debug(RIG_DEBUG_WARN, "%s(%d): unknown rx_vfo=%s\n", __func__, __LINE__,
diff --git a/rigs/kenwood/kenwood.h b/rigs/kenwood/kenwood.h
index ec2331ab8..bbbeac31b 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 "20240505"
+#define BACKEND_VER "20240511"
#define EOM_KEN ';'
#define EOM_TH '\r'
commit 3c4b1a83f8f5afa5af2c838bc5a3bb4c4ebb1d3e
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sat May 11 12:51:25 2024 -0500
Change IC7100 so x25x26 always and update icom.c to detect probably better
diff --git a/rigs/icom/ic7100.c b/rigs/icom/ic7100.c
index 4499bfd9d..a7ff0288e 100644
--- a/rigs/icom/ic7100.c
+++ b/rigs/icom/ic7100.c
@@ -201,8 +201,8 @@ static const struct icom_priv_caps ic7100_priv_caps =
.extcmds = ic7100_extcmds,
.antack_len = 2,
.ant_count = 2,
- .x25x26_always = 0,
- .x25x26_possibly = 1,
+ .x25x26_always = 1,
+ .x25x26_possibly = 0,
.x1cx03_always = 0,
.x1cx03_possibly = 1,
.x1ax03_supported = 1,
@@ -327,7 +327,7 @@ struct rig_caps ic7100_caps =
RIG_MODEL(RIG_MODEL_IC7100),
.model_name = "IC-7100",
.mfg_name = "Icom",
- .version = BACKEND_VER ".6",
+ .version = BACKEND_VER ".7",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h
index 212a35c2f..131db64b9 100644
--- a/rigs/icom/icom.h
+++ b/rigs/icom/icom.h
@@ -35,7 +35,7 @@
#include <sys/time.h>
#endif
-#define BACKEND_VER "20240504"
+#define BACKEND_VER "20240511"
#define ICOM_IS_ID31 rig_is_model(rig, RIG_MODEL_ID31)
#define ICOM_IS_ID51 rig_is_model(rig, RIG_MODEL_ID51)
commit 37df9e93bd0267b2dd967ccb40741154430476cf
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sat May 11 07:55:32 2024 -0500
Add RIG_OP_TUNE to Elecraftc K2 -- update docs a bit
diff --git a/rigs/kenwood/k2.c b/rigs/kenwood/k2.c
index 7e2142d86..0ebf14d12 100644
--- a/rigs/kenwood/k2.c
+++ b/rigs/kenwood/k2.c
@@ -38,7 +38,7 @@
RIG_LEVEL_STRENGTH|RIG_LEVEL_RFPOWER|RIG_LEVEL_KEYSPD)
#define K2_VFO (RIG_VFO_A|RIG_VFO_B)
-#define K2_VFO_OP (RIG_OP_UP|RIG_OP_DOWN)
+#define K2_VFO_OP (RIG_OP_UP|RIG_OP_DOWN|RIG_OP_TUNE)
#define K2_ANTS (RIG_ANT_1|RIG_ANT_2)
@@ -99,6 +99,7 @@ int k2_open(RIG *rig);
int k2_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width);
int k2_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width);
int k2_get_ext_level(RIG *rig, vfo_t vfo, hamlib_token_t token, value_t *val);
+int k2_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op);
/* Private function declarations */
int k2_probe_mdfw(RIG *rig, struct kenwood_priv_data *priv);
@@ -118,7 +119,7 @@ struct rig_caps k2_caps =
RIG_MODEL(RIG_MODEL_K2),
.model_name = "K2",
.mfg_name = "Elecraft",
- .version = BACKEND_VER ".0",
+ .version = BACKEND_VER ".2",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
@@ -237,7 +238,7 @@ struct rig_caps k2_caps =
.set_level = kenwood_set_level,
.get_level = kenwood_get_level,
.get_ext_level = k2_get_ext_level,
- .vfo_op = kenwood_vfo_op,
+ .vfo_op = k2_vfo_op,
.set_trn = kenwood_set_trn,
.get_powerstat = kenwood_get_powerstat,
.get_trn = kenwood_get_trn,
@@ -804,3 +805,17 @@ int k2_pop_fw_lst(RIG *rig, const char *cmd)
return RIG_OK;
}
+int k2_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op)
+{
+ char buf[32];
+ switch (op)
+ {
+ case RIG_OP_TUNE: // K2
+ SNPRINTF(buf, sizeof(buf), "SWH20");
+ break;
+ default: return kenwood_vfo_op(rig, vfo, op);
+ }
+ return kenwood_transaction(rig, buf, NULL, 0);
+}
+
+
diff --git a/rigs/kenwood/k3.c b/rigs/kenwood/k3.c
index 03057d144..a0a6c33a3 100644
--- a/rigs/kenwood/k3.c
+++ b/rigs/kenwood/k3.c
@@ -2495,7 +2495,7 @@ int k3_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op)
char buf[32];
switch (op)
{
- case RIG_OP_TUNE: // K2 KX2 K3 KX3 K4
+ case RIG_OP_TUNE: // KX2 K3 KX3 K4 -- K2 needs SWH20 to it's in k2.c
SNPRINTF(buf, sizeof(buf), "SWH16");
break;
default: return kenwood_vfo_op(rig, vfo, op);
commit 2d30291caa23b17b1177b3f219e5ba37d3be5f25
Merge: 64a119367 d71f7a938
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sat May 11 07:52:41 2024 -0500
Merge branch 'master' of https://github.com/Hamlib/Hamlib
commit 64a119367d1fd156088e865c7108ba8d85e600ad
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sat May 11 07:42:20 2024 -0500
Add RIG_OP_TUNE to Elecraft KX2 K3 KX3 K4
diff --git a/rigs/kenwood/k3.c b/rigs/kenwood/k3.c
index 779fc504a..03057d144 100644
--- a/rigs/kenwood/k3.c
+++ b/rigs/kenwood/k3.c
@@ -52,7 +52,7 @@
RIG_LEVEL_NR|RIG_LEVEL_MONITOR_GAIN|RIG_LEVEL_RAWSTR|RIG_LEVEL_RFPOWER_METER|RIG_LEVEL_RFPOWER_METER_WATTS)
#define K3_VFO (RIG_VFO_A|RIG_VFO_B)
-#define K3_VFO_OP (RIG_OP_UP|RIG_OP_DOWN)
+#define K3_VFO_OP (RIG_OP_UP|RIG_OP_DOWN|RIG_OP_TUNE)
#define K3_ANTS (RIG_ANT_1|RIG_ANT_2)
#define K4_ANTS (RIG_ANT_1|RIG_ANT_2|RIG_ANT_3|RIG_ANT_4)
@@ -161,6 +161,7 @@ int kx3_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val);
int kx3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val);
int k3_set_func(RIG *rig, vfo_t vfo, setting_t func, int status);
int k3_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status);
+int k3_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op);
int k3_power2mW(RIG *rig, unsigned int *mwpower, float power, freq_t freq,
rmode_t mode);
@@ -197,7 +198,7 @@ struct rig_caps k3_caps =
RIG_MODEL(RIG_MODEL_K3),
.model_name = "K3",
.mfg_name = "Elecraft",
- .version = BACKEND_VER ".27",
+ .version = BACKEND_VER ".28",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
@@ -334,7 +335,7 @@ struct rig_caps k3_caps =
.get_level = k3_get_level,
.set_ext_level = k3_set_ext_level,
.get_ext_level = k3_get_ext_level,
- .vfo_op = kenwood_vfo_op,
+ .vfo_op = k3_vfo_op,
.set_trn = kenwood_set_trn,
.get_trn = kenwood_get_trn,
.set_powerstat = kenwood_set_powerstat,
@@ -356,7 +357,7 @@ struct rig_caps k3s_caps =
RIG_MODEL(RIG_MODEL_K3S),
.model_name = "K3S",
.mfg_name = "Elecraft",
- .version = BACKEND_VER ".21",
+ .version = BACKEND_VER ".22",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
@@ -493,7 +494,7 @@ struct rig_caps k3s_caps =
.get_level = k3_get_level,
.set_ext_level = k3_set_ext_level,
.get_ext_level = k3_get_ext_level,
- .vfo_op = kenwood_vfo_op,
+ .vfo_op = k3_vfo_op,
.set_trn = kenwood_set_trn,
.get_trn = kenwood_get_trn,
.set_powerstat = kenwood_set_powerstat,
@@ -516,7 +517,7 @@ struct rig_caps k4_caps =
RIG_MODEL(RIG_MODEL_K4),
.model_name = "K4",
.mfg_name = "Elecraft",
- .version = BACKEND_VER ".28",
+ .version = BACKEND_VER ".29",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
@@ -658,7 +659,7 @@ struct rig_caps k4_caps =
.get_level = k3_get_level,
.set_ext_level = k3_set_ext_level,
.get_ext_level = k3_get_ext_level,
- .vfo_op = kenwood_vfo_op,
+ .vfo_op = k3_vfo_op,
.set_trn = kenwood_set_trn,
.get_trn = kenwood_get_trn,
.set_powerstat = kenwood_set_powerstat,
@@ -680,7 +681,7 @@ struct rig_caps kx3_caps =
RIG_MODEL(RIG_MODEL_KX3),
.model_name = "KX3",
.mfg_name = "Elecraft",
- .version = BACKEND_VER ".19",
+ .version = BACKEND_VER ".20",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
@@ -816,7 +817,7 @@ struct rig_caps kx3_caps =
.get_level = kx3_get_level,
.set_ext_level = k3_set_ext_level,
.get_ext_level = k3_get_ext_level,
- .vfo_op = kenwood_vfo_op,
+ .vfo_op = k3_vfo_op,
.set_trn = kenwood_set_trn,
.get_trn = kenwood_get_trn,
.set_powerstat = kenwood_set_powerstat,
@@ -838,7 +839,7 @@ struct rig_caps kx2_caps =
RIG_MODEL(RIG_MODEL_KX2),
.model_name = "KX2",
.mfg_name = "Elecraft",
- .version = BACKEND_VER ".18",
+ .version = BACKEND_VER ".19",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
@@ -973,7 +974,7 @@ struct rig_caps kx2_caps =
.get_level = kx3_get_level,
.set_ext_level = k3_set_ext_level,
.get_ext_level = k3_get_ext_level,
- .vfo_op = kenwood_vfo_op,
+ .vfo_op = k3_vfo_op,
.set_trn = kenwood_set_trn,
.get_trn = kenwood_get_trn,
.set_powerstat = kenwood_set_powerstat,
@@ -2478,6 +2479,10 @@ int k3_set_func(RIG *rig, vfo_t vfo, setting_t func, int status)
SNPRINTF(buf, sizeof(buf), "AG%c", (status == 0) ? '/' : '0');
break;
+ case RIG_FUNC_TUNER: // K2 KX2 K3 KX3 K4
+ SNPRINTF(buf, sizeof(buf), "SWH16");
+ break;
+
default:
return kenwood_set_func(rig, vfo, func, status);
}
@@ -2485,6 +2490,19 @@ int k3_set_func(RIG *rig, vfo_t vfo, setting_t func, int status)
return kenwood_transaction(rig, buf, NULL, 0);
}
+int k3_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op)
+{
+ char buf[32];
+ switch (op)
+ {
+ case RIG_OP_TUNE: // K2 KX2 K3 KX3 K4
+ SNPRINTF(buf, sizeof(buf), "SWH16");
+ break;
+ default: return kenwood_vfo_op(rig, vfo, op);
+ }
+ return kenwood_transaction(rig, buf, NULL, 0);
+}
+
/*
* Some functions, notably RIT and XIT On/Off status, can be queried
* on the K3. Those functions are handled here and others are passed
commit d71f7a93857a2eb1b551b13b5b6add03cbbe0b4e
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sat May 11 07:42:20 2024 -0500
Add RIG_OP_TUNE to Elecraft K2 KX2 K3 KX3 K4
diff --git a/rigs/kenwood/k3.c b/rigs/kenwood/k3.c
index 779fc504a..03057d144 100644
--- a/rigs/kenwood/k3.c
+++ b/rigs/kenwood/k3.c
@@ -52,7 +52,7 @@
RIG_LEVEL_NR|RIG_LEVEL_MONITOR_GAIN|RIG_LEVEL_RAWSTR|RIG_LEVEL_RFPOWER_METER|RIG_LEVEL_RFPOWER_METER_WATTS)
#define K3_VFO (RIG_VFO_A|RIG_VFO_B)
-#define K3_VFO_OP (RIG_OP_UP|RIG_OP_DOWN)
+#define K3_VFO_OP (RIG_OP_UP|RIG_OP_DOWN|RIG_OP_TUNE)
#define K3_ANTS (RIG_ANT_1|RIG_ANT_2)
#define K4_ANTS (RIG_ANT_1|RIG_ANT_2|RIG_ANT_3|RIG_ANT_4)
@@ -161,6 +161,7 @@ int kx3_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val);
int kx3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val);
int k3_set_func(RIG *rig, vfo_t vfo, setting_t func, int status);
int k3_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status);
+int k3_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op);
int k3_power2mW(RIG *rig, unsigned int *mwpower, float power, freq_t freq,
rmode_t mode);
@@ -197,7 +198,7 @@ struct rig_caps k3_caps =
RIG_MODEL(RIG_MODEL_K3),
.model_name = "K3",
.mfg_name = "Elecraft",
- .version = BACKEND_VER ".27",
+ .version = BACKEND_VER ".28",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
@@ -334,7 +335,7 @@ struct rig_caps k3_caps =
.get_level = k3_get_level,
.set_ext_level = k3_set_ext_level,
.get_ext_level = k3_get_ext_level,
- .vfo_op = kenwood_vfo_op,
+ .vfo_op = k3_vfo_op,
.set_trn = kenwood_set_trn,
.get_trn = kenwood_get_trn,
.set_powerstat = kenwood_set_powerstat,
@@ -356,7 +357,7 @@ struct rig_caps k3s_caps =
RIG_MODEL(RIG_MODEL_K3S),
.model_name = "K3S",
.mfg_name = "Elecraft",
- .version = BACKEND_VER ".21",
+ .version = BACKEND_VER ".22",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
@@ -493,7 +494,7 @@ struct rig_caps k3s_caps =
.get_level = k3_get_level,
.set_ext_level = k3_set_ext_level,
.get_ext_level = k3_get_ext_level,
- .vfo_op = kenwood_vfo_op,
+ .vfo_op = k3_vfo_op,
.set_trn = kenwood_set_trn,
.get_trn = kenwood_get_trn,
.set_powerstat = kenwood_set_powerstat,
@@ -516,7 +517,7 @@ struct rig_caps k4_caps =
RIG_MODEL(RIG_MODEL_K4),
.model_name = "K4",
.mfg_name = "Elecraft",
- .version = BACKEND_VER ".28",
+ .version = BACKEND_VER ".29",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
@@ -658,7 +659,7 @@ struct rig_caps k4_caps =
.get_level = k3_get_level,
.set_ext_level = k3_set_ext_level,
.get_ext_level = k3_get_ext_level,
- .vfo_op = kenwood_vfo_op,
+ .vfo_op = k3_vfo_op,
.set_trn = kenwood_set_trn,
.get_trn = kenwood_get_trn,
.set_powerstat = kenwood_set_powerstat,
@@ -680,7 +681,7 @@ struct rig_caps kx3_caps =
RIG_MODEL(RIG_MODEL_KX3),
.model_name = "KX3",
.mfg_name = "Elecraft",
- .version = BACKEND_VER ".19",
+ .version = BACKEND_VER ".20",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
@@ -816,7 +817,7 @@ struct rig_caps kx3_caps =
.get_level = kx3_get_level,
.set_ext_level = k3_set_ext_level,
.get_ext_level = k3_get_ext_level,
- .vfo_op = kenwood_vfo_op,
+ .vfo_op = k3_vfo_op,
.set_trn = kenwood_set_trn,
.get_trn = kenwood_get_trn,
.set_powerstat = kenwood_set_powerstat,
@@ -838,7 +839,7 @@ struct rig_caps kx2_caps =
RIG_MODEL(RIG_MODEL_KX2),
.model_name = "KX2",
.mfg_name = "Elecraft",
- .version = BACKEND_VER ".18",
+ .version = BACKEND_VER ".19",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
@@ -973,7 +974,7 @@ struct rig_caps kx2_caps =
.get_level = kx3_get_level,
.set_ext_level = k3_set_ext_level,
.get_ext_level = k3_get_ext_level,
- .vfo_op = kenwood_vfo_op,
+ .vfo_op = k3_vfo_op,
.set_trn = kenwood_set_trn,
.get_trn = kenwood_get_trn,
.set_powerstat = kenwood_set_powerstat,
@@ -2478,6 +2479,10 @@ int k3_set_func(RIG *rig, vfo_t vfo, setting_t func, int status)
SNPRINTF(buf, sizeof(buf), "AG%c", (status == 0) ? '/' : '0');
break;
+ case RIG_FUNC_TUNER: // K2 KX2 K3 KX3 K4
+ SNPRINTF(buf, sizeof(buf), "SWH16");
+ break;
+
default:
return kenwood_set_func(rig, vfo, func, status);
}
@@ -2485,6 +2490,19 @@ int k3_set_func(RIG *rig, vfo_t vfo, setting_t func, int status)
return kenwood_transaction(rig, buf, NULL, 0);
}
+int k3_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op)
+{
+ char buf[32];
+ switch (op)
+ {
+ case RIG_OP_TUNE: // K2 KX2 K3 KX3 K4
+ SNPRINTF(buf, sizeof(buf), "SWH16");
+ break;
+ default: return kenwood_vfo_op(rig, vfo, op);
+ }
+ return kenwood_transaction(rig, buf, NULL, 0);
+}
+
/*
* Some functions, notably RIT and XIT On/Off status, can be queried
* on the K3. Those functions are handled here and others are passed
commit 09fbc4cb64895925e3a00ec8d314f6b3e275ad7f
Author: Mike Black W9MDB <mdb...@ya...>
Date: Thu May 9 17:09:40 2024 -0500
Restore Xiegu G90 x25/x26 command detection. Works find on Base 1.79 App 1.80
https://github.com/Hamlib/Hamlib/issues/1547
diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c
index 5660a9823..7dd23c42e 100644
--- a/rigs/icom/icom.c
+++ b/rigs/icom/icom.c
@@ -9751,6 +9751,7 @@ static void icom_set_x25x26_ability(RIG *rig, int status)
if (!icom_is_x25x26_potentially_supported(rig))
{
// No change for rigs that don't support these commands anyway
+ rig_debug(RIG_DEBUG_VERBOSE, "%s: Hamlib thinks rig does not support x25/x26 command\n", __func__);
return;
}
diff --git a/rigs/icom/xiegu.c b/rigs/icom/xiegu.c
index 3fc04385b..fad83abdc 100644
--- a/rigs/icom/xiegu.c
+++ b/rigs/icom/xiegu.c
@@ -147,6 +147,7 @@ int xiegu_rig_open(RIG *rig)
if (retval == RIG_OK)
{
+ dump_hex(id,id_len);
iid = (((int)id[2]) << 8) + id[3];
rig_debug(RIG_DEBUG_VERBOSE, "%s: Xiegu Radio ID=0x%04x\n", __func__, iid);
switch(iid)
@@ -551,7 +552,7 @@ static struct icom_priv_caps g90_priv_caps =
0, /* no XCHG */
ic7200_ts_sc_list,
.x25x26_always = 0,
- .x25x26_possibly = 0, // Firmware G90 v20240504.8 doesn't work well -- see https://github.com/Hamlib/Hamlib/issues/1547
+ .x25x26_possibly = 1, // Firmware G90 v20240504.8 doesn't work well -- see https://github.com/Hamlib/Hamlib/issues/1547
.x1cx03_always = 0,
.x1cx03_possibly = 0,
.x1ax03_supported = 0,
@@ -564,7 +565,7 @@ struct rig_caps g90_caps =
RIG_MODEL(RIG_MODEL_G90),
.model_name = "G90",
.mfg_name = "Xiegu",
- .version = BACKEND_VER ".9",
+ .version = BACKEND_VER ".10",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
@@ -599,8 +600,7 @@ struct rig_caps g90_caps =
.max_xit = Hz(9999),
.max_ifshift = Hz(0), /* TODO */
.vfo_ops = X108G_VFO_OPS,
-// Disabling targetable_vfo as G90 firmare update has brokne it see https://github.com/Hamlib/Hamlib/issues/1547
-// .targetable_vfo = RIG_TARGETABLE_FREQ | RIG_TARGETABLE_MODE,
+ .targetable_vfo = RIG_TARGETABLE_FREQ | RIG_TARGETABLE_MODE,
.scan_ops = X108G_SCAN_OPS,
.transceive = RIG_TRN_RIG,
.bank_qty = 5,
commit cf91e96333979368a0bde89d5c31b7ed4f39bce5
Author: Addison Schuhardt <ad...@sc...>
Date: Thu Apr 11 00:17:06 2024 -0700
Refactoring GPIO push-to-talk logic to use libgpiod rather than the deprecated/broken sysfs method.
TODO: I'm not familiar with autoconf to set up linking to libgpiod correctly, so I'd like to ask someone else to do that.
Fixes #1538
diff --git a/configure.ac b/configure.ac
index d07ec9b9a..3a6af4e55 100644
--- a/configure.ac
+++ b/configure.ac
@@ -529,6 +529,9 @@ AS_IF([test x"${cf_with_xml_support}" = "xyes"], [
AC_SUBST([LIBXML2_LIBS])
AC_SUBST([LIBXML2_CFLAGS])
+# TODO: I don't know how to use autoconf
+LIBS="$LIBS -lgpiod"
+
## ----------------- ##
## Language bindings ##
diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h
index fc360c692..a03890f8e 100644
--- a/include/hamlib/rig.h
+++ b/include/hamlib/rig.h
@@ -2340,6 +2340,7 @@ typedef struct hamlib_port {
int fd; /*!< File descriptor */
void *handle; /*!< handle for USB */
+ void *gpio; /*!< handle for GPIO */
int write_delay; /*!< Delay between each byte sent out, in mS */
int post_write_delay; /*!< Delay between each commands send out, in mS */
diff --git a/src/gpio.c b/src/gpio.c
index e5fcfb597..88bfd305f 100644
--- a/src/gpio.c
+++ b/src/gpio.c
@@ -19,135 +19,91 @@
*
*/
-#include <string.h>
+#include "gpio.h"
+
#include <errno.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/stat.h>
#include <fcntl.h>
+#include <string.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <unistd.h>
+#include <gpiod.h>
-#include "gpio.h"
+#ifndef GPIOD_PATH
+// This is what's used on the Raspberry Pi 4; I'm not sure about others
+#define GPIO_CHIP_NAME "gpiochip0"
+#endif
+#define GPIO_CHIP_CONSUMER "Hamlib"
int gpio_open(hamlib_port_t *port, int output, int on_value)
{
- char pathname[HAMLIB_FILPATHLEN * 2];
- FILE *fexp, *fdir;
- int fd;
- char *dir;
+ struct gpiod_chip *chip;
+ struct gpiod_line *line;
port->parm.gpio.on_value = on_value;
- SNPRINTF(pathname, HAMLIB_FILPATHLEN, "/sys/class/gpio/export");
- fexp = fopen(pathname, "w");
+ chip = gpiod_chip_open_by_name(GPIO_CHIP_NAME);
- if (!fexp)
+ if (!chip)
{
- rig_debug(RIG_DEBUG_ERR,
- "Export GPIO%s (using %s): %s\n",
- port->pathname,
- pathname,
- strerror(errno));
+ rig_debug(RIG_DEBUG_ERR, "Failed to open GPIO chip %s: %s\n", GPIO_CHIP_NAME, strerror(errno));
return -RIG_EIO;
}
- fprintf(fexp, "%s\n", port->pathname);
- fclose(fexp);
-
- SNPRINTF(pathname,
- sizeof(pathname),
- "/sys/class/gpio/gpio%s/direction",
- port->pathname);
- fdir = fopen(pathname, "w");
-
- if (!fdir)
+ line = gpiod_chip_get_line(chip, atoi(port->pathname));
+ if (!line)
{
- rig_debug(RIG_DEBUG_ERR,
- "GPIO%s direction (using %s): %s\n",
- port->pathname,
- pathname,
- strerror(errno));
+ rig_debug(RIG_DEBUG_ERR, "Failed to acquire GPIO%s: %s\n", port->pathname, strerror(errno));
+ gpiod_chip_close(chip);
return -RIG_EIO;
}
- dir = output ? "out" : "in";
- rig_debug(RIG_DEBUG_VERBOSE, "Setting direction of GPIO%s to %s\n",
- port->pathname, dir);
- fprintf(fdir, "%s\n", dir);
- fclose(fdir);
-
- SNPRINTF(pathname,
- sizeof(pathname),
- "/sys/class/gpio/gpio%s/value",
- port->pathname);
- fd = open(pathname, O_RDWR);
-
- if (fd < 0)
+ if ((output && gpiod_line_request_output(line, GPIO_CHIP_CONSUMER, 0) < 0) ||
+ (!output && gpiod_line_request_input(line, GPIO_CHIP_CONSUMER) < 0))
{
- rig_debug(RIG_DEBUG_ERR,
- "GPIO%s opening value file %s: %s\n",
- port->pathname,
- pathname,
- strerror(errno));
+ rig_debug(RIG_DEBUG_ERR, "Failed to set GPIO%s to %s mode: %s\n",
+ port->pathname, (output ? "OUTPUT" : "INPUT"), strerror(errno));
+ gpiod_line_release(line);
+ gpiod_chip_close(chip);
return -RIG_EIO;
}
- port->fd = fd;
- return fd;
-}
+ port->gpio = line;
+ return RIG_OK;
+}
int gpio_close(hamlib_port_t *port)
{
- int retval;
- char pathname[HAMLIB_FILPATHLEN * 2];
- FILE *fexp;
-
- retval = close(port->fd);
-
- SNPRINTF(pathname, HAMLIB_FILPATHLEN, "/sys/class/gpio/unexport");
- fexp = fopen(pathname, "w");
-
- if (!fexp)
- {
- rig_debug(RIG_DEBUG_ERR,
- "Export GPIO%s (using %s): %s\n",
- port->pathname,
- pathname,
- strerror(errno));
- return -RIG_EIO;
- }
-
- fprintf(fexp, "%s\n", port->pathname);
- fclose(fexp);
- return retval;
+ gpiod_line_close_chip((struct gpiod_line*)port->gpio);
+ return RIG_OK;
}
-
int gpio_ptt_set(hamlib_port_t *port, ptt_t pttx)
{
- char *val;
+ int result = 0;
port->parm.gpio.value = pttx != RIG_PTT_OFF;
- if ((port->parm.gpio.value && port->parm.gpio.on_value)
- || (!port->parm.gpio.value && !port->parm.gpio.on_value))
+ if ((port->parm.gpio.value && port->parm.gpio.on_value) ||
+ (!port->parm.gpio.value && !port->parm.gpio.on_value))
{
- val = "1\n";
+ result = gpiod_line_set_value((struct gpiod_line*)port->gpio, 1);
}
else
{
- val = "0\n";
+ result = gpiod_line_set_value((struct gpiod_line*)port->gpio, 0);
}
- if (write(port->fd, val, strlen(val)) <= 0)
+ if (result)
{
+ rig_debug(RIG_DEBUG_ERR, "Failed to set the value of GPIO%s: %s\n", port->pathname, strerror(errno));
return -RIG_EIO;
}
return RIG_OK;
}
-
int gpio_ptt_get(hamlib_port_t *port, ptt_t *pttx)
{
if (port->parm.gpio.value)
@@ -164,21 +120,15 @@ int gpio_ptt_get(hamlib_port_t *port, ptt_t *pttx)
int gpio_dcd_get(hamlib_port_t *port, dcd_t *dcdx)
{
- char val;
- int port_value;
-
- lseek(port->fd, 0, SEEK_SET);
-
- if (read(port->fd, &val, sizeof(val)) <= 0)
+ int val = gpiod_line_get_value((struct gpiod_line*)port->gpio);
+ if (val < 0)
{
- return -RIG_EIO;
+ rig_debug(RIG_DEBUG_ERR, "Failed to read the value of GPIO%s: %s\n", port->pathname, strerror(errno));
}
rig_debug(RIG_DEBUG_VERBOSE, "DCD GPIO pin value: %c\n", val);
- port_value = val - '0';
-
- if (port_value == port->parm.gpio.on_value)
+ if (val == port->parm.gpio.on_value)
{
*dcdx = RIG_DCD_ON;
}
-----------------------------------------------------------------------
Summary of changes:
rigs/icom/ic7100.c | 6 +++---
rigs/icom/icom.c | 1 +
rigs/icom/icom.h | 2 +-
rigs/icom/xiegu.c | 8 ++++----
rigs/kenwood/k2.c | 21 ++++++++++++++++++---
rigs/kenwood/k3.c | 40 +++++++++++++++++++++++++++++-----------
rigs/kenwood/kenwood.c | 7 +++++++
rigs/kenwood/kenwood.h | 2 +-
simulators/simelecraft.c | 19 +++++++++++++++++--
9 files changed, 81 insertions(+), 25 deletions(-)
hooks/post-receive
--
Hamlib -- Ham radio control libraries
|
|
From: n0nb <n0...@us...> - 2024-05-08 21:00: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 8221961de2e24121482e72959c77c27edaa74740 (commit)
from 02a5f70200e589249bf8958e6d4b4a3aa094e00a (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 8221961de2e24121482e72959c77c27edaa74740
Author: Christoph Nadig <hb...@us...>
Date: Wed May 8 11:02:13 2024 +0200
Fix for setting power on Elecraft TRXs
(currently the power set is off by a factor of 10 if no PA is attached).
I also included a change to k3_max_power to take the current band into
account again. These values have changed in firmware upgrades in the
past but have been stable for quite a while now, so I think they should
be considered again.
Best Regards,
Chris, HB9ZHK
diff --git a/rigs/kenwood/k3.c b/rigs/kenwood/k3.c
index 53aab4f94..779fc504a 100644
--- a/rigs/kenwood/k3.c
+++ b/rigs/kenwood/k3.c
@@ -1835,15 +1835,12 @@ static int k3_get_maxpower(RIG *rig)
{
maxpower = 110;
}
-
-// Elecraft makes max power pretty variable
-// So we will stick with 15W or 110W and scale everything to that
-#if 0
else if (RIG_IS_KX2 || RIG_IS_KX3)
{
int bandnum = -1;
- retval = kenwood_safe_transaction(rig, "BN", levelbuf, KENWOOD_MAX_BUF_LEN, 4);
+ char levelbuf[KENWOOD_MAX_BUF_LEN];
+ int retval = kenwood_safe_transaction(rig, "BN", levelbuf, KENWOOD_MAX_BUF_LEN, 4);
if (retval != RIG_OK) { return retval; }
@@ -1877,8 +1874,6 @@ static int k3_get_maxpower(RIG *rig)
}
}
-#endif
-
rig_debug(RIG_DEBUG_TRACE, "%s: maxpower=%d\n", __func__, maxpower);
return maxpower;
}
@@ -1899,6 +1894,7 @@ int k3_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
{
char levelbuf[16];
int kenwood_val;
+ float pwr;
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
@@ -1998,9 +1994,9 @@ int k3_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
break;
case RIG_LEVEL_RFPOWER:
- kenwood_val = (int)(val.f * k3_get_maxpower(rig));
- SNPRINTF(levelbuf, sizeof(levelbuf), "PC%03d%s", kenwood_val,
- kenwood_val > 15 ? "1" : "0");
+ pwr = val.f * k3_get_maxpower(rig);
+ SNPRINTF(levelbuf, sizeof(levelbuf), "PC%03.f%c", pwr > 15.0 ? pwr : 10.0 * pwr,
+ pwr > 15.0 ? '1' : '0');
break;
default:
-----------------------------------------------------------------------
Summary of changes:
rigs/kenwood/k3.c | 16 ++++++----------
1 file changed, 6 insertions(+), 10 deletions(-)
hooks/post-receive
--
Hamlib -- Ham radio control libraries
|