From 24f3b5d90fef6489cb653b76f25e2759f3aaaf04 Mon Sep 17 00:00:00 2001 From: Andrew Reynolds Date: Thu, 21 Nov 2013 16:11:44 -0500 Subject: [PATCH 1/3] Fixed uci get for 5ghz devices --- luasrc/model/cbi/commotion/meshconfig.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/luasrc/model/cbi/commotion/meshconfig.lua b/luasrc/model/cbi/commotion/meshconfig.lua index 6b8cfb5..1de2c16 100644 --- a/luasrc/model/cbi/commotion/meshconfig.lua +++ b/luasrc/model/cbi/commotion/meshconfig.lua @@ -34,7 +34,8 @@ sctMesh:option(Value, "bssid", translate("Device Designation (BSSID)"), translat e = m:section(TypedSection, "wifi-device", translate("Network-wide Settings")) e.anonymous = true -protocol = uci.get("wireless", "wifi-device", "hwmode") +local device = uci:get_first("wireless", "wifi-device") +protocol = uci:get("wireless", device, "hwmode") if protocol == '11na' then c = e:option(ListValue, "channel", translate("5GHz Channel"), translate("The 5GHz backhaul channel of the mesh network, if applicable.")) From ce90c9e798679a8525ca6a06bae9cbb4adfd8cb2 Mon Sep 17 00:00:00 2001 From: Andrew Reynolds Date: Mon, 25 Nov 2013 15:34:45 -0500 Subject: [PATCH 2/3] Added wider range of 5ghz protocols --- luasrc/model/cbi/commotion/meshconfig.lua | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/luasrc/model/cbi/commotion/meshconfig.lua b/luasrc/model/cbi/commotion/meshconfig.lua index 1de2c16..57f9a7a 100644 --- a/luasrc/model/cbi/commotion/meshconfig.lua +++ b/luasrc/model/cbi/commotion/meshconfig.lua @@ -15,6 +15,20 @@ local uci = require "luci.model.uci".cursor() local sys = require "luci.sys" local util = require "luci.util" +function log(msg) +if (type(msg) == "table") then +for key, val in pairs(msg) do +log('{') +log(key) +log(':') +log(val) +log('}') +end +else +luci.sys.exec("logger -t luci \"" .. tostring(msg) .. '"') +end +end + m = Map("wireless", translate("Configuration"), translate("This configuration wizard will assist you in setting up your router for a Commotion network.")) @@ -34,10 +48,10 @@ sctMesh:option(Value, "bssid", translate("Device Designation (BSSID)"), translat e = m:section(TypedSection, "wifi-device", translate("Network-wide Settings")) e.anonymous = true -local device = uci:get_first("wireless", "wifi-device") -protocol = uci:get("wireless", device, "hwmode") +local fiveghz = {'11a', '11adt', '11na'} +protocol = uci:get_first("wireless", "wifi-device", "hwmode") -if protocol == '11na' then +if util.contains(fiveghz, protocol) then c = e:option(ListValue, "channel", translate("5GHz Channel"), translate("The 5GHz backhaul channel of the mesh network, if applicable.")) c:value(36, "Channel 36 (5.180 GHz)") c:value(40, "Channel 40 (5.200 GHz)") From 70c5355e13c78af2c6de3b25fabee43c1f3e5cff Mon Sep 17 00:00:00 2001 From: Andrew Reynolds Date: Tue, 26 Nov 2013 09:18:23 -0500 Subject: [PATCH 3/3] Removed some test code --- luasrc/model/cbi/commotion/meshconfig.lua | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/luasrc/model/cbi/commotion/meshconfig.lua b/luasrc/model/cbi/commotion/meshconfig.lua index 57f9a7a..7cc17e9 100644 --- a/luasrc/model/cbi/commotion/meshconfig.lua +++ b/luasrc/model/cbi/commotion/meshconfig.lua @@ -15,21 +15,6 @@ local uci = require "luci.model.uci".cursor() local sys = require "luci.sys" local util = require "luci.util" -function log(msg) -if (type(msg) == "table") then -for key, val in pairs(msg) do -log('{') -log(key) -log(':') -log(val) -log('}') -end -else -luci.sys.exec("logger -t luci \"" .. tostring(msg) .. '"') -end -end - - m = Map("wireless", translate("Configuration"), translate("This configuration wizard will assist you in setting up your router for a Commotion network.")) sctAP = m:section(NamedSection, "quickstartAP", "wifi-iface", translate("Access Point"))