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

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

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 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 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 .. ")" return true, "autowifi: no action - existing configuration found for currently wifi visible network (" .. netName .. ")"
end end
@ -102,6 +111,7 @@ local function setupAutoWifiMode()
return nil, "autowifi: failed to configure as access point with ssid '" .. apSsid .. "' (" .. msg .. ")" return nil, "autowifi: failed to configure as access point with ssid '" .. apSsid .. "' (" .. msg .. ")"
end end
else else
netconf.setStatus(netconf.CREATED,"Access point created");
return true, "autowifi: no action - no known networks found, already in access point mode" return true, "autowifi: no action - no known networks found, already in access point mode"
end end