Snapshot.
This commit is contained in:
@@ -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
|
transceiver via a serial port and stores the results in a CSV file
|
||||||
so you can run analysis in another program.
|
so you can run analysis in another program.
|
||||||
|
|
||||||
Inspired by "RFIM" by W4DD and written in Rust.
|
Inspired by RFI Mapper (RFIM) by [W4DD](https://www.qrz.com/db/W4DD)
|
||||||
(add a link here to W4DD's RFI materials)
|
and written in Rust.
|
||||||
|
|
||||||
# Use Cases
|
# Use Cases
|
||||||
- Drive a route and measure variation in noise level, to determine local noise sources
|
- Drive a route and measure variation in noise level, to determine local noise sources
|
||||||
|
|||||||
+8
-6
@@ -115,10 +115,11 @@ struct Rig {
|
|||||||
data_bits: DataBits,
|
data_bits: DataBits,
|
||||||
stop_bits: StopBits,
|
stop_bits: StopBits,
|
||||||
parity: Parity,
|
parity: Parity,
|
||||||
|
s_meter_cat: String
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create a rig struct
|
// 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 {
|
Rig {
|
||||||
name: name.to_string(),
|
name: name.to_string(),
|
||||||
baud_rate,
|
baud_rate,
|
||||||
@@ -139,7 +140,8 @@ fn build_rig(name: &str, baud_rate: u32, data_bits: u8, stop_bits: u8, parity: &
|
|||||||
"odd" => Parity::Odd,
|
"odd" => Parity::Odd,
|
||||||
"even" => Parity::Even,
|
"even" => Parity::Even,
|
||||||
_ => Parity::None,
|
_ => 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/
|
// https://kevinlynagh.com/notes/match-vs-lookup/
|
||||||
fn get_rig(x: &str) -> Rig {
|
fn get_rig(x: &str) -> Rig {
|
||||||
match x {
|
match x {
|
||||||
"qmx" => build_rig("qmx", 4800, 8, 2, "none"),
|
"qmx" => build_rig("qmx", 9600, 8, 2, "none", "SM"),
|
||||||
"ic-7300" => build_rig("ic-7300", 115200, 8, 1, "none"),
|
"ic-7300" => build_rig("ic-7300", 115200, 8, 1, "none", "1502"),
|
||||||
_ => {
|
_ => {
|
||||||
// This prints a message every loop but that's OK.
|
// This prints a message every loop but that's OK.
|
||||||
println!("Rig '{x}' in rig list. Using default connection values.");
|
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!
|
// Duh, you need the ";" on the end!
|
||||||
// let output = "FA14075000;"; // set VFO A frequency
|
// let output = "FA14075000;"; // set VFO A frequency
|
||||||
// let output = "FA;"; // ask for 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?
|
// What are we actually sending?
|
||||||
//dbg!(output.as_bytes());
|
//dbg!(output.as_bytes());
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user