Merge 963bcfd3ee
into e153ba6bd7
This commit is contained in:
commit
f32596cf33
@ -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(
|
||||
|
@ -46,8 +46,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
|
||||
|
@ -126,4 +126,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