caner 1 year ago
parent
commit
da58ed9877
1 changed files with 1 additions and 20 deletions
  1. 1 20
      src-tauri/src/lib.rs

+ 1 - 20
src-tauri/src/lib.rs

@@ -1,5 +1,5 @@
 use std::thread;
-use hidapi::{HidApi,HidDevice};
+use hidapi::HidApi;
 use tauri::{Emitter,Window};
 // 全局宏变量
 lazy_static::lazy_static! {
@@ -49,25 +49,6 @@ fn start_reading_data(window: Window) -> Result<(), String> {
     Ok(())
 }
 
-// TODO 发送力反馈 暂时用不上
-#[tauri::command]
-fn send_force_feedback(device: HidDevice) {
-    // 构造输出报告缓冲区(64字节,兼容多数设备)
-    let mut buffer = [0u8; 64];
-    
-    // 填充关键字段(根据实际协议调整)
-    buffer[0] = 0x01;   // Report ID
-    buffer[1] = 0x08;   // 力反馈指令
-    buffer[2..4].copy_from_slice(&0x00FFu16.to_le_bytes()); // 强度
-    buffer[4..6].copy_from_slice(&0x0032u16.to_le_bytes()); // 频率
-
-    // 发送输出报告
-    match device.write(&buffer) {
-        Ok(len) => println!("Sent {} bytes: {:?}", len, &buffer[..len]),
-        Err(e) => eprintln!("Error sending output report: {}", e),
-    }
-}
-
 pub fn run() {
     tauri::Builder::default()
         .plugin(tauri_plugin_shell::init())