cat1升级增加升级文件屏蔽
authorhcj <1224667075@qq.com>
Sat, 23 Nov 2024 08:25:28 +0000 (16:25 +0800)
committerhcj <1224667075@qq.com>
Sat, 23 Nov 2024 08:25:28 +0000 (16:25 +0800)
cat1modem/src/main.py
cat1modem/src/main_init.py
code/sdk/drivers/peripheral/slip/cat1Service/cat1_tcpServer.cpp

index 3d70c7c..0f8b84a 100644 (file)
@@ -1,9 +1,21 @@
 import example
 main_flag = 1
 try:
-    from usr.slipService import slipservice
-    from usr.tcpService import TcpService
-    import usr.checkota
+    try:
+        from usr.slipService import slipservice
+    except Exception as e:
+        main_flag = 0
+        print("启动失败!!!!!\r\n".format(e),'slipservice') 
+    try:       
+        from usr.tcpService import TcpService
+    except Exception as e:
+        main_flag = 0
+        print("启动失败!!!!!\r\n".format(e),'tcpService') 
+    try:    
+        import usr.checkota
+    except Exception as e:
+        main_flag = 0
+        print("启动失败!!!!!\r\n".format(e),'checkota') 
     example.exec('/usr/main_init.py')
     print("启动成功!!!!!\r\n")
 except Exception as e:
index 9ed74f7..6c2d339 100644 (file)
@@ -6,10 +6,30 @@ import sms
 from misc import Power
 ota_flag = 0
 try:
-    from usr.EventMesh import eventMesh
-    from usr.telecom_dmp import telecomDmpCb
-    from usr.china_mobile_dmp import chinamobileCb
-    from usr.cat1Service import cat1service
+    try:
+        from usr.EventMesh import eventMesh
+        print("检测文件成功!!!!!!!\r\n",'eventMesh')
+    except Exception as e:
+        print("检测文件失败!!!!!!!{}\r\n",'eventMesh')
+        
+    try:
+        from usr.telecom_dmp import telecomDmpCb
+        print("检测文件成功!!!!!!!\r\n",'telecomDmpCb')
+    except Exception as e:
+        print("检测文件失败!!!!!!!{}\r\n",'telecomDmpCb')
+        
+    try:
+        from usr.china_mobile_dmp import chinamobileCb
+        print("检测文件成功!!!!!!!\r\n",'chinamobileCb')
+    except Exception as e:
+        print("检测文件失败!!!!!!!{}\r\n",'chinamobileCb')
+        
+    try:
+        from usr.cat1Service import cat1service
+        print("检测文件成功!!!!!!!\r\n",'cat1service')
+    except Exception as e:
+        print("检测文件失败!!!!!!!{}\r\n",'cat1service')
+        
     ota_flag = 1
     print("检测文件成功!!!!!!!\r\n")
 except Exception as e:
index a72079e..18100ac 100644 (file)
@@ -485,7 +485,17 @@ void read_dir(void){
         // 跳过'.'和'..'目录
         if (strcmp(entry->d_name, ".") != 0 && strcmp(entry->d_name, "..") != 0) {
             printf("%s\n", entry->d_name); // 输出文件名
+            std::string filename= entry->d_name;
             //0 1 2
+            if(filename=="Cat1pyVersion.txt" 
+            || filename=="main.py"
+            || filename=="main_init.py" 
+            || filename=="tcpService.py")
+            {
+                printf("屏蔽升级文件 %s\n",filename.c_str());
+                continue;
+            }
+
             fileNameList[file_count] = (char *)malloc(DEFAULT_MAX_FILE_NAME_SIZE * sizeof(char));
             if (fileNameList[file_count] == NULL) {
                 printf("内存分配失败\n");