VOS_VOID  MN_CALL_ReadReportEccNumSupportNvim( VOS_VOID )
{
    MN_CALL_NVIM_REPORT_ECC_NUM_SUPPORT_FLG_STRU            stCustomSetEcc;
    MN_CALL_CUSTOM_CFG_INFO_STRU                           *pstCustomCfg = VOS_NULL_PTR;
    VOS_UINT32                                              ulLength;


    ulLength = 0;
    PS_MEM_SET(&stCustomSetEcc, 0x00, sizeof(stCustomSetEcc));

    pstCustomCfg = MN_CALL_GetCustomCfgInfo();

    /* 先获取NV的长度 */
    NV_GetLength(en_NV_Item_REPORT_ECC_NUM_SUPPORT_FLAG, &ulLength);

    if (ulLength > sizeof(MN_CALL_NVIM_REPORT_ECC_NUM_SUPPORT_FLG_STRU))
    {
        MN_WARN_LOG("MN_CALL_ReadReportEccNumSupportNvim():WARNING: en_NV_Item_REPORT_ECC_NUM_SUPPORT_FLAG length Error");
        pstCustomCfg->ucReportEccNumFlg = VOS_FALSE;

        return;
    }

    NV_GetLength(en_NV_Item_REPORT_ECC_NUM_SUPPORT_FLAG, &ulLength);	
    if (ulLength > sizeof(MN_CALL_NVIM_REPORT_ECC_NUM_SUPPORT_FLG_STRU))
    {
        return;
    }

    /* 如果NV读取失败,则设置为不激活 */
    if (NV_OK != NV_Read(en_NV_Item_REPORT_ECC_NUM_SUPPORT_FLAG,
                         &stCustomSetEcc, ulLength))
    {
        MN_WARN_LOG("MN_CAL_ReadReportEccNumSupportNvim():WARNING: en_NV_Item_REPORT_ECC_NUM_SUPPORT_FLAG Error");

        pstCustomCfg->ucReportEccNumFlg = VOS_FALSE;

        return;
    }

    /* NV激活则设置主动上报激活标志为VOS_TRUE */
    if (MN_CALL_NV_ITEM_ACTIVE == stCustomSetEcc.ucReportEccNumFlg)
    {
        pstCustomCfg->ucReportEccNumFlg = VOS_TRUE;
    }
    else
    {
        pstCustomCfg->ucReportEccNumFlg = VOS_FALSE;
    }

    return;
}
VOS_VOID TAF_MMA_ReadAccessModeNvim(VOS_VOID)
{
    VOS_UINT32                          ulLength;
    NAS_MMA_NVIM_ACCESS_MODE_STRU       stAccessMode;
    MN_MMA_LAST_SETTED_SYSCFG_SET_STRU *pstLastSyscfgSet = VOS_NULL_PTR;

    PS_MEM_SET(&stAccessMode, 0x00, sizeof(NAS_MMA_NVIM_ACCESS_MODE_STRU));
    pstLastSyscfgSet = MN_MMA_GetLastSyscfgSetAddr();
    ulLength = 0;

    NV_GetLength(en_NV_Item_MMA_AccessMode, &ulLength);
    if (ulLength > sizeof(NAS_MMA_NVIM_ACCESS_MODE_STRU))
    {
        return;
    }

    if (NV_OK != NV_Read(en_NV_Item_MMA_AccessMode ,
                         &stAccessMode,
                         ulLength))

    {
        MN_WARN_LOG("TAF_MMA_ReadAccessModeNvim:Read:NV_Read runs failed");
        return ;
    }
    pstLastSyscfgSet->enPrioRat = (stAccessMode.aucAccessMode)[1];
    return;
}
VOS_VOID NAS_UTRANCTRL_ReadUtranModeNvim( VOS_VOID )
{
    NAS_UTRANCTRL_NVIM_UTRAN_MODE_STRU  stUtranMode;
    VOS_UINT32                          ulLength;

    ulLength = 0;

    PS_MEM_SET(&stUtranMode, 0x00, sizeof(NAS_UTRANCTRL_NVIM_UTRAN_MODE_STRU));

    NV_GetLength(en_NV_Item_Utran_Mode, &ulLength);	
    if (ulLength > sizeof(stUtranMode))
    {
        return;
    }

    if ( NV_OK != NV_Read(en_NV_Item_Utran_Mode, &stUtranMode, ulLength) )
    {
        NAS_ERROR_LOG(WUEPS_PID_MMC, "NAS_UTRANCTRL_ReadUtranModeNvim():WARNING: en_NV_Item_Utran_Mode Error");

        return;
    }

    /* 将NVIM中读取的UTRAN模式保存到NASUTRANCTRL中的全局变量中 */
    NAS_UTRANCTRL_SetCurrUtranMode(stUtranMode.ucUtranMode);

    return;
}
VOS_VOID NAS_RABM_ReadVoicePreferNvim(VOS_VOID)
{
    NAS_RABM_NVIM_WCDMA_VOICE_PREFER_STRU                   stVoicePreferCfg;
    VOS_UINT32                                              ulLength;

    ulLength = 0;
    PS_MEM_SET(&stVoicePreferCfg, 0x00, sizeof(NAS_RABM_NVIM_WCDMA_VOICE_PREFER_STRU));

    /* 读NV失败,认为不允许VoicePrefer */
    NV_GetLength(en_NV_Item_Wcdma_Voice_Prefer_Cfg, &ulLength);

    if (ulLength > sizeof(NAS_RABM_NVIM_WCDMA_VOICE_PREFER_STRU))
    {
        NAS_WARNING_LOG(WUEPS_PID_RABM, "NAS_RABM_ReadVoicePreferNvim:WARNING:NV_GetLength ulLength fail!");
        g_stNasRabmVoicePreferCtx.ucVoicePreferNvimEnableFlag = VOS_FALSE;
        return;
    }

    if (NV_OK != NV_Read(en_NV_Item_Wcdma_Voice_Prefer_Cfg, &stVoicePreferCfg,
                         ulLength))
    {
        NAS_WARNING_LOG(WUEPS_PID_RABM, "NAS_RABM_ReadVoicePreferNvim:WARNING:NV_Read faild!");
        g_stNasRabmVoicePreferCtx.ucVoicePreferNvimEnableFlag = VOS_FALSE;
        return;
    }

    g_stNasRabmVoicePreferCtx.ucVoicePreferNvimEnableFlag = stVoicePreferCfg.ucEnableFlag;
    g_stNasRabmVoicePreferCtx.ulNvTestMcc = stVoicePreferCfg.ulMcc;
    g_stNasRabmVoicePreferCtx.ulNvTestMnc = stVoicePreferCfg.ulMnc;

    return;
}
Exemplo n.º 5
0
VOS_VOID MN_MSG_CloseSmsCapabilityFeatureInit(VOS_VOID)
{
    VOS_UINT32                                              ulRet;
    VOS_UINT32                                              ulLength;

    NAS_NVIM_CLOSE_SMS_CAPABILITY_CFG_STRU                  stCloseSmsCapabilityCfg;


    ulLength = 0;

    /* 先获取NV的长度 */
    NV_GetLength(en_NV_Item_Close_SMS_Capability_Config, &ulLength);

    if (ulLength > sizeof(stCloseSmsCapabilityCfg))
    {
        MN_ERR_LOG("MN_MSG_CloseSmsCapabilityFeatureInit():WARNING: en_NV_Item_Close_SMS_Capability_Config length Error");
        return;
    }

    ulRet = NV_Read(en_NV_Item_Close_SMS_Capability_Config,
                   &stCloseSmsCapabilityCfg,
                    ulLength);

    f_stMnMsgCloseSmsCapabilityMsg.ucActFlg = stCloseSmsCapabilityCfg.ucActFlg;

    /* 读取关闭短信定制NV失败,默认不关闭短信功能 */
    if (NV_OK != ulRet)
    {
        f_stMnMsgCloseSmsCapabilityMsg.ucActFlg = MN_MSG_NVIM_ITEM_INACTIVE;

        MN_ERR_LOG("MN_MSG_CloseSmsCapabilityFeatureInit: Read en_NV_Item_CLOSE_SMS_Capability_Config Failed");
    }

    return;
}
VOS_VOID TAF_MMA_ReadSystemAppCofigNvim(VOS_VOID)
{
    VOS_UINT32                          ulLength;
    NAS_NVIM_SYSTEM_APP_CONFIG_STRU     stSysAppConfig;

    PS_MEM_SET(&stSysAppConfig, 0x00, sizeof(NAS_NVIM_SYSTEM_APP_CONFIG_STRU));

    /* 读取en_NV_Item_System_APP_Config,获取对接的上层应用 */
    NV_GetLength(en_NV_Item_System_APP_Config, &ulLength);

    if (NV_OK != NV_Read(en_NV_Item_System_APP_Config,
                         &stSysAppConfig, ulLength))
    {
        stSysAppConfig.usSysAppConfigType = SYSTEM_APP_MP;
        MMA_WARNINGLOG("TAF_MMA_ReadSystemAppCofigNvim():Read en_NV_Item_System_APP_Config Failed!");
    }

    if ( SYSTEM_APP_ANDROID < stSysAppConfig.usSysAppConfigType)
    {
        g_usMmaAppConfigSupportType = SYSTEM_APP_MP;
        MMA_WARNINGLOG("TAF_MMA_ReadSystemAppCofigNvim():en_NV_Item_System_APP_Config error!");
    }
    else
    {
        g_usMmaAppConfigSupportType = stSysAppConfig.usSysAppConfigType;
    }


    return;
}
VOS_VOID TAF_MMA_ReadMsClassNvim(VOS_VOID)
{
    NAS_NVIM_MS_CLASS_STRU              stMsClass;
    VOS_UINT32                          ulLength;
    MN_MMA_LAST_SETTED_SYSCFG_SET_STRU *pstLastSyscfgSet = VOS_NULL_PTR;

    PS_MEM_SET(&stMsClass, 0x00, sizeof(NAS_NVIM_MS_CLASS_STRU));
    pstLastSyscfgSet = MN_MMA_GetLastSyscfgSetAddr();
    ulLength = 0;

    NV_GetLength(en_NV_Item_MMA_MsClass, &ulLength);
    if (NV_OK != NV_Read(en_NV_Item_MMA_MsClass,
                         &stMsClass,
                         ulLength))
    {
        pstLastSyscfgSet->ucSrvDomain = TAF_PH_SERVICE_CS_PS;
    }
    else
    {
        pstLastSyscfgSet->ucSrvDomain = stMsClass.ucMsClass;
    }

    MMA_ChangeSrv2Class(pstLastSyscfgSet->ucSrvDomain, &gstMmaValue.stSetMsClass.MsClassType);

    gstMmaValue.stSetMsClass.NewMsClassType             = gstMmaValue.stSetMsClass.MsClassType;
    /*同步该参数位于STA子模块中的值*/
    gstMmaValue.pg_StatusContext->ucModeService         = gstMmaValue.stSetMsClass.MsClassType;
    return;
}
VOS_VOID TAF_MMA_ReadDisplaySpnFlagNvim(VOS_VOID)
{
    VOS_UINT32                          ulLength;
    NAS_MMA_NVIM_DISPLAY_SPN_FLAG_STRU  stSpnFlag;

    PS_MEM_SET(&stSpnFlag, 0x00, sizeof(NAS_MMA_NVIM_DISPLAY_SPN_FLAG_STRU));
    NV_GetLength(en_NV_Item_Display_Spn_Flag, &ulLength);

    if (NV_OK != NV_Read(en_NV_Item_Display_Spn_Flag,
                          (VOS_VOID*)(&stSpnFlag),
                           ulLength))
    {
       gstMmaValue.ucCopsNotDisplaySpnFlg = MMA_FALSE;
    }
    else if (NV_ITEM_ACTIVE == (stSpnFlag.aucDisplaySpnFlag)[0])
    {
        gstMmaValue.ucCopsNotDisplaySpnFlg = (stSpnFlag.aucDisplaySpnFlag)[1];
    }
    else
    {

    }

    return;
}
VOS_VOID TAF_MMA_ReadRoamingBrokerInfoNvim(VOS_VOID)
{
    NAS_MMA_NVIM_ROAMING_BROKER_STRU    stRoamingBroker;
    VOS_UINT32                          ulLength;

    ulLength = 0;

    PS_MEM_SET(&stRoamingBroker, 0, sizeof(NAS_MMA_NVIM_ROAMING_BROKER_STRU));
    NV_GetLength(en_NV_Item_Roaming_Broker, &ulLength);

    if (NV_OK != NV_Read(en_NV_Item_Roaming_Broker, &stRoamingBroker, ulLength))
    {
        NAS_WARNING_LOG(WUEPS_PID_MMA, "TAF_MMA_ReadRoamingBrokerInfoNvim: Read NV Fail ");
        gstMmaValue.ucRoamBrokerSwitch = VOS_FALSE;
    }
    else
    {
        gstMmaValue.ucRoamBrokerSwitch = (stRoamingBroker.aucRoamingBroker)[0];

        /* 如果NV中的值无效,则设置RoamBroker功能关闭 */
        if ( (VOS_FALSE != (stRoamingBroker.aucRoamingBroker)[0]) && (VOS_TRUE != (stRoamingBroker.aucRoamingBroker)[0]) )
        {
            gstMmaValue.ucRoamBrokerSwitch = VOS_FALSE;
        }
    }

    return;
}
Exemplo n.º 10
0
VOS_VOID SSA_GetUssdMode(VOS_VOID)
{
    TAF_USSD_NVIM_TRANS_MODE_STRU       stUssdTranMode;
    VOS_UINT32                          ulLength;

    ulLength = 0;


    PS_MEM_SET(&stUssdTranMode, 0x00, sizeof(stUssdTranMode));

    NV_GetLength(en_NV_Item_CUST_USSD_MODE, &ulLength);

    /*读取USSD是否透传设置 */
    if (NV_OK == NV_Read(en_NV_Item_CUST_USSD_MODE,
                          &stUssdTranMode,
                          ulLength))
    {
        if (TAF_SSA_NVIM_ITEM_ACTIVE == stUssdTranMode.ucStatus)
        {
            g_usTafSsaUssdTransMode = stUssdTranMode.ucUssdTransMode;
        }
        else
        {
            g_usTafSsaUssdTransMode = AT_USSD_TRAN_MODE;
        }
    }
    else
    {
        g_usTafSsaUssdTransMode = AT_USSD_TRAN_MODE;
    }

    return;
}
VOS_VOID TAF_MMA_ReadPlmnSelectionModeNvim(VOS_VOID)
{
    NAS_NVIM_SELPLMN_MODE_STRU          stPlmnSelMode;
    VOS_UINT32                          ulLength;

    ulLength = 0;

    NV_GetLength(en_NV_Item_SelPlmn_Mode, &ulLength);
    if (ulLength > sizeof(NAS_NVIM_SELPLMN_MODE_STRU))
    {
        return;
    }


    stPlmnSelMode.usSelPlmnMode = MMA_MMC_PLMN_SEL_MODE_AUTO;

    if (NV_OK != NV_Read(en_NV_Item_SelPlmn_Mode, &stPlmnSelMode, ulLength))
    {
        MMA_ERRORLOG("TAF_MMA_ReadPlmnSelectionModeNvim(): Read NV Fail");
        return;
    }

    if ((stPlmnSelMode.usSelPlmnMode != MMA_MMC_PLMN_SEL_MODE_AUTO)
     && (stPlmnSelMode.usSelPlmnMode != MMA_MMC_PLMN_SEL_MODE_MANUAL))
    {
        MMA_ERRORLOG("TAF_MMA_ReadPlmnSelectionModeNvim(): ucPlmnSelMode is invalid");
        return;
    }


    TAF_MMA_SetPlmnSelectionMode((VOS_UINT8)stPlmnSelMode.usSelPlmnMode);

    return;
}
VOS_VOID NAS_CC_ReadErrlogCtrlInfoNvim(VOS_VOID)
{
    VOS_UINT32                          ulResult;
    VOS_UINT32                          ulLength;
    NV_ID_ERR_LOG_CTRL_INFO_STRU        stErrorLogCtrlInfo;

    ulLength = 0;
    PS_MEM_SET(&stErrorLogCtrlInfo, 0x00, sizeof(NV_ID_ERR_LOG_CTRL_INFO_STRU));
    NV_GetLength(en_NV_Item_ErrLogCtrlInfo, &ulLength);

    ulResult = NV_Read(en_NV_Item_ErrLogCtrlInfo,
                       &stErrorLogCtrlInfo,
                       ulLength);

    if (ulResult == NV_OK)
    {
        NAS_CC_SetErrlogCtrlFlag(stErrorLogCtrlInfo.ucAlmStatus);
        NAS_CC_SetErrlogAlmLevel(stErrorLogCtrlInfo.ucAlmLevel);
    }
    else
    {
        NAS_CC_SetErrlogCtrlFlag(VOS_FALSE);
        NAS_CC_SetErrlogAlmLevel(NAS_ERR_LOG_CTRL_LEVEL_CRITICAL);
    }

    return;
}
VOS_VOID TAF_CALL_ReadAtaReportOkAsyncCfgNvim(VOS_VOID)
{
    TAF_CALL_NVIM_ATA_REPORT_OK_ASYNC_CFG_STRU              stAtaReportOkAsyncCfg;
    VOS_UINT32                                              ulLength;

    ulLength = 0;
    NV_GetLength(en_NV_Item_Ata_Report_Ok_Async_Cfg, &ulLength);

    PS_MEM_SET(&stAtaReportOkAsyncCfg, 0x0, sizeof(stAtaReportOkAsyncCfg));

    /* 设置默认值为VOS_FALSE */
    TAF_CALL_SetAtaReportOkAsyncFlag(VOS_FALSE);

    if (ulLength > sizeof(TAF_CALL_NVIM_ATA_REPORT_OK_ASYNC_CFG_STRU))
    {
       return;
    }

    if (NV_OK != NV_Read(en_NV_Item_Ata_Report_Ok_Async_Cfg,
                         &stAtaReportOkAsyncCfg,
                         sizeof(stAtaReportOkAsyncCfg)))
    {
        return;
    }

    if (VOS_TRUE == stAtaReportOkAsyncCfg.ucAtaReportOkAsyncFlag)
    {
        TAF_CALL_SetAtaReportOkAsyncFlag(VOS_TRUE);
    }

    return;
}
VOS_VOID  MN_CAL_ReadVideoCallNvim( VOS_VOID )
{
    MN_CALL_NV_ITEM_VIDEO_CALL_STRU               stVideoCall;
    VOS_UINT32                                    ulResult;
    VOS_UINT32                                    ulLength;

    ulLength                 = 0;

    stVideoCall.ucStatus     = VOS_FALSE;
    stVideoCall.ucVpCfgState = MN_CALL_VP_BUTT;
    
    NV_GetLength(en_NV_Item_VIDEO_CALL, &ulLength);	

    ulResult = NV_Read(en_NV_Item_VIDEO_CALL,
                       &stVideoCall,
                       ulLength);

    /* PC工程,回放工程,CC默认打开 */
#if (defined(__PS_WIN32_RECUR__))
        stVideoCall.ucStatus = VOS_TRUE;
        stVideoCall.ucVpCfgState = MN_CALL_VP_MO_MT_BOTH;
#endif
     if((ulResult == NV_OK)
     &&(VOS_TRUE == stVideoCall.ucStatus))
     {
        TAF_CALL_SetVpCfgState(stVideoCall.ucVpCfgState);
     }
     else
     {
        TAF_CALL_SetVpCfgState(MN_CALL_VP_MO_MT_BOTH);
     }

    return;
}
Exemplo n.º 15
0
VOS_VOID MN_CALL_LineInfo(
    MNPH_USIM_STATUS_ENUM_U32           enUsimStatus
)
{
    MN_CALL_ALS_LINE_INFO_STRU          stAlsInfo;
    VOS_UINT8                           aucMmaImsi[9];
    VOS_BOOL                            bWriteNvim;
    VOS_UINT32                          ulLength;

    ulLength = 0;
    stAlsInfo.enAlsLine = MN_CALL_ALS_LINE_NO_BUTT;
    PS_MEM_SET(stAlsInfo.aucMmaImsi, 0x00, sizeof(stAlsInfo.aucMmaImsi));

    if ( MNPH_USIM_STATUS_AVILABLE == enUsimStatus )
    {
        bWriteNvim = VOS_FALSE;

        if ( NV_OK != NV_Read(en_NV_Item_ALS_LINE_Config,&stAlsInfo,sizeof(stAlsInfo)))
        {
            return;
        }
        if ( USIMM_API_SUCCESS != NAS_USIMMAPI_GetCardIMSI(aucMmaImsi) )
        {
            return ;
        }

        /*线路号值不在取值范围内*/
        if  ( ( MN_CALL_ALS_LINE_NO_1 != stAlsInfo.enAlsLine )
           && ( MN_CALL_ALS_LINE_NO_2 != stAlsInfo.enAlsLine ) )
        {
            stAlsInfo.enAlsLine = MN_CALL_ALS_LINE_NO_1;
            bWriteNvim = VOS_TRUE;
        }

        /*判断NV中当前使用线路号对应的IMSI和SIM卡中IMSI是否相同,若不同则清NV
          项,并填入默认线路号1*/
        if ( 0 != VOS_StrCmp( (VOS_CHAR *)aucMmaImsi,
                               (VOS_CHAR *)stAlsInfo.aucMmaImsi) )
        {
            stAlsInfo.enAlsLine = MN_CALL_ALS_LINE_NO_1;
            PS_MEM_CPY(stAlsInfo.aucMmaImsi,aucMmaImsi,9);
            bWriteNvim = VOS_TRUE;
        }

        /*需要更新NVIM*/
        if ( VOS_TRUE == bWriteNvim )
        {
            NV_GetLength(en_NV_Item_ALS_LINE_Config, &ulLength);
            if (NV_OK != NV_Write(en_NV_Item_ALS_LINE_Config,
                     &stAlsInfo,
                     ulLength) )
            {
                TAF_WARNING_LOG(WUEPS_PID_TAF, "MN_CALL_LineInfo: en_NV_Item_ALS_LINE_Config NV Write Fail!");
            }
        }

        MN_CALL_UpdateAlsLineInfo(stAlsInfo.enAlsLine,VOS_FALSE);
    }
}
VOS_VOID  NAS_CC_ReadCcTimerLenNvim( VOS_VOID )
{
    NAS_CC_NVIM_TIMER_LEN_STRU          stNasCcTimerLen;
    VOS_UINT32                          ulLength;
    VOS_UINT32                          ulTimerLength;

    ulLength = 0;

    ulTimerLength = 0;
    
    PS_MEM_SET(&stNasCcTimerLen, 0, sizeof(NAS_CC_NVIM_TIMER_LEN_STRU));
    
    NV_GetLength(en_NV_Item_CC_TimerLen, &ulLength);	
    if (ulLength > sizeof(NAS_CC_NVIM_TIMER_LEN_STRU))
    {
        return;
    }
    
    if (VOS_OK != NV_Read(en_NV_Item_CC_TimerLen,
                         &stNasCcTimerLen, ulLength))
    {
        NAS_CC_WARN_LOG("NAS_CC_ReadCcTimerLenNvim():WARNING: en_NV_Item_CC_TimerLen Error");

        return;
    }
    
    /* 如果NV中设置的值为0或者大于等于30s,则按照协议默认值30s处理,否则视为有效值,需要进行设置 */
    if ((stNasCcTimerLen.ucT305Len > 0)
      &&(stNasCcTimerLen.ucT305Len < 30))
    {
        /* 更新T305的时长 */
        ulTimerLength = NAS_CC_ONE_THOUSAND_MILLISECOND * ((VOS_UINT32)stNasCcTimerLen.ucT305Len);
        NAS_CC_SetNvTimerLen(TI_NAS_CC_T305, ulTimerLength);
    }
    else
    {
        /* 更新T305的时长 */
        ulTimerLength = 30000;
        NAS_CC_SetNvTimerLen(TI_NAS_CC_T305, ulTimerLength);
    }

    if ((stNasCcTimerLen.ucT308Len > 0)
      &&(stNasCcTimerLen.ucT308Len < 30))
    {
        /* 更新T308的时长 */
        ulTimerLength = NAS_CC_ONE_THOUSAND_MILLISECOND * ((VOS_UINT32)stNasCcTimerLen.ucT308Len);
        NAS_CC_SetNvTimerLen(TI_NAS_CC_T308, ulTimerLength);
    }
    else
    {
        /* 更新T308的时长 */
        ulTimerLength = 30000;
        NAS_CC_SetNvTimerLen(TI_NAS_CC_T308, ulTimerLength);
    }

    return;
}
//*****************************************************************************
// oˉêy??3?: atSetNVRDLenPara
// 1|?ü?èê?: ?áNV3¤?èY
//
// 2?êy?μ?÷:
//   ulIndex [in] ó??§?÷òy
//
// ·μ ?? ?μ:
//    TODO: ...
//
// μ÷ó?òa?ó: TODO: ...
// μ÷ó??ùày: TODO: ...
//*****************************************************************************
VOS_UINT32 atSetNVRDLenPara(VOS_UINT8 ucClientId)
{
    VOS_UINT32 ulRet = ERR_MSP_FAILURE;
    VOS_UINT16 usNVID = 0;
    VOS_UINT32 ulNVLen = 0;


    /*PCLINT*/
    if(ucClientId == 0)
    {

    }

    if(AT_CMD_OPT_SET_PARA_CMD != g_stATParseCmd.ucCmdOptType)
    {
        g_ulNVRDTL = 1;
        return AT_CME_INCORRECT_PARAMETERS;
    }

    if(gucAtParaIndex > 1)
    {
        g_ulNVRDTL = 2;
        return AT_CME_INCORRECT_PARAMETERS;
    }

    if(0 == gastAtParaList[0].usParaLen)
    {
        g_ulNVRDTL = 3;
        return AT_CME_INCORRECT_PARAMETERS;
    }
    else
    {
        usNVID = (VOS_UINT16)gastAtParaList[0].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;
    }

    gstAtSendData.usBufLen = 0;
    gstAtSendData.usBufLen = (VOS_UINT16)At_sprintf(AT_CMD_MAX_LEN, (VOS_CHAR*)pgucAtSndCodeAddr,(VOS_CHAR*)pgucAtSndCodeAddr,
        "^NVRDLEN: %d", ulNVLen);
    g_ulNVRDTL = 7;
    return AT_OK;
}
VOS_VOID TAF_MMA_ReadLcCtrlNvim( VOS_VOID )
{
    TAF_SDC_LC_CONFIG_PARA_STRU        *pstLcConfigInfo = VOS_NULL_PTR;
    TAF_NV_LC_CTRL_PARA_STRU            stLcCtrlInfo;
    VOS_UINT32                          ulResult;
    VOS_UINT32                          ulLength;

    pstLcConfigInfo = TAF_SDC_GetLcConfigPara();

    PS_MEM_SET(&stLcCtrlInfo, 0x00, sizeof(TAF_NV_LC_CTRL_PARA_STRU));

    NV_GetLength(en_NV_Item_LC_Ctrl_PARA, &ulLength);

    ulResult = NV_Read(en_NV_Item_LC_Ctrl_PARA,
                       &stLcCtrlInfo,
                       ulLength);

    if (NV_OK != ulResult)
    {
        return;
    }

    /* NV 内容异常检测,如果内容异常,则不修改当前LC值 */
    if ( (VOS_TRUE                      != stLcCtrlInfo.ucLCEnableFlg)
      && (VOS_FALSE                     != stLcCtrlInfo.ucLCEnableFlg) )
    {
        return;
    }

    if ( (TAF_NVIM_LC_RAT_COMBINED_GUL  != stLcCtrlInfo.enRatCombined)
      && (TAF_NVIM_LC_RAT_COMBINED_CL   != stLcCtrlInfo.enRatCombined)
      && (TAF_NVIM_LC_RAT_COMBINED_BUTT != stLcCtrlInfo.enRatCombined))
    {
        return;
    }

    if ( (TAF_NVIM_LC_INDEPENT_WORK     != stLcCtrlInfo.enLCWorkCfg)
      && (TAF_NVIM_LC_INTER_WORK        != stLcCtrlInfo.enLCWorkCfg)
      && (TAF_NVIM_LC_WORK_CFG_BUTT     != stLcCtrlInfo.enLCWorkCfg) )
    {
        return;
    }

    pstLcConfigInfo->ucLCEnableFlg = stLcCtrlInfo.ucLCEnableFlg;
    pstLcConfigInfo->enRatCombined = stLcCtrlInfo.enRatCombined;
    pstLcConfigInfo->enLCWorkCfg   = stLcCtrlInfo.enLCWorkCfg;

    return;
}
VOS_VOID  TAF_SSA_ReadSsRetryCmSrvRejCfgNvim( VOS_VOID )
{
    TAF_SSA_NVIM_RETRY_CM_SRV_REJ_CFG_STRU      stSsRetryCmSrvRejCfg;
    VOS_UINT32                                  ulLength;

    ulLength = 0;

    /* GCF测试,ss重发功能需要关闭 */
    if (VOS_TRUE == NAS_USIMMAPI_IsTestCard())
    {
        g_stSsaRetryCfgInfo.ucSsRetryCmSrvRejCauseNum = 0;
        return;
    }

    /* 先获取NV的长度 */
    (VOS_VOID)NV_GetLength(en_NV_Item_SS_RETRY_CM_SRV_REJ_CAUSE_CFG, &ulLength);

    PS_MEM_SET(&stSsRetryCmSrvRejCfg, 0x0, sizeof(TAF_SSA_NVIM_RETRY_CM_SRV_REJ_CFG_STRU));

    if (ulLength > sizeof(TAF_SSA_NVIM_RETRY_CM_SRV_REJ_CFG_STRU))
    {
        MN_WARN_LOG("TAF_SSA_ReadSsRetryCmSrvRejCfgNvim():WARNING: en_NV_Item_SS_RETRY_CM_SRV_REJ_CAUSE_CFG length Error");

        g_stSsaRetryCfgInfo.ucSsRetryCmSrvRejCauseNum = 0;
        return;
    }

    /* 如果NV读取失败,则设置为不开启 */
    if (NV_OK != NV_Read(en_NV_Item_SS_RETRY_CM_SRV_REJ_CAUSE_CFG,
                         &stSsRetryCmSrvRejCfg, ulLength))
    {
        MN_WARN_LOG("TAF_SSA_ReadSsRetryCmSrvRejCfgNvim():WARNING: en_NV_Item_SS_RETRY_CM_SRV_REJ_CAUSE_CFG Error");
        g_stSsaRetryCfgInfo.ucSsRetryCmSrvRejCauseNum = 0;
        return;
    }

    if (stSsRetryCmSrvRejCfg.ucSsRetryCmSrvRejCauseNum > TAF_NVIM_SS_RETRY_CAUSE_MAX_NUM)
    {
        stSsRetryCmSrvRejCfg.ucSsRetryCmSrvRejCauseNum = TAF_NVIM_SS_RETRY_CAUSE_MAX_NUM;
    }

    g_stSsaRetryCfgInfo.ucSsRetryCmSrvRejCauseNum = stSsRetryCmSrvRejCfg.ucSsRetryCmSrvRejCauseNum;
    PS_MEM_CPY(g_stSsaRetryCfgInfo.aucSsRetryCmSrvRejCause,
               stSsRetryCmSrvRejCfg.aucSsRetryCmSrvRejCause,
               stSsRetryCmSrvRejCfg.ucSsRetryCmSrvRejCauseNum);
    return;
}
VOS_VOID TAF_MMA_ReadUeSupporttedGuBandNvim(VOS_VOID)
{
    /* 修改硬件频段的读取为32位格式 */
    VOS_UINT32                          aulSptBand[3];
    MMA_UE_SUPPORT_FREQ_BAND_STRU       stUeBand;
    MMA_USER_BAND_SET_UN                uUserSetBand;
    VOS_UINT32                          ulDataLen;

    ulDataLen = 0;

    /*获取 UE支持的 Band */
    PS_MEM_SET(&stUeBand,0x00,sizeof(stUeBand));
    PS_MEM_SET(&uUserSetBand,0x00,sizeof(uUserSetBand));


    PS_MEM_SET(aulSptBand, 0x00, sizeof(aulSptBand));

    NV_GetLength(en_NV_Item_WG_RF_MAIN_BAND, &ulDataLen);

    if (NV_OK != NV_Read(en_NV_Item_WG_RF_MAIN_BAND,aulSptBand,ulDataLen))
    {
        /*打印未成功初始化值,原值保留*/
        MMA_WARNINGLOG("MMA_InitMeInfo():Read en_NV_Item_WG_RF_MAIN_BAND Failed!");
    }
    else
    {
        stUeBand.unWcdmaBand.ulBand = aulSptBand[0];
        gstMmaBandCapa.unWRFSptBand.ulBand = aulSptBand[0];
        MMA_SwitchUESupportBand2UserSetBand(stUeBand,&uUserSetBand);
        gstMmaBandCapa.ulUeWSptBand = uUserSetBand.ulPrefBand;

        PS_MEM_SET(&stUeBand,0x00,sizeof(stUeBand));
        PS_MEM_SET(&uUserSetBand,0x00,sizeof(uUserSetBand));
        /*V9R1 NV数据结构扩展为32位 */
        stUeBand.unGsmBand.ulBand = aulSptBand[2];
        gstMmaBandCapa.unGRFSptBand.ulBand = aulSptBand[2];
        /*V9R1 NV数据结构扩展为32位 */
        MMA_SwitchUESupportBand2UserSetBand(stUeBand,&uUserSetBand);
        gstMmaBandCapa.ulUeGSptBand = uUserSetBand.ulPrefBand;

        gstMmaBandCapa.ulAllUeBand = (gstMmaBandCapa.ulUeGSptBand | gstMmaBandCapa.ulUeWSptBand);
    }

    return;
}
VOS_UINT32  TAF_MMA_ReadLastImsiNvim(
    NAS_MMC_NVIM_LAST_IMSI_STRU        *pstLastImsi
)
{
    VOS_UINT32                          ulResult;
    VOS_UINT32                          ulLength;

    NV_GetLength(en_NV_Item_Last_Imsi, &ulLength);

    ulResult = NV_Read(en_NV_Item_Last_Imsi, pstLastImsi, ulLength);

    if (NV_OK != ulResult)
    {
        return MMA_FAILURE;
    }

    return MMA_SUCCESS;
}
VOS_UINT32  TAF_MMA_ReadLastTinInfoNvim(
    NAS_NVIM_TIN_INFO_STRU             *pstTinInfo
)
{
    VOS_UINT32                          ulResult;
    VOS_UINT32                          ulLength;

    NV_GetLength(en_NV_Item_TIN_INFO, &ulLength);

    ulResult = NV_Read(en_NV_Item_TIN_INFO, pstTinInfo, sizeof(NAS_NVIM_TIN_INFO_STRU));

    if (NV_OK != ulResult)
    {
        return MMA_FAILURE;
    }

    return MMA_SUCCESS;
}
VOS_VOID TAF_MMA_WritePlmnSelectionModeNvim(VOS_UINT8 ucReselMode)
{
    NAS_NVIM_SELPLMN_MODE_STRU          stPlmnSelMode;
    VOS_UINT32                          ulNvLength;

    ulNvLength                  = 0;
    stPlmnSelMode.usSelPlmnMode = ucReselMode;

    NV_GetLength(en_NV_Item_SelPlmn_Mode, &ulNvLength);

    if (NV_OK != NV_Write(en_NV_Item_SelPlmn_Mode,
                      &stPlmnSelMode,
                      ulNvLength))
    {
        MN_WARN_LOG("TAF_MMA_WritePlmnSelectionModeNvim:WARNING:  read en_NV_Item_SelPlmn_Mode fail");
    }

    return;
}
VOS_VOID TAF_MMA_ReadNotDisplayLocalNetworkNameNvim(VOS_VOID)
{
    VOS_UINT32                                              ulLength;
    TAF_MMA_NOT_DISPLAY_LOCAL_NETWORKNAME_NVIM_STRU         stNotDisplayLocalNetworkNameStru;

    PS_MEM_SET(&stNotDisplayLocalNetworkNameStru, 0x00, sizeof(TAF_MMA_NOT_DISPLAY_LOCAL_NETWORKNAME_NVIM_STRU));
    NV_GetLength(en_NV_Item_NotDisplayLocalNetworkName, &ulLength);

    /* 从NV中获取用户配置的是否显示本地的全球运营商信息标志 */
    if (NV_OK == NV_Read(en_NV_Item_NotDisplayLocalNetworkName,
                         &stNotDisplayLocalNetworkNameStru,
                         ulLength))
    {
       gstMmaValue.ucNotDisplayLocalNetworkNameFlg = stNotDisplayLocalNetworkNameStru.ucNotDisplayLocalNetworkNameFlg;
    }


    return;
}
VOS_VOID  TAF_MMA_ReadSimLockMaxTimesNvim( VOS_VOID )
{
    TAF_CUSTOM_SIM_LOCK_MAX_TIMES_STRU  stSimLockMaxTimes;
    VOS_UINT32                          ulResult;
    VOS_UINT32                          ulLength;

    PS_MEM_SET(&stSimLockMaxTimes, 0x00, sizeof(stSimLockMaxTimes));
    ulLength = 0;

    /* 先获取NV的长度 */
    NV_GetLength(en_NV_Item_CustomizeSimLockMaxTimes, &ulLength);

    if (ulLength > sizeof(TAF_CUSTOM_SIM_LOCK_MAX_TIMES_STRU))
    {
        NAS_ERROR_LOG(WUEPS_PID_MMA,"TAF_MMA_ReadNvimCustomizeSimLockMaxTimes():WARNING: en_NV_Item_CustomizeSimLockMaxTimes length Error");
        g_MmaNewValue.stSimLockMaxTimes.ulStatus = VOS_FALSE;
        g_MmaNewValue.stSimLockMaxTimes.ulLockMaxTimes = TAF_PH_CARDLOCK_DEFAULT_MAXTIME;
        return;
    }

    ulResult = NV_Read(en_NV_Item_CustomizeSimLockMaxTimes,
                               &stSimLockMaxTimes,
                               sizeof(stSimLockMaxTimes));

    if (NV_OK != ulResult)
    {
        g_MmaNewValue.stSimLockMaxTimes.ulStatus        = VOS_FALSE;
        g_MmaNewValue.stSimLockMaxTimes.ulLockMaxTimes  = TAF_PH_CARDLOCK_DEFAULT_MAXTIME;
    }
    else
    {
        if (VOS_FALSE == stSimLockMaxTimes.ulStatus)
        {
            g_MmaNewValue.stSimLockMaxTimes.ulLockMaxTimes = TAF_PH_CARDLOCK_DEFAULT_MAXTIME;
        }
        else
        {
            g_MmaNewValue.stSimLockMaxTimes = stSimLockMaxTimes;
        }
    }

    return;
}
Exemplo n.º 26
0
VOS_VOID TAF_APS_ReadPdpActLimitFlgFromNv(VOS_VOID)
{
    TAF_APS_NVIM_PDP_ACT_LIMIT_STRU     stNvPdpActLimit;
    TAF_APS_PDP_ACT_LIMIT_INFO_STRU    *pstPdpActLimitInfo = VOS_NULL_PTR;
    VOS_UINT32                          ulLength;

    ulLength = 0;


    PS_MEM_SET(&stNvPdpActLimit, 0x00, sizeof(TAF_APS_NVIM_PDP_ACT_LIMIT_STRU));

    NV_GetLength(en_NV_Item_Pdp_Act_Limit_Para, &ulLength);
    if (ulLength > sizeof(stNvPdpActLimit))
    {
        return;
    }

    /* 从en_NV_Item_Pdp_Act_Limit_Para中读取PDP激活受限标志 */
    if (NV_OK !=  NV_Read(en_NV_Item_Pdp_Act_Limit_Para,
                          &stNvPdpActLimit,
                          ulLength))
    {
        TAF_ERROR_LOG(WUEPS_PID_TAF, "TAF_APS_ReadPdpActLimitFlgFromNv:NVIM Read Failed");

        return;
    }

    /* PDP激活受限标志有效性检查 */
    if ((stNvPdpActLimit.ucNvimActiveFlg != VOS_TRUE)
     && (stNvPdpActLimit.ucNvimActiveFlg != VOS_FALSE))
    {
        TAF_ERROR_LOG(WUEPS_PID_TAF, "TAF_APS_ReadPdpActLimitFlgFromNv:NVIM Is Anavil");
        return;
    }

    pstPdpActLimitInfo = TAF_APS_GetPdpActLimitInfoAddr();

    pstPdpActLimitInfo->ucPdpActLimitFlg = stNvPdpActLimit.ucNvimActiveFlg;

    return;
}
VOS_VOID  NAS_CC_ReadCcbsNvim( VOS_VOID )
{
    NAS_CC_NVIM_CCBS_SUPPORT_FLG_STRU   stCcbsSupportFlg;
    NAS_CC_CUSTOM_CFG_INFO_STRU        *pstCcbsSupportFlg = VOS_NULL_PTR;
    VOS_UINT32                          ulLength;

    ulLength = 0;
    

    stCcbsSupportFlg.ucCcbsSupportFlg = NAS_CC_NV_ITEM_DEACTIVE;

    pstCcbsSupportFlg = NAS_CC_GetCustomCfgInfo();
    
    NV_GetLength(en_NV_Item_NVIM_CCBS_SUPPORT_FLG, &ulLength);	
    if (ulLength > sizeof(NAS_NVIM_CCBS_SUPPORT_FLG_STRU))
    {
        return;
    }
    
    if (VOS_OK != NV_Read(en_NV_Item_NVIM_CCBS_SUPPORT_FLG,
                         &stCcbsSupportFlg, ulLength))
    {
        NAS_CC_WARN_LOG("NAS_CC_ReadCcbsNvim():WARNING: en_NV_Item_NVIM_CCBS_SUPPORT_FLG Error");

        return;
    }


    if ((NAS_CC_NV_ITEM_ACTIVE != stCcbsSupportFlg.ucCcbsSupportFlg)
     && (NAS_CC_NV_ITEM_DEACTIVE != stCcbsSupportFlg.ucCcbsSupportFlg))
    {
        pstCcbsSupportFlg->ucCcbsSupportFlg = NAS_CC_NV_ITEM_DEACTIVE;
        NAS_CC_WARN_LOG("NAS_CC_ReadCcbsNvim():WARNING: NV parameter Error");
        return;
    }

    pstCcbsSupportFlg->ucCcbsSupportFlg = stCcbsSupportFlg.ucCcbsSupportFlg;

    return;
}
VOS_VOID TAF_MMA_ReadWaitImsVoiceCapTimerLenNvim(VOS_VOID)
{
    TAF_NVIM_WAIT_IMS_VOICE_AVAIL_TIMER_LEN_STRU            stImsVoiceAvailTimerLen;
    VOS_UINT32                                              ulLength;

    PS_MEM_SET(&stImsVoiceAvailTimerLen, 0x00, sizeof(stImsVoiceAvailTimerLen));
    ulLength = 0;

    /* 先获取NV的长度 */
    NV_GetLength(en_NV_Item_WAIT_IMS_VOICE_AVAIL_Timer_Len, &ulLength);

    if (ulLength > sizeof(TAF_NVIM_WAIT_IMS_VOICE_AVAIL_TIMER_LEN_STRU))
    {
        MN_WARN_LOG("TAF_MMA_ReadWaitImsVoiceCapTimerLenNvim(): en_NV_Item_WAIT_IMS_VOICE_AVAIL_Timer_Len length Error");
        return;
    }

    /* 读NV失败 */
    if (NV_OK != NV_Read(en_NV_Item_WAIT_IMS_VOICE_AVAIL_Timer_Len,
                         &stImsVoiceAvailTimerLen, ulLength))
    {
        MN_WARN_LOG("TAF_MMA_ReadWaitImsVoiceCapTimerLenNvim(): en_NV_Item_WAIT_IMS_VOICE_AVAIL_Timer_Len error");
        return;
    }

    if (VOS_TRUE == stImsVoiceAvailTimerLen.ucNvimActiveFlag)
    {
        /* NV的长度为0使用默认时长,NV的单位为S,需要转换为毫秒 */
        if (0 == stImsVoiceAvailTimerLen.ucWaitImsVoiceAvailTimerLen)
        {
            TAF_SDC_SetWaitImsVoiceAvailTimerLen(TI_TAF_SDC_WAIT_IMSA_IMS_VOICE_AVAIL_IND_LEN);
        }
        else
        {
            TAF_SDC_SetWaitImsVoiceAvailTimerLen(stImsVoiceAvailTimerLen.ucWaitImsVoiceAvailTimerLen * TAF_SDC_ONE_THOUSAND_MILLISECOND);
        }
    }

    return;
}
VOS_VOID  MN_CAL_ReadAlsSupportNvim( VOS_VOID )
{
    MN_CALL_NVIM_ALS_SUPPORT_FLG_STRU                       stAlsSupportFlg;
    MN_CALL_CUSTOM_CFG_INFO_STRU                           *pstCustomCfg = VOS_NULL_PTR;
    VOS_UINT32                                              ulLength;

    ulLength                        = 0;

    stAlsSupportFlg.ucAlsSupportFlg = MN_CALL_NV_ITEM_DEACTIVE;

    pstCustomCfg = MN_CALL_GetCustomCfgInfo();
    
    NV_GetLength(en_NV_Item_NVIM_ALS_SUPPORT_FLG, &ulLength);	
    if (ulLength > sizeof(MN_CALL_NVIM_ALS_SUPPORT_FLG_STRU))
    {
        return;
    }
    
    if (NV_OK != NV_Read(en_NV_Item_NVIM_ALS_SUPPORT_FLG,
                         &stAlsSupportFlg, ulLength))
    {
        MN_WARN_LOG("MN_CAL_ReadAlsSupportNvim():WARNING: en_NV_Item_NVIM_ALS_SUPPORT_FLG Error");

        return;
    }


    if ((MN_CALL_NV_ITEM_ACTIVE != stAlsSupportFlg.ucAlsSupportFlg)
     && (MN_CALL_NV_ITEM_DEACTIVE != stAlsSupportFlg.ucAlsSupportFlg))
    {
        pstCustomCfg->ucAlsSupportFlg = MN_CALL_NV_ITEM_DEACTIVE;
        MN_WARN_LOG("MN_CAL_ReadAlsSupportNvim():WARNING: NV parameter Error");
        return;
    }

    pstCustomCfg->ucAlsSupportFlg = stAlsSupportFlg.ucAlsSupportFlg;

    return;
}
VOS_VOID NAS_UTRANCTRL_WriteUtranModeNvim(
    NAS_UTRANCTRL_UTRAN_MODE_ENUM_UINT8  enCurrentUtranMode
)
{
    NAS_UTRANCTRL_NVIM_UTRAN_MODE_STRU  stUtranMode;
    VOS_UINT32                          ulNvLength;

    stUtranMode.ucReserve   = 0;
    stUtranMode.ucUtranMode = enCurrentUtranMode;
    ulNvLength              = 0;

    /* 从NV中获取en_NV_Item_Utran_Mode NV项内容 */
    NV_GetLength(en_NV_Item_Utran_Mode, &ulNvLength);
    if ( NV_OK != NV_Write(en_NV_Item_Utran_Mode, &stUtranMode, ulNvLength) )
    {
        NAS_ERROR_LOG(WUEPS_PID_MMC, "NAS_UTRANCTRL_WriteUtranModeNvim:ERROR: NV_Write Error");

        return;
    }

    return;
}