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:
parent
90439649ab
commit
f246252e53
@ -296,6 +296,23 @@ function M.setupAccessPoint(ssid)
|
|||||||
return true
|
return true
|
||||||
end
|
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.
|
--- Associates wlan device as client with the given SSID.
|
||||||
-- Note: this function might belong in the wlanconfig module but that would introduce
|
-- Note: this function might belong in the wlanconfig module but that would introduce
|
||||||
-- a circular dependency, easiest solution is to place the function here.
|
-- a circular dependency, easiest solution is to place the function here.
|
||||||
|
@ -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.
|
-- NOTE: the module 'detects' command-line invocation by existence of 'arg', so we have to make sure it is not defined.
|
||||||
argStash = arg
|
argStash = arg
|
||||||
arg = nil
|
arg = nil
|
||||||
@ -144,7 +148,10 @@ function M.install_POST(request, response)
|
|||||||
|
|
||||||
updater.setLogger(log)
|
updater.setLogger(log)
|
||||||
updater.setState(updater.STATE.INSTALLING,"")
|
updater.setState(updater.STATE.INSTALLING,"")
|
||||||
|
|
||||||
|
local ssid = wifi.getSubstitutedSsid(settings.get('network.ap.ssid'))
|
||||||
|
local rv,msg = netconf.enableAccessPoint(ssid)
|
||||||
|
|
||||||
if not argVersion then
|
if not argVersion then
|
||||||
local success,status,msg = updater.getStatus()
|
local success,status,msg = updater.getStatus()
|
||||||
if not success then
|
if not success then
|
||||||
|
Loading…
Reference in New Issue
Block a user