|
|
@@ -411,15 +411,16 @@ static void HMI_Decode(char *cmd,uint8_t cmd_len)
|
|
|
}
|
|
|
//定时设置
|
|
|
else if (strstr(rx_buffer,"saveClockSet=")!=NULL) {
|
|
|
- char sun_str[3],start_str[3],stop_str[3],timeswitch_str[3];
|
|
|
+ char value_str[10];
|
|
|
+ memset(value_str,0,sizeof(value_str));
|
|
|
rt_kprintf("时间设置!\n");
|
|
|
var=strstr(rx_buffer,"=");
|
|
|
var++;
|
|
|
- strncpy(sun_str,var,2);
|
|
|
- if(atoi(sun_str) > 0 && atoi(sun_str) <12)
|
|
|
+ strncpy(value_str,var,2);
|
|
|
+ if(atoi(value_str) > 0 && atoi(value_str) <12)
|
|
|
{
|
|
|
#if LAMP_EN == 0
|
|
|
- device_status.sunBar=atoi(sun_str);
|
|
|
+ device_status.sunBar=atoi(value_str);
|
|
|
ef_set_env_blob("sunBar", &device_status.sunBar, sizeof(device_status.sunBar));
|
|
|
#else
|
|
|
rt_kprintf("光控定时设置失败!!!,三光源模式!!\n");
|
|
|
@@ -434,39 +435,42 @@ static void HMI_Decode(char *cmd,uint8_t cmd_len)
|
|
|
// device_status.light_over_tim = device_status.sunBar * 3600 + nowstamp_num;
|
|
|
}
|
|
|
else {
|
|
|
- rt_kprintf("参数设置异常(光控时长):%d!!!%d",atoi(sun_str));
|
|
|
+ rt_kprintf("参数设置异常(光控时长):%d!!!%d",atoi(value_str));
|
|
|
}
|
|
|
+ memset(value_str,0,sizeof(value_str));
|
|
|
//时控开始时间
|
|
|
- strncpy(start_str,var+2,2);
|
|
|
- if(atoi(start_str) >= 0 && atoi(start_str) < 24)
|
|
|
+ strncpy(value_str,var+2,2);
|
|
|
+ if(atoi(value_str) >= 0 && atoi(value_str) < 24)
|
|
|
{
|
|
|
- device_status.startBar=atoi(start_str);
|
|
|
+ device_status.startBar=atoi(value_str);
|
|
|
ef_set_env_blob("startBar", &device_status.startBar, sizeof(device_status.startBar));
|
|
|
}
|
|
|
else {
|
|
|
- rt_kprintf("参数设置异常(开始):%d!!!",atoi(start_str));
|
|
|
+ rt_kprintf("参数设置异常(开始):%d!!!",atoi(value_str));
|
|
|
}
|
|
|
+ memset(value_str,0,sizeof(value_str));
|
|
|
//
|
|
|
- strncpy(stop_str,var+4,2);
|
|
|
- if(atoi(stop_str) >= 0&& atoi(stop_str) < 24)
|
|
|
+ strncpy(value_str,var+4,2);
|
|
|
+ if(atoi(value_str) >= 0&& atoi(value_str) < 24)
|
|
|
{
|
|
|
- device_status.stopBar=atoi(stop_str);
|
|
|
+ device_status.stopBar=atoi(value_str);
|
|
|
ef_set_env_blob("stopBar", &device_status.stopBar, sizeof(device_status.stopBar));
|
|
|
}
|
|
|
else {
|
|
|
- rt_kprintf("参数设置异常(结束):%d!!!",atoi(stop_str));
|
|
|
+ rt_kprintf("参数设置异常(结束):%d!!!",atoi(value_str));
|
|
|
}
|
|
|
+ memset(value_str,0,sizeof(value_str));
|
|
|
//
|
|
|
- strncpy(timeswitch_str,var+7,2);
|
|
|
- if(atoi(timeswitch_str) >= 0 && atoi(timeswitch_str) <= 1)
|
|
|
+ strncpy(value_str,var+7,2);
|
|
|
+ if(atoi(value_str) >= 0 && atoi(value_str) <= 1)
|
|
|
{
|
|
|
#if LAMP_EN == 0
|
|
|
- device_status.timeSwitch=atoi(timeswitch_str);
|
|
|
+ device_status.timeSwitch=atoi(value_str);
|
|
|
ef_set_env_blob("timeSwitch", &device_status.timeSwitch, sizeof(device_status.timeSwitch));
|
|
|
#endif
|
|
|
}
|
|
|
else {
|
|
|
- rt_kprintf("参数设置异常(模式):%d!!!",atoi(timeswitch_str));
|
|
|
+ rt_kprintf("参数设置异常(模式):%d!!!",atoi(value_str));
|
|
|
}
|
|
|
//2022/06/23,add:
|
|
|
rt_sprintf(device_status.json_w_clock,"屏幕操作:修改工作时间:开始-%d,结束-%d,模式-%d(0-光控,1-时控)操作时间:%04d-%02d-%02d %02d:%02d:%02d",device_status.startBar,device_status.stopBar,device_status.timeSwitch,tm.tm_year+1900,tm.tm_mon+1,tm.tm_mday,tm.tm_hour,tm.tm_min,tm.tm_sec);
|
|
|
@@ -518,6 +522,7 @@ static void HMI_Decode(char *cmd,uint8_t cmd_len)
|
|
|
else {
|
|
|
rt_kprintf("参数设置失败!!!\n");
|
|
|
}
|
|
|
+ rt_thread_delay(1000);
|
|
|
MA_save();
|
|
|
rt_free(var);
|
|
|
rt_kprintf("系统设置已保存:收集时间-%d,加热时间-%d,加热温度-%d,音量-%d,自动关屏-%d\n",device_status.clt_time,device_status.heattime,device_status.heatvalue,device_status.vol,device_status.thsp);
|
|
|
@@ -753,8 +758,14 @@ static void HMI_Decode(char *cmd,uint8_t cmd_len)
|
|
|
ef_set_env_blob("version_type",&device_status.version_type,sizeof(device_status.version_type)); //版本类型
|
|
|
MA_save();
|
|
|
}
|
|
|
- else {
|
|
|
-
|
|
|
+ }
|
|
|
+ else if (strstr(rx_buffer,"SwversionV30")!=NULL) {
|
|
|
+ if(device_status.version_type != 30)
|
|
|
+ {
|
|
|
+ device_status.version_type = 30;
|
|
|
+ sprintf(device_status.driver, "%s",VERSION_Robot);
|
|
|
+ ef_set_env_blob("version_type",&device_status.version_type,sizeof(device_status.version_type)); //版本类型
|
|
|
+ MA_save();
|
|
|
}
|
|
|
}
|
|
|
else if (strstr(rx_buffer,"putTest.switchFAN_PU=1")!=NULL) {
|
|
|
@@ -947,21 +958,24 @@ static void Ctr_Mortor_entry(void* parameter)
|
|
|
}
|
|
|
if(device_status.photo_ws==1)
|
|
|
{
|
|
|
+ ctr_led(ON);
|
|
|
//打开补光灯
|
|
|
- if(photo_led_sec==100)
|
|
|
+ if(photo_led_sec==400)
|
|
|
{
|
|
|
- ctr_led(ON);
|
|
|
DTU_Write("takephoto.mp3");
|
|
|
//延时
|
|
|
rt_thread_delay(1000);
|
|
|
rt_kprintf("\n测试拍照!\n");
|
|
|
Hk_Take_io();
|
|
|
+ char *takephotojson = makeJson_takephoto();
|
|
|
+ DTU_Write("%s",takephotojson);
|
|
|
+ rt_free(takephotojson);
|
|
|
}
|
|
|
photo_led_sec--;
|
|
|
if(photo_led_sec==0)
|
|
|
{
|
|
|
ctr_led(OFF);
|
|
|
- photo_led_sec = 100;
|
|
|
+ photo_led_sec = 450;
|
|
|
device_status.photo_ws = 0;
|
|
|
HMI_WRITE("sysTest.switchPhoto.val=0");
|
|
|
HMI_WRITE("sysTest.switchFill.val=0");
|
|
|
@@ -1163,6 +1177,9 @@ void Check_ParamConfig(void)
|
|
|
rt_pin_write(HK_5000W_P,ON);
|
|
|
rt_sprintf(device_status.driver, "%s",VERSION_XCT);
|
|
|
}
|
|
|
+ else if (device_status.version_type==30) {
|
|
|
+ rt_sprintf(device_status.driver, "%s",VERSION_Robot);
|
|
|
+ }
|
|
|
if(device_status.iccid[0]!=8)
|
|
|
{
|
|
|
rt_sprintf(device_status.iccid,"87654321000000000000");
|
|
|
@@ -1214,6 +1231,7 @@ void Check_ParamConfig(void)
|
|
|
#if SENSOR_EN==1
|
|
|
mb_master_samlpe();
|
|
|
#endif
|
|
|
+#if ROBOT_EN == 0
|
|
|
uint16_t connect_num=0;
|
|
|
//等待联网,
|
|
|
while(atoi(device_status.net)==1)
|
|
|
@@ -1238,6 +1256,7 @@ void Check_ParamConfig(void)
|
|
|
}
|
|
|
if(device_status.version_type==6) device_status.timeSwitch = 1;
|
|
|
DTU_Write("%s",makeJson_Warn("turnon", "device_stm32"));
|
|
|
+#endif
|
|
|
}
|
|
|
}
|
|
|
void ResetParamDefault(void)
|