Skip to content
Snippets Groups Projects
Commit e41e5cb8 authored by Christof Schulze's avatar Christof Schulze
Browse files

gluon-core: add get_mesh_devices(uconn) to gluon.util which will return all...

gluon-core: add get_mesh_devices(uconn) to gluon.util which will return all devices being up and having proto = gluon_mesh
parent 0abe3507
No related branches found
No related tags found
No related merge requests found
......@@ -73,6 +73,16 @@ function node_id()
return string.gsub(sysconfig.primary_mac, ':', '')
end
function get_mesh_devices(uconn)
local dump = uconn:call("network.interface", "dump", {})
local devices = {}
for _, interface in ipairs(dump.interface) do
if ( (interface.proto == "gluon_mesh") and interface.up ) then
table.insert(devices, interface.device)
end
end
return devices
end
local function find_phy_by_path(path)
for phy in fs.glob('/sys/devices/' .. path .. '/ieee80211/phy*') do
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment