From 9fb8387680699e7fe4fba4880bdeab4f9f680109 Mon Sep 17 00:00:00 2001 From: zhangsheng Date: Sat, 23 Nov 2024 14:54:44 +0800 Subject: [PATCH] 3.2.5 G2UL 4G --- common/SH_global.h | 6 +++--- jsonparse/SH_JsonCmd.cpp | 2 +- main.cpp | 1 + threadfunc/SH_ThreadFunc.cpp | 2 ++ uart/SH_Uart.cpp | 1 + 5 files changed, 8 insertions(+), 4 deletions(-) diff --git a/common/SH_global.h b/common/SH_global.h index 614818d..cecd330 100644 --- a/common/SH_global.h +++ b/common/SH_global.h @@ -21,11 +21,11 @@ enum enumZigBeeTransmitStatus { //#define NR5G_MODULE -//#define Q4G_MODULE +#define Q4G_MODULE //#define WIFI_MODULE //#define NR5G_MEIGE -//#define G2UL_GATEWAY -#define IMX6UL_GATEWAY +#define G2UL_GATEWAY +//#define IMX6UL_GATEWAY class GlobalConfig { diff --git a/jsonparse/SH_JsonCmd.cpp b/jsonparse/SH_JsonCmd.cpp index 59c42ee..fced795 100644 --- a/jsonparse/SH_JsonCmd.cpp +++ b/jsonparse/SH_JsonCmd.cpp @@ -607,7 +607,7 @@ void JsonData::DataNodeStatusCheck() } } } - if (count == nSize && nodeOnline) + if (count == nSize && nodeOnline && count != 0) { LOG_ERROR("ALL Node offline,count = %d\n",count); exit(0); diff --git a/main.cpp b/main.cpp index dc4b5bd..7dbf18a 100644 --- a/main.cpp +++ b/main.cpp @@ -65,6 +65,7 @@ int main(int argc, char *argv[]) // boost::thread InitModuleReadTh(InitModule); // InitModuleReadTh.detach(); + InitModule(); // 休眠2秒,等待串口线程初始化完毕 sleep(2); diff --git a/threadfunc/SH_ThreadFunc.cpp b/threadfunc/SH_ThreadFunc.cpp index 7e77cc1..9da4e88 100644 --- a/threadfunc/SH_ThreadFunc.cpp +++ b/threadfunc/SH_ThreadFunc.cpp @@ -697,6 +697,8 @@ void InitModule() std::string strAPN = ReadStrByOpt(SERVERCONFIG, "Server", "APN"); sprintf(szquectel,"/opt/quectel-CM/quectel-CM -s %s &",strAPN.c_str()); system(szquectel); + sleep(2); + system("/opt/Cidn/daemon_CM &"); #endif #endif #ifdef WIFI_MODULE diff --git a/uart/SH_Uart.cpp b/uart/SH_Uart.cpp index 4363b3c..668e044 100644 --- a/uart/SH_Uart.cpp +++ b/uart/SH_Uart.cpp @@ -4481,6 +4481,7 @@ int Uart::CheckZigbeeACK() iRet = 0; break; } + time += 1; mssleep(10000); }while(time < 150); return iRet;