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

This commit is contained in:
xin
2024-09-27 16:16:03 +08:00
parent 6d47134dac
commit e8d98f155d
37 changed files with 2361 additions and 257 deletions

38
src-tauri/src/comman1.rs Normal file
View File

@ -0,0 +1,38 @@
use super::serport::serport::*;
use super::mylog::*;
#[tauri::command]
pub fn greet(name: &str) -> String {
format!("Hello, {}! You've been greeted from Rust!", name)
}
#[tauri::command]
pub fn getportnames() -> Vec<String> {
get_port_name()
}
// #[tauri::command]
// pub fn opencom(portname: serde_json::Value, baudrate: serde_json::Value) -> String {
// //tauri
// let portname = portname.as_str().unwrap();
// let baudrate = baudrate.as_u64().unwrap() as u32;
// set_port_info(&portname.to_string(), baudrate);
// println!("opencom portname:{} baudrate:{}", portname, baudrate);
// logtorust(format!(
// "opencom portname:{} baudrate:{}",
// portname, baudrate
// ));
// tryuseport()
// }
#[tauri::command]
pub fn clearportbuff() -> String {
clearserilport()
}
#[tauri::command]
pub fn closecome() -> String {
closeport()
}