site: disallow usage of outdoor mode in case outdoor_chanlist is missing
The documentation states the outdoor mode is only enabled in case outdoor_chanlist is defined in the sites wifi5 configurationsection: > If enabled, by setting ``wifi5.outdoor_chanlist``, a number of > devices that are commonly installed outdoors will have outdoor > mode automatically enabled during their initial setup This currently does not hold true, as Outdoor mode is always activated for these devices on first setup, even in case the site does not specify an outdoor chanlist. Furthermore, it also does not make sense to show the option neither in setup-modes basic nor advences configuration view in case the site is lacking an out door chanlist. This patch will disable outdoor mode on new installs in case the outdoor chanlist is missing. It will also not show the respective configuration options in this case. Signed-off-by: David Bauer <mail@david-bauer.net>
This commit is contained in:
parent
4f53b9848c
commit
963bcfd3ee
@ -12,6 +12,11 @@ return function(form, uci)
|
||||
return
|
||||
end
|
||||
|
||||
if not wireless.site_supports_outdoor_mode() then
|
||||
-- Don't show in case the site does not support outdoor-mode
|
||||
return
|
||||
end
|
||||
|
||||
local pkg_i18n = i18n 'gluon-config-mode-outdoor'
|
||||
|
||||
local section = form:section(Section, nil, pkg_i18n.translate(
|
||||
|
@ -44,8 +44,10 @@ for _, config in ipairs({'wifi24', 'wifi5'}) do
|
||||
120, 122, 124, 126, 128, 132, 134, 136, 138, 140, 142, 144,
|
||||
149, 151, 153, 155, 157, 159, 161, 165, 169, 173 }
|
||||
need_one_of({config, 'channel'}, channels)
|
||||
need_chanlist({config, 'outdoor_chanlist'}, channels, false)
|
||||
need_one_of({config, 'outdoors'}, {true, false, 'preset'}, false)
|
||||
|
||||
local outdoors = need_one_of({config, 'outdoors'}, {true, false, 'preset'}, false)
|
||||
local outdoor_chanlist_required = (outdoors ~= false)
|
||||
need_chanlist({config, 'outdoor_chanlist'}, channels, outdoor_chanlist_required)
|
||||
end
|
||||
|
||||
obsolete({config, 'supported_rates'}, '802.11b rates are disabled by default.')
|
||||
|
@ -13,11 +13,15 @@ end
|
||||
|
||||
local sysconfig = require 'gluon.sysconfig'
|
||||
local platform = require 'gluon.platform'
|
||||
local wireless = require 'gluon.wireless'
|
||||
|
||||
local config = site.wifi5.outdoors('preset')
|
||||
local outdoor
|
||||
|
||||
if sysconfig.gluon_version then
|
||||
if not wireless.site_supports_outdoor_mode() then
|
||||
-- site does not support outdoor mode
|
||||
outdoor = false
|
||||
elseif sysconfig.gluon_version then
|
||||
-- don't enable the outdoor mode after an upgrade
|
||||
outdoor = false
|
||||
elseif config == 'preset' then
|
||||
|
@ -100,4 +100,8 @@ function M.preserve_channels(uci)
|
||||
return uci:get_first('gluon-core', 'wireless', 'preserve_channels')
|
||||
end
|
||||
|
||||
function M.site_supports_outdoor_mode()
|
||||
return site.wifi5.outdoor_chanlist() ~= nil
|
||||
end
|
||||
|
||||
return M
|
||||
|
@ -142,7 +142,7 @@ uci:foreach('wireless', 'wifi-device', function(config)
|
||||
end)
|
||||
|
||||
|
||||
if has_5ghz_radio() and not wireless.preserve_channels(uci) then
|
||||
if has_5ghz_radio() and not wireless.preserve_channels(uci) and wireless.site_supports_outdoor_mode() then
|
||||
local r = f:section(Section, translate("Outdoor Installation"), translate(
|
||||
"Configuring the node for outdoor use tunes the 5 GHz radio to a frequency "
|
||||
.. "and transmission power that conforms with the local regulatory requirements. "
|
||||
|
Loading…
Reference in New Issue
Block a user