From e82393a5d69e1a47442c69fb00fd80259fe6656f Mon Sep 17 00:00:00 2001 From: payton Date: Tue, 24 Oct 2023 17:10:13 +0800 Subject: [PATCH] =?UTF-8?q?1.esim=E5=8D=A1=E7=9A=84iccid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../UIWnd/LVGL_SPORTCAM/UIInfo/UIInfo.h | 2 ++ .../source/sf_app/code/include/sf_4g_lpa.h | 2 +- .../sf_app/code/source/4gMng/sf_4g_lpa.c | 32 +++++++++++++++++++ .../sf_app/code/source/app/sf_service.c | 10 +++++- .../sifar/code/source/common/sf_common.c | 2 +- .../UIWnd/LVGL_SPORTCAM/UIInfo/UIInfo.h | 2 ++ 6 files changed, 47 insertions(+), 3 deletions(-) diff --git a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UIInfo.h b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UIInfo.h index c239c73bc..ea7bfdc68 100755 --- a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UIInfo.h +++ b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UIInfo.h @@ -576,6 +576,8 @@ typedef struct _UIMenuUIMenuStoreInfo { UINT32 FileKey; CHAR BluSsid[14]; CHAR BluSwitch;/*OFF/ON*/ + CHAR SimIccidV[21]; + CHAR SimIccidA[21]; UINT32 x1; UINT32 x2; UINT32 x3; diff --git a/code/application/source/sf_app/code/include/sf_4g_lpa.h b/code/application/source/sf_app/code/include/sf_4g_lpa.h index 5a3d77204..977527176 100755 --- a/code/application/source/sf_app/code/include/sf_4g_lpa.h +++ b/code/application/source/sf_app/code/include/sf_4g_lpa.h @@ -73,7 +73,7 @@ void sf_set_wifi_cmd(UINT8 cmd); UINT8 sf_get_wifi_cmd(void); void sf_network_select(UINT8* profileId); void sf_4g_operator_scan(UINT8 mode); - +SINT32 sf_lpa_get_esim_iccid(SF_CHAR iccid[][22]); diff --git a/code/application/source/sf_app/code/source/4gMng/sf_4g_lpa.c b/code/application/source/sf_app/code/source/4gMng/sf_4g_lpa.c index fec90dc9c..9f06a23b2 100755 --- a/code/application/source/sf_app/code/source/4gMng/sf_4g_lpa.c +++ b/code/application/source/sf_app/code/source/4gMng/sf_4g_lpa.c @@ -3470,6 +3470,38 @@ void sf_network_switch(void) pthread_create(&tNetWorkSeclectTask,NULL,sf_network_switch_thread,NULL); } +SINT32 sf_lpa_get_esim_iccid(SF_CHAR iccid[][22]) +{ + UINT8 iccidStr[2 * LPA_PROFILE_ICCID_BUFFER_MAX_SIZE + 1] = {0}; + UINT8 indexProfile = 0; + + if(iccid == NULL) + { + return SF_FAILURE; + } + + for (indexProfile = 0; indexProfile < getProfilesInfo.countProfileInfo; indexProfile++) + { + if(strstr(ProfileData[indexProfile].profileName, "ATT")) + { + SampleLPA_GetIccidStr(iccidStr, ProfileData[indexProfile].iccid, ProfileData[indexProfile].iccidSize); + SF_STRCPY(iccid[1], iccidStr); + SLOGI("ATT-Iccid:%s\n", iccid[1]); + } + else if(strstr(ProfileData[indexProfile].profileName, "Verizon")) + { + SampleLPA_GetIccidStr(iccidStr, ProfileData[indexProfile].iccid, ProfileData[indexProfile].iccidSize); + SF_STRCPY(iccid[0], iccidStr); + SLOGI("Version-Iccid:%s\n", iccid[0]); + } + + } + + + + return SF_SUCCESS; +} + #endif 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 b4bc41570..51c1d8de1 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 @@ -1334,6 +1334,7 @@ static SINT32 app_Register_Net_startup_mode(SF_FN_PARAM_S *pfnParam) { SINT32 s32ret = 0; SF_CHAR simICCID[24] = { 0 }; + SF_CHAR simIccidTmp[2][22] = {{0}}; SF_CHAR eid[40] = {0}; SF_CHAR sim4gApn[40] = {0}; UIMenuStoreInfo *pCustomerParam = sf_app_ui_para_get(); @@ -1426,6 +1427,10 @@ static SINT32 app_Register_Net_startup_mode(SF_FN_PARAM_S *pfnParam) } #endif + sf_lpa_get_esim_iccid(simIccidTmp); + snprintf((char *)pCustomerParam->SimIccidV, sizeof(pCustomerParam->SimIccidV), (char *)simIccidTmp[0]); + snprintf((char *)pCustomerParam->SimIccidA, sizeof(pCustomerParam->SimIccidA), (char *)simIccidTmp[1]); + s32ret = sf_4G_register_net_manual(pfnParam); //sf_share_mem_customer_down(1); SF_APPCOMM_CHECK_RETURN(s32ret, s32ret); @@ -1682,7 +1687,10 @@ static SINT32 app_Register_Net_startup_mode(SF_FN_PARAM_S *pfnParam) #endif - + sf_lpa_get_esim_iccid(simIccidTmp); + snprintf((char *)pCustomerParam->SimIccidV, sizeof(pCustomerParam->SimIccidV), (char *)simIccidTmp[0]); + snprintf((char *)pCustomerParam->SimIccidA, sizeof(pCustomerParam->SimIccidA), (char *)simIccidTmp[1]); + s32ret = sf_4G_register_net_manual(pfnParam); if(pCustomerParam->ProfileSwitchFlg) 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 854adf5de..4e2144af7 100755 --- a/code/lib/source/sifar/code/source/common/sf_common.c +++ b/code/lib/source/sifar/code/source/common/sf_common.c @@ -2511,7 +2511,7 @@ void sf_save_camera_info(void) sf_get_wifi_ssid(wifissid); SF_SPRINTF(temp, "IMEI:%s\r\nSoftwareVER:%s\r\nModuleVER:%s\r\nMcuVER:%s\r\nICCID:%s\r\nICCID-A:%s\r\nICCID-V:%s\r\nSSID:%s\r\nBLE:%s\r\n", - puiPara->ModuleImei, localver, puiPara->ModuleSubver, mcuver, puiPara->SimIccid, puiPara->SimIccid, puiPara->SimIccid, wifissid,puiPara->BluSsid); + puiPara->ModuleImei, localver, puiPara->ModuleSubver, mcuver, puiPara->SimIccid, puiPara->SimIccidA, puiPara->SimIccidV, wifissid,puiPara->BluSsid); if(access((char*)SF_CAMERA_INFO_FILENAME, F_OK) == 0) { diff --git a/rtos/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UIInfo.h b/rtos/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UIInfo.h index aee1f734b..57ec75684 100755 --- a/rtos/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UIInfo.h +++ b/rtos/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UIInfo.h @@ -576,6 +576,8 @@ typedef struct _UIMenuUIMenuStoreInfo { UINT32 FileKey; CHAR BluSsid[14]; CHAR BluSwitch;/*OFF/ON*/ + CHAR SimIccidV[21]; + CHAR SimIccidA[21]; UINT32 x1; UINT32 x2; UINT32 x3;