Skip to content

Commit

Permalink
timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
tenmajkl committed Mar 19, 2023
1 parent e0fab8e commit ddefb7b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ fn scan() -> Option<Box<dyn SerialPort>> {
}
}
let raw_port = serialport::new(p.port_name.as_str(), 9600)
.timeout(Duration::from_millis(50))
.timeout(Duration::from_millis(5000))
.open()
;

Expand Down Expand Up @@ -53,7 +53,6 @@ fn scan() -> Option<Box<dyn SerialPort>> {
let message = String::from_utf8(result).expect("[LOG] Menor poslal nejakou bejkarnu");

if message == "csmoravak" {
port.set_timeout(Duration::from_millis(10000)).expect("[LOG] Unable to set timeout");
return Some(port);
}
}
Expand Down

0 comments on commit ddefb7b

Please sign in to comment.