VOS_UINT32 At_SetLWThresholdCfgPara(VOS_UINT8 ucIndex) { VOS_UINT32 ulRet = ERR_MSP_SUCCESS; L4A_LW_THREASHOLD_CFG_REQ_STRU stReq = {0}; LPS_SWITCH_PARA_STRU stDrxControlFlag = {0}; stReq.stCtrl.ulClientId = gastAtClientTab[ucIndex].usClientId; stReq.stCtrl.ulOpId = 0; stReq.stCtrl.ulPid = WUEPS_PID_AT; stReq.ulFlag = gastAtParaList[0].ulParaValue; if(NV_OK != NVM_Read(EN_NV_ID_SWITCH_PARA, &stDrxControlFlag,sizeof(LPS_SWITCH_PARA_STRU))) { return AT_ERROR; } if( 0 == ((*((VOS_UINT32 * )(&(stDrxControlFlag.stPsFunFlag01)))) & LPS_NV_JP_DCOM_REL_OFFSET_BIT)) { return AT_OK; } /*L模调用如下接口转发*/ ulRet = atSendDataMsg(MSP_L4_L4A_PID, ID_MSG_L4A_LW_THRESHOLD_REQ, (VOS_VOID*)(&stReq), sizeof(L4A_LW_THREASHOLD_CFG_REQ_STRU)); if(ERR_MSP_SUCCESS == ulRet) { return AT_OK; } return AT_ERROR;
VOS_UINT32 AT_SetLFastDormPara(VOS_UINT8 ucIndex) { VOS_UINT32 ulRet = ERR_MSP_SUCCESS; L4A_SET_FAST_DORM_REQ_STRU stReq = {0}; LPS_SWITCH_PARA_STRU stDrxControlFlag = {0}; /* 参数检查在AT入口已做 */ stReq.stCtrl.ulClientId = gastAtClientTab[ucIndex].usClientId; stReq.stCtrl.ulOpId = 0; stReq.stCtrl.ulPid = WUEPS_PID_AT; stReq.ulFlag = gastAtParaList[0].ulParaValue; stReq.ulTimerLen = gastAtParaList[1].ulParaValue; if(NV_OK != NVM_Read(EN_NV_ID_SWITCH_PARA, &stDrxControlFlag,sizeof(LPS_SWITCH_PARA_STRU))) { return AT_ERROR; } if( 0 == ((*((VOS_UINT32 * )(&(stDrxControlFlag.stPsFunFlag01)))) & LPS_NV_JP_DCOM_FAST_DORM_BIT)) { return AT_OK; } /*L模调用如下接口转发*/ ulRet = atSendDataMsg(MSP_L4_L4A_PID, ID_MSG_L4A_FAST_DORM_REQ, (VOS_VOID*)(&stReq), sizeof(L4A_SET_FAST_DORM_REQ_STRU)); if(ERR_MSP_SUCCESS == ulRet) { return AT_OK; }
VOS_UINT32 At_SetLFromConnToIdlePara(VOS_UINT8 ucIndex) { VOS_UINT32 ulRet = ERR_MSP_SUCCESS; L4A_SET_LTE_TO_IDLE_REQ_STRU stReq = {0}; LPS_SWITCH_PARA_STRU stDrxControlFlag = {0}; stReq.stCtrl.ulClientId = gastAtClientTab[ucIndex].usClientId; stReq.stCtrl.ulOpId = 0; stReq.stCtrl.ulPid = WUEPS_PID_AT; /* 参数检查 */ if(AT_CMD_OPT_SET_CMD_NO_PARA != g_stATParseCmd.ucCmdOptType) { return AT_CME_INCORRECT_PARAMETERS; } if(NV_OK != NVM_Read(EN_NV_ID_SWITCH_PARA, &stDrxControlFlag,sizeof(LPS_SWITCH_PARA_STRU))) { return AT_ERROR; } if( 0 == ((*((VOS_UINT32 * )(&(stDrxControlFlag.stPsFunFlag01)))) & LPS_NV_JP_DCOM_CON_TO_IDLE_BIT)) { return AT_OK; } /*L模调用如下接口转发*/ ulRet = atSendDataMsg(MSP_L4_L4A_PID, ID_MSG_L4A_LTE_TO_IDLE_REQ, (VOS_VOID*)(&stReq), sizeof(L4A_SET_LTE_TO_IDLE_REQ_STRU)); if(ERR_MSP_SUCCESS == ulRet) { return AT_OK; } return AT_ERROR;
void bsp_usb_nv_init(void) { /* init the default value */ bsp_usb_nv_default_init(); /* * read needed usb nv items from nv * ignore the nv_read return value, * if fail, use the default value */ if (NVM_Read(USB_WIN7_FEATURE_NV, &g_usb_nv.win7_feature, sizeof(g_usb_nv.win7_feature))) { g_usb_nv.stat_nv_read_fail++; } if (NVM_Read(USB_ITEM_AT_SHELL_OPEN_FLAG, &g_usb_nv.shell_lock, sizeof(g_usb_nv.shell_lock))) { g_usb_nv.stat_nv_read_fail++; } }
VOS_UINT32 At_GetNvRevertState(VOS_VOID) { VOS_UINT32 ret = (VOS_UINT32)-1; VOS_UINT16 resume_flag = 0; ret = NVM_Read(NV_ID_DRV_RESUME_FLAG,&resume_flag,sizeof(VOS_UINT16)); /*to do*/ if(ret) { return ret; } if(0 != resume_flag) { return ((VOS_UINT32)-1); } return 0; }
VOS_UINT32 At_GetNvAuthorityVer(VOS_UINT32 * pdata) { VOS_UINT32 ulRst; if(pdata == NULL) { return ((VOS_UINT32)-1); } ulRst = NVM_Read(NV_ID_MSP_AUTHORITY_VER, pdata, sizeof(VOS_UINT32)); if(ulRst != 0) { *pdata = 0; } return 0; }
VOS_UINT32 At_GetNvAuthorityType(VOS_UINT32 * pdata) { VOS_UINT32 ulRst; VOS_UINT8 *pucData = NULL; if(pdata==NULL) { return 0; } pucData = (VOS_UINT8 *)pdata; ulRst = NVM_Read(NV_ID_MSP_AUTHORITY_TYPE, pdata, sizeof(VOS_UINT32)); if(ulRst != 0) { pucData[0] = 1; pucData[1] = 0; pucData[2] = 0; pucData[3] = 0; return ulRst; } return 0; }
VOS_UINT32 At_GetImei(VOS_CHAR szimei [ 16 ]) { VOS_UINT32 ret; VOS_UINT32 uslen = 0; VOS_UINT32 subscript = 0; VOS_CHAR checkdata = 0; VOS_CHAR auctemp[AT_NV_IMEI_LEN+1] = {0}; uslen = AT_NV_IMEI_LEN+1; ret = NVM_Read(0, auctemp, uslen); if(ret != 0) { return ret; } else { for (subscript = 0; subscript < (AT_NV_IMEI_LEN - 1); subscript += 2) { checkdata += (VOS_CHAR)(((auctemp[subscript]) +((auctemp[subscript + 1] * 2) / 10)) +((auctemp[subscript + 1] * 2) % 10)); } checkdata = (10 - (checkdata%10)) % 10; for (subscript = 0; subscript < uslen; subscript++) { *(szimei + subscript) = *(auctemp + subscript) + 0x30; /*字符转换*/ } szimei[AT_NV_IMEI_LEN - 1] = checkdata + 0x30; szimei[AT_NV_IMEI_LEN] = 0; } return 0; }
/***************************************************************************** 函 数 名 : at_ftm_get_freq 功能描述 : 通过某频点获得其对应的实际频率值(LTE单位100KHz, TDS单位为200Khz) 输入参数 : emMode 模式 (LTE TDS) usChan 频点 输出参数 : 无 返 回 值 : 频率值, 返回0代表未找到对应的频点 *****************************************************************************/ VOS_UINT16 at_ftm_get_freq(FCHAN_MODE_ENUM emMode, VOS_UINT16 usChan) { VOS_UINT16 usFreq = 0; VOS_UINT16 i = 0; VOS_UINT16 usTblSize = 0; VOS_UINT32 ulNvId =0,ulRet =0; LTE_COMM_NON_STANDARD_BAND_COMM_STRU stLpsNonstandBand = {0}; /* TDS */ if(EN_FCHAN_MODE_TD_SCDMA == emMode) { HAL_SDMLOG(" TDS, get freq = %d!\n",usChan); return usChan; } /* LTE */ usTblSize = sizeof(g_stBandInfo)/sizeof(FTM_BAND_INFO_STRU); for(i=1; i<usTblSize; i++) { /* 判断该频点是否为某频段下行频点,如果为下行频点则计算该频点的频率 */ if((usChan>=g_stBandInfo[i].usDlLowChan) && (usChan<=g_stBandInfo[i].usDlHigChan)) { usFreq = g_stBandInfo[i].usDlLowFreq + usChan - g_stBandInfo[i].usDlLowChan; return usFreq; } /* 判断该频点是否为某频段的上行频点,如果为上行频点则计算该频点的频率 */ if((usChan>=g_stBandInfo[i].usUlLowChan) && (usChan<=g_stBandInfo[i].usUlHigChan)) { usFreq = g_stBandInfo[i].usUlLowFreq + usChan - g_stBandInfo[i].usUlLowChan; return usFreq; } } /* 搜索非标频段, 搜索到则将非标频点转换为频率 */ for(i=0; i<(LTE_COMM_NONSTANDARD_BAND_END-LTE_COMM_NONSTANDARD_BAND_BEGIN); i++) { ulNvId = i + EN_NV_ID_BANDNon1_BAND_INFO ; ulRet = NVM_Read(ulNvId, (VOS_VOID*) &stLpsNonstandBand, sizeof(LTE_COMM_NON_STANDARD_BAND_COMM_STRU)); if(ERR_MSP_SUCCESS != ulRet) { HAL_SDMLOG("read non stand band nv fail,ulNvId =%d!\n",ulNvId); return 0; } if((usChan >= stLpsNonstandBand.stDlFreqInfo.usRangOfNLow) && (usChan <= stLpsNonstandBand.stDlFreqInfo.usRangOfNHigh)) { usFreq = (VOS_UINT16)(stLpsNonstandBand.stDlFreqInfo.usFLow+usChan-stLpsNonstandBand.stDlFreqInfo.usRangOfNLow); HAL_SDMLOG("stDlFreqInfo:usGetReq = %d!\n", usFreq); return usFreq; } if((usChan >= stLpsNonstandBand.stUlFreqInfo.usRangOfNLow) && (usChan <= stLpsNonstandBand.stUlFreqInfo.usRangOfNHigh)) { usFreq = (VOS_UINT16)(stLpsNonstandBand.stUlFreqInfo.usFLow+usChan-stLpsNonstandBand.stUlFreqInfo.usRangOfNLow); HAL_SDMLOG("stUlFreqInfo:usGetReq = %d!\n", usFreq); return usFreq; } } return 0; }
VOS_UINT32 atSetNVRDExPara(VOS_UINT8 ucClientId) { VOS_UINT32 ulRet = ERR_MSP_FAILURE; VOS_UINT16 usNVID = 0; VOS_UINT32 ulNVLen = 0; VOS_UINT16 usOffset = 0; VOS_UINT16 usRdLen = 0; VOS_UINT8 * pu8Data = NULL; VOS_UINT32 i = 0; /*PCLINT*/ if(ucClientId == 0) { } if(AT_CMD_OPT_SET_PARA_CMD != g_stATParseCmd.ucCmdOptType) { g_ulNVRDTL = 1; return AT_CME_INCORRECT_PARAMETERS; } if(3 != gucAtParaIndex) { g_ulNVRDTL = 2; return AT_CME_INCORRECT_PARAMETERS; } if(0 == gastAtParaList[0].usParaLen || 0 == gastAtParaList[1].usParaLen || 0 == gastAtParaList[2].usParaLen) { g_ulNVRDTL = 3; return AT_CME_INCORRECT_PARAMETERS; } usNVID = (VOS_UINT16)gastAtParaList[0].ulParaValue; usOffset = (VOS_UINT16)gastAtParaList[1].ulParaValue; usRdLen = (VOS_UINT16)gastAtParaList[2].ulParaValue; ulRet = NV_GetLength(usNVID, (BSP_U32 *)&ulNVLen); //vos_printf("\n usNVID=0x%x ulNVLen =0x%x\n",usNVID,ulNVLen); //vos_printf("\n nvim_GetItemLenById ulRet=0x%x \n",ulRet); // HAL_DIAG_SDM_FUN(EN_SDM_NVRD_GETNVLEN, ulRet, usNVID, ulNVLen); if(ERR_MSP_SUCCESS != ulRet) { g_ulNVRDTL = 4; return AT_ERROR; } if(usOffset > ulNVLen - 1 || usOffset + usRdLen > ulNVLen) { g_ulNVRDTL = 5; return AT_ERROR; } /* ulNVLen = (ulNVLen > 128)?128:ulNVLen;*/ pu8Data = VOS_MemAlloc(WUEPS_PID_AT, (DYNAMIC_MEM_PT), ulNVLen); if(NULL == pu8Data) { g_ulNVRDTL = 6; return AT_ERROR; } ulRet = NVM_Read((VOS_UINT32)usNVID, (VOS_VOID*)pu8Data, ulNVLen); //vos_printf("NVM_Read ulRet = 0x%x",ulRet); //HAL_DIAG_SDM_FUN(EN_SDM_NVRD_READNVITEM, ulRet, usNVID, ulNVLen); if(ERR_MSP_SUCCESS != ulRet) { VOS_MemFree(WUEPS_PID_AT, pu8Data); g_ulNVRDTL = 7; return AT_ERROR; } gstAtSendData.usBufLen = 0; gstAtSendData.usBufLen = (VOS_UINT16)At_sprintf(AT_CMD_MAX_LEN, (VOS_CHAR*)pgucAtSndCodeAddr,(VOS_CHAR*)pgucAtSndCodeAddr, "^NVRDEX: %d,%d,%d,", usNVID, usOffset, usRdLen); for(i = usOffset; i < usOffset + usRdLen; i++) { if(usOffset == i) { gstAtSendData.usBufLen += (VOS_UINT16)At_sprintf(AT_CMD_MAX_LEN, (VOS_CHAR *)pgucAtSndCodeAddr,(VOS_CHAR*)pgucAtSndCodeAddr + gstAtSendData.usBufLen,"%02X", pu8Data[i]); } else { gstAtSendData.usBufLen += (VOS_UINT16)At_sprintf(AT_CMD_MAX_LEN, (VOS_CHAR *)pgucAtSndCodeAddr,(VOS_CHAR*)pgucAtSndCodeAddr + gstAtSendData.usBufLen," %02X", pu8Data[i]); } } VOS_MemFree(WUEPS_PID_AT, pu8Data); g_ulNVRDTL = 8; return AT_OK; }
VOS_VOID TAF_MMA_ReadNvimUeSupporttedLteBand(VOS_VOID) { TAF_USER_SET_PREF_BAND64 *pstUeSupportLteBand = VOS_NULL_PTR; VOS_UINT32 ulRslt; LRRC_NV_UE_EUTRA_CAP_STRU *pstUECapability = VOS_NULL_PTR; RRC_UE_CAP_RF_PARA_STRU *pstRfPara = VOS_NULL_PTR; VOS_UINT32 i; VOS_UINT8 ucBandNo; pstUeSupportLteBand = MN_MMA_GetUeSupportLteBandAddr(); PS_MEM_SET(pstUeSupportLteBand, 0X0, sizeof(TAF_USER_SET_PREF_BAND64)); pstUECapability =(LRRC_NV_UE_EUTRA_CAP_STRU*)PS_MEM_ALLOC(WUEPS_PID_MMA, sizeof(LRRC_NV_UE_EUTRA_CAP_STRU)); if(VOS_NULL_PTR == pstUECapability) { MN_ERR_LOG("TAF_MMA_ReadNvimUeSupporttedLteBand():PS_MEM_ALLOC failed!"); return ; } PS_MEM_SET(pstUECapability, 0x00, sizeof(LRRC_NV_UE_EUTRA_CAP_STRU)); /* LTE NV项长度 */ ulRslt = NVM_Read(EN_NV_ID_UE_CAPABILITY, pstUECapability, sizeof(LRRC_NV_UE_EUTRA_CAP_STRU)); if ( (NV_OK != ulRslt) || (NVIM_EUTRA_MAX_SUPPORT_BANDS_NUM < pstUECapability->stRfPara.usCnt) ) { /* 读NV失败,打印未成功初始化值,默认赋值为支持所有频段 */ MN_ERR_LOG("TAF_MMA_ReadNvimUeSupporttedLteBand():read en_NV_Item_EUTRA_CAPA_COMM_INFO error"); pstUeSupportLteBand->ulBandHigh = MN_MMA_LTE_HIGH_BAND_ALL; pstUeSupportLteBand->ulBandLow = MN_MMA_LTE_LOW_BAND_ALL; PS_MEM_FREE(WUEPS_PID_MMA, pstUECapability); return; } /* 获取NV中的频段信息: ulBandLow的最低bit对应band1,最高bit对应band32 ulBandHigh的最低bit对应band33,最高bit对应band64 */ pstRfPara = &(pstUECapability->stRfPara); for ( i = 0; i < pstRfPara->usCnt; i++ ) { ucBandNo = (pstRfPara->astSuppEutraBandList[i]).ucEutraBand; /* NV中的频段信息指示为低32,即对应band1到band32*/ if ( ucBandNo <= (NVIM_EUTRA_MAX_SUPPORT_BANDS_NUM / 2) ) { /*lint -e701*/ pstUeSupportLteBand->ulBandLow |= (VOS_UINT32)( 0x00000001 << (ucBandNo - 1) ); /*lint +e701*/ } /* NV中的频段信息指示为高32,即对应band33到band64 */ else if ( ucBandNo <= NVIM_EUTRA_MAX_SUPPORT_BANDS_NUM ) { /*lint -e961 -e701*/ pstUeSupportLteBand->ulBandHigh |= (VOS_UINT32)( 0x00000001 << (ucBandNo - 32 - 1) ); /*lint +e961 +e701*/ } else { /* band号异常 */ MN_ERR_LOG("TAF_MMA_ReadNvimUeSupporttedLteBand():LTE BAND NO IS BIG THAN 64, error"); } } PS_MEM_FREE(WUEPS_PID_MMA, pstUECapability); return; }
/***************************************************************************** Function Name : diag_ConnProc Description : 该函数用于处理ConnProcEntry传进来的HSO连接命令 Input : pstReq 待处理数据 Output : None Return : VOS_UINT32 History : 1.y00228784 2012-11-22 Draft Enact *****************************************************************************/ VOS_UINT32 diag_ConnProc(VOS_UINT8* pstReq,VOS_UINT32 ulCmdId) { VOS_UINT32 ret = ERR_MSP_SUCCESS; VOS_UINT32 ulCnfRst = ERR_MSP_UNAVAILABLE; #if (VOS_OS_VER == VOS_LINUX) DIAG_CMD_HOST_CONNECT_CNF_STRU stCnf = {0}; NV_ITEM_PWC_SWITCH_STRU stPwrctrlSwitch = {0}; VOS_UINT32 ulPwrFlag = 0; LPS_SWITCH_PARA_STRU stDrxControlFlag = {0}; UE_SW_BUILD_VER_INFO_STRU *pstBuildVer =NULL; DIAG_CMD_REPLAY_SET_REQ_STRU stReplay= {0}; #endif /*重置所有开关状态为未打开*/ diag_CfgResetAllSwt(); /*设置连接状态开关值*/ ulCnfRst = diag_CfgSetGlobalBitValue(&g_ulDiagCfgInfo,DIAG_CFG_CONN_BIT,DIAG_CFG_SWT_OPEN); DIAG_DEBUG_SDM_FUN(EN_DIAG_DEBUG_CONN_CFG, ulCnfRst, 0, 0); #if (VOS_OS_VER == VOS_LINUX) VOS_MemSet(&(stCnf.stBuildVersion), 0, sizeof(DIAG_CMD_UE_BUILD_VER_STRU)); /*获取版本信息*/ pstBuildVer = BSP_GetBuildVersion(); if(pstBuildVer!=NULL) { pstBuildVer->ulProductNo = BSP_HwGetVerMain(); stCnf.stBuildVersion.usVVerNo = pstBuildVer->ulVVerNo; stCnf.stBuildVersion.usRVerNo = pstBuildVer->ulRVerNo; stCnf.stBuildVersion.usCVerNo = pstBuildVer->ulCVerNo; stCnf.stBuildVersion.usBVerNo = pstBuildVer->ulBVerNo; stCnf.stBuildVersion.usSpcNo = pstBuildVer->ulSpcNo; stCnf.stBuildVersion.usHardwareVerNo = pstBuildVer->ulCustomVer; stCnf.stBuildVersion.ulProductNo = pstBuildVer->ulProductNo; } /*获取IMEI号*/ ret = diag_GetImei(stCnf.szImei); if(ret) { } /*获取软件版本号*/ VOS_MemSet(&stCnf.stUeSoftVersion,0,sizeof(DIAG_CMD_UE_SOFT_VERSION_STRU)); /*获取数采基地址*/ stCnf.ulChipBaseAddr = (VOS_UINT32)BSP_OM_GetChipType(); //stCnf.ulChipBaseAddr = (VOS_UINT32)V7R1_PILOT_CHIP; /*路测信息获取*/ ret = NVM_Read(EN_NV_ID_AGENT_FLAG,&(stCnf.stAgentFlag),sizeof(NV_ITEM_AGENT_FLAG_STRU)); if(ret) { } /*低功耗开关获取*/ ret = NVM_Read(EN_NV_ID_PWC_SWITCH,&stPwrctrlSwitch,sizeof(NV_ITEM_PWC_SWITCH_STRU)); if(ret) { } ulPwrFlag = stPwrctrlSwitch.drxLBbpPd; ret = NVM_Read(EN_NV_ID_SWITCH_PARA,&stDrxControlFlag,sizeof(stDrxControlFlag)); if(ret) { } stCnf.ulDrxControlFlag = stDrxControlFlag.ulDrxControlFlag & ulPwrFlag; /*lint -save -e40*/ ulCnfRst |= diag_SendMsg(diag_GetAgentPid(),PS_PID_MM,ID_MSG_DIAG_CMD_REPLAY_TO_PS,(VOS_UINT8*)&stReplay,\ sizeof(DIAG_CMD_REPLAY_SET_REQ_STRU)); /*lint -restore +e40*/ /*获取当前存取模式*/ stCnf.ulLpdMode = diag_GetLogSendType(); /*处理结果*/ stCnf.ulRc = ulCnfRst; /*组包给FW回复*/ ret = diag_AgentCnfFun((VOS_UINT8*)&stCnf,ulCmdId,sizeof(DIAG_CMD_HOST_CONNECT_CNF_STRU)); #else /*lint -e18 -e718 -e628 -e830 -e746*/ diag_EnableSocpChan(); /*lint +e18 +e718 +e628 +e830 +e746*/ #endif return ret; }
VOS_UINT32 AT_GetLteFeatureInfo(AT_FEATURE_SUPPORT_ST*pstFeATure) { /*AT_FEATURE_SUPPORT_ST *pstFeATure = NULL; */ /*RRC_NV_SUPPORT_BAND_ID_LIST_STRU stSupportBandID = {0}; */ VOS_UINT32 ulRst = 0; VOS_UINT8 ucBandStr[64] = {0}; VOS_UINT8 ucBandNv = 0; VOS_UINT8 ucBandFlag = 0; VOS_UINT32 ulStrlen1=0; VOS_UINT32 i =0; VOS_UINT8 ucBandNum[65]={0}; LRRC_NV_UE_EUTRA_CAP_STRU *pstEutraCap = NULL; pstEutraCap = VOS_MemAlloc(WUEPS_PID_AT, (DYNAMIC_MEM_PT), sizeof(LRRC_NV_UE_EUTRA_CAP_STRU)); if( pstEutraCap == NULL) { return ERR_MSP_MALLOC_FAILUE; } MSP_MEMSET(pstEutraCap, 0, sizeof(LRRC_NV_UE_EUTRA_CAP_STRU )); ulRst = NVM_Read(EN_NV_ID_UE_CAPABILITY,pstEutraCap,sizeof(LRRC_NV_UE_EUTRA_CAP_STRU)); if( ulRst != ERR_MSP_SUCCESS ) { VOS_MemFree(WUEPS_PID_AT, pstEutraCap); return ERR_MSP_FAILURE; } /*RRC_MAX_NUM_OF_BANDS */ for( i = 0; i < pstEutraCap->stRfPara.usCnt; i++ ) { if( pstEutraCap->stRfPara.astSuppEutraBandList[i].ucEutraBand > 0 ) { ucBandNv=pstEutraCap->stRfPara.astSuppEutraBandList[i].ucEutraBand; if( ucBandNv < (RRC_MAX_NUM_OF_BANDS+1) ) { ucBandNum[ucBandNv]=1; ucBandFlag++; } } } /*解析获取LTE band信息 */ if( ucBandFlag > 0 ) { pstFeATure[AT_FEATURE_LTE].ucFeatureFlag = AT_FEATURE_EXIST; /*ulStrlen1 += At_sprintf(64,ucBandStr,ucBandStr+ulStrlen1,"%s","LTE,"); */ } else { VOS_MemFree(WUEPS_PID_AT, pstEutraCap); return ERR_MSP_FAILURE; } for( i = 1 ; i < 65; i++ ) { if( ucBandNum[i] == 1 ) { ulStrlen1 +=(VOS_UINT32) At_sprintf(64,(VOS_CHAR* )ucBandStr,(VOS_CHAR* )(ucBandStr+ulStrlen1),"B%d,",i); /*ucBandNum[i]=2; */ } } for( i = 0 ; i < ulStrlen1-1; i++ ) { pstFeATure[AT_FEATURE_LTE].aucContent[i] = ucBandStr[i]; } for( i = 0 ; i < ulStrlen1; i++ )/* [false alarm]:fortify */ { ucBandStr[i] = 0;/* [false alarm]:fortify */ }/* [false alarm]:fortify */ ulStrlen1 = 0;/* [false alarm]:fortify*/ VOS_MemFree(WUEPS_PID_AT, pstEutraCap);/* [false alarm]:fortify */ return ERR_MSP_SUCCESS;/* [false alarm]:fortify */ }
/***************************************************************************** 函 数 名 : SystemDataTdRead 功能描述 : 读取TDS相关NV项 输入参数 : FTM_SCALIB_SYSTEM_SETTING_STRU 输出参数 : 无 返 回 值 : VOS_UINT32 *****************************************************************************/ VOS_UINT32 SystemDataTdRead(FTM_SCALIB_SYSTEM_SETTING_STRU * pstSystemInfo) { VOS_UINT32 ret = ERR_MSP_SUCCESS; TDS_NV_PA_POWER_STRU maxPower; if(NULL == pstSystemInfo) { return ERR_MSP_FAILURE; } MSP_MEMSET(&maxPower, 0x00, sizeof(TDS_NV_PA_POWER_STRU)); /* band A */ ret = NVM_Read(NV_ID_TDS_TX_PA_POWER_BAND_A, &maxPower, AT_CALIB_PARAM_APCOFF_MAX); if(ret != ERR_MSP_SUCCESS) { return ret; } MSP_MEMCPY((pstSystemInfo->tdsTxPaPowerBand_A), (maxPower.asTxMaxPower), AT_CALIB_PARAM_APCOFF); ret = NVM_Read(NV_ID_TDS_TX_APC_COMP_BAND_A, pstSystemInfo->tdsTxApcCompBand_A, AT_CALIB_PARAM_APC); if(ret != ERR_MSP_SUCCESS) { return ret; } ret = NVM_Read(NV_ID_TDS_TX_APC_FREQ_COMP_BAND_A, pstSystemInfo->tdsTxApcFreqCompBand_A, AT_CALIB_PARAM_APCFREQ); if(ret != ERR_MSP_SUCCESS) { return ret; } ret = NVM_Read(NV_ID_TDS_RX_AGC_COMP_BAND_A, pstSystemInfo->tdsRxAgcCompBand_A, AT_CALIB_PARAM_AGC); if(ret != ERR_MSP_SUCCESS) { return ret; } ret = NVM_Read(NV_ID_TDS_RX_AGC_FREQ_COMP_BAND_A, pstSystemInfo->tdsRxAgcFreqCompBand_A, AT_CALIB_PARAM_AGCFREQ); if(ret != ERR_MSP_SUCCESS) { return ret; } /* band E */ ret = NVM_Read(NV_ID_TDS_TX_PA_POWER_BAND_E, &maxPower, AT_CALIB_PARAM_APCOFF_MAX); if(ret != ERR_MSP_SUCCESS) { return ret; } MSP_MEMCPY((pstSystemInfo->tdsTxPaPowerBand_E), (maxPower.asTxMaxPower), AT_CALIB_PARAM_APCOFF); ret = NVM_Read(NV_ID_TDS_TX_APC_COMP_BAND_E, pstSystemInfo->tdsTxApcCompBand_E, AT_CALIB_PARAM_APC); if(ret != ERR_MSP_SUCCESS) { return ret; } ret = NVM_Read(NV_ID_TDS_TX_APC_FREQ_COMP_BAND_E, pstSystemInfo->tdsTxApcFreqCompBand_E, AT_CALIB_PARAM_APCFREQ); if(ret != ERR_MSP_SUCCESS) { return ret; } ret = NVM_Read(NV_ID_TDS_RX_AGC_COMP_BAND_E, pstSystemInfo->tdsRxAgcCompBand_E, AT_CALIB_PARAM_AGC); if(ret != ERR_MSP_SUCCESS) { return ret; } ret = NVM_Read(NV_ID_TDS_RX_AGC_FREQ_COMP_BAND_E, pstSystemInfo->tdsRxAgcFreqCompBand_E, AT_CALIB_PARAM_AGCFREQ); if(ret != ERR_MSP_SUCCESS) { return ret; } /* band F */ ret = NVM_Read(NV_ID_TDS_TX_PA_POWER_BAND_F, &maxPower, AT_CALIB_PARAM_APCOFF_MAX); if(ret != ERR_MSP_SUCCESS) { return ret; } MSP_MEMCPY((pstSystemInfo->tdsTxPaPowerBand_F), (maxPower.asTxMaxPower), AT_CALIB_PARAM_APCOFF); ret = NVM_Read(NV_ID_TDS_TX_APC_COMP_BAND_F, pstSystemInfo->tdsTxApcCompBand_F, AT_CALIB_PARAM_APC); if(ret != ERR_MSP_SUCCESS) { return ret; } ret = NVM_Read(NV_ID_TDS_TX_APC_FREQ_COMP_BAND_F, pstSystemInfo->tdsTxApcFreqCompBand_F, AT_CALIB_PARAM_APCFREQ); if(ret != ERR_MSP_SUCCESS) { return ret; } ret = NVM_Read(NV_ID_TDS_RX_AGC_COMP_BAND_F, pstSystemInfo->tdsRxAgcCompBand_F, AT_CALIB_PARAM_AGC); if(ret != ERR_MSP_SUCCESS) { return ret; } ret = NVM_Read(NV_ID_TDS_RX_AGC_FREQ_COMP_BAND_F, pstSystemInfo->tdsRxAgcFreqCompBand_F, AT_CALIB_PARAM_AGCFREQ); if(ret != ERR_MSP_SUCCESS) { return ret; } return ret; }