Developing lightweight computation at the DSG edge

Commit ae344dfa authored by Roger Pueyo Centelles's avatar Roger Pueyo Centelles
Browse files

Fix #345 (1/2): function qmp_get_wifi_devices returns wifi devices sorted

alphabetically, so that qmp_get_wifi_mac_devices returns their corresponding
MAC addresses in the same order.

Fix #345 (2/2): function qmp_configure_wifi_initial does not sort MAC addresses,
but only checks for duplicates, since now they are already ordered by interface
name (wlan0, wlan1, wlan2...).
parent bcff6842
......@@ -162,7 +162,7 @@ qmp_debug() {
# Returns the names of the wifi devices from the system
qmp_get_wifi_devices() {
awk 'NR>2 { gsub(/:$/,"",$1); print $1 }' /proc/net/wireless | grep -v -e "wlan[0-9]-[0-9]"
awk 'NR>2 { gsub(/:$/,"",$1); print $1 }' /proc/net/wireless | grep -v -e "wlan[0-9]-[0-9]" | sort -u
}
# Returns the MAC address of the wifi devices
......
......@@ -469,7 +469,7 @@ qmp_wifi_get_default() {
# channel AP = ( node_id + index*3 ) % ( num_channels_ap) + 1
# channel is 1, 6 or 11 for coexistence and performance
[ "$mode" = "ap" -o "$mode" = "adhoc_ap" ] && {
[ "$mode" = "ap" -o "$mode" = "adhoc_ap" -o "$mode" = "80211s_aplan" ] && {
AP_INDEX=${AP_INDEX:-0}
......@@ -540,7 +540,7 @@ qmp_configure_wifi_initial() {
#Changing to configured countrycode
iw reg set $(qmp_uci_get wireless.country)
macs="$(qmp_get_wifi_mac_devices | sort -u)"
macs="$(qmp_get_wifi_mac_devices | uniq)"
#Looking for configured devices
id_configured=""
......
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