Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
vecs
FIJI Public
Commits
776895d3
Commit
776895d3
authored
Aug 12, 2016
by
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
Changes
1
Hide whitespace changes
Inline
Side-by-side
bin/FIJI/Utils.pm
View file @
776895d3
...
...
@@ -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
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment