Commit graph

2241 commits

Author SHA1 Message Date
Rega57
2df5128251
Add support for Harris PRC-138
This is the first implementation of basic funtionality of Harris PRC-138.

(cherry picked from commit f880cac0ad)
2026-04-10 19:52:36 -05:00
Dhiru Kholia
3cf97b5a5b
Add support for rigs using the 'Simple CAT' protocol
See 'rigs/simplecat/SIMPLE_CAT_PROTOCOL.md' for the protocol spec.

Notes:

- Memory correctness checks were done using Valgrind.

- Tested with wsjtx-3.1.0_improved_PLUS_260228.tgz (with mods) and
  Bunzee Labs' DDX HF Digital Transceiver

  https://bunzee-labs.com/products/ddx

Tested on:

- Ubuntu Linux
- macOS Tahoe
- Windows 11

(cherry picked from commit debe6fcaf9)
2026-03-26 07:25:09 -05:00
Matthias Moeller
cd6428fe31
Initialize rp->timeout in rig_init
(cherry picked from commit 5a87f7e415)
2026-02-26 21:36:36 -06:00
Daniele Forsi IU5HKX
8a27cbcd1f
Fix typos
(cherry picked from commit ee42a8c120)
2025-12-26 10:52:31 -06:00
George Baltz N3GB
0542918723
First round of IC-F8101 updates
Thanks to AB4MW for driving this
See Issue #1954

(cherry picked from commit 1d7f7591d9)
2025-12-09 16:19:39 -06:00
Daniele Forsi IU5HKX
fe7fee4893 Fix typos 2025-12-02 22:06:42 +01:00
George Baltz N3GB
4ad91cad0a Add a fallback function for spaces()
This shouldn't be needed, but somebody somewhere sometime is going
to use an old rigctl with a new hamlib and get an undefined symbol.

Should go away with 5.0.
2025-10-03 11:12:06 -04:00
George Baltz N3GB
d391e569ce Add rig to opened list even if skip_init is set.
Just in case someone finishes CHECK_RIG_ARG,
 or checks status from remove_opened_rig().
2025-09-30 11:09:18 -04:00
George Baltz N3GB
8bd19c4db8 Change pseudo-anonymous structure name to convention. 2025-09-27 15:56:31 -04:00
George Baltz N3GB
00020e6d9d Add 'hl_' prefix to names of push(), pop() and peek()
to avoid conflict with app code.

Add header to fifo.c
Drop unused structure member in rig.c
2025-09-27 15:56:31 -04:00
George Baltz N3GB
2283473707 Move FIFO_RIG from hamlib/rig.h to fifo.h where it belongs.
Add header to fifo.h
Update structure pointer in rig_state
2025-09-27 15:56:31 -04:00
Nate Bargmann
0d122f6b1a
Restore information message from diff
Make sure tab preceeds all indented lines.
2025-09-27 11:16:32 -05:00
Nate Bargmann
34fa8d0e2f
Refactor hamlibdatetime.h target
Re: GitHub Issue #1895

Thanks to inspiration from Jan Engelhardt <ej@inai.de> via the GNU
automake mailing list on Thu, 25 Sep 2025 20:40:21 +0200 (CEST):
https://lists.gnu.org/archive/html/automake/2025-09/msg00013.html
The 'diff' command has been wrapped inside an 'if' conditional to
hopefully hide its return value from FreeBSD make.

Also make a couple other small changes.
2025-09-26 20:54:46 -05:00
Jan Engelhardt
744fe5a066
Remove redundant path from BUILT_SOURCES
Re: GitHub Issue #1895

In response to a query to the automake mailing list, this reply was
received:

On Wednesday 2025-09-24 19:05, Nate Bargmann wrote:

>make[1]: don't know how to make ./hamlibdatetime.h. Stop

Something wanted to make "./hamlibdatetime.h", but you only provide
a rule for "hamlibdatetime.h":

