Commit graph

3876 commits

Author SHA1 Message Date
Nate Bargmann
8c0070e0b5
Merge GitHub PR #2119 2026-08-10 11:53:58 -05:00
Nate Bargmann
148feba986
Merge GitHub PR #2118 2026-08-02 09:07:30 -05:00
Nate Bargmann
b897a7bed5
Merge GitHub PR #2117 2026-08-02 08:28:18 -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
Nate Bargmann
568b6c1cde
Merge GitHub PR #2113 2026-07-31 13:02:48 -05:00
Nate Bargmann
cc6bbf70cc
Merge GitHub PR #2089 2026-07-31 12:36:48 -05:00
Miao Wang
2d1974a748 ftx1: handle WFM mode quirk (FM-in-WFM-band returns mode '0')
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.
2026-07-30 12:55:53 +08:00
Miao Wang
1944a6736e ftx1: include WFM in the frequency table
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.
2026-07-30 12:38:08 +08:00
Nate Bargmann
04f13b4a01
Merge GitHub PR #2112 2026-07-29 21:24:30 -05:00
Nate Bargmann
9415c552b0
Merge GitHub PR #2111 2026-07-29 20:53:12 -05:00
KJ5HST
335820ad0a ftx1: round repeater offset to nearest menu step, reject negative
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.
2026-07-29 12:18:38 -04: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
Miao Wang
3f3e4becb3 ftx1: Fix CTCSS/DCS tone handling and add CSQL support
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.
2026-07-28 22:51:28 +08:00
David Christle
951ff93651
fix(guohetec): initialize fallback filter width
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.
2026-07-28 00:50:57 -05:00
David Christle
3afe2133a1
refactor(ftx1): simplify S-meter parsing
Suppress the unused P1 conversion result while retaining the response-digit validation performed by the conversion.
2026-07-27 23:33:13 -05:00
David Christle
d60beb2e63
fix(ftx1): validate physical-device replies
Require exact clarifier and extended-menu response structure, validate numeric conversions and terminators, and reject signed or out-of-range meter values.
2026-07-27 23:33:03 -05:00
David Christle
b9b972378f
fix(backends): validate bounded parser fields
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.
2026-07-27 23:33:00 -05:00
Miao Wang
e0c8de6936 FTX-1: fix get/set_rptr_offs to use correct unit
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>
2026-07-28 03:59:43 +08:00
David Christle
900c4d354e
fix(kenwood): validate Elecraft SWR responses
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.
2026-07-27 02:42:13 -05:00
Jon Snow
379cf42746
Merge branch 'Hamlib:master' into master 2026-07-26 22:17:16 -04:00
Jon Snow
d0805c935e fix type warnings 2026-07-26 22:17:01 -04:00
Jon Snow
1db9187c0a disable truncation warnings 2026-07-26 22:16:38 -04:00
Nate Bargmann
c7fb0fa148
Merge GitHub PR #2108 2026-07-25 12:36:52 -05:00
Jon Snow
6cbc4f5a70 fix formatting 2026-07-25 12:54:02 -04:00
David Christle
ee57b43282
fix(dummy): prevent get_level buffer overflow
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()")
2026-07-25 01:45:24 -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
Jon Snow
00ce86d038
Merge branch 'Hamlib:master' into master 2026-07-24 21:38:46 -04:00
Nate Bargmann
616c1ff953
Merge GitHub PR #2098 2026-07-24 19:03:16 -05:00
Nate Bargmann
82db1d2d09
Merge GitHub PR #2092 2026-07-24 18:23:31 -05:00
Christoph Berg
3840e1ed84 IC-7610, IC-7760: Implement SYNC
\set_func SYNC is called "Tracking" in the IC-7610 main menu.
2026-07-21 17:48:28 +02:00
Jon Snow
ac05900450 add PR comments, change rig and folder name 2026-07-12 13:38:06 -04:00
Jon Snow
8d157a09a8
Merge branch 'Hamlib:master' into master 2026-07-11 23:51:22 -04:00
Nate Bargmann
a475dad9d7
Merge GitHub PR #2088 2026-07-09 11:24:06 -05:00
Nate Bargmann
6da672e3a6
Merge GitHub PR #2086 2026-07-09 07:01:33 -05:00
KJ5HST
9fe116a417 ftx1: stop an ATAS tuner with AC120, not the rejected AC000
Hardware-verified on an FTX-1 + ATAS-120A: with an ATAS selected, the general
AC000 stop is rejected ('?'), and because newcat does not read the AC reply
that '?' leaked into the next command. Route RIG_FUNC_TUNER off by the active
antenna's tuner type — AC120 for ATAS, AC000 otherwise — matching rad-con.
2026-07-07 14:43:25 -04:00
KJ5HST
af6165a8b2 ftx1: rework RIG_FUNC_TUNER to real AC status + add ATAS manual control
ftx1_set/get_tuner claimed "AC is status-only", gated everything behind
SPA-1, wrote 0/1 into EX030104 (the general select, not an on/off), and
returned ENIMPL for tune. Replace with the hardware-tested AC model:

- get_tuner: read AC and report P3 != '0' (tune active), like rad-con
  Power.isTuning(); no SPA-1 gate.
- set_tuner: mode 0 -> AC000 (stop/bypass); mode 1 -> no-op (the FTX-1 has no
  persistent tuner-on toggle; select type via ext-parms, tune via RIG_OP_TUNE).
