Commit 50a21e22 authored by Christian Fibich's avatar Christian Fibich Committed by Stefan Tauner
Browse files

(Windows) Descriptive error message if no serial port is connected

parent fc3cf2e2
......@@ -190,12 +190,17 @@ sub get_uart_devs {
my $choices = [];
my @s;
if ($^O eq "MSWin32") {
my $reg = new Win32::TieRegistry("LMachine\\Hardware\\DEVICEMAP\\SERIALCOMM\\",{Access=>Win32::TieRegistry::KEY_READ(),Delimiter=>"\\"});
my $reg = new Win32::TieRegistry("LMachine\\Hardware\\DEVICEMAP\\",{Access=>Win32::TieRegistry::KEY_READ(),Delimiter=>"\\"});
if (!defined $reg) {
$logger->error("Can't access registry key: $^E");
} else {
foreach my $port ($reg->ValueNames) {
push(@s, $reg->GetValue($port));
my $serialcomm = $reg->Open("SERIALCOMM\\");
if (!defined $serialcomm) {
$logger->error("No serial ports found: $^E");
} else {
foreach my $port ($serialcomm->ValueNames) {
push(@s, $serialcomm->GetValue($port));
}
}
}
} elsif ($^O eq "cygwin") {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment