1.4G标识优化

This commit is contained in:
payton 2023-11-14 19:21:44 +08:00
parent d7e783bdc6
commit 4a7e905855

View File

@ -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");