- Add ftx1_atas_ctrl() (AC120 stop / AC121 up / AC122 down / AC123 start),
  mirroring rad-con's AtasTunerProvider, exposed as the write-only ATAS_CTRL
  ext-parm (synthetic non-menu token, dispatched directly).
2026-07-07 14:43:25 -04:00
KJ5HST
771b5b3c3c ftx1: correct the antenna-tuner menu model (EX030104 vs per-antenna type)
The driver conflated GENERAL TUNER SELECT (EX030104, 0=Option/1=ATAS) with
the per-antenna tuner type (EX030701/2, 0=INT/1=INT_FAST/2=EXT/3=ATAS) and
gated EXT/ATAS selection + HF antenna select behind SPA-1. On a field head
(or any head with an ATAS/EXT antenna) that wrongly blocked tuner setup.

- GEN_TUNER_SELECT: range 0-3 -> 0-1 (Option/ATAS), in both the menu table
  (set-time validation) and the ext-parm descriptor (caps.extparms).
- OPT_TUNER_ANT1/ANT2 + OPT_HF_ANT_SEL: drop FTX1_MENU_FLAG_SPA1 — EXT/ATAS
  tuning and antenna select work on any head; only INT/INT_FAST need SPA-1,
  which the radio enforces itself. Power-limit items (EX030705-11) stay gated.
- Fix the ftx1_ext.c guardrail (EX030104 no longer SPA-1-gated; the OPTION
  gate now applies only to power items >= 5) and the header/tuner_select docs.

Menu model hardware-verified on an FTX-1 + ATAS-120A: EX030704=ANT1,
EX030701=ATAS matched the physical setup.
2026-07-07 14:43:25 -04:00
KJ5HST
76427ee7b4 ftx1: fix RIG_OP_TUNE to send AC123 (ATAS)/AC103, not the rejected AC110
RIG_OP_TUNE sent AC110, which the radio rejects with '?;' (P3=0 is
off/stop, not a tune start) — so `vfo_op TUNE` never tuned. Verified on an
FTX-1 + ATAS-120A: AC110 -> '?;' while AC123 starts an ATAS auto-tune.

Send the tune form for the tuner type selected on the active antenna:
AC123 (P2=2 ATAS, P3=3 start) for ATAS, AC103 (external-port start) for
INT/INT_FAST/EXT, defaulting to AC103 on read failure. Drop the SPA-1 gate
here: EXT/ATAS tune on any head type; only INT/INT(FAST) need SPA-1, which
the radio enforces itself.

Add ftx1_get_effective_tuner_type() (active antenna EX030704 -> per-antenna
type EX030701/2), mirroring the hardware-tested rad-con model.
2026-07-07 14:43:25 -04:00
George Baltz N3GB
1a46034995 Fix typo in cache invalidation logic
Misplaced close-paren in if statement caused "IF" command to be cached,
  even if rig settings were changed. Note that the last if-clause would
  never be evaluated as true due to the strlen() in the first clause.
2026-07-06 12:45:45 -04:00
Matt
332d76b61f Rewrite AT-D578UVIII backend with dual-mode serial protocol support
Add runtime-selectable dual-mode operation to the AnyTone AT-D578UVIII
backend via a -C commode= config flag on the existing model 37001.

Default mode (commode=0) uses the direct serial mic protocol for PTT
with no handshake and no radio display lockout. COM mode (commode=1)
uses the BT-01 ADATA protocol for PTT, get/set frequency, get/set VFO,
and set clock — the radio displays "EXTERNAL CABLE MODE" while connected.

The keepalive thread checks transaction_active before sending so that
raw commands via rigctld's w interface pass through without collision,
enabling third-party software to use undocumented ADATA commands through
the driver's managed session.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-07-04 16:33:10 -04:00
Jon Snow
064828f410 ATS Mini basic functionality 2026-07-04 16:15:57 -04:00
George Baltz N3GB
d633ccf263 Another place to treat TS-790 like TS-50 and TS-940
Add TS-790 to rigs needing change FR->FN, and make it mutually exclusive
  to addition of ";FT#".

Part of issue #2084
2026-07-03 10:40:50 -04:00
George Baltz N3GB
751ae294db Make TS-790 match TS-50 & TS-940
These rigs are of the same vintage, and the command set is very similar.
2026-07-02 12:07:17 -04:00
George Baltz N3GB
32fbe874e5 Make a few Icom switches boolean
Note that variables x1cx03_possibly and x1ax03_supported are declared
  and defined for several rigs, but those variables are not currently
  referenced or tested in the code.
2026-06-30 11:00:38 -04:00
George Baltz N3GB
9fbfaf08fe Make more variables boolean
Clean up formatting in newcat.h
2026-06-28 18:20:22 -04:00
George Baltz N3GB
4c84693d5d Make some flags boolean
Show that there are only two states for these variables.
2026-06-24 17:52:23 -04:00
George Baltz N3GB
2360882b0c Still more scope shrinkage 2026-06-23 22:55:11 -04:00
George Baltz N3GB
e00b1baed9 Clean up what we can in rigs/dummy/ 2026-06-23 12:13:22 -04:00
George Baltz N3GB
88ba3e3bad Reduce some more scoping 2026-06-23 12:13:22 -04:00
George Baltz N3GB
7b8dbf50d2 Still more scope reductions 2026-06-23 12:13:22 -04:00