VOS_UINT32 USIMM_GetCardType_Instance(
    MODEM_ID_ENUM_UINT16                enModemID,
    VOS_UINT8                          *pucCardStatus,
    VOS_UINT8                          *pucCardType)
{
    if (MODEM_ID_0 == enModemID)
    {
        USIMM_NORMAL_LOG("USIMM_GetCardType_Instance: call USIMM_GetCardType");

        return USIMM_GetCardType(pucCardStatus, pucCardType);
    }

#if (FEATURE_MULTI_MODEM == FEATURE_ON)
    if (MODEM_ID_1 == enModemID)
    {
        USIMM_NORMAL_LOG("USIMM_GetCardType_Instance: call I1_USIMM_GetCardType");

        return I1_USIMM_GetCardType(pucCardStatus, pucCardType);
    }
#endif

    USIMM_ERROR_LOG("USIMM_GetCardType_Instance: Para Is Error");

    return USIMM_API_WRONG_PARA;
}
VOS_VOID STK_GetProfileInfo(VOS_UINT8 **ppucProfile, VOS_UINT8 *pucProfileLen)
{
    VOS_UINT8                           ucCardType;

    USIMM_GetCardType(VOS_NULL_PTR, &ucCardType);

    if (USIMM_CARD_USIM == ucCardType)
    {
        if (VOS_NULL == g_stSTKProfileContent.stUsimProfile.ucProfileLen)
        {
            STK_ProfileInit(&g_stSTKProfileContent, ucCardType);            
        }

        *ppucProfile = g_stSTKProfileContent.stUsimProfile.aucProfile;
        *pucProfileLen = g_stSTKProfileContent.stUsimProfile.ucProfileLen;
    }
    else
    {
        if (VOS_NULL == g_stSTKProfileContent.stSimProfile.ucProfileLen)
        {
            STK_ProfileInit(&g_stSTKProfileContent, ucCardType); 
        }
        
        *ppucProfile = g_stSTKProfileContent.stSimProfile.aucProfile;
        *pucProfileLen = g_stSTKProfileContent.stSimProfile.ucProfileLen;
    }

    return;
}
VOS_UINT32 CSIMA_CBP_TerminalResponseMsgProc(CSIMA_CBP_TERMINALRESPONSE_MSG_STRU *pstMsg)
{
    VOS_UINT32                          ulRslt;
    VOS_UINT8                           ucCardStatus;
    VOS_UINT8                           ucCardType;

    USIMM_GetCardType(&ucCardStatus, &ucCardType);

    /* 无卡时直接发到USIMM模块处理 */
    if (USIMM_CARD_NOCARD == ucCardType)
    {
        ulRslt = USIMM_CbpTerminalResponseReq(WUEPS_PID_CSIMA, (VOS_UINT8)pstMsg->usDataLen, pstMsg->aucData);
    }
    /* 有卡时直接发到STK模块处理,因为还要有释放STK解码过程中动态申请的内存 */
    else
    {
        ulRslt = SI_STK_CLSndTrMsg(pstMsg->usDataLen, pstMsg->aucData);
    }

    return ulRslt;
}
Beispiel #4
0
VOS_UINT32 SI_PB_GetEccNumber(SI_PB_ECC_DATA_STRU *pstEccData)
{
    VOS_UINT32                          ulResult;
    VOS_UINT8                           ucPBOffset=0;
    VOS_UINT8                          *ptemp;
    VOS_UINT32                          ulNum;
    VOS_UINT8                           i,j;
    VOS_UINT8                           ucCardStatus;
    VOS_UINT8                           ucCardType;

    ulResult = SI_PB_LocateRecord(PB_ECC, 1, 1, &ucPBOffset);

    if(VOS_OK != ulResult)     /*当前电话本不存在或者初始化未完成*/
    {
        PB_ERROR_LOG("SI_PB_GetEccNumber Error: SI_PB_LocateRecord Return Failed");

        pstEccData->bEccExists = SI_PB_CONTENT_INVALID;
        pstEccData->ulReocrdNum= VOS_NULL;

        return VOS_ERR;
    }

    pstEccData->bEccExists = SI_PB_CONTENT_VALID;

    ulNum = ((gastPBContent[ucPBOffset].usTotalNum>USIM_MAX_ECC_RECORDS)?USIM_MAX_ECC_RECORDS:gastPBContent[ucPBOffset].usTotalNum);

    ptemp = gastPBContent[ucPBOffset].pContent;

    for(i=0,j=0; i<ulNum; i++)   /*根据数据结构最大长度循环*/
    {
        ulResult = SI_PB_CheckEccValidity(ptemp);

        if(VOS_ERR == ulResult)     /*当前记录内容无效*/
        {
            PB_INFO_LOG("SI_PB_GetEccNumber Info: The Ecc Number is Empty");
        }
        else                                /*转换当前记录内容*/
        {
            PB_INFO_LOG("SI_PB_GetEccNumber Info: The Ecc Number is Not Empty");

            USIMM_GetCardType(&ucCardStatus, &ucCardType);

            VOS_MemCpy(pstEccData->astEccRecord[j].aucEccCode,
                                    ptemp, gastPBContent[ucPBOffset].ucNumberLen);

            if (USIMM_CARD_USIM == ucCardType)
            {
                pstEccData->astEccRecord[j].bESC = SI_PB_CONTENT_VALID;

                VOS_MemCpy(pstEccData->astEccRecord[j].AlphaIdentifier,
                           &ptemp[gastPBContent[ucPBOffset].ucNumberLen],
                           gastPBContent[ucPBOffset].ucNameLen);

                pstEccData->astEccRecord[j].ucESC = ptemp[gastPBContent[ucPBOffset].ucRecordLen - 1];
            }

            j++;
        }

        ptemp += gastPBContent[ucPBOffset].ucRecordLen;
    }

    pstEccData->ulReocrdNum = j;

    return VOS_OK;
}