|
|
@@ -432,6 +432,7 @@ char * makeJson()
|
|
|
if(atoi(device_status.power)<400&&device_status.work_status==1&&makejson_sta!=0)
|
|
|
{
|
|
|
rt_kprintf("power is:%d\n",atoi(device_status.power));
|
|
|
+ if(atoi(device_status.power)>10) //过滤电流检测芯片损坏导致电流直为0 的异常
|
|
|
device_status.lamp_status = 1;
|
|
|
}
|
|
|
else {
|
|
|
@@ -793,7 +794,15 @@ int parseDtu(char *json_string)
|
|
|
rt_thread_delay(5000);
|
|
|
ctr_RTU_DTU(ON);
|
|
|
}
|
|
|
- if(strstr(type->valuestring,"takephoto")!=RT_NULL)
|
|
|
+ //对焦拍照
|
|
|
+ else if(strstr(type->valuestring,"auto_takephoto")!=RT_NULL)
|
|
|
+ {
|
|
|
+ char *auto_takephoto = makeJson_Warn("send cmd success:auto_takephoto","control");
|
|
|
+ DTU_Write("%s",auto_takephoto);
|
|
|
+ rt_free(auto_takephoto);
|
|
|
+ device_status.autotakepic = 1;
|
|
|
+ }
|
|
|
+ else if(strstr(type->valuestring,"takephoto")!=RT_NULL)
|
|
|
{
|
|
|
HK_TakePhoto();
|
|
|
char *photo = makeJson_Warn("takephoto","control");
|
|
|
@@ -801,6 +810,15 @@ int parseDtu(char *json_string)
|
|
|
rt_free(photo);
|
|
|
rt_thread_delay(2000);
|
|
|
}
|
|
|
+ //{"ext": {"type": "turn"}, "cmd": "ctrl"} 转仓
|
|
|
+ else if(strstr(type->valuestring,"turn")!=RT_NULL)
|
|
|
+ {
|
|
|
+ char *turn_zp = makeJson_Warn("send cmd success:turn_zp","control");
|
|
|
+ DTU_Write("%s",turn_zp);
|
|
|
+ rt_free(turn_zp);
|
|
|
+ ctr_turn(90, 0);
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
//切换平台
|
|
|
else if (strstr(item_cmd->valuestring,"platform")!=RT_NULL)
|
|
|
@@ -887,6 +905,18 @@ int parseDtu(char *json_string)
|
|
|
device_status.hmi_fresh = 2;
|
|
|
device_status.refresh_num = 15;
|
|
|
}
|
|
|
+ else if (strstr(item_cmd->valuestring,"poweron")!=RT_NULL)
|
|
|
+ {
|
|
|
+ device_status.ds = 1;
|
|
|
+ ef_set_env_blob("ds",&device_status.ds,sizeof(device_status.ds)); //
|
|
|
+ UpLoad_Data();
|
|
|
+ }
|
|
|
+ else if (strstr(item_cmd->valuestring,"poweroff")!=RT_NULL)
|
|
|
+ {
|
|
|
+ device_status.ds = 0;
|
|
|
+ ef_set_env_blob("ds",&device_status.ds,sizeof(device_status.ds)); //
|
|
|
+ UpLoad_Data();
|
|
|
+ }
|
|
|
// else if (strstr(item_cmd->valuestring,"log")!=RT_NULL) {
|
|
|
// rt_thread_mdelay(2000);
|
|
|
// //read_all_flash_log();
|