wim/inc/ScardDefs.h
changeset 0 164170e6151a
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:  Definitions for smart card
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef SCARDDEFS_H
       
    20 #define SCARDDEFS_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include <e32base.h>
       
    24 
       
    25 // FORWARD DECLARATIONS (these has to be before data types)
       
    26 class CScardCommandTimer;
       
    27 
       
    28 const TInt KScardReaderMaxNameLength = 32; // Maximum data lengths
       
    29 
       
    30 //  DATA TYPES  
       
    31 
       
    32 // Database string aliases
       
    33 typedef TBuf<KScardReaderMaxNameLength> TScardReaderName;
       
    34 
       
    35 typedef TInt16 TReaderID;
       
    36 typedef TInt16 TGroupID;
       
    37 
       
    38 enum TScardServiceStatus
       
    39     {
       
    40     EScardReseted,
       
    41     EScardInserted,
       
    42     EScardRemoved,
       
    43     EReaderRemoved,
       
    44     ECommunicationError
       
    45     };
       
    46 
       
    47 enum TPowerAction
       
    48     {
       
    49     EScardPowerUp,
       
    50     EScardPowerDown,
       
    51     EScardReset
       
    52     };
       
    53 
       
    54 enum TScChannelManagement
       
    55     {
       
    56     EOpenAnyChannel = 1,
       
    57     ECloseChannel,
       
    58     EChannelStatus
       
    59     };
       
    60 
       
    61 //  CScardAccessControl & CScardMessageRegistry
       
    62 struct TMessageHandle
       
    63     {
       
    64     RMessage2    iMessage;
       
    65     TInt        iSessionID;
       
    66     TReaderID   iReaderID;
       
    67     TBool       iCancelled;
       
    68     TInt8       iChannel;
       
    69 
       
    70     CScardCommandTimer* iTimer;
       
    71     TInt        iAdditionalParameter;
       
    72 
       
    73     TMessageHandle( const RMessage2& aMessage,
       
    74                     const TInt aSessionID,
       
    75                     const TReaderID aReaderID,
       
    76                     const TInt8 aChannel, 
       
    77                     const TInt8 aAddition = 0 );
       
    78     TMessageHandle();
       
    79     };
       
    80 
       
    81 //  CScardConnector & CScardEventStack
       
    82 struct TQueueEvent
       
    83     {
       
    84     TReaderID   iReaderID;
       
    85     TScardServiceStatus iEventType;
       
    86     };
       
    87 
       
    88 // Answer To Reset
       
    89 const TInt KMaxATRBytes           = 33; 
       
    90 const TInt KMaxATRHistoricalBytes = 15;
       
    91 typedef TBuf8<KMaxATRBytes> TScardATR; // ATR bytes
       
    92 
       
    93 #endif      // SCARDDEFS_H
       
    94 
       
    95 // End of File