@@ -114,7 +114,7 @@ bool ESP3DGCodeParserService::hasMultiLineReport(const char* data) {
114114}
115115
116116bool ESP3DGCodeParserService::processCommand (const char * data) {
117- esp3d_log (" processing Command %s" , data);
117+ esp3d_log_d (" processing Command %s" , data);
118118 if (data != nullptr && strlen (data) > 0 ) {
119119 // is temperature
120120 if (strstr (data, " T:" ) != nullptr ) {
@@ -125,7 +125,7 @@ bool ESP3DGCodeParserService::processCommand(const char* data) {
125125 char * ptrt1 = strstr (data, " T1:" );
126126 char * ptrb = strstr (data, " B:" );
127127 if (ptrt0 && ptrt1) { // dual extruder
128- esp3d_log (" Temperature dual extruders" );
128+ esp3d_log_d (" Temperature dual extruders" );
129129 ptrt0 += 3 ;
130130 ptrt1 += 3 ;
131131 // Extruder 0 current temperature
@@ -148,7 +148,7 @@ bool ESP3DGCodeParserService::processCommand(const char* data) {
148148 ptrt0);
149149 esp3dTftValues.set_string_value (
150150 ESP3DValuesIndex::ext_0_target_temperature, ptrtt);
151- esp3d_log (" T0: %s / %s" , ptrt0, ptrtt);
151+ esp3d_log_d (" T0: %s / %s" , ptrt0, ptrtt);
152152
153153 // Extruder 1 current temperature
154154 ptre = strstr (ptrt1, " /" );
@@ -178,9 +178,9 @@ bool ESP3DGCodeParserService::processCommand(const char* data) {
178178 ptrt1);
179179 esp3dTftValues.set_string_value (
180180 ESP3DValuesIndex::ext_1_target_temperature, ptrtt);
181- esp3d_log (" T1: %s / %s" , ptrt1, ptrtt);
181+ esp3d_log_d (" T1: %s / %s" , ptrt1, ptrtt);
182182 } else { // single extruder
183- esp3d_log (" Temperature single extruder" );
183+ esp3d_log_d (" Temperature single extruder" );
184184 esp3dTftValues.set_string_value (ESP3DValuesIndex::ext_1_temperature,
185185 " #" );
186186 esp3dTftValues.set_string_value (
@@ -207,10 +207,10 @@ bool ESP3DGCodeParserService::processCommand(const char* data) {
207207 esp3dTftValues.set_string_value (
208208 ESP3DValuesIndex::ext_0_target_temperature, ptrtt);
209209
210- esp3d_log (" T: %s / %s" , ptrt, ptrtt);
210+ esp3d_log_d (" T: %s / %s" , ptrt, ptrtt);
211211 }
212212 if (ptrb) { // bed
213- esp3d_log (" Temperature bed" );
213+ esp3d_log_d (" Temperature bed" );
214214 ptrb += 2 ;
215215 // Bed current temperature
216216 char * ptre = strstr (ptrb, " /" );
@@ -232,9 +232,9 @@ bool ESP3DGCodeParserService::processCommand(const char* data) {
232232 ptrb);
233233 esp3dTftValues.set_string_value (
234234 ESP3DValuesIndex::bed_target_temperature, ptrtt);
235- esp3d_log (" Bed: %s / %s" , ptrb, ptrtt);
235+ esp3d_log_d (" Bed: %s / %s" , ptrb, ptrtt);
236236 } else {
237- esp3d_log (" No Temperature bed" );
237+ esp3d_log_d (" No Temperature bed" );
238238 esp3dTftValues.set_string_value (ESP3DValuesIndex::bed_temperature, " #" );
239239 esp3dTftValues.set_string_value (
240240 ESP3DValuesIndex::bed_target_temperature, " #" );
@@ -247,7 +247,7 @@ bool ESP3DGCodeParserService::processCommand(const char* data) {
247247 } else if (strstr (data, " X:" ) != nullptr &&
248248 strstr (data, " Bed X:" ) == nullptr ) {
249249 // X:0.00 Y:0.00 Z:0.00 E:0.00 Count X:0 Y:0 Z:0
250- esp3d_log (" Positions" );
250+ esp3d_log_d (" Positions" );
251251 char * ptrx = strstr (data, " X:" );
252252 char * ptry = strstr (data, " Y:" );
253253 char * ptrz = strstr (data, " Z:" );
@@ -312,11 +312,11 @@ bool ESP3DGCodeParserService::processCommand(const char* data) {
312312 }
313313 }
314314 // is there an index ?
315- esp3d_log (" Check index in %s" , ptr106);
315+ esp3d_log_d (" Check index in %s" , ptr106);
316316 uint8_t index = 0 ;
317317 char * ptrI = strstr (ptr106, " P" );
318318 if (ptrI) {
319- esp3d_log (" Index found %s" , ptrI);
319+ esp3d_log_d (" Index found %s" , ptrI);
320320 if (ptrI[1 ] == ' 1' ) {
321321 index = 1 ;
322322 }
@@ -330,7 +330,7 @@ bool ESP3DGCodeParserService::processCommand(const char* data) {
330330
331331 fanSpeed = esp3d_string::set_precision (std::to_string (fspeed), 0 );
332332 // set fan speed according index
333- esp3d_log (" Fan speed 106, index: %d, %s" , index, fanSpeed.c_str ());
333+ esp3d_log_d (" Fan speed 106, index: %d, %s" , index, fanSpeed.c_str ());
334334 if (index == 0 ) {
335335 esp3dTftValues.set_string_value (ESP3DValuesIndex::ext_0_fan,
336336 fanSpeed.c_str ());
@@ -349,7 +349,7 @@ bool ESP3DGCodeParserService::processCommand(const char* data) {
349349 index = 1 ;
350350 }
351351 }
352- esp3d_log (" Fan speed 107, index: %d" , index);
352+ esp3d_log_d (" Fan speed 107, index: %d" , index);
353353 // set fan speed to 0 according index
354354 if (index == 0 ) {
355355 esp3dTftValues.set_string_value (ESP3DValuesIndex::ext_0_fan, " 0" );
@@ -409,8 +409,8 @@ ESP3DDataType ESP3DGCodeParserService::getType(const char* data) {
409409
410410 // is it ack ?
411411 if (((ptr[0 ] == ' o' && ptr[1 ] == ' k' ) &&
412- (ptr[2 ] == ' \n ' || ptr[2 ] == ' \r ' || ptr[2 ] == ' ' || ptr[2 ] == 0x0 )) || strstr (ptr, " ok" ) != nullptr ) {
413- esp3d_log (" Ack found in %s" , ptr);
412+ (ptr[2 ] == ' \n ' || ptr[2 ] == ' \r ' || ptr[2 ] == ' ' || ptr[2 ] == 0x0 )) || strstr (ptr, " ok" ) != nullptr || strstr (ptr, " o` " ) != nullptr || strstr (ptr, " `k " ) != nullptr ) {
413+ esp3d_log_d (" Ack found in %s" , ptr);
414414 return ESP3DDataType::ack;
415415 }
416416
@@ -462,7 +462,7 @@ ESP3DDataType ESP3DGCodeParserService::getType(const char* data) {
462462 strstr (ptr, " heating" ) == ptr || strstr (ptr, " echo:busy" ) == ptr ||
463463 strstr (ptr, " echo:processing" ) == ptr ||
464464 strstr (ptr, " echo:heating" ) == ptr) {
465- esp3d_log (" Status: %s" , esp3d_string::str_trim (ptr));
465+ esp3d_log_d (" Status: %s" , esp3d_string::str_trim (ptr));
466466 return ESP3DDataType::status;
467467 }
468468 /*
0 commit comments