Initialize Tizen 2.3
[framework/telephony/libslp-tapi.git] / mobile / include / TelSim.h
1 /*
2  * libslp-tapi
3  *
4  * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact: Ja-young Gu <jygu@samsung.com>
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  */
20
21 /**
22  * @open
23  * @ingroup             TelephonyAPI
24  * @addtogroup  SIM_TAPI        SIM
25  * @{
26  *
27  * @file TelSim.h
28
29  @brief This file serves as a "C" header file defines structures for Tapi SIM Services. \n
30  It contains a sample set of constants, enums, structs that would be required by applications.
31  */
32
33 #ifndef _TELSIM_H_
34 #define _TELSIM_H_
35
36 #include <TelDefines.h>
37
38 #ifdef __cplusplus
39 extern "C"
40 {
41 #endif
42
43 /** Maximum ICCID Length */
44 #define TAPI_SIM_ICCID_LEN_MAX 20
45
46 /** Alpha Id  max length */
47 #define TAPI_SIM_XDN_ALPHA_ID_MAX_LEN 30
48
49 /** Dialing number max length */
50 #define TAPI_SIM_XDN_DIALING_NUMBER_LEN 20
51
52 /** CSP profile entry count max length */
53 #define TAPI_SIM_CPHS_CUSTOMER_SERVICE_PROFILE_ENTRY_COUNT_MAX  11
54
55 /** Authentication code max length */
56 #define TAPI_SIM_AUTH_MAX_REQ_DATA_LEN 16
57
58 /** Authentication response data max length */
59 #define TAPI_SIM_AUTH_MAX_RESP_DATA_LEN 16
60
61 /** SAP APDU max length */
62 #define TAPI_SIM_APDU_MAX_LEN 256+2 // to be fine tuned according to lower layers, 2bytes for SW1 & SW2 should be added
63
64 /** SIM 3G Phone book EF Max count */
65 #define TAPI_SIM_PB_3G_FILE_MAX_COUNT 13
66
67 /** SAP Answer to Reset data max length */
68 #define TAPI_SIM_SAP_ATR_DATA   256
69
70 #define TAPI_SIM_NET_FULL_NAME_MAX_LEN 40
71
72 #define TAPI_SIM_NET_SHORT_NAME_MAX_LEN 10
73
74 #define TAPI_SIM_MSP_CNT_MAX 2
75
76 #define TAPI_SIM_OPERATION_TIMEOUT 1234
77
78 /**
79  * @enum TelSimCardType_t
80  * This enumeration defines the card type.
81  */
82 typedef enum {
83         TAPI_SIM_CARD_TYPE_UNKNOWN, /**< Unknown card */
84         TAPI_SIM_CARD_TYPE_GSM, /**< SIm(GSM) card*/
85         TAPI_SIM_CARD_TYPE_USIM, /**< USIM card */
86         TAPI_SIM_CARD_TYPE_RUIM,
87         TAPI_SIM_CARD_TYPE_IMS,
88 } TelSimCardType_t;
89
90 /**
91  * @enum TelSimFileID_t
92  * This enumeration defines the card type.
93  */
94 typedef enum {
95         TAPI_SIM_EF_DIR = 0x2F00, /**< Root Directory for the USIM */
96         TAPI_SIM_EF_ICCID = 0x2FE2, /**< the ICC Identification file    */
97         TAPI_SIM_EF_IMSI = 0x6F07, /**< the IMSI file                */
98         TAPI_SIM_EF_SST = 0x6F38, /**< the SIM Service Table file   */
99         TAPI_SIM_EF_EST = 0x6F56, /**< the Enabled Service Table file   */
100         TAPI_SIM_EF_OPLMN_ACT = 0x6F61, /**< the OPLMN List file*/
101         TAPI_SIM_EF_GID1 = 0x6F3E, /**< the Group Identifier Level 1 */
102         TAPI_SIM_EF_GID2 = 0x6F3F, /**< the Group Identifier Level 2 */
103
104         TAPI_SIM_EF_ELP = 0x2F05, /**< the Extended Language Preference file */
105         TAPI_SIM_EF_LP = 0x6F05, /**< SIM: Language preference */
106         TAPI_SIM_EF_ECC = 0x6FB7, /**< the Emergency Call Codes     */
107         TAPI_SIM_EF_SPN = 0x6F46, /**< the Service Provider Name    */
108         TAPI_SIM_EF_SPDI = 0x6FCD, /**< the Service provider display information*/
109         TAPI_SIM_EF_PNN = 0x6FC5, /**< the PLMN Network Name File*/
110         TAPI_SIM_EF_OPL = 0x6FC6, /**< the Operator PLMN List File*/
111         TAPI_SIM_EF_MSISDN = 0x6F40, /**< MSISDN */
112
113         TAPI_SIM_EF_SMS = 0x6F3C, /** < Short Messages file */
114         TAPI_SIM_EF_SMSP = 0x6F42, /** < SMS Parameter */
115         TAPI_SIM_EF_SMSS = 0x6F43, /** < SMS Status */
116         TAPI_SIM_EF_CBMI = 0x6F45, /** < Cell Broadcast Message Identifier */
117         TAPI_SIM_EF_MBDN = 0x6FC7, /** < SIM Mail Box Dialing Number file */
118
119         TAPI_SIM_EF_USIM_MBI = 0x6FC9, /** < Mailbox Identifier -linear fixed*/
120         TAPI_SIM_EF_USIM_MWIS = 0x6FCA, /** < Message Waiting Indication Status -linear fixed*/
121         TAPI_SIM_EF_USIM_CFIS = 0x6FCB, /** < Call forward indication status -linear fixed*/
122
123         /* CPHS FILE ID */
124         TAPI_SIM_EF_CPHS_VOICE_MSG_WAITING = 0x6F11, /** < CPHS voice MSG waiting indication  */
125         TAPI_SIM_EF_CPHS_SERVICE_STRING_TABLE = 0x6F12, /** < CPHS service string table  */
126         TAPI_SIM_EF_CPHS_CALL_FORWARD_FLAGS = 0x6F13, /** < CPHS call forward flags  */
127         TAPI_SIM_EF_CPHS_OPERATOR_NAME_STRING = 0x6F14, /** < CPHS operator name string  */
128         TAPI_SIM_EF_CPHS_CUSTOMER_SERVICE_PROFILE = 0x6F15, /** < CPHS customer service profile  */
129         TAPI_SIM_EF_CPHS_CPHS_INFO = 0x6F16, /** < CPHS information  */
130         TAPI_SIM_EF_CPHS_MAILBOX_NUMBERS = 0x6F17, /** < CPHS mail box numbers  */
131         TAPI_SIM_EF_CPHS_OPERATOR_NAME_SHORT_FORM_STRING = 0x6F18, /** < CPHS operator name short form string  */
132         TAPI_SIM_EF_CPHS_INFORMATION_NUMBERS = 0x6F19, /** < CPHS information numbers  */
133         /*  CPHS ALS FILE ID */
134         TAPI_SIM_EF_CPHS_DYNAMICFLAGS = 0x6F9F, /** < CPHS Dynamics flags  */
135         TAPI_SIM_EF_CPHS_DYNAMIC2FLAG = 0x6F92, /** < CPHS Dynamics2 flags  */
136         TAPI_SIM_EF_CPHS_CUSTOMER_SERVICE_PROFILE_LINE2 = 0x6F98, /** < CPHS CSP2  */
137
138         /* Invalid File ID, All the file ID are less than this Value*/
139         TAPI_SIM_EF_INVALID = 0xFFFF, /**< Invalid file.*/
140         TAPI_SIM_EF_OTHERS, /**< Element to indicate an unknown file.*/
141 }TelSimFileID_t;
142
143 /**
144  * @enum TelSimFacilityStatus_t
145  * This enumeration defines the pin status.
146  */
147 typedef enum {
148         TAPI_SIM_FACILITY_DISABLED = 0x00,
149         TAPI_SIM_FACILITY_ENABLED = 0x01,
150         TAPI_SIM_FACILITY_UNKNOWN = 0xFF
151 } TelSimFacilityStatus_t;
152
153 /**
154  * @enum TelSimPinOperationResult_t
155  * This enumeration defines the pin operation result from the lower layers.
156  */
157 typedef enum {
158         TAPI_SIM_PIN_OPERATION_SUCCESS, /**< Operation involving PIN (verification/change/enable/disable, etc) is successful.  */
159         TAPI_SIM_BUSY, /**< SIM is busy  */
160         TAPI_SIM_CARD_ERROR, /**< SIM card error - Permanently blocked and general errors   */
161         TAPI_SIM_INCOMPATIBLE_PIN_OPERATION, /**< SIM Incompatible pin operation that is in case when invalid SIM command is given or incorrect parameters are supplied to the SIM. */
162         TAPI_SIM_PIN_INCORRECT_PASSWORD, /**< SIM PIN  Incorrect password */
163         TAPI_SIM_PUK_INCORRECT_PASSWORD, /**< SIM PUK Incorrect Password */
164         TAPI_SIM_PUK_REQUIRED, /**< PUK Required */
165         TAPI_SIM_PIN_REQUIRED, /**< PIN Required */
166         TAPI_SIM_NCK_REQUIRED, /**< Network Control Key Required */
167         TAPI_SIM_NSCK_REQUIRED, /**< Network Subset Control Key Required */
168         TAPI_SIM_SPCK_REQUIRED, /**< Service Provider Control Key Required */
169         TAPI_SIM_CCK_REQUIRED, /**< Corporate Control Key Required */
170         TAPI_SIM_LOCK_REQUIRED, /**<  PH-SIM (phone-SIM) locked state **/
171 } TelSimPinOperationResult_t;
172
173 /**
174  * @enum TelSimAccessResult_t
175  * This enumeration defines the SIM access result from the lower layers.
176  */
177 typedef enum {
178         TAPI_SIM_ACCESS_SUCCESS, /**< Access to file successful.  */
179         TAPI_SIM_ACCESS_CARD_ERROR, /**< SIM card error    */
180         TAPI_SIM_ACCESS_FILE_NOT_FOUND, /**< File not found  */
181         TAPI_SIM_ACCESS_ACCESS_CONDITION_NOT_SATISFIED, /**< Access condition is not fulfilled  */
182         TAPI_SIM_ACCESS_FAILED, /**< Access failed.  */
183 } TelSimAccessResult_t;
184
185 /**
186  * @enum TelSimPinType_t
187  * This enumeration defines the pin type.
188  */
189 typedef enum {
190         TAPI_SIM_PTYPE_PIN1 = 0x00, /**< PIN 1 code */
191         TAPI_SIM_PTYPE_PIN2 = 0x01, /**< PIN 2 code */
192         TAPI_SIM_PTYPE_PUK1 = 0x02, /**< PUK 1 code */
193         TAPI_SIM_PTYPE_PUK2 = 0x03, /**< PUK 2 code */
194         TAPI_SIM_PTYPE_UPIN = 0x04, /**< Universal PIN - Unused now */
195         TAPI_SIM_PTYPE_ADM = 0x05, /**< Administrator - Unused now */
196         TAPI_SIM_PTYPE_SIM = 0x06 /**< SIM Lock code */
197 } TelSimPinType_t;
198
199 /**
200  * @enum TelSimTypeOfNum_t
201  * This enumeration defines the type of number.
202  */
203 typedef enum {
204         TAPI_SIM_TON_UNKNOWN = 0, /**< unknown */
205         TAPI_SIM_TON_INTERNATIONAL = 1, /**< international number */
206         TAPI_SIM_TON_NATIONAL = 2, /**< national number */
207         TAPI_SIM_TON_NETWORK_SPECIFIC = 3, /**< network specific number */
208         TAPI_SIM_TON_DEDICATED_ACCESS = 4, /**< subscriber number */
209         TAPI_SIM_TON_ALPHA_NUMERIC = 5, /**< alphanumeric, GSM 7-bit default alphabet) */
210         TAPI_SIM_TON_ABBREVIATED_NUMBER = 6, /**< abbreviated number */
211         TAPI_SIM_TON_RESERVED_FOR_EXT = 7 /**< reserved for extension */
212 } TelSimTypeOfNum_t;
213
214 /**
215  *  @enum TelSimTextEncrypt_t
216  *   This enumeration defines the text encryption types
217  */
218 typedef enum {
219         TAPI_SIM_TEXT_ENC_ASCII, /**< ASCII Encoding */
220         TAPI_SIM_TEXT_ENC_GSM7BIT, /**< GSM 7 Bit Encoding */
221         TAPI_SIM_TEXT_ENC_UCS2, /**< UCS2 Encoding */
222         TAPI_SIM_TEXT_ENC_HEX, /**< HEX Encoding */
223 } TelSimTextEncrypt_t;
224
225 /**
226  * @enum TelSimNumberingPlanIdentity_t
227  * This enumeration defines the numbering plan identifier.
228  */
229 typedef enum {
230         TAPI_SIM_NPI_UNKNOWN = 0, /**< Unknown */
231         TAPI_SIM_NPI_ISDN_TEL = 1, /**< ISDN/Telephone numbering plan */
232         TAPI_SIM_NPI_DATA_NUMBERING_PLAN = 3, /**< Data numbering plan */
233         TAPI_SIM_NPI_TELEX = 4, /**< Telex numbering plan */
234         TAPI_SIM_NPI_SVC_CNTR_SPECIFIC_PLAN = 5, /**< Service Center Specific plan */
235         TAPI_SIM_NPI_SVC_CNTR_SPECIFIC_PLAN2 = 6, /**< Service Center Specific plan */
236         TAPI_SIM_NPI_NATIONAL = 8, /**< National numbering plan */
237         TAPI_SIM_NPI_PRIVATE = 9, /**< Private numbering plan */
238         TAPI_SIM_NPI_ERMES_NUMBERING_PLAN = 10, /**< ERMES numbering plan */
239         TAPI_SIM_NPI_RESERVED_FOR_EXT = 0xF /**< Reserved for extension */
240 } TelSimNumberingPlanIdentity_t;
241
242 /**
243  * @enum TelSimEccEmergencyServiceInfo_t
244  * This enumeration defines the emergency service type.
245  */
246 typedef enum {
247         TAPI_SIM_ECC_ESC_POLICE = 0x01, /**< Police */
248         TAPI_SIM_ECC_ESC_AMBULANCE = 0x02, /**< Ambulance */
249         TAPI_SIM_ECC_ESC_FIREBRIGADE = 0x04, /**< Fire brigade */
250         TAPI_SIM_ECC_ESC_MARAINEGUARD = 0x08, /**< Marine guard */
251         TAPI_SIM_ECC_ESC_MOUTAINRESCUE = 0x10, /**< Mountain rescue */
252         TAPI_SIM_ECC_ESC_SPARE = 0x00 /**< Spare */
253 } TelSimEccEmergencyServiceInfo_t;
254
255 /**
256  * @enum TelSimLanguagePreferenceCode_t
257  * This enumeration defines the language indication code.
258  */
259 typedef enum {
260         TAPI_SIM_LP_GERMAN = 0x00, /**< German */
261         TAPI_SIM_LP_ENGLISH = 0x01, /**< English */
262         TAPI_SIM_LP_ITALIAN = 0x02, /**< Italian */
263         TAPI_SIM_LP_FRENCH = 0x03, /**< French */
264         TAPI_SIM_LP_SPANISH = 0x04, /**< Spanish */
265         TAPI_SIM_LP_DUTCH = 0x05, /**< Dutch */
266         TAPI_SIM_LP_SWEDISH = 0x06, /**< Swedish */
267         TAPI_SIM_LP_DANISH = 0x07, /**< Danish */
268         TAPI_SIM_LP_PORTUGUESE = 0x08, /**< Portuguese */
269         TAPI_SIM_LP_FINNISH = 0x09, /**< Finnish */
270         TAPI_SIM_LP_NORWEGIAN = 0x0A, /**< Norwegian */
271         TAPI_SIM_LP_GREEK = 0x0B, /**< Greek */
272         TAPI_SIM_LP_TURKISH = 0x0C, /**< Turkish */
273         TAPI_SIM_LP_HUNGARIAN = 0x0D, /**< Hungarian */
274         TAPI_SIM_LP_POLISH = 0x0E, /**< Polish */
275         TAPI_SIM_LP_KOREAN = 0x0F, /**< Korean */
276         TAPI_SIM_LP_CHINESE = 0x10, /**< Chinese */
277         TAPI_SIM_LP_RUSSIAN = 0x11, /**< Russian */
278         TAPI_SIM_LP_JAPANESE = 0x12, /**< Japanese */
279         TAPI_SIM_LP_LANG_UNSPECIFIED = 0xFF /**< Unspecified */
280 } TelSimLanguagePreferenceCode_t;
281
282 /**
283  * @enum TelSimCardStatus_t
284  * This enumeration defines the SIM card status
285  */
286 typedef enum {
287         TAPI_SIM_STATUS_CARD_ERROR = 0x00, /**< Bad card / On the fly SIM gone bad **/
288         TAPI_SIM_STATUS_CARD_NOT_PRESENT = 0x01, /**<  Card not present **/
289         TAPI_SIM_STATUS_SIM_INITIALIZING = 0x02, /**<  SIM is Initializing state **/
290         TAPI_SIM_STATUS_SIM_INIT_COMPLETED = 0x03, /**<  SIM Initialization ok **/
291         TAPI_SIM_STATUS_SIM_PIN_REQUIRED = 0x04, /**<  PIN  required state **/
292         TAPI_SIM_STATUS_SIM_PUK_REQUIRED = 0x05, /**<  PUK required state **/
293         TAPI_SIM_STATUS_CARD_BLOCKED = 0x06, /**<  PIN/PUK blocked(permanently blocked- All the attempts for PIN/PUK failed) **/
294         TAPI_SIM_STATUS_SIM_NCK_REQUIRED = 0x07, /**<  Network Control Key required state **/
295         TAPI_SIM_STATUS_SIM_NSCK_REQUIRED = 0x08, /**<  Network Subset Control Key required state **/
296         TAPI_SIM_STATUS_SIM_SPCK_REQUIRED = 0x09, /**<  Service Provider Control Key required state **/
297         TAPI_SIM_STATUS_SIM_CCK_REQUIRED = 0x0a, /**<  Corporate Control Key required state **/
298         TAPI_SIM_STATUS_CARD_REMOVED = 0x0b, /**<  Card removed **/
299         TAPI_SIM_STATUS_SIM_LOCK_REQUIRED = 0x0c, /**<  PH-SIM (phone-SIM) locked state **/
300         TAPI_SIM_STATUS_UNKNOWN = 0xff /**<  Unknown status. It can be initial status **/
301 } TelSimCardStatus_t;
302
303 /**
304  * @enum TelSimCphsPhaseType_t
305  * This enum gives the current CPHS phase of SIM card.
306  */
307 typedef enum {
308         TAPI_SIM_CPHS_PHASE1 = 0x01, /**< phase1  */
309         TAPI_SIM_CPHS_PHASE2 = 0x02, /**< phase2  */
310         TAPI_SIM_CPHS_PHASE_RFU = 0xff /**< RFU  */
311 } TelSimCphsPhaseType_t;
312
313 /**
314  * @enum TelSimCphsIndexLevelIndicator_t
315  * This struct gives CPHS index level indication.
316  */
317 typedef enum {
318         TAPI_SIM_CPHS_INDEX_LEVEL_ONE = 0x01, /**< SIM cphs index level one */
319         TAPI_SIM_CPHS_INDEX_LEVEL_TWO = 0x02, /**< SIM cphs index level two */
320         TAPI_SIM_CPHS_INDEX_LEVEL_THREE = 0x03, /**< SIM cphs index level three */
321         TAPI_SIM_CPHS_INDEX_LEVEL_RFU = 0xff /**< SIM cphs index level rfu */
322 } TelSimCphsIndexLevelIndicator_t;
323
324 /**
325  * @enum TelSimCphsCustomerServiceGroup_t
326  * This struct gives CPHS group service type information .
327  */
328 typedef enum {
329         TAPI_SIM_CPHS_CSP_SERVICE_GROUP_CALL_OFFERING = 0x01, /**< Group csp offering*/
330         TAPI_SIM_CPHS_CSP_SERVICE_GROUP_CALL_RESTRICTION = 0x02, /**< Group csp restriction*/
331         TAPI_SIM_CPHS_CSP_SERVICE_GROUP_OTHER_SUPP_SERVICES = 0x03, /**< Group csp supplementary services*/
332         TAPI_SIM_CPHS_CSP_SERVICE_GROUP_CALL_COMPLETION = 0x04, /**< Group csp completion*/
333         TAPI_SIM_CPHS_CSP_SERVICE_GROUP_TELESERVICES = 0x05, /**< Group csp teleservices*/
334         TAPI_SIM_CPHS_CSP_SERVICE_GROUP_CPHS_TELESERVICES = 0x06, /**< Group csp cphs teleservies*/
335         TAPI_SIM_CPHS_CSP_SERVICE_GROUP_CPHS_FEATURES = 0x07, /**< Group csp cphs features*/
336         TAPI_SIM_CPHS_CSP_SERVICE_GROUP_NUMBER_IDENTIFIERS = 0x08, /**< Group csp number identifiers*/
337         TAPI_SIM_CPHS_CSP_SERVICE_GROUP_PHASE_SERVICES = 0x09, /**< Group csp phase services*/
338         TAPI_SIM_CPHS_CSP_SERVICE_GROUP_VALUE_ADDED_SERVICES = 0xC0, /**< Group csp value added services*/
339         TAPI_SIM_CPHS_CSP_SERVICE_GROUP_INFORMATION_NUMBERS = 0xD5 /**< Group csp information numbers*/
340 } TelSimCphsCustomerServiceGroup_t;
341
342 /**
343  * @enum TelSimMailboxType_t
344  * This enum gives mailbox type.
345  */
346 typedef enum {
347         TAPI_SIM_MAILBOX_VOICE = 0x01, /**< CFIS voice*/
348         TAPI_SIM_MAILBOX_FAX = 0x03, /**< CFIS fax*/
349         TAPI_SIM_MAILBOX_DATA = 0x04, /**< CFIS data*/
350         TAPI_SIM_MAILBOX_EMAIL = 0x05, /**< CFIS email*/
351         TAPI_SIM_MAILBOX_OTHER = 0x06, /**< CFIS other*/
352 } TelSimMailboxType_t;
353
354 /**
355  * @enum TelSimDynamicFlagsSelectedLineId_t
356  * This enum gives dynamics flag selected line  information.
357  */
358 typedef enum {
359         TAPI_SIM_DYNAMIC_FLAGS_LINE1 = 0x01, /**< line 1 */
360         TAPI_SIM_DYNAMIC_FLAGS_LINE2 = 0x00, /**< line 2*/
361         TAPI_SIM_DYNAMIC_FLAGS_RFU = 0xff /**< rfu*/
362 } TelSimDynamicFlagsSelectedLineId_t;
363
364 /**
365  * @enum tapi_sim_dynamic2_flag_als_status_t
366  * This enum gives dynamics2 flag selected line  information.
367  */
368 typedef enum {
369         TAPI_SIM_PIN2_ACCESSIBLE_FLAGS_LOCKED = 0x01, /**< Dynamic flags locked */
370         TAPI_SIM_PIN2_ACCESSIBLE_FLAGS_UNLOCKED = 0x00, /**< Dynamic flags unlocked */
371         TAPI_SIM_PIN2_ACCESSIBLE_FLAGS_RFU = 0xff /**< rfu */
372 } TelSimDynamic2FlagAlsStatus_t;
373
374
375 /**
376  * @enum TelSimAuthenticationType_t
377  * This is used for Authentication Procedure by using SIM.
378  */
379 typedef enum {
380         TAPI_SIM_AUTH_TYPE_IMS = 0x00, /**< IMS Authentication */
381         TAPI_SIM_AUTH_TYPE_GSM, /**< GSM Authentication */
382         TAPI_SIM_AUTH_TYPE_3G, /**< 3G Authentication */
383         TAPI_SIM_AUTH_TYPE_MAX /**< TBD */
384 } TelSimAuthenticationType_t;
385
386 /**
387  * @enum TelSimAuthenticationResult_t
388  * This is used for Authentication Procedure.
389  */
390 typedef enum {
391         TAPI_SIM_AUTH_NO_ERROR = 0x00, /**< ISIM no error */
392         TAPI_SIM_AUTH_CANNOT_PERFORM, /**< status - can't perform authentication */
393         TAPI_SIM_AUTH_SKIP_RESPONSE, /**< status - skip authentication response */
394         TAPI_SIM_AUTH_MAK_CODE_FAILURE, /**< status - MAK(Multiple Activation Key) code failure */
395         TAPI_SIM_AUTH_SQN_FAILURE, /**< status - SQN(SeQuenceNumber) failure */
396         TAPI_SIM_AUTH_SYNCH_FAILURE, /**< status - synch failure */
397         TAPI_SIM_AUTH_UNSUPPORTED_CONTEXT, /**< status - unsupported context */
398         TAPI_SIM_AUTH_MAX /**< TBD */
399 } TelSimAuthenticationResult_t;
400
401 /**
402  * @enum TelSimLockType_t
403  *      This structure gives security lock type enum values
404  */
405 typedef enum {
406         TAPI_SIM_LOCK_PS = 0x01, /** < PH-SIM (phone-SIM) locked.Lock Phone to SIM/UICC card
407          *      (MT asks password when other than current SIM/UICC card inserted;
408          *      MT may remember certain amount of previously used cards thus not
409          *      requiring password when they are inserted
410          */
411         TAPI_SIM_LOCK_PF, /** < PH-FSIM (phone-first-SIM) Lock Phone to the very
412          * First inserted SIM/UICC card(MT asks password when other than the first SIM/UICC
413          * card is inserted
414          */
415         TAPI_SIM_LOCK_SC, /** < SIM Lock (PIN, PIN2, PUK, PUK2) Lock SIM/UICC card ( SIM asks password in ME power-up and
416          *      when this command is issued
417          */
418         TAPI_SIM_LOCK_FD, /** < FDN - SIM card or active application in the UICC (GSM or USIM)
419          *      fixed dialing memory feature */
420         TAPI_SIM_LOCK_PN, /**< Network Personalization */
421         TAPI_SIM_LOCK_PU, /** < network subset Personalization */
422         TAPI_SIM_LOCK_PP, /** < service Provider Personalization */
423         TAPI_SIM_LOCK_PC, /** < Corporate Personalization */
424 } TelSimLockType_t;
425
426 /**
427  * @enum TelSimLockKey_t
428  *      This structure gives security lock key information enum values
429  */
430 typedef enum {
431         TAPI_SIM_LOCK_KEY_NOT_NEED = 0x00, /**< key not need */
432         TAPI_SIM_LOCK_KEY_PIN = 0x01, /**< PIN required */
433         TAPI_SIM_LOCK_KEY_PUK = 0x02, /**< PUK required */
434         TAPI_SIM_LOCK_KEY_PIN2 = 0x03, /**< PIN2 required */
435         TAPI_SIM_LOCK_KEY_PUK2 = 0x04, /**< PUK2 required */
436         TAPI_SIM_LOCK_PERM_BLOCKED = 0x05, /**< Permanent block SIM */
437 } TelSimLockStatus_t;
438
439 /**
440  * @enum TelSimSapPowerMode_t
441  * This enum gives the SAP message Ids between SAP client and SAP server.
442  */
443 typedef enum {
444         TAPI_SIM_SAP_POWER_SIM_ON_REQ, /**< SAP Client request about power SIM on in Server */
445         TAPI_SIM_SAP_POWER_SIM_OFF_REQ, /**< SAP Client request about power SIM off in Server */
446         TAPI_SIM_SAP_RESET_SIM_REQ, /**< SAP Client request about SIM reset in Server */
447 } TelSimSapPowerMode_t;
448
449 /**
450  * @enum TelSimSapConnectionStatus_t
451  * This enum gives the SAP connection status information .
452  */
453 typedef enum {
454         TAPI_SIM_SAP_CONNECTION_STATUS_OK = 0x00, /**< connect successfully */
455         TAPI_SIM_SAP_CONNECTION_STATUS_UNABLE_TO_ESTABLISH, /**< unable to establish connection */
456         TAPI_SIM_SAP_CONNECTION_STATUS_NOT_SUPPORT_MAX_SIZE, /**< when server does not support message length that client want send */
457         TAPI_SIM_SAP_CONNECTION_STATUS_TOO_SMALL_MAX_SIZE /**< when client want to connect with very small message length which is not supported by Server */
458 } TelSimSapConnectionStatus_t;
459
460 /**
461  * @enum TelSimSapDissconnectType_t
462  * This enum gives the SAP  disconnect type information.
463  */
464 typedef enum {
465         TAPI_SIM_SAP_DISCONNECT_TYPE_GRACEFUL = 0x00, /**< disconnection procedure ends after finishing current work */
466         TAPI_SIM_SAP_DISCONNECT_TYPE_IMMEDIATE /**<  disconnection procedure ends immediately*/
467 } TelSimSapDissconnectType_t;
468
469 /**
470  * @enum TelSimSapStatusInfo_t
471  * This enum gives the SAP current connection status information
472  */
473 typedef enum {
474         TAPI_SIM_SAP_STATUS_UNKNOWN = 0x00, /**<  SAP server connection status - unknown*/
475         TAPI_SIM_SAP_STATUS_NO_SIM, /**<  SAP server connection status - no SIM*/
476         TAPI_SIM_SAP_STATUS_NOT_READY, /**<  SAP server connection status - not ready*/
477         TAPI_SIM_SAP_STATUS_READY, /**<  SAP server connection status - ready*/
478         TAPI_SIM_SAP_STATUS_CONNECTED /**<  SAP server connection status - connected*/
479 } TelSimSapStatusInfo_t;
480
481 /**
482  * @enum TelSimSapCardStatus_t
483  * This enum gives the SIM card status if server`s status changed about connection with subscription module
484  */
485 typedef enum {
486         TAPI_SIM_SAP_CARD_STATUS_UNKNOWN = 0x00, /**<  SAP server status(card reader status) - unknown*/
487         TAPI_SIM_SAP_CARD_STATUS_RESET, /**<  SAP server status(card reader status) - reset*/
488         TAPI_SIM_SAP_CARD_STATUS_NOT_ACCESSIBLE, /**<  SAP server status(card reader status) - not accessible*/
489         TAPI_SIM_SAP_CARD_STATUS_REMOVED, /**<  SAP server status(card reader status) - removed*/
490         TAPI_SIM_SAP_CARD_STATUS_INSERTED, /**<  SAP server status(card reader status) - inserted*/
491         TAPI_SIM_SAP_CARD_STATUS_RECOVERED /**<  SAP server status(card reader status) - recovered*/
492 } TelSimSapCardStatus_t;
493
494 /**
495  * @enum TelSimSapResultCode_t
496  * This enum gives the SAP result information.
497  */
498 typedef enum {
499         TAPI_SIM_SAP_RESULT_CODE_OK = 0x00, /**<  SAP operation result - ok*/
500         TAPI_SIM_SAP_RESULT_CODE_NO_REASON, /**<  SAP operation result - no reason*/
501         TAPI_SIM_SAP_RESULT_CODE_CARD_NOT_ACCESSIBLE, /**<  SAP operation result - not accessible*/
502         TAPI_SIM_SAP_RESULT_CODE_CARD_ALREADY_POWER_OFF, /**<  SAP operation result - card already power off*/
503         TAPI_SIM_SAP_RESULT_CODE_CARD_REMOVED, /**<  SAP operation result - card removed*/
504         TAPI_SIM_SAP_RESULT_CODE_CARD_ALREADY_POWER_ON, /**<  SAP operation result - card already power on*/
505         TAPI_SIM_SAP_RESULT_CODE_DATA_NOT_AVAILABLE, /**<  SAP operation result - data not available*/
506         TAPI_SIM_SAP_RESULT_CODE_NOT_SUPPORT /**<  SAP operation result - not support*/
507 } TelSimSapResultCode_t;
508
509 /**
510  * @enum TelSimSapProtocol_t
511  * This enum gives SAP transport protocol type
512  */
513 typedef enum {
514         TAPI_SIM_SAP_PROTOCOL_T0, /**< T = 0, character*/
515         TAPI_SIM_SAP_PROTOCOL_T1 /**< T = 1, block*/
516 } TelSimSapProtocol_t;
517
518 /**
519  * @enum TelSimPbAccessResult_t
520  * This enumeration defines the Phone book access result
521  */
522 typedef enum {
523         TAPI_SIM_PB_SUCCESS, /**< SIM phonebook operation successful. */
524         TAPI_SIM_PB_FAIL, /**< SIM phonebook operation failure. */
525         TAPI_SIM_PB_INVALID_INDEX, /**< The index passed was not a valid index. */
526         TAPI_SIM_PB_INVALID_NUMBER_LENGTH, /**< The number length is exceeds the max length allowed (or 0). */
527         TAPI_SIM_PB_INVALID_NAME_LENGTH, /**< The name length is exceeds the max length allowed (or 0). */
528         TAPI_SIM_PB_ACCESS_CONDITION_NOT_SATISFIED, /**< Access condition for PB file is not satisfied. */
529 } TelSimPbAccessResult_t;
530
531 /**
532  * @enum TelSimPbFileType_t
533  * This enumeration defines  different storage types to be selected in SIM or USIM
534  */
535 typedef enum {
536         TAPI_SIM_PB_FDN, /**< Fixed Dialing Number */
537         TAPI_SIM_PB_ADN, /**< SIM - ADN  */
538         TAPI_SIM_PB_SDN, /**< Service Dialing Number  */
539         TAPI_SIM_PB_3GSIM, /**< USIM - 3G phone book */
540         TAPI_SIM_PB_AAS, /**< Additional number Alpha String */
541         TAPI_SIM_PB_GAS, /**< Grouping identifier Alpha String */
542         TAPI_SIM_PB_UNKNOWNN = 0xFF, /**< Unknown file type */
543 } TelSimPbType_t;
544
545 /**
546  * @enum TelSimPb3GFileType_t
547  *  This enumeration defines the different storage field types in 3G Phone book.
548  */
549 typedef enum {
550         /* for 3G phone storage field type */
551         TAPI_PB_3G_NAME = 0x01, /**< Name */
552         TAPI_PB_3G_NUMBER, /**< Number */
553         TAPI_PB_3G_ANR1, /**< First Another number*/
554         TAPI_PB_3G_ANR2, /**< Second Another number */
555         TAPI_PB_3G_ANR3, /**< Third Another number */
556         TAPI_PB_3G_EMAIL1, /**< First Email */
557         TAPI_PB_3G_EMAIL2, /**< Second Email */
558         TAPI_PB_3G_EMAIL3, /**< Third Email */
559         TAPI_PB_3G_EMAIL4, /**< Fourth Email */
560         TAPI_PB_3G_SNE, /**< Second name entry of main name*/
561         TAPI_PB_3G_GRP, /**< Group  */
562         TAPI_PB_3G_PBC, /** <1 byte control info and 1 byte hidden info*/
563 } TelSimPb3GFileType_t;
564
565 /**
566  * This data structure defines the data for the Imsi information.
567  */
568 typedef struct {
569         char szMcc[3 + 1]; /**< mobile country code */
570         char szMnc[3 + 1]; /**< mobile network code */
571         char szMsin[10 + 1]; /**< mobile station identification number */
572 } TelSimImsiInfo_t;
573
574 typedef struct {
575         char name[30+1];
576         char number[6+1];
577         TelSimEccEmergencyServiceInfo_t category;
578 }TelSimEcc_t;
579
580 typedef struct {
581         int ecc_count;
582         TelSimEcc_t list[15];
583 }TelSimEccList_t;
584
585 typedef struct {
586         int icc_length; /**< Integrated Circuit Card number length */
587         char icc_num[TAPI_SIM_ICCID_LEN_MAX]; /**< Integrated Circuit Card number */
588 } TelSimIccIdInfo_t;
589
590 typedef struct {
591         int b_cphs;
592         int rec_index; /**< index which stands for the location where record is saved in SIM*/
593         int profile_num; /**< SIM profile index*/
594         TelSimMailboxType_t mb_type;
595         int alpha_id_max_len; /**< alpha max length in SIM - READ ONLY*/
596         char alpha_id[TAPI_SIM_XDN_ALPHA_ID_MAX_LEN + 1]; /**< Alpha Identifier */
597         TelSimTypeOfNum_t ton; /**< Type Of Number */
598         TelSimNumberingPlanIdentity_t npi; /**< Number Plan Identity */
599         char num[TAPI_SIM_XDN_DIALING_NUMBER_LEN + 1]; /**< Dialing Number/SSC String */
600         unsigned char cc_id; /**< Capability/Configuration Identifier */
601         unsigned char ext1_id; /**< Extensiion1 Record Identifier */
602 }TelSimMailBoxNumber_t;
603
604 typedef struct {
605         int count;
606         TelSimMailBoxNumber_t list[TAPI_SIM_MSP_CNT_MAX*5]; //max is 10
607 }TelSimMailboxList_t;
608
609 typedef struct {
610         int rec_index;
611         unsigned char msp_num; /**< MSP number*/
612         unsigned char cfu_status; /**< call forwarding unconditional indication status*/
613         TelSimTypeOfNum_t ton; /**< TON*/
614         TelSimNumberingPlanIdentity_t npi; /**< NPI*/
615         char cfu_num[TAPI_SIM_XDN_DIALING_NUMBER_LEN + 1];/**< Dialing Number/SSC String*/
616         unsigned char cc2_id; /**< Capability/Configuration2 Record Identifier */
617         unsigned char ext7_id; /**< Extension 7 Record Identifier */
618 }TelSimCfis_t;
619
620 typedef struct {
621         int profile_count;
622         TelSimCfis_t cf[TAPI_SIM_MSP_CNT_MAX];
623 }TelSimCfisList_t;
624
625 typedef struct {
626         int b_line1; /**< CallForwardUnconditionalLine 1 */
627         int b_line2; /**< CallForwardUnconditionalLine 2 */
628         int b_fax; /**< CallForwardUnconditional FAX */
629         int b_data; /**<CallForwardUnconditional data*/
630 }TelSimCphsCf_t;
631
632 typedef struct {
633         int b_cphs;
634         TelSimCfisList_t cf_list;
635         TelSimCphsCf_t cphs_cf;
636 }TelSimCallForwardingResp_t;
637
638 typedef struct {
639         int b_cphs;
640         union {
641                 TelSimCfis_t cf;
642                 TelSimCphsCf_t cphs_cf;
643         } cf_data_u;
644 }TelSimCallForwardingReq_t;
645
646 typedef struct {
647         int rec_index;
648         unsigned char indicator_status; /**< Indicator Type*/
649         int voice_count; /**< VoiceMail Count*/
650         int fax_count; /**< FAX Count*/
651         int email_count; /**< Email Count*/
652         int other_count; /**< Other Count*/
653         int video_count; /**< VideoMail Count*/
654 }TelSimMwis_t;
655
656 typedef struct {
657         int profile_count;
658         TelSimMwis_t mw[TAPI_SIM_MSP_CNT_MAX];
659 }TelSimMwisList_t;
660
661 typedef struct {
662         int b_voice1; /**< VoiceMsgLine1 message waiting flag */
663         int b_voice2; /**< VoiceMsgLine2 message waiting flag */
664         int b_fax; /**< FAX message waiting flag */
665         int b_data; /**< Data message waiting flag */
666 }TelSimCphsMw_t;
667
668 typedef struct {
669         int b_cphs;
670         TelSimMwisList_t mw_list;
671         TelSimCphsMw_t cphs_mw;
672 }TelSimMessageWaitingResp_t;
673
674 typedef struct {
675         int b_cphs;
676         union {
677                 TelSimMwis_t mw;
678                 TelSimCphsMw_t cphs_mw;
679         } mw_data_u;
680 }TelSimMessageWaitingReq_t;
681
682 /**
683  *      This data structure represents MSISDN information
684  */
685 typedef struct {
686         char num[TAPI_SIM_XDN_DIALING_NUMBER_LEN + 1]; /**< MSISDN number. If not exist, Null string will be returned*/
687         char name[TAPI_SIM_XDN_ALPHA_ID_MAX_LEN + 1]; /**< MSISDN name. If not exist, Null string will be returned*/
688 } TelSimSubscriberInfo_t;
689
690 typedef struct {
691         int count;
692         TelSimSubscriberInfo_t list[3]; //max is 3
693 }TelSimMsisdnList_t;
694
695 typedef struct {
696         char plmn[6+1];
697         int b_umts;
698         int b_gsm;
699 }TelSimOplmnwact_t;
700
701 typedef struct {
702         int count;
703         TelSimOplmnwact_t list[30]; //max is 30
704 }TelSimOplmnwactList_t;
705
706 typedef struct {
707         unsigned char display_condition; /**< display condition (1 byte) */
708         unsigned char spn[TAPI_SIM_NET_FULL_NAME_MAX_LEN + 1]; /**< SPN */
709 }TelSimSpn_t;
710
711 typedef struct {
712         unsigned char full_name[TAPI_SIM_NET_FULL_NAME_MAX_LEN + 1];
713         unsigned char short_name[TAPI_SIM_NET_SHORT_NAME_MAX_LEN + 1];
714 }TelSimCphsNetName_t;
715
716 /**
717  *This is used for authentication request procedure.
718  */
719 typedef struct {
720         TelSimAuthenticationType_t auth_type; /**< Authentication type */
721         int rand_length; /**< the length of RAND */
722         int autn_length; /**< the length of AUTN. it is not used in case of GSM AUTH */
723         char rand_data[TAPI_SIM_AUTH_MAX_REQ_DATA_LEN]; /**< RAND data */
724         char autn_data[TAPI_SIM_AUTH_MAX_REQ_DATA_LEN]; /**< AUTN data. it is not used in case of GSM AUTH */
725 } TelSimAuthenticationData_t;
726
727 /**
728  * This is used for result data of authentication.
729  */
730 typedef struct {
731         TelSimAuthenticationType_t auth_type; /**< authentication type */
732         TelSimAuthenticationResult_t auth_result; /**< authentication result */
733         int resp_length; /**< response length. IMS and 3G case, it stands for RES_AUTS. GSM case, it stands for SRES. */
734         char resp_data[TAPI_SIM_AUTH_MAX_RESP_DATA_LEN]; /**< response data. IMS and 3G case, it stands for RES_AUTS. GSM case, it stands for SRES. */
735         int authentication_key_length; /**< the length of authentication key, Kc*/
736         char authentication_key[TAPI_SIM_AUTH_MAX_RESP_DATA_LEN]; /**< the data of of authentication key, Kc*/
737         int cipher_length; /**< the length of cipher key length */
738         char cipher_data[TAPI_SIM_AUTH_MAX_RESP_DATA_LEN]; /**< cipher key */
739         int integrity_length; /**< the length of integrity key length */
740         char integrity_data[TAPI_SIM_AUTH_MAX_RESP_DATA_LEN]; /**< integrity key */
741 } TelSimAuthenticationResponse_t;
742
743
744 /**
745  * This structure contains information about pin data.
746  * SIM PIN DATA. For PIN handling (Change, UnBlock) & for Type of PIN information.
747  */
748 typedef struct {
749         TelSimPinType_t type; /**< Pin type */
750         unsigned char* pw; /**< PIN code */
751         unsigned int pw_len; /**< PIN code length*/
752 } TelSimSecPw_t;
753
754 /**
755  * This data structure defines the data for the PIN Information.
756  */
757 typedef struct {
758         TelSimPinType_t type; /**< Specifies the PIN or PUK type.*/
759         int retry_count; /**< Number of attempts remaining for PIN/PUK verification.*/
760 } TelSimSecResult_t;
761
762 /**
763  * This structure is used to en/disable facility
764  */
765 typedef struct {
766         TelSimLockType_t lock_type; /**< Facility type */
767         unsigned char *pw; /**< password */
768         int pw_len; /**< password length */
769 } TelSimFacilityPw_t;
770
771 typedef struct {
772         TelSimLockType_t type; /**< Specifies the PIN or PUK type.*/
773         int retry_count; /**< Number of attempts remaining for PIN/PUK verification.*/
774 } TelSimFacilityResult_t;
775
776 typedef struct {
777         TelSimLockType_t type;
778         TelSimFacilityStatus_t f_status;
779 }TelSimFacilityInfo_t;
780
781 /**
782  *
783  * This structure is used to get information about LOCK_TYPE
784  */
785 typedef struct {
786         TelSimLockType_t lock_type; /**< Lock type */
787         TelSimLockStatus_t lock_status; /**< Lock key */
788         int retry_count; /**< retry counts */
789 } TelSimLockInfo_t;
790
791 /**
792  * This data structure defines the data for the apdu.
793  */
794 typedef struct {
795         unsigned short apdu_len;
796         unsigned char* apdu;
797 } TelSimApdu_t;
798
799 /**
800  * This data structure defines the data for the Response of sending apdu.
801  */
802 typedef struct {
803         unsigned short apdu_resp_len;
804         unsigned char apdu_resp[TAPI_SIM_APDU_MAX_LEN];
805 } TelSimApduResp_t;
806
807 /**
808  * This data structure defines the data for the Response of sending apdu.
809  */
810 typedef struct {
811         unsigned short atr_resp_len;
812         unsigned char atr_resp[TAPI_SIM_APDU_MAX_LEN];
813 } TelSimAtrResp_t;
814
815 /**
816  *      This sturcture gives information of available optional CPHS SIM files.
817  */
818 typedef struct {
819         /* Byte 2 - bit1 & 2*/
820         int bCustomerServiceProfile; /**< Customer Service Profile (CSP)  */
821         /* Byte 2 - bit3 & 4*/
822         int bServiceStringTable; /**< Service String Table (SST) */
823         /* Byte 2 - bit5 & 6*/
824         int bMailBoxNumbers; /**< MailBoxNumbers */
825         /* Byte 2 - bit7 & 8*/
826         int bOperatorNameShortForm; /**< Short form of operator name */
827         /* Byte 3 - bit1 & 2*/
828         int bInformationNumbers; /**< Information numbers */
829 } TelSimCphsServiceTable_t;
830
831 /*
832  These requirements are additional to the GSM 900 and DCS1800 recommendations.
833  They apply to all products which are to be compliant with the CPHS specification.
834
835  In addition to those SIM storage fields previously defined in DCS1800 to support
836  existing MS features and services, the Association has defined the following fields  :-
837
838  1)     Call Forwarding flag                                            (mandatory)
839  2)     Voice message waiting flag                                      (mandatory)
840  3)     PLMN operator name                                              (mandatory)
841  4)     Customer Service Profile (CSP)                          (optional)
842  5)     CPHS Information                                                        (mandatory)
843  6)     Mailbox Numbers                                                 (optional)
844  7)     Information Numbers                                             (optional)
845
846  */
847
848 /*
849  DATA FIELD - 6F 16: CPHS INFORMATION
850  Access Conditions:
851  READ   CHV1
852  UPDATE ADM
853  */
854 /**
855  *
856  *This structure gives CPHS information data.
857  */
858 typedef struct {
859         TelSimCphsPhaseType_t CphsPhase; /**< CPHS phase type */
860         TelSimCphsServiceTable_t CphsServiceTable; /**< CPHS service table */
861 } TelSimCphsInfo_t;
862
863 /*
864  DATA FIELD -6F 19: Information Numbers
865  Access Conditions:
866  READ   CHV1
867  UPDATE CHV1
868  */
869 /**
870  * This struct gives CPHS information numbers data.
871  */
872 typedef struct {
873         int bUsed; /**< SIM CPHS index level one */
874         unsigned char AlphaIdLength; /**< length of alpha identifier */
875
876         TelSimCphsIndexLevelIndicator_t IndexLevelIndicator; /**< SIM CPHS index level one */
877         int PremiumServiceIndicator; /**< SIM CPHS index level one */
878         int NetworkSpecificIndicator; /**< SIM CPHS index level one */
879         unsigned char Alpha_id[TAPI_SIM_XDN_ALPHA_ID_MAX_LEN + 1]; /**<  Alpha Identifier */
880
881         unsigned long DiallingnumLength; /**< Length of BCD number/SSC contents */
882         TelSimTypeOfNum_t TypeOfNumber; /**< TON */
883         TelSimNumberingPlanIdentity_t NumberingPlanIdentity; /**< NPI */
884         char DiallingNum[TAPI_SIM_XDN_DIALING_NUMBER_LEN + 1]; /**< dialing Number/SSC String */
885         unsigned char Ext1RecordId; /**< Extensiion1 Record Identifier */
886 } TelSimCphsInformationNum_t;
887
888 /*
889  DATA FIELD- 6F 15: Customer Service Profile (Storing a list of service options which are relevant to that specific customer)
890  Access Conditions:
891  READ   CHV1
892  UPDATE CHV1
893  */
894 /**
895  *
896  * This struct gives CPHS service call offering information.
897  */
898 typedef struct {
899         int bCallForwardingUnconditional; /**< CallForwarding Unconditional */
900         int bCallForwardingOnUserBusy; /**< CallForwarding On UserBusy */
901         int bCallForwardingOnNoReply; /**< CallForwarding On NoReply */
902         int bCallForwardingOnUserNotReachable; /**< CallForwarding On User Not Reachable */
903         int bCallTransfer; /**< Call Transfer */
904 } TelSimCphsServiceCallOffering_t;
905
906 /**
907  *
908  * This struct gives CPHS service call restriction information.
909  */
910 typedef struct {
911         int bBarringOfAllOutgoingCalls; /**< Barring Of All Outgoing Calls*/
912         int bBarringOfOutgoingInternationalCalls; /**< Barring Of Outgoing International Calls */
913         int bBarringOfOutgoingInternationalCallsExceptHplmn; /**< Barring Of Outgoing International Calls Except HPLMN */
914         int bBarringOfAllIncomingCallsRoamingOutsideHplmn; /**< Barring Of All Incoming Calls Roaming Outside HPLMN */
915         int bBarringOfIncomingCallsWhenRoaming; /**< Barring Of IncomingCalls When Roaming */
916 } TelSimCphsServiceCallRestriction_t;
917
918 /**
919  *
920  * This struct gives CPHS service SS  information.
921  */
922 typedef struct {
923         int bMultiPartyService; /**< MultiPartyService*/
924         int bClosedUserGroup; /**< ClosedUserGroup*/
925         int bAdviceOfCharge; /**< AdviceOfCharge*/
926         int bPreferentialClosedUserGroup; /**< PreferentialClosedUserGroup*/
927         int bClosedUserGroupOutgoingAccess; /**< ClosedUserGroupOutgoingAccess*/
928 } TelSimCphsServiceOtherSupplimentaryService_t;
929
930 /**
931  *
932  * This struct gives CPHS service call complete information.
933  */
934 typedef struct {
935         int bCallHold; /**< Call Hold*/
936         int bCallWaiting; /**< Call Waiting*/
937         int bCompletionOfCallToBusySubscriber; /**< Completion Of Call To Busy Subscriber*/
938         int bUserUserSignalling; /**< User User Signaling*/
939 } TelSimCphsServiceCallComplete_t;
940
941 /**
942  *
943  * This struct gives CPHS service teleservices  information.
944  */
945 typedef struct {
946         int bShortMessageMobileOriginated; /**< Short Message Mobile Originated*/
947         int bShortMessageMobileTerminated; /**< Short Message Mobile Terminated*/
948         int bShortMessageCellBroadcast; /**< Short Message Cell Broadcast*/
949         int bShortMessageReplyPath; /**< Short  Message Reply Path*/
950         int bShortMessageDeliveryConf; /**< Short Message Delivery Conf*/
951         int bShortMessageProtocolIdentifier; /**< Short Message Protocol Identifier*/
952         int bShortMessageValidityPeriod; /**< Short Message Validity Period*/
953 } TelSimCphsServiceTeleservices_t;
954
955 /**
956  *
957  * This struct gives CPHS alternative line service  information.
958  */
959 typedef struct {
960         int bAlternativeLineService; /**< Alternative Line Service*/
961 } TelSimCphsServiceCphsTeleservices_t;
962
963 /**
964  *
965  * This struct gives CPHS string service table information.
966  */
967 typedef struct {
968         int bStringServiceTable; /**< String Service Table*/
969 } TelSimCphsServiceCphsFeatures_t;
970
971 /**
972  *
973  * This struct gives CPHS service number identifier  information.
974  */
975 typedef struct {
976         int bCallingLineIdentificationPresent; /**< Calling Line Identification Present*/
977         int bConnectedLineIdentificationRestrict; /**< Connected Line Identification Restrict*/
978         int bConnectedLineIdentificationPresent; /**< Connected Line Identification Present*/
979         int bMaliciousCallIdentifier; /**< Malicious Call Identifier*/
980         int bCallingLineIdentificationSend; /**< Calling Line Identification Send*/
981         int bCallingLineIdentificationBlock; /**< Calling Line Identification Block*/
982 } TelSimCphsServiceNumberIdentifier_t;
983
984 /**
985  *
986  * This struct gives CPHS service phase services information.
987  */
988 typedef struct {
989         int bMenuForGprs; /**< Menu For GPRS*/
990         int bMenuForHighSpeedCsd; /**< Menu For HighSpeedCsd*/
991         int bMenuForVoiceGroupCall; /**< Menu For VoiceGroupCall*/
992         int bMenuForVoiceBroadcastService; /**< Menu For VoiceBroadcastService*/
993         int bMenuForMultipleSubscriberProfile; /**< Menu For MultipleSubscriberProfile*/
994         int bMenuForMultipleBand; /**< Menu For MultipleBand*/
995 } TelSimCphsServicePhaseServices_t;
996
997 /**
998  *
999  * This struct gives CPHS value added service   information.
1000  */
1001 typedef struct {
1002         int bRestrictMenuForManualSelection; /**< RestrictMenu For ManualSelection*/
1003         int bRestrictMenuForVoiceMail; /**< RestrictMenu For VoiceMail*/
1004         int bRestrictMenuForMoSmsAndPaging; /**< RestrictMenu For MoSmsAndPaging*/
1005         int bRestrictMenuForMoSmsWithEmialType; /**< RestrictMenu For MoSmsWithEmialType*/
1006         int bRestrictMenuForFaxCalls; /**< RestrictMenu For FaxCalls*/
1007         int bRestrictMenuForDataCalls; /**< RestrictMenu For DataCalls*/
1008         int bRestrictMenuForChangeLanguage; /**< RestrictMenu For ChangeLanguage*/
1009 } TelSimCphsServiceValueAddedServices_t;
1010
1011 /**
1012  *
1013  * This struct gives CPHS service information number data.
1014  */
1015 typedef struct {
1016         int bInformationNumbers; /**< Information Numbers*/
1017 } TelSimCphsServiceInformationNumbers_t;
1018
1019 /**
1020  *
1021  * This struct gives CPHS service profile entry  information.
1022  */
1023 typedef struct {
1024         TelSimCphsCustomerServiceGroup_t CustomerServiceGroup; /**< customer service group*/
1025         union {
1026                 TelSimCphsServiceCallOffering_t CallOffering; /**< call offering*/
1027                 TelSimCphsServiceCallRestriction_t CallRestriction; /**< call restriction*/
1028                 TelSimCphsServiceOtherSupplimentaryService_t OtherSuppServices; /**< other SS services*/
1029                 TelSimCphsServiceCallComplete_t CallComplete; /**< call complete*/
1030                 TelSimCphsServiceTeleservices_t Teleservices; /**< teleservices*/
1031                 TelSimCphsServiceCphsTeleservices_t CphsTeleservices; /**< CPHS teleservices*/
1032                 TelSimCphsServiceCphsTeleservices_t CphsFeatures; /**< CPHS features*/
1033                 TelSimCphsServiceNumberIdentifier_t NumberIdentifiers; /**< number identifiers*/
1034                 TelSimCphsServicePhaseServices_t PhaseServices; /**< phase services*/
1035                 TelSimCphsServiceValueAddedServices_t ValueAddedServices; /**< value added services*/
1036                 TelSimCphsServiceInformationNumbers_t InformationNumbers; /**< information numbers*/
1037         } u;
1038 } TelSimCphsCustomerServiceProfileEntry_t;
1039
1040 /**
1041  *
1042  * This struct gives CPHS service profile information.
1043  */
1044 typedef struct {
1045         TelSimCphsCustomerServiceProfileEntry_t ServiceProfileEntry[TAPI_SIM_CPHS_CUSTOMER_SERVICE_PROFILE_ENTRY_COUNT_MAX]; /**< service profile entry*/
1046 } TelSimCphsCustomerServiceProfileInfo_t;
1047
1048 /**
1049  *
1050  * This struct gives dynamics flag selected line  information.
1051  */
1052 typedef struct {
1053         TelSimDynamicFlagsSelectedLineId_t DynamicFlags; /**< Dynamic flags information */
1054 } TelSimDynamicFlagsInfo_t;
1055
1056 /**
1057  *
1058  * This struct gives dynamics flag selected line  information.
1059  */
1060 typedef struct {
1061         TelSimDynamic2FlagAlsStatus_t Dynamic2Flag; /**< Dynamic flags status */
1062 } TelSimDynamic2FlagsInfo_t;
1063
1064
1065 /**
1066  * This data structure gives the phone book availability of current SIM.
1067  */
1068 typedef struct {
1069         int b_fdn; /**< Fixed Dialing Number */
1070         int b_adn; /**< SIM - ADN(2G phonebook, Under DF phonebook       */
1071         int b_sdn; /**< Service Dialing Number  */
1072         int b_3g; /**< USIM - 3G phonebook */
1073         int b_aas; /**< Additional number Alpha String phonebook */
1074         int b_gas; /**< Grouping information Alpha String phonebook */
1075 } TelSimPbList_t;
1076
1077 typedef struct {
1078         TelSimPbType_t phonebook_type;
1079         unsigned short index;
1080         unsigned short next_index; //this field is not used in add/update case
1081
1082         unsigned char name[255+1];
1083         TelSimTextEncrypt_t dcs;
1084
1085         unsigned char number[255+1];
1086         TelSimTypeOfNum_t ton;
1087
1088         /* following field is valid in only USIM*/
1089         unsigned char sne[255+1];
1090         TelSimTextEncrypt_t sne_dcs;
1091         unsigned char anr1[255+1];
1092         TelSimTypeOfNum_t anr1_ton;
1093         unsigned char anr2[255+1];
1094         TelSimTypeOfNum_t anr2_ton;
1095         unsigned char anr3[255+1];
1096         TelSimTypeOfNum_t anr3_ton;
1097
1098         unsigned char email1[255+1];
1099         unsigned char email2[255+1];
1100         unsigned char email3[255+1];
1101         unsigned char email4[255+1];
1102
1103         unsigned short group_index; //GRP
1104         unsigned short pb_control; //PBC
1105 } TelSimPbRecord_t;
1106
1107 /**
1108  *      This data structure defines the phone book storage count information.
1109  */
1110 typedef struct {
1111         TelSimPbType_t StorageFileType; /**< Storage  file type */
1112         unsigned short TotalRecordCount; /**< Total record count */
1113         unsigned short UsedRecordCount; /**< Used record count */
1114 } TelSimPbStorageInfo_t;
1115
1116 /**
1117  * This data structure gives the phone book entry information.
1118  */
1119 typedef struct {
1120         TelSimPbType_t StorageFileType; /**< Storage  file type */
1121         unsigned short PbIndexMin; /**< Phone book minimum index*/
1122         unsigned short PbIndexMax; /**< Phone book maximum index */
1123         unsigned short PbNumLenMax; /**< Phone number maximum length */
1124         unsigned short PbTextLenMax; /**< Text maximum length */
1125 } TelSimPbEntryInfo_t;
1126
1127 /**
1128  *
1129  This structure gives 3G phone book capability information.
1130  */
1131 typedef struct {
1132         TelSimPb3GFileType_t field_type; /**< 3G phonebook file type */
1133         unsigned short index_max; /**< max index */
1134         unsigned short text_max; /**< max text length */
1135         unsigned short used_count; /**< used record count */
1136 } TelSimPb3GFileTypeCapabiltyInfo_t;
1137
1138 /**
1139  *
1140  * This data structure defines the data for the SIM PHONEBOOK & ITS CAPABILITIES information.
1141  * It refers to EF_PBR
1142  */
1143 typedef struct {
1144         unsigned short FileTypeCount; /**< phonebook file type count */
1145         TelSimPb3GFileTypeCapabiltyInfo_t FileTypeInfo[TAPI_SIM_PB_3G_FILE_MAX_COUNT]; /**< phonebook file type information */
1146 } TelSimPbCapabilityInfo_t;
1147
1148
1149
1150 /* SAP (SIM Access Profile) related interface structures and enum */
1151 /**
1152  * This struct gives the SAP ATR response data information.
1153  */
1154 typedef struct {
1155         int atr_len; /**<  SAP ATR response data length */
1156         unsigned char atr_data[TAPI_SIM_SAP_ATR_DATA]; /**<  SAP ATR response data */
1157 } TelSapAtrInfo_t;
1158
1159 /* SAP transfer APDU request */
1160
1161 /**
1162  * This data structure gives the SAP APDU data information.
1163  */
1164 typedef struct {
1165         int apdu_len; /**<  SAP APDU length */
1166         unsigned char apdu_data[TAPI_SIM_APDU_MAX_LEN]; /**<  SAP APDU data */
1167 } TelSapApduData_t;
1168
1169
1170 #ifdef __cplusplus
1171 }
1172 #endif
1173
1174 #endif // _TELSIM_H_
1175 /**
1176  * @}
1177  */