Commit graph

1565 commits

Author SHA1 Message Date
David Christle
5bc6deefe1
refactor(tests): split test registration into stable lists
Share directly executed tests and generated wrappers between Automake primaries. Keep entries one per line to reduce conflicts when independent changes add coverage.
2026-08-02 10:41:57 -07:00
Nate Bargmann
06d19e6c92
Merge GitHub PR #2115 2026-08-01 08:28:29 -05:00
Nate Bargmann
8ac832885c
Merge GitHub PR #2114 2026-08-01 06:39:17 -05:00
David Christle
eff25c9472
fix(dummy): copy string parameter values
The Dummy backend retained caller-owned string pointers in its parameter
array, leaving BANDSELECT and KEYERTYPE dangling after the caller returned.

Deep-copy string parameters, release replacements during cleanup, and add
set/get ownership regressions for both string-valued parameters.
2026-07-31 21:27:17 -07:00
David Christle
faefdac4ab
fix(rotctl): bound escaped command parsing
Stop parsing when an escape is missing or consumes no input, and count only successfully decoded bytes. This avoids the extra strtol call beyond the command terminator while preserving valid raw commands.
2026-07-29 10:39:38 -05:00
David Christle
1f804d4da7
fix(ftx1): validate S-meter response framing
Require the response command, VFO selector, numeric payload, and terminator to match the requested S-meter frame. Reject malformed or mismatched replies without changing the output value.
2026-07-29 10:38:05 -05:00
David Christle
489ca77a04
fix(core): return generic band for missing metadata
Band-name callers treat successful lookups as printable strings. Return BANDGEN when granularity metadata has no band list instead of propagating NULL into formatting paths.
2026-07-29 10:31:51 -05:00
David Christle
439f91fa28
fix(core): terminate empty hexadecimal output
to_hex() left non-empty destination buffers untouched when the source
length was zero. Initialize the output string before returning and cover
the empty conversion in testbcd.
2026-07-28 00:50:52 -05:00
David Christle
560a44d844
fix(ampctl): bound escaped command parsing
Stop binary command decoding at the documented escape boundary and use the conversion endpoint to advance. This avoids reading beyond a terminated command while preserving valid escaped bytes.
2026-07-27 23:33:13 -05:00
David Christle
5293dbb855
test(parsers): add boundary regressions
Exercise command stream failures, hexadecimal byte formats, backend truncation and framing, metadata absence, and physical-device reply boundaries with focused valid and malformed cases. Ignore the generated test binaries and harness logs.
2026-07-27 23:33:09 -05:00
David Christle
c0adbb27bb
fix(ctl): bound command parser inputs
Reject stream read errors instead of synthesizing empty commands, validate raw hexadecimal command syntax without reading past its terminator, and keep fixed-size command and description inputs within their actual capacities.
2026-07-27 23:32:48 -05:00
David Christle
e80cc8fd82 fix: prevent network AGC parser overflow
NET rigctl and Quisk reused an old loop index while parsing
peer-provided AGC levels, which could write past the fixed array.

Use a shared bounded parser that truncates the list to the array
capacity and ignores malformed fields without failing the connection.

Fixes: 652e12a446 ("Fix cppcheck style")
2026-07-25 00:03:53 -05:00
David Christle
cf3fcc4b8a
fix(debug): prevent race in debug history capture
Concurrent calls to rig_debug() could use the same temporary buffer
and corrupt the saved debug history.

Give each call its own buffer and update the shared history under the
existing mutex.
2026-07-23 22:32:22 -05:00
George Baltz N3GB
0508a165c5 Shrink scope of some iteration variables 2026-06-23 12:13:22 -04:00
Nate Bargmann
55366e14f2
Merge commit from fork
For your consideration
2026-06-12 08:59:45 -05:00
George Baltz N3GB
a3a7f00d75 Bend boundary->subscript conversion in the right direction.
Don't mess with binary data.
2026-06-06 10:02:26 -04:00
George Baltz N3GB
11dbace230 Make a padded copy of input so compare doesn't overread
Cleanup:
Fix typo and formatting
Move RIGCTLD_PASSWORDS from rig.h to rigctl_parse.h
2026-06-05 04:37:50 -04:00
George Baltz N3GB
cef2d9d3a9 Move password status to connection specific data.
Fix memory leak in rigctld_password_check()
2026-06-03 16:52:49 -04:00
George Baltz N3GB
b56f8d8f8a Infrastructure and setup for associating connection data with thread
Will allow rigctl_parse() routines access to connection data, without
  reworking all of the internal and external interfaces.
