From: hcj <1224667075@qq.com> Date: Sat, 23 Nov 2024 08:25:28 +0000 (+0800) Subject: cat1升级增加升级文件屏蔽 X-Git-Tag: fd230_release_V1.3.102~39^2~6 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=b33317ff95a8db9f7b7d466c77e3d8655da12a9e;p=mirrors%2FFD230.git cat1升级增加升级文件屏蔽 --- diff --git a/cat1modem/src/main.py b/cat1modem/src/main.py index 3d70c7cac..0f8b84a69 100644 --- a/cat1modem/src/main.py +++ b/cat1modem/src/main.py @@ -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: diff --git a/cat1modem/src/main_init.py b/cat1modem/src/main_init.py index 9ed74f7ce..6c2d33926 100644 --- a/cat1modem/src/main_init.py +++ b/cat1modem/src/main_init.py @@ -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: diff --git a/code/sdk/drivers/peripheral/slip/cat1Service/cat1_tcpServer.cpp b/code/sdk/drivers/peripheral/slip/cat1Service/cat1_tcpServer.cpp index a72079eef..18100ac12 100644 --- a/code/sdk/drivers/peripheral/slip/cat1Service/cat1_tcpServer.cpp +++ b/code/sdk/drivers/peripheral/slip/cat1Service/cat1_tcpServer.cpp @@ -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");