From: hcj <1224667075@qq.com> Date: Sat, 29 Nov 2025 07:53:47 +0000 (+0800) Subject: cat1升级启动换位置 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=6e15647565d451ea8b3625ac74ff483bb2863a01;p=mirrors%2FFD230.git cat1升级启动换位置 --- diff --git a/code/sdk/zhihui/4g/cat1Service/Service/cat1_server.c b/code/sdk/zhihui/4g/cat1Service/Service/cat1_server.c index c1b819260..2b6d21fe8 100644 --- a/code/sdk/zhihui/4g/cat1Service/Service/cat1_server.c +++ b/code/sdk/zhihui/4g/cat1Service/Service/cat1_server.c @@ -1109,6 +1109,21 @@ int cat1_handle_version_msg(char *msg) // OHOS::ConfigModel::GetInstance()->SetpyVer(cat1_api_runtime_get_cat1_pyver()); // OHOS::ConfigModel::GetInstance()->SetmoderVer(cat1_api_runtime_get_cat1_modemver()); // cat1_msg_event_sendmsg_toUI("verupdate"); + + uint8_t need_ota=0; + FILE *fp= fopen(CAT1_PY_IS_NEED_UPDATA_PATH,"rb+"); + if(fp) + { + fread(&need_ota,sizeof(uint8_t),1,fp); + fclose(fp); + remove(CAT1_PY_IS_NEED_UPDATA_PATH); + if(need_ota>g_py_ver) + { + cat1_start_tcp_ota_init(); + cat1_tcp_server_init(); + } + + } } @@ -1763,20 +1778,7 @@ errcode_t cat1_server_init(void) //第一次启动,要确保去除已经添加过的cat1 Vote restart_sleep_cat1_timer(); #endif - uint8_t need_ota=0; - FILE *fp= fopen(CAT1_PY_IS_NEED_UDP_PATH,"rb+"); - if(fp) - { - fread(&need_ota,sizeof(uint8_t),1,fp); - fclose(fp); - remove(CAT1_PY_IS_NEED_UDP_PATH); - if(need_ota>g_py_ver) - { - cat1_start_tcp_ota_init(); - cat1_tcp_server_init(); - } - - } + return ERRCODE_SUCC; diff --git a/code/sdk/zhihui/4g/cat1Service/include/cat1_tcpServer.h b/code/sdk/zhihui/4g/cat1Service/include/cat1_tcpServer.h index ef0e7e9fa..ceb53f046 100644 --- a/code/sdk/zhihui/4g/cat1Service/include/cat1_tcpServer.h +++ b/code/sdk/zhihui/4g/cat1Service/include/cat1_tcpServer.h @@ -84,6 +84,8 @@ uint8_t Get_Cat1_OTA_Flag(void); #define CAT1_PY_IS_NEED_UDP_PATH "/system/cat1otaudp/is_need_updata.txt" //存放需要升级的py文件路径 #endif +#define CAT1_PY_IS_NEED_UPDATA_PATH "/user/system/is_need_updata.txt" //存放需要升级的py文件路径 + #ifdef __cplusplus #if __cplusplus