wim/inc/ScardReader.h
changeset 0 164170e6151a
child 5 3b17fc5c9564
equal deleted inserted replaced
-1:000000000000 0:164170e6151a
       
     1 /*
       
     2 * Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  This file contains definition of abstract Card Reader interface
       
    15 *               class from which the final Reader classes in Reader Handler 
       
    16 *               level are derived.
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 
       
    22 #ifndef CSCARDREADER_H
       
    23 #define CSCARDREADER_H
       
    24 
       
    25 //  INCLUDES
       
    26 #include "ScardBase.h"
       
    27 #include "ScardDefs.h"
       
    28 
       
    29 //  CONSTANTS  
       
    30 
       
    31 // The UID for Card Reader DLLs.
       
    32 // The client imposes this on DLLs which are required
       
    33 // to satisfy the protocol 
       
    34 const TInt KReaderUidValue = 0x1000086E;
       
    35 const TUid KReaderUid      = {KReaderUidValue};
       
    36 
       
    37 // CLASS DECLARATION
       
    38 
       
    39 /**
       
    40 *  Smart card reader. 
       
    41 *
       
    42 *  @lib Scard.lib
       
    43 *  @since Series60 2.1
       
    44 */
       
    45 class MScardReader
       
    46     {
       
    47     public: 
       
    48         
       
    49         /**
       
    50         * Initializes the Card Reader. Implementations of this method must carry
       
    51         * out all steps required to set the concrete reader into a proper state.
       
    52         * After invoking this method it should be possible to communicate with 
       
    53         * the reader properly.
       
    54         * @param aStatus Request status
       
    55         * @return void
       
    56         */
       
    57         virtual void Open( TRequestStatus& aStatus ) = 0; 
       
    58 
       
    59         /**
       
    60         * Closes the Card Reader. Implementations of this method must carry out
       
    61         * all steps required to close the concrete terminal and free resources 
       
    62         * held by it.
       
    63         * @return Symbian error code
       
    64         */
       
    65         virtual TInt Close() = 0;
       
    66 
       
    67         /**
       
    68         * Cancel any pending requests (if any)
       
    69         * @return void
       
    70         */
       
    71         virtual void CancelTransmit() = 0;
       
    72 
       
    73         /**
       
    74         * Return the ATR bytes. 
       
    75         * @param anATR ATR
       
    76         * @return Symbian error code
       
    77         */
       
    78         virtual TInt GetATR( TScardATR& anATR ) = 0;
       
    79         
       
    80         /**
       
    81         * Return the value corresponding to the specified TAG parameter
       
    82         * @param aStatus Request status
       
    83         * @param aTag Tag
       
    84         * @param aValue Value for capabilities
       
    85         * @param aTimeout Timeout
       
    86         * @return ETrue/EFalse
       
    87         */
       
    88         virtual TBool GetCapabilities( TRequestStatus& aStatus, 
       
    89                                        const TInt32 aTag,
       
    90                                        TPtr8& aValue,
       
    91                                        const TInt32 aTimeout ) = 0;
       
    92 
       
    93         /**
       
    94         * Send a Command(APDU) to the card and return Response(APDU)
       
    95         * received from card.
       
    96         * @param aStatus Request status
       
    97         * @param aCommand Command APDU 
       
    98         * @param aResponse Response APDU
       
    99         * @param aTimeout Timeout
       
   100         * @return void
       
   101         */
       
   102         virtual void TransmitToCard( TRequestStatus& aStatus, 
       
   103                                      const TPtrC8& aCommand, 
       
   104                                      TPtr8& aResponse,
       
   105                                      const TInt32 aTimeout ) = 0;
       
   106 
       
   107     };
       
   108     
       
   109 #endif      // CSCARDREADER_H
       
   110 
       
   111 // End of File