From 66eeceb728f1814f488b810864469f3774674f4d Mon Sep 17 00:00:00 2001 From: mattbk Date: Sat, 12 Sep 2026 11:27:01 -0500 Subject: [PATCH] Snapshot. --- README.md | 4 ++-- src/main.rs | 14 ++++++++------ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 8ee6d85..17e1572 100644 --- a/README.md +++ b/README.md @@ -5,8 +5,8 @@ This program reads location from a GPS dongle and the S-Meter from a transceiver via a serial port and stores the results in a CSV file so you can run analysis in another program. -Inspired by "RFIM" by W4DD and written in Rust. -(add a link here to W4DD's RFI materials) +Inspired by RFI Mapper (RFIM) by [W4DD](https://www.qrz.com/db/W4DD) +and written in Rust. # Use Cases - Drive a route and measure variation in noise level, to determine local noise sources diff --git a/src/main.rs b/src/main.rs index 63f592e..e6cb995 100644 --- a/src/main.rs +++ b/src/main.rs @@ -115,10 +115,11 @@ struct Rig { data_bits: DataBits, stop_bits: StopBits, parity: Parity, + s_meter_cat: String } // Create a rig struct -fn build_rig(name: &str, baud_rate: u32, data_bits: u8, stop_bits: u8, parity: &str) -> Rig { +fn build_rig(name: &str, baud_rate: u32, data_bits: u8, stop_bits: u8, parity: &str, s_meter_cat: &str) -> Rig { Rig { name: name.to_string(), baud_rate, @@ -139,7 +140,8 @@ fn build_rig(name: &str, baud_rate: u32, data_bits: u8, stop_bits: u8, parity: & "odd" => Parity::Odd, "even" => Parity::Even, _ => Parity::None, - } + }, + s_meter_cat: s_meter_cat.to_string() } } @@ -147,12 +149,12 @@ fn build_rig(name: &str, baud_rate: u32, data_bits: u8, stop_bits: u8, parity: & // https://kevinlynagh.com/notes/match-vs-lookup/ fn get_rig(x: &str) -> Rig { match x { - "qmx" => build_rig("qmx", 4800, 8, 2, "none"), - "ic-7300" => build_rig("ic-7300", 115200, 8, 1, "none"), + "qmx" => build_rig("qmx", 9600, 8, 2, "none", "SM"), + "ic-7300" => build_rig("ic-7300", 115200, 8, 1, "none", "1502"), _ => { // This prints a message every loop but that's OK. println!("Rig '{x}' in rig list. Using default connection values."); - build_rig("qmx", 4800, 8, 2, "none") + build_rig("qmx", 4800, 8, 2, "none", "SM") }, } } @@ -175,7 +177,7 @@ fn get_smeter(comport: &str, rig_name: &str) -> String { // Duh, you need the ";" on the end! // let output = "FA14075000;"; // set VFO A frequency // let output = "FA;"; // ask for VFO A frequency - let output = "SM;"; // ask for S-meter reading + let output = format!("{};", rig.s_meter_cat);//"SM;"; // ask for S-meter reading // What are we actually sending? //dbg!(output.as_bytes());