Skip to content

Commit d143274

Browse files
committed
Add logging to find error detecting booster client band (#203)
1 parent 8204298 commit d143274

File tree

6 files changed

+41
-32
lines changed

6 files changed

+41
-32
lines changed

src/common/devices/www/lua/devices_helper.lua

+11-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ local splitter = require("split")
77
local static_helper = require("ethernet-static-leases_helper")
88

99
local string,ngx,os = string,ngx,os
10-
local concat,sort = table.concat,table.sort
10+
local sort = table.sort
1111
local tonumber = tonumber
1212
local find,format,gmatch,gsub,lower,match,sub = string.find,string.format,string.gmatch,string.gsub,string.lower,string.match,string.sub
1313
---@diagnostic disable-next-line: undefined-field
@@ -254,7 +254,16 @@ function M.getWiFi()
254254
for k =1,#macs do
255255
local v = macs[k]
256256
if not skipPath[v.prefix] then
257-
agentSTA[lower(v.mac)] = format("%s - %s",aliases[v.prefix],((sta_param == "AssociatedDevice") and bands[sub(v.path,1,bandPrefixLength)] or bands[bssid[v.path]]))
257+
if aliases[v.prefix] then
258+
local band = (sta_param == "AssociatedDevice") and bands[sub(v.path,1,bandPrefixLength)] or bands[bssid[v.path]]
259+
if not band then
260+
band = "???GHz"
261+
ngx.log(ngx.ERR,"Could not determine frequency band for ",v.mac," path=",v.path)
262+
end
263+
agentSTA[lower(v.mac)] = format("%s - %s",aliases[v.prefix],band)
264+
else
265+
agentSTA[lower(v.mac)] = "Unknown?"
266+
end
258267
end
259268
end
260269

tch-gui-unhide-17.2

+6-6
Large diffs are not rendered by default.

tch-gui-unhide-18.1.c

+6-6
Large diffs are not rendered by default.

tch-gui-unhide-20.3.c

+6-6
Large diffs are not rendered by default.

tch-gui-unhide-20.4

+6-6
Large diffs are not rendered by default.

tch-gui-unhide-21.4

+6-6
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)