feat: current progress - connect panel layout, manual checkbox, serial enum
This commit is contained in:
11
src/utils.rs
Normal file
11
src/utils.rs
Normal file
@@ -0,0 +1,11 @@
|
||||
use anyhow;
|
||||
use serialport::available_ports;
|
||||
|
||||
pub fn serial_enum() -> anyhow::Result<Vec<String>> {
|
||||
let ports = available_ports()
|
||||
.map_err(|e| anyhow::anyhow!("available_ports failed: {}", e))?
|
||||
.into_iter()
|
||||
.map(|info| info.port_name)
|
||||
.collect();
|
||||
Ok(ports)
|
||||
}
|
||||
Reference in New Issue
Block a user