⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 uicc_test.c

📁 MMI层OBJ不能完全编译
💻 C
字号:
/*=============================================================================
 *     Copyright 2001-2002 Texas Instruments. All Rights Reserved.
 */


#include "main_system.h"
#include "main_app.h"
#include "uicc_UiccEh.h"
#include "puf_PrimHdr.h"
#include "uicc_Test.h"
#include "bspUicc.h"


/* Test Data structures */
SYS_UWORD8                       uicc_Test_resetData[32];
SYS_UWORD8                       uicc_Test_commandBuffer[64];

/*=============================================================================
 * Description:
 *   Handle the Uicc physical layer init request test primitive
 */
void uicc_Test_handlePhyInitReq(Puf_PrimHdr *primPtr)
{
    Uicc_UiccEh_PhyInitCnf  *cnfPrimPtr;
    /* A Physical layer init Powers off the card and gets ready for a brand new test */

    bspUicc_powerOff();


    cnfPrimPtr = (Uicc_UiccEh_PhyInitCnf *)puf_PrimHdr_new( UICC_UICCEH_PHY_INIT_CNF,
                    (Puf_PrimHdr_Length) ( sizeof(Uicc_UiccEh_PhyInitCnf) -
                                               sizeof( Puf_PrimHdr ) ),
                    puf_PrimHdr_getSourceEH( (Puf_PrimHdr *)primPtr),
                    puf_PrimHdr_getReturnQID( (Puf_PrimHdr *)primPtr),
                    PUF_PRIMHDR_QUEUE_CODE_ASYNC );

    puf_PrimHdr_sendPrim( (Puf_PrimHdr *) cnfPrimPtr );

    return;
    
}

/*===========================================================================
 * Description:
 * Handle the Uicc physical layer config request test primitive
 */
void uicc_Test_handlePhyConfigReq(Uicc_UiccEh_PhyConfigReq *primPtr)
{

    return;

}
/*===========================================================================
 * Description:
 * Handle the Uicc physical layer Read request test primitive
 */
void uicc_Test_handlePhyReadReq(Uicc_UiccEh_PhyReadReq *primPtr)
{

    return;
    
}
/*===========================================================================
 * Description:
 * Handle the Uicc physical layer Write request test primitive
 */ 
void uicc_Test_handlePhyWriteReq(Uicc_UiccEh_PhyWriteReq *primPtr)
{

}
/*===========================================================================
 * Description:
 * Handle the Uicc physical layer Reset request test primitive
 */
void uicc_Test_handlePhyResetReq(Uicc_UiccEh_PhyResetReq *primPtr)
{

    return;
}

/*===========================================================================
 * Description:
 * Test function to be called when a Card insert interrupt is received
 */ 
void uicc_Test_insert(void)
{
     Uicc_UiccEh_CardInsertInd  *primPtr;

     primPtr = (Uicc_UiccEh_CardInsertInd *)puf_PrimHdr_new( UICC_UICCEH_CARD_INSERT_IND,
                                                             (Puf_PrimHdr_Length) ( sizeof(Uicc_UiccEh_CardInsertInd) -
                                                                                    sizeof( Puf_PrimHdr ) ),
                                                             257,
                                                             0,
                                                             0 );
     /* Send the primitive */
     puf_PrimHdr_sendPrim( (Puf_PrimHdr *) primPtr );
}

/*===========================================================================
 * Description:
 * Test function to be called when a Card extract interrupt is received
 */
void uicc_Test_remove(void)
{
    Uicc_UiccEh_CardRemoveInd  *primPtr;

    primPtr = (Uicc_UiccEh_CardRemoveInd *)puf_PrimHdr_new( UICC_UICCEH_CARD_INSERT_IND,
                                                            (Puf_PrimHdr_Length) ( sizeof(Uicc_UiccEh_CardRemoveInd) -
                                                                                   sizeof( Puf_PrimHdr ) ),
                                                            257,
                                                            0,
                                                            PUF_PRIMHDR_QUEUE_CODE_ASYNC );
    /* Send the primitive */
    puf_PrimHdr_sendPrim( (Puf_PrimHdr *) primPtr );    
}

/*===========================================================================
 * Description:
 * Test function to be called when a Card extract interrupt is received
 */
void uicc_Test_handleInitReq( Uicc_UiccEh_InitReq *primPtr ) 
{
    Uicc_UiccEh_InitCnf  *cnfPrimPtr;

      bspUicc_init( uicc_Test_insert, uicc_Test_remove );
      
      cnfPrimPtr = ( Uicc_UiccEh_InitCnf *)puf_PrimHdr_new( UICC_UICCEH_INIT_CNF,
                    ( Puf_PrimHdr_Length ) ( sizeof(Uicc_UiccEh_InitCnf) -
                     sizeof( Puf_PrimHdr ) ),
                    puf_PrimHdr_getSourceEH( (Puf_PrimHdr *)primPtr),
                    puf_PrimHdr_getReturnQID( (Puf_PrimHdr *)primPtr),
                    PUF_PRIMHDR_QUEUE_CODE_ASYNC );
    
    /* Send the primitive */
    puf_PrimHdr_sendPrim( (Puf_PrimHdr *) cnfPrimPtr );
    return;
    
}



/*===========================================================================
 * Description:
 * Test function to handle the Test reset
 */
void uicc_Test_handleResetReq( Uicc_UiccEh_ResetReq *primPtr )
{
    Uicc_UiccEh_ResetCnf  *cnfPrimPtr;
    SYS_UWORD8                 i;
    BspUicc_ResetResult      result;
    
    for(i= 0;i<32;i++)
    {
        uicc_Test_resetData[i] = 0;
    }

    result = bspUicc_reset( uicc_Test_resetData );
    
    cnfPrimPtr = ( Uicc_UiccEh_ResetCnf *)puf_PrimHdr_new( UICC_UICCEH_RESET_CNF,
                  ( Puf_PrimHdr_Length) ( sizeof(Uicc_UiccEh_ResetCnf) -
                                          sizeof( Puf_PrimHdr ) ),
                    puf_PrimHdr_getSourceEH( (Puf_PrimHdr *)primPtr),
                    puf_PrimHdr_getReturnQID( (Puf_PrimHdr *)primPtr),
                    PUF_PRIMHDR_QUEUE_CODE_ASYNC );


    for(i =0; i < 32; i++)
    {
        cnfPrimPtr->resetData[i] = uicc_Test_resetData[i];
    }

    cnfPrimPtr->resetData[31] = result;
    
    puf_PrimHdr_sendPrim( (Puf_PrimHdr *) cnfPrimPtr );
    
    return;
    
}


/*===========================================================================
 * Description:
 * Test function to handle the send command request
 */
void uicc_Test_handleSendCommandReq( Uicc_UiccEh_SendCommandReq *primPtr)
{
    

    return;

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -