|
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 // INCLUDE FILES |
|
20 |
|
21 #include "cstsgetresponse.h" |
|
22 |
|
23 namespace java |
|
24 { |
|
25 namespace satsa |
|
26 { |
|
27 |
|
28 // CONSTANTS |
|
29 const TUint8 KSTSINSGetResponse = 0xC0; |
|
30 const TUint8 KSTSP1GetResponse = 0x00; |
|
31 const TUint8 KSTSP2GetResponse = 0x00; |
|
32 const TInt KSTSGetResponseApduLength = 5; |
|
33 |
|
34 // ============================ MEMBER FUNCTIONS =============================== |
|
35 |
|
36 // ----------------------------------------------------------------------------- |
|
37 // CSTSGetResponse::CSTSGetResponse |
|
38 // C++ default constructor can NOT contain any code, that |
|
39 // might leave. |
|
40 // ----------------------------------------------------------------------------- |
|
41 // |
|
42 CSTSGetResponse::CSTSGetResponse() |
|
43 { |
|
44 } |
|
45 |
|
46 // ----------------------------------------------------------------------------- |
|
47 // CSTSGetResponse::NewLC |
|
48 // Two-phased constructor. |
|
49 // ----------------------------------------------------------------------------- |
|
50 // |
|
51 CSTSGetResponse* CSTSGetResponse::NewLC(TInt aExpectedRespLength, |
|
52 CSTSApdu::TSTSApduStandard aStandard) |
|
53 { |
|
54 CSTSGetResponse* self = new(ELeave) CSTSGetResponse(); |
|
55 CleanupStack::PushL(self); |
|
56 self->ConstructL(aExpectedRespLength, aStandard); |
|
57 return self; |
|
58 } |
|
59 |
|
60 // ----------------------------------------------------------------------------- |
|
61 // CSTSGetResponse::NewL |
|
62 // Two-phased constructor. |
|
63 // ----------------------------------------------------------------------------- |
|
64 // |
|
65 CSTSGetResponse* CSTSGetResponse::NewL(TInt aExpectedRespLength, |
|
66 CSTSApdu::TSTSApduStandard aStandard) |
|
67 { |
|
68 CSTSGetResponse* self = CSTSGetResponse::NewLC(aExpectedRespLength, |
|
69 aStandard); |
|
70 CleanupStack::Pop(self); |
|
71 |
|
72 return self; |
|
73 } |
|
74 |
|
75 // Destructor |
|
76 CSTSGetResponse::~CSTSGetResponse() |
|
77 { |
|
78 } |
|
79 |
|
80 // ----------------------------------------------------------------------------- |
|
81 // CSTSGetResponse::SetExpectedResponseLength |
|
82 // Sets Le value (in this case same location than Lc). |
|
83 // (other items were commented in a header). |
|
84 // ----------------------------------------------------------------------------- |
|
85 void CSTSGetResponse::SetExpectedResponseLength(TInt aExpectedRespLength) |
|
86 { |
|
87 |
|
88 SetApduByte((TUint8) aExpectedRespLength, ESTSLc); |
|
89 } |
|
90 |
|
91 // ----------------------------------------------------------------------------- |
|
92 // CSTSGetResponse::ConstructL |
|
93 // Symbian 2nd phase constructor can leave. |
|
94 // Constructs Get Response apdu. |
|
95 // APDU is constructed according to standard ETSI TS 102 221 |
|
96 // (other items were commented in a header). |
|
97 // ----------------------------------------------------------------------------- |
|
98 // |
|
99 void CSTSGetResponse::ConstructL(TInt aExpectedRespLength, |
|
100 CSTSApdu::TSTSApduStandard aStandard) |
|
101 { |
|
102 iApduData = CSTSApdu::NewL(KSTSGetResponseApduLength, aStandard); |
|
103 |
|
104 //fills needed area with zeros |
|
105 iApduData->ApduPtr().FillZ(KSTSGetResponseApduLength); |
|
106 |
|
107 SetHeader(KSTSCLABasicUMTS, KSTSINSGetResponse, KSTSP1GetResponse, |
|
108 KSTSP2GetResponse); |
|
109 |
|
110 //we expect gived bytes long response |
|
111 SetLe((TUint8) aExpectedRespLength); |
|
112 |
|
113 } |
|
114 |
|
115 } // namespace satsa |
|
116 } // namespace java |
|
117 // End of File |