ESP3D
3.0
Firmware for ESP boards connected to 3D Printer
handle-config.cpp
Go to the documentation of this file.
1
/*
2
handle-config.cpp - ESP3D http handle
3
4
Copyright (c) 2014 Luc Lebosse. All rights reserved.
5
6
This library is free software; you can redistribute it and/or
7
modify it under the terms of the GNU Lesser General Public
8
License as published by the Free Software Foundation; either
9
version 2.1 of the License, or (at your option) any later version.
10
11
This library is distributed in the hope that it will be useful,
12
but WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
Lesser General Public License for more details.
15
16
You should have received a copy of the GNU Lesser General Public
17
License along with this library; if not, write to the Free Software
18
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19
*/
20
#include "../../../include/esp3d_config.h"
21
#if defined (HTTP_FEATURE)
22
#include "../http_server.h"
23
#if defined (ARDUINO_ARCH_ESP32)
24
#include <WebServer.h>
25
#endif //ARDUINO_ARCH_ESP32
26
#if defined (ARDUINO_ARCH_ESP8266)
27
#include <ESP8266WebServer.h>
28
#endif //ARDUINO_ARCH_ESP8266
29
#include "../../authentication/authentication_service.h"
30
#include "../../../core/commands.h"
31
#include "../../../core/esp3doutput.h"
32
33
//Handle web command query [ESP420]plain and send answer//////////////////////////////
34
void
HTTP_Server::handle_config ()
35
{
36
level_authenticate_type
auth_level =
AuthenticationService::authenticated_level
();
37
String cmd =
"[ESP420]plain"
;
38
ESP3DOutput
output(_webserver);
39
output.print(
"<pre>"
);
40
esp3d_commands
.
process
((uint8_t*)cmd.c_str(), cmd.length(), &output, auth_level);
41
output.print(
"</pre>"
);
42
return
;
43
}
44
#endif //HTTP_FEATURE
esp3d_commands
Commands esp3d_commands
Definition:
commands.cpp:26
Commands::process
void process(uint8_t *sbuf, size_t len, ESP3DOutput *output, level_authenticate_type auth=LEVEL_GUEST, ESP3DOutput *outputonly=nullptr)
Definition:
commands.cpp:36
AuthenticationService::authenticated_level
static level_authenticate_type authenticated_level(const char *pwd=nullptr)
Definition:
authentication_service.cpp:61
level_authenticate_type
level_authenticate_type
Definition:
authentication_service.h:25
ESP3DOutput
Definition:
esp3doutput.h:48
esp3d
src
modules
http
handles
handle-config.cpp
Generated by
1.8.17