From de6ac0bbc4565789f41dc2a8f9f8f037b56dca18 Mon Sep 17 00:00:00 2001 From: payton Date: Fri, 11 Aug 2023 10:39:24 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81=EF=BC=8C?= =?UTF-8?q?=E4=BB=A5=E5=85=8Dapp=E5=B4=A9=E6=BA=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sf_app/code/source/4gMng/sf_eg91_sim.c | 36 ++++++++++--------- 1 file changed, 20 insertions(+), 16 deletions(-) mode change 100644 => 100755 code/application/source/sf_app/code/source/4gMng/sf_eg91_sim.c diff --git a/code/application/source/sf_app/code/source/4gMng/sf_eg91_sim.c b/code/application/source/sf_app/code/source/4gMng/sf_eg91_sim.c old mode 100644 new mode 100755 index bc819bb94..48b208d0c --- a/code/application/source/sf_app/code/source/4gMng/sf_eg91_sim.c +++ b/code/application/source/sf_app/code/source/4gMng/sf_eg91_sim.c @@ -2325,10 +2325,11 @@ SINT32 sf_module_complete_init(void) UIMenuStoreInfo *puiPara = sf_app_ui_para_get(); - SLOGD(" s"); + SLOGD(" s\n"); //needRecordLogFlag = 1; puiPara->NetGeneration = SF_NET_NO; + sf_gsm_para_buff_clear(); while(sf_app_while_flag()) { @@ -2369,7 +2370,7 @@ SINT32 sf_module_complete_init(void) sf_test_code_err(eNetRegLocation, "test"); #endif - if(strstr((const char *)gsmPara, "OK")) + if(strstr((const char *)gsmPara, "OK") && (strstr((const char *)gsmPara, "AT+GSN"))) { delim = " \r\n"; pTemp = strtok((char *)strstr((const char *)gsmPara, "AT+GSN"), delim); @@ -2382,8 +2383,10 @@ SINT32 sf_module_complete_init(void) mm++; pTemp = strtok((char *)0, delim); } - strcpy((char *)strNow, (const char *)strtmp[1]); - SLOGD("strNow=%s,strSave=%s", strNow, strSave); + snprintf((char *)strNow, sizeof(strNow), "%s", (const char *)strtmp[1]); + + //strcpy((char *)strNow, (const char *)strtmp[1]); + SLOGD("strNow=%s,strSave=%s\n", strNow, strSave); if((strNow[0] != '\0') && (strncmp((char *)strNow, (char *)strSave, MODULE_IMEI_LEN) == 0)) { @@ -2394,7 +2397,7 @@ SINT32 sf_module_complete_init(void) puiPara->DailyReportTime.Min = ((UINT16)(puiPara->ModuleImei[13]-48)*10+(puiPara->ModuleImei[14]-48))%60; SLOGI(puiPara->ModuleImei); - SF_DEBUG("ModuleImei=%s", puiPara->ModuleImei); + SF_DEBUG("ModuleImei=%s\n", puiPara->ModuleImei); } eNetRegLocation = QUECTEL_NETREG_ATI; @@ -2431,7 +2434,7 @@ SINT32 sf_module_complete_init(void) case QUECTEL_NETREG_ATI: - if(strstr((const char *)gsmPara, "OK")) + if(strstr((const char *)gsmPara, "OK") && (strstr((const char *)gsmPara, "Revision"))) { delim = " \r\n"; pTemp = strtok((char *)strstr((const char *)gsmPara, "Revision"), delim); @@ -2446,7 +2449,7 @@ SINT32 sf_module_complete_init(void) } strcpy((char *)puiPara->ModuleVer, (const char *)strtmp[1]); - SF_DEBUG("ModuleVer=%s", puiPara->ModuleVer); + SF_DEBUG("ModuleVer=%s\n", puiPara->ModuleVer); if(strstr(puiPara->ModuleVer, GPRS_MODULE_TYPE_EG915Q)){ at_manager_init(AT_MODULE_TYPE_EG915Q, sf_hal_ttyusb2_read, sf_hal_ttyusb2_write); } @@ -2950,7 +2953,7 @@ SINT32 sf_module_complete_init(void) case QUECTEL_NETREG_QCCID: - if(strstr((const char *)gsmPara, "OK")) + if(strstr((const char *)gsmPara, "OK") && (strstr((const char *)gsmPara, "+QCCID:"))) { delim = " \r\n"; pTemp = strtok((char *)strstr((const char *)gsmPara, "+QCCID:"), delim); @@ -2964,7 +2967,7 @@ SINT32 sf_module_complete_init(void) pTemp = strtok((char *)0, delim); } strcpy((char *)strNow, (const char *)strtmp[1]); - SLOGD("strNow=%s,strSave=%s", strNow, strSave); + SLOGD("strNow=%s,strSave=%s\n", strNow, strSave); if((strNow[0] != '\0') && (strncmp((char *)strNow, (char *)strSave, MODULE_ICCID_LEN) == 0)) { @@ -2972,7 +2975,7 @@ SINT32 sf_module_complete_init(void) { memset(puiPara->SimIccid, '\0', sizeof(puiPara->SimIccid)); strncpy((char *)puiPara->SimIccid, (const char *)strNow, MODULE_ICCID_LEN); - SF_DEBUG("SimIccid=%s", puiPara->SimIccid); + SF_DEBUG("SimIccid=%s\n", puiPara->SimIccid); } goto SF_MODULE_END; @@ -3061,7 +3064,7 @@ SINT32 sf_net_regist_manual(void) UIMenuStoreInfo *puiPara = sf_app_ui_para_get(); - SF_LOG(" s"); + SF_LOG(" s\n"); #if MEGA_TEST @@ -3072,6 +3075,7 @@ SINT32 sf_net_regist_manual(void) #endif + sf_gsm_para_buff_clear(); while(sf_app_while_flag()) { @@ -3404,7 +3408,7 @@ SINT32 sf_net_regist_manual(void) case QUECTEL_NETREG_CIMI_2: - if(strstr((const char *)gsmPara, "OK")) + if(strstr((const char *)gsmPara, "OK") && (strstr((const char *)gsmPara, "AT+CIMI"))) { delim = " \r\n"; pTemp = strtok((char *)strstr((const char *)gsmPara, "AT+CIMI"), delim); @@ -3623,7 +3627,7 @@ SINT32 sf_net_regist_manual(void) case QUECTEL_NETREG_CSQ: - if(strstr((const char *)gsmPara, "OK")) + if(strstr((const char *)gsmPara, "OK") && (strstr((const char *)gsmPara, "+CSQ:"))) { delim = " ,\r\n"; pTemp = strtok((char *)strstr((const char *)gsmPara, "+CSQ:"), delim); @@ -3794,7 +3798,7 @@ SINT32 sf_auto_net_reg(void) UIMenuStoreInfo *puiPara = sf_app_ui_para_get(); - SF_LOG(" s"); + SF_LOG(" s\n"); //needRecordLogFlag = 1; puiPara->NetGeneration = 0; @@ -4035,7 +4039,7 @@ SINT32 sf_auto_net_reg(void) case QUECTEL_NETREG_CIMI_2: - if(strstr((const char *)gsmPara, "OK")) + if(strstr((const char *)gsmPara, "OK") && (strstr((const char *)gsmPara, "AT+CIMI"))) { delim = " \r\n"; pTemp = strtok((char *)strstr((const char *)gsmPara, "AT+CIMI"), delim); @@ -4215,7 +4219,7 @@ SINT32 sf_auto_net_reg(void) case QUECTEL_NETREG_CSQ: - if(strstr((const char *)gsmPara, "OK")) + if(strstr((const char *)gsmPara, "OK") && (strstr((const char *)gsmPara, "+CSQ:"))) { delim = " ,\r\n"; pTemp = strtok((char *)strstr((const char *)gsmPara, "+CSQ:"), delim);