feat: 初步增加 Windows 支持

This commit is contained in:
mofeng-git
2026-05-18 22:43:28 +08:00
parent 0b9d94f53f
commit 935fa823f2
163 changed files with 11419 additions and 7581 deletions

12
src/utils/serial.rs Normal file
View File

@@ -0,0 +1,12 @@
//! Cross-platform serial port discovery helpers.
/// Return serial port names that users can put directly into the config.
pub fn list_serial_ports() -> Vec<String> {
let mut ports: Vec<String> = serialport::available_ports()
.map(|ports| ports.into_iter().map(|port| port.port_name).collect())
.unwrap_or_default();
ports.sort();
ports.dedup();
ports
}