Now printing the list of all available ports (Wokňous issue?)
This commit is contained in:
19
src/main.rs
19
src/main.rs
@@ -330,6 +330,25 @@ fn main() {
|
||||
let Some(port) = port else {
|
||||
println!("Could not find any compatible serial port. Please make sure that the target is connected.");
|
||||
println!("If the issue persists, please specify the port manually with the `--port ...` argument.");
|
||||
println!();
|
||||
|
||||
let ports = serial_enumerator::get_serial_list();
|
||||
|
||||
if ports.is_empty() {
|
||||
println!("No usable ports detected.");
|
||||
}
|
||||
|
||||
if !ports.is_empty() {
|
||||
println!("Possible ports:");
|
||||
|
||||
for port in serial_enumerator::get_serial_list() {
|
||||
println!(" - {} ({}, {})",
|
||||
port.name,
|
||||
port.vendor.unwrap_or_else(|| "unknown vendor".to_string()),
|
||||
port.product.unwrap_or_else(|| "unknown product".to_string()));
|
||||
}
|
||||
}
|
||||
|
||||
std::process::exit(1);
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user