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:
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:
// 跳过'.'和'..'目录
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");