0
0
mirror of https://github.com/Doodle3D/doodle3d-firmware.git synced 2024-12-22 11:03:48 +01:00

WiFi related logging

This commit is contained in:
peteruithoven 2015-06-12 14:46:38 +02:00
parent df4f1702a9
commit 067689d64b
2 changed files with 6 additions and 4 deletions

View File

@ -48,18 +48,19 @@ local function setupAutoWifiMode()
local wifiState = wifi.getDeviceState() local wifiState = wifi.getDeviceState()
local netName, netMode = wifiState.ssid, wifiState.mode 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 apSsid = wifi.getSubstitutedSsid(settings.get('network.ap.ssid'))
local apMode = (apSsid == netName) and (netMode == 'ap') local apMode = (apSsid == netName) and (netMode == 'ap')
log:info("ssid of self: " .. apSsid)
local scanList,msg = wifi.getScanInfo() local scanList,msg = wifi.getScanInfo()
local knownSsids = wifi.getConfigs()
if not scanList then if not scanList then
return nil, "autowifi: could not scan wifi networks (" .. msg .. ")" return nil, "autowifi: could not scan wifi networks (" .. msg .. ")"
end 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 = {}, {} local visNet, knownNet = {}, {}
for _,sn in ipairs(scanList) do for _,sn in ipairs(scanList) do
table.insert(visNet, sn.ssid) table.insert(visNet, sn.ssid)

View File

@ -137,9 +137,10 @@ end
-- @param ssid return data for given SSID or for all networks if SSID not given -- @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 -- @return data for all or requested network; false+error on failure or nil when requested network not found
function M.getScanInfo(ssid) function M.getScanInfo(ssid)
local iw = iwinfo[deviceApi] local iw = iwinfo[deviceApi]
log:info("start wifi scan")
local sr = iw.scanlist(deviceName) local sr = iw.scanlist(deviceName)
log:info("wifi scan done")
local si, se local si, se
if ssid == nil then if ssid == nil then