Bugfix
parent
45033b1397
commit
bc2654ce9e
|
|
@ -52,6 +52,18 @@ void KlipperClient::getPrinterJobResults() {
|
||||||
bufferSize,
|
bufferSize,
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
|
if (this->jsonRequestClient->getLastError() != "") {
|
||||||
|
this->debugController->printLn(this->jsonRequestClient->getLastError());
|
||||||
|
printerData.error = this->jsonRequestClient->getLastError();
|
||||||
|
printerData.state = "";
|
||||||
|
printerData.isPrinting = false;
|
||||||
|
printerData.toolTemp = "";
|
||||||
|
printerData.toolTargetTemp = "";
|
||||||
|
printerData.bedTemp = "";
|
||||||
|
printerData.bedTargetTemp = "";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
printerData.state = (const char*)(*jsonDoc)["result"]["status"]["print_stats"]["state"];
|
printerData.state = (const char*)(*jsonDoc)["result"]["status"]["print_stats"]["state"];
|
||||||
printerData.filamentLength = (const char*)(*jsonDoc)["result"]["status"]["job"]["print_stats"]["filament_used"];
|
printerData.filamentLength = (const char*)(*jsonDoc)["result"]["status"]["job"]["print_stats"]["filament_used"];
|
||||||
printerData.progressPrintTime = (const char*)(*jsonDoc)["result"]["status"]["print_stats"]["print_duration"];
|
printerData.progressPrintTime = (const char*)(*jsonDoc)["result"]["status"]["print_stats"]["print_duration"];
|
||||||
|
|
|
||||||
|
|
@ -103,6 +103,7 @@ DynamicJsonDocument *JsonRequestClient::requestJson(
|
||||||
this->resetLastError();
|
this->resetLastError();
|
||||||
WiFiClient reqClient = this->requestWifiClient(requestType, server, port, encodedAuth, httpPath, apiPostBody);
|
WiFiClient reqClient = this->requestWifiClient(requestType, server, port, encodedAuth, httpPath, apiPostBody);
|
||||||
if ((this->lastError != "") || !withResponse) {
|
if ((this->lastError != "") || !withResponse) {
|
||||||
|
reqClient.stop();
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -112,6 +113,7 @@ DynamicJsonDocument *JsonRequestClient::requestJson(
|
||||||
if (error) {
|
if (error) {
|
||||||
this->debugController->printLn("Data Parsing failed: " + server + ":" + String(port) + "[" + error.c_str() + "]");
|
this->debugController->printLn("Data Parsing failed: " + server + ":" + String(port) + "[" + error.c_str() + "]");
|
||||||
this->lastError = "Data Parsing failed: " + server + ":" + String(port);
|
this->lastError = "Data Parsing failed: " + server + ":" + String(port);
|
||||||
|
reqClient.stop();
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
reqClient.stop();
|
reqClient.stop();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue