[e-sim]1.切网调试,目前eg915上读取profile失败

2.eg91模块执行at+qnvfr优化,强制匹配EG91VX和EG95VX
This commit is contained in:
alisa 2023-08-30 23:33:48 +08:00
parent 95d1d07f69
commit 962968f81a
8 changed files with 77 additions and 22 deletions

View File

@ -28,6 +28,9 @@
#include "sf_sd_common.h" #include "sf_sd_common.h"
#endif #endif
#include "sf_sd_common.h"
#include "sf_message_queue.h"
#include "sf_param_enum.h"
#if 0 #if 0
#include "rtc.h" #include "rtc.h"
@ -239,10 +242,14 @@ UINT32 DrvKey_DetNormalKey(void)
sf_save_camera_info(); sf_save_camera_info();
vos_perf_mark(&ttick); vos_perf_mark(&ttick);
} }
else if((0 == cmdflag) && (time == 20000)) else if((0 == cmdflag) && (time >= 20000))
{ {
cmdflag = 1; cmdflag = 1;
printf("[%s:%d] SendKeyCnt:%d KeyTestPressCnt:%d time: %dms\n", __FUNCTION__, __LINE__, SendKeyCnt, KeyTestPressCnt, time); printf("[%s:%d] SendKeyCnt:%d KeyTestPressCnt:%d time: %dms\n", __FUNCTION__, __LINE__, SendKeyCnt, KeyTestPressCnt, time);
SF_MESSAGE_BUF_S stMessageBuf = {0};
stMessageBuf.arg1 = SF_DEV_CMD_ESIM_OPERATION_SWTICH;
stMessageBuf.cmdId = CMD_DEV;
sf_com_message_send_to_app(&stMessageBuf);
//sf_network_switch(); //sf_network_switch();
} }
@ -251,16 +258,20 @@ UINT32 DrvKey_DetNormalKey(void)
if(KeyTestPressCnt && (0 == sf_get_fw_update())){ if(KeyTestPressCnt && (0 == sf_get_fw_update())){
if((!cmdflag) && (time >= 3000) && (sf_get_pir_statu_flag())){ if((!cmdflag) && (time >= 3000) && (sf_get_pir_statu_flag())){
printf("[%s:%d] SendKeyCnt:%d KeyTestPressCnt:%d time: %dms\n", __FUNCTION__, __LINE__, SendKeyCnt, KeyTestPressCnt, time);
cmdflag = 1; cmdflag = 1;
//sf_set_card_statu(CMD_FORMAT_SD_STA); //sf_set_card_statu(CMD_FORMAT_SD_STA);
//BKG_PostEvent(NVTEVT_BKW_FORMAT_CARD); //BKG_PostEvent(NVTEVT_BKW_FORMAT_CARD);
}else if((!cmdflag) && (time >= 10000) && (FALSE == sf_check_net_work_flag()) && (!sf_get_pir_statu_flag())){ }else if((!cmdflag) && (time >= 10000) && (FALSE == sf_check_net_work_flag()) && (!sf_get_pir_statu_flag())){
printf("[%s:%d] SendKeyCnt:%d KeyTestPressCnt:%d time: %dms\n", __FUNCTION__, __LINE__, SendKeyCnt, KeyTestPressCnt, time);
cmdflag = 1; cmdflag = 1;
sf_set_module_update(1); sf_set_module_update(1);
}else if((++SendKeyCnt < SendKey_LessCnt) && (!cmdflag)){//shot key }else if((++SendKeyCnt < SendKey_LessCnt) && (!cmdflag)){//shot key
printf("[%s:%d] SendKeyCnt:%d KeyTestPressCnt:%d time: %dms\n", __FUNCTION__, __LINE__, SendKeyCnt, KeyTestPressCnt, time);
uiKeyCode |= FLGKEY_SHUTTER2; uiKeyCode |= FLGKEY_SHUTTER2;
}else { }else {
printf("[%s:%d] SendKeyCnt:%d KeyTestPressCnt:%d time: %dms\n", __FUNCTION__, __LINE__, SendKeyCnt, KeyTestPressCnt, time); printf("[%s:%d] SendKeyCnt:%d KeyTestPressCnt:%d time: %dms\n", __FUNCTION__, __LINE__, SendKeyCnt, KeyTestPressCnt, time);
SendKeyCnt = 0; SendKeyCnt = 0;
KeyTestPressCnt = 0; KeyTestPressCnt = 0;
timeflag = 0; timeflag = 0;

View File

@ -515,6 +515,9 @@ typedef enum _SF_DEV_CMD_STEP_e{
SF_DEV_CMD_TEMPER = 0x0, SF_DEV_CMD_TEMPER = 0x0,
SF_DEV_CMD_BAT = 0x1, SF_DEV_CMD_BAT = 0x1,
SF_DEV_CMD_4G_USB_RM = 0x2, SF_DEV_CMD_4G_USB_RM = 0x2,
SF_DEV_CMD_ESIM_OPERATION_SCAN = 0x3,
SF_DEV_CMD_ESIM_OPERATION_SELECT = 0x4,
SF_DEV_CMD_ESIM_OPERATION_SWTICH = 0x5,
SF_DEV_CMD_BUTT SF_DEV_CMD_BUTT
} SF_DEV_CMD_STEP_e; } SF_DEV_CMD_STEP_e;

View File

@ -2771,6 +2771,7 @@ UINT8 sf_check_network_status(void)
errCode = NETWORK_NO_SIM; errCode = NETWORK_NO_SIM;
} }
#if 0
//NetworkScan = TRUE; //NetworkScan = TRUE;
while(!sf_get_simcard_ready()) while(!sf_get_simcard_ready())
{ {
@ -2782,18 +2783,21 @@ UINT8 sf_check_network_status(void)
errCode = NETWORK_NO_SIM; errCode = NETWORK_NO_SIM;
return errCode; return errCode;
} }
#endif
while(!sf_is_esim_init_finish()) while(!sf_is_esim_init_finish())
{ {
usleep(100*1000); usleep(100*1000);
} }
SLOGD("\n");
/*adjust the module is not reset status*/ /*adjust the module is not reset status*/
while(sf_get_module_reset_flag()) while(sf_get_module_reset_flag())
{ {
usleep(100*1000); usleep(100*1000);
} }
SLOGD("\n");
if(!sf_is_esim_card()) if(!sf_is_esim_card())
errCode = NETWORK_SIM_NOT_SUPPORTED; errCode = NETWORK_SIM_NOT_SUPPORTED;
@ -3238,7 +3242,7 @@ void sf_network_select(UINT8 profileId)
void sf_network_switch_thread() void sf_network_switch_thread()
{ {
printf("switch network.\n"); SLOGD("switch network.\n");
UINT32 ret = SF_LPA_SUCCESS; UINT32 ret = SF_LPA_SUCCESS;
UINT32 sts = 0; UINT32 sts = 0;
UINT32 retryTime=0; UINT32 retryTime=0;
@ -3248,10 +3252,10 @@ void sf_network_switch_thread()
LPA_API_ERROR lpaErrCode = LPA_NO_ERROR; LPA_API_ERROR lpaErrCode = LPA_NO_ERROR;
errCode = sf_check_network_status(); errCode = sf_check_network_status();
SLOGE("errCode:%x\n", errCode);
if(errCode == CMD_SUCCESS) if(errCode == CMD_SUCCESS)
{ {
if(sf_get_active_profile_next_index(&profileId) == FALSE) if(sf_get_active_profile_next_index(&profileId) == FALSE)
{ {
profileId = 0; profileId = 0;

View File

@ -2664,6 +2664,7 @@ SINT32 sf_module_complete_init(void)
else if(strstr((const char *)gsmPara, "+QSIMSTAT: 0,1")) else if(strstr((const char *)gsmPara, "+QSIMSTAT: 0,1"))
{ {
eNetRegLocation = QUECTEL_NETREG_DBGCTL; eNetRegLocation = QUECTEL_NETREG_DBGCTL;
sf_set_sim_insert(1);
if(puiPara->QLogSwitch) if(puiPara->QLogSwitch)
{ {
@ -3263,8 +3264,9 @@ SINT32 sf_net_regist_manual(void)
{ {
SF_LOG("operation info manual set,default success.\n"); SF_LOG("operation info manual set,default success.\n");
} }
SF_LOG("puiPara->ModuleVer:%s\n",puiPara->ModuleVer);
if((strstr((const char *)puiPara->Sim4gApn, APN_4G_VERIZON)) && ((SF_STRNCMP(puiPara->ModuleVer, GPRS_MODULE_TYPE_EG915Q, 6) != 0))) if((strstr((const char *)puiPara->Sim4gApn, APN_4G_VERIZON)) && ((SF_STRNCMP(puiPara->ModuleVer, GPRS_MODULE_TYPE_EG91_V, 6) == 0)) \
&& ((SF_STRNCMP(puiPara->ModuleVer, GPRS_MODULE_TYPE_EG95_V, 6) == 0)))
{ {
eNetRegLocation = QUECTEL_NETREG_QNVFW; eNetRegLocation = QUECTEL_NETREG_QNVFW;
sprintf((char *)gsmPara, "%s", "at+qnvfr=\"/nv/item_files/modem/uim/gstk/feature_bmsk\"\r"); sprintf((char *)gsmPara, "%s", "at+qnvfr=\"/nv/item_files/modem/uim/gstk/feature_bmsk\"\r");
@ -3340,7 +3342,13 @@ SINT32 sf_net_regist_manual(void)
} }
else else
{ {
eNetRegLocation = QUECTEL_NETREG_MODULE_RESTART; //eNetRegLocation = QUECTEL_NETREG_MODULE_RESTART;
eNetRegLocation = QUECTEL_SEARCH_IPV4V6;
sprintf((char *)gsmPara, "%s", "AT+QICSGP=1\r");
ttyRet = sf_hal_ttyusb2_write(gsmPara, strlen((const char *)gsmPara));
SF_CHECK_RETURN(ttyRet, SF_GPRS_MODULE_ERROR_WRITE);
//ttyData.cmp = "OK";
ttyData.len = strlen(gsmPara) + 2;
} }
break; break;

View File

@ -103,7 +103,7 @@ int main(int argc, char *argv[])
{ {
printf("*********************************************\n"); printf("*********************************************\n");
printf("* *\n"); printf("* *\n");
printf("* sf_app-v1 *\n"); printf("* sf_app-v3 *\n");
printf("* *\n"); printf("* *\n");
printf("*********************************************\n"); printf("*********************************************\n");
//gpio_direction_input(C_GPIO(10)); //gpio_direction_input(C_GPIO(10));

View File

@ -19,7 +19,7 @@
#include <linux/msdos_fs.h> #include <linux/msdos_fs.h>
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <pthread.h> #include <pthread.h>
#include "sf_4g_lpa.h"
#ifdef __cplusplus #ifdef __cplusplus
#if __cplusplus #if __cplusplus
@ -897,6 +897,26 @@ static SINT32 sf_app_proccess_cmd_dev(SF_MESSAGE_BUF_S *pMessageBuf)
MLOGE("-------ttyUSB deinit fail!\n"); MLOGE("-------ttyUSB deinit fail!\n");
} }
break; break;
case SF_DEV_CMD_ESIM_OPERATION_SCAN:
MLOGI("SF_DEV_CMD_ESIM_OPERATION_SCAN\n");
sf_set_wifi_socket(pMessageBuf->arg2);
sf_set_wifi_cmd(0x3b);//WIFI_CONTROL_CAMERA_Network_Scan
sf_4g_operator_scan(pMessageBuf->arg3);
break;
case SF_DEV_CMD_ESIM_OPERATION_SELECT:
MLOGI("SF_DEV_CMD_ESIM_OPERATION_SELECT\n");
sf_set_wifi_socket(pMessageBuf->arg2);
sf_set_wifi_cmd(0x3c);//WIFI_CONTROL_CAMERA_Network_Select
sf_network_select(pMessageBuf->arg3);
break;
case SF_DEV_CMD_ESIM_OPERATION_SWTICH:
MLOGI("SF_DEV_CMD_ESIM_OPERATION_SWTICH\n");
sf_network_switch();
default: default:
break; break;
} }

View File

@ -57,7 +57,7 @@
#include "Mode/UIModeMovie.h" #include "Mode/UIModeMovie.h"
#include "sf_log.h" #include "sf_log.h"
#include "DCF.h" #include "DCF.h"
#if SF_LPA_SDK #if 0//SF_LPA_SDK
#include "lpasdk/api/lpasdk_api.h" #include "lpasdk/api/lpasdk_api.h"
#include "sf_4g_lpa.h" #include "sf_4g_lpa.h"
#endif #endif
@ -1064,6 +1064,7 @@ SINT32 sf_svr_packet_proc(SINT32 fd, UINT8 *pAppData, UINT16 dataLen)
UIMenuStoreInfo *puiPara = sf_ui_para_get(); UIMenuStoreInfo *puiPara = sf_ui_para_get();
UINT8 paraNeedReboot = 0; UINT8 paraNeedReboot = 0;
UINT8 paramSaveFlag = 0; UINT8 paramSaveFlag = 0;
SF_MESSAGE_BUF_S stMessageBuf = {0};
// HI_MESSAGE_S stMessage; // HI_MESSAGE_S stMessage;
//printf("[sf_svr_packet_proc]dataLen: %d\n",dataLen); //printf("[sf_svr_packet_proc]dataLen: %d\n",dataLen);
@ -2027,23 +2028,30 @@ SINT32 sf_svr_packet_proc(SINT32 fd, UINT8 *pAppData, UINT16 dataLen)
paramSaveFlag = 1; paramSaveFlag = 1;
respFlag = 2; respFlag = 2;
break; break;
#if 0 #if 1
SF_LPA_SDK //SF_LPA_SDK
extern void sf_4g_operator_scan(UINT8 mode); //extern void sf_4g_operator_scan(UINT8 mode);
extern void sf_network_select(UINT8 profileId); //extern void sf_network_select(UINT8 profileId);
case WIFI_CONTROL_CAMERA_Network_Scan: case WIFI_CONTROL_CAMERA_Network_Scan:
sf_set_wifi_socket(fd); //sf_set_wifi_socket(fd);
sf_set_wifi_cmd(WIFI_CONTROL_CAMERA_Network_Scan); //SF_MESSAGE_BUF_S stMessageBuf = {0};
sf_4g_operator_scan(pMsgStruct->msgBuf.ctrlNetworkScan.networkCtrl); stMessageBuf.arg1 = SF_DEV_CMD_ESIM_OPERATION_SCAN;
stMessageBuf.arg2 = fd;
stMessageBuf.arg3 = pMsgStruct->msgBuf.ctrlNetworkScan.networkCtrl;
stMessageBuf.cmdId = CMD_DEV;
sf_com_message_send_to_app(&stMessageBuf);
respFlag = 0; respFlag = 0;
break; break;
case WIFI_CONTROL_CAMERA_Network_Select: case WIFI_CONTROL_CAMERA_Network_Select:
sf_set_wifi_socket(fd); //SF_MESSAGE_BUF_S stMessageBuf = {0};
sf_set_wifi_cmd(WIFI_CONTROL_CAMERA_Network_Select); stMessageBuf.arg1 = SF_DEV_CMD_ESIM_OPERATION_SELECT;
sf_network_select(pMsgStruct->msgBuf.ctrlNetworkSelect.profileId); stMessageBuf.arg2 = fd;
stMessageBuf.arg3 = pMsgStruct->msgBuf.ctrlNetworkSelect.profileId;
stMessageBuf.cmdId = CMD_DEV;
sf_com_message_send_to_app(&stMessageBuf);
respFlag = 0; respFlag = 0;
break; break;
#endif #endif

View File

@ -60,6 +60,7 @@
#include <sf_param_struct.h> #include <sf_param_struct.h>
#include "UIAppNetwork.h" #include "UIAppNetwork.h"
#include "sf_mcu.h" #include "sf_mcu.h"
#include "sf_4g_lpa.h"
#include <sf_wifi_svr.h> #include <sf_wifi_svr.h>
#include <sf_log.h> #include <sf_log.h>