Safety-focused patch release. Started as a fix for the Yaesu HF serial-framing bug reported in issue #12, then expanded into a full seven-vendor Hamlib parity audit after the initial fix uncovered several more latent safety-critical bugs.
Full detail in the CHANGELOG entry.
Fixed — safety-critical (would key TX or transmit on wrong VFO)
- Kenwood
setPTT(false)no longer keys the transmitter. Pre-fix code sentTX0;for PTT-off, but on KenwoodTX0;means "PTT on via mic port" — the opposite of releasing PTT. EverysetPTT(false)call was keying the radio. Now sends bareRX;per Hamlibkenwood_set_ptt. - Kenwood
getPTT()no longer keys on every poll. Pre-fix code sent theTX;set command to query PTT state, keying the radio every time. Now readsIF;response byte 28 per Hamlibkenwood_get_ptt. - Yaesu
setSplit()no longer risks TX on the wrong VFO. Pre-fix code sentFT0;/FT1;— butFTon modern Yaesu radios is TX-VFO selection, not split. SendingFT1;for "enable split" would silently reassign which VFO transmits. Now usesST0;/ST1;per Hamlibnewcat_set_split. On radios withoutSTsupport (FT-950/891/991/2000/DX3000/5000/1200/9000) the method throws explicitly rather than silently doing the wrong thing. - Yaesu
selectVFO()uses the correct FT encoding per model. On FT-950/2000/DX3000/5000/1200/991(A)/DX10/DX101(D/MP),FT2;selects VFO A andFT3;selects VFO B (FT0;/FT1;toggle the TX function on those radios). On FT-710/450, classicFT0;/FT1;applies. On FT-891, theFTcommand doesn't exist at all — the method throws. - Yaesu
getPTT()recognizesTX2;/TX3;as transmitting. Pre-fix code only checked forTX1;and misreported data-jack PTT (TX2) and CAT-port PTT (TX3) as RX. A UI that polled PTT would show the radio idle while it was actually keyed.
Fixed — per-radio serial framing
- Per-radio stop bits and hardware handshake now propagate through
RigControllerintoSerialConfiguration. Pre-fix code left every serial-connected radio atSerialConfiguration.initdefaults (8-N-1, no flow control). Correct for Icom, wrong for every modern Yaesu HF radio except FT-710 (needs 8-N-2) and desktop Kenwood TS-590/990S/2000/570/TH-D72 (needs RTS/CTS). - Serial framing corrected for TS-570D, TS-570S, TH-D72, TH-D72A (→
.kenwoodDesktop), TS-850S (→ new.kenwoodLegacy, 8-N-2 + HW), and Elecraft K2 (→ new.elecraftK2, 8-N-2 no HW). - Lab599 TX-500 baud rate corrected 115200 → 9600 (Hamlib locks it there — the pre-fix code left the radio completely unresponsive).
- Yaesu FT-891
hasSplitcapability corrected tofalse— the radio has no CAT path to establish split.
Fixed — protocol correctness
- Kenwood mode-code table completed. Mode code
8(FSK-R / RTTY-R) now round-trips per Hamlibts990s.c:92. - Elecraft K2 post-write delay 50ms → 100ms per Hamlib
k2.c:137. Pre-fix value could drop bytes under sustained command sequences. - Elecraft K2 response timeout 1s → 2s per Hamlib
k2.c:139(K2 can take up to 500ms on band-change frequency sets). K3 and later stay at 1s via per-instance resolution. - Ten-Tec Legacy (Jupiter/Pegasus) frequency encoding rewritten. Pre-fix code sent decimal ASCII that the radios silently ignored. Now emits three 16-bit binary tuning factors per Hamlib
tentec_tuning_factor_calc. Unit-tested against hand-computed reference values for USB/LSB/CW/AM. Baud rate also corrected 38400 → 57600.
Added
RadioDefinition.SerialDefaults— new value type carrying stop bits, parity, and hardware/software flow control. Named profiles:.standard,.yaesuHFDesktop,.yaesuHFPortable,.kenwoodDesktop,.kenwoodLegacy,.elecraftK2,.tentecModern.RadioDefinition.initgains an optionalserialDefaults:parameter defaulting to.standardfor source compatibility.YaesuCATProtocol.Quirks— per-model behavioural quirks (ST-split support, FT encoding variants) sourced from Hamlibnewcat.c'svalid_commandstable. Named profiles:.classic,.newcatNoST,.newcatWithSTDX,.ft710,.ft450,.ft891.- Ten-Tec radio factories now public.
RadioDefinition.TenTec.orion/.orionII/.eagle/.jupiter/.pegasus. AllverificationStatus: .definition— the wire protocols match Hamlib but no radio has been driven against real hardware since the fixes.
Compatibility
No API breakage. All new parameters are optional with defaults that preserve pre-v1.1.2 behaviour for callers that don't opt in. Downstream apps should bump when convenient; the Kenwood PTT fixes are safety-relevant for anyone driving a Kenwood radio over CAT.
Audit provenance
Seven-agent Hamlib parity audit (Icom, Yaesu, Kenwood + THD72, Elecraft, Xiegu/Lab599/Flex, Ten-Tec, cross-vendor connect-path safety). Icom, connect-path, and Ten-Tec Orion vendors passed cleanly. Every fix cites the Hamlib source file:line in code comments.
Regression coverage
- New
Tier1SafetyFixesTests(16 tests) pins every Tier 1 safety fix to the exact wire semantics we now guarantee. - New
SerialDefaultsTests(24 tests) verifies per-radio profile assignments across every affected radio. - New
TenTecTuningFactorTests(5 tests) validates the portedtentec_tuning_factor_calcagainst hand-computed Hamlib reference values. - New
TenTecRadioDefinitionsTestsandElecraftResponseTimeoutTestscover the exposed factories and K2 timeout.
Test status: 521 tests, 0 failures (up from 459 in v1.1.1). Zero new compiler warnings under Swift 6 strict concurrency.
Deferred to v1.2.0
K2 hardware re-verification at 8-N-2, K2 extended-power probing (K22;), baud-rate range API on RadioDefinition, Kenwood mic/data PTT variants, Ten-Tec hardware validators. Tracked in ROADMAP Phase 5.8.