javaextensions/satsa/apdu/src.s60/cstsmanagechannel.h
changeset 21 2a9601315dfc
equal deleted inserted replaced
18:e8e63152f320 21:2a9601315dfc
       
     1 /*
       
     2 * Copyright (c) 2008 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:
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CSTSMANAGECHANNEL_H
       
    20 #define CSTSMANAGECHANNEL_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include "cstscmdapdu.h"
       
    24 #include "stsapduconstants.h"
       
    25 
       
    26 namespace java
       
    27 {
       
    28 namespace satsa
       
    29 {
       
    30 
       
    31 // CLASS DECLARATION
       
    32 /**
       
    33  *  Detailed command APDU class for Manage Channel apdu.
       
    34  *
       
    35  *  @since 3.0
       
    36  */
       
    37 NONSHARABLE_CLASS(CSTSManageChannel): public CSTSCmdApdu
       
    38 {
       
    39 public: // data types
       
    40     enum TSTSManageChannelApduType
       
    41     {
       
    42         ESTSOpenChannel,
       
    43         ESTSCloseChannel
       
    44     };
       
    45 
       
    46 public: // Constructors and destructor
       
    47     /**
       
    48      * Two-phased constructor.
       
    49      * @param aChannel Channel number which will be used. If using open
       
    50      *  channel purposes, this parameter is not used anywhere.
       
    51      * @param aType Type of the manage channel apdu
       
    52      * @param aStandard Apdu standard
       
    53      */
       
    54     static CSTSManageChannel* NewLC(TInt aChannel,
       
    55                                     TSTSManageChannelApduType aType,
       
    56                                     CSTSApdu::TSTSApduStandard aStandard);
       
    57 
       
    58     static CSTSManageChannel* NewL(TInt aChannel,
       
    59                                    TSTSManageChannelApduType aType,
       
    60                                    CSTSApdu::TSTSApduStandard aStandard);
       
    61 
       
    62 public: // New functions
       
    63 
       
    64     /**
       
    65      * Sets type of manage channel apdu and channel which will be closed.
       
    66      * @since 3.0
       
    67      * @param Type of Manage Channel apdu
       
    68      * @param aChannel In close channel case contains channel, which will
       
    69      * be closed. Other cases this parameter is not used at all (zero can
       
    70      * be used).
       
    71      */
       
    72     void SetApduType(TSTSManageChannelApduType aType, TInt aChannel);
       
    73 
       
    74 private: // New functions
       
    75 
       
    76     /**
       
    77      * C++ default constructor.
       
    78      */
       
    79     CSTSManageChannel();
       
    80 
       
    81     /**
       
    82      * Generates P1 and P2 values depending of Manage Channel apdu type
       
    83      * @since 3.0
       
    84      * @param aP1 Reference to P1
       
    85      * @param aP2 Reference to P2
       
    86      * @param aMaxLength Reference to maximum length
       
    87      * @param aType Type of Manage Channel apdu
       
    88      */
       
    89     void GenerateP1P2(TUint8& aP1,
       
    90                       TUint8& aP2,
       
    91                       TInt aChannel,
       
    92                       TSTSManageChannelApduType aType);
       
    93 
       
    94 protected: // New functions
       
    95 
       
    96     /**
       
    97      * Protected construction to allow derivation
       
    98      */
       
    99     void ConstructL(TInt aChannel,
       
   100                     TSTSManageChannelApduType aType,
       
   101                     CSTSApdu::TSTSApduStandard aStandard);
       
   102 
       
   103 private: // Data
       
   104 
       
   105     TSTSManageChannelApduType iType;
       
   106 
       
   107 };
       
   108 
       
   109 } // namespace satsa
       
   110 } // namespace java
       
   111 #endif // CSTSMANAGECHANNEL_H
       
   112 // End of File