[refactor](trx-server): use trx-app for shared infrastructure
Replace server's local implementations with unified trx-app utilities. Changes: - Use trx_app::normalize_name() instead of local fn - Depend on trx-app crate This eliminates the server's copy of the normalize_name logic and ensures both server and client use the same implementation. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com> Signed-off-by: Stanislaw Grams <stanislawgrams@gmail.com>
This commit is contained in:
@@ -7,6 +7,7 @@ members = [
|
|||||||
"src/trx-ft8",
|
"src/trx-ft8",
|
||||||
"src/trx-core",
|
"src/trx-core",
|
||||||
"src/trx-protocol",
|
"src/trx-protocol",
|
||||||
|
"src/trx-app",
|
||||||
"src/trx-server",
|
"src/trx-server",
|
||||||
"src/trx-server/trx-backend",
|
"src/trx-server/trx-backend",
|
||||||
"src/trx-server/trx-backend/trx-backend-ft817",
|
"src/trx-server/trx-backend/trx-backend-ft817",
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ libloading = "0.8"
|
|||||||
bytes = "1"
|
bytes = "1"
|
||||||
cpal = "0.15"
|
cpal = "0.15"
|
||||||
opus = "0.3"
|
opus = "0.3"
|
||||||
|
trx-app = { path = "../trx-app" }
|
||||||
trx-backend = { path = "trx-backend" }
|
trx-backend = { path = "trx-backend" }
|
||||||
trx-core = { path = "../trx-core" }
|
trx-core = { path = "../trx-core" }
|
||||||
trx-ft8 = { path = "../trx-ft8" }
|
trx-ft8 = { path = "../trx-ft8" }
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ use tracing::{error, info};
|
|||||||
|
|
||||||
use trx_core::audio::AudioStreamInfo;
|
use trx_core::audio::AudioStreamInfo;
|
||||||
|
|
||||||
|
use trx_app::normalize_name;
|
||||||
use trx_backend::{is_backend_registered, register_builtin_backends, registered_backends, RigAccess};
|
use trx_backend::{is_backend_registered, register_builtin_backends, registered_backends, RigAccess};
|
||||||
use trx_core::rig::controller::{AdaptivePolling, ExponentialBackoff};
|
use trx_core::rig::controller::{AdaptivePolling, ExponentialBackoff};
|
||||||
use trx_core::rig::request::RigRequest;
|
use trx_core::rig::request::RigRequest;
|
||||||
@@ -76,14 +77,6 @@ enum AccessKind {
|
|||||||
Tcp,
|
Tcp,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Normalize a rig name to lowercase alphanumeric.
|
|
||||||
fn normalize_name(name: &str) -> String {
|
|
||||||
name.to_ascii_lowercase()
|
|
||||||
.chars()
|
|
||||||
.filter(|c| c.is_ascii_alphanumeric())
|
|
||||||
.collect()
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Parse a serial rig address of the form "<path> <baud>".
|
/// Parse a serial rig address of the form "<path> <baud>".
|
||||||
fn parse_serial_addr(addr: &str) -> DynResult<(String, u32)> {
|
fn parse_serial_addr(addr: &str) -> DynResult<(String, u32)> {
|
||||||
let mut parts = addr.split_whitespace();
|
let mut parts = addr.split_whitespace();
|
||||||
|
|||||||
Reference in New Issue
Block a user