feat(kpa1500): pure CAT codec for telemetry + control (FR-AMP-02) - #184
Open
dc0sk wants to merge 1 commit into
Open
feat(kpa1500): pure CAT codec for telemetry + control (FR-AMP-02)#184dc0sk wants to merge 1 commit into
dc0sk wants to merge 1 commit into
Conversation
Add the dependency-free `k4-kpa` crate: control-command encoders and a response parser into a `KpaState`, built from the KPA1500 Programming Reference V3 wire formats (read in full — not guessed). Encoders: operate/standby (^OS), ATU tune/cancel (^FT/^FE), ATU mode (^AM), antenna select (^AN, two-digit form to avoid ^AN0 = "next"), power (^ON). Parser: ^OS mode, ^WS (forward power + SWR in one reply), ^SW, ^PWF/^PWR power, ^TM temperature, ^FL hex fault code + description table, ^BN band, ^AI/^AM ATU state, ^AN antenna, ^FS fan, ^TP tune-in-progress, ^RVM firmware, ^SN serial, ^I identity. Every field stays None until the amp reports it, and a malformed or bare-tag fragment never blanks an already-known field (a clobber bug the fragment test caught and fixed). Pure L1 slice — no socket I/O or UI yet; the poll loop and mini-panel are the next slice. Nine `fr_amp_02_*` tests; `xtask trace` covers FR-AMP-02. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KiAgfnGv746wwVBSfFkoRY
This was referenced Aug 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Second slice of KPA1500 support: the pure
k4-kpacrate — a dependency-free CAT codec that encodes the amplifier's control commands and parses its telemetry into aKpaState. Built from the KPA1500 Programming Reference V3 wire formats (read end to end, not guessed — theRO/RAlesson).What's in it
catmodule): operate/standby^OS, ATU tune/cancel^FT/^FE, ATU mode^AM, antenna select^AN(two-digit^AN01;..^AN32;to avoid^AN0;= "next antenna"), power^ON.apply→KpaState):^OSmode,^WS(forward power + SWR in one reply),^SWSWR,^PWF/^PWRpower,^TMtemperature,^FLhex fault code + description table,^BNband,^AI/^AMATU state,^ANantenna,^FSfan,^TPtune-in-progress,^RVMfirmware,^SNserial,^Iidentity.Noneuntil the amp reports it; a malformed or bare-tag fragment never matches and never blanks an already-known field.Scope / evidence
Pure L1 slice — no socket I/O or UI yet. The TCP poll loop, lifecycle gating (connect on K4 auth), and the amp mini-panel are the next slice. Evidence is unit-only, and the ledger says so.
Verification
fr_amp_02_*unit tests — encoder wire forms, two-digit antenna bounds, each telemetry field,^WScombined power+SWR, hex fault decode + text, identity/firmware/serial (RVM ≠ RV), parse bounds, and a noise/fragment test that caught and fixed a clobber bug.cargo fmt/clippy --all-targets -D warnings/ full workspace tests — green (pre-commit gate).xtask trace— green; FR-AMP-02 covered.🤖 Generated with Claude Code