feat: add local-staging FULLOTA2 flow
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
#include "cJSON.h"
|
||||
#include "build_macro.h"
|
||||
#include "ql_log.h"
|
||||
#include "ota_fullfota2.h"
|
||||
|
||||
|
||||
|
||||
@@ -242,6 +243,17 @@ static void ota_state_clear(void)
|
||||
}
|
||||
}
|
||||
|
||||
static void ota_fullfota2_finished(int result)
|
||||
{
|
||||
if (result == BANBAN_FULLOTA2_OK) {
|
||||
return;
|
||||
}
|
||||
|
||||
RLOGE("FULLOTA2 failed before activation: %d", result);
|
||||
ota_state_clear();
|
||||
fota_start = 0;
|
||||
}
|
||||
|
||||
static int ota_parse_version(const char *version, unsigned int parts[3])
|
||||
{
|
||||
char tail;
|
||||
@@ -1246,6 +1258,8 @@ static void ota_report_pending_success(void)
|
||||
compare_result != 0) {
|
||||
RLOGE("OTA pending state version mismatch: current=%s target=%s",
|
||||
current_version, state.target_version);
|
||||
banban_fullfota2_discard_staged_package();
|
||||
ota_state_clear();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1369,12 +1383,10 @@ static void handle_ota_upgrade(command_t *cmd)
|
||||
}
|
||||
}
|
||||
|
||||
/* Product requirement: keep deleting the configured audio files before OTA. */
|
||||
app_file_check_del();
|
||||
|
||||
ret = ql_fullfota_app_start(cmd->params.ota.url);
|
||||
ret = banban_fullfota2_start(cmd->params.ota.url,
|
||||
ota_fullfota2_finished);
|
||||
if (ret != 0) {
|
||||
RLOGE("start OTA failed: %d", ret);
|
||||
RLOGE("start FULLOTA2 task failed: %d", ret);
|
||||
fota_start = 0;
|
||||
ota_state_clear();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user