diff --git a/code/application/source/cardv/SrcCode/System/SysMain_cmd.c b/code/application/source/cardv/SrcCode/System/SysMain_cmd.c index c18ceac47..ef5e621a0 100755 --- a/code/application/source/cardv/SrcCode/System/SysMain_cmd.c +++ b/code/application/source/cardv/SrcCode/System/SysMain_cmd.c @@ -262,6 +262,7 @@ SXCMD_ITEM("sf_sw_esim %", sf_cmd_switch_esim, "sf_switch_esim") SXCMD_ITEM("gprssw %", sf_cmd_gprs_switch, "gprssw 0/1") SXCMD_ITEM("uiprint %", sf_cmd_para_printf, "uiprint") SXCMD_ITEM("blusw %", cmd_blu_switch, "blusw 0/1") +SXCMD_ITEM("wifisw %", cmd_wifi_switch, "wifisw 0/1") #endif diff --git a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UICfgDefault.h b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UICfgDefault.h index 3da7b5018..ac2fbe2c4 100755 --- a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UICfgDefault.h +++ b/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/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UIInfo.c b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UIInfo.c index 5aaf1db14..0472d1054 100755 --- a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UIInfo.c +++ b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UIInfo.c @@ -1765,6 +1765,7 @@ 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; diff --git a/code/application/source/sf_app/code/source/app/sf_app.c b/code/application/source/sf_app/code/source/app/sf_app.c index 57c889bd6..3e029dd7b 100755 --- a/code/application/source/sf_app/code/source/app/sf_app.c +++ b/code/application/source/sf_app/code/source/app/sf_app.c @@ -157,8 +157,14 @@ int main(int argc, char *argv[]) #if SF_IQ_TEST != ENABLE if(SF_MCU_STARTUP_ONKEY == startup) { - sf_set_wifi_en(1); - sf_set_bt_en(1); + if(puiPara->WifiSwitch) + { + sf_set_wifi_en(1); + } + if(puiPara->BluSwitch) + { + sf_set_bt_en(1); + } } if((0 == isUpdate) && (puiPara->GprsSwitch)) { diff --git a/code/lib/source/sifar/code/include/sf_common.h b/code/lib/source/sifar/code/include/sf_common.h index ea9c418dd..4b153e3ee 100755 --- a/code/lib/source/sifar/code/include/sf_common.h +++ b/code/lib/source/sifar/code/include/sf_common.h @@ -156,4 +156,6 @@ BOOL sf_ota_trigger(void); BOOL sf_ota_result(void); SF_BLE_STATUS_E sf_get_ble_status(void); void sf_set_ble_status(SF_BLE_STATUS_E enStatus); +BOOL cmd_wifi_switch(unsigned char argc, char **argv); +void sf_set_msdc_clk(void); #endif 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 28ae345c2..1389bc63e 100755 --- a/code/lib/source/sifar/code/source/common/sf_common.c +++ b/code/lib/source/sifar/code/source/common/sf_common.c @@ -2613,6 +2613,12 @@ void* sf_cardv_wifi_thread(void *arg) 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"); @@ -3211,6 +3217,19 @@ BOOL cmd_blu_switch(unsigned char argc, char **argv) return TRUE; } +BOOL cmd_wifi_switch(unsigned char argc, char **argv) +{ + UINT32 value; + UIMenuStoreInfo *puiPara = sf_ui_para_get(); + sscanf_s(argv[0],"%d", &value); + if(value < SF_ON_OFF_MAX){ + puiPara->WifiSwitch = value; + + Save_MenuInfo(); + } + printf("[%s:%d] WifiSwitch:%d\n", __FUNCTION__, __LINE__,puiPara->WifiSwitch); + return TRUE; +} SF_BLE_STATUS_E sf_get_ble_status(void) { @@ -3228,4 +3247,11 @@ void sf_set_ble_status(SF_BLE_STATUS_E enStatus) SLOGE("Type format error\n"); return; +} + +void sf_set_msdc_clk(void) +{ + printf("[%s:%d] s\n", __FUNCTION__, __LINE__); + system("echo 24000000 > /sys/kernel/debug/mmc0/clock"); + printf("[%s:%d] e \n", __FUNCTION__, __LINE__); } \ No newline at end of file