优化了定时器和日志
This commit is contained in:
parent
ad5bb32d1a
commit
5f6fc096a3
@ -79,7 +79,7 @@ public :
|
|||||||
|
|
||||||
#ifdef IMX6UL_GATEWAY
|
#ifdef IMX6UL_GATEWAY
|
||||||
#define SAVE_COUNT 4320
|
#define SAVE_COUNT 4320
|
||||||
#define OneWeek 259359
|
#define OneWeek 432000 //5天
|
||||||
#endif
|
#endif
|
||||||
#ifdef G2UL_GATEWAY
|
#ifdef G2UL_GATEWAY
|
||||||
#define SAVE_COUNT 4800*4
|
#define SAVE_COUNT 4800*4
|
||||||
|
@ -568,6 +568,7 @@ void JsonData::DataNodeStatusCheck()
|
|||||||
int lNowTime = atoi(nowTimetamp.c_str());
|
int lNowTime = atoi(nowTimetamp.c_str());
|
||||||
int onlineCheck = readIntValue( "config", "online",(char*)GlobalConfig::Config_G.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 loseTime = readIntValue( "config", "loseTime",(char*)GlobalConfig::Config_G.c_str());
|
||||||
|
int count = 0;
|
||||||
if (nSize > 0) {
|
if (nSize > 0) {
|
||||||
for (int i = 0; i < nSize; i++) {
|
for (int i = 0; i < nSize; i++) {
|
||||||
std::string strDataNodeNo = vetRes[i][0];
|
std::string strDataNodeNo = vetRes[i][0];
|
||||||
@ -598,8 +599,18 @@ void JsonData::DataNodeStatusCheck()
|
|||||||
sprintf(whereCon, "dataNodeNo='%s'", strDataNodeNo.c_str());
|
sprintf(whereCon, "dataNodeNo='%s'", strDataNodeNo.c_str());
|
||||||
sql_ctl->UpdateTableData(T_SENSOR_INFO(TNAME), "status='1'", whereCon);
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -225,7 +225,7 @@ void CheckThread()
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
if(mqttresend == 1800){
|
if(mqttresend == 7200){
|
||||||
mqttresend = 0;
|
mqttresend = 0;
|
||||||
#ifdef WIFI_MODULE
|
#ifdef WIFI_MODULE
|
||||||
bool status = Ping( GlobalConfig::ServerIP.c_str(), 10000);
|
bool status = Ping( GlobalConfig::ServerIP.c_str(), 10000);
|
||||||
|
@ -2048,8 +2048,6 @@ void Uart::DealDataNodeFeature(const char *pData, int flag)
|
|||||||
if (flag == 1)
|
if (flag == 1)
|
||||||
{
|
{
|
||||||
LOG_INFO("DealDataNodeFeature %02x%02x, %d\n",pRecvData->ShortAddr[0], pRecvData->ShortAddr[1],flag);
|
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");
|
sprintf(selectCon, "zigbeeSignal <> '' ORDER BY timeStamp desc LIMIT 0,1");
|
||||||
strTime = sql_ctl->GetData(szTableNameStatic, "timeStamp", selectCon);
|
strTime = sql_ctl->GetData(szTableNameStatic, "timeStamp", selectCon);
|
||||||
|
|
||||||
|
if (flag == 1)
|
||||||
|
{
|
||||||
LOG_INFO("DealDataNodeFeature end %02x%02x\n",pRecvData->ShortAddr[0], pRecvData->ShortAddr[1]);
|
LOG_INFO("DealDataNodeFeature end %02x%02x\n",pRecvData->ShortAddr[0], pRecvData->ShortAddr[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
void Uart::DealDataNodeWave(const char *pData,int comand)
|
void Uart::DealDataNodeWave(const char *pData,int comand)
|
||||||
{
|
{
|
||||||
//print_info("recv wave\n");
|
//print_info("recv wave\n");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user