mirror of
https://github.com/Djeeberjr/fw-anwesenheit.git
synced 2026-04-30 18:49:09 +00:00
added precompiled files, autorun service and changed tokyo buffer to one
This commit is contained in:
19
src/fw-anwesenheit.service
Normal file
19
src/fw-anwesenheit.service
Normal file
@@ -0,0 +1,19 @@
|
||||
[Unit]
|
||||
Description=Feuerwehr Anwesenheit Service
|
||||
Requires=local-fs.target
|
||||
After=local-fs.target
|
||||
StartLimitIntervalSec=500
|
||||
StartLimitBurst=5
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=/home/pi/fw-anwesenheit
|
||||
Restart=on-failure
|
||||
RestartSec=5
|
||||
User=root
|
||||
Group=root
|
||||
Environment="PM3_BIN=/home/pi/proxmark3/pm3"
|
||||
RuntimeDirectory=/home/pi
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -34,6 +34,7 @@ impl IDStore {
|
||||
pub fn add_id(&mut self, id: TallyID) {
|
||||
let day = self.get_current_day();
|
||||
|
||||
println!("id: {}", id.0);
|
||||
day.add_id(id);
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,8 @@ mod webserver;
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() {
|
||||
let (tx, mut rx) = mpsc::channel::<String>(32);
|
||||
println!("Heeeeeeeeeeeelllllllooooooo start!");
|
||||
let (tx, mut rx) = mpsc::channel::<String>(1);
|
||||
|
||||
tokio::spawn(async move {
|
||||
match run_pm3(tx).await {
|
||||
|
||||
@@ -29,8 +29,10 @@ pub async fn run_pm3(tx: mpsc::Sender<String>) -> Result<(), Box<dyn Error>> {
|
||||
for line_result in reader.lines() {
|
||||
match line_result {
|
||||
Ok(line) => {
|
||||
println!("line: {}", line);
|
||||
let parse_result = super::parser::parse_line(&line);
|
||||
if let Some(uid) = parse_result {
|
||||
println!("uid {}", uid);
|
||||
match tx.send(uid).await {
|
||||
Ok(()) => {}
|
||||
Err(e) => {
|
||||
|
||||
Reference in New Issue
Block a user