Share directly executed tests and generated wrappers between Automake primaries. Keep entries one per line to reduce conflicts when independent changes add coverage.
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.
On the FTX-1, WFM is a bit special: Inside the 76-108 MHz WFM band the
radio is set to WFM by sending the normal FM mode code (MD...4), and
when read back the MD reply carries P2='0', which newcat_get_mode cannot
map and so returns -RIG_EPROTO. Override get_mode/set_mode with ftx1
wrappers:
- ftx1_get_mode: on -RIG_EPROTO with mode '0', verify the current VFO
frequency falls in a WFM rx range (rx_range_list), and if so report
RIG_MODE_WFM instead of the protocol error.
- ftx1_set_mode: when asked for RIG_MODE_WFM, reject it (-RIG_EINVAL)
outside the WFM range, and inside the range translate it to
RIG_MODE_FM with RIG_PASSBAND_NOCHANGE (let the radio apply its WFM
bandwidth).
- ftx1_check_freq_wfm(): helper scanning rx_range_list for a WFM-typed
entry covering the given frequency.
This commit includes WFM (Wide Frequency Modulation) in the frequency
table for the Yaesu FTX-1 rig. The frequency ranges are updated to
reflect the correct modes for each range, ensuring that WFM is properly
recognized and handled by the rig's capabilities. This change also
adds filter bandwidth information for WFM.
ftx1_set_rptr_offs() converted the requested offset into the EX menu's
step count with a truncating integer division, so any offset that was
not an exact multiple of the step was silently programmed as a smaller
one, with nothing returned to tell the caller it had been changed.
Round to the nearest step instead.
Also reject a negative offset up front. The offset is a magnitude --
direction comes from set_rptr_shift -- and truncation towards zero
meant a small negative value was accepted as "no offset" rather than
rejected, while a larger one failed later in the menu range check.
Verified on an FTX-1 (Optima) on 144 MHz, with #2110 applied so the
step is the correct 50 kHz:
set_rptr_offs 625000 -> 650000 (exactly half a step, rounds up)
set_rptr_offs 630000 -> 650000
set_rptr_offs 620000 -> 600000
set_rptr_offs 624999 -> 600000
set_rptr_offs 600000 -> 600000 (exact, unchanged)
set_rptr_offs -600000 -> -RIG_EINVAL, menu value left untouched
The truncation is present independently of #2110 -- that PR only makes
it easier to hit by correcting the 144/430 MHz step to 50 kHz.
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.
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.
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.
Correct several issues in the FTX-1 CTCSS/DCS implementation:
* Add DCS code table (ftx1_dcs_codes[]) and index<->code conversion
helpers (ftx1_code_to_dcs_num/ftx1_dcs_num_to_code). Previously
set_dcs_code/get_dcs_code passed the raw DCS code value (e.g. 023)
directly to the CN command, which expects a 0-based table index
(000-103). The code value is now converted to/from the index on
set/get respectively.
* Fix CN command parameter documentation. P1 is the VFO selector
(0=Main/1=Sub), not a TX/RX selector as previously stated.
* Simplify set/get_ctcss_sql to delegate to set/get_ctcss_tone, and
set/get_dcs_sql to delegate to set/get_dcs_code. The FTX-1 does not
support separate TX/RX tones or DCS codes, so the previous
CN10/CN11 (Sub VFO) usage was incorrect.
* Add RIG_FUNC_CSQL support in set_func/get_func and rig caps,
mapping it to the CT3 (DCS) mode via FTX1_CTCSS_MODE_DCS.
PMR-171 and Q900 can return the private filter width when a mode query
falls back to cached state. Initialize it to RIG_PASSBAND_NORMAL during
backend setup.
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.
Validate input and transmit-antenna digits against each model's declared capabilities before constructing antenna masks. Return a protocol error for malformed status fields.
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.
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.
Require exact clarifier and extended-menu response structure, validate numeric conversions and terminators, and reject signed or out-of-range meter values.
Stop Icom tuning-step lookup at each table sentinel and bound Gemini status fields without letting truncated scans cancel valid matches. Parse GS100 newline-delimited response lines until its exact non-terminated prompt while enforcing response and line-count limits.
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.
The raw value of frequency offset for 144 MHz and 430 MHz band is in
50 kHz unit, and the available range is from 0 to 100 MHz.
Tested on real hardware.
Fixes: 2c0ba29d53 ("FTX-1: Fix capability gaps - DCD, CWPITCH, RPTR_OFFS, BAND_UP/DOWN")
Signed-off-by: Miao Wang <shankerwangmiao@gmail.com>
Malformed K3/K3S SW and K4 TM replies could leave parsed meter
fields uninitialized. The K4 SWR path also discarded helper failures.
Reject incomplete conversions with RIG_EPROTO and return K4 transaction
and parse errors to callers.
dummy_get_level() copied a full value_t into result pointers even when
rig_get_strength() passed an int-sized buffer, overflowing the caller.
Copy only the integer or float member selected by the level while
retaining memcpy() for targets with weaker alignment.
Fixes: 5805de6e1e ("dummy/dummy.c: Fix unaligned access in dummy_get_level()")
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")