2026-06-03 15:45:12 -04:00
George Baltz N3GB
7fc1389349 Turn off passwords and their help text
Disable them until they work
2026-06-03 13:07:07 -04:00
Gong BI1XJT
60fb8e5fa0 Remove old-fashioned and buggy Android.mk build system
Signed-off-by: Gong BI1XJT <bi1xjt@rad1o.cn>
2026-05-17 22:49:59 +08:00
Gong BI1XJT
1f2cebac17 Correct the linkage of tests/* against Android Sensor rot
Signed-off-by: Gong BI1XJT <bi1xjt@rad1o.cn>
2026-05-17 21:02:25 +08:00
Nate Bargmann
90bc716e78
Merge GitHub PR #2047 2026-05-10 14:08:20 -05:00
George Baltz N3GB
0b2b91f538 Get rid of all 'mode_t' declarations
Use rmode_t for real hamlib modes, appropriate types for others.
2026-05-10 12:11:01 -04:00
George Baltz N3GB
7df5ae1a00 Fix errors found by glibc 2.43
glibc implements some new parts of the C23 standard:
(Taken from https://download.opensuse.org/tumbleweed/iso/Changes.20260430.txt)

  * For ISO C23, the functions bsearch, memchr, strchr, strpbrk, strrchr,
    strstr, wcschr, wcspbrk, wcsrchr, wcsstr and wmemchr that return
    pointers into their input arrays now have definitions as macros that
    return a pointer to a const-qualified type when the input argument is
    a pointer to a const-qualified type

and

  * The aforementioned change in ISO C23 of the declaration of bsearch,
    memchr, strchr, strpbrk, strrchr, strstr, wcschr, wcspbrk, wcsrchr,
    wcsstr, and wmemchr as const-preserving macros can lead to compilation
    issues in code not set up for it

This lead to some warnings about assigning returns from strchr(const, target)
  to non-const pointers, and then discovering that Hamlib was modifying
  those const parameters.

This commit aligns the const-ness of the offending parameters. Only affects
  internal functions in ampctl_parse.c, rigctl_parse.c and rotctl_parse.c,
  so API/ABI should not change.
2026-05-03 14:55:05 -04:00
George Baltz N3GB
b6a25c8a83 Avoid warnings from gcc-16
gcc-16 adds warnings about using strncpy() to copy into a buffer with
  size equal to the max count, possibly creating an unterminated string.
  Since we don't care about the contents here and both buffers are the
  same size, just do a byte copy.
2026-03-13 05:21:54 -04:00
George Baltz N3GB
1b2461aba9 Cope with new amplifier code
Replace obsolete usages (search&replace)
Add required includes
2026-02-23 15:16:31 -05:00
George Baltz N3GB
a96fbef780 Fix the fallout of the big cut
Add needed includes to the diddly programs in tests.
Makes `make distcheck` work.
2026-02-23 11:16:40 -05:00
George Baltz N3GB
29c4ec4778 Finish adding #include's for things moving out of rig.h
Clean compile & execution with both NO_OLD_INCLUDES and NO_OLD_STRUCTS
  defined.
2026-02-23 11:12:15 -05:00
George Baltz N3GB
ba3c5624b6 Remove deprecated port references from ampctl.c
As a stand-alone program, ampctl has no need for that data.
2026-02-23 11:02:34 -05:00
George Baltz N3GB
02ea4af572 Move rig_state to heap storage.
Allocate and free it.
For access apps must
1) #include <hamlib/rig_state.h>  and
2) Use HAMLIB_STATE(rig) to get the address

Also fix a couple of misuses of STATE() macro.
2026-02-23 11:02:34 -05:00
George Baltz N3GB
1945e8db33 Remove all code references to (rig|ptt|dcd)port_deprecated.
The structures are no longer read or written.
2026-02-23 11:02:34 -05:00
Mikael Nousiainen
a526eb6bbc Extend amplifier API with funcs, levels, parms, ops, status and Expert backend.
Add new amp_caps fields (funcs, levels, parms, ops, status, freq ranges, input/ant)
with corresponding frontend API functions, ampctl commands, and dumpcaps
support. Implement Expert 13K-FA/15K-FA/2K-FA amplifier backend. Extend
dummy backend with full coverage of all new API features.
2026-02-17 15:54:00 +02:00
Nate Bargmann
6b9bd14d24
Pause building and installing rigfreqwalk
The utility requires eight arguments but #3, baud, is ignored which
seems to leave it broken and has been ignored for about as long as the
code has been in the repository.  There is also no documentation on the
intended usage of this utility.

Will restore when these issues are resolved.
2026-02-14 13:50:06 -06:00
Nate Bargmann
3703191f67
Add rigctltcp manual page
Reorder rigctltcp usage output slightly.
2026-02-14 09:09:11 -06:00
George Baltz N3GB
f6734ad832 Add the missing commit
Plus a few more arbitrary lengths, so `git grep scanfc` shows no more
  bare "%s" format strings.
2026-01-28 15:44:36 -05:00
George Baltz N3GB
de5087f57a Same for ampctl_parse.c
Update NEWS
Fix compiler snit about possible truncation
2026-01-28 04:50:19 -05:00
George Baltz N3GB
330b791216 Fix string overflows in rotctl_parse.c 2026-01-27 22:25:43 -05:00
George Baltz N3GB
9d40f9f180 Fix unbounded scanf string in rigctl_parse.c
Thanks to Vlatko Kosturjak with Marlink Cyber, for reporting it.
2026-01-27 22:25:43 -05:00
Daniele Forsi IU5HKX
ee42a8c120 Fix typos 2025-12-21 13:12:23 +01:00
George Baltz N3GB
1cf8d03e13 Missed one 2025-12-12 02:39:07 -05:00
George Baltz N3GB
018c86997b Fix the same leak in rigctltcp.c 2025-12-10 17:02:29 -05:00
George Baltz N3GB
08a013b87b Fix memory leak in rigctld
Just started playing with valgrind, and already We have a Winner!
rigctld was leaking ~100 bytes every 5 seconds; rearrange code so
  arg is not allocated until it is needed and will be passed to the
  routine that will free() it.
Also fix uninitialized variable warning.
2025-12-10 16:16:02 -05:00
George Baltz N3GB
bc5b5b6725 Use auto storage instead of clobbering string literal. 2025-10-06 13:08:19 -04:00
Daniele Forsi IU5HKX
bceb1a1fdf Do not use abbreviations where there is enough space 2025-10-05 11:36:03 +02:00
Daniele Forsi IU5HKX
486ec607dd Remove space for consistency with other descriptions 2025-10-05 11:31:10 +02:00
Daniele Forsi IU5HKX
a7188c201a Put set_gpio before get_gpio
Like other set/get pairs.
2025-10-05 09:02:00 +02:00
Daniele Forsi IU5HKX
0546e764af Update comments
All letters are used now, rig_set/rig_get are added and -W is
reserved by POSIX.2 for implementation extensions of get_opt,
but it doesn't apply here because this code is using strcmp()
and the W command which is implemented is not prefixed by a '-'.
2025-10-05 00:29:01 +02:00
Daniele Forsi IU5HKX
19ce6d30b0 Put get_conf near set_conf 2025-10-04 22:37:09 +02:00
Daniele Forsi IU5HKX
6238a5ef1b Reorder commands in --help output
Puts more related get/set commands side by side in the columnar output.
2025-10-04 21:51:00 +02:00