mirror of
				https://github.com/Djeeberjr/fw-anwesenheit.git
				synced 2025-11-03 23:24:10 +00:00 
			
		
		
		
	added arm target in .toml
fixed some shit
This commit is contained in:
		
							parent
							
								
									48c99b4040
								
							
						
					
					
						commit
						cc42e4b231
					
				
							
								
								
									
										52
									
								
								Cargo.lock
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										52
									
								
								Cargo.lock
									
									
									
										generated
									
									
									
								
							@ -358,12 +358,10 @@ dependencies = [
 | 
			
		||||
 "chrono",
 | 
			
		||||
 "gpio",
 | 
			
		||||
 "regex",
 | 
			
		||||
<<<<<<< HEAD
 | 
			
		||||
 "rocket",
 | 
			
		||||
 "rppal",
 | 
			
		||||
 "serde",
 | 
			
		||||
 "serde_json",
 | 
			
		||||
=======
 | 
			
		||||
 "rocket",
 | 
			
		||||
 "tokio",
 | 
			
		||||
]
 | 
			
		||||
 | 
			
		||||
@ -415,6 +413,12 @@ version = "0.3.2"
 | 
			
		||||
source = "registry+https://github.com/rust-lang/crates.io-index"
 | 
			
		||||
checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2"
 | 
			
		||||
 | 
			
		||||
[[package]]
 | 
			
		||||
name = "gpio"
 | 
			
		||||
version = "0.4.1"
 | 
			
		||||
source = "registry+https://github.com/rust-lang/crates.io-index"
 | 
			
		||||
checksum = "4fe6783270536547ac473c9d2ae5a7e0e715ea43f29004ced47fbd1c1372d2c7"
 | 
			
		||||
 | 
			
		||||
[[package]]
 | 
			
		||||
name = "h2"
 | 
			
		||||
version = "0.3.26"
 | 
			
		||||
@ -519,15 +523,8 @@ dependencies = [
 | 
			
		||||
 "tower-service",
 | 
			
		||||
 "tracing",
 | 
			
		||||
 "want",
 | 
			
		||||
>>>>>>> eb39b09632efb1568079352e3d639edc79df65fd
 | 
			
		||||
]
 | 
			
		||||
 | 
			
		||||
[[package]]
 | 
			
		||||
name = "gpio"
 | 
			
		||||
version = "0.4.1"
 | 
			
		||||
source = "registry+https://github.com/rust-lang/crates.io-index"
 | 
			
		||||
checksum = "4fe6783270536547ac473c9d2ae5a7e0e715ea43f29004ced47fbd1c1372d2c7"
 | 
			
		||||
 | 
			
		||||
[[package]]
 | 
			
		||||
name = "iana-time-zone"
 | 
			
		||||
version = "0.1.63"
 | 
			
		||||
@ -553,8 +550,6 @@ dependencies = [
 | 
			
		||||
]
 | 
			
		||||
 | 
			
		||||
[[package]]
 | 
			
		||||
<<<<<<< HEAD
 | 
			
		||||
=======
 | 
			
		||||
name = "indexmap"
 | 
			
		||||
version = "2.9.0"
 | 
			
		||||
source = "registry+https://github.com/rust-lang/crates.io-index"
 | 
			
		||||
@ -583,7 +578,6 @@ dependencies = [
 | 
			
		||||
]
 | 
			
		||||
 | 
			
		||||
[[package]]
 | 
			
		||||
>>>>>>> eb39b09632efb1568079352e3d639edc79df65fd
 | 
			
		||||
name = "itoa"
 | 
			
		||||
version = "1.0.15"
 | 
			
		||||
source = "registry+https://github.com/rust-lang/crates.io-index"
 | 
			
		||||
@ -607,9 +601,9 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe"
 | 
			
		||||
 | 
			
		||||
[[package]]
 | 
			
		||||
name = "libc"
 | 
			
		||||
version = "0.2.171"
 | 
			
		||||
version = "0.2.172"
 | 
			
		||||
source = "registry+https://github.com/rust-lang/crates.io-index"
 | 
			
		||||
checksum = "c19937216e9d3aa9956d9bb8dfc0b0c8beb6058fc4f7a4dc4d850edf86a237d6"
 | 
			
		||||
checksum = "d750af042f7ef4f724306de029d18836c26c1765a54a6a3f094cbd23a7267ffa"
 | 
			
		||||
 | 
			
		||||
