mirror of
https://git.mirrors.martin98.com/https://github.com/luc-github/ESP3D.git
synced 2025-08-14 12:06:00 +08:00
Add IP query command and Module reset command
"[ESP111]<pre display>" show IP with <pre display> command "[ESP111]" will show 192.168.x.xxx "[ESP111]M117 " will show M117 192.168.x.xxx "[ESP888]RESTART" will show RESTART and restart module
This commit is contained in:
parent
10f1f9d68d
commit
beca36448f
@ -19,6 +19,7 @@
|
||||
*/
|
||||
|
||||
#include "command.h"
|
||||
#include "config.h"
|
||||
#include "webinterface.h"
|
||||
extern "C" {
|
||||
#include "user_interface.h"
|
||||
@ -37,6 +38,26 @@ void COMMAND::execute_command(int cmd,String cmd_params)
|
||||
case 800:
|
||||
Serial.println("\nCommand received");
|
||||
break;
|
||||
case 111:
|
||||
{
|
||||
String currentIP ;
|
||||
if (wifi_get_opmode()==WIFI_STA)currentIP=WiFi.localIP().toString();
|
||||
else currentIP=WiFi.softAPIP().toString();
|
||||
Serial.print("\n\r");
|
||||
Serial.print(cmd_params);
|
||||
Serial.println(currentIP);
|
||||
Serial.print("\r\n");
|
||||
}
|
||||
break;
|
||||
case 888:
|
||||
if (cmd_params=="RESTART")
|
||||
{
|
||||
Serial.print("\r");
|
||||
Serial.print(cmd_params);
|
||||
web_interface->restartmodule=true;
|
||||
Serial.print("\r\n");
|
||||
}
|
||||
break;
|
||||
//default:
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user