made the port an argument
This commit is contained in:
parent
073113a144
commit
d5309d592b
|
|
@ -1,6 +1,7 @@
|
||||||
use reqwest::Client;
|
use reqwest::Client;
|
||||||
use serde::Deserialize;
|
use serde::Deserialize;
|
||||||
use serial::prelude::*;
|
use serial::prelude::*;
|
||||||
|
use std::env;
|
||||||
use std::io;
|
use std::io;
|
||||||
use std::str::from_utf8;
|
use std::str::from_utf8;
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
|
|
@ -43,7 +44,9 @@ struct ImageLinks {
|
||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
async fn main() {
|
async fn main() {
|
||||||
let mut port = serial::open("/dev/ttyACM0").unwrap();
|
let args: Vec<String> = env::args().collect();
|
||||||
|
let path_to_scanner = &args[1];
|
||||||
|
let mut port = serial::open(path_to_scanner).unwrap();
|
||||||
interact(&mut port).await.unwrap();
|
interact(&mut port).await.unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue