mirror of
https://github.com/Laxilef/OTGateway.git
synced 2025-12-11 18:54:28 +05:00
refactor: moving some strings to flash memory
This commit is contained in:
@@ -154,11 +154,11 @@ public:
|
|||||||
result->error = Update.errorString();
|
result->error = Update.errorString();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Log.serrorln("PORTAL.OTA", F("File '%s', on start: %s"), upload.filename.c_str(), result->error.c_str());
|
Log.serrorln(FPSTR(L_PORTAL_OTA), F("File '%s', on start: %s"), upload.filename.c_str(), result->error.c_str());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Log.sinfoln("PORTAL.OTA", F("File '%s', started"), upload.filename.c_str());
|
Log.sinfoln(FPSTR(L_PORTAL_OTA), F("File '%s', started"), upload.filename.c_str());
|
||||||
|
|
||||||
} else if (upload.status == UPLOAD_FILE_WRITE) {
|
} else if (upload.status == UPLOAD_FILE_WRITE) {
|
||||||
if (Update.write(upload.buf, upload.currentSize) != upload.currentSize) {
|
if (Update.write(upload.buf, upload.currentSize) != upload.currentSize) {
|
||||||
@@ -172,20 +172,20 @@ public:
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
Log.serrorln(
|
Log.serrorln(
|
||||||
"PORTAL.OTA",
|
FPSTR(L_PORTAL_OTA),
|
||||||
F("File '%s', on writing %d bytes: %s"),
|
F("File '%s', on writing %d bytes: %s"),
|
||||||
upload.filename.c_str(), upload.totalSize, result->error
|
upload.filename.c_str(), upload.totalSize, result->error
|
||||||
);
|
);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
Log.sinfoln("PORTAL.OTA", F("File '%s', writed %d bytes"), upload.filename.c_str(), upload.totalSize);
|
Log.sinfoln(FPSTR(L_PORTAL_OTA), F("File '%s', writed %d bytes"), upload.filename.c_str(), upload.totalSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (upload.status == UPLOAD_FILE_END) {
|
} else if (upload.status == UPLOAD_FILE_END) {
|
||||||
if (Update.end(true)) {
|
if (Update.end(true)) {
|
||||||
result->status = UpgradeStatus::SUCCESS;
|
result->status = UpgradeStatus::SUCCESS;
|
||||||
|
|
||||||
Log.sinfoln("PORTAL.OTA", F("File '%s': finish"), upload.filename.c_str());
|
Log.sinfoln(FPSTR(L_PORTAL_OTA), F("File '%s': finish"), upload.filename.c_str());
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
result->status = UpgradeStatus::ERROR_ON_FINISH;
|
result->status = UpgradeStatus::ERROR_ON_FINISH;
|
||||||
@@ -195,14 +195,14 @@ public:
|
|||||||
result->error = Update.errorString();
|
result->error = Update.errorString();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Log.serrorln("PORTAL.OTA", F("File '%s', on finish: %s"), upload.filename.c_str(), result->error);
|
Log.serrorln(FPSTR(L_PORTAL_OTA), F("File '%s', on finish: %s"), upload.filename.c_str(), result->error);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (upload.status == UPLOAD_FILE_ABORTED) {
|
} else if (upload.status == UPLOAD_FILE_ABORTED) {
|
||||||
Update.end(false);
|
Update.end(false);
|
||||||
result->status = UpgradeStatus::ABORTED;
|
result->status = UpgradeStatus::ABORTED;
|
||||||
|
|
||||||
Log.serrorln("PORTAL.OTA", F("File '%s': aborted"), upload.filename.c_str());
|
Log.serrorln(FPSTR(L_PORTAL_OTA), F("File '%s': aborted"), upload.filename.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ const char L_NETWORK_SETTINGS[] PROGMEM = "NETWORK.SETTINGS";
|
|||||||
const char L_PORTAL_WEBSERVER[] PROGMEM = "PORTAL.WEBSERVER";
|
const char L_PORTAL_WEBSERVER[] PROGMEM = "PORTAL.WEBSERVER";
|
||||||
const char L_PORTAL_DNSSERVER[] PROGMEM = "PORTAL.DNSSERVER";
|
const char L_PORTAL_DNSSERVER[] PROGMEM = "PORTAL.DNSSERVER";
|
||||||
const char L_PORTAL_CAPTIVE[] PROGMEM = "PORTAL.CAPTIVE";
|
const char L_PORTAL_CAPTIVE[] PROGMEM = "PORTAL.CAPTIVE";
|
||||||
|
const char L_PORTAL_OTA[] PROGMEM = "PORTAL.OTA";
|
||||||
const char L_MAIN[] PROGMEM = "MAIN";
|
const char L_MAIN[] PROGMEM = "MAIN";
|
||||||
const char L_MQTT[] PROGMEM = "MQTT";
|
const char L_MQTT[] PROGMEM = "MQTT";
|
||||||
const char L_MQTT_MSG[] PROGMEM = "MQTT.MSG";
|
const char L_MQTT_MSG[] PROGMEM = "MQTT.MSG";
|
||||||
|
|||||||
Reference in New Issue
Block a user