mirror of
https://git.mirrors.martin98.com/https://github.com/luc-github/ESP3D.git
synced 2025-08-12 06:59:02 +08:00
add command to get FW target
This commit is contained in:
parent
87b5720a16
commit
6cbb11ddf0
@ -69,6 +69,9 @@ if no password set it use default one
|
||||
* Get fw version
|
||||
[ESP800]<header answer>
|
||||
|
||||
* Get fw target
|
||||
[ESP801]<header answer>
|
||||
|
||||
* Clear status/error/info list
|
||||
cmd can be ALL, ERROR, INFO, STATUS
|
||||
[ESP999]<cmd>
|
||||
|
@ -449,6 +449,26 @@ void COMMAND::execute_command(int cmd,String cmd_params, tpipe output)
|
||||
BRIDGE::print("FW version:", output);
|
||||
BRIDGE::println(FW_VERSION, output);
|
||||
break;
|
||||
//get fw target
|
||||
//[ESP801]<header answer>
|
||||
case 801:
|
||||
BRIDGE::print(cmd_params, output);
|
||||
#if FIRMWARE_TARGET == REPETIER
|
||||
BRIDGE::println("Repetier", output);
|
||||
#endif
|
||||
#if FIRMWARE_TARGET == REPETIER4DV
|
||||
BRIDGE::println("Repetier_Davinci", output);
|
||||
#endif
|
||||
#if FIRMWARE_TARGET == MARLIN
|
||||
BRIDGE::println("Marlin", output);
|
||||
#endif
|
||||
#if FIRMWARE_TARGET == MARLINKIMBRA
|
||||
BRIDGE::println("Marlin_Kimbra", output);
|
||||
#endif
|
||||
#if FIRMWARE_TARGET == SMOOTHIEWARE
|
||||
BRIDGE::println("Smoothieware", output);
|
||||
#endif
|
||||
break;
|
||||
//clear status/error/info list
|
||||
//[ESP999]<cmd>
|
||||
case 999:
|
||||
@ -529,6 +549,8 @@ bool COMMAND::check_command(String buffer, tpipe output, bool handlelockserial)
|
||||
int Zpos = buffer.indexOf("Z:");
|
||||
#endif
|
||||
#if FIRMWARE_TARGET == SMOOTHIEWARE
|
||||
int Bpos = buffer.indexOf("B:");
|
||||
if (Bpos > -1 ) is_temp = true;
|
||||
#ifdef SPEED_MONITORING_FEATURE
|
||||
int Speedpos = buffer.indexOf("Speed factor at ");
|
||||
#endif
|
||||
@ -558,9 +580,13 @@ bool COMMAND::check_command(String buffer, tpipe output, bool handlelockserial)
|
||||
int Infopos= buffer.indexOf("Info:");
|
||||
#endif
|
||||
#ifdef STATUS_MSG_FEATURE
|
||||
#if FIRMWARE_TARGET == MARLIN
|
||||
int Statuspos= buffer.indexOf("echo:");
|
||||
#else
|
||||
int Statuspos= buffer.indexOf("Status:");
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef SERIAL_COMMAND_FEATURE
|
||||
String ESP_Command;
|
||||
@ -594,8 +620,24 @@ bool COMMAND::check_command(String buffer, tpipe output, bool handlelockserial)
|
||||
if(spacepos-Tpos < 17) {
|
||||
web_interface->answer4M105=buffer; //do not interprete just need when requested so store it
|
||||
web_interface->last_temp=millis();
|
||||
} else {
|
||||
LOG("Not a T temp")
|
||||
}
|
||||
}
|
||||
#if FIRMWARE_TARGET == SMOOTHIEWARE
|
||||
else if (Bpos > -1 ){
|
||||
//look for valid temperature answer
|
||||
int slashpos = buffer.indexOf(" /",Bpos);
|
||||
int spacepos = buffer.indexOf(" ",slashpos+1);
|
||||
//if match mask B:xxx.xx /xxx.xx
|
||||
if(spacepos-Bpos < 17) {
|
||||
web_interface->answer4M105=buffer; //do not interprete just need when requested so store it
|
||||
web_interface->last_temp=millis();
|
||||
} else {
|
||||
LOG("Not a B temp")
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#ifdef POS_MONITORING_FEATURE
|
||||
//Position of axis
|
||||
@ -646,8 +688,12 @@ bool COMMAND::check_command(String buffer, tpipe output, bool handlelockserial)
|
||||
if (Statuspos>-1) {
|
||||
#if FIRMWARE_TARGET == SMOOTHIEWARE
|
||||
(web_interface->status_msg).add(buffer.substring(Statuspos+8).c_str());
|
||||
#else
|
||||
#if FIRMWARE_TARGET == MARLIN
|
||||
(web_interface->status_msg).add(buffer.substring(Statuspos+5).c_str());
|
||||
#else
|
||||
(web_interface->status_msg).add(buffer.substring(Statuspos+7).c_str());
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user