修复连续采集时没有时间间隔导致通讯失败从而导致无有法正常连续采集的问题 修改如下
This commit is contained in:
@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user