From f441ef1d983edcb970e94a00c424417f13d8e27c Mon Sep 17 00:00:00 2001 From: alisa Date: Wed, 23 Aug 2023 01:44:08 +0800 Subject: [PATCH] =?UTF-8?q?[lpa]1=E3=80=82=E4=BF=AE=E6=94=B9lps=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E6=96=87=E4=BB=B6=E8=B7=AF=E5=BE=84=EF=BC=8C=E5=BE=85?= =?UTF-8?q?=E4=BD=BF=E7=94=A8e-sim=E5=8D=A1=E6=B5=8B=E8=AF=95=E6=B3=A8?= =?UTF-8?q?=E7=BD=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DxInput_Key.c | 9 +++++++ .../source/sf_app/code/source/app/sf_app.c | 2 +- .../sf_app/code/source/app/sf_service.c | 24 +++++++++++-------- .../sf_app/code/source/wifi/sf_wifi_svr.c | 4 +++- 4 files changed, 27 insertions(+), 12 deletions(-) mode change 100644 => 100755 code/application/source/cardv/SrcCode/Dx/565_HUNTING_EVB_LINUX_4G_S530/DxInput_Key.c diff --git a/code/application/source/cardv/SrcCode/Dx/565_HUNTING_EVB_LINUX_4G_S530/DxInput_Key.c b/code/application/source/cardv/SrcCode/Dx/565_HUNTING_EVB_LINUX_4G_S530/DxInput_Key.c old mode 100644 new mode 100755 index 5210a6fcc..f659b6211 --- a/code/application/source/cardv/SrcCode/Dx/565_HUNTING_EVB_LINUX_4G_S530/DxInput_Key.c +++ b/code/application/source/cardv/SrcCode/Dx/565_HUNTING_EVB_LINUX_4G_S530/DxInput_Key.c @@ -26,7 +26,9 @@ #if HUNTING_CAMERA_MCU == ENABLE #include #include "sf_sd_common.h" + #endif + #if 0 #include "rtc.h" #include "Delay.h" @@ -237,6 +239,13 @@ UINT32 DrvKey_DetNormalKey(void) sf_save_camera_info(); vos_perf_mark(&ttick); } + else if((0 == cmdflag) && (time == 20000)) + { + cmdflag = 1; + printf("[%s:%d] SendKeyCnt:%d KeyTestPressCnt:%d time: %dms\n", __FUNCTION__, __LINE__, SendKeyCnt, KeyTestPressCnt, time); + //sf_network_switch(); + } + } }else{ if(KeyTestPressCnt && (0 == sf_get_fw_update())){ 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 889684e71..7dba47d38 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 @@ -102,7 +102,7 @@ int main(int argc, char *argv[]) { printf("*********************************************\n"); printf("* *\n"); - printf("* sf_app *\n"); + printf("* sf_app-v1 *\n"); printf("* *\n"); printf("*********************************************\n"); //gpio_direction_input(C_GPIO(10)); 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 7bc7a57d5..5e5d81609 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 @@ -41,6 +41,8 @@ #include "sf_module.h" #include "sf_otamng.h" +#include "lpasdk/api/lpasdk_api.h" +#include "sf_4G_sms_lpa_cmd.h" #include "sf_commMng.h" #include "sf_commu_mcu_reg.h" @@ -1295,11 +1297,11 @@ static SINT32 app_Register_Net_startup_mode(SF_FN_PARAM_S *pfnParam) s32ret = sf_4G_sim_init(pfnParam); SF_APPCOMM_CHECK_RETURN(s32ret, s32ret); - -#if SF_LPA_SDK - + SLOGD("\n"); +#if 1 + SLOGD("\n"); sf_sample_lpa_init(); - + SLOGD("\n"); while(!sf_is_esim_init_finish()) { usleep(100*1000); @@ -1530,7 +1532,7 @@ static SINT32 app_Register_Net_startup_mode(SF_FN_PARAM_S *pfnParam) s32ret = sf_4G_sim_init(pfnParam); SF_APPCOMM_CHECK_RETURN(s32ret, SF_APP_ERROR_REQUEST); - #if SF_LPA_SDK + #if 1 //SF_LPA_SDK sf_sample_lpa_init(); @@ -1580,11 +1582,15 @@ static SINT32 app_Register_Net_startup_mode(SF_FN_PARAM_S *pfnParam) } +#endif + + s32ret = sf_4G_register_net_manual(pfnParam); + if(pCustomerParam->ProfileSwitchFlg) { pCustomerParam->ProfileSwitchFlg = 0; - if(ret == SF_SIM_ERROR_REG_NET_REFUSE) + if(s32ret == SF_SIM_ERROR_REG_NET_REFUSE) { sf_sms_lpa_command_recombination_log(SF_SMS_LPA_CMD_FAIL, SF_LPA_CUSTOM_ERROR_NETWORK_REJECTED); @@ -1608,16 +1614,14 @@ static SINT32 app_Register_Net_startup_mode(SF_FN_PARAM_S *pfnParam) { sf_sms_lpa_command_recombination_log(SF_SMS_LPA_CMD_SUCCESS, LPA_NO_ERROR); memset(pCustomerParam->PreActiveProfileIccid, '\0', sizeof(pCustomerParam->PreActiveProfileIccid)); - if(ret == SF_SUCCESS) + if(s32ret == SF_SUCCESS) sf_sms_lpa_set_send_lpa_log_flg(1); // switch prlfile reboot in A reg net, reg 0,1 or reg 0,2, not need reboot again pCustomerParam->NetWorkNeedSearch = 0; } } -#endif - - s32ret = sf_4G_register_net_manual(pfnParam); + if (s32ret != SF_SUCCESS) { sf_set_signal_ready_flag(TRUE); } diff --git a/code/application/source/sf_app/code/source/wifi/sf_wifi_svr.c b/code/application/source/sf_app/code/source/wifi/sf_wifi_svr.c index 7261d4925..f0cbae56d 100755 --- a/code/application/source/sf_app/code/source/wifi/sf_wifi_svr.c +++ b/code/application/source/sf_app/code/source/wifi/sf_wifi_svr.c @@ -62,6 +62,7 @@ #include "sf_4g_lpa.h" #endif + /************************************************************************** * C O N S T A N T S * **************************************************************************/ @@ -2025,7 +2026,8 @@ SINT32 sf_svr_packet_proc(SINT32 fd, UINT8 *pAppData, UINT16 dataLen) paramSaveFlag = 1; respFlag = 2; break; -#if SF_LPA_SDK +#if 0 +SF_LPA_SDK extern void sf_4g_operator_scan(UINT8 mode); extern void sf_network_select(UINT8 profileId);