Commit 776895d3 authored by Stefan Tauner's avatar Stefan Tauner
Browse files

get_uart_devs: return symlinks to UART TTYs as well

These are often created by udev rules for easier recognition.
parent ca250ba1
......@@ -47,8 +47,13 @@ sub get_uart_devs {
} elsif ($^O eq "linux") {
# This relies on udev persistent serial rules.
# They do only cover devices detected by udev thus
# excludes native UARTs (e.g., /dev/ttyS0)
@s = map {realpath($_)} glob("/dev/serial/by-id/*");
# may exclude native UARTs (e.g., /dev/ttyS0)
# We also try to include symlinks named /dev/tty* that
# point to actual UARTs.
@s = map {
my $tty = $_;
my @uart_ttys = grep { realpath($tty) eq realpath($_) } glob("/dev/tty*");
} map {realpath($_)} glob("/dev/serial/by-id/*");
$choices = \@s;
return $choices;
Supports Markdown
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