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:
commit
a1edf05bc7
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user