|
@@ -869,7 +869,7 @@ char * makeJson()
|
|
|
char utos[5];
|
|
char utos[5];
|
|
|
|
|
|
|
|
if(atoi(device_status.power)>5000) //过滤异常值
|
|
if(atoi(device_status.power)>5000) //过滤异常值
|
|
|
- rt_sprintf(device_status.power,"0.01");
|
|
|
|
|
|
|
+ rt_sprintf(device_status.power,"NA");
|
|
|
|
|
|
|
|
makejson_sta = 1;
|
|
makejson_sta = 1;
|
|
|
time_t stamp=time(RT_NULL);
|
|
time_t stamp=time(RT_NULL);
|
|
@@ -901,17 +901,7 @@ char * makeJson()
|
|
|
if (device_status.version_type==7) {
|
|
if (device_status.version_type==7) {
|
|
|
rt_snprintf(device_status.driver, sizeof(device_status.driver), "%s-%s", VERSION_BZY, device_status.driver_4g);
|
|
rt_snprintf(device_status.driver, sizeof(device_status.driver), "%s-%s", VERSION_BZY, device_status.driver_4g);
|
|
|
}
|
|
}
|
|
|
- if(device_status.sensor_485_sta!=0)
|
|
|
|
|
- {
|
|
|
|
|
- if(strstr(device_status.driver,"485")==RT_NULL)
|
|
|
|
|
- {
|
|
|
|
|
- /* 2026-09-28: 原 strcat 会在版本号已拼到 60+ 字节时写穿 64 字节缓冲;
|
|
|
|
|
- * 改为先拼到临时缓冲再限长写回, 避免源目的重叠与越界 */
|
|
|
|
|
- char ver_tmp[sizeof(device_status.driver) + 8];
|
|
|
|
|
- rt_snprintf(ver_tmp, sizeof(ver_tmp), "%s.485", device_status.driver);
|
|
|
|
|
- rt_snprintf(device_status.driver, sizeof(device_status.driver), "%s", ver_tmp);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+
|
|
|
cJSON_AddItemToObject(pJsonRoot, "ext", pSubJson);
|
|
cJSON_AddItemToObject(pJsonRoot, "ext", pSubJson);
|
|
|
cJSON_AddStringToObject(pSubJson, "dver", device_status.driver); //版本号,字符型
|
|
cJSON_AddStringToObject(pSubJson, "dver", device_status.driver); //版本号,字符型
|
|
|
cJSON_AddStringToObject(pSubJson,"proj",device_status.project); //项目类型
|
|
cJSON_AddStringToObject(pSubJson,"proj",device_status.project); //项目类型
|
|
@@ -999,10 +989,12 @@ char * makeJson()
|
|
|
cJSON_AddNumberToObject(pSubJson, "y_init_dis", device_status.y_init_dis);
|
|
cJSON_AddNumberToObject(pSubJson, "y_init_dis", device_status.y_init_dis);
|
|
|
cJSON_AddNumberToObject(pSubJson, "tape_used", flashdb_value.tape_used);
|
|
cJSON_AddNumberToObject(pSubJson, "tape_used", flashdb_value.tape_used);
|
|
|
cJSON_AddNumberToObject(pSubJson, "tape_max", flashdb_value.tape_max);
|
|
cJSON_AddNumberToObject(pSubJson, "tape_max", flashdb_value.tape_max);
|
|
|
|
|
+#if BZYV13_EN == 0
|
|
|
cJSON_AddNumberToObject(pSubJson, "filter_used", flashdb_value.filter_used);
|
|
cJSON_AddNumberToObject(pSubJson, "filter_used", flashdb_value.filter_used);
|
|
|
cJSON_AddNumberToObject(pSubJson, "filter_max", flashdb_value.filter_max);
|
|
cJSON_AddNumberToObject(pSubJson, "filter_max", flashdb_value.filter_max);
|
|
|
cJSON_AddNumberToObject(pSubJson, "worked_day", flashdb_value.worked_day);
|
|
cJSON_AddNumberToObject(pSubJson, "worked_day", flashdb_value.worked_day);
|
|
|
cJSON_AddNumberToObject(pSubJson, "freq_filter", flashdb_value.freq_filter);
|
|
cJSON_AddNumberToObject(pSubJson, "freq_filter", flashdb_value.freq_filter);
|
|
|
|
|
+#endif
|
|
|
char *p = cJSON_PrintUnformatted(pJsonRoot);
|
|
char *p = cJSON_PrintUnformatted(pJsonRoot);
|
|
|
if(NULL == p)
|
|
if(NULL == p)
|
|
|
{
|
|
{
|
|
@@ -1146,7 +1138,11 @@ int parseDtu(char *json_string)
|
|
|
}else{
|
|
}else{
|
|
|
send_signal(SIGUSR2);
|
|
send_signal(SIGUSR2);
|
|
|
}
|
|
}
|
|
|
|
|
+#if BZYV13_EN == 0
|
|
|
ctr_Heat(OFF); //关闭风机
|
|
ctr_Heat(OFF); //关闭风机
|
|
|
|
|
+#else
|
|
|
|
|
+ ctr_router(OFF);
|
|
|
|
|
+#endif
|
|
|
device_status.autotakepic = 2;
|
|
device_status.autotakepic = 2;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1171,10 +1167,18 @@ int parseDtu(char *json_string)
|
|
|
}
|
|
}
|
|
|
//采集风机开和关
|
|
//采集风机开和关
|
|
|
if(strstr(item_cmd->valuestring,"windon")!=RT_NULL){
|
|
if(strstr(item_cmd->valuestring,"windon")!=RT_NULL){
|
|
|
|
|
+#if BZYV13_EN == 0
|
|
|
ctr_Heat(ON);
|
|
ctr_Heat(ON);
|
|
|
|
|
+#else
|
|
|
|
|
+ ctr_router(ON);
|
|
|
|
|
+#endif
|
|
|
}
|
|
}
|
|
|
if(strstr(item_cmd->valuestring,"windoff")!=RT_NULL){
|
|
if(strstr(item_cmd->valuestring,"windoff")!=RT_NULL){
|
|
|
|
|
+#if BZYV13_EN == 0
|
|
|
ctr_Heat(OFF);
|
|
ctr_Heat(OFF);
|
|
|
|
|
+#else
|
|
|
|
|
+ ctr_router(OFF);
|
|
|
|
|
+#endif
|
|
|
}
|
|
}
|
|
|
//卷带电机执行旋转一次
|
|
//卷带电机执行旋转一次
|
|
|
if(strstr(item_cmd->valuestring,"translate")!=RT_NULL){
|
|
if(strstr(item_cmd->valuestring,"translate")!=RT_NULL){
|