[[package]]
 | 
			
		||||
name = "linux-raw-sys"
 | 
			
		||||
@ -845,9 +839,9 @@ dependencies = [
 | 
			
		||||
 | 
			
		||||
[[package]]
 | 
			
		||||
name = "proc-macro2"
 | 
			
		||||
version = "1.0.94"
 | 
			
		||||
version = "1.0.95"
 | 
			
		||||
source = "registry+https://github.com/rust-lang/crates.io-index"
 | 
			
		||||
checksum = "a31971752e70b8b2686d7e46ec17fb38dad4051d94024c88df49b667caea9c84"
 | 
			
		||||
checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778"
 | 
			
		||||
dependencies = [
 | 
			
		||||
 "unicode-ident",
 | 
			
		||||
]
 | 
			
		||||
@ -984,14 +978,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 | 
			
		||||
checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c"
 | 
			
		||||
 | 
			
		||||
[[package]]
 | 
			
		||||
<<<<<<< HEAD
 | 
			
		||||
name = "rppal"
 | 
			
		||||
version = "0.22.1"
 | 
			
		||||
source = "registry+https://github.com/rust-lang/crates.io-index"
 | 
			
		||||
checksum = "c1ce3b019009cff02cb6b0e96e7cc2e5c5b90187dc1a490f8ef1521d0596b026"
 | 
			
		||||
dependencies = [
 | 
			
		||||
 "libc",
 | 
			
		||||
=======
 | 
			
		||||
name = "rocket"
 | 
			
		||||
version = "0.5.1"
 | 
			
		||||
source = "registry+https://github.com/rust-lang/crates.io-index"
 | 
			
		||||
@ -1072,6 +1058,15 @@ dependencies = [
 | 
			
		||||
 "uncased",
 | 
			
		||||
]
 | 
			
		||||
 | 
			
		||||
[[package]]
 | 
			
		||||
name = "rppal"
 | 
			
		||||
version = "0.22.1"
 | 
			
		||||
source = "registry+https://github.com/rust-lang/crates.io-index"
 | 
			
		||||
checksum = "c1ce3b019009cff02cb6b0e96e7cc2e5c5b90187dc1a490f8ef1521d0596b026"
 | 
			
		||||
dependencies = [
 | 
			
		||||
 "libc",
 | 
			
		||||
]
 | 
			
		||||
 | 
			
		||||
[[package]]
 | 
			
		||||
name = "rustc-demangle"
 | 
			
		||||
version = "0.1.24"
 | 
			
		||||
@ -1089,7 +1084,6 @@ dependencies = [
 | 
			
		||||
 "libc",
 | 
			
		||||
 "linux-raw-sys",
 | 
			
		||||
 "windows-sys 0.59.0",
 | 
			
		||||
>>>>>>> eb39b09632efb1568079352e3d639edc79df65fd
 | 
			
		||||
]
 | 
			
		||||
 | 
			
		||||
[[package]]
 | 
			
		||||
@ -1105,8 +1099,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 | 
			
		||||
checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f"
 | 
			
		||||
 | 
			
		||||
[[package]]
 | 
			
		||||
<<<<<<< HEAD
 | 
			
		||||
=======
 | 
			
		||||
name = "scoped-tls"
 | 
			
		||||
version = "1.0.1"
 | 
			
		||||
source = "registry+https://github.com/rust-lang/crates.io-index"
 | 
			
		||||
@ -1119,7 +1111,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 | 
			
		||||
checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
 | 
			
		||||
 | 
			
		||||
[[package]]
 | 
			
		||||
>>>>>>> eb39b09632efb1568079352e3d639edc79df65fd
 | 
			
		||||
name = "serde"
 | 
			
		||||
version = "1.0.219"
 | 
			
		||||
source = "registry+https://github.com/rust-lang/crates.io-index"
 | 
			
		||||
@ -1152,8 +1143,6 @@ dependencies = [
 | 
			
		||||
]
 | 
			
		||||
 | 
			
		||||
[[package]]
 | 
			
		||||
<<<<<<< HEAD
 | 
			
		||||
=======
 | 
			
		||||
name = "serde_spanned"
 | 
			
		||||
version = "0.6.8"
 | 
			
		||||
source = "registry+https://github.com/rust-lang/crates.io-index"
 | 
			
		||||
@ -1172,7 +1161,6 @@ dependencies = [
 | 
			
		||||
]
 | 
			
		||||
 | 
			
		||||
[[package]]
 | 
			
		||||
>>>>>>> eb39b09632efb1568079352e3d639edc79df65fd
 | 
			
		||||
name = "shlex"
 | 
			
		||||
version = "1.3.0"
 | 
			
		||||
source = "registry+https://github.com/rust-lang/crates.io-index"
 | 
			
		||||
 | 
			
		||||
@ -12,3 +12,6 @@ serde = { version = "1.0.219", features = ["derive"] }
 | 
			
		||||
serde_json = "1.0.140"
 | 
			
		||||
rocket = "0.5.1"
 | 
			
		||||
tokio = { version = "1.44.2", features = ["full"] }
 | 
			
		||||
 | 
			
		||||
[target.armv7-unknown-linux-gnueabihf]
 | 
			
		||||
linker = "arm-linux-gnueabihf-gcc"
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										13
									
								
								src/main.rs
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								src/main.rs
									
									
									
									
									
								
							@ -1,15 +1,3 @@
 | 
			
		||||
<<<<<<< HEAD
 | 
			
		||||
use pm3::run_pm3;
 | 
			
		||||
 | 
			
		||||
mod parser;
 | 
			
		||||
mod pm3;
 | 
			
		||||
mod id_store;
 | 
			
		||||
mod buzzer;
 | 
			
		||||
 | 
			
		||||
fn main() {
 | 
			
		||||
    run_pm3().unwrap();
 | 
			
		||||
}
 | 
			
		||||
=======
 | 
			
		||||
use pm3::{pm3_mock, run_pm3};
 | 
			
		||||
use tokio::sync::mpsc;
 | 
			
		||||
use webserver::start_webserver;
 | 
			
		||||
@ -47,4 +35,3 @@ async fn main() {
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
>>>>>>> eb39b09632efb1568079352e3d639edc79df65fd
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										41
									
								
								src/pm3.rs
									
									
									
									
									
								
							
							
						
						
									
										41
									
								
								src/pm3.rs
									
									
									
									
									
								
							@ -1,43 +1,3 @@
 | 
			
		||||
<<<<<<< HEAD
 | 
			
		||||
use std::error::Error;
 | 
			
		||||
use std::process::{Command, Stdio};
 | 
			
		||||
use std::io::{self, BufRead};
 | 
			
		||||
 | 
			
		||||
pub fn run_pm3() -> Result<(), Box<dyn Error>> {
 | 
			
		||||
    let mut cmd = Command::new("stdbuf")
 | 
			
		||||
        .arg("-oL")
 | 
			
		||||
        .arg("pm3")
 | 
			
		||||
        .arg("-c")
 | 
			
		||||
        .arg("lf hitag reader -@")
 | 
			
		||||
        .stdout(Stdio::piped())
 | 
			
		||||
        .spawn()?;
 | 
			
		||||
 | 
			
		||||
    let stdout = cmd.stdout.take().ok_or("Failed to get stdout")?;
 | 
			
		||||
    let reader = io::BufReader::new(stdout);
 | 
			
		||||
 | 
			
		||||
    for line_result in reader.lines() {
 | 
			
		||||
        match line_result {
 | 
			
		||||
            Ok(line) => {
 | 
			
		||||
                let parse_result = super::parser::parse_line(&line);
 | 
			
		||||
                if let Some(uid) = parse_result {
 | 
			
		||||
                    println!("UID: {}",uid);
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
            Err(e) => {
 | 
			
		||||
                eprintln!("{}",e);
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    let status = cmd.wait().expect("Failed to wait on child");
 | 
			
		||||
 | 
			
		||||
    if status.success() {
 | 
			
		||||
        Ok(())
 | 
			
		||||
    }else {
 | 
			
		||||
        Err("pm3 had non zero exit code".into())
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
=======
 | 
			
		||||
use std::error::Error;
 | 
			
		||||
use std::io::{self, BufRead};
 | 
			
		||||
use std::process::{Command, Stdio};
 | 
			
		||||
@ -100,4 +60,3 @@ pub async fn pm3_mock(tx: mpsc::Sender<String>) -> Result<(), Box<dyn Error>> {
 | 
			
		||||
 | 
			
		||||
    Ok(())
 | 
			
		||||
}
 | 
			
		||||
>>>>>>> eb39b09632efb1568079352e3d639edc79df65fd
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user