ESP3D  3.0
Firmware for ESP boards connected to 3D Printer
commands.h
Go to the documentation of this file.
1 /*
2  commands.h - ESP3D commands class
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 
21 #ifndef COMMANDS_H
22 #define COMMANDS_H
23 #include <Arduino.h>
24 #include "../modules/authentication/authentication_service.h"
25 class ESP3DOutput;
26 
27 class Commands
28 {
29 public:
30  Commands();
31  ~Commands();
32  void process(uint8_t * sbuf, size_t len, ESP3DOutput * output, level_authenticate_type auth = LEVEL_GUEST, ESP3DOutput * outputonly = nullptr);
33  bool is_esp_command(uint8_t * sbuf, size_t len);
34  bool execute_internal_command(int cmd, const char* cmd_params, level_authenticate_type auth_level, ESP3DOutput * output);
35  int get_space_pos(const char * string, uint from = 0);
36  const char* get_param (const char * cmd_params, const char * label);
37  const char* get_label (const char * cmd_params, const char * labelseparator, uint8_t startindex = 0);
38  bool hastag (const char * cmd_params, const char * tag);
39 #if defined (WIFI_FEATURE)
40  bool ESP100(const char* cmd_params, level_authenticate_type auth_level, ESP3DOutput * output);
41  bool ESP101(const char* cmd_params, level_authenticate_type auth_level, ESP3DOutput * output);
42 #endif //WIFI_FEATURE
43 #if defined (WIFI_FEATURE) || defined (ETH_FEATURE)
44  bool ESP102(const char* cmd_params, level_authenticate_type auth_level, ESP3DOutput * output);
45  bool ESP103(const char* cmd_params, level_authenticate_type auth_level, ESP3DOutput * output);
46 #endif //WIFI_FEATURE ||ETH_FEATURE
47 #if defined (WIFI_FEATURE)
48  bool ESP105(const char* cmd_params, level_authenticate_type auth_level, ESP3DOutput * output);
49  bool ESP106(const char* cmd_params, level_authenticate_type auth_level, ESP3DOutput * output);
50  bool ESP107(const char* cmd_params, level_authenticate_type auth_level, ESP3DOutput * output);
51  bool ESP108(const char* cmd_params, level_authenticate_type auth_level, ESP3DOutput * output);
52 #endif //WIFI_FEATURE
53 #if defined( WIFI_FEATURE) || defined( BLUETOOTH_FEATURE) || defined (ETH_FEATURE)
54  bool ESP110(const char* cmd_params, level_authenticate_type auth_level, ESP3DOutput * output);
55 #endif //WIFI_FEATURE || BLUETOOTH_FEATURE || ETH_FEATURE
56 #if defined( WIFI_FEATURE) || defined (ETH_FEATURE)
57  bool ESP111(const char* cmd_params, level_authenticate_type auth_level, ESP3DOutput * output);
58 #endif //WIFI_FEATURE || ETH_FEATURE
59 #if defined(WIFI_FEATURE) || defined(ETH_FEATURE) || defined(BT_FEATURE)
60  bool ESP112(const char* cmd_params, level_authenticate_type auth_level, ESP3DOutput * output);
61  bool ESP115(const char* cmd_params, level_authenticate_type auth_level, ESP3DOutput * output);
62 #endif //WIFI_FEATURE || BLUETOOTH_FEATURE || ETH_FEATURE
63 #if defined(HTTP_FEATURE)
64  bool ESP120(const char* cmd_params, level_authenticate_type auth_level, ESP3DOutput * output);
65  bool ESP121(const char* cmd_params, level_authenticate_type auth_level, ESP3DOutput * output);
66 #endif //HTTP_FEATURE
67 #if defined(TELNET_FEATURE)
68  bool ESP130(const char* cmd_params, level_authenticate_type auth_level, ESP3DOutput * output);
69  bool ESP131(const char* cmd_params, level_authenticate_type auth_level, ESP3DOutput * output);
70 #endif //TELNET_FEATURE
71 #if defined(TIMESTAMP_FEATURE)
72  bool ESP140(const char* cmd_params, level_authenticate_type auth_level, ESP3DOutput * output);
73 #endif //TIMESTAMP_FEATURE
74  bool ESP150(const char* cmd_params, level_authenticate_type auth_level, ESP3DOutput * output);
75 #if defined(WS_DATA_FEATURE)
76  bool ESP160(const char* cmd_params, level_authenticate_type auth_level, ESP3DOutput * output);
77  bool ESP161(const char* cmd_params, level_authenticate_type auth_level, ESP3DOutput * output);
78 #endif //WS_DATA_FEATURE
79 #if defined(CAMERA_DEVICE)
80  bool ESP170(const char* cmd_params, level_authenticate_type auth_level, ESP3DOutput * output);
81  bool ESP171(const char* cmd_params, level_authenticate_type auth_level, ESP3DOutput * output);
82  bool ESP172(const char* cmd_params, level_authenticate_type auth_level, ESP3DOutput * output);
83 #endif //CAMERA_DEVICE
84 #if defined(FTP_FEATURE)
85  bool ESP180(const char* cmd_params, level_authenticate_type auth_level, ESP3DOutput * output);
86  bool ESP181(const char* cmd_params, level_authenticate_type auth_level, ESP3DOutput * output);
87 #endif //FTP_FEATURE
88 #if defined (SD_DEVICE)
89  bool ESP200(const char* cmd_params, level_authenticate_type auth_level, ESP3DOutput * output);
90 #endif //SD_DEVICE
91 #ifdef DIRECT_PIN_FEATURE
92  bool ESP201(const char* cmd_params, level_authenticate_type auth_level, ESP3DOutput * output);
93 #endif //DIRECT_PIN_FEATURE
94 #if defined (DISPLAY_DEVICE)
95  bool ESP214(const char* cmd_params, level_authenticate_type auth_level, ESP3DOutput * output);
96 #if defined(DISPLAY_TOUCH_DRIVER)
97  bool ESP215(const char* cmd_params, level_authenticate_type auth_level, ESP3DOutput * output);
98 #endif //DISPLAY_TOUCH_DRIVER
99 #if defined(DISPLAY_SNAPSHOT_FEATURE)
100  bool ESP216(const char* cmd_params, level_authenticate_type auth_level, ESP3DOutput * output);
101 #endif //DISPLAY_TOUCH_DRIVER
102 #endif //DISPLAY_DEVICE
103 #ifdef DHT_DEVICE
104  bool ESP210(const char* cmd_params, level_authenticate_type auth_level, ESP3DOutput * output);
105 #endif //DHT_DEVICE
106  bool ESP290(const char* cmd_params, level_authenticate_type auth_level, ESP3DOutput * output);
107  bool ESP400(const char* cmd_params, level_authenticate_type auth_level, ESP3DOutput * output);
108  bool ESP401(const char* cmd_params, level_authenticate_type auth_level, ESP3DOutput * output);
109 #if defined (WIFI_FEATURE)
110  bool ESP410(const char* cmd_params, level_authenticate_type auth_level, ESP3DOutput * output);
111 #endif //WIFI_FEATURE
112  bool ESP420(const char* cmd_params, level_authenticate_type auth_level, ESP3DOutput * output);
113  bool ESP444(const char* cmd_params, level_authenticate_type auth_level, ESP3DOutput * output);
114 #if defined (AUTHENTICATION_FEATURE)
115  bool ESP550(const char* cmd_params, level_authenticate_type auth_level, ESP3DOutput * output);
116  bool ESP555(const char* cmd_params, level_authenticate_type auth_level, ESP3DOutput * output);
117 #endif //AUTHENTICATION_FEATURE
118 #if defined(NOTIFICATION_FEATURE)
119  bool ESP600(const char* cmd_params, level_authenticate_type auth_level, ESP3DOutput * output);
120  bool ESP610(const char* cmd_params, level_authenticate_type auth_level, ESP3DOutput * output);
121 #endif //NOTIFICATION_FEATURE
122 #if defined(FILESYSTEM_FEATURE) && defined(ESP_GCODE_HOST_FEATURE)
123  bool ESP700(const char* cmd_params, level_authenticate_type auth_level, ESP3DOutput * output);
124 #endif //FILESYSTEM_FEATURE
125 #if defined(FILESYSTEM_FEATURE)
126  bool ESP710(const char* cmd_params, level_authenticate_type auth_level, ESP3DOutput * output);
127  bool ESP720(const char* cmd_params, level_authenticate_type auth_level, ESP3DOutput * output);
128  bool ESP730(const char* cmd_params, level_authenticate_type auth_level, ESP3DOutput * output);
129 #endif //FILESYSTEM_FEATURE
130 #if defined (SD_DEVICE)
131  bool ESP715(const char* cmd_params, level_authenticate_type auth_level, ESP3DOutput * output);
132  bool ESP750(const char* cmd_params, level_authenticate_type auth_level, ESP3DOutput * output);
133  bool ESP740(const char* cmd_params, level_authenticate_type auth_level, ESP3DOutput * output);
134 #endif //SD_DEVICE
135 #if defined (GLOBAL_FILESYSTEM_FEATURE)
136  bool ESP780(const char* cmd_params, level_authenticate_type auth_level, ESP3DOutput * output);
137  bool ESP790(const char* cmd_params, level_authenticate_type auth_level, ESP3DOutput * output);
138 #endif //GLOBAL_FILESYSTEM_FEATURE
139  bool ESP800(const char* cmd_params, level_authenticate_type auth_level, ESP3DOutput * output);
140  bool ESP900(const char* cmd_params, level_authenticate_type auth_level, ESP3DOutput * output);
141 #ifdef BUZZER_DEVICE
142  bool ESP910(const char* cmd_params, level_authenticate_type auth_level, ESP3DOutput * output);
143  bool ESP250(const char* cmd_params, level_authenticate_type auth_level, ESP3DOutput * output);
144 #endif //BUZZER_DEVICE
145 };
146 
147 extern Commands esp3d_commands;
148 
149 #endif //COMMANDS_H
Commands::ESP400
bool ESP400(const char *cmd_params, level_authenticate_type auth_level, ESP3DOutput *output)
Definition: ESP400.cpp:28
Commands::get_param
const char * get_param(const char *cmd_params, const char *label)
Definition: commands.cpp:162
Commands::ESP100
bool ESP100(const char *cmd_params, level_authenticate_type auth_level, ESP3DOutput *output)
Definition: ESP100.cpp:29
Commands::ESP103
bool ESP103(const char *cmd_params, level_authenticate_type auth_level, ESP3DOutput *output)
Definition: ESP103.cpp:35
Commands::get_label
const char * get_label(const char *cmd_params, const char *labelseparator, uint8_t startindex=0)
Definition: commands.cpp:117
Commands::ESP160
bool ESP160(const char *cmd_params, level_authenticate_type auth_level, ESP3DOutput *output)
Definition: ESP160.cpp:29
Commands::ESP115
bool ESP115(const char *cmd_params, level_authenticate_type auth_level, ESP3DOutput *output)
Definition: ESP115.cpp:29
Commands::ESP120
bool ESP120(const char *cmd_params, level_authenticate_type auth_level, ESP3DOutput *output)
Definition: ESP120.cpp:28
Commands::ESP610
bool ESP610(const char *cmd_params, level_authenticate_type auth_level, ESP3DOutput *output)
Definition: ESP610.cpp:30
Commands::Commands
Commands()
Definition: commands.cpp:28
Commands::ESP720
bool ESP720(const char *cmd_params, level_authenticate_type auth_level, ESP3DOutput *output)
Definition: ESP720.cpp:29
Commands::ESP410
bool ESP410(const char *cmd_params, level_authenticate_type auth_level, ESP3DOutput *output)
Definition: ESP410.cpp:30
Commands::ESP800
bool ESP800(const char *cmd_params, level_authenticate_type auth_level, ESP3DOutput *output)
Definition: ESP800.cpp:48
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
Commands::ESP112
bool ESP112(const char *cmd_params, level_authenticate_type auth_level, ESP3DOutput *output)
Definition: ESP112.cpp:29
Commands::ESP790
bool ESP790(const char *cmd_params, level_authenticate_type auth_level, ESP3DOutput *output)
Definition: ESP790.cpp:30
Commands::ESP780
bool ESP780(const char *cmd_params, level_authenticate_type auth_level, ESP3DOutput *output)
Definition: ESP780.cpp:32
Commands::ESP401
bool ESP401(const char *cmd_params, level_authenticate_type auth_level, ESP3DOutput *output)
Definition: ESP401.cpp:45
Commands::ESP444
bool ESP444(const char *cmd_params, level_authenticate_type auth_level, ESP3DOutput *output)
Definition: ESP444.cpp:28
Commands::ESP105
bool ESP105(const char *cmd_params, level_authenticate_type auth_level, ESP3DOutput *output)
Definition: ESP105.cpp:29
Commands::ESP730
bool ESP730(const char *cmd_params, level_authenticate_type auth_level, ESP3DOutput *output)
Definition: ESP730.cpp:30
Commands::ESP161
bool ESP161(const char *cmd_params, level_authenticate_type auth_level, ESP3DOutput *output)
Definition: ESP161.cpp:28
Commands::ESP900
bool ESP900(const char *cmd_params, level_authenticate_type auth_level, ESP3DOutput *output)
Definition: ESP900.cpp:28
Commands::ESP108
bool ESP108(const char *cmd_params, level_authenticate_type auth_level, ESP3DOutput *output)
Definition: ESP108.cpp:29
Commands::ESP715
bool ESP715(const char *cmd_params, level_authenticate_type auth_level, ESP3DOutput *output)
Definition: ESP715.cpp:29
LEVEL_GUEST
@ LEVEL_GUEST
Definition: authentication_service.h:26
Commands::get_space_pos
int get_space_pos(const char *string, uint from=0)
Definition: commands.cpp:95
Commands::ESP750
bool ESP750(const char *cmd_params, level_authenticate_type auth_level, ESP3DOutput *output)
Definition: ESP750.cpp:30
Commands::ESP130
bool ESP130(const char *cmd_params, level_authenticate_type auth_level, ESP3DOutput *output)
Definition: ESP130.cpp:29
Commands::ESP201
bool ESP201(const char *cmd_params, level_authenticate_type auth_level, ESP3DOutput *output)
Definition: ESP201.cpp:30
Commands
Definition: commands.h:27
Commands::ESP101
bool ESP101(const char *cmd_params, level_authenticate_type auth_level, ESP3DOutput *output)
Definition: ESP101.cpp:29
level_authenticate_type
level_authenticate_type
Definition: authentication_service.h:25
Commands::ESP102
bool ESP102(const char *cmd_params, level_authenticate_type auth_level, ESP3DOutput *output)
Definition: ESP102.cpp:35
esp3d_commands
Commands esp3d_commands
Definition: commands.cpp:26
Commands::ESP107
bool ESP107(const char *cmd_params, level_authenticate_type auth_level, ESP3DOutput *output)
Definition: ESP107.cpp:30
Commands::hastag
bool hastag(const char *cmd_params, const char *tag)
Definition: commands.cpp:221
Commands::ESP110
bool ESP110(const char *cmd_params, level_authenticate_type auth_level, ESP3DOutput *output)
Definition: ESP110.cpp:29
Commands::ESP200
bool ESP200(const char *cmd_params, level_authenticate_type auth_level, ESP3DOutput *output)
Definition: ESP200.cpp:29
Commands::ESP106
bool ESP106(const char *cmd_params, level_authenticate_type auth_level, ESP3DOutput *output)
Definition: ESP106.cpp:29
Commands::ESP131
bool ESP131(const char *cmd_params, level_authenticate_type auth_level, ESP3DOutput *output)
Definition: ESP131.cpp:28
Commands::ESP180
bool ESP180(const char *cmd_params, level_authenticate_type auth_level, ESP3DOutput *output)
Definition: ESP180.cpp:29
Commands::is_esp_command
bool is_esp_command(uint8_t *sbuf, size_t len)
Definition: commands.cpp:73
Commands::ESP121
bool ESP121(const char *cmd_params, level_authenticate_type auth_level, ESP3DOutput *output)
Definition: ESP121.cpp:28
Commands::ESP600
bool ESP600(const char *cmd_params, level_authenticate_type auth_level, ESP3DOutput *output)
Definition: ESP600.cpp:29
Commands::ESP150
bool ESP150(const char *cmd_params, level_authenticate_type auth_level, ESP3DOutput *output)
Definition: ESP150.cpp:27
Commands::ESP181
bool ESP181(const char *cmd_params, level_authenticate_type auth_level, ESP3DOutput *output)
Definition: ESP181.cpp:28
Commands::ESP111
bool ESP111(const char *cmd_params, level_authenticate_type auth_level, ESP3DOutput *output)
Definition: ESP111.cpp:29
Commands::ESP420
bool ESP420(const char *cmd_params, level_authenticate_type auth_level, ESP3DOutput *output)
Definition: ESP420.cpp:75
Commands::ESP740
bool ESP740(const char *cmd_params, level_authenticate_type auth_level, ESP3DOutput *output)
Definition: ESP740.cpp:32
Commands::~Commands
~Commands()
Definition: commands.cpp:31
Commands::execute_internal_command
bool execute_internal_command(int cmd, const char *cmd_params, level_authenticate_type auth_level, ESP3DOutput *output)
Definition: commands.cpp:240
Commands::ESP710
bool ESP710(const char *cmd_params, level_authenticate_type auth_level, ESP3DOutput *output)
Definition: ESP710.cpp:29
Commands::ESP700
bool ESP700(const char *cmd_params, level_authenticate_type auth_level, ESP3DOutput *output)
Definition: ESP700.cpp:30
Commands::ESP290
bool ESP290(const char *cmd_params, level_authenticate_type auth_level, ESP3DOutput *output)
Definition: ESP290.cpp:26
ESP3DOutput
Definition: esp3doutput.h:48