Review comments
This commit is contained in:
1 parent
157a19ff35
commit
7da8b335ab
7 files changed
+82
-53
No files matched your search
@@ -201,7 +201,10 @@ const std::string& OtaUpdater::getLatestVersion() const { return latestVersion;
|
||||
|
||||
void OtaUpdater::cleanupUpdate() {
|
||||
if (otaHandle) {
|
||||
esp_https_ota_finish(otaHandle);
|
||||
const esp_err_t err = esp_https_ota_finish(otaHandle);
|
||||
if (err != ESP_OK) {
|
||||
LOG_ERR("OTA", "esp_https_ota_finish on cleanup: %s", esp_err_to_name(err));
|
||||
}
|
||||
otaHandle = nullptr;
|
||||
}
|
||||
cancelRequested = false;
|
||||
@@ -365,20 +368,3 @@ OtaUpdater::OtaUpdaterError OtaUpdater::performInstallUpdateStep() {
|
||||
LOG_INF("OTA", "Update completed");
|
||||
return OK;
|
||||
}
|
||||
|
||||
OtaUpdater::OtaUpdaterError OtaUpdater::installUpdate() {
|
||||
const auto beginResult = beginInstallUpdate();
|
||||
if (beginResult != UPDATE_IN_PROGRESS) {
|
||||
return beginResult;
|
||||
}
|
||||
|
||||
OtaUpdaterError result;
|
||||
do {
|
||||
result = performInstallUpdateStep();
|
||||
if (result == UPDATE_IN_PROGRESS) {
|
||||
delay(100);
|
||||
}
|
||||
} while (result == UPDATE_IN_PROGRESS);
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -51,7 +51,6 @@ class OtaUpdater {
|
||||
OtaUpdaterError performInstallUpdateStep();
|
||||
void cancelUpdate();
|
||||
void cleanupUpdate();
|
||||
OtaUpdaterError installUpdate();
|
||||
|
||||
private:
|
||||
static int forceSetOtaBootPartition();
|
||||
|
||||
Reference in new issue
Block a user