From 067689d64b36047ec8ba8d8d9fbbd388e9aac93f Mon Sep 17 00:00:00 2001 From: peteruithoven Date: Fri, 12 Jun 2015 14:46:38 +0200 Subject: [PATCH] WiFi related logging --- src/main.lua | 7 ++++--- src/network/wlanconfig.lua | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main.lua b/src/main.lua index e529eb3..ff4d324 100644 --- a/src/main.lua +++ b/src/main.lua @@ -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 "") .. ", 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 "") .. ", mode: " .. netMode .. ", ssid of self: " .. apSsid) + local knownSsids = wifi.getConfigs() + -- log:info("current wifi name: " .. (netName or "") .. ", mode: " .. netMode .. ", ssid of self: " .. apSsid) local visNet, knownNet = {}, {} for _,sn in ipairs(scanList) do table.insert(visNet, sn.ssid) diff --git a/src/network/wlanconfig.lua b/src/network/wlanconfig.lua index 4087a9d..1e72933 100644 --- a/src/network/wlanconfig.lua +++ b/src/network/wlanconfig.lua @@ -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