Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lime.wireless: Fix wireless.is5Ghz #1071

Merged
merged 1 commit into from
Jan 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions packages/lime-system/files/usr/lib/lua/lime/wireless.lua
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,18 @@ function wireless.scandevices()
end

function wireless.is5Ghz(radio)
local devModes = iwinfo.nl80211.hwmodelist(radio)
return devModes.a or devModes.ac
local config = require("lime.config")
local uci = config.get_uci_cursor()
wifi_band = uci:get('wireless', radio, 'band')
if wifi_band then return wifi_band=='5g' end
wifi_channel = uci:get('wireless', radio, 'channel')
if tonumber(wifi_channel) then
wifi_channel = tonumber(wifi_channel)
return 32<=wifi_channel and wifi_channel<178
end
local backend = iwinfo.type(radio)
local devModes = backend and iwinfo[backend].hwmodelist(radio)
return devModes and (devModes.a or devModes.ac)
end

wireless.availableModes = { adhoc=true, ap=true, apname=true, apbb=true, ieee80211s=true }
Expand Down
Loading