mirror of
https://git.mirrors.martin98.com/https://github.com/luc-github/ESP3D.git
synced 2025-08-12 11:48:59 +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
|
* Get fw version
|
||||||
[ESP800]<header answer>
|
[ESP800]<header answer>
|
||||||
|
|
||||||
|
* Get fw target
|
||||||
|
[ESP801]<header answer>
|
||||||
|
|
||||||
* Clear status/error/info list
|
* Clear status/error/info list
|
||||||
cmd can be ALL, ERROR, INFO, STATUS
|
cmd can be ALL, ERROR, INFO, STATUS
|
||||||
[ESP999]<cmd>
|
[ESP999]<cmd>
|
||||||
|
@ -449,6 +449,26 @@ void COMMAND::execute_command(int cmd,String cmd_params, tpipe output)
|
|||||||
BRIDGE::print("FW version:", output);
|
BRIDGE::print("FW version:", output);
|
||||||
BRIDGE::println(FW_VERSION, output);
|
BRIDGE::println(FW_VERSION, output);
|
||||||
break;
|
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
|
//clear status/error/info list
|
||||||
//[ESP999]<cmd>
|
//[ESP999]<cmd>
|
||||||
case 999:
|
case 999:
|
||||||
@ -529,6 +549,8 @@ bool COMMAND::check_command(String buffer, tpipe output, bool handlelockserial)
|
|||||||
int Zpos = buffer.indexOf("Z:");
|
int Zpos = buffer.indexOf("Z:");
|
||||||
#endif
|
#endif
|
||||||
#if FIRMWARE_TARGET == SMOOTHIEWARE
|
#if FIRMWARE_TARGET == SMOOTHIEWARE
|
||||||
|
int Bpos = buffer.indexOf("B:");
|
||||||
|
if (Bpos > -1 ) is_temp = true;
|
||||||
#ifdef SPEED_MONITORING_FEATURE
|
#ifdef SPEED_MONITORING_FEATURE
|
||||||
int Speedpos = buffer.indexOf("Speed factor at ");
|
int Speedpos = buffer.indexOf("Speed factor at ");
|
||||||
#endif
|
#endif
|
||||||
@ -558,9 +580,13 @@ bool COMMAND::check_command(String buffer, tpipe output, bool handlelockserial)
|
|||||||
int Infopos= buffer.indexOf("Info:");
|
int Infopos= buffer.indexOf("Info:");
|
||||||
#endif
|
#endif
|
||||||
#ifdef STATUS_MSG_FEATURE
|
#ifdef STATUS_MSG_FEATURE
|
||||||
|
#if FIRMWARE_TARGET == MARLIN
|
||||||
|
int Statuspos= buffer.indexOf("echo:");
|
||||||
|
#else
|
||||||
int Statuspos= buffer.indexOf("Status:");
|
int Statuspos= buffer.indexOf("Status:");
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef SERIAL_COMMAND_FEATURE
|
#ifdef SERIAL_COMMAND_FEATURE
|
||||||
String ESP_Command;
|
String ESP_Command;
|
||||||
@ -594,8 +620,24 @@ bool COMMAND::check_command(String buffer, tpipe output, bool handlelockserial)
|
|||||||
if(spacepos-Tpos < 17) {
|
if(spacepos-Tpos < 17) {
|
||||||
web_interface->answer4M105=buffer; //do not interprete just need when requested so store it
|
web_interface->answer4M105=buffer; //do not interprete just need when requested so store it
|
||||||
web_interface->last_temp=millis();
|
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
|
#endif
|
||||||
#ifdef POS_MONITORING_FEATURE
|
#ifdef POS_MONITORING_FEATURE
|
||||||
//Position of axis
|
//Position of axis
|
||||||
@ -646,8 +688,12 @@ bool COMMAND::check_command(String buffer, tpipe output, bool handlelockserial)
|
|||||||
if (Statuspos>-1) {
|
if (Statuspos>-1) {
|
||||||
#if FIRMWARE_TARGET == SMOOTHIEWARE
|
#if FIRMWARE_TARGET == SMOOTHIEWARE
|
||||||
(web_interface->status_msg).add(buffer.substring(Statuspos+8).c_str());
|
(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
|
#else
|
||||||
(web_interface->status_msg).add(buffer.substring(Statuspos+7).c_str());
|
(web_interface->status_msg).add(buffer.substring(Statuspos+7).c_str());
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user