cat1升级启动换位置
authorhcj <1224667075@qq.com>
Sat, 29 Nov 2025 07:53:47 +0000 (15:53 +0800)
committerhcj <1224667075@qq.com>
Sat, 29 Nov 2025 07:53:47 +0000 (15:53 +0800)
code/sdk/zhihui/4g/cat1Service/Service/cat1_server.c
code/sdk/zhihui/4g/cat1Service/include/cat1_tcpServer.h

index c1b8192..2b6d21f 100644 (file)
@@ -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;
index ef0e7e9..ceb53f0 100644 (file)
@@ -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