修复连续采集时没有时间间隔导致通讯失败从而导致无有法正常连续采集的问题 修改如下

This commit is contained in:
xin
2025-03-31 13:53:01 +08:00
parent 62a5415e97
commit 8820b28ab8
206 changed files with 19735 additions and 572 deletions

View File

@ -103,11 +103,12 @@ pub fn sendtoprot(data: Vec<u8>) -> String {
if port_info.port_name == "NON" {
return format!("Port is not set");
}
println!("{:?}", data.iter().map(|&byte| format!("{:02X}", byte)).collect::<Vec<String>>().join(" "));
match &mut port_info.port {
Some(p) => match p.write(&data) {
Ok(_) => {
println!("Data sent");
return String::from("Data sent");
}
Err(e) => {