修复连续采集时没有时间间隔导致通讯失败从而导致无有法正常连续采集的问题 修改如下
This commit is contained in:
38
src-tauri/src/comman1.rs
Normal file
38
src-tauri/src/comman1.rs
Normal 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()
|
||||
}
|
||||
Reference in New Issue
Block a user