From 11f1a095f671fa0bd4acc5edbee1550a1951f052 Mon Sep 17 00:00:00 2001 From: Stanislaw Grams Date: Fri, 6 Feb 2026 23:02:03 +0100 Subject: [PATCH] [docs](trx-rs): update docs and split example configs Replace trx-rs.toml.example with separate trx-server.toml.example and trx-client.toml.example. Update OVERVIEW.md and README.md references from trx-bin to trx-server/trx-client. Co-Authored-By: Claude Opus 4.6 Signed-off-by: Stanislaw Grams --- OVERVIEW.md | 24 +++++++------ README.md | 4 +-- trx-client.toml.example | 53 +++++++++++++++++++++++++++ trx-rs.toml.example | 79 ----------------------------------------- trx-server.toml.example | 50 ++++++++++++++++++++++++++ 5 files changed, 119 insertions(+), 91 deletions(-) create mode 100644 trx-client.toml.example delete mode 100644 trx-rs.toml.example create mode 100644 trx-server.toml.example diff --git a/OVERVIEW.md b/OVERVIEW.md index d5eba1b..9cf2855 100644 --- a/OVERVIEW.md +++ b/OVERVIEW.md @@ -34,7 +34,7 @@ ``` ┌──────────────────────────────────────────────────────────────────────────┐ -│ trx-bin │ +│ trx-server/trx-client │ │ ┌────────────────────────────────────────────────────────────────────┐ │ │ │ Application │ │ │ │ ┌──────────────┐ ┌──────────────┐ ┌──────────────────────────┐ │ │ @@ -83,7 +83,8 @@ | `trx-frontend-http-json` | JSON-over-TCP control frontend | | `trx-frontend-qt` | Qt/QML GUI frontend (Linux only, optional) | | `trx-frontend-rigctl` | Hamlib rigctl-compatible TCP interface | -| `trx-bin` | Main executable with config file support | +| `trx-server` | Server binary — connects to rig backend, exposes JSON TCP control | +| `trx-client` | Client binary — connects to server, runs frontends (HTTP, rigctl, Qt) | --- @@ -92,7 +93,7 @@ trx-rs supports TOML configuration files with the following search order: 1. `--config ` (explicit CLI argument) -2. `./trx-rs.toml` (current directory) +2. `./trx-server.toml` or `./trx-client.toml` (current directory) 3. `~/.config/trx-rs/config.toml` (XDG user config) 4. `/etc/trx-rs/config.toml` (system-wide) @@ -151,7 +152,7 @@ max_retries = 3 retry_base_delay_ms = 100 ``` -Use `trx-bin --print-config` to generate an example configuration. +Use `trx-server --print-config` or `trx-client --print-config` to generate an example configuration. --- @@ -199,7 +200,7 @@ Implemented commands: - `ToggleVfoCommand`, `LockCommand`, `UnlockCommand` - `GetTxLimitCommand`, `SetTxLimitCommand`, `GetSnapshotCommand` -The rig task (`trx-bin/src/rig_task.rs`) now syncs the state machine to the live `RigState` +The rig task (`trx-server/src/rig_task.rs`) now syncs the state machine to the live `RigState` and emits events whenever rig status changes. ### Event Notifications (`events.rs`) @@ -317,14 +318,17 @@ impl RigError { # Build cargo build --release -# Run with CLI args -./target/release/trx-bin -r ft817 "/dev/ttyUSB0 9600" +# Run server with CLI args +./target/release/trx-server -r ft817 "/dev/ttyUSB0 9600" -# Run with config file -./target/release/trx-bin --config /path/to/config.toml +# Run server with config file +./target/release/trx-server --config /path/to/config.toml + +# Run client +./target/release/trx-client --config /path/to/client-config.toml # Print example config -./target/release/trx-bin --print-config > trx-rs.toml +./target/release/trx-server --print-config > trx-server.toml # Run tests cargo test diff --git a/README.md b/README.md index 62a190c..e6c65d2 100644 --- a/README.md +++ b/README.md @@ -22,8 +22,8 @@ The rig task is now driven by the controller components (state machine, handlers ## Plugin discovery -`trx-bin` can load shared-library plugins that register backends/frontends via a -`trx_register` entrypoint. Search paths: +`trx-server` and `trx-client` can load shared-library plugins that register backends/frontends +via a `trx_register` entrypoint. Search paths: - `./plugins` - `~/.config/trx-rs/plugins` diff --git a/trx-client.toml.example b/trx-client.toml.example new file mode 100644 index 0000000..c0d5eef --- /dev/null +++ b/trx-client.toml.example @@ -0,0 +1,53 @@ +# trx-client Configuration File +# +# Copy this file to one of: +# ./trx-client.toml (current directory) +# ~/.config/trx-rs/client.toml (user config) +# /etc/trx-rs/client.toml (system-wide) +# +# Or specify a custom path with: trx-client --config /path/to/config.toml +# +# CLI arguments override config file values. + +[general] +# Callsign or station identifier displayed in frontends +callsign = "N0CALL" + +# Log level: trace, debug, info, warn, error +# log_level = "info" + +[remote] +# Remote trx-server URL (host:port) +url = "192.168.1.100:9000" + +# Poll interval in milliseconds +poll_interval_ms = 750 + +[remote.auth] +# Bearer token for authenticating with the remote server +token = "my-token" + +[frontends.http] +# Enable HTTP/REST frontend with SSE for real-time updates +enabled = true +listen = "127.0.0.1" +port = 8080 + +[frontends.rigctl] +# Enable rigctl-compatible TCP interface (hamlib compatible) +enabled = false +listen = "127.0.0.1" +port = 4532 + +[frontends.http_json] +# Enable JSON-over-TCP control interface +enabled = true +listen = "127.0.0.1" +# Set to 0 to bind an ephemeral port +port = 0 +# List of accepted bearer tokens (empty = no auth) +# auth.tokens = ["example-token"] + +[frontends.qt] +# Enable Qt/QML GUI frontend (Linux only, requires system Qt6) +enabled = false diff --git a/trx-rs.toml.example b/trx-rs.toml.example deleted file mode 100644 index 31fb9df..0000000 --- a/trx-rs.toml.example +++ /dev/null @@ -1,79 +0,0 @@ -# trx-rs Configuration File -# -# Copy this file to one of: -# ./trx-rs.toml (current directory) -# ~/.config/trx-rs/config.toml (user config) -# /etc/trx-rs/config.toml (system-wide) -# -# Or specify a custom path with: trx-bin --config /path/to/config.toml -# -# CLI arguments override config file values. - -[general] -# Callsign or station identifier displayed in frontends -callsign = "N0CALL" - -# Log level: trace, debug, info, warn, error -# log_level = "info" - -[rig] -# Rig model: ft817 (more models coming) -model = "ft817" -# Initial frequency (Hz) before first CAT read -initial_freq_hz = 144300000 -# Initial mode before first CAT read (LSB, USB, CW, CWR, AM, WFM, FM, DIG, PKT) -initial_mode = "USB" - -[rig.access] -# Access type: "serial" or "tcp" -type = "serial" - -# Serial port settings (when type = "serial") -port = "/dev/ttyUSB0" -baud = 9600 - -# TCP settings (when type = "tcp") -# host = "192.168.1.100" -# tcp_port = 4532 - -[frontends.http] -# Enable HTTP/REST frontend with SSE for real-time updates -enabled = true -listen = "127.0.0.1" -port = 8080 - -[frontends.rigctl] -# Enable rigctl-compatible TCP interface (hamlib compatible) -enabled = false -listen = "127.0.0.1" -port = 4532 - -[frontends.http_json] -# Enable JSON-over-TCP control interface -enabled = true -listen = "127.0.0.1" -# Set to 0 to bind an ephemeral port -port = 0 -# List of accepted bearer tokens (empty = no auth) -# auth.tokens = ["example-token"] - -[frontends.qt] -# Enable Qt/QML GUI frontend (Linux only, requires system Qt6) -enabled = false -# Use remote JSON TCP server instead of local rig task -# remote.enabled = true -# remote.url = "127.0.0.1:9000" -# remote.auth.token = "example-token" - -[behavior] -# Polling interval when idle (milliseconds) -poll_interval_ms = 500 - -# Polling interval when transmitting (milliseconds) -poll_interval_tx_ms = 100 - -# Maximum retry attempts for transient errors -max_retries = 3 - -# Base delay for exponential backoff (milliseconds) -retry_base_delay_ms = 100 diff --git a/trx-server.toml.example b/trx-server.toml.example new file mode 100644 index 0000000..0a67fe2 --- /dev/null +++ b/trx-server.toml.example @@ -0,0 +1,50 @@ +# trx-server Configuration File +# +# Copy this file to one of: +# ./trx-server.toml (current directory) +# ~/.config/trx-rs/server.toml (user config) +# /etc/trx-rs/server.toml (system-wide) +# +# Or specify a custom path with: trx-server --config /path/to/config.toml +# +# CLI arguments override config file values. + +[general] +# Callsign or station identifier +callsign = "N0CALL" + +# Log level: trace, debug, info, warn, error +# log_level = "info" + +[rig] +# Rig model: ft817 (more models coming) +model = "ft817" +# Initial frequency (Hz) before first CAT read +initial_freq_hz = 144300000 +# Initial mode before first CAT read (LSB, USB, CW, CWR, AM, WFM, FM, DIG, PKT) +initial_mode = "USB" + +[rig.access] +# Access type: "serial" or "tcp" +type = "serial" + +# Serial port settings (when type = "serial") +port = "/dev/ttyUSB0" +baud = 9600 + +# TCP settings (when type = "tcp") +# host = "192.168.1.100" +# tcp_port = 4532 + +[behavior] +# Polling interval when idle (milliseconds) +poll_interval_ms = 500 + +# Polling interval when transmitting (milliseconds) +poll_interval_tx_ms = 100 + +# Maximum retry attempts for transient errors +max_retries = 3 + +# Base delay for exponential backoff (milliseconds) +retry_base_delay_ms = 100