From 4a7e9058555d89ca536f7655f9ed8802625afbfd Mon Sep 17 00:00:00 2001 From: payton Date: Tue, 14 Nov 2023 19:21:44 +0800 Subject: [PATCH] =?UTF-8?q?1.4G=E6=A0=87=E8=AF=86=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sf_app/code/source/4gMng/sf_eg91_sim.c | 46 +++++++++++++------ 1 file changed, 31 insertions(+), 15 deletions(-) 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 index cd12b26c8..f2f0330f7 100755 --- 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 @@ -42,7 +42,7 @@ BOOL GprsNetWorkReady = FALSE; time_t sendStartTime; UINT8 gprs_search_process = GPRS_SEARCH_STEP_IDLE; extern SF_PARA_TIME_S rtcTime; - +CHAR netGeneration = SF_NET_NO; // SF_PARA_TIME_S nowDate = { 0, 0, 0, 0, 0, 0}; typedef struct sf_cimi_id @@ -3696,7 +3696,8 @@ SINT32 sf_net_regist_manual(void) { if(strstr((const char *)gsmPara, "No Service")) { - puiPara->NetGeneration = 2; + //puiPara->NetGeneration = 2; + netGeneration = 2; } else if(NULL != strtok((char *)(char *)gsmPara, "\"")) { @@ -3705,24 +3706,31 @@ SINT32 sf_net_regist_manual(void) if((strstr((const char *)netStr, "DD") != NULL)) { - puiPara->NetGeneration = 4; + //puiPara->NetGeneration = 4; + netGeneration = 4; } else if(strstr((const char *)netStr, "CDMA") != NULL || strstr((const char *)netStr, "HDR") != NULL || strstr((const char *)netStr, "HSUPA") != NULL || strstr((const char *)netStr, "HSDPA") != NULL || (strstr((const char *)netStr, "HSPA+") != NULL)) { - puiPara->NetGeneration = 3; + //puiPara->NetGeneration = 3; + netGeneration = 3; } else if(strstr((const char *)netStr, "CMDA") != NULL || strstr((const char *)netStr, "G") != NULL) { - puiPara->NetGeneration = 2; + //puiPara->NetGeneration = 2; + netGeneration = 2; } else { - puiPara->NetGeneration = 2; + // puiPara->NetGeneration = 2; + netGeneration = 2; } } - - if(puiPara->NetGeneration == 4) + if(puiPara->NetGeneration != netGeneration) + { + puiPara->NetGeneration = netGeneration; + } + if(netGeneration == 4) { eNetRegLocation = QUECTEL_NETREG_QCSQ; strcpy((char *)gsmPara, "AT+QCSQ\r"); @@ -4311,7 +4319,8 @@ SINT32 sf_auto_net_reg(void) { if(strstr((const char *)gsmPara, "No Service")) { - puiPara->NetGeneration = 2; + //puiPara->NetGeneration = 2; + netGeneration = 2; } else if(NULL != strtok((char *)(char *)gsmPara, "\"")) { @@ -4320,24 +4329,31 @@ SINT32 sf_auto_net_reg(void) if((strstr((const char *)netStr, "DD") != NULL)) { - puiPara->NetGeneration = 4; + // puiPara->NetGeneration = 4; + netGeneration = 4; } else if(strstr((const char *)netStr, "CDMA") != NULL || strstr((const char *)netStr, "HDR") != NULL || strstr((const char *)netStr, "HSUPA") != NULL || strstr((const char *)netStr, "HSDPA") != NULL || (strstr((const char *)netStr, "HSPA+") != NULL)) { - puiPara->NetGeneration = 3; + // puiPara->NetGeneration = 3; + netGeneration = 3; } else if(strstr((const char *)netStr, "CMDA") != NULL || strstr((const char *)netStr, "G") != NULL) { - puiPara->NetGeneration = 2; + // puiPara->NetGeneration = 2; + netGeneration = 2; } else { - puiPara->NetGeneration = 2; + // puiPara->NetGeneration = 2; + netGeneration = 2; } } - - if(puiPara->NetGeneration == 4) + if(puiPara->NetGeneration != netGeneration) + { + puiPara->NetGeneration = netGeneration; + } + if(netGeneration == 4) { eNetRegLocation = QUECTEL_NETREG_QCSQ; strcpy((char *)gsmPara, "AT+QCSQ\r");