|
@@ -709,16 +709,16 @@ char * makeJson()
|
|
|
LOG_I("Current is:%d",atoi(device_status.power));
|
|
LOG_I("Current is:%d",atoi(device_status.power));
|
|
|
if(atoi(device_status.power)>10) //过滤电流检测芯片损坏导致电流直为0 的异常
|
|
if(atoi(device_status.power)>10) //过滤电流检测芯片损坏导致电流直为0 的异常
|
|
|
{
|
|
{
|
|
|
- device_status.lamp_status = 1;
|
|
|
|
|
|
|
+ device_status._lamp = 1;
|
|
|
}
|
|
}
|
|
|
#endif
|
|
#endif
|
|
|
if(device_status.version_type==11||device_status.version_type==12)
|
|
if(device_status.version_type==11||device_status.version_type==12)
|
|
|
{
|
|
{
|
|
|
- device_status.lamp_status = 0;
|
|
|
|
|
|
|
+ device_status._lamp = 0;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
else {
|
|
else {
|
|
|
- device_status.lamp_status = 0;
|
|
|
|
|
|
|
+ device_status._lamp = 0;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -853,7 +853,7 @@ char * makeJson()
|
|
|
rt_sprintf(utos, "%d",device_status.bat_status);
|
|
rt_sprintf(utos, "%d",device_status.bat_status);
|
|
|
cJSON_AddStringToObject(pSubJson,"batStatus",utos);
|
|
cJSON_AddStringToObject(pSubJson,"batStatus",utos);
|
|
|
//灯管状态
|
|
//灯管状态
|
|
|
- rt_sprintf(utos, "%d",device_status.lamp_status);
|
|
|
|
|
|
|
+ rt_sprintf(utos, "%d",device_status._lamp);
|
|
|
cJSON_AddStringToObject(pSubJson,"lamp",utos);
|
|
cJSON_AddStringToObject(pSubJson,"lamp",utos);
|
|
|
//上仓门状态 1-打开,0-关闭-(通道) 打开为落虫,关闭为排水
|
|
//上仓门状态 1-打开,0-关闭-(通道) 打开为落虫,关闭为排水
|
|
|
rt_sprintf(utos, "%d",device_status.up_status);
|
|
rt_sprintf(utos, "%d",device_status.up_status);
|
|
@@ -1501,18 +1501,6 @@ int parseDtu(char *json_string)
|
|
|
struct timeval tv;
|
|
struct timeval tv;
|
|
|
gettimeofday(&tv,NULL);
|
|
gettimeofday(&tv,NULL);
|
|
|
LOG_I("系统当前时间戳:%d",tv.tv_sec);
|
|
LOG_I("系统当前时间戳:%d",tv.tv_sec);
|
|
|
- time_t timestamp_diff;
|
|
|
|
|
- if(timestamp>tv.tv_sec)
|
|
|
|
|
- {
|
|
|
|
|
- timestamp_diff = timestamp - tv.tv_sec;
|
|
|
|
|
- }else
|
|
|
|
|
- {
|
|
|
|
|
- timestamp_diff = tv.tv_sec - timestamp;
|
|
|
|
|
- }
|
|
|
|
|
- if (tm_time != NULL&×tamp_diff>60) {
|
|
|
|
|
- setSystemTime(tm_time);
|
|
|
|
|
- free(tm_time); // Free the allocated memory
|
|
|
|
|
- }
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
if(hum!=NULL&&tmp!=NULL)
|
|
if(hum!=NULL&&tmp!=NULL)
|