This commit is contained in:
xin
2025-05-07 11:13:56 +08:00
parent fb037dbf6f
commit 94336c9ba1
23 changed files with 215 additions and 382 deletions

View File

@ -131,7 +131,7 @@ pub fn clearserilport() -> String{
match &mut port_info.port {
Some(p) => {
p.set_timeout(Duration::from_millis(100)).unwrap();
while true{
loop{
let sizeread =match p.read(&mut buf){
Ok(size)=>{size},
Err(_e)=>{return "Port is not open".to_string()}