|
|
@@ -133,7 +133,10 @@ static void dtu_thread_entry_recv(void *parameter)
|
|
|
rx_length = rt_device_read(msg.dev, 0, &rx_buffer[0], rx_length);
|
|
|
rx_buffer[rx_length] = '\0';
|
|
|
rt_kprintf("recv data:%s\n",rx_buffer);
|
|
|
-
|
|
|
+ if(strstr(rx_buffer,"{")==RT_NULL||strstr(rx_buffer,"}")==RT_NULL)
|
|
|
+ {
|
|
|
+ HMI_WRITE("sysTest.result.txt=\"%s\"",rx_buffer);
|
|
|
+ }
|
|
|
//过滤异常数据
|
|
|
char str_check_head[2];
|
|
|
char str_check_end[2];
|
|
|
@@ -1116,10 +1119,14 @@ int parseDtu(char *json_string)
|
|
|
}
|
|
|
if(item_ext!=RT_NULL&&strstr(item_cmd->valuestring,"paramconf")!=RT_NULL)
|
|
|
{
|
|
|
+ if(device_status.dtype==3)
|
|
|
hst = cJSON_GetObjectItem(item_ext,"hst");
|
|
|
- et = cJSON_GetObjectItem(item_ext,"et");
|
|
|
+ if(device_status.dtype==7)
|
|
|
+ hst = cJSON_GetObjectItem(item_ext,"set_temp");
|
|
|
|
|
|
+ et = cJSON_GetObjectItem(item_ext,"et");
|
|
|
datt = cJSON_GetObjectItem(item_ext,"datt");
|
|
|
+
|
|
|
shake_sec = cJSON_GetObjectItem(item_ext,"shake_sec");
|
|
|
tpl = cJSON_GetObjectItem(item_ext,"tpl");
|
|
|
shake = cJSON_GetObjectItem(item_ext,"shake");
|
|
|
@@ -1128,80 +1135,37 @@ int parseDtu(char *json_string)
|
|
|
st = cJSON_GetObjectItem(item_ext,"st");
|
|
|
tt = cJSON_GetObjectItem(item_ext,"tt");
|
|
|
htim = cJSON_GetObjectItem(item_ext,"htim");
|
|
|
+ if(device_status.dtype==3)
|
|
|
ds = cJSON_GetObjectItem(item_ext,"ds");
|
|
|
vt = cJSON_GetObjectItem(item_ext,"vt");
|
|
|
+
|
|
|
if(device_status.dtype==3)
|
|
|
collt = cJSON_GetObjectItem(item_ext,"collt");
|
|
|
+
|
|
|
+ if(device_status.dtype==7)
|
|
|
+ ds = cJSON_GetObjectItem(item_ext,"on_off");
|
|
|
if(device_status.dtype==7)
|
|
|
collt = cJSON_GetObjectItem(item_ext,"coll_time"); //收集(数组格式)
|
|
|
+
|
|
|
cJSON* cul_time = cJSON_GetObjectItem(item_ext,"cul_time"); //培养时间1~24
|
|
|
cJSON* drop_sec = cJSON_GetObjectItem(item_ext,"drop_time");
|
|
|
- if(drop_sec->valueint>=1&&drop_sec->valueint<=30)
|
|
|
+ if(drop_sec!=NULL)
|
|
|
{
|
|
|
- device_status.shake_sec = shake_sec->valueint;
|
|
|
- ef_set_env_blob("shake_sec", &device_status.shake_sec, sizeof(device_status.shake_sec)); //培养时间
|
|
|
- rt_kprintf("下发设置滴液时间:%d\n",shake_sec->valueint);
|
|
|
- }
|
|
|
- if(collt!=NULL)
|
|
|
- {
|
|
|
- int array_size = cJSON_GetArraySize(collt);
|
|
|
- int icnt = 0;
|
|
|
- for(icnt=0;icnt < array_size;icnt++)
|
|
|
- {
|
|
|
- cJSON *pSub = cJSON_GetArrayItem(collt, icnt);
|
|
|
- uint8_t itmp = 0;
|
|
|
- if(NULL==pSub) {continue;}
|
|
|
- char * ivalue = pSub->valuestring;
|
|
|
- if(icnt==0)
|
|
|
- {
|
|
|
- for(itmp = 0;itmp<10;itmp++)
|
|
|
- {
|
|
|
- if(strstr(&ivalue[itmp],"-")!=NULL&&itmp==1)
|
|
|
- {
|
|
|
- device_status.collecting_sh1 = atoi(&ivalue[0]);
|
|
|
- device_status.collecting_eh1 = atoi(&ivalue[3])<<8|atoi(&ivalue[2]);
|
|
|
- ef_set_env_blob("collecting_sh1", device_status.collecting_sh1, sizeof(device_status.collecting_sh1));
|
|
|
- ef_set_env_blob("collecting_eh1", device_status.collecting_eh1, sizeof(device_status.collecting_eh1));
|
|
|
- }
|
|
|
- else if (strstr(&ivalue[itmp],"-")!=NULL&&itmp==2)
|
|
|
- {
|
|
|
- device_status.collecting_sh1 = atoi(&ivalue[1])<<8|atoi(&ivalue[0]);
|
|
|
- device_status.collecting_eh1 = atoi(&ivalue[4])<<8|atoi(&ivalue[3]);
|
|
|
- ef_set_env_blob("collecting_sh1", device_status.collecting_sh1, sizeof(device_status.collecting_sh1));
|
|
|
- ef_set_env_blob("collecting_eh1", device_status.collecting_eh1, sizeof(device_status.collecting_eh1));
|
|
|
- }
|
|
|
- }
|
|
|
- rt_kprintf("开始结束时间1:%d-%d",device_status.collecting_sh1,device_status.collecting_eh1);
|
|
|
- }
|
|
|
- else if (icnt==1)
|
|
|
- {
|
|
|
- for(itmp = 0;itmp<10;itmp++)
|
|
|
- {
|
|
|
- if(strstr(&ivalue[itmp],"-")!=NULL&&itmp==1)
|
|
|
- {
|
|
|
- device_status.collecting_sh2 = atoi(&ivalue[0]);
|
|
|
- device_status.collecting_eh2 = atoi(&ivalue[3])<<8|atoi(&ivalue[2]);
|
|
|
- ef_set_env_blob("collecting_sh2", device_status.collecting_sh2, sizeof(device_status.collecting_sh2));
|
|
|
- ef_set_env_blob("collecting_eh2", device_status.collecting_eh2, sizeof(device_status.collecting_eh2));
|
|
|
- }
|
|
|
- else if (strstr(&ivalue[itmp],"-")!=NULL&&itmp==2)
|
|
|
- {
|
|
|
- device_status.collecting_sh2 = (atoi(&ivalue[1])<<8)|atoi(&ivalue[0]);
|
|
|
- device_status.collecting_eh2 = (atoi(&ivalue[4])<<8)|atoi(&ivalue[3]);
|
|
|
- ef_set_env_blob("collecting_sh2", device_status.collecting_sh2, sizeof(device_status.collecting_sh2));
|
|
|
- ef_set_env_blob("collecting_eh2", device_status.collecting_eh2, sizeof(device_status.collecting_eh2));
|
|
|
- }
|
|
|
- }
|
|
|
- rt_kprintf("开始结束时间2:%d-%d",device_status.collecting_sh2,device_status.collecting_eh2);
|
|
|
- }
|
|
|
- rt_kprintf("下发设置收集:%d-%s\n",icnt,ivalue);
|
|
|
- }
|
|
|
+ if(drop_sec->valueint>=1&&drop_sec->valueint<=300)
|
|
|
+ {
|
|
|
+ device_status.shake_sec = drop_sec->valueint;
|
|
|
+ ef_set_env_blob("shake_sec", &device_status.shake_sec, sizeof(device_status.shake_sec)); //培养时间
|
|
|
+ LOG_I("下发设置滴液时间:%d",drop_sec->valueint);
|
|
|
+ }
|
|
|
}
|
|
|
- if(cul_time->valueint>=1&&cul_time->valueint<=24)
|
|
|
+ if(cul_time!=NULL)
|
|
|
{
|
|
|
- device_status.cul_time = cul_time->valueint;
|
|
|
- ef_set_env_blob("cul_time", &device_status.cul_time, sizeof(device_status.cul_time)); //培养时间
|
|
|
- rt_kprintf("下发设置培养时间:%d\n",cul_time->valueint);
|
|
|
+ if(cul_time->valueint>=1&&cul_time->valueint<=24)
|
|
|
+ {
|
|
|
+ device_status.cul_time = cul_time->valueint;
|
|
|
+ ef_set_env_blob("cul_time", &device_status.cul_time, sizeof(device_status.cul_time)); //培养时间
|
|
|
+ LOG_I("下发设置培养时间:%d",cul_time->valueint);
|
|
|
+ }
|
|
|
}
|
|
|
/*加热温度*/
|
|
|
if(hst!=NULL)
|
|
|
@@ -1212,10 +1176,10 @@ int parseDtu(char *json_string)
|
|
|
{
|
|
|
device_status.heatvalue = hst->valueint;
|
|
|
ef_set_env_blob("jheat", &device_status.heatvalue, sizeof(device_status.heatvalue)); //开始时间
|
|
|
- rt_kprintf("加热温度hst:%d\n",hst->valueint);
|
|
|
+ LOG_I("加热温度hst:%d",hst->valueint);
|
|
|
}
|
|
|
else {
|
|
|
- rt_kprintf("加热温度hst设置失败参数错误!!!\n");
|
|
|
+ LOG_E("加热温度hst设置失败参数错误!!!");
|
|
|
}
|
|
|
}
|
|
|
else {
|
|
|
@@ -1223,10 +1187,10 @@ int parseDtu(char *json_string)
|
|
|
{
|
|
|
device_status.heatvalue=atoi(hst->valuestring);
|
|
|
ef_set_env_blob("jheat", &device_status.heatvalue, sizeof(device_status.heatvalue)); //加热温度
|
|
|
- rt_kprintf("加热温度hst:%d\n",atoi(hst->valuestring));
|
|
|
+ LOG_I("加热温度hst:%d",atoi(hst->valuestring));
|
|
|
}
|
|
|
else {
|
|
|
- rt_kprintf("加热温度hst设置失败参数错误!!!\n");
|
|
|
+ LOG_E("加热温度hst设置失败参数错误!!!");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -1239,10 +1203,10 @@ int parseDtu(char *json_string)
|
|
|
{
|
|
|
device_status.startBar = st->valueint;
|
|
|
ef_set_env_blob("startBar", &device_status.startBar, sizeof(device_status.startBar)); //开始时间
|
|
|
- rt_kprintf("开始时间st:%d\n",st->valueint);
|
|
|
+ LOG_I("开始时间st:%d",st->valueint);
|
|
|
}
|
|
|
else {
|
|
|
- rt_kprintf("开始时间st设置失败参数错误!!!\n");
|
|
|
+ LOG_E("开始时间st设置失败参数错误!!!");
|
|
|
}
|
|
|
}
|
|
|
else {
|
|
|
@@ -1250,10 +1214,10 @@ int parseDtu(char *json_string)
|
|
|
{
|
|
|
device_status.startBar = atoi(st->valuestring);
|
|
|
ef_set_env_blob("startBar", &device_status.startBar, sizeof(device_status.startBar)); //开始时间
|
|
|
- rt_kprintf("开始时间st:%d\n",atoi(st->valuestring));
|
|
|
+ LOG_I("开始时间st:%d",atoi(st->valuestring));
|
|
|
}
|
|
|
else {
|
|
|
- rt_kprintf("开始时间st设置失败参数错误!!!\n");
|
|
|
+ LOG_E("开始时间st设置失败参数错误!!!");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -1266,10 +1230,10 @@ int parseDtu(char *json_string)
|
|
|
{
|
|
|
device_status.stopBar = et->valueint;
|
|
|
ef_set_env_blob("stopBar", &device_status.stopBar, sizeof(device_status.stopBar)); //结束时间
|
|
|
- rt_kprintf("结束时间et:%d\n",et->valueint);
|
|
|
+ LOG_I("结束时间et:%d",et->valueint);
|
|
|
}
|
|
|
else {
|
|
|
- rt_kprintf("结束时间et设置失败参数错误!!!\n");
|
|
|
+ LOG_E("结束时间et设置失败参数错误!!!");
|
|
|
}
|
|
|
}
|
|
|
else if(et->type==cJSON_String){
|
|
|
@@ -1277,10 +1241,10 @@ int parseDtu(char *json_string)
|
|
|
{
|
|
|
device_status.stopBar = atoi(et->valuestring);
|
|
|
ef_set_env_blob("stopBar", &device_status.stopBar, sizeof(device_status.stopBar)); //结束时间
|
|
|
- rt_kprintf("结束时间et:%d\n",atoi(et->valuestring));
|
|
|
+ LOG_I("结束时间et:%d",atoi(et->valuestring));
|
|
|
}
|
|
|
else {
|
|
|
- rt_kprintf("结束时间et设置失败参数错误!!!\n");
|
|
|
+ LOG_E("结束时间et设置失败参数错误!!!");
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -1293,10 +1257,10 @@ int parseDtu(char *json_string)
|
|
|
{
|
|
|
device_status.clt_time = collt->valueint;
|
|
|
ef_set_env_blob("stime", &device_status.clt_time, sizeof(device_status.clt_time)); //收集时间
|
|
|
- rt_kprintf("收集时间collt:%d\n",collt->valueint);
|
|
|
+ LOG_I("收集时间collt:%d",collt->valueint);
|
|
|
}
|
|
|
else {
|
|
|
- rt_kprintf("收集时间collt设置失败参数错误!!!\n");
|
|
|
+ LOG_E("收集时间collt设置失败参数错误!!!");
|
|
|
}
|
|
|
}
|
|
|
else if (collt->type==cJSON_String) {
|
|
|
@@ -1304,12 +1268,71 @@ int parseDtu(char *json_string)
|
|
|
{
|
|
|
device_status.clt_time = atoi(collt->valuestring);
|
|
|
ef_set_env_blob("stime", &device_status.clt_time, sizeof(device_status.clt_time)); //收集时间
|
|
|
- rt_kprintf("收集时间collt:%d\n",atoi(collt->valuestring));
|
|
|
+ LOG_I("收集时间collt:%d",atoi(collt->valuestring));
|
|
|
}
|
|
|
else {
|
|
|
- rt_kprintf("收集时间collt设置失败参数错误!!!\n");
|
|
|
+ LOG_E("收集时间collt设置失败参数错误!!!");
|
|
|
}
|
|
|
}
|
|
|
+ else if (collt->type==cJSON_Array) {
|
|
|
+ int icnt = 0;
|
|
|
+ for(icnt=0;icnt < cJSON_GetArraySize(collt);icnt++)
|
|
|
+ {
|
|
|
+ cJSON *pSub = cJSON_GetArrayItem(collt, icnt);
|
|
|
+ if(NULL==pSub) break;
|
|
|
+ char ivalue[10];
|
|
|
+ rt_sprintf(ivalue,"%s",pSub->valuestring);
|
|
|
+ if(icnt==0)
|
|
|
+ {
|
|
|
+ if(ivalue[1]=='-')
|
|
|
+ {
|
|
|
+ device_status.collecting_sh1 = atoi(&ivalue[0]);
|
|
|
+ if(strlen(ivalue)==3)
|
|
|
+ device_status.collecting_eh1 = atoi(&ivalue[2]);
|
|
|
+ if(strlen(ivalue)==4)
|
|
|
+ device_status.collecting_eh1 = atoi(&ivalue[3])<<8|atoi(&ivalue[2]);
|
|
|
+ ef_set_env_blob("collecting_sh1", &device_status.collecting_sh1, sizeof(device_status.collecting_sh1));
|
|
|
+ ef_set_env_blob("collecting_eh1", &device_status.collecting_eh1, sizeof(device_status.collecting_eh1));
|
|
|
+ }
|
|
|
+ if(ivalue[2]=='-')
|
|
|
+ {
|
|
|
+ device_status.collecting_sh1 = atoi(&ivalue[1])<<8|atoi(&ivalue[0]);
|
|
|
+ if(strlen(ivalue)==3)
|
|
|
+ device_status.collecting_eh1 = atoi(&ivalue[3]);
|
|
|
+ if(strlen(ivalue)==5)
|
|
|
+ device_status.collecting_eh1 = atoi(&ivalue[4])<<8|atoi(&ivalue[3]);
|
|
|
+ ef_set_env_blob("collecting_sh1", &device_status.collecting_sh1, sizeof(device_status.collecting_sh1));
|
|
|
+ ef_set_env_blob("collecting_eh1", &device_status.collecting_eh1, sizeof(device_status.collecting_eh1));
|
|
|
+ }
|
|
|
+ LOG_I("开始结束时间1:%d-%d",device_status.collecting_sh1,device_status.collecting_eh1);
|
|
|
+ }
|
|
|
+ else if (icnt==1)
|
|
|
+ {
|
|
|
+ if((ivalue[1]=='-'))
|
|
|
+ {
|
|
|
+ device_status.collecting_sh2 = atoi(&ivalue[0]);
|
|
|
+ if(strlen(ivalue)==3)
|
|
|
+ device_status.collecting_eh2 = atoi(&ivalue[2]);
|
|
|
+ if(strlen(ivalue)==4)
|
|
|
+ device_status.collecting_eh2 = atoi(&ivalue[3])<<8|atoi(&ivalue[2]);
|
|
|
+ ef_set_env_blob("collecting_sh2", &device_status.collecting_sh2, sizeof(device_status.collecting_sh2));
|
|
|
+ ef_set_env_blob("collecting_eh2", &device_status.collecting_eh2, sizeof(device_status.collecting_eh2));
|
|
|
+ }
|
|
|
+ if((ivalue[2]=='-'))
|
|
|
+ {
|
|
|
+ device_status.collecting_sh2 = atoi(&ivalue[1])<<8|atoi(&ivalue[0]);
|
|
|
+ if(strlen(ivalue)==3)
|
|
|
+ device_status.collecting_eh2 = atoi(&ivalue[2]);
|
|
|
+ if(strlen(ivalue)==5)
|
|
|
+ device_status.collecting_eh2 = atoi(&ivalue[4])<<8|atoi(&ivalue[3]);
|
|
|
+ ef_set_env_blob("collecting_sh2", &device_status.collecting_sh2, sizeof(device_status.collecting_sh2));
|
|
|
+ ef_set_env_blob("collecting_eh2", &device_status.collecting_eh1, sizeof(device_status.collecting_eh2));
|
|
|
+ }
|
|
|
+ LOG_I("开始结束时间2:%d-%d",device_status.collecting_sh2,device_status.collecting_eh2);
|
|
|
+ }
|
|
|
+ LOG_I("下发设置收集:%d-%s",icnt,ivalue);
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
}
|
|
|
if(datt!=NULL)
|
|
|
@@ -1320,10 +1343,10 @@ int parseDtu(char *json_string)
|
|
|
{
|
|
|
device_status.dattim = datt->valueint;
|
|
|
ef_set_env_blob("dattim", &device_status.dattim, sizeof(device_status.dattim)); //数据上传间隔
|
|
|
- rt_kprintf("数据上传间隔datt:%d\n",datt->valueint);
|
|
|
+ LOG_I("数据上传间隔datt:%d",datt->valueint);
|
|
|
}
|
|
|
else {
|
|
|
- rt_kprintf("数据上传间隔datt设置失败参数错误!!!\n");
|
|
|
+ LOG_E("数据上传间隔datt设置失败参数错误!!!");
|
|
|
}
|
|
|
}
|
|
|
else if (datt->type==cJSON_String) {
|
|
|
@@ -1331,10 +1354,10 @@ int parseDtu(char *json_string)
|
|
|
{
|
|
|
device_status.dattim = atoi(datt->valuestring);
|
|
|
ef_set_env_blob("dattim", &device_status.dattim, sizeof(device_status.dattim)); //数据上传间隔
|
|
|
- rt_kprintf("数据上传间隔datt:%d\n",atoi(datt->valuestring));
|
|
|
+ LOG_I("数据上传间隔datt:%d",atoi(datt->valuestring));
|
|
|
}
|
|
|
else {
|
|
|
- rt_kprintf("数据上传间隔datt设置失败参数错误!!!\n");
|
|
|
+ LOG_E("数据上传间隔datt设置失败参数错误!!!");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -1347,10 +1370,10 @@ int parseDtu(char *json_string)
|
|
|
{
|
|
|
device_status.shake_sec = shake_sec->valueint;
|
|
|
ef_set_env_blob("shake_sec", &device_status.shake_sec, sizeof(device_status.shake_sec)); //震动时间
|
|
|
- rt_kprintf("震动时间shake_sec:%d\n",shake_sec->valueint);
|
|
|
+ LOG_I("震动时间shake_sec:%d",shake_sec->valueint);
|
|
|
}
|
|
|
else {
|
|
|
- rt_kprintf("震动时间shake_sec设置失败参数错误!!!\n");
|
|
|
+ LOG_E("震动时间shake_sec设置失败参数错误!!!");
|
|
|
}
|
|
|
}
|
|
|
else if (shake_sec->type==cJSON_String) {
|
|
|
@@ -1358,10 +1381,10 @@ int parseDtu(char *json_string)
|
|
|
{
|
|
|
device_status.shake_sec = atoi(shake_sec->valuestring);
|
|
|
ef_set_env_blob("shake_sec", &device_status.shake_sec, sizeof(device_status.shake_sec)); //震动时间
|
|
|
- rt_kprintf("震动时间shake_sec:%d\n",atoi(shake_sec->valuestring));
|
|
|
+ LOG_I("震动时间shake_sec:%d",atoi(shake_sec->valuestring));
|
|
|
}
|
|
|
else {
|
|
|
- rt_kprintf("震动时间shake_sec设置失败参数错误!!!\n");
|
|
|
+ LOG_E("震动时间shake_sec设置失败参数错误!!!");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -1374,10 +1397,10 @@ int parseDtu(char *json_string)
|
|
|
{
|
|
|
device_status.shake_ws = shake->valueint;
|
|
|
ef_set_env_blob("shake_ws", &device_status.shake_ws, sizeof(device_status.shake_ws)); //震动开关
|
|
|
- rt_kprintf("震动开关shake:%d\n",shake->valueint);
|
|
|
+ LOG_I("震动开关shake:%d",shake->valueint);
|
|
|
}
|
|
|
else {
|
|
|
- rt_kprintf("震动开关shake设置失败参数错误!!!\n");
|
|
|
+ LOG_E("震动开关shake设置失败参数错误!!!");
|
|
|
}
|
|
|
}
|
|
|
else if (shake->type==cJSON_String) {
|
|
|
@@ -1385,10 +1408,10 @@ int parseDtu(char *json_string)
|
|
|
{
|
|
|
device_status.shake_ws = atoi(shake->valuestring);
|
|
|
ef_set_env_blob("shake_ws", &device_status.shake_ws, sizeof(device_status.shake_ws)); //震动开关
|
|
|
- rt_kprintf("震动开关shake:%d\n",atoi(shake->valuestring));
|
|
|
+ LOG_I("震动开关shake:%d",atoi(shake->valuestring));
|
|
|
}
|
|
|
else {
|
|
|
- rt_kprintf("震动开关shake设置失败参数错误!!!\n");
|
|
|
+ LOG_E("震动开关shake设置失败参数错误!!!");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -1436,10 +1459,10 @@ int parseDtu(char *json_string)
|
|
|
{
|
|
|
device_status.heattime = htim->valueint;
|
|
|
ef_set_env_blob("jtime", &device_status.heattime, sizeof(device_status.heattime)); //加热时间
|
|
|
- rt_kprintf("加热时长htim:%d\n",htim->valueint);
|
|
|
+ LOG_I("加热时长htim:%d",htim->valueint);
|
|
|
}
|
|
|
else {
|
|
|
- rt_kprintf("加热时长htim设置失败参数错误!!!\n");
|
|
|
+ LOG_I("加热时长htim设置失败参数错误!!!");
|
|
|
}
|
|
|
}
|
|
|
else if (htim->type==cJSON_String) {
|
|
|
@@ -1447,10 +1470,10 @@ int parseDtu(char *json_string)
|
|
|
{
|
|
|
device_status.heattime = atoi(htim->valuestring);
|
|
|
ef_set_env_blob("jtime", &device_status.heattime, sizeof(device_status.heattime)); //加热时间
|
|
|
- rt_kprintf("加热时长htim:%d\n",atoi(htim->valuestring));
|
|
|
+ LOG_I("加热时长htim:%d",atoi(htim->valuestring));
|
|
|
}
|
|
|
else {
|
|
|
- rt_kprintf("加热时长htim设置失败参数错误!!!\n");
|
|
|
+ LOG_E("加热时长htim设置失败参数错误!!!");
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -1471,7 +1494,7 @@ int parseDtu(char *json_string)
|
|
|
// static rt_uint32_t nowstamp_num = 0;
|
|
|
// nowstamp_num = mktime(&nowstamp);
|
|
|
// device_status.light_over_tim = device_status.sunBar * 3600 + nowstamp_num;
|
|
|
- rt_kprintf("定时模式ts:%d\n",ts->valueint);
|
|
|
+ LOG_I("定时模式ts:%d",ts->valueint);
|
|
|
#else
|
|
|
rt_kprintf("三光源模式,禁止设置定时!!!\n");
|
|
|
#endif
|
|
|
@@ -1494,13 +1517,13 @@ int parseDtu(char *json_string)
|
|
|
// static rt_uint32_t nowstamp_num = 0;
|
|
|
// nowstamp_num = mktime(&nowstamp);
|
|
|
// device_status.light_over_tim = device_status.sunBar * 3600 + nowstamp_num;
|
|
|
- rt_kprintf("定时模式ts:%d\n",atoi(ts->valuestring));
|
|
|
+ LOG_I("定时模式ts:%d",atoi(ts->valuestring));
|
|
|
#else
|
|
|
rt_kprintf("三光源模式,禁止设置定时!!!\n");
|
|
|
#endif
|
|
|
}
|
|
|
else {
|
|
|
- rt_kprintf("定时模式ts设置失败参数错误!!!\n");
|
|
|
+ LOG_I("定时模式ts设置失败参数错误!!!");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -1567,10 +1590,10 @@ int parseDtu(char *json_string)
|
|
|
{
|
|
|
device_status.ds = ds->valueint;
|
|
|
ef_set_env_blob("ds", &device_status.ds, sizeof(device_status.ds));
|
|
|
- rt_kprintf("开关机状态:%d\n",ds->valueint);
|
|
|
+ LOG_I("开关机状态:%d",ds->valueint);
|
|
|
}
|
|
|
else {
|
|
|
- rt_kprintf("开关机状态设置失败参数错误!!!\n");
|
|
|
+ LOG_E("开关机状态设置失败参数错误!!!");
|
|
|
}
|
|
|
}
|
|
|
else if (ds->type==cJSON_String) {
|
|
|
@@ -1578,10 +1601,10 @@ int parseDtu(char *json_string)
|
|
|
{
|
|
|
device_status.ds = atoi(ds->valuestring);
|
|
|
ef_set_env_blob("ds", &device_status.ds, sizeof(device_status.ds));
|
|
|
- rt_kprintf("开关机状态:%d\n",atoi(ds->valuestring));
|
|
|
+ LOG_I("开关机状态:%d\n",atoi(ds->valuestring));
|
|
|
}
|
|
|
else {
|
|
|
- rt_kprintf("开关机状态设置失败参数错误!!!\n");
|
|
|
+ LOG_E("开关机状态设置失败参数错误!!!");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -1601,12 +1624,16 @@ int parseDtu(char *json_string)
|
|
|
UpLoad_Data();
|
|
|
rt_thread_delay(2000);
|
|
|
//2022/06/23,add:
|
|
|
- rt_sprintf(device_status.json_w_clock,"平台操作:修改工作时间:开始-%d,结束-%d,模式-%d(0-光控,1-时控)操作时间:%s",device_status.startBar,device_status.stopBar,device_status.timeSwitch,device_status.stamp);
|
|
|
- json_s = makeJson_Warn(device_status.json_w_clock, "修改时间");
|
|
|
- ef_set_env_blob("json_w_clock", &device_status.json_w_clock, sizeof(device_status.json_w_clock)); //将修改屏幕参数操作记录保存到Flash中
|
|
|
- if(atoi(device_status.net)==0)
|
|
|
- DTU_Write("%s",json_s);
|
|
|
- rt_free(json_s);
|
|
|
+ if(device_status.dtype==3)
|
|
|
+ {
|
|
|
+ rt_sprintf(device_status.json_w_clock,"平台操作:修改工作时间:开始-%d,结束-%d,模式-%d(0-光控,1-时控)-%s",device_status.startBar,device_status.stopBar,device_status.timeSwitch,device_status.stamp);
|
|
|
+ json_s = makeJson_Warn(device_status.json_w_clock, "修改时间");
|
|
|
+ ef_set_env_blob("json_w_clock", &device_status.json_w_clock, sizeof(device_status.json_w_clock)); //将修改屏幕参数操作记录保存到Flash中
|
|
|
+ if(atoi(device_status.net)==0)
|
|
|
+ DTU_Write("%s",json_s);
|
|
|
+ rt_free(json_s);
|
|
|
+ }
|
|
|
+
|
|
|
rt_thread_delay(1000);
|
|
|
MA_save();
|
|
|
rt_thread_delay(1000);
|