>hamlibdatetime.h: FORCE
>       @if test -x $(top_srcdir)/.git ; then \
>               echo "/* This date time is from the last non-merge commit to Hamlib. */" > $(builddir)/$(@F).tmp ;\
>               echo "#define HAMLIBDATETIME "\"$$(TZ=UTC git --git-dir=$(top_srcdir)/.git log --no-merges
+--date='format-local:%Y-%m-%dT%H:%M:%SZ SHA=' --format='%cd' -n 1)$$(git --git-dir=$(top_srcdir)/.git log --no-merges -n 1 | head
+-n 1 | cut -c8-13)\"  >> $(builddir)/$(@F).tmp ;\

The distinction is important.

>BUILT_SOURCES = $(builddir)/hamlibdatetime.h

All targets are already relative to ${builddir},
so explicitly mentioning ${builddir} is wrong for
targets, and redundant in the recipe.

----------------------

Removing "$(builddir)/" allows FreeBSD make to enter the rule.  GNU make
wasn't bothered by the prepending of the path when comparing to the
Makefile target.
2025-09-26 08:13:26 -05:00
Nate Bargmann
d04364e685
Use pkgconf/pkg-config to test for libusb-1.0
As reported in GitHub issue #1892, configure on FreeBSD failed to search
for the name of the library correctly which is libusb.  As pkg-config
correctly holds the library name for linking, modify the search for
libusb-1.0 to use the pkg-config capability.  If pkg-config (now largely
replaced by pkgconf) is not installed or found, the modules depending on
it will be gracefull disabled, i.e. the configure script will complete
with those modules disabled.

Modify the output summary to use spaces instead of tabs as things were
not lining up nicely in my FreeBSD terminal.

Rename the Automake substituted variable 'HAVE_LIBUSB' to
'TESTS_HAVE_LIBUSB' to avoid confusion with identically named variable
written to include/hamlib/config.h.

Likewise, rename the AutoConf substituted name 'LIBUSB' to
'HAMLIB_PC_LIBUSB' to avoid confusion with the 'LIBUSB' string passed to
PKG_CHECK_MODULES.

Update hamlib.pc.in and tests/Makefile.am to use the new variable names.

Make sure all source files no longer reference HAVE_LIBUSB_H or
HAVE_LIBUSB_1_0_LIBUSB_H as these variables no longer exist.

Fix src/Makefile.am to provide include path for usb_port.c.
2025-09-17 21:31:37 -05:00
George Baltz N3GB
5f845e92cb Get rid of more cppcheck fluff
Turn off -x option in cppcheck.sh, fix missing '\'.

This fixes all the "error" messages from cppcheck except those
  due to its own inability to handle concatenated format strings.
2025-09-13 21:37:25 -04:00
George Baltz N3GB
7e572fcdd0 Rename spaces() -> hl_stars()
Resolves conflict with function of same name in cqrlog.
Makes future conflicts less likely.
Add it to doxygen.
2025-09-13 21:37:25 -04:00
George Baltz N3GB
f7a127dbdc Doxygen updates. 2025-09-13 21:37:25 -04:00
Daniele Forsi IU5HKX
d507e815a3 Also check the "val" parameter in amp_set_conf() and rot_set_conf()
Avoids a segfault in lower level functions that can more easily
happen when using the bindings.
Simmetric with amp_get_conf() via amp_get_conf2() and rot_get_conf()
via rot_get_conf2().

This is a followup of commit ede84bfce4
that made the same change to conf.c
2025-09-09 20:36:58 +02:00
Nate Bargmann
d74581f6fe
Merge GitHub PR #1891 2025-09-09 06:06:07 -05:00
Daniele Forsi IU5HKX
717d3e1491 Partially revert "[src] Remove unused includes"
This partially reverts commit 83ed5abeb4.
2025-09-07 11:54:30 +02:00
Nate Bargmann
0f871a5a3e
Update Doxygen comments for rigerror() and rigerror2()
Add a new topic of "Hamlib internals" with the group of lib_internal.

