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

Goto access point mode before update

This commit is contained in:
peteruithoven 2013-10-30 21:20:42 +01:00
parent 90439649ab
commit f246252e53
2 changed files with 25 additions and 1 deletions

View File

@ -296,6 +296,23 @@ function M.setupAccessPoint(ssid)
return true
end
--- set the network configuration to accesspoint, but don't reload (used before updating)
-- Note: this function might belong in the wlanconfig module but that would introduce
-- a circular dependency, easiest solution is to place the function here.
-- @tparam string ssid The SSID to use for the access point.
-- @return True on success or nil+msg on error.
function M.enableAccessPoint(ssid)
log:debug("enableAccessPoint ssid: ".. utils.dump(ssid))
M.switchConfiguration{apnet="add_noreload"}
wifi.activateConfig(ssid)
local ds = wifi.getDeviceState()
log:debug(" ssid: ".. utils.dump(ds.ssid))
return true
end
--- Associates wlan device as client with the given SSID.
-- Note: this function might belong in the wlanconfig module but that would introduce
-- a circular dependency, easiest solution is to place the function here.

View File

@ -1,3 +1,7 @@
local wifi = require('network.wlanconfig')
local netconf = require('network.netconfig')
local settings = require('util.settings')
-- NOTE: the module 'detects' command-line invocation by existence of 'arg', so we have to make sure it is not defined.
argStash = arg
arg = nil
@ -144,7 +148,10 @@ function M.install_POST(request, response)
updater.setLogger(log)
updater.setState(updater.STATE.INSTALLING,"")
local ssid = wifi.getSubstitutedSsid(settings.get('network.ap.ssid'))
local rv,msg = netconf.enableAccessPoint(ssid)
if not argVersion then
local success,status,msg = updater.getStatus()
if not success then