diff --git a/.gitmodules b/.gitmodules index dc8e78f..a01b68d 100644 --- a/.gitmodules +++ b/.gitmodules @@ -5,6 +5,3 @@ [submodule "docs"] path = docs url = http://github.com/sgrams/trx-rs.wiki.git -[submodule "external/ft8_lib"] - path = external/ft8_lib - url = ssh://git@github.com/sgrams/ft8_lib.git diff --git a/CLAUDE.md b/CLAUDE.md index cd925b1..445bc93 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -54,7 +54,7 @@ src/ decoders/ trx-aprs/ # APRS packet decoder trx-cw/ # CW (Morse) decoder - trx-ft8/ # FT8 decoder (wraps external ft8_lib C library) + trx-ftx/ # Pure Rust FTx decoder (FT8/FT4/FT2) trx-wspr/ # WSPR decoder trx-decode-log/ # Shared decoder logging (JSON Lines, date-rotated files) ``` @@ -86,7 +86,7 @@ The rig controller (`src/trx-core/src/rig/controller/`) is the central state man ### Decoders -Signal decoders run as background tasks in `trx-server`, consuming decoded audio. `trx-ft8` wraps a C library (`external/ft8_lib`). Decoded frames can be forwarded to PSKReporter and APRS-IS (IGate) uplinks, or logged via `trx-decode-log`. +Signal decoders run as background tasks in `trx-server`, consuming decoded audio. `trx-ftx` provides the FT8/FT4/FT2 decoder in pure Rust. Decoded frames can be forwarded to PSKReporter and APRS-IS (IGate) uplinks, or logged via `trx-decode-log`. ### Plugin system diff --git a/OVERVIEW.md b/OVERVIEW.md index dfebfb1..1651f0c 100644 --- a/OVERVIEW.md +++ b/OVERVIEW.md @@ -52,7 +52,7 @@ Target users are amateur radio operators who want networked, automated, or multi | CAT serial | tokio-serial | | CLI | clap | | Logging | tracing / tracing-subscriber | -| FT8 decode | ft8_lib (external C library via FFI) | +| FTx decode | trx-ftx (pure Rust) | --- @@ -144,7 +144,7 @@ trx-rs/ # Workspace root └── decoders/ ├── trx-aprs/ # APRS packet decoder ├── trx-cw/ # CW / Morse decoder - ├── trx-ft8/ # FT8 decoder (wraps ft8_lib C library) + ├── trx-ftx/ # Pure Rust FTx decoder (FT8/FT4/FT2) ├── trx-wspr/ # WSPR beacon decoder ├── trx-rds/ # FM RDS decoder └── trx-decode-log/ # JSON Lines log rotation for decoded frames @@ -704,7 +704,7 @@ All decoders run as background Tokio tasks inside `trx-server`. They subscribe t |-------|---------|-------| | `trx-aprs` | APRS (AX.25) | Forwards to APRS-IS if enabled | | `trx-cw` | CW / Morse | Auto WPM detection | -| `trx-ft8` | FT8 | Wraps `external/ft8_lib` C library via FFI; posts to PSKReporter | +| `trx-ftx` | FTx | Pure Rust FT8/FT4/FT2 decoder; posts to PSKReporter | | `trx-wspr` | WSPR beacons | Posts to PSKReporter | | `trx-rds` | FM RDS | Station name, radiotext, time | | `trx-decode-log` | Logging infrastructure | JSON Lines, date-rotated files | diff --git a/external/ft8_lib b/external/ft8_lib deleted file mode 160000 index f5421c3..0000000 --- a/external/ft8_lib +++ /dev/null @@ -1 +0,0 @@ -Subproject commit f5421c3972ac97e585ef1f7720e87e8c8e5b2746 diff --git a/src/decoders/trx-ftx/FTX_CRATE.md b/src/decoders/trx-ftx/FTX_CRATE.md index 6a350c9..d789843 100644 --- a/src/decoders/trx-ftx/FTX_CRATE.md +++ b/src/decoders/trx-ftx/FTX_CRATE.md @@ -2,9 +2,9 @@ ## Goal -Replace `trx-ft8` (C FFI wrapper around ft8_lib + custom FT2 code) with a pure Rust -implementation. The new `trx-ftx` crate provides the exact same public API -(`Ft8Decoder`, `Ft8DecodeResult`) so it is a drop-in replacement. +`trx-ftx` is the pure Rust replacement for the old `trx-ft8` C FFI wrapper. +It provides the same public API (`Ft8Decoder`, `Ft8DecodeResult`) so it can +serve as a drop-in decoder implementation. ## Why @@ -85,21 +85,22 @@ hound = "3" # WAV file reading for integration tests ### Phase 5: Migration 14. Convert `trx-ft8` to thin re-export of `trx-ftx` 15. Delete C sources: `ft8_wrapper.c`, `ft2_ldpc.c`, `build.rs` +16. Remove the vendored `ft8_lib` checkout after the port is complete -## C Sources Being Ported +## Historical C Sources Ported | C Source | Rust Target | Lines | |----------|-------------|-------| -| `external/ft8_lib/ft8/message.c` | `message.rs` | 1156 | +| `ft8_lib/ft8/message.c` | `message.rs` | 1156 | | `src/decoders/trx-ft8/src/ft8_wrapper.c` | `decoder.rs` + `ft2/` | 1800 | -| `external/ft8_lib/ft8/decode.c` | `decode.rs` | 773 | -| `external/ft8_lib/ft8/constants.c` | `constants.rs` | 391 | -| `external/ft8_lib/ft8/text.c` | `text.rs` | 303 | -| `external/ft8_lib/common/monitor.c` | `monitor.rs` | 261 | -| `external/ft8_lib/ft8/ldpc.c` | `ldpc.rs` | 251 | -| `external/ft8_lib/ft8/encode.c` | `encode.rs` | 200 | -| `external/ft8_lib/ft8/crc.c` | `crc.rs` | 63 | -| `external/ft8_lib/fft/*.c` | replaced by `rustfft` | 555 | +| `ft8_lib/ft8/decode.c` | `decode.rs` | 773 | +| `ft8_lib/ft8/constants.c` | `constants.rs` | 391 | +| `ft8_lib/ft8/text.c` | `text.rs` | 303 | +| `ft8_lib/common/monitor.c` | `monitor.rs` | 261 | +| `ft8_lib/ft8/ldpc.c` | `ldpc.rs` | 251 | +| `ft8_lib/ft8/encode.c` | `encode.rs` | 200 | +| `ft8_lib/ft8/crc.c` | `crc.rs` | 63 | +| `ft8_lib/fft/*.c` | replaced by `rustfft` | 555 | ## Public API (matches trx-ft8 exactly) @@ -129,5 +130,5 @@ impl Ft8Decoder { ## Testing Strategy - Unit tests per module: CRC round-trip, LDPC recovery, message pack/unpack -- Integration tests: decode WAV files from `external/ft8_lib/test/wav/` +- Integration tests: decode reference WAV fixtures when available - Compatibility test: `ft2_uses_distinct_block_size` (FT4=576, FT2=288, window=45000)