|
|
@@ -1043,50 +1043,50 @@ static void HMI_Decode(void)
|
|
|
LOG_D("震动时间设置:%d",device_status.shake_sec);
|
|
|
}
|
|
|
//切换大数据平台
|
|
|
- else if (strstr(rx_buffer,"8.136.98.49")!=NULL)
|
|
|
- {
|
|
|
- memset(device_status.json_w_platform,0,sizeof(device_status.json_w_platform));
|
|
|
- rt_sprintf(device_status.mqttcfg1, "8.136.98.49");
|
|
|
- ef_set_env_blob("platform", &device_status.mqttcfg1, sizeof(device_status.mqttcfg1));
|
|
|
- //给RTU发送切换指令
|
|
|
- if(strstr(device_status.project,"DTU_CBD")!=NULL)
|
|
|
- {
|
|
|
- DTU_Write("%s",makeJson_platform("8.136.98.49"));
|
|
|
- rt_free(makeJson_platform("8.136.98.49"));
|
|
|
- rt_thread_delay(1000);
|
|
|
- }
|
|
|
- //2022/06/23,add:
|
|
|
- rt_sprintf(device_status.json_w_platform,"屏幕操作:切换平台:8.136.98.49,操作时间:%s",device_status.stamp);
|
|
|
- json_temp = makeJson_Warn(device_status.json_w_platform, "切换平台");
|
|
|
- ef_set_env_blob("json_w_platform", &device_status.json_w_platform, sizeof(device_status.json_w_platform)); //将修改屏幕参数操作记录保存到Flash中
|
|
|
- if(atoi(device_status.net)==0)
|
|
|
- DTU_Write("%s",json_temp);
|
|
|
- rt_free(json_temp);
|
|
|
- rt_thread_delay(1000);
|
|
|
- MA_save();
|
|
|
- }
|
|
|
- else if (strstr(rx_buffer,"120.27.222.26")!=NULL)
|
|
|
- {
|
|
|
- memset(device_status.json_w_platform,0,sizeof(device_status.json_w_platform));
|
|
|
- rt_sprintf(device_status.mqttcfg1, "120.27.222.26");
|
|
|
- ef_set_env_blob("platform", &device_status.mqttcfg1, sizeof(device_status.mqttcfg1));
|
|
|
- //给RTU发送切换指令
|
|
|
- if(strstr(device_status.project,"DTU_CBD")!=NULL)
|
|
|
- {
|
|
|
- DTU_Write("%s",makeJson_platform("120.27.222.26"));
|
|
|
- rt_free(makeJson_platform("120.27.222.26"));
|
|
|
- rt_thread_delay(1000);
|
|
|
- }
|
|
|
- //2022/06/23,add:
|
|
|
- rt_sprintf(device_status.json_w_platform,"屏幕操作:切换平台:120.27.222.26,操作时间:%04d-%02d-%02d %02d:%02d:%02d",tm.tm_year+1900,tm.tm_mon+1,tm.tm_mday,tm.tm_hour,tm.tm_min,tm.tm_sec);
|
|
|
- json_temp = makeJson_Warn(device_status.json_w_platform, "切换平台");
|
|
|
- ef_set_env_blob("json_w_platform", &device_status.json_w_platform, sizeof(device_status.json_w_platform)); //将修改屏幕参数操作记录保存到Flash中
|
|
|
- if(atoi(device_status.net)==0)
|
|
|
- DTU_Write("%s",json_temp);
|
|
|
- rt_free(json_temp);
|
|
|
- rt_thread_delay(1000);
|
|
|
- MA_save();
|
|
|
- }
|
|
|
+// else if (strstr(rx_buffer,"8.136.98.49")!=NULL)
|
|
|
+// {
|
|
|
+// memset(device_status.json_w_platform,0,sizeof(device_status.json_w_platform));
|
|
|
+// rt_sprintf(device_status.mqttcfg1, "8.136.98.49");
|
|
|
+// ef_set_env_blob("platform", &device_status.mqttcfg1, sizeof(device_status.mqttcfg1));
|
|
|
+// //给RTU发送切换指令
|
|
|
+// if(strstr(device_status.project,"DTU_CBD")!=NULL)
|
|
|
+// {
|
|
|
+// DTU_Write("%s",makeJson_platform("8.136.98.49"));
|
|
|
+// rt_free(makeJson_platform("8.136.98.49"));
|
|
|
+// rt_thread_delay(1000);
|
|
|
+// }
|
|
|
+// //2022/06/23,add:
|
|
|
+// rt_sprintf(device_status.json_w_platform,"屏幕操作:切换平台:8.136.98.49,操作时间:%s",device_status.stamp);
|
|
|
+// json_temp = makeJson_Warn(device_status.json_w_platform, "切换平台");
|
|
|
+// ef_set_env_blob("json_w_platform", &device_status.json_w_platform, sizeof(device_status.json_w_platform)); //将修改屏幕参数操作记录保存到Flash中
|
|
|
+// if(atoi(device_status.net)==0)
|
|
|
+// DTU_Write("%s",json_temp);
|
|
|
+// rt_free(json_temp);
|
|
|
+// rt_thread_delay(1000);
|
|
|
+// MA_save();
|
|
|
+// }
|
|
|
+// else if (strstr(rx_buffer,"120.27.222.26")!=NULL)
|
|
|
+// {
|
|
|
+// memset(device_status.json_w_platform,0,sizeof(device_status.json_w_platform));
|
|
|
+// rt_sprintf(device_status.mqttcfg1, "120.27.222.26");
|
|
|
+// ef_set_env_blob("platform", &device_status.mqttcfg1, sizeof(device_status.mqttcfg1));
|
|
|
+// //给RTU发送切换指令
|
|
|
+// if(strstr(device_status.project,"DTU_CBD")!=NULL)
|
|
|
+// {
|
|
|
+// DTU_Write("%s",makeJson_platform("120.27.222.26"));
|
|
|
+// rt_free(makeJson_platform("120.27.222.26"));
|
|
|
+// rt_thread_delay(1000);
|
|
|
+// }
|
|
|
+// //2022/06/23,add:
|
|
|
+// rt_sprintf(device_status.json_w_platform,"屏幕操作:切换平台:120.27.222.26,操作时间:%04d-%02d-%02d %02d:%02d:%02d",tm.tm_year+1900,tm.tm_mon+1,tm.tm_mday,tm.tm_hour,tm.tm_min,tm.tm_sec);
|
|
|
+// json_temp = makeJson_Warn(device_status.json_w_platform, "切换平台");
|
|
|
+// ef_set_env_blob("json_w_platform", &device_status.json_w_platform, sizeof(device_status.json_w_platform)); //将修改屏幕参数操作记录保存到Flash中
|
|
|
+// if(atoi(device_status.net)==0)
|
|
|
+// DTU_Write("%s",json_temp);
|
|
|
+// rt_free(json_temp);
|
|
|
+// rt_thread_delay(1000);
|
|
|
+// MA_save();
|
|
|
+// }
|
|
|
//恢复出厂设置电池
|
|
|
else if (strstr(rx_buffer,"resetdcDefault")!=NULL)
|
|
|
{
|
|
|
@@ -1220,7 +1220,7 @@ static void Ctr_Mortor_entry(void* parameter)
|
|
|
rt_uint16_t num_down_open = 200; //
|
|
|
rt_uint16_t num_down_close = 200; //
|
|
|
rt_int16_t photo_led_sec = 900; //90S
|
|
|
-
|
|
|
+ struct timeval tv;
|
|
|
//int current_t[200];
|
|
|
/*孢子仪拍照数量*/
|
|
|
rt_uint16_t photo_setup = 0;
|
|
|
@@ -1374,6 +1374,8 @@ static void Ctr_Mortor_entry(void* parameter)
|
|
|
//打开补光灯
|
|
|
if(photo_led_sec==890)
|
|
|
{
|
|
|
+ gettimeofday(&tv, NULL);
|
|
|
+ device_status.photo_stamp = tv.tv_sec;
|
|
|
DTU_Write("takephoto.mp3");
|
|
|
//延时
|
|
|
rt_thread_delay(1000);
|
|
|
@@ -1394,12 +1396,11 @@ static void Ctr_Mortor_entry(void* parameter)
|
|
|
}
|
|
|
|
|
|
}else if(device_status.photo_ws ==2){
|
|
|
- struct timeval tv;
|
|
|
- gettimeofday(&tv, NULL);
|
|
|
- device_status.photo_stamp = tv.tv_sec;
|
|
|
ctr_led(ON);
|
|
|
photo_led_sec--;
|
|
|
if(photo_led_sec==890){
|
|
|
+ gettimeofday(&tv, NULL);
|
|
|
+ device_status.photo_stamp = tv.tv_sec;
|
|
|
DTU_Write("takephoto.mp3");
|
|
|
rt_thread_delay(2000);
|
|
|
DTU_Write(makeJson_ParsePhoto());
|
|
|
@@ -1740,7 +1741,7 @@ void Check_ParamConfig(void)
|
|
|
ef_get_env_blob("env_h",&device_status.humidity,sizeof(device_status.humidity),NULL); //环境湿度
|
|
|
ef_get_env_blob("json_w_clock",&device_status.json_w_clock,sizeof(device_status.json_w_clock),NULL); //时间
|
|
|
ef_get_env_blob("json_w_reset",&device_status.json_w_reset,sizeof(device_status.json_w_reset),NULL); //重置
|
|
|
- ef_get_env_blob("json_w_platform",&device_status.json_w_platform,sizeof(device_status.json_w_platform),NULL);//平台
|
|
|
+ //ef_get_env_blob("json_w_platform",&device_status.json_w_platform,sizeof(device_status.json_w_platform),NULL);//平台
|
|
|
ef_get_env_blob("version_type",&device_status.version_type,sizeof(device_status.version_type),NULL); //版本类型
|
|
|
ef_get_env_blob("driver_bl",&device_status.driver_bl,sizeof(device_status.driver_bl),NULL); //BL版本号 进BL的时候存储到FLASH
|
|
|
ef_get_env_blob("platform",&device_status.mqttcfg1,sizeof(device_status.mqttcfg1),NULL); //平台地址
|
|
|
@@ -1919,7 +1920,7 @@ void ResetParamDefault(void)
|
|
|
device_status.collecting_eh1 = 10;
|
|
|
device_status.collecting_sh2 = 14;
|
|
|
device_status.collecting_eh2 = 16;
|
|
|
- device_status.Power_Type = 1;
|
|
|
+ device_status.Power_Type = 0;
|
|
|
ef_set_env_blob("Power_Type", &device_status.Power_Type, sizeof(device_status.Power_Type));
|
|
|
if(device_status.dtype==8)
|
|
|
{
|
|
|
@@ -1999,7 +2000,7 @@ void ResetParamDefault_DC(void)
|
|
|
#else
|
|
|
device_status.sunBar = 4;
|
|
|
#endif
|
|
|
- device_status.Power_Type = 0;
|
|
|
+ device_status.Power_Type = 1;
|
|
|
device_status.tph = 70; //高温保护阈值
|
|
|
device_status.tpl = -5; //低温保护阈值
|
|
|
device_status.timeSwitch = 1; //定时模式
|