优化了定时器和日志

This commit is contained in:
zhangsheng 2024-10-09 10:24:45 +08:00
parent ad5bb32d1a
commit 5f6fc096a3
4 changed files with 19 additions and 7 deletions

View File

@ -79,7 +79,7 @@ public :
#ifdef IMX6UL_GATEWAY
#define SAVE_COUNT 4320
#define OneWeek 259359
#define OneWeek 432000 //5天
#endif
#ifdef G2UL_GATEWAY
#define SAVE_COUNT 4800*4

View File

@ -568,6 +568,7 @@ void JsonData::DataNodeStatusCheck()
int lNowTime = atoi(nowTimetamp.c_str());
int onlineCheck = readIntValue( "config", "online",(char*)GlobalConfig::Config_G.c_str());
int loseTime = readIntValue( "config", "loseTime",(char*)GlobalConfig::Config_G.c_str());
int count = 0;
if (nSize > 0) {
for (int i = 0; i < nSize; i++) {
std::string strDataNodeNo = vetRes[i][0];
@ -598,8 +599,18 @@ void JsonData::DataNodeStatusCheck()
sprintf(whereCon, "dataNodeNo='%s'", strDataNodeNo.c_str());
sql_ctl->UpdateTableData(T_SENSOR_INFO(TNAME), "status='1'", whereCon);
}
if (lTimeTemp > atoi(vetRes[i][21].c_str()) * 3 )//判定传感器是否超过三次未传特征值
{
count ++;
}
}
}
if (count == nSize)
{
LOG_ERROR("ALL Node offline\n");
exit(0);
}
}
}

View File

@ -225,7 +225,7 @@ void CheckThread()
}
}
if(mqttresend == 1800){
if(mqttresend == 7200){
mqttresend = 0;
#ifdef WIFI_MODULE
bool status = Ping( GlobalConfig::ServerIP.c_str(), 10000);

View File

@ -2048,8 +2048,6 @@ void Uart::DealDataNodeFeature(const char *pData, int flag)
if (flag == 1)
{
LOG_INFO("DealDataNodeFeature %02x%02x, %d\n",pRecvData->ShortAddr[0], pRecvData->ShortAddr[1],flag);
}else{
LOG_INFO("DealDataNodeFeature %02x%02x\n",pRecvData->ShortAddr[0], pRecvData->ShortAddr[1]);
}
@ -3531,10 +3529,13 @@ void Uart::DealDataNodeFeature(const char *pData, int flag)
sprintf(selectCon, "zigbeeSignal <> '' ORDER BY timeStamp desc LIMIT 0,1");
strTime = sql_ctl->GetData(szTableNameStatic, "timeStamp", selectCon);
if (flag == 1)
{
LOG_INFO("DealDataNodeFeature end %02x%02x\n",pRecvData->ShortAddr[0], pRecvData->ShortAddr[1]);
}
}
void Uart::DealDataNodeWave(const char *pData,int comand)
{
//print_info("recv wave\n");