author | mikaruus <mika.a.ruuskanen@nokia.com> |
Thu, 14 Jan 2010 10:44:58 +0200 | |
changeset 5 | 8ccc39f9d787 |
parent 0 | 63b37f68c1ce |
permissions | -rw-r--r-- |
0 | 1 |
/* |
2 |
* Copyright (c) 2007-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 the License "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 |
* |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
14 |
* Description: |
0 | 15 |
* |
16 |
*/ |
|
17 |
||
18 |
||
19 |
||
20 |
#ifndef BER_TLV_H |
|
21 |
#define BER_TLV_H |
|
22 |
||
23 |
// INCLUDES |
|
24 |
#include <e32base.h> // base class cbase |
|
25 |
||
26 |
||
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
27 |
// CONSTANTS |
0 | 28 |
const TUint8 KTlvLengthStartPosition = 0x01; |
29 |
const TUint8 KTlvDataAreaStartPosition = 0x02; |
|
30 |
const TUint8 KTlvHeaderLength = 0x02; |
|
31 |
const TUint8 KTwoByteLengthCoding = 0x81; |
|
32 |
const TUint8 KMccAndMncLength = 0x03; |
|
33 |
const TUint8 KLocationAreaCodeLength = 0x02; |
|
34 |
const TUint8 KCApduLengthWithoutLc = 0x06; |
|
35 |
const TUint8 KCommonTlvHeaderLength = 0x02; |
|
36 |
const TUint8 KDefaultCommandNumber = 0x01; |
|
37 |
const TUint8 KDefaultGetInkeyCodingScheme = 0x04; |
|
38 |
const TUint8 KTagValueMask = 0x7f; |
|
39 |
const TUint8 KTagCrMask = 0x80; |
|
40 |
const TUint8 KMaxOneByteLength = 0x7f; |
|
41 |
||
42 |
||
43 |
// In 242 octets, it is possible to pack (242x8)/7=277 characters. |
|
44 |
// See ref. 3GPP TS 23.038. |
|
45 |
const TInt16 KTextBufferMaxSize = 277; |
|
46 |
const TUint8 KCommandQualifier = 4; |
|
47 |
const TUint8 KTlvMaxSize = 255; |
|
48 |
||
49 |
//Proactive SIM commands |
|
50 |
const TUint8 KRefresh = 0x01; |
|
51 |
const TUint8 KMoreTime = 0x02; |
|
52 |
const TUint8 KPollInterval = 0x03; |
|
53 |
const TUint8 KPollingOff = 0x04; |
|
54 |
const TUint8 KSetUpEventList = 0x05; |
|
55 |
const TUint8 KSetUpCall = 0x10; |
|
56 |
const TUint8 KSendSs = 0x11; |
|
57 |
const TUint8 KSendUssd = 0x12; |
|
58 |
const TUint8 KSendShortMessage = 0x13; |
|
59 |
const TUint8 KSendDtmf = 0x14; |
|
60 |
const TUint8 KLaunchBrowser = 0x15; |
|
61 |
const TUint8 KPlayTone = 0x20; |
|
62 |
const TUint8 KDisplayText = 0x21; |
|
63 |
const TUint8 KGetInkey = 0x22; |
|
64 |
const TUint8 KGetInput = 0x23; |
|
65 |
const TUint8 KSelectItem = 0x24; |
|
66 |
const TUint8 KSetUpMenu = 0x25; |
|
67 |
const TUint8 KProvideLocalInformation = 0x26; |
|
68 |
const TUint8 KTimerManagement = 0x27; |
|
69 |
const TUint8 KSetUpIdleModeText = 0x28; |
|
70 |
const TUint8 KPerformCardApdu = 0x30; |
|
71 |
const TUint8 KPowerOnCard = 0x31; |
|
72 |
const TUint8 KPowerOffCard = 0x32; |
|
73 |
const TUint8 KGetReaderStatus = 0x33; |
|
74 |
const TUint8 KRunAtCommand = 0x34; |
|
75 |
const TUint8 KLanguageNotification = 0x35; |
|
76 |
const TUint8 KOpenChannel = 0x40; |
|
77 |
const TUint8 KCloseChannel = 0x41; |
|
78 |
const TUint8 KReceiveData = 0x42; |
|
79 |
const TUint8 KSendData = 0x43; |
|
80 |
const TUint8 KGetChannelStatus = 0x44; |
|
81 |
const TUint8 KEndOfTheProactiveSession = 0x81; |
|
82 |
||
83 |
||
84 |
//TAG Values |
|
85 |
||
86 |
//BER-TLV tags |
|
87 |
//BER-TLV tags in ME to SIM direction |
|
88 |
const TUint8 KBerTlvSmsPpDownloadTag = 0xD1; |
|
89 |
const TUint8 KBerTlvCellBroadcastTag = 0xD2; |
|
90 |
const TUint8 KBerTlvMenuSelectionTag = 0xD3; |
|
91 |
const TUint8 KBerTlvCallControlTag = 0xD4; |
|
92 |
const TUint8 KBerTlvMoShortMessageControlTag = 0xD5; |
|
93 |
const TUint8 KBerTlvEventDownloadTag = 0xD6; |
|
94 |
const TUint8 KBerTlvTimerExpirationTag = 0xD7; |
|
95 |
||
96 |
//BER-TLV tags in SIM to ME direction |
|
97 |
const TUint8 KBerTlvProactiveSimCommandTag = 0xD0; |
|
98 |
||
99 |
//SIMPLE-TLV tags in both directions |
|
100 |
//TLV tags, Tag value, bits 1-7 (Range: '01' - '7E') |
|
101 |
const TUint8 KTlvCommandDetailsTag = 0x01; |
|
102 |
const TUint8 KTlvDeviceIdentityTag = 0x02; |
|
103 |
const TUint8 KTlvResultTag = 0x03; |
|
104 |
const TUint8 KTlvDurationTag = 0x04; |
|
105 |
const TUint8 KTlvAlphaIdentifierTag = 0x05; |
|
106 |
const TUint8 KTlvAddressTag = 0x06; |
|
107 |
const TUint8 KTlvCapabilityConfigurationParametersTag = 0x07; |
|
108 |
const TUint8 KTlvSubaddressTag = 0x08; |
|
109 |
const TUint8 KTlvSsStringTag = 0x09; |
|
110 |
const TUint8 KTlvUssdStringTag = 0x0A; |
|
111 |
const TUint8 KTlvSmsTpduTag = 0x0B; |
|
112 |
const TUint8 KTlvCellBroadcastPageTag = 0x0C; |
|
113 |
const TUint8 KTlvTextStringTag = 0x0D; |
|
114 |
const TUint8 KTlvToneTag = 0x0E; |
|
115 |
const TUint8 KTlvItemTag = 0x0F; |
|
116 |
const TUint8 KTlvItemIdentifierTag = 0x10; |
|
117 |
const TUint8 KTlvResponseLengthTag = 0x11; |
|
118 |
const TUint8 KTlvFileListTag = 0x12; |
|
119 |
const TUint8 KTlvLocationInformationTag = 0x13; |
|
120 |
const TUint8 KTlvImeiTag = 0x14; |
|
121 |
const TUint8 KTlvHelpRequestTag = 0x15; |
|
122 |
const TUint8 KTlvNetworkMeasurementResultsTag = 0x16; |
|
123 |
const TUint8 KTlvDefaultTextTag = 0x17; |
|
124 |
const TUint8 KTlvItemsNextActionIndicatorTag = 0x18; |
|
125 |
const TUint8 KTlvEventListTag = 0x19; |
|
126 |
const TUint8 KTlvCauseTag = 0x1A; |
|
127 |
const TUint8 KTlvLocationStatusTag = 0x1B; |
|
128 |
const TUint8 KTlvTransactionIdentifierTag = 0x1C; |
|
129 |
const TUint8 KTlvBccdChannelListTag = 0x1D; |
|
130 |
const TUint8 KTlvIconIdentifierTag = 0x1E; |
|
131 |
const TUint8 KTlvItemIconIdentifierListTag = 0x1F; |
|
132 |
const TUint8 KTlvCardReaderStatusTag = 0x20; |
|
133 |
const TUint8 KTlvCardAtrTag = 0x21; |
|
134 |
const TUint8 KTlvCApduTag = 0x22; |
|
135 |
const TUint8 KTlvRApduTag = 0x23; |
|
136 |
const TUint8 KTlvTimerIdentifierTag = 0x24; |
|
137 |
const TUint8 KTlvTimerValueTag = 0x25; |
|
138 |
const TUint8 KTlvDateTimeAndTimeZoneTag = 0x26; |
|
139 |
const TUint8 KTlvCallControlRequestedActionTag = 0x27; |
|
140 |
const TUint8 KTlvAtCommandTag = 0x28; |
|
141 |
const TUint8 KTlvAtResponseTag = 0x29; |
|
142 |
const TUint8 KTlvBcRepeatIndicatorTag = 0x2A; |
|
143 |
const TUint8 KTlvImmediateResponseTag = 0x2B; |
|
144 |
const TUint8 KTlvDtmfStringTag = 0x2C; |
|
145 |
const TUint8 KTlvLanguageTag = 0x2D; |
|
146 |
const TUint8 KTlvTimingAdvanceTag = 0x2E; |
|
147 |
const TUint8 KTlvAIDTag = 0x2F; |
|
148 |
const TUint8 KTlvBrowserIdentityTag = 0x30; |
|
149 |
const TUint8 KTlvUrlTag = 0x31; |
|
150 |
const TUint8 KTlvBearerTag = 0x32; |
|
151 |
const TUint8 KTlvProvisioningReferenceFileTag = 0x33; |
|
152 |
const TUint8 KTlvBrowserTerminationCauseTag = 0x34; |
|
153 |
const TUint8 KTlvBearerDescriptionTag = 0x35; |
|
154 |
const TUint8 KTlvChannelDataTag = 0x36; |
|
155 |
const TUint8 KTlvChannelDataLengthTag = 0x37; |
|
156 |
const TUint8 KTlvChannelStatusTag = 0x38; |
|
157 |
const TUint8 KTlvBufferSizeTag = 0x39; |
|
158 |
const TUint8 KTlvCardReaderIdentifierTag = 0x3A; |
|
159 |
const TUint8 KTlvTextStringTagUserPassword = 0x3B; |
|
160 |
const TUint8 KTlvSimMeTransportLevelTag = 0x3C; |
|
161 |
const TUint8 KTlvURLTag = 0x3D; |
|
162 |
const TUint8 KTlvOtherAddressTag = 0x3E; |
|
163 |
||
164 |
const TUint8 KTlvAccessTechnologyTag = 0x3F; |
|
165 |
const TUint8 KTlvESNTag = 0x46; |
|
166 |
const TUint8 KTlvNetworkAccessNameTag = 0x47; |
|
167 |
const TUint8 KTlvPdpContextActivationParametersTag = 0x52; |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
168 |
const TUint8 KTlvImeisvTag = 0x62; |
0 | 169 |
|
170 |
const TUint8 KTlvTimerIdentifierTagCRBitOn = 0xA4; |
|
171 |
||
172 |
const TUint8 KTlvUtranMeasurementQualifierTag = 0x69; |
|
173 |
//TLV Coding |
|
174 |
||
175 |
// event download - Event list event coding |
|
176 |
const TUint8 KEventMTCall = 0x00; |
|
177 |
const TUint8 KEventCallConnected = 0x01; |
|
178 |
const TUint8 KEventCallDisconnected = 0x02; |
|
179 |
const TUint8 KEventLocationStatus = 0x03; |
|
180 |
const TUint8 KEventUserActivity = 0x04; |
|
181 |
const TUint8 KEventIdleScreenAvailable = 0x05; |
|
182 |
const TUint8 KEventCardReaderStatus = 0x06; |
|
183 |
const TUint8 KEventLanguageSelection = 0x07; |
|
184 |
const TUint8 KEventBrowserTermination = 0x08; |
|
185 |
const TUint8 KEventDataAvailable = 0x09; |
|
186 |
const TUint8 KEventChannelStatus = 0x0A; |
|
187 |
const TUint8 KEventAccessTechnologyChange = 0x0B; |
|
188 |
||
189 |
// event download - Location status coding |
|
190 |
const TUint8 KLocationStatusNormalService = 0x00; |
|
191 |
const TUint8 KLocationStatusLimitedService = 0x01; |
|
192 |
const TUint8 KLocationStatusNoService = 0x02; |
|
193 |
||
194 |
// event download - Browser termination coding |
|
195 |
const TUint8 KBrowserTerminationUser = 0x00; |
|
196 |
const TUint8 KBrowserTerminationError = 0x01; |
|
197 |
||
198 |
||
199 |
//REFRESH; |
|
200 |
const TUint8 KSimInitFullFileChangeNotification = 0x00; |
|
201 |
const TUint8 KFileChangeNotification = 0x01; |
|
202 |
const TUint8 KSimInitFileChangeNotification = 0x02; |
|
203 |
const TUint8 KSimInit = 0x03; |
|
204 |
const TUint8 KSimReset = 0x04; |
|
205 |
const TUint8 KUSIMApplicationReset = 0x05; |
|
206 |
const TUint8 K3GSessionReset = 0x06; |
|
207 |
const TUint8 KMaxPathLength = 16; |
|
208 |
||
209 |
||
210 |
//SET UP CALL; |
|
211 |
const TUint8 KSetUpCallIfNotCurrentlyBusy = 0x00; |
|
212 |
const TUint8 KSetUpCallIfNotCurrentlyBusyWithRedial = 0x01; |
|
213 |
const TUint8 KSetUpCallPuttingOtherCallsOnHold = 0x02; |
|
214 |
const TUint8 KSetUpCallPuttingOtherCallsOnHoldWithRedial = 0x03; |
|
215 |
const TUint8 KSetUpCallDisconnectingOtherCalls = 0x04; |
|
216 |
const TUint8 KSetUpCallDisconnectingOtherCallsWithRedial = 0x05; |
|
217 |
const TUint8 KAuthorityFormatIdentifier = 0x50; |
|
218 |
const TUint8 KMinutes = 0x00; |
|
219 |
const TUint8 KSeconds = 0x01; |
|
220 |
const TUint8 KTenthsOfSeconds = 0x02; |
|
221 |
||
222 |
||
223 |
//SEND SHORT MESSAGE; |
|
224 |
const TUint8 KSmsPackingRequiredMask = 0x01; |
|
225 |
const TUint8 KDCSAlphabetMask = 0x06; |
|
226 |
const TUint8 KSmsMaxSize = 160; |
|
227 |
const TUint8 KSmsMaxSizeWithoutPacking = 140; |
|
228 |
const TUint8 KSMSCommandMaxSize = 152; |
|
229 |
||
230 |
//DISPLAY TEXT, |
|
231 |
const TUint8 KPriorityMask = 0x01; |
|
232 |
const TUint8 KMessageClearMask = 0x80; |
|
233 |
||
234 |
//GET INKEY, |
|
235 |
const TUint8 KAlphabetMask = 0x01; |
|
236 |
const TUint8 KUCS2AlphabetMask = 0x02; |
|
237 |
const TUint8 KYesNoMask = 0x04; |
|
238 |
const TUint8 KImmediateDigitResponse = 0x08; |
|
239 |
const TUint8 KHelpAvailabilityMask = 0x80; |
|
240 |
||
241 |
//GET INPUT, |
|
242 |
const TUint8 KUserInputMask = 0x04; |
|
243 |
const TUint8 KGetInputSmsPackedMask = 0x08; |
|
244 |
const TUint8 KUCS2DCS = 0x08; |
|
245 |
const TUint8 K7BitDefaultSmsDCS = 0x00; |
|
246 |
const TUint8 K8BitDCS = 0x04; |
|
247 |
||
248 |
//SELECT ITEM. |
|
249 |
const TUint8 KSelectItemPresentationTypeMask = 0x01; |
|
250 |
const TUint8 KSelectItemChoiceOfNavigationMask = 0x02; |
|
251 |
const TUint8 KSelectItemSelectUsingSoftKeyMask = 0x04; |
|
252 |
||
253 |
//SET UP MENU. |
|
254 |
const TUint8 KSelectionUsingSoftKey = 0x01; |
|
255 |
||
256 |
//TIMER MANAGEMENT |
|
257 |
const TUint8 KDeactivateTimer = 0x01; |
|
258 |
const TUint8 KGetTimerValue = 0x02; |
|
259 |
||
260 |
//LAUNCH BROWSER |
|
261 |
const TUint8 KLaunchBrowserIfNotYetLaunched = 0x00; |
|
262 |
const TUint8 KUseExistingBrowser = 0x02; |
|
263 |
const TUint8 KCloseAndLaunchNewBrowser = 0x03; |
|
264 |
||
265 |
//PROVIDE LOCAL INFORMATION |
|
266 |
const TUint8 KNetworkModeGsm = 0x00; |
|
267 |
const TUint8 KNetworkModeUtran = 0x03; |
|
268 |
const TUint8 KIntraFrequencyMeasurements = 0x01; |
|
269 |
const TUint8 KInterFrequencyMeasurements = 0x02; |
|
270 |
const TUint8 KInterRatMeasurements = 0x03; |
|
271 |
// BEARER INDEPENDENT PROTOCOL |
|
272 |
const TUint8 KIPV4 = 0x21; |
|
273 |
const TUint8 KIPV6 = 0x57; |
|
274 |
||
275 |
//General result |
|
276 |
//All other values are reserved. |
|
277 |
//Results '0X' and '1X' indicate that the command has been performed. |
|
278 |
const TUint8 KCommandPerformedSuccessfully = 0x00; |
|
279 |
const TUint8 KCommandPerformedWithPartialComprehension = 0x01; |
|
280 |
const TUint8 KCommandPerformedWithMissingInformation = 0x02; |
|
281 |
const TUint8 KRefreshPerformedWithAdditionalEfsRead = 0x03; |
|
282 |
const TUint8 KCommandPerformedSuccessfullyIconCouldNotBeDisplayed = 0x04; |
|
283 |
const TUint8 KCommandPerformedButModifiedByCallControlBySim = 0x05; |
|
284 |
const TUint8 KCommandPerformedSuccessfullyLimitedService = 0x06; |
|
285 |
const TUint8 KCommandPerformedWithModification = 0x07; |
|
286 |
const TUint8 KProactiveSimSessionTerminatedByTheUser = 0x10; |
|
287 |
const TUint8 KBackwardMoveInTheProactiveSimSessionRequestedByTheUser = 0x11; |
|
288 |
const TUint8 KNoResponseFromUser = 0x12; |
|
289 |
const TUint8 KHelpInformationRequiredByTheUser = 0x13; |
|
290 |
const TUint8 KUssdOrSsTransactionTerminatedByTheUser = 0x14; |
|
291 |
||
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
292 |
//Results '2X' Indicate To The SIM That It May Be Worth Re-Trying The Command |
0 | 293 |
//At A Later Opportunity. |
294 |
const TUint8 KMeCurrentlyUnableToProcessCommand = 0x20; |
|
295 |
const TUint8 KNetworkCurrentlyUnableToProcessCommand = 0x21; |
|
296 |
const TUint8 KUserDidNotAcceptTheProactiveCommand = 0x22; |
|
297 |
const TUint8 KUserClearedDownCallBeforeConnectionOrNetworkRelease = 0x23; |
|
298 |
const TUint8 KActionInContradictionWithTheCurrentTimerState = 0x24; |
|
299 |
const TUint8 KInteractionWithCallControlBySimTemporaryProblem = 0x25; |
|
300 |
const TUint8 KLaunchBrowserGenericErrorCode = 0x26; |
|
301 |
||
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
302 |
//Results '3X' Indicate That It Is Not Worth The SIM Re-Trying With An |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
303 |
//Identical Command, As It Will Only Get The Same Response. However, The |
0 | 304 |
//Decision To Retry Lies With The SIM Application. |
305 |
const TUint8 KCommandBeyondMeCapabilities = 0x30; |
|
306 |
const TUint8 KCommandTypeNotUnderstoodByMe = 0x31; |
|
307 |
const TUint8 KCommandDataNotUnderstoodByMe = 0x32; |
|
308 |
const TUint8 KCommandNumberNotKnownByMe = 0x33; |
|
309 |
const TUint8 KSsReturnError = 0x34; |
|
310 |
const TUint8 KSmsRpError = 0x35; |
|
311 |
const TUint8 KErrorRequiredValuesAreMissing = 0x36; |
|
312 |
const TUint8 KUssdReturnError = 0x37; |
|
313 |
const TUint8 KMultiplecardCommandsError = 0x38; |
|
314 |
const TUint8 KSimPermanentProblem = 0x39; |
|
315 |
const TUint8 KBearerIndependentProtocolError = 0x3a; |
|
316 |
||
317 |
//Additional information |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
318 |
//Contents: For the general result "Command performed successfully", some |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
319 |
// proactive commands require additional information in the command result. |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
320 |
// This is defined in the subclauses below. For the general results '20', '21', |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
321 |
// '26', '34', '35', '37', '38' and '39' and '3A', it is mandatory for the ME |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
322 |
// to provide a specific cause value as additional information, as defined in |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
323 |
// the subclauses below. For the other general results, the ME may optionally |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
324 |
// supply additional information. If additional information is not supplied, |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
325 |
// then the length of the value part of the data object need only contain the |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
326 |
// general result. See 3GPP TS 11.14 V8.8.0, chapters 12.12.1 - 12.12.11 for |
0 | 327 |
// more details. |
328 |
||
329 |
//Additional information for ME problem |
|
330 |
//Additional information for network problem |
|
331 |
//Additional information for SS problem |
|
332 |
const TUint8 KNoSpecificCauseCanBeGiven = 0x00; |
|
333 |
const TUint8 KScreenIsBusy = 0x01; |
|
334 |
const TUint8 KMeCurrentlyBusyOnCall = 0x02; |
|
335 |
const TUint8 KMeCurrentlyBusyOnSsTransaction = 0x03; |
|
336 |
const TUint8 KNoService = 0x04; |
|
337 |
const TUint8 KAccessControlClassBar = 0x05; |
|
338 |
const TUint8 KRadioResourceNotGranted = 0x06; |
|
339 |
const TUint8 KNotInSpeechCall = 0x07; |
|
340 |
const TUint8 KMeCurrentlyBusyOnUssdTransaction = 0x08; |
|
341 |
const TUint8 KMeCurrentlyBusyOnSendDtmfCommand = 0x09; |
|
342 |
||
343 |
//Additional information for interaction with call control or MO SM control |
|
344 |
const TUint8 KActionNotAllowed = 0x01; |
|
345 |
const TUint8 KTypeOfRequestHasChanged = 0x02; |
|
346 |
||
347 |
//Additional information for MultipleCard commands |
|
348 |
const TUint8 KCardReaderRemovedOrNotPresent = 0x01; |
|
349 |
const TUint8 KCardRemovedOrNotPresent = 0x02; |
|
350 |
const TUint8 KCardReaderBusy = 0x03; |
|
351 |
const TUint8 KCardPoweredOff = 0x04; |
|
352 |
const TUint8 KCApduFormatError = 0x05; |
|
353 |
const TUint8 KMuteCard = 0x06; |
|
354 |
const TUint8 KTransmissionError = 0x07; |
|
355 |
const TUint8 KProtocolNotSupported = 0x08; |
|
356 |
const TUint8 KSpecifiedReaderNotValid = 0x09; |
|
357 |
||
358 |
//Additional information for Launch Browser problem |
|
359 |
const TUint8 KBearerUnavailable = 0x01; |
|
360 |
const TUint8 KBrowserUnavailable = 0x02; |
|
361 |
const TUint8 KMeUnableToReadTheProvisioningData = 0x03; |
|
362 |
||
363 |
//Additional information for Bearer Independent Protocol |
|
364 |
const TUint8 KNoChannelAvailable = 0x01; |
|
365 |
const TUint8 KChannelClosed = 0x02; |
|
366 |
const TUint8 KChannelIdentifierNotValid = 0x03; |
|
367 |
const TUint8 KRequestedBufferSizeNotAvailable = 0x04; |
|
368 |
const TUint8 KSecurityError = 0x05; |
|
369 |
const TUint8 KRequestedSimMeInterfaceTransportLevelNotAvailable = 0x06; |
|
370 |
||
371 |
//Source and Destination device identities are coded as follows: |
|
372 |
const TUint8 KKeypad = 0x01; |
|
373 |
const TUint8 KDisplay = 0x02; |
|
374 |
const TUint8 KEarpiece = 0x03; |
|
375 |
const TUint8 KAdditionalCardReader0 = 0x10; |
|
376 |
const TUint8 KAdditionalCardReader1 = 0x11; |
|
377 |
const TUint8 KAdditionalCardReader2 = 0x12; |
|
378 |
const TUint8 KAdditionalCardReader3 = 0x13; |
|
379 |
const TUint8 KAdditionalCardReader4 = 0x14; |
|
380 |
const TUint8 KAdditionalCardReader5 = 0x15; |
|
381 |
const TUint8 KAdditionalCardReader6 = 0x16; |
|
382 |
const TUint8 KAdditionalCardReader7 = 0x17; |
|
383 |
const TUint8 KChannel1 = 0x21; |
|
384 |
const TUint8 KChannel2 = 0x22; |
|
385 |
const TUint8 KChannel3 = 0x23; |
|
386 |
const TUint8 KChannel4 = 0x24; |
|
387 |
const TUint8 KChannel5 = 0x25; |
|
388 |
const TUint8 KChannel6 = 0x26; |
|
389 |
const TUint8 KChannel7 = 0x27; |
|
390 |
const TUint8 KSim = 0x81; |
|
391 |
const TUint8 KMe = 0x82; |
|
392 |
const TUint8 KNetwork = 0x83; |
|
393 |
||
394 |
||
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
395 |
// DATA TYPES |
0 | 396 |
|
397 |
// Tlv Specific Data Types |
|
398 |
enum TTlvSpesificDataType |
|
399 |
{ |
|
400 |
ETLV_TonAndNpi, |
|
401 |
ETLV_DiallingNumberString, |
|
402 |
ETLV_AlphaIdentifier, |
|
403 |
ETLV_SubAddress, |
|
404 |
ETLV_CapabilityConfigurationParameters, |
|
405 |
ETLV_CellBroadcastPage, |
|
406 |
ETLV_CommandNumber, |
|
407 |
ETLV_TypeOfCommand, |
|
408 |
ETLV_CommandQualifier, |
|
409 |
ETLV_SourceDeviceIdentity, |
|
410 |
ETLV_DestinationDeviceIdentity, |
|
411 |
ETLV_TimeUnit, |
|
412 |
ETLV_TimeInteval, |
|
413 |
ETLV_IdentifierOfItem, |
|
414 |
ETLV_TextStringOfItem, |
|
415 |
ETLV_IdentifierOfItemChosen, |
|
416 |
ETLV_MinimumLengthOfResponse, |
|
417 |
ETLV_MaximumLengthOfResponse, |
|
418 |
ETLV_GeneralResult, |
|
419 |
ETLV_AdditionalInformationOnResult, |
|
420 |
ETLV_SmsTPdu, |
|
421 |
ETLV_DataCodingScheme, |
|
422 |
ETLV_SsOrUssdString, |
|
423 |
ETLV_TextString, |
|
424 |
ETLV_Tone, |
|
425 |
ETLV_UssdString, |
|
426 |
ETLV_NumberOfFiles, |
|
427 |
ETLV_Files, |
|
428 |
ETLV_LocationAreaCode, |
|
429 |
ETLV_CellIdentityValue, |
|
430 |
ETLV_MccAndMnc, |
|
431 |
ETLV_Imei, |
|
432 |
ETLV_NetworkMeasurementResults, |
|
433 |
ETLV_DefaultText, |
|
434 |
ETLV_ItemsNextActionIndicator, |
|
435 |
ETLV_EventList, |
|
436 |
ETLV_Cause, |
|
437 |
ETLV_LocationStatus, |
|
438 |
ETLV_TransactionIdentifier, |
|
439 |
ETLV_BcchChannelList, |
|
440 |
ETLV_IconIdentifier, |
|
441 |
ETLV_IconQualifier, |
|
442 |
ETLV_IconListQualifier, |
|
443 |
ETLV_IconIdentifierList, |
|
444 |
ETLV_CardReaderStatus, |
|
445 |
ETLV_CommandClassCLA, |
|
446 |
ETLV_CommandInstructionCodeIns, |
|
447 |
ETLV_P1Parameter, |
|
448 |
ETLV_P2Parameter, |
|
449 |
ETLV_Lc, |
|
450 |
ETLV_Data, |
|
451 |
ETLV_Le, |
|
452 |
ETLV_RApduData, |
|
453 |
ETLV_StatusWordSW1, |
|
454 |
ETLV_StatusWordSW2, |
|
455 |
ETLV_TimerIdentifier, |
|
456 |
ETLV_TimerValue, |
|
457 |
ETLV_DateTimeAndTimeZone, |
|
458 |
ETLV_AtCommand, |
|
459 |
ETLV_AtResponse, |
|
460 |
ETLV_BcRepeatIndicatorValues, |
|
461 |
ETLV_DtmfString, |
|
462 |
ETLV_Language, |
|
463 |
ETLV_MeStatus, |
|
464 |
ETLV_TimingAdvance, |
|
465 |
ETLV_BrowserIdentity, |
|
466 |
ETLV_Url, |
|
467 |
ETLV_ListOfBearers, |
|
468 |
ETLV_PathToProvisioningFile, |
|
469 |
ETLV_BrowserTerminationCause, |
|
470 |
ETLV_BearerType, |
|
471 |
ETLV_BearerParameters, |
|
472 |
ETLV_ChannelDataString, |
|
473 |
ETLV_ChannelDataLength, |
|
474 |
ETLV_BufferSize, |
|
475 |
ETLV_ChannelStatus, |
|
476 |
ETLV_IdentifierOfCardReader, |
|
477 |
ETLV_TypeOfAddress, |
|
478 |
ETLV_Address, |
|
479 |
ETLV_TransportProtocolType, |
|
480 |
ETLV_PortNumber, |
|
481 |
ETLV_NetworkAccessName, |
|
482 |
ETLV_CallControlRequestedAction, |
|
483 |
ETLV_Atr, |
|
484 |
ETLV_AID, |
|
485 |
ETLV_UtranMeasurementQualifier, |
|
486 |
ETLV_RemoteEntityAddressCoding, |
|
487 |
ETLV_RemoteEntityAddress |
|
488 |
}; |
|
489 |
||
490 |
||
491 |
// FORWARD DECLARATIONS |
|
492 |
class TIsiReceiveC; |
|
493 |
class CTlv; |
|
494 |
||
495 |
||
496 |
// CLASS DECLARATION |
|
497 |
/** |
|
498 |
* TTlvBase |
|
499 |
* TLV type: Tag Length Value(s) |
|
500 |
* Generic BER-TLV constructor class, can be used to create TLVs |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
501 |
* You do not need to worry about lenghts; Example usage: |
0 | 502 |
* TTlv tlv; |
503 |
* tlv.Begin( KxxBerTag); <--- top level tag |
|
504 |
* tlv.AddTag( KxxxTag ) <--- simple tags |
|
505 |
* tlv.AddByte(...) <--- add values for this tag |
|
506 |
* tlv.AddByte(...) |
|
507 |
* .... add more simple tags and values.. |
|
508 |
* result = tlv.End(); <--- ends construction and returns |
|
509 |
* the ber-tlv |
|
510 |
* @lib SIMATKTSY.LIB |
|
511 |
* @since Series 60 Series60_2.6 |
|
512 |
*/ |
|
513 |
class TTlvBase |
|
514 |
{ |
|
515 |
public: // Constructor |
|
516 |
||
517 |
/** |
|
518 |
* Constructor |
|
519 |
* @since Series 60 Series60_2.6 |
|
520 |
* @param aData data to be inserted |
|
521 |
*/ |
|
522 |
TTlvBase(TDes8& aData) : iLenIndex(0),iData(aData) {} |
|
523 |
||
524 |
public: |
|
525 |
||
526 |
/** |
|
527 |
* Begin TLV construction |
|
528 |
* @since Series 60 Series60_2.6 |
|
529 |
* @param aTag ber-tlv tag |
|
530 |
* @return None |
|
531 |
*/ |
|
532 |
void Begin( TUint8 aTag ); |
|
533 |
||
534 |
/** |
|
535 |
* Start new simple TLV |
|
536 |
* @since Series 60 Series60_2.6 |
|
537 |
* @param aTag simple tag |
|
538 |
* @return None |
|
539 |
*/ |
|
540 |
void AddTag( TUint8 aTag ); |
|
541 |
||
542 |
/** |
|
543 |
* Add byte value to simple TLV |
|
544 |
* @since Series 60 Series60_2.6 |
|
545 |
* @param aValue byte value |
|
546 |
* @return None |
|
547 |
*/ |
|
548 |
void AddByte( TUint8 aValue ); |
|
549 |
||
550 |
/** |
|
551 |
* Add descriptor value to simple TLV |
|
552 |
* @since Series 60 Series60_2.6 |
|
553 |
* @param aValue descriptor value |
|
554 |
* @return None |
|
555 |
*/ |
|
556 |
void AddData( const TDesC8& aValue ); |
|
557 |
||
558 |
||
559 |
/** |
|
560 |
* End tlv construction |
|
561 |
* @since Series 60 Series60_2.6 |
|
562 |
* @param None |
|
563 |
* @return TDesC8& descriptor containing BER-TLV |
|
564 |
*/ |
|
565 |
const TDesC8& End(); |
|
566 |
||
567 |
/** |
|
568 |
* Return data, calculated without |
|
569 |
* top level tag. |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
570 |
* @since Series 60 Series60_2.6 |
0 | 571 |
* @param None |
572 |
* @return TDesC8& descriptor containing BER-TLV |
|
573 |
*/ |
|
574 |
const TDesC8& GetDataWithoutTopLevelTag(); |
|
575 |
||
576 |
||
577 |
protected: // Data |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
578 |
|
0 | 579 |
TInt iLenIndex; |
580 |
TDes8& iData; |
|
581 |
}; |
|
582 |
||
583 |
/** |
|
584 |
* TTlvBuf |
|
585 |
* Type for Tag Length Value buffer. |
|
586 |
* Define tlv that is smaller than default max size of 255 |
|
587 |
* |
|
588 |
* @lib SIMATKTSY.LIB |
|
589 |
* @since Series 60 Series60_2.6 |
|
590 |
*/ |
|
591 |
template <TInt S> |
|
592 |
class TTlvBuf : public TTlvBase |
|
593 |
{ |
|
594 |
public: // Constructor |
|
595 |
||
596 |
/** |
|
597 |
* Constructor |
|
598 |
* @since Series 60 Series60_2.6 |
|
599 |
* @param iBuffer |
|
600 |
*/ |
|
601 |
TTlvBuf() : TTlvBase( iBuffer ) {} |
|
602 |
||
603 |
private: // Data |
|
604 |
||
605 |
// Data buffer smaller than default maximum size of 255 |
|
606 |
TBuf8<S> iBuffer; |
|
607 |
}; |
|
608 |
||
609 |
/** |
|
610 |
* TTlv |
|
611 |
* Type for Tag Length Value buffer. |
|
612 |
* Default TLV with size of 255 |
|
613 |
* |
|
614 |
* @lib SIMATKTSY.LIB |
|
615 |
* @since Series 60 Series60_2.6 |
|
616 |
*/ |
|
617 |
class TTlv : public TTlvBase |
|
618 |
{ |
|
619 |
public: // Constructor |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
620 |
|
0 | 621 |
/** |
622 |
* Constructor |
|
623 |
* @since Series 60 Series60_2.6 |
|
624 |
* @param iBuffer |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
625 |
*/ |
0 | 626 |
TTlv() : TTlvBase( iBuffer ) {} |
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
627 |
|
0 | 628 |
private: // Data |
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
629 |
|
0 | 630 |
// TLV must fit in APDU limits (255 bytes) |
631 |
// therefore the maximum possible TLV size is 255 |
|
632 |
TBuf8<255> iBuffer; |
|
633 |
}; |
|
634 |
||
635 |
/** |
|
636 |
* CTlvBase |
|
637 |
* TLV Base class. methods common for CTlv and CBerTlv |
|
638 |
* |
|
639 |
* @lib SIMATKTSY.LIB |
|
640 |
* @since Series 60 Series60_2.6 |
|
641 |
*/ |
|
642 |
class CTlvBase : public CBase |
|
643 |
{ |
|
644 |
public: |
|
645 |
||
646 |
/** |
|
647 |
* Constructor |
|
648 |
* @since Series 60 Series60_2.6 |
|
649 |
* @param iData |
|
650 |
*/ |
|
651 |
CTlvBase() : iData( 0, 0 ) {} |
|
652 |
||
653 |
/** |
|
654 |
* Get pointer to TLV data |
|
655 |
* @since Series 60 Series60_2.6 |
|
656 |
* @return iData Pointer to TLV data |
|
657 |
*/ |
|
658 |
TPtrC8 Data() const |
|
659 |
{ |
|
660 |
return iData; |
|
661 |
} |
|
662 |
||
663 |
/** |
|
664 |
* Set TLV data |
|
665 |
* @since Series 60 Series60_2.6 |
|
666 |
* @param aData Data to be inserted |
|
667 |
* @return None |
|
668 |
*/ |
|
669 |
void SetData |
|
670 |
( |
|
671 |
TPtrC8 aData // TLV |
|
672 |
) |
|
673 |
{ |
|
674 |
iData.Set( aData ); |
|
675 |
} |
|
676 |
||
677 |
/** |
|
678 |
* Get total size, including tag |
|
679 |
* @since Series 60 Series60_2.6 |
|
680 |
* @return size |
|
681 |
*/ |
|
682 |
TInt GetSize() const |
|
683 |
{ |
|
684 |
return ( iData.Length() ); |
|
685 |
} |
|
686 |
||
687 |
/** |
|
688 |
* Get tag part of TLV |
|
689 |
* @since Series 60 Series60_2.6 |
|
690 |
* @return tag value |
|
691 |
*/ |
|
692 |
TUint8 GetTag() const |
|
693 |
{ |
|
694 |
return TUint8( iData[0] & KTagValueMask ); |
|
695 |
} |
|
696 |
||
697 |
/** |
|
698 |
* Returns true if comprehension flag is on |
|
699 |
* @since Series 60 Series60_2.6 |
|
700 |
* @return boolean |
|
701 |
*/ |
|
702 |
TBool GetComprehensionRequired() const |
|
703 |
{ |
|
704 |
return ( iData[0] & KTagCrMask ) ? ETrue : EFalse; |
|
705 |
} |
|
706 |
||
707 |
/** |
|
708 |
* Get length part of TLV |
|
709 |
* @since Series 60 Series60_2.6 |
|
710 |
* @return length |
|
711 |
*/ |
|
712 |
TUint8 GetLength () const |
|
713 |
{ |
|
714 |
return ( KTwoByteLengthCoding == iData[KTlvLengthStartPosition] ) ? |
|
715 |
iData[KTlvLengthStartPosition + 1] : |
|
716 |
iData[KTlvLengthStartPosition]; |
|
717 |
} |
|
718 |
||
719 |
/** |
|
720 |
* Get value part of TLV |
|
721 |
* @since Series 60 Series60_2.6 |
|
722 |
* @return value |
|
723 |
*/ |
|
724 |
TPtrC8 GetValue() const |
|
725 |
{ |
|
726 |
TInt offset = ( KTwoByteLengthCoding == iData[1] ) ? 1 : 0; |
|
727 |
return iData.Mid( 2+offset, iData[1+offset] ); |
|
728 |
} |
|
729 |
||
730 |
protected: // Data |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
731 |
|
0 | 732 |
// Pointer to Tlv data |
733 |
TPtrC8 iData; |
|
734 |
}; |
|
735 |
||
736 |
/** |
|
737 |
* CBerTlv |
|
738 |
* CBerTlv contains methods to read BER-TLV data |
|
739 |
* |
|
740 |
* @lib SIMATKTSY.LIB |
|
741 |
* @since Series 60 Series60_2.6 |
|
742 |
*/ |
|
743 |
class CBerTlv : public CTlvBase |
|
744 |
{ |
|
745 |
||
746 |
public: // Constructor |
|
747 |
||
748 |
/** |
|
749 |
* Default constructor |
|
750 |
*/ |
|
751 |
CBerTlv(); |
|
752 |
||
753 |
public: // New methods |
|
754 |
||
755 |
/** |
|
756 |
* Find tlv by tag value |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
757 |
* @param aTlv |
0 | 758 |
* @param aTlvTagValue TlvTag |
759 |
* @param aItemNbr number of requested Tlv, default is 0 |
|
760 |
* @return TInt: KErrNone or KErrNotFound |
|
761 |
*/ |
|
762 |
TInt TlvByTagValue( |
|
763 |
CTlv* aTlv, |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
764 |
TUint8 aTlvTagValue, |
0 | 765 |
TInt aItemNbr = 0 ); |
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
766 |
|
0 | 767 |
/** |
768 |
* Find several tlvs by tag value |
|
769 |
* @since Series 60 Series60_2.6 |
|
770 |
* @param aSubBlock retruns tlvs |
|
771 |
* @param aSubBlockId TlvTag |
|
772 |
* @return TInt: KErrNone or KErrNotFound |
|
773 |
*/ |
|
774 |
TInt TlvByTagValueMulti( CTlv* aTlv, TUint8 aTlvTag ); |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
775 |
|
0 | 776 |
/** |
777 |
* Set ber-tlv from atk_generic_req isi-message. |
|
778 |
* @since NCP 5.0 |
|
779 |
* @param aIsiMessage ISI message |
|
780 |
* @return TInt: KErrNone or KErrNotFound |
|
781 |
*/ |
|
782 |
TInt BerTlv( const TIsiReceiveC& aIsiMessage ); |
|
783 |
}; |
|
784 |
||
785 |
/** |
|
786 |
* CTlv |
|
787 |
* CTlv contains methods to read simple TLV data |
|
788 |
* |
|
789 |
* @lib SIMATKTSY.LIB |
|
790 |
* @since Series 60 Series60_2.6 |
|
791 |
*/ |
|
792 |
class CTlv : public CTlvBase |
|
793 |
{ |
|
794 |
public: // Constructor |
|
795 |
||
796 |
/** |
|
797 |
* Default constructor |
|
798 |
*/ |
|
799 |
CTlv(); |
|
800 |
||
801 |
public: // New methods |
|
802 |
||
803 |
/** |
|
804 |
* Returns short info defined by aType. |
|
805 |
* @since Series 60 Series60_2.6 |
|
806 |
* TAtkSpesificDataType aType: wanted data type. |
|
807 |
* @return TUint8: wanted data. |
|
808 |
*/ |
|
809 |
TUint8 GetShortInfo( TTlvSpesificDataType aType ); |
|
810 |
||
811 |
/** |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
812 |
* Returns the Data defined by aType. Index and length of the |
0 | 813 |
* data depends on data type. |
814 |
* @since Series 60 Series60_2.6 |
|
815 |
* @param TAtkSpesificDataType aType: data type. |
|
816 |
* @return TptrC8: pointer to the data. |
|
817 |
*/ |
|
818 |
TPtrC8 GetData( TTlvSpesificDataType aType ); |
|
819 |
||
820 |
/** |
|
821 |
* Returns long info by aType. |
|
822 |
* @since Series 60 Series60_2.6 |
|
823 |
* @param TAtkSpesificDataType aType: data type. |
|
824 |
* @return TUint8: returned data |
|
825 |
*/ |
|
826 |
TUint16 GetLongInfo( TTlvSpesificDataType aType ); |
|
827 |
}; |
|
828 |
||
829 |
#endif // BER_TLV_H |
|
830 |
||
831 |
// End of File |