|
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 CSTSCHANNELMANAGER_H |
|
20 #define CSTSCHANNELMANAGER_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 |
|
25 namespace java |
|
26 { |
|
27 namespace satsa |
|
28 { |
|
29 |
|
30 // FORWARD DECLARATIONS |
|
31 class CSTSApduExchanger; |
|
32 class CSTSConnection; |
|
33 class CSTSManageChannel; |
|
34 class CSTSManageChannelResp; |
|
35 |
|
36 // CLASS DECLARATION |
|
37 |
|
38 /** |
|
39 * Handels the channel related operations of connection. |
|
40 * Used for opening and closing logical channels. |
|
41 * |
|
42 * @since 3.0 |
|
43 */ |
|
44 NONSHARABLE_CLASS(CSTSChannelManager): public CBase |
|
45 { |
|
46 public: // Constructors and destructor |
|
47 |
|
48 /** |
|
49 * Two-phased constructor. |
|
50 */ |
|
51 static CSTSChannelManager* NewL(CSTSApduExchanger* aApduExchanger); |
|
52 |
|
53 /** |
|
54 * Destructor. |
|
55 */ |
|
56 virtual ~CSTSChannelManager(); |
|
57 |
|
58 public: // New functions |
|
59 |
|
60 /** |
|
61 * Requests free channel from the card. |
|
62 * @since 3.0 |
|
63 * @return Opened channel or -1 if no free channel available or |
|
64 * other error code |
|
65 */ |
|
66 TInt RequestChannel(); |
|
67 |
|
68 /** |
|
69 * Closes the gived channel. |
|
70 * @since 3.0 |
|
71 * @param aChannel Channel which will be closed |
|
72 * @return Error code |
|
73 */ |
|
74 TInt CloseChannel(TInt aChannel); |
|
75 |
|
76 private: |
|
77 |
|
78 /** |
|
79 * C++ default constructor. |
|
80 */ |
|
81 CSTSChannelManager(CSTSApduExchanger* aApduExchanger); |
|
82 |
|
83 /** |
|
84 * By default Symbian 2nd phase constructor is private. |
|
85 */ |
|
86 void ConstructL(); |
|
87 |
|
88 private: // Data |
|
89 //for sending apdus |
|
90 CSTSApduExchanger* iApduExchanger; //not owned |
|
91 |
|
92 //manage channel apdu, owned |
|
93 CSTSManageChannel* iCmdApdu; |
|
94 |
|
95 CSTSManageChannelResp* iRespApdu; //owned |
|
96 }; |
|
97 |
|
98 } // namespace satsa |
|
99 } // namespace java |
|
100 #endif // CSTSCHANNELMANAGER_H |
|
101 // End of File |