Developing lightweight computation at the DSG edge

Commit 87b022a3 authored by p4u's avatar p4u
Browse files

Fixed some bug and addapted to the new iwinfo

parent 7b108815
......@@ -39,7 +39,7 @@ function print_help()
end
function print_modes()
local data = qmp.get_modes(dev)
local data = qmp.get_modes(op1)
local output = ""
if data.b then output = output .. "b " end
if data.g then output = output .. "g " end
......
......@@ -28,7 +28,6 @@ qmpinfo = {}
function qmpinfo.get_modes(dev)
local iw = iwinfo[iwinfo.type(dev)]
local ma = "" -- modes avaiable
return iw.hwmodelist(dev)
end
......@@ -74,23 +73,25 @@ function qmpinfo.get_channels(dev)
ch.channel = c
ch.ht40p = false
ch.ht40m = false
ch.adhoc = false
if not f.restricted then
ch.adhoc = true
else
ch.adhoc = false
end
-- 2.4Ghz band
if c < 15 then
if c < 4 then
ch.ht40p = true
ch.adhoc = true
elseif c < 10 then
ch.ht40m = true
ch.ht40p = true
ch.adhoc = true
else
ch.ht40m = true
ch.adhoc = true
end
-- 5Ghz band
elseif c > 14 then
if #freqs == i then nc = nil
......@@ -109,10 +110,6 @@ function qmpinfo.get_channels(dev)
ch.ht40m = true
end
adhoc = os.execute("iw list | grep \"no IBSS\" | grep -v disabled | grep -q " .. f.mhz .. " 2>/dev/null")
if adhoc ~= 0 then
ch.adhoc = true
end
end
-- If the device does not support ht40, both vars (+/-) are false
......
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