diff --git a/code/application/source/cardv/SrcCode/System/SysMain_Exe.c b/code/application/source/cardv/SrcCode/System/SysMain_Exe.c index 6ec76d4bf..936988d03 100755 --- a/code/application/source/cardv/SrcCode/System/SysMain_Exe.c +++ b/code/application/source/cardv/SrcCode/System/SysMain_Exe.c @@ -244,6 +244,7 @@ INT32 System_OnBoot(VControl *pCtrl, UINT32 paramNum, UINT32 *paramArray) #if HUNTING_CAMERA_MCU == ENABLE sf_cardv_para_check_start(); + sf_cardv_wifi_start(); #endif #if (UCTRL_FUNC) diff --git a/code/lib/source/sifar/code/source/common/sf_common.c b/code/lib/source/sifar/code/source/common/sf_common.c index 1389bc63e..523cd3212 100755 --- a/code/lib/source/sifar/code/source/common/sf_common.c +++ b/code/lib/source/sifar/code/source/common/sf_common.c @@ -1601,7 +1601,7 @@ static const SF_CHAR* sf_process_message_getstatusstring(SF_MESSAGE_TYPE_E enTyp } static SINT32 sf_cardv_proccess_cmd_mcu(SF_MESSAGE_BUF_S *pMessageBuf) { - static UINT8 wifistart = 0; + // static UINT8 wifistart = 0; UINT8 powerOnMode = 0; //printf("[%s:%d] ID = %#x\n", __FUNCTION__, __LINE__,pMessageBuf->arg1); @@ -1624,19 +1624,19 @@ static SINT32 sf_cardv_proccess_cmd_mcu(SF_MESSAGE_BUF_S *pMessageBuf) sf_set_mcu_ver(pMessageBuf->arg3); MLOGI("%d.%d.%d\n",(pMessageBuf->arg3>>4)&0x0F, pMessageBuf->arg3 & 0x0F, pMessageBuf->arg2); - if((0 == sf_get_fw_update()) && (sf_get_mode_flag()) && (0 == wifistart)) - { - wifistart = 1; - GOIO_Turn_Onoff_IRCUT(1); - /*wifi init*/ - //stMessageBuf.arg1 = SF_WIFI_CMD_START; - //stMessageBuf.cmdId = CMD_WIFI; - //sf_com_message_send_to_cardv(&stMessageBuf); - sf_cardv_wifi_start(); - //Ux_SendEvent(0, NVTEVT_EXE_WIFI_START, 0); - //sleep(2); - //sf_apinfo_thread_init(); - } + // if((0 == sf_get_fw_update()) && (sf_get_mode_flag()) && (0 == wifistart)) + // { + // wifistart = 1; + // GOIO_Turn_Onoff_IRCUT(1); + // /*wifi init*/ + // //stMessageBuf.arg1 = SF_WIFI_CMD_START; + // //stMessageBuf.cmdId = CMD_WIFI; + // //sf_com_message_send_to_cardv(&stMessageBuf); + // sf_cardv_wifi_start(); + // //Ux_SendEvent(0, NVTEVT_EXE_WIFI_START, 0); + // //sleep(2); + // //sf_apinfo_thread_init(); + // } break; case SF_MCU_CMD_MCU_RTC: @@ -2614,25 +2614,25 @@ UINT32 sf_cardv_wifi_start(void) { SINT32 ret = 1; UIMenuStoreInfo *puiPara = sf_ui_para_get(); - if(puiPara->WifiSwitch == SF_OFF) - { - SLOGE("WifiSwitch OFF\n"); - return 1; - } - if(WifiTskCfg.IsRun) - { - SLOGE("thread has already run !!!\n"); - return 1; - } - ret = pthread_create(&WifiTskCfg.TskId, NULL, sf_cardv_wifi_thread, NULL); - if(ret != SF_SUCCESS) - { - MLOGD("thread creat fail!\n"); - return ret; - } - WifiTskCfg.IsRun = 1; - return SF_SUCCESS; + if((0 == sf_get_fw_update()) && (sf_get_mode_flag()) && (puiPara->WifiSwitch)) + { + if(WifiTskCfg.IsRun) + { + SLOGE("thread has already run !!!\n"); + return 1; + } + ret = pthread_create(&WifiTskCfg.TskId, NULL, sf_cardv_wifi_thread, NULL); + if(ret != SF_SUCCESS) + { + MLOGD("thread creat fail!\n"); + return ret; + } + WifiTskCfg.IsRun = 1; + return SF_SUCCESS; + } + SLOGE("WifiSwitch OFF\n"); + return 1; } BOOL sf_cmd_disp_para_set(unsigned char argc, char **argv) diff --git a/rtos/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UICfgDefault.h b/rtos/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UICfgDefault.h index 3da7b5018..ac2fbe2c4 100644 --- a/rtos/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UICfgDefault.h +++ b/rtos/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UICfgDefault.h @@ -263,7 +263,7 @@ #define DEFAULT_MULTISHOT_INTEVEL SF_MULTISHOT_INTEVEL_1S #define DEFAULT_PIC_UP_DAILY_REPORT SF_OFF #define DEFAULT_BLU_SWITCH SF_ON - +#define DEFAULT_WIFI_SWITCH SF_ON #define SIFAR_FTP_IP "119.23.174.139" #define SIFAR_FTP_PORT "21" #define SIFAR_FTP_USERNAME "cameraftp" diff --git a/rtos/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UIInfo.c b/rtos/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UIInfo.c index 8b90a840c..65fc80048 100755 --- a/rtos/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UIInfo.c +++ b/rtos/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UIInfo.c @@ -1177,7 +1177,8 @@ void SysResetFlag(void) puiPara->MultiShotIntevel = DEFAULT_MULTISHOT_INTEVEL; puiPara->PicUpDailyReport = DEFAULT_PIC_UP_DAILY_REPORT; puiPara->BluSwitch = DEFAULT_BLU_SWITCH; - + puiPara->WifiSwitch = DEFAULT_WIFI_SWITCH; + if(puiPara->ModuleImei[0] != '\0') { puiPara->DailyReportTime.Hour = ((UINT16)(puiPara->ModuleImei[11]-48)*10+(puiPara->ModuleImei[12]-48))%12;