Merge "[Feature][T106][task-view-107] sometimes qser_nw_get_reg_status value error in 3g"
diff --git a/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/ril/reference-ril/ril_mm.c b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/ril/reference-ril/ril_mm.c
index 34d4d1b..b8c31ce 100755
--- a/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/ril/reference-ril/ril_mm.c
+++ b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/ril/reference-ril/ril_mm.c
@@ -139,6 +139,7 @@
 		break;

 

 	case 6:

+	case 8://add by hq for bug 107 at 20240822

 		sprintf(state, "%d", RADIO_TECH_HSPA);

 		break;

 	/*LTE*/

@@ -460,8 +461,8 @@
 	char* pZeminfo;

 	T_zEM_EmInfo_Ind* pEmInfo_Ind = NULL;

 

-	char smcc[16] = {0};

-	char smnc[16] = {0};

+	char smcc[4] = {0};//modify by hq for bug 107 at 20240811

+	char smnc[4] = {0};//modify by hq for bug 107 at 20240811

 

 	pZeminfo = alloca(strlen(at_paras) / 2);

 	hexStr2ByteArr(at_paras, pZeminfo);

@@ -484,10 +485,11 @@
 		ci[0].registered = 1;

 		ci[0].timeStamp = curTime;

 

-		sprintf(smcc, "%d%d%d", pNasInfo->tPlmnId.bMCC1, pNasInfo->tPlmnId.bMCC2, pNasInfo->tPlmnId.bMCC3);

+		

+		snprintf(smcc, 4, "%x%x%x", pNasInfo->tPlmnId.bMCC1, pNasInfo->tPlmnId.bMCC2, pNasInfo->tPlmnId.bMCC3); //modify by hq for bug 107 at 20240811

 		smcc[3] = '\0';

-		sprintf(smnc, "%d%d", pNasInfo->tPlmnId.bMNC1, pNasInfo->tPlmnId.bMNC2);

-		smnc[2] = '\0';

+		snprintf(smnc, 3, "%x%x", pNasInfo->tPlmnId.bMNC1, pNasInfo->tPlmnId.bMNC2); //modify by hq for bug 107 at 20240811

+		smnc[2] = '\0';		

 		plte->cellIdentityLte.mcc = atoi(smcc);

 		plte->cellIdentityLte.mnc = atoi(smnc);

 		plte->cellIdentityLte.ci = tScellInfo->dwCellId; //Ð¡ÇøID

@@ -518,6 +520,10 @@
 		plte->signalStrengthLte.rssnr = getRssnr();

 		plte->signalStrengthLte.cqi = 0x7FFFFFFF;

 		plte->signalStrengthLte.timingAdvance = 0x7FFFFFFF;

+		RLOGD("parseCellInfo lte mcc:%d, mnc:%d, ci:%d, pci:%d, tac:%d, earfcn:%d, signalStrength:%d, rsrp:%d, rsrq:%d, rssnr:%d", 

+            plte->cellIdentityLte.mcc, plte->cellIdentityLte.mnc, plte->cellIdentityLte.ci,plte->cellIdentityLte.pci, plte->cellIdentityLte.tac, plte->cellIdentityLte.earfcn, 

+            plte->signalStrengthLte.signalStrength, plte->signalStrengthLte.rsrp, plte->signalStrengthLte.rsrq,plte->signalStrengthLte.rssnr); //add by hq for bug 107 at 20240811

+			  

 	} else if (pEmInfo_Ind->bRatType == 4) {

 		RIL_CellInfoGsm     *gsm = &ci[0].CellInfo.gsm;

 		T_zEm_Gsm_EmInfo_Ind   *tGsmEmInfo = &pEmInfo_Ind->uEmInfo.tGsmEmInfo;

@@ -529,9 +535,10 @@
 		ci[0].registered = 1;

 		ci[0].timeStamp = curTime;

 

-		snprintf(smcc, 3, "%d%d%d", tNasInfo->tPlmn.bMCC1, tNasInfo->tPlmn.bMCC2, tNasInfo->tPlmn.bMCC3);

+		

+		snprintf(smcc, 4, "%x%x%x", tNasInfo->tPlmn.bMCC1, tNasInfo->tPlmn.bMCC2, tNasInfo->tPlmn.bMCC3);//modify by hq for bug 107 at 20240822

 		smcc[3] = '\0';

-		snprintf(smnc, 2, "%d%d", tNasInfo->tPlmn.bMNC1, tNasInfo->tPlmn.bMNC2);

+		snprintf(smnc, 3, "%x%x", tNasInfo->tPlmn.bMNC1, tNasInfo->tPlmn.bMNC2);//modify by hq for bug 107 at 20240822

 		smnc[2] = '\0';

 		gsm->cellIdentityGsm.mcc = atoi(smcc);

 		gsm->cellIdentityGsm.mnc = atoi(smnc);

@@ -549,6 +556,9 @@
 		}

 		gsm->signalStrengthGsm.bitErrorRate = 99;

 		gsm->signalStrengthGsm.timingAdvance = 0x7FFFFFFF;

