Expand description
§serial_enumerator
A cross-platform serial port enumeration library for Linux, Windows, and macOS. Returns available serial ports with vendor, product, driver, and USB VID/PID information.
Unlike tools that blindly list every TTY device, this library validates each port
and exposes a valid field so you can distinguish functional
ports from false positives.
§Quick Start
use serial_enumerator::get_serial_list;
for port in get_serial_list() {
println!("{} valid={}", port.name, port.valid);
}§CLI Tool
A command-line tool lser is included.
Install with:
cargo install serial_enumerator
lser§Example Output
Linux:
SerialInfo { name: "/dev/ttyS0", valid: true, vendor: Some("pnp"), product: Some("PNP0501"), driver: Some("serial"), usb_info: None }
SerialInfo { name: "/dev/ttyUSB0", valid: true, vendor: Some("FTDI"), product: Some("Dual RS232-HS:00"), driver: Some("usbserial"), usb_info: Some(UsbInfo { vid: "0403", pid: "6010" }) }Windows:
SerialInfo { name: "COM4", valid: true, vendor: Some("wch.cn"), product: Some("USB-SERIAL CH340"), driver: None, usb_info: Some(UsbInfo { vid: "1A86", pid: "7523" }) }Structs§
- Serial
Info - Information about an enumerated serial port.
- UsbInfo
- USB identification for a serial device.
Functions§
- get_
serial_ list - enumerate all avaliable serial port