modify:ota:erase the download img before the downloading
@@ -388,9 +388,21 @@ static int https_filedownload(ota_https_para_t *param,http_section_t *section)
ret = ota_flag_get(param->ota_type, &otaflag);
if(ret != 0 )
{
+ LINK_LOG_ERROR("Get the failed");
goto EXIT_FLAGGET;
}
+ ret = ota_img_erase(param->ota_type,EN_OTA_IMG_DOWNLOAD);
+ if(ret != 0 )
+ {
+ LINK_LOG_ERROR("Erase the download img failed");
+ goto EXIT_FLAGGET;
+ }
+ else
+ {
+ LINK_LOG_DEBUG("Erase the download img SUCCESS");
+ }
+
file_off = 0;
file_lenleft = param->file_size;
@@ -473,17 +485,10 @@ int ota_https_download(ota_https_para_t *param)
osal_free(section);
-
EXIT_SECTIONPARAM:
return ret;
}
-
-
-
-
-
-
#ifdef CONFIG_SHELL_ENABLE
#include <shell.h>