+		RLOGD("parseCellInfo gsm mcc:%d, mnc:%d, lac:%d, cid:%d, signalStrength:%d", 

+               gsm->cellIdentityGsm.mcc, gsm->cellIdentityGsm.mnc, gsm->cellIdentityGsm.lac,gsm->cellIdentityGsm.cid, 

+               gsm->signalStrengthGsm.signalStrength);//add by hq for bug 107 at 20240822

 	} else if (pEmInfo_Ind->bRatType == 2) {

 		RIL_CellInfoWcdma     *pwcdma = &ci[0].CellInfo.wcdma;

 		T_zEm_W_EmInfo_Ind   *twcdmaEmInfo = &pEmInfo_Ind->uEmInfo.tWEmInfo;

@@ -562,9 +572,9 @@
 		//RLOGD("parseCellInfo wcdma bMCC1:%d, bMCC2:%d, bMCC3:%d", pNasInfo->tPlmn.bMCC1, pNasInfo->tPlmn.bMCC2, pNasInfo->tPlmn.bMCC3);

 		//RLOGD("parseCellInfo wcdma bMNC1:%d, bMNC2:%d", pNasInfo->tPlmn.bMNC1, pNasInfo->tPlmn.bMNC2);

 

-		snprintf(smcc, 4, "%d%d%d", pNasInfo->tPlmn.bMCC1, pNasInfo->tPlmn.bMCC2, pNasInfo->tPlmn.bMCC3);

+		snprintf(smcc, 4, "%x%x%x", pNasInfo->tPlmn.bMCC1, pNasInfo->tPlmn.bMCC2, pNasInfo->tPlmn.bMCC3);	//modify by hq for bug 107 at 20240822

 		smcc[3] = '\0';

-		snprintf(smnc, 3, "%d%d", pNasInfo->tPlmn.bMNC1, pNasInfo->tPlmn.bMNC2);

+		snprintf(smnc, 3, "%x%x", pNasInfo->tPlmn.bMNC1, pNasInfo->tPlmn.bMNC2);	//modify by hq for bug 107 at 20240822

 		smnc[2] = '\0';

 

 		//RLOGD("parseCellInfo wcdma smcc:%s, smnc:%s", smcc, smnc);

@@ -604,7 +614,9 @@
 			pwcdma->signalStrengthWcdma.bitErrorRate = twcdmaEmInfo->uWcellMeasInfo.tNotDchInfo.tFddSCellReselInfo.tScellInfo.bEcNo;

 		}

 

-		//RLOGD("parseCellInfo wcdma psc: %d, signalStrength:%d, bitErrorRate:%d", pwcdma->cellIdentityWcdma.psc, pwcdma->signalStrengthWcdma.signalStrength, pwcdma->signalStrengthWcdma.bitErrorRate);

+		RLOGD("parseCellInfo wcdma mcc:%d, mnc:%d, lac:%d, cid:%d, psc: %d, signalStrength:%d, bitErrorRate:%d", 

+		       pwcdma->cellIdentityWcdma.mcc, pwcdma->cellIdentityWcdma.mnc, pwcdma->cellIdentityWcdma.lac, pwcdma->cellIdentityWcdma.cid, pwcdma->cellIdentityWcdma.psc, 

+		       pwcdma->signalStrengthWcdma.signalStrength, pwcdma->signalStrengthWcdma.bitErrorRate);//add by hq for bug 107 at 20240822

 	} else if (pEmInfo_Ind->bRatType == 1) {

 		ci[0].cellInfoType = RIL_CELL_INFO_TYPE_TD_SCDMA;

 		ci[0].registered = 1;