Address GitHub issue #1881.
2025-09-06 18:13:12 -05:00
Daniele Forsi IU5HKX
64ec35845c Return "Feature not available" for range_list_number and range_list_name
Test case:
tests/rigctl get_conf range_list_number get_conf range_list_name
error = *1:event.c(269):rig_poll_routine_start entered
*1:event.c(309):rig_poll_routine_start returning(0)
rig.c(294):add_opened_rig entered
rig.c(306):add_opened_rig returning2(0)
rig.c(1669):rig_open returning2(0)
*1:rig.c(6904):rig_get_powerstat entered
*rig.c(6918) trace
**2:dummy.c(1680):dummy_get_powerstat entered
**2:dummy.c(1683):dummy_get_powerstat returning(0)
*1:rig.c(6931):rig_get_powerstat returning(0)
Backend version: 20240709.0, Status: Stable
rigctl_parse: called, interactive=0
rigctl_parse: vfo_opt=0
rig_set_cache_timeout_ms: called selection=0, ms=1000
rig_set_cache_timeout_ms: called selection=0, ms=1000
rigctl_get_conf:
rig_token_lookup called for range_list_number
rig_confparam_lookup called for range_list_number
rig_get_conf2 called
Feature not available

error = **2:dummy.c(1680):dummy_get_powerstat entered
**2:dummy.c(1683):dummy_get_powerstat returning(0)
*1:rig.c(6931):rig_get_powerstat returning(0)
Backend version: 20240709.0, Status: Stable
rigctl_parse: called, interactive=0
rigctl_parse: vfo_opt=0
rig_set_cache_timeout_ms: called selection=0, ms=1000
rig_set_cache_timeout_ms: called selection=0, ms=1000
rigctl_get_conf:
rig_token_lookup called for range_list_number
rig_confparam_lookup called for range_list_number
rig_get_conf2 called
Feature not available
rigctl_parse: called, interactive=0
rigctl_parse: vfo_opt=0
rigctl_get_conf:
rig_token_lookup called for range_list_name
rig_confparam_lookup called for range_list_name
rig_get_conf2 called
Feature not available
2025-09-03 21:11:16 +02:00
Daniele Forsi IU5HKX
b3cde37a06 Add missing code to read some configuration parameters
Adds code keeping the same order of token.h to `get_conf` the
following tokens:
 freq_skip
 offset_vfoa
 offset_vfob
 range_list_name (always returns an empty string)
 range_list_number (always returns 0)
 tuner_control_pathname
2025-09-03 20:32:09 +02:00
Daniele Forsi IU5HKX
7ab3dd718c Fix conflicting names for TOK_RANGE_SELECTED and TOK_RANGE_NAME
Change also the descriptions.

Test case
before:
tests/rigctl dump_conf | grep range
Selected range list: "The tx/rx range list in use"
Selected range list: "The tx/rx range list name"

after:
tests/rigctl dump_conf | grep range
range_list_number: "The tx/rx range list number in use"
range_list_name: "The tx/rx range list name in use"
2025-09-03 20:32:09 +02:00
Nate Bargmann
7180eb7da6
Merge GitHub PR #1879 2025-09-01 13:20:11 -05:00
Nate Bargmann
4c520571df
Merge GitHub PR #1876 2025-08-31 20:11:12 -05:00
Nate Bargmann
9123d08a6c
Merge GitHub PR #1874 2025-08-31 19:21:27 -05:00
Nate Bargmann
43b84ee56a
Merge GitHub PR #1873 2025-08-31 19:07:18 -05:00
Daniele Forsi IU5HKX
80281719f4 Fix twiddle_timeout
Fixes the definition of config parameter "twiddle_timeout" and
the description of rig_set_twiddle().
2025-08-31 10:34:44 +02:00
Daniele Forsi IU5HKX
39e155efe7 Fix include config.h
It should be included, with its path, before any hamlib include
and before any #ifdef that uses the symbols that it defines.
2025-08-30 11:18:51 +02:00
Daniele Forsi IU5HKX
d227444aa6 Fix return values of amp_load_backend() and rot_load_backend()
The value -EINVAL is in the domain of errno.
2025-08-30 10:27:09 +02:00
Daniele Forsi IU5HKX
83ed5abeb4 [src] Remove unused includes
Found by iwyu.
2025-08-30 09:43:45 +02:00
Daniele Forsi IU5HKX
341a5201c6 Replace literal constant with defined symbol 2025-08-29 23:27:23 +02:00
Daniele Forsi IU5HKX
8f343197e0 Replace a printf() with rig_debug()
The bug is that we don't know why the string is invalid.

