1
0
Fork 0
mirror of https://github.com/albfan/miraclecast.git synced 2025-02-12 17:51:55 +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:
albfan 2017-03-26 13:12:33 +02:00
parent bc9ebcc849
commit a2735d9b4d

View file

@ -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
#