ESP3D  3.0
Firmware for ESP boards connected to 3D Printer
commands.cpp
Go to the documentation of this file.
1 /*
2  commands.cpp - 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 #include "../include/esp3d_config.h"
21 #include "esp3d.h"
22 #include "commands.h"
23 #include "esp3doutput.h"
24 #include "settings_esp3d.h"
25 
27 
29 {
30 }
32 {
33 }
34 
35 //dispatch the command
36 void Commands::process(uint8_t * sbuf, size_t len, ESP3DOutput * output, level_authenticate_type auth, ESP3DOutput * outputonly )
37 {
38  if(is_esp_command(sbuf,len)) {
39  size_t slen = len;
40  String tmpbuf = (const char*)sbuf;
41  if (tmpbuf.startsWith("echo: ")) {
42  tmpbuf.replace("echo: ", "");
43  slen = tmpbuf.length();
44  }
45 
46  uint8_t cmd[4];
47  cmd[0] = tmpbuf[4];
48  cmd[1] = tmpbuf[5];
49  cmd[2] = tmpbuf[6];
50  cmd[3] = 0x0;
51 
52  //log_esp3d("Authentication = %d client %d", auth, output->client());
53  execute_internal_command (String((const char*)cmd).toInt(), (slen > 8)?(const char*)&tmpbuf[8]:"", auth, (outputonly == nullptr)?output:outputonly);
54  } else {
55  //Dispatch to all clients but current or to define output
56  if ((output->client() == ESP_HTTP_CLIENT) && (outputonly == nullptr)) {
57  if (auth != LEVEL_GUEST) {
58  output->printMSG("");
59  } else {
60  output->printERROR("Wrong authentication!", 401);
61  return;
62  }
63  }
64  if (outputonly == nullptr) {
65  output->dispatch(sbuf, len);
66  } else {
67  outputonly->write(sbuf, len);
68  }
69  }
70 }
71 
72 //check if current line is an [ESPXXX] command
73 bool Commands::is_esp_command(uint8_t * sbuf, size_t len)
74 {
75  //TODO
76  //M117 should be handled here and transfered to [ESP214] if it is an host
77  if (len < 8) {
78  return false;
79  }
80  if ((char(sbuf[0]) == '[') && (char(sbuf[1]) == 'E') && (char(sbuf[2]) == 'S') && (char(sbuf[3]) == 'P') && (char(sbuf[7]) == ']')) {
81  return true;
82  }
83  if((char(sbuf[0]) == 'e') && (char(sbuf[1]) == 'c') && (char(sbuf[2]) == 'h') && (char(sbuf[3]) == 'o') && (char(sbuf[4]) == ':') && (char(sbuf[5]) == ' ') && (char(sbuf[6]) == '[') && (char(sbuf[7]) == 'E')) {
84  if (len >= 14) {
85  if ((char(sbuf[8]) == 'S') && (char(sbuf[9]) == 'P') && (char(sbuf[13]) == ']')) {
86  return true;
87  }
88  }
89  }
90  return false;
91 }
92 
93 //find space in string
94 //if space is has \ before it is ignored
95 int Commands::get_space_pos(const char * string, uint from)
96 {
97  uint len = strlen(string);
98  if (len < from) {
99  return -1;
100  }
101  for (uint i = from; i < len; i++) {
102  if (string[i] == ' ') {
103  //if it is first char
104  if (i == from) {
105  return from;
106  }
107  //if not first one and previous char is not '\'
108  if (string[i-1] != '\\') {
109  return (i);
110  }
111  }
112  }
113  return -1;
114 }
115 
116 //return first label but pwd using labelseparator (usualy =) like mylabel=myvalue will return mylabel
117 const char* Commands::get_label (const char * cmd_params, const char * labelseparator, uint8_t startindex)
118 {
119  static String res;
120  String tmp = "";
121  res = "";
122  int start = 1;
123  int end = -1;
124  res = cmd_params;
125  res.replace("\r ", "");
126  res.replace("\n ", "");
127  res.trim();
128  if ((res.length() == 0) || (startindex >=res.length())) {
129  return res.c_str();
130  }
131 
132  if (strlen(labelseparator) > 0) {
133  end = res.indexOf(labelseparator, startindex);
134  if (end == -1) {
135  return "";
136  }
137  start = end;
138  for (int8_t p = end; p >= startindex ; p--, start--) {
139  if (res[p]==' ') {
140  p = -1;
141  start+=2;
142  }
143  }
144  if(start==-1) {
145  start=0;
146  }
147  if (start > end) {
148  return "";
149  }
150  tmp = res.substring(start,end);
151  if (tmp == "pwd") {
152  res = get_label (cmd_params, labelseparator,end+1);
153  } else {
154  res = tmp;
155  }
156  }
157  return res.c_str();
158 }
159 
160 //extract parameter with corresponding label
161 //if label is empty give whole line without authentication label/parameter
162 const char * Commands::get_param (const char * cmd_params, const char * label)
163 {
164  static String res;
165  res = "";
166  int start = 1;
167  int end = -1;
168  String tmp = "";
169  String slabel = " ";
170  res = cmd_params;
171  res.replace("\r ", "");
172  res.replace("\n ", "");
173  res.trim();
174  if (res.length() == 0) {
175  return res.c_str();
176  }
177 
178  tmp = " " + res;
179  slabel += label;
180  if (strlen(label) > 0) {
181  start = tmp.indexOf(slabel);
182  if (start == -1) {
183  return "";
184  }
185  start+=slabel.length();
186  end = get_space_pos(tmp.c_str(),start);
187  }
188  if (end == -1) {
189  end = tmp.length();
190  }
191  //extract parameter
192  res = tmp.substring (start, end);
193 
194 
195 #ifdef AUTHENTICATION_FEATURE
196  //if no label remove authentication parameters
197  if (strlen(label) == 0) {
198 
199  tmp = " " + res;
200  start = tmp.indexOf (" pwd=");
201  if (start != -1) {
202  end = get_space_pos(tmp.c_str(),start+1);
203  res = "";
204  if (start != 0) {
205  res = tmp.substring(0, start);
206  }
207  if (end != -1) {
208  res += " " + tmp.substring(end+1, tmp.length());
209  }
210  }
211  }
212 #endif //AUTHENTICATION_FEATURE
213  //remove space format
214  res.replace("\\ ", " ");
215  //be sure no extra space
216  res.trim();
217  return res.c_str();
218 
219 }
220 
221 bool Commands::hastag (const char * cmd_params, const char *tag)
222 {
223  String tmp = "";
224  String stag = " ";
225  if ((strlen(cmd_params) == 0) || (strlen(tag) == 0)) {
226  return false;
227  }
228  stag += tag;
229  tmp = cmd_params;
230  tmp.trim();
231  tmp = " " + tmp;
232  if (tmp.indexOf(stag) == -1) {
233  return false;
234  }
235  return true;
236 }
237 
238 
239 //execute internal command
240 bool Commands::execute_internal_command (int cmd, const char* cmd_params, level_authenticate_type auth_level, ESP3DOutput * output)
241 {
242 #ifndef SERIAL_COMMAND_FEATURE
243  if (output->client() == ESP_SERIAL_CLIENT) {
244  output->printMSG("Feature disabled");
245  return false;
246  }
247 #endif //SERIAL_COMMAND_FEATURE
248  bool response = true;
249  level_authenticate_type auth_type = auth_level;
250  //log_esp3d("Authentication = %d", auth_type);
251 //override if parameters
252 #ifdef AUTHENTICATION_FEATURE
253 
254  //do not overwrite previous authetic <time=YYYY-MM-DD#H24:MM:SS>ation level
255  if (auth_type == LEVEL_GUEST) {
256  String pwd=get_param (cmd_params, "pwd=");
257  auth_type = AuthenticationService::authenticated_level(pwd.c_str());
258  }
259 #endif //AUTHENTICATION_FEATURE
260  //log_esp3d("Authentication = %d", auth_type);
261  String parameter;
262  switch (cmd) {
263 #if defined (WIFI_FEATURE)
264  //STA SSID
265  //[ESP100]<SSID>[pwd=<admin password>]
266  case 100:
267  response = ESP100(cmd_params, auth_type, output);
268  break;
269  //STA Password
270  //[ESP101]<Password>[pwd=<admin password>]
271  case 101:
272  response = ESP101(cmd_params, auth_type, output);
273  break;
274 #endif //WIFI_FEATURE
275 #if defined (WIFI_FEATURE) || defined (ETH_FEATURE)
276  //Change STA IP mode (DHCP/STATIC)
277  //[ESP102]<mode>pwd=<admin password>
278  case 102:
279  response = ESP102(cmd_params, auth_type, output);
280  break;
281  //Change STA IP/Mask/GW
282  //[ESP103]IP=<IP> MSK=<IP> GW=<IP> pwd=<admin password>
283  case 103:
284  response = ESP103(cmd_params, auth_type, output);
285  break;
286 #endif //WIFI_FEATURE ||ETH_FEATURE
287 #if defined (WIFI_FEATURE)
288  //AP SSID
289  //[ESP105]<SSID>[pwd=<admin password>]
290  case 105:
291  response = ESP105(cmd_params, auth_type, output);
292  break;
293  //AP Password
294  //[ESP106]<Password>[pwd=<admin password>]
295  case 106:
296  response = ESP106(cmd_params, auth_type, output);
297  break;
298  //Change AP IP
299  //[ESP107]<IP> pwd=<admin password>
300  case 107:
301  response = ESP107(cmd_params, auth_type, output);
302  break;
303  //Change AP channel
304  //[ESP108]<channel>pwd=<admin password>
305  case 108:
306  response = ESP108(cmd_params, auth_type, output);
307  break;
308 #endif //WIFI_FEATURE
309 
310 #if defined( WIFI_FEATURE) || defined( BLUETOOTH_FEATURE) || defined (ETH_FEATURE)
311  //Set radio state at boot which can be BT, WIFI-STA, WIFI-AP, ETH-STA, OFF
312  //[ESP110]<state>pwd=<admin password>
313  case 110:
314  response = ESP110(cmd_params, auth_type, output);
315  break;
316 #endif //WIFI_FEATURE || BLUETOOTH_FEATURE || ETH_FEATURE)
317 
318 #if defined(WIFI_FEATURE) || defined (ETH_FEATURE)
319  //Get current IP
320  //[ESP111]
321  case 111:
322  response = ESP111(cmd_params, auth_type, output);
323  break;
324 #endif //WIFI_FEATURE || ETH_FEATURE)
325 
326 #if defined(WIFI_FEATURE) || defined(ETH_FEATURE) || defined(BT_FEATURE)
327  //Get/Set hostname
328  //[ESP112]<Hostname> pwd=<admin password>
329  case 112:
330  response = ESP112(cmd_params, auth_type, output);
331  break;
332  //Get/Set immediate Network (WiFi/BT/Ethernet) state which can be ON, OFF
333  //[ESP115]<state>pwd=<admin password>
334  case 115:
335  response = ESP115(cmd_params, auth_type, output);
336  break;
337 #endif //WIFI_FEATURE|| ETH_FEATURE || BT_FEATURE
338 
339 #ifdef HTTP_FEATURE
340  //Set HTTP state which can be ON, OFF
341  //[ESP120]<state>pwd=<admin password>
342  case 120:
343  response = ESP120(cmd_params, auth_type, output);
344  break;
345  //Set HTTP port
346  //[ESP121]<port>pwd=<admin password>
347  case 121:
348  response = ESP121(cmd_params, auth_type, output);
349  break;
350 #endif //HTTP_FEATURE
351 #ifdef TELNET_FEATURE
352  //Set TELNET state which can be ON, OFF
353  //[ESP130]<state>pwd=<admin password>
354  case 130:
355  response = ESP130(cmd_params, auth_type, output);
356  break;
357  //Set TELNET port
358  //[ESP131]<port>pwd=<admin password>
359  case 131:
360  response = ESP131(cmd_params, auth_type, output);
361  break;
362 #endif //TELNET_FEATURE
363 #ifdef TIMESTAMP_FEATURE
364  //Sync / Set / Get current time
365  //[ESP140]<SYNC> <srv1=XXXXX> <srv2=XXXXX> <srv3=XXXXX> <zone=xxx> <dst=YES/NO> <time=YYYY-MM-DD#H24:MM:SS> pwd=<admin password>
366  case 140:
367  response = ESP140(cmd_params, auth_type, output);
368  break;
369 #endif //TIMESTAMP_FEATURE
370  //Get/Set boot delay
371  //[ESP150]<time>[pwd=<admin password>]
372  case 150:
373  response = ESP150(cmd_params, auth_type, output);
374  break;
375 #ifdef WS_DATA_FEATURE
376  //Set WebSocket state which can be ON, OFF
377  //[ESP160]<state>pwd=<admin password>
378  case 160:
379  response = ESP160(cmd_params, auth_type, output);
380  break;
381  //Set WebSocket port
382  //[ESP161]<port>pwd=<admin password>
383  case 161:
384  response = ESP161(cmd_params, auth_type, output);
385  break;
386 #endif //WS_DATA_FEATURE
387 #ifdef CAMERA_DEVICE
388  //Set carmera server state which can be ON, OFF
389  //[ESP170]<state>pwd=<admin password>
390  case 170:
391  response = ESP170(cmd_params, auth_type, output);
392  break;
393  case 171:
394  response = ESP171(cmd_params, auth_type, output);
395  break;
396  case 172:
397  response = ESP172(cmd_params, auth_type, output);
398  break;
399 #endif //CAMERA_DEVICE
400 #ifdef FTP_FEATURE
401  //Set Ftp state which can be ON, OFF
402  //[ESP180]<state>pwd=<admin password>
403  case 180:
404  response = ESP180(cmd_params, auth_type, output);
405  break;
406  //Set/get ftp ports
407  //[ESP181]ctrl=<port> active=<port> passive=<port> pwd=<admin password>
408  case 181:
409  response = ESP181(cmd_params, auth_type, output);
410  break;
411 #endif //FTP_FEATURE
412 #if defined (SD_DEVICE)
413  //Get SD Card Status
414  //[ESP200] pwd=<user/admin password>
415  case 200:
416  response = ESP200(cmd_params, auth_type, output);
417  break;
418 #endif //SD_DEVICE
419 #ifdef DIRECT_PIN_FEATURE
420  //Get/Set pin value
421  //[ESP201]P<pin> V<value> [PULLUP=YES RAW=YES]pwd=<admin password>
422  case 201:
423  response = ESP201(cmd_params, auth_type, output);
424  break;
425 #endif //DIRECT_PIN_FEATURE
426 #ifdef DHT_DEVICE
427  //Get DHT Value / type/Set DHT type
428  //[ESP210] <TYPE> <type=NONE/11/22/xxx> <interval=XXX in millisec>
429  case 210:
430  response = ESP210(cmd_params, auth_type, output);
431  break;
432 #endif //#ifdef DHT_DEVICE
433 #if defined (DISPLAY_DEVICE)
434  //Output to esp screen status
435  //[ESP214]<Text>pwd=<user password>
436  case 214:
437  response = ESP214(cmd_params, auth_type, output);
438  break;
439 #if defined(DISPLAY_TOUCH_DRIVER)
440  //Touch Calibration
441  //[ESP215]<CALIBRATE>[pwd=<user password>]
442  case 215:
443  response = ESP215(cmd_params, auth_type, output);
444  break;
445 #endif //DISPLAY_TOUCH_DRIVER
446 #if defined(DISPLAY_SNAPSHOT_FEATURE)
447  //Take screen snapshot
448  //[ESP216]<SNAP>[pwd=<user password>]
449  case 216:
450  response = ESP216(cmd_params, auth_type, output);
451  break;
452 #endif //DISPLAY_SNAPSHOT_FEATURE
453 #ifdef BUZZER_DEVICE
454  //Play sound
455  //[ESP250]F=<frequency> D=<duration> [pwd=<user password>]
456  case 250:
457  response = ESP250(cmd_params, auth_type, output);
458  break;
459 #endif //BUZZER_DEVICE
460 #endif //DISPLAY_DEVICE
461  //Delay command
462  //[ESP290]<delay in ms>[pwd=<user password>]
463  case 290:
464  response = ESP290(cmd_params, auth_type, output);
465  break;
466  //Get full ESP3D settings
467  //[ESP400]<pwd=admin>
468  case 400:
469  response = ESP400(cmd_params, auth_type, output);
470  break;
471  //Set EEPROM setting
472  //[ESP401]P=<position> T=<type> V=<value> pwd=<user/admin password>
473  case 401:
474  response = ESP401(cmd_params, auth_type, output);
475  break;
476 #if defined (WIFI_FEATURE)
477  //Get available AP list (limited to 30)
478  //output is JSON or plain text according parameter
479  //[ESP410]<plain>
480  case 410:
481  response = ESP410(cmd_params, auth_type, output);
482  break;
483 #endif //WIFI_FEATURE
484  //Get ESP current status
485  //output is JSON or plain text according parameter
486  //[ESP420]<plain>
487  case 420:
488  response = ESP420(cmd_params, auth_type, output);
489  break;
490  //Set ESP State
491  //cmd are RESTART / RESET
492  //[ESP444]<cmd><pwd=admin>
493  case 444:
494  response = ESP444(cmd_params, auth_type, output);
495  break;
496 #ifdef AUTHENTICATION_FEATURE
497  //Change admin password
498  //[ESP550]<password>pwd=<admin password>
499  case 550:
500  response = ESP550(cmd_params, auth_type, output);
501  break;
502  //Change user password
503  //[ESP555]<password>pwd=<admin/user password>
504  case 555:
505  response = ESP555(cmd_params, auth_type, output);
506  break;
507 #endif //AUTHENTICATION_FEATURE
508 #if defined(NOTIFICATION_FEATURE)
509  //Send Notification
510  //[ESP600]<msg>[pwd=<admin password>]
511  case 600:
512  response = ESP600(cmd_params, auth_type, output);
513  break;
514  //Set/Get Notification settings
515  //[ESP610]type=<NONE/PUSHOVER/EMAIL/LINE> T1=<token1> T2=<token2> TS=<Settings> [pwd=<admin password>]
516  //Get will give type and settings only not the protected T1/T2
517  case 610:
518  response = ESP610(cmd_params, auth_type, output);
519  break;
520 #endif //NOTIFICATION_FEATURE
521 #if defined(FILESYSTEM_FEATURE)
522  //Format ESP Filesystem
523  //[ESP710]FORMAT pwd=<admin password>
524  case 710:
525  response = ESP710(cmd_params, auth_type, output);
526  break;
527 #endif //FILESYSTEM_FEATURE
528 #if defined(SD_DEVICE)
529  //Format ESP Filesystem
530  //[ESP715]FORMATSD pwd=<admin password>
531  case 715:
532  response = ESP715(cmd_params, auth_type, output);
533  break;
534 #endif //SD_DEVICE
535 #if defined(FILESYSTEM_FEATURE) && defined(ESP_GCODE_HOST_FEATURE)
536  //Open local file
537  //[ESP700]<filename>
538  case 700:
539  response = ESP700(cmd_params, auth_type, output);
540  break;
541 
542  //List ESP Filesystem
543  //[ESP720]<Root> pwd=<admin password>
544  case 720:
545  response = ESP720(cmd_params, auth_type, output);
546  break;
547  //Action on ESP Filesystem
548  //rmdir / remove / mkdir / exists
549  //[ESP730]<Action>=<path> pwd=<admin password>
550  case 730:
551  response = ESP730(cmd_params, auth_type, output);
552  break;
553 #endif //FILESYSTEM_FEATURE
554 #if defined (SD_DEVICE)
555  //List SD Filesystem
556  //[ESP740]<Root> pwd=<admin password>
557  case 740:
558  response = ESP740(cmd_params, auth_type, output);
559  break;
560  //Action on SD Filesystem
561  //rmdir / remove / mkdir / exists
562  //[ESP750]<Action>=<path> pwd=<admin password>
563  case 750:
564  response = ESP750(cmd_params, auth_type, output);
565  break;
566 #endif //SD_DEVICE
567 #if defined (GLOBAL_FILESYSTEM_FEATURE)
568  //List Global Filesystem
569  //[ESP780]<Root> pwd=<admin password>
570  case 780:
571  response = ESP780(cmd_params, auth_type, output);
572  break;
573  //Action on Global Filesystem
574  //rmdir / remove / mkdir / exists
575  //[ESP790]<Action>=<path> pwd=<admin password>
576  case 790:
577  response = ESP790(cmd_params, auth_type, output);
578  break;
579 #endif //GLOBAL_FILESYSTEM_FEATURE
580  //Get fw version firmare target and fw version
581  //eventually set time with pc time
582  //output is JSON or plain text according parameter
583  //[ESP800]<plain><time=YYYY-MM-DD-HH-MM-SS>
584  case 800:
585  response = ESP800(cmd_params, auth_type, output);
586  break;
587 
588  //Get state / Set Enable / Disable Serial Communication
589  //[ESP900]<ENABLE/DISABLE>
590  case 900:
591  response = ESP900(cmd_params, auth_type, output);
592  break;
593 #ifdef BUZZER_DEVICE
594  //Get state / Set Enable / Disable buzzer
595  //[ESP910]<ENABLE/DISABLE>
596  case 910:
597  response = ESP910(cmd_params, auth_type, output);
598  break;
599 #endif //BUZZER_DEVICE
600  default:
601  output->printERROR ("Invalid Command");
602  response = false;
603  }
604  return response;
605 }
esp3d_commands
Commands esp3d_commands
Definition: commands.cpp:26
esp3d.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
ESP3DOutput::dispatch
size_t dispatch(uint8_t *sbuf, size_t len)
Definition: esp3doutput.cpp:87
Commands::ESP900
bool ESP900(const char *cmd_params, level_authenticate_type auth_level, ESP3DOutput *output)
Definition: ESP900.cpp:28
AuthenticationService::authenticated_level
static level_authenticate_type authenticated_level(const char *pwd=nullptr)
Definition: authentication_service.cpp:61
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
settings_esp3d.h
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
ESP3DOutput::printMSG
size_t printMSG(const char *s, bool withNL=true)
Definition: esp3doutput.cpp:190
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
ESP_SERIAL_CLIENT
#define ESP_SERIAL_CLIENT
Definition: esp3doutput.h:22
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
ESP3DOutput::printERROR
size_t printERROR(const char *s, int code_error=200)
Definition: esp3doutput.cpp:247
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
ESP3DOutput::client
uint8_t client()
Definition: esp3doutput.h:79
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
ESP3DOutput::write
size_t write(uint8_t c)
Definition: esp3doutput.cpp:322
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.h
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
esp3doutput.h
ESP_HTTP_CLIENT
#define ESP_HTTP_CLIENT
Definition: esp3doutput.h:24
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