0
0
mirror of https://github.com/Doodle3D/doodle3d-firmware.git synced 2024-12-22 02:53:49 +01:00

Merge pull request #63 from Doodle3D/feature/always-available

Feature/always available
This commit is contained in:
Peter Uithoven 2016-05-25 11:07:17 +02:00
commit a1edf05bc7
2 changed files with 9 additions and 2 deletions

View File

@ -177,11 +177,13 @@ end
function M.removeConfig(ssid)
local rv = false
uci:foreach('wireless', 'wifi-iface', function(s)
log:verbose(MOD_ABBR, utils.dump(s.ssid).."\n "..utils.dump(s))
if s.ssid == ssid then
uci:delete('wireless', s['.name'])
rv = true
log:verbose(MOD_ABBR, "deleting faulty ssid: "..utils.dump(s['.name']))
rv = uci:delete('wireless', s['.name'])
end
end)
uci:save('wireless')
uci:commit('wireless')
return rv
end

View File

@ -154,6 +154,11 @@ function M.associate_POST(request, response)
log:info(MOD_ABBR, "associated to wifi: "..utils.dump(argSsid))
else
log:info(MOD_ABBR, "failed to associate to wifi: "..utils.dump(argSsid).." ("..utils.dump(msg)..")")
wifi.removeConfig(argSsid)
local backupssid = wifi.getSubstitutedSsid(settings.get('network.ap.ssid'))
netconf.setupAccessPoint(backupssid)
netconf.enableAccessPoint(backupssid)
wifi.removeConfig(argSsid)
end
end