This commit is contained in:
xin
2026-06-03 13:43:27 +08:00
parent 90b1fe2f7a
commit f99647775c
9 changed files with 105 additions and 6 deletions

View File

@ -246,10 +246,10 @@ pub fn readforport()->Vec<u8>{
if port_info.port_name == "NON" {
return "Port is not set".as_bytes().to_vec();
}
let mut buf: Vec<u8> = vec![0; 1000];
let mut buf: Vec<u8> = vec![0; 5000];
match &mut port_info.port {
Some(p) => {
p.set_timeout(Duration::from_millis(100)).unwrap();
p.set_timeout(Duration::from_millis(10)).unwrap();
let sizeread =match p.read(&mut buf){
Ok(size)=>{size},
Err(_e)=>{0}