mirror of
https://github.com/Doodle3D/doodle3d-firmware.git
synced 2024-12-22 11:03:48 +01:00
Merge branch 'develop' of github.com:Doodle3D/doodle3d-firmware into develop
Conflicts: src/rest/api/api_info.lua
This commit is contained in:
commit
b6a3426b07
@ -15,12 +15,10 @@ local wifi = require('network.wlanconfig')
|
||||
local accessManager = require('util.access')
|
||||
local printerAPI = require('rest.api.api_printer')
|
||||
|
||||
|
||||
local M = {
|
||||
isApi = true
|
||||
}
|
||||
|
||||
|
||||
-- TODO: this function is also defined in 2 other places, combine them (and avoid require loops)
|
||||
local function operationsAccessOrFail(request, response)
|
||||
if not accessManager.hasControl(request.remoteAddress) then
|
||||
@ -84,6 +82,9 @@ function M._global_POST(request, response)
|
||||
|
||||
local substitutedSsid = wifi.getSubstitutedSsid(settings.get('network.ap.ssid'))
|
||||
response:addData("substituted_ssid",substitutedSsid)
|
||||
|
||||
local substitutedWiFiBoxID = wifi.getSubstitutedSsid(settings.get('network.cl.wifiboxid'))
|
||||
response:addData("substituted_wifiboxid",substitutedWiFiBoxID)
|
||||
end
|
||||
|
||||
function M.all_GET(request, response)
|
||||
|
@ -14,6 +14,7 @@ local printDriver = require('print3d')
|
||||
local printerUtils = require('util.printer')
|
||||
local printerAPI = require('rest.api.api_printer')
|
||||
local wifi = require('network.wlanconfig')
|
||||
local settings = require('util.settings')
|
||||
|
||||
local TMP_DIR = '/tmp'
|
||||
local LOG_COLLECT_DIRNAME = 'wifibox-logs'
|
||||
@ -48,6 +49,10 @@ local M = {
|
||||
|
||||
function M._global(request, response)
|
||||
response:setSuccess()
|
||||
|
||||
local wifiboxid = wifi.getSubstitutedSsid(settings.get('network.cl.wifiboxid'))
|
||||
response:addData('wifiboxid', wifiboxid)
|
||||
|
||||
end
|
||||
|
||||
-- TODO: redirect stdout+stderr; handle errors
|
||||
@ -171,11 +176,7 @@ end
|
||||
|
||||
function M.status(request, response)
|
||||
|
||||
local ds = wifi.getDeviceState()
|
||||
log:debug(" ssid: "..utils.dump(ds.ssid))
|
||||
|
||||
local rv
|
||||
rv, state = printerAPI.state(request, response)
|
||||
local rv, state = printerAPI.state(request, response)
|
||||
if(rv == false) then return end
|
||||
|
||||
if state ~= "disconnected" and state ~= "connecting" then
|
||||
|
Loading…
Reference in New Issue
Block a user