Update network status after boot when no action was needed

When it already was connected to a WiFi network or it already was a
access point.
This commit is contained in:
peteruithoven 2015-06-16 16:49:18 +02:00
parent 2d0254dc1e
commit eedc6d3c6b
1 changed files with 10 additions and 0 deletions

View File

@ -73,6 +73,15 @@ local function setupAutoWifiMode()
-- if the currently active network is client mode and is also visible, do nothing since it will connect automatically further along the boot process
if netMode == 'sta' and netName ~= nil and netName ~= "" and findSsidInList(scanList, netName) then
-- signin to connect.doodle3d.com
local success, output = Signin.signin()
if success then
log:info("Signed in")
else
log:info("Signing in failed")
end
-- report we are connected after signin attempt
netconf.setStatus(netconf.CONNECTED,"Connected");
return true, "autowifi: no action - existing configuration found for currently wifi visible network (" .. netName .. ")"
end
@ -102,6 +111,7 @@ local function setupAutoWifiMode()
return nil, "autowifi: failed to configure as access point with ssid '" .. apSsid .. "' (" .. msg .. ")"
end
else
netconf.setStatus(netconf.CREATED,"Access point created");
return true, "autowifi: no action - no known networks found, already in access point mode"
end