From: luozheng <1732036298@qq.com> Date: Sun, 19 Oct 2025 09:51:47 +0000 (+0800) Subject: 解决lnppp 因进入到睡眠状态ota下载失败问题 X-Git-Tag: V1.0.9_20251128_194606_LN~207 X-Git-Url: http://git.snicker.com.cn/?a=commitdiff_plain;h=880ec76275be3ac9dbe1a05ad91ebf7a75ded01e;p=mirrors%2FFD230.git 解决lnppp 因进入到睡眠状态ota下载失败问题 --- diff --git a/code/sdk/zhihui/leiniao/imsl_ln/ln_api.c b/code/sdk/zhihui/leiniao/imsl_ln/ln_api.c index f3e1142c5..013cc2412 100644 --- a/code/sdk/zhihui/leiniao/imsl_ln/ln_api.c +++ b/code/sdk/zhihui/leiniao/imsl_ln/ln_api.c @@ -404,9 +404,7 @@ int uapi_ln_download_file(const char *url, const char *save_path) WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[DOWNLOAD] 开始下载: %s -> %s", url, save_path); g_ln_is_file_downloading = 1; - #ifdef SUPPORT_CAT1_SERVICE uapi_pm_add_sleep_veto(PM_ID_DEBUG); - #endif HttpClient client = {0}; HttpClientData client_data = {0}; @@ -418,9 +416,7 @@ int uapi_ln_download_file(const char *url, const char *save_path) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[DOWNLOAD] fopen failed for %s", save_path); g_ln_is_file_downloading = 0; - #ifdef SUPPORT_CAT1_SERVICE uapi_pm_remove_sleep_veto(PM_ID_DEBUG); - #endif return ERRCODE_FAIL; } @@ -430,9 +426,7 @@ int uapi_ln_download_file(const char *url, const char *save_path) WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[DOWNLOAD] prepare failed: %d", prep); fclose(fd); g_ln_is_file_downloading = 0; - #ifdef SUPPORT_CAT1_SERVICE uapi_pm_remove_sleep_veto(PM_ID_DEBUG); - #endif return ERRCODE_FAIL; } @@ -444,9 +438,7 @@ int uapi_ln_download_file(const char *url, const char *save_path) fclose(fd); HttpClientUnprepare(&client_data); g_ln_is_file_downloading = 0; - #ifdef SUPPORT_CAT1_SERVICE uapi_pm_remove_sleep_veto(PM_ID_DEBUG); - #endif return ERRCODE_FAIL; } @@ -459,9 +451,7 @@ int uapi_ln_download_file(const char *url, const char *save_path) HttpClientClse(&client); HttpClientUnprepare(&client_data); g_ln_is_file_downloading = 0; - #ifdef SUPPORT_CAT1_SERVICE uapi_pm_remove_sleep_veto(PM_ID_DEBUG); - #endif return ERRCODE_FAIL; } @@ -483,9 +473,7 @@ int uapi_ln_download_file(const char *url, const char *save_path) fclose(fd); HttpClientClse(&client); HttpClientUnprepare(&client_data); - #ifdef SUPPORT_CAT1_SERVICE uapi_pm_remove_sleep_veto(PM_ID_DEBUG); - #endif return ERRCODE_FAIL; } total_written += written; @@ -522,9 +510,7 @@ int uapi_ln_download_file(const char *url, const char *save_path) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "删除不完整文件成功\r\n"); } - #ifdef SUPPORT_CAT1_SERVICE uapi_pm_remove_sleep_veto(PM_ID_DEBUG); - #endif } HttpClientUnprepare(&client_data); @@ -532,9 +518,7 @@ int uapi_ln_download_file(const char *url, const char *save_path) fclose(fd); g_ln_is_file_downloading = 0; WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[DOWNLOAD] 下载过程结束,ret=%d", ret); - #ifdef SUPPORT_CAT1_SERVICE uapi_pm_remove_sleep_veto(PM_ID_DEBUG); - #endif return ret; } diff --git a/code/sdk/zhihui/leiniao/imsl_ln/ln_api_ota.c b/code/sdk/zhihui/leiniao/imsl_ln/ln_api_ota.c index c0fb39036..ce867d04f 100644 --- a/code/sdk/zhihui/leiniao/imsl_ln/ln_api_ota.c +++ b/code/sdk/zhihui/leiniao/imsl_ln/ln_api_ota.c @@ -366,9 +366,9 @@ static int ln_download_file_to_path(const char *full_url, const char *save_path, /* CAT1 网络保活处理 */ cat1_api_add_cat1_vote(); cat1_api_disable_cat1_cmd(0); - uapi_pm_add_sleep_veto(PM_ID_DEBUG); LOS_Msleep(500); // 等待模块就绪 #endif + uapi_pm_add_sleep_veto(PM_ID_DEBUG); /* 初始化HTTP客户端(与http_download风格一致) */ HttpClient client = {0};