mirror of
https://gitea.farpn.net/w1cdn/mwtchahrd.git
synced 2025-12-08 13:38:02 -06:00
Compare commits
5 Commits
d95cf3e368
...
ca858bc038
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ca858bc038 | ||
|
|
fd641c1ca1 | ||
|
|
05a6bb18b0 | ||
|
|
85521543c6 | ||
|
|
6bbfa66c4f |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -6,7 +6,7 @@ target/
|
||||
|
||||
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
|
||||
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
|
||||
Cargo.lock
|
||||
#Cargo.lock
|
||||
|
||||
#Cross config
|
||||
Cross.toml
|
||||
|
||||
1882
Cargo.lock
generated
Normal file
1882
Cargo.lock
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,13 +1,15 @@
|
||||
[package]
|
||||
name = "mwtchahrd"
|
||||
version = "0.1.0"
|
||||
version = "0.1.1"
|
||||
edition = "2021"
|
||||
authors = ["Chris, N6CTA <mail@n6cta.com>"]
|
||||
authors = ["Chris, N6CTA <mail@n6cta.com>", "Matt, W1CDN <admin@w1cdn.net>"]
|
||||
|
||||
[dependencies]
|
||||
anyhow = "1.0"
|
||||
chrono = "0.4"
|
||||
clap = { version = "4", features = ["derive"] }
|
||||
openssl-sys = "0.9.111"
|
||||
openssl = { version = "0.10", features = ["vendored"] }
|
||||
rand = "0.9.2"
|
||||
regex = "1.12.2"
|
||||
reqwest = { version = "0.12.24", features = ["json", "blocking"] }
|
||||
@@ -16,3 +18,4 @@ socket2 = "0.5"
|
||||
|
||||
[profile.release]
|
||||
lto = "thin"
|
||||
|
||||
|
||||
7
auto-build-release.sh
Executable file
7
auto-build-release.sh
Executable file
@@ -0,0 +1,7 @@
|
||||
echo "Building release for multiple targets";
|
||||
cargo build --release;
|
||||
cross build --release --target=aarch64-unknown-linux-gnu;
|
||||
cross build --release --target=x86_64-unknown-linux-gnu;
|
||||
cross build --release --target=armv7-unknown-linux-gnueabihf;
|
||||
cross build --release --target=arm-unknown-linux-gnueabihf;
|
||||
cross build --release --target=x86_64-pc-windows-gnu;
|
||||
7
auto-build.sh
Executable file
7
auto-build.sh
Executable file
@@ -0,0 +1,7 @@
|
||||
echo "Building dev for multiple targets";
|
||||
cargo build;
|
||||
cross build --target=aarch64-unknown-linux-gnu;
|
||||
cross build --target=x86_64-unknown-linux-gnu;
|
||||
cross build --target=armv7-unknown-linux-gnueabihf;
|
||||
cross build --target=arm-unknown-linux-gnueabihf;
|
||||
cross build --target=x86_64-pc-windows-gnu;
|
||||
16
src/main.rs
16
src/main.rs
@@ -545,6 +545,13 @@ fn aprs_loc(packet: &str) -> (f64, f64) {
|
||||
// Capture different pieces of the location string
|
||||
let re_loc = Regex::new(r"(?P<latd>\d{2})(?P<latm>[\d ]{2}\.[\d ]{2})(?P<ns>[nsNS])/(?P<lond>\d{3})(?P<lonm>[\d ]{2}\.[\d ]{2})(?P<ew>[ewEW])").unwrap();
|
||||
|
||||
// Check for 3rd party traffic, which may include location
|
||||
let re_3p = Regex::new(r"(?<tcpip>TCPIP)").unwrap();
|
||||
let mut loc3p: bool = false;
|
||||
if re_3p.is_match(&packet) {
|
||||
loc3p = true;
|
||||
}
|
||||
|
||||
// Only proceed if there were captures
|
||||
match re_loc.captures(&packet) {
|
||||
Some(_caps) => {
|
||||
@@ -572,7 +579,14 @@ fn aprs_loc(packet: &str) -> (f64, f64) {
|
||||
|
||||
// String to paste into map for testing
|
||||
//println!("{}, {}", lat_dec, lon_dec);
|
||||
|
||||
|
||||
// But if after all that, it's a 3rd-party location, toss it
|
||||
// This is the only capture group we ID by numberf
|
||||
if loc3p == true {
|
||||
(lat_dec, lon_dec) = (-9999.0_f64, -9999.0_f64);
|
||||
println!("Dropping location, looks like 3rd party");
|
||||
}
|
||||
|
||||
// Return
|
||||
(lat_dec, lon_dec)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user