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