Test case:
before
tests/rigctl -r "invalid:123:port" -m 2
Unhandled host=invalid:123:port
Unhandled host=invalid:123:port

after:
tests/rigctl -r "invalid:123:port" -m 2
(no output)
tests/rigctl -r "invalid:123:port" -m 2 -v
parse_hoststr: Unhandled host=invalid:123:port
parse_hoststr: Unhandled host=invalid:123:port
2025-08-29 23:26:39 +02:00
George Baltz N3GB
002677e48c Still more pthread conditional code cleanup 2025-08-27 15:24:50 -04:00
George Baltz N3GB
9a90745ba6 More conditional pthread usage unleashed
Anybody know what sync_callback() is supposed to do? Currently
unused, very broken, and not even a header comment.
2025-08-24 19:53:44 -04:00
George Baltz N3GB
df65ceee67 Start removing conditional pthreads use.
We can treat HAVE_PTHREAD and HAVE_PTHREAD_H as equivalent. But using
_PTHREAD_H is a real kludge.
2025-08-24 19:53:44 -04:00
Daniele Forsi IU5HKX
7a9e101b9d Add missing string form for RIG_FUNC_SLICE 2025-08-19 19:41:26 +02:00
George Baltz N3GB
053178ccbd Fix nits in serial.c
Squelch uninitialized variable from cppckeck
Remove duplicate close()s from -fanalyzer and unreachable breaks.
2025-08-13 13:03:25 -04:00
George Baltz N3GB
0e36d4faa4 Mangle names of structure members to avoid clash with perl keywords. 2025-08-13 09:30:59 -04:00
Daniele Forsi IU5HKX
289a3952ce Change the dummy implementation of rig_send_raw()
Makes it more similar to the regular version handling also
the reply and term arguments.
2025-08-11 12:18:50 +02:00
Daniele Forsi IU5HKX
12ec55c3d7 Add missing set_transaction_inactive()
Otherwise no other command will be executed afterwards.
2025-08-10 21:39:15 +02:00
Daniele Forsi IU5HKX
5e336b90c1 Improve Doxygen comments 2025-08-10 21:39:09 +02:00
Daniele Forsi IU5HKX
2462ab0a13 Improve Doxygen comments
Adds missing cross-references. Fix tagging of comment blocks in "aor"
even if the rigs aren't included in the generated documentation.
2025-08-08 10:38:55 +02:00
George Baltz N3GB
1e5adb9fde Fix errors in error cases
Leak FDs in error exits, seg faults if RIG missing.
Found by `gcc -fanalyzer`
2025-08-06 04:56:02 -04:00
Nate Bargmann
1e310b7958
Merge GitHub PR #1828 2025-08-04 08:04:15 -05:00
Daniele Forsi IU5HKX
fbe9803777 Fix initialization of comm_status
The function rig_init() doesn't touch the hardware, it's rig_open()
that initiates the connection and in fact the first use of comm_status
in rig_open() is when it gets the value RIG_COMM_STATUS_CONNECTING and
rig_close() sets it to RIG_COMM_STATUS_DISCONNECTED.
2025-08-03 13:34:36 +02:00
Daniele Forsi IU5HKX
8d8d0328bf Fix typos 2025-08-03 10:49:23 +02:00
Nate Bargmann
989623ec51
Merge GitHub PR #1824 2025-08-01 18:31:38 -05:00