Skip to content

feat(kpa1500): pure CAT codec for telemetry + control (FR-AMP-02) - #184

Open
dc0sk wants to merge 1 commit into
feat/kpa1500-configfrom
feat/kpa1500-client
Open

feat(kpa1500): pure CAT codec for telemetry + control (FR-AMP-02)#184
dc0sk wants to merge 1 commit into
feat/kpa1500-configfrom
feat/kpa1500-client

Conversation

@dc0sk

@dc0sk dc0sk commented Aug 6, 2026

Copy link
Copy Markdown
Owner

Summary

Second slice of KPA1500 support: the pure k4-kpa crate — a dependency-free CAT codec that encodes the amplifier's control commands and parses its telemetry into a KpaState. Built from the KPA1500 Programming Reference V3 wire formats (read end to end, not guessed — the RO/RA lesson).

Stacked on #183 (base feat/kpa1500-config). Review/merge that first.

What's in it

  • Encoders (cat module): 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.
  • Parser (applyKpaState): ^OS mode, ^WS (forward power + SWR in one reply), ^SW SWR, ^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; 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

  • Nine fr_amp_02_* unit tests — encoder wire forms, two-digit antenna bounds, each telemetry field, ^WS combined 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

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant