Skip to content

Commit

Permalink
Add phy/network name handling and more index usage
Browse files Browse the repository at this point in the history
Jira-Id: SCDI-43

Signed-off-by: Mika Joenpera <[email protected]>
  • Loading branch information
joenpera committed Oct 11, 2023
1 parent 73c37a0 commit d7ace14
Show file tree
Hide file tree
Showing 10 changed files with 124 additions and 439 deletions.
347 changes: 0 additions & 347 deletions common/scripts/mesh-11s-mr.sh

This file was deleted.

29 changes: 26 additions & 3 deletions common/scripts/mesh-11s_nats.sh
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,26 @@ calculate_wifi_channel() {
fi
}

find_phy_interface() {
# Argument:
# $1 = Wi-Fi interface name

# Return value: retval_phy as global

echo "Find PHY interface for Wi-Fi interface: $1"
echo
phy_names=$(ls /sys/class/ieee80211/)

for phy in $phy_names; do
if [ -d "/sys/class/ieee80211/$phy/device/net/$1" ]; then
retval_phy=$phy
break
else
retval_phy=""
fi
done
}

mode_execute() {
# parameters:
# $1 = mode
Expand Down Expand Up @@ -440,7 +460,7 @@ main () {

source /opt/mesh-helper.sh
# sources mesh configuration
source_configuration
source_configuration "${2:2}"

# Modes: mesh, ap+mesh_scc, ap+mesh_mcc, halow
# mesh 1.0 with NATS communication setup
Expand Down Expand Up @@ -516,8 +536,11 @@ main () {
_mesh_vif="${INDEX}_MESH_VIF"
wifidev="${!_mesh_vif}"

_phy="${INDEX}_PHY"
phyname="${!_phy}"
#_phy="${INDEX}_PHY"
#phyname="${!_phy}"

find_phy_interface "$wifidev"
phyname=$retval_phy

_priority="${INDEX}_PRIORITY"
priority="${!_priority}"
Expand Down
Loading

0 comments on commit d7ace14

Please sign in to comment.