|
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 STSAPDUCONSTANTS_H |
|
20 #define STSAPDUCONSTANTS_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 |
|
25 namespace java |
|
26 { |
|
27 namespace satsa |
|
28 { |
|
29 |
|
30 // CONSTANTS |
|
31 |
|
32 // **** LEAVE CODES |
|
33 // Leave codes maps to corresponding java expection. |
|
34 // KSTSErr<java expection name without Expection word> |
|
35 // Refer to JSR177 for correct meaning for expections. |
|
36 // In java side these leave codes are defined in APDUError.java file. |
|
37 |
|
38 // Base value for leaves to distinguish them from native error codes. |
|
39 const TInt KSTSErrBase = -3000; |
|
40 |
|
41 const TInt KSTSErrIllegalArgument = KSTSErrBase - 100;//incorrect uri |
|
42 const TInt KSTSErrInterruptedIO = KSTSErrBase - 200; |
|
43 //slot doesn't exist, card not inserted or powered on, application selection fails |
|
44 const TInt KSTSErrConnectionNotFound = KSTSErrBase - 300; |
|
45 //j2me application not allowed to access to selected application |
|
46 const TInt KSTSErrSecurity = KSTSErrBase - 400; |
|
47 const TInt KSTSErrIO = KSTSErrBase - 500; |
|
48 const TInt KSTSErrCancel = KSTSErrBase - 600; |
|
49 |
|
50 //illegal argument related detailed errors |
|
51 //next is needed only in java side |
|
52 const TInt KSTSErrIASelectApp = -12; |
|
53 const TInt KSTSErrIAManageChannel = -13; |
|
54 const TInt KSTSErrIAOtherCLA = -14; |
|
55 const TInt KSTSErrIAMalformedAPDU = -15; |
|
56 const TInt KSTSErrIAInvalidParam = -16; |
|
57 const TInt KSTSErrIANotEnvelope = -17; |
|
58 |
|
59 //Interrupted IO related detailed errors |
|
60 const TInt KSTSErrIIConnClosedDuring = -21; |
|
61 const TInt KSTSErrIICardRemoved = -22; |
|
62 const TInt KSTSErrIIBTSapInUse = -23; |
|
63 |
|
64 //Connection not found related detailed errors |
|
65 const TInt KSTSErrCNTNoSlot = -31; |
|
66 const TInt KSTSErrCNTNoCard = -32; |
|
67 const TInt KSTSErrCNTNoApplication = -33; |
|
68 const TInt KSTSErrCNTBtSapInUse = -34; |
|
69 |
|
70 //Security related detailed errors |
|
71 const TInt KSTSErrSECNoRightsPin = -41; |
|
72 const TInt KSTSErrSECIllegalApdu = -42; |
|
73 const TInt KSTSErrSECAccessNotAllowed = -43; |
|
74 const TInt KSTSErrSECIllegalFileID = -44; |
|
75 |
|
76 //IO related detailed errors |
|
77 const TInt KSTSErrIOConnClosedBefore = -51; |
|
78 const TInt KSTSErrIOCommProblems = -52; |
|
79 const TInt KSTSErrIOErrorIO = -53; |
|
80 const TInt KSTSErrIONoFreeChannels = -54; |
|
81 |
|
82 //other constants |
|
83 |
|
84 const TUint8 KMaxReaderAmount = 8; |
|
85 const TInt KSTSApduMandatoryHeaderLen = 4; |
|
86 //data part + sw1 and sw2 |
|
87 const TInt KSTSResponseApduMaxLength = 0xFF + 2; |
|
88 |
|
89 const TInt KSTSLogicalChannelsMax = 3; |
|
90 |
|
91 // DATA TYPES |
|
92 enum TSTSAIDMode |
|
93 { |
|
94 ESTSAIDActivation, ESTSAIDTermination |
|
95 }; |
|
96 |
|
97 enum TSTSNetworkType |
|
98 { |
|
99 ESTSTypeGSM, ESTSTypeUMTS |
|
100 }; |
|
101 |
|
102 //must be values 0-4, because used also in array index |
|
103 enum TPinApduType |
|
104 { |
|
105 EVerifyPinAPDU = 0, |
|
106 EChangePinAPDU = 1, |
|
107 EDisablePinAPDU = 2, |
|
108 EEnablePinAPDU = 3, |
|
109 EUnblockPinAPDU = 4, |
|
110 }; |
|
111 |
|
112 } // namespace satsa |
|
113 } // namespace java |
|
114 #endif // STSAPDUCONSTANTS_H |
|
115 // End of File |
|
116 |