mirror of
https://github.com/albfan/miraclecast.git
synced 2025-02-12 15:41:57 +00:00
find pci bus slot for wireless adapter
helper function to find number to pass to run command of miracle-sinkctl
This commit is contained in:
parent
bc9ebcc849
commit
a2735d9b4d
1 changed files with 16 additions and 0 deletions
|
@ -27,6 +27,13 @@ function find_wireless_network_interfaces {
|
|||
done
|
||||
}
|
||||
|
||||
#
|
||||
# show pci slot
|
||||
#
|
||||
function show_pci_slot {
|
||||
basename $(readlink /sys/class/net/$1/device) | cut -d: -f2 | sed 's/^0*//'
|
||||
}
|
||||
|
||||
#
|
||||
# test if interface is connected
|
||||
#
|
||||
|
@ -34,6 +41,15 @@ function is_interface_connected {
|
|||
test x$( cat /sys/class/net/$1/carrier 2>/dev/null) = x1
|
||||
}
|
||||
|
||||
#
|
||||
# find wireless pci slot
|
||||
#
|
||||
function find_wireless_pci_slot {
|
||||
for i in $( find_wireless_network_interfaces )
|
||||
do
|
||||
show_pci_slot $i
|
||||
done
|
||||
}
|
||||
#
|
||||
# find wireless connected interfaces
|
||||
#
|
||||
|
|
Loading…
Reference in a new issue