mirror of
https://github.com/Doodle3D/doodle3d-firmware.git
synced 2024-12-22 02:53:49 +01:00
WiFi related logging
This commit is contained in:
parent
df4f1702a9
commit
067689d64b
@ -48,18 +48,19 @@ local function setupAutoWifiMode()
|
||||
|
||||
local wifiState = wifi.getDeviceState()
|
||||
local netName, netMode = wifiState.ssid, wifiState.mode
|
||||
log:info("current wifi name: " .. (netName or "<nil>") .. ", mode: " .. netMode)
|
||||
|
||||
local apSsid = wifi.getSubstitutedSsid(settings.get('network.ap.ssid'))
|
||||
local apMode = (apSsid == netName) and (netMode == 'ap')
|
||||
log:info("ssid of self: " .. apSsid)
|
||||
|
||||
local scanList,msg = wifi.getScanInfo()
|
||||
local knownSsids = wifi.getConfigs()
|
||||
|
||||
if not scanList then
|
||||
return nil, "autowifi: could not scan wifi networks (" .. msg .. ")"
|
||||
end
|
||||
|
||||
log:info("current wifi name: " .. (netName or "<nil>") .. ", mode: " .. netMode .. ", ssid of self: " .. apSsid)
|
||||
local knownSsids = wifi.getConfigs()
|
||||
-- log:info("current wifi name: " .. (netName or "<nil>") .. ", mode: " .. netMode .. ", ssid of self: " .. apSsid)
|
||||
local visNet, knownNet = {}, {}
|
||||
for _,sn in ipairs(scanList) do
|
||||
table.insert(visNet, sn.ssid)
|
||||
|
@ -137,9 +137,10 @@ end
|
||||
-- @param ssid return data for given SSID or for all networks if SSID not given
|
||||
-- @return data for all or requested network; false+error on failure or nil when requested network not found
|
||||
function M.getScanInfo(ssid)
|
||||
|
||||
local iw = iwinfo[deviceApi]
|
||||
log:info("start wifi scan")
|
||||
local sr = iw.scanlist(deviceName)
|
||||
log:info("wifi scan done")
|
||||
local si, se
|
||||
|
||||
if ssid == nil then
|
||||
|
Loading…
Reference in New Issue
Block a user