From 6e01c4f871001b7cd6932d19196a66db0a85b13c Mon Sep 17 00:00:00 2001 From: payton Date: Thu, 18 Jan 2024 16:33:24 +0800 Subject: [PATCH] =?UTF-8?q?1.=E5=90=AF=E5=8A=A8=E6=A0=87=E5=BF=97=E8=B0=83?= =?UTF-8?q?=E6=95=B4=EF=BC=8C=E4=BB=A5=E5=85=8D=E5=90=AF=E5=8A=A8=E6=96=B9?= =?UTF-8?q?=E5=BC=8F=E9=94=99=E4=B9=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../UIWnd/LVGL_SPORTCAM/UIInfo/UIInfo.c | 5 ++ .../source/sf_app/code/include/sf_service.h | 1 + .../sf_app/code/source/app/sf_service.c | 54 +++++++++++++------ .../code/source/paramMng/sf_param_common.c | 9 ++++ .../UIWnd/LVGL_SPORTCAM/UIInfo/UIInfo.c | 7 +++ 5 files changed, 59 insertions(+), 17 deletions(-) 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 2447800a7..9ca4ab57d 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 @@ -2367,6 +2367,11 @@ void sf_power_on_para_check_init(void) memset(puiPara->SimIccid,'\0',sizeof(puiPara->SimIccid)); memset(puiPara->ServiceProvider,'\0',sizeof(puiPara->ServiceProvider)); } + else if(PowerOnMode == PWR_ON_GPRS_INIT) + { + puiPara->NeedTimeSyncStartUp = 1; + puiPara->NetWorkNeedSearch = 0; + } else if(PowerOnMode == PWR_ON_TIME_SYNC) { puiPara->NetWorkNeedSearch = 0; diff --git a/code/application/source/sf_app/code/include/sf_service.h b/code/application/source/sf_app/code/include/sf_service.h index 16e5a60b0..c31d67f4c 100755 --- a/code/application/source/sf_app/code/include/sf_service.h +++ b/code/application/source/sf_app/code/include/sf_service.h @@ -105,6 +105,7 @@ int sf_check_sd(void); void sf_save_camera_gps_info(void); void set_at_parament(void); int sf_net_dns_ck(void); +void sf_register_net_para_ck(void); #ifdef __cplusplus #if __cplusplus } diff --git a/code/application/source/sf_app/code/source/app/sf_service.c b/code/application/source/sf_app/code/source/app/sf_service.c index 5b5b39a4c..7c11dfb88 100755 --- a/code/application/source/sf_app/code/source/app/sf_service.c +++ b/code/application/source/sf_app/code/source/app/sf_service.c @@ -1,5 +1,6 @@ #include "sf_log.h" +#include "sf_param_enum.h" #include "sf_qrcode.h" #include #include @@ -1713,16 +1714,7 @@ static SINT32 app_Register_Net_startup_mode(SF_FN_PARAM_S *pfnParam) sf_set_signal_ready_flag(TRUE); } - if (1 == pCustomerParam->NeedTimeSyncStartUp) { - printf("[%s:%d]8 between A and B,no reg net again,no reset time " - "sync.\n", - __FUNCTION__, __LINE__); - sf_set_dr_reset_time_sys_flag(1); - } - if (0 != sf_get_cq_signal()) { - pCustomerParam->NeedTimeSyncStartUp = 1; - } // if (pCustomerParam->DailyReportSwitch) { // pCustomerParam->GpsSendFlag = // 1; // indicate need send dp file in b power on. @@ -1861,12 +1853,7 @@ static SINT32 app_Register_Net_startup_mode(SF_FN_PARAM_S *pfnParam) if (s32ret != SF_SUCCESS) { sf_set_signal_ready_flag(TRUE); } - if (0 != sf_get_cq_signal()) { - //pCustomerParam->GpsSendFlag = 1; - pCustomerParam->NeedTimeSyncStartUp = 1; - // avoid always A mode power on - pCustomerParam->NetWorkNeedSearch = 0; - } + SF_APPCOMM_CHECK_RETURN(s32ret, SF_APP_ERROR_REQUEST); // sf_4G_usb_net_apn_cfg(pfnParam); // set_at_parament(); @@ -1939,8 +1926,6 @@ static SINT32 app_Register_Net_startup_mode(SF_FN_PARAM_S *pfnParam) s32ret = sf_read_message(); SF_APPCOMM_CHECK_RETURN(s32ret, SF_APP_ERROR_REQUEST); - pCustomerParam->NetWorkNeedSearch = 0; - pCustomerParam->NeedTimeSyncStartUp = 0; s32ret = sf_file_send_auto(); //SF_APPCOMM_CHECK_RETURN(s32ret, SF_APP_ERROR_FILE_SEND); @@ -1986,6 +1971,8 @@ void app_Register_Net_thread(void) { pthread_detach(pthread_self()); s32ret = app_Register_Net_startup_mode(&stpfncallback); + sf_register_net_para_ck(); + switch (s32ret) { case SF_APP_ERROR_REQUEST: app_Register_Net_Error_return_init(&stpfncallback); @@ -2536,6 +2523,39 @@ int sf_net_dns_ck(void) return EXIT_SUCCESS; } +void sf_register_net_para_ck(void) +{ + SF_STARTUP_TYPE_E startup = sf_poweron_type_get(); + UIMenuStoreInfo *puiPara = sf_app_ui_para_get(); + SLOGE("NeedTimeSyncStartUp:%d NetWorkNeedSearch:%d\n", puiPara->NeedTimeSyncStartUp, puiPara->NetWorkNeedSearch); + + switch (startup) { + case SF_MCU_STARTUP_DP: + if (1 == puiPara->NeedTimeSyncStartUp) { + printf("[%s:%d]8 between A and B,no reg net again,no reset time " + "sync.\n", + __FUNCTION__, __LINE__); + sf_set_dr_reset_time_sys_flag(1); + } + + if (0 != sf_get_cq_signal()) { + puiPara->NeedTimeSyncStartUp = 1; + } + break; + case SF_MCU_STARTUP_RESET: + puiPara->NeedTimeSyncStartUp = 1; + puiPara->NetWorkNeedSearch = 0; + break; + case SF_MCU_STARTUP_SYN_PARAM: + puiPara->NetWorkNeedSearch = 0; + puiPara->NeedTimeSyncStartUp = 0; + break; + default: + break; + } + SLOGE("NeedTimeSyncStartUp:%d NetWorkNeedSearch:%d\n", puiPara->NeedTimeSyncStartUp, puiPara->NetWorkNeedSearch); + +} #ifdef __cplusplus #if __cplusplus } diff --git a/code/application/source/sf_app/code/source/paramMng/sf_param_common.c b/code/application/source/sf_app/code/source/paramMng/sf_param_common.c index 13e7a27a5..582bd1742 100755 --- a/code/application/source/sf_app/code/source/paramMng/sf_param_common.c +++ b/code/application/source/sf_app/code/source/paramMng/sf_param_common.c @@ -297,7 +297,15 @@ void sf_app_power_on_para_check_init(void) if(0 == puiPara->NetWorkNeedSearch){ puiPara->NetWorkNeedSearch = 1; } + puiPara->FristSendDailyAndGps = 1; + puiPara->GpsSendFlag = 0; memset(puiPara->SimIccid,'\0',sizeof(puiPara->SimIccid)); + memset(puiPara->ServiceProvider,'\0',sizeof(puiPara->ServiceProvider)); + } + else if(PowerOnMode == SF_MCU_STARTUP_RESET) + { + puiPara->NeedTimeSyncStartUp = 1; + puiPara->NetWorkNeedSearch = 0; } else if(PowerOnMode == SF_MCU_STARTUP_SYN_PARAM) { @@ -311,6 +319,7 @@ void sf_app_power_on_para_check_init(void) // puiPara->GpsSendFlag = 1; // indicate need send dp file in b power on. // } } + printf("PowerOnMode=%d NeedTimeSyncStartUp=%d NetWorkNeedSearch:%d\n", PowerOnMode, puiPara->NeedTimeSyncStartUp, puiPara->NetWorkNeedSearch); if(puiPara->Multishot != sf_sys_get_flag(FL_CONTINUE_SHOT)) { 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 e95556cbc..736314292 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 @@ -491,6 +491,7 @@ void Save_MenuInfo(void) #else #if (HUNTING_CAMERA_MODEL == ENABLE) + printf("%s:%d s\n", __FUNCTION__, __LINE__); if(is_storage_sys_partition_exist() == TRUE && memcmp(¤tInfo, &origInfo, sizeof(currentInfo))){ UINT32 uiSectorAddr = 0; @@ -542,6 +543,7 @@ void Save_MenuInfo(void) } } } + printf("%s:%d e\n", __FUNCTION__, __LINE__); #endif /* HUNTING_CAMERA_MODEL == ENABLE */ #endif /* PST_FUNC == ENABLE */ @@ -1743,6 +1745,11 @@ void sf_power_on_para_check_init(void) memset(puiPara->Latitude, 0, sizeof(puiPara->Latitude)); //sf_dailyReport_refresh(); } + else if(PowerOnMode == PWR_ON_GPRS_INIT) + { + puiPara->NeedTimeSyncStartUp = 1; + puiPara->NetWorkNeedSearch = 0; + } else if(PowerOnMode == PWR_ON_TIME_SYNC) { puiPara->NetWorkNeedSearch = 0;