diff --git a/src/main.rs b/src/main.rs index 84bafcf..87dc15c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -10,7 +10,7 @@ use std::thread::sleep; use std::time::{Duration, SystemTime, UNIX_EPOCH}; use std::net::UdpSocket; use std::net::Ipv4Addr; -use serde_json::json; +use serde_json::{json}; use reqwest; use regex::Regex; use rand::Rng; @@ -393,15 +393,19 @@ fn handle_frame(frame: &AgwFrame, cli: &Cli, buffers: &mut BufferManager, loc_st let my_lon = &cli.my_lon; // Split callsign and SSID if there are both - let (source_call, source_ssid) = if source.contains("-") { + let (source_call, source_ssid): (&String, Option<&String>) = if source.contains("-") { let re_source = Regex::new(r"(?P.*)-(?P[\d])").unwrap(); // Break captures into named values let callssid = re_source.captures(&source).unwrap(); - (&callssid["call"].to_string(), &callssid["ssid"].to_string()) + (&callssid["call"].to_string(), Some(&callssid["ssid"].to_string())) + // Otherwise there is just the call and no SSID } else { - (&source, &"".to_string()) + (&source, None) + //(&source, &String::new()) }; + println!("{:?}",(source_call, source_ssid)); + //println!("{} - {}", source_call, source_ssid); @@ -478,7 +482,7 @@ fn handle_frame(frame: &AgwFrame, cli: &Cli, buffers: &mut BufferManager, loc_st let json_lat = stored_loc[0].clone() ; let json_lon = stored_loc[1].clone() ; - println!("Stored location: {} {}", stored_loc[0].clone(), stored_loc[1].clone()); + //println!("Stored location: {} {}", stored_loc[0].clone(), stored_loc[1].clone()); // If Spothole is enabled if summary == "UI" && cli.spothole {