4 * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved.
5 * Copyright (c) 2013 Intel Corporation. All rights reserved.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
26 * @addtogroup TAPI_SIM
30 * @brief TAPI sim Interface
38 #define TELEPHONY_SIM_INTERFACE TELEPHONY_SERVICE".Sim"
40 #define TEL_SIM_ICCID_LEN_MAX 20 /**< Maximum ICCID Length */
41 #define TEL_SIM_MSIN_LEN_MAX 10 /**< Mobile Station Identification Number max length */
42 #define TEL_SIM_MCC_MNC_LEN_MAX 3 /**< MCC/MNC max length */
44 #define TEL_SIM_PLMN_LEN_MAX 6 /**< PLMN max length */
45 #define TEL_SIM_SPN_LEN_MAX 16 /**< Service Provider Name max length */
47 #define TEL_SIM_ECC_NUMBER_LEN_MAX 6 /**< Emergency code max length */
48 #define TEL_SIM_ECC_LIST_MAX 16 /**< Emergency list max items */
49 #define TEL_SIM_ECC_TEXT_MAX 255 /**< Emergency alpha identifier max length */
51 #define TEL_SIM_EXT_RECORD_CNT_MAX 15 /** EXT record count max length */
52 #define TEL_SIM_OPL_PNN_RECORD_CNT_MAX 5 /* OPL PNN record count max */
53 #define TEL_SIM_NW_FULL_NAME_LEN_MAX 40 /* Full name length max */
54 #define TEL_SIM_MBDN_NUM_LEN_MAX 20 /**< Max length of the Number supported*/
55 #define TEL_SIM_ALPHA_ID_LEN_MAX 241 /**< Max length of the Alpha ID supported*/
57 #define TEL_SIM_MSP_CNT_MAX 4 /**< The Profile Identity shall be between 1and 4 as defined in TS 23.097 for MSP.*/
59 #define TEL_SIM_AUTH_MAX_REQ_DATA_LEN 16 /**< Authentication code max length */
60 #define TEL_SIM_AUTH_MAX_RESP_DATA_LEN 16 /**< Authentication response data max length */
62 #define TEL_SIM_APDU_LEN_MAX 261 /**< APDU max command length */
63 #define TEL_SIM_APDU_RESP_LEN_MAX 258 /**< APDU max response length */
64 #define TEL_SIM_ATR_LEN_MAX 33 /**< Answer to Reset data max length */
66 #define TEL_SIM_MAILBOX_TYPE_MAX 5 /**< Mailbox type count */
67 #define TEL_SIM_CALL_FORWARDING_TYPE_MAX 5 /** Call forwarding type count */
71 * Response (Return) values.
74 TEL_SIM_RESULT_SUCCESS, /**< Operation completed successfully */
75 TEL_SIM_RESULT_FAILURE, /**< Operation Failed */
76 TEL_SIM_RESULT_INVALID_PARAMETER, /**< Invalid input parameters */
77 TEL_SIM_RESULT_MEMORY_FAILURE, /**< Memory allocation failed */
78 TEL_SIM_RESULT_OPERATION_NOT_SUPPORTED, /**< Operation not supported */
80 TEL_SIM_RESULT_CARD_ERROR, /**< SIM card error - Permanently blocked and general errors */
81 TEL_SIM_RESULT_ACCESS_CONDITION_NOT_SATISFIED, /**< SIM Incompatible pin operation that is in case when invalid SIM command is given or incorrect parameters are supplied to the SIM. */
82 TEL_SIM_RESULT_INCOMPATIBLE_PIN_OPERATION, /**< SIM PIN Incorrect password */
83 TEL_SIM_RESULT_INCORRECT_PASSWORD, /**< SIM Incorrect password */
84 TEL_SIM_RESULT_PIN_REQUIRED, /**< PIN Required */
85 TEL_SIM_RESULT_PUK_REQUIRED, /**< PUK Required */
86 TEL_SIM_RESULT_PERM_BLOCKED, /**< Permanent block SIM */
87 TEL_SIM_RESULT_SQN_FAILURE, /**< status - SQN(SeQuenceNumber) failure */
88 TEL_SIM_RESULT_OPERATION_NOT_PERMITTED /**< Operation not permitted */
92 * @enum TelSimCardType
93 * This enumeration defines the card type.
96 TEL_SIM_CARD_TYPE_UNKNOWN, /**< Unknown card */
97 TEL_SIM_CARD_TYPE_GSM, /**< 2G SIM(GSM) card */
98 TEL_SIM_CARD_TYPE_USIM, /**< 3G USIM card */
99 TEL_SIM_CARD_TYPE_RUIM, /**< CDMA based card */
100 TEL_SIM_CARD_TYPE_ISIM /**< IMS based card */
104 TEL_SIM_MWIS_NONE = 0x00, /**< MWIS none*/
105 TEL_SIM_MWIS_VOICE = 0x01, /**< MWIS voice*/
106 TEL_SIM_MWIS_FAX = 0x02, /**< MWIS FAX*/
107 TEL_SIM_MWIS_EMAIL = 0x04, /**< MWIS email*/
108 TEL_SIM_MWIS_OTHER = 0x08, /**< MWIS other*/
109 TEL_SIM_MWIS_VIDEO = 0x10, /**< MWIS video*/
110 TEL_SIM_MWIS_RFU = 0xff /**< MWIS RFU*/
113 /** * @enum TelSimFacilityStatus
114 * This enumeration defines the pin status.
117 TEL_SIM_FACILITY_STATUS_UNKNOWN = -1, /**< SIM facility UNKNOWN status*/
118 TEL_SIM_FACILITY_STATUS_DISABLED, /**< SIM facility DISABLED status*/
119 TEL_SIM_FACILITY_STATUS_ENABLED /**< SIM facility ENABLED status*/
120 } TelSimFacilityStatus;
123 * @enum TelSimPinType
124 * This enumeration defines the pin type.
127 TEL_SIM_PIN_TYPE_PIN1, /**< PIN 1 code */
128 TEL_SIM_PIN_TYPE_PIN2 /**< PIN 2 code */
132 * @enum TelSimPukType
133 * This enumeration defines the puk type.
136 TEL_SIM_PUK_TYPE_PUK1, /**< PUK 1 code */
137 TEL_SIM_PUK_TYPE_PUK2 /**< PUK 2 code */
141 * @enum TelSimEccEmergencyServiceInfo
142 * This enumeration defines the emergency service type.
145 TEL_SIM_ECC_ESC_DEFAULT = 0x00, /**< DEFAULT */
146 TEL_SIM_ECC_ESC_POLICE = 0x01, /**< Police */
147 TEL_SIM_ECC_ESC_AMBULANCE = 0x02, /**< Ambulance */
148 TEL_SIM_ECC_ESC_FIREBRIGADE = 0x04, /**< Fire brigade */
149 TEL_SIM_ECC_ESC_MARINEGUARD = 0x08, /**< Marine guard */
150 TEL_SIM_ECC_ESC_MOUNTAINRESCUE = 0x10, /**< Mountain rescue */
151 TEL_SIM_ECC_ESC_MANUAL_ECALL = 0x20, /**< Manual Emergency call */
152 TEL_SIM_ECC_ESC_AUTO_ECALL = 0x40 /**< Automatic Emergency call */
153 } TelSimEccEmergencyServiceInfo;
156 * @enum TelSimLanguagePreferenceCode
157 * This enumeration defines the language indication code.
160 TEL_SIM_LP_GERMAN = 0x00, /**< German */
161 TEL_SIM_LP_ENGLISH = 0x01, /**< English */
162 TEL_SIM_LP_ITALIAN = 0x02, /**< Italian */
163 TEL_SIM_LP_FRENCH = 0x03, /**< French */
164 TEL_SIM_LP_SPANISH = 0x04, /**< Spanish */
165 TEL_SIM_LP_DUTCH = 0x05, /**< Dutch */
166 TEL_SIM_LP_SWEDISH = 0x06, /**< Swedish */
167 TEL_SIM_LP_DANISH = 0x07, /**< Danish */
168 TEL_SIM_LP_PORTUGUESE = 0x08, /**< Portuguese */
169 TEL_SIM_LP_FINNISH = 0x09, /**< Finnish */
170 TEL_SIM_LP_NORWEGIAN = 0x0A, /**< Norwegian */
171 TEL_SIM_LP_GREEK = 0x0B, /**< Greek */
172 TEL_SIM_LP_TURKISH = 0x0C, /**< Turkish */
173 TEL_SIM_LP_HUNGARIAN = 0x0D, /**< Hungarian */
174 TEL_SIM_LP_POLISH = 0x0E, /**< Polish */
175 TEL_SIM_LP_KOREAN = 0x0F, /**< Korean */
176 TEL_SIM_LP_CHINESE = 0x10, /**< Chinese */
177 TEL_SIM_LP_RUSSIAN = 0x11, /**< Russian */
178 TEL_SIM_LP_JAPANESE = 0x12, /**< Japanese */
179 TEL_SIM_LP_LANG_UNSPECIFIED = 0xFF /**< Unspecified */
180 } TelSimLanguagePreferenceCode;
183 * @enum TelSimCardStatus
184 * This enumeration defines the SIM card status
187 TEL_SIM_STATUS_UNKNOWN, /**< Unknown status. It can be initial status **/
188 TEL_SIM_STATUS_CARD_ERROR, /**< Bad card / On the fly SIM gone bad **/
189 TEL_SIM_STATUS_SIM_CARD_POWEROFF, /**< SIM Card Powered OFF **/
190 TEL_SIM_STATUS_CARD_NOT_PRESENT, /**< Card not present **/
191 TEL_SIM_STATUS_SIM_INITIALIZING, /**< SIM is Initializing state **/
192 TEL_SIM_STATUS_SIM_INIT_COMPLETED, /**< SIM Initialization COMPLETE **/
193 TEL_SIM_STATUS_SIM_PIN_REQUIRED, /**< PIN required state **/
194 TEL_SIM_STATUS_SIM_PUK_REQUIRED, /**< PUK required state **/
195 TEL_SIM_STATUS_CARD_BLOCKED, /**< PIN/PUK blocked(permanently blocked - All the attempts for PIN/PUK failed) **/
196 TEL_SIM_STATUS_SIM_NCK_REQUIRED, /**< Network Control Key required state **/
197 TEL_SIM_STATUS_SIM_NSCK_REQUIRED, /**< Network Subset Control Key required state **/
198 TEL_SIM_STATUS_SIM_SPCK_REQUIRED, /**< Service Provider Control Key required state **/
199 TEL_SIM_STATUS_SIM_CCK_REQUIRED, /**< Corporate Control Key required state **/
200 TEL_SIM_STATUS_CARD_REMOVED, /**< Card removed **/
201 TEL_SIM_STATUS_SIM_LOCK_REQUIRED /**< PH-SIM (phone-SIM) locked state **/
205 * @enum TelSimCardChangeStatus
206 * This enumeration defines whether SIM card is changed or not
209 TEL_SIM_CHANGE_STATUS_UNKNOWN, /**< Unknown */
210 TEL_SIM_CHANGE_STATUS_SAME, /**< SIM card is same */
211 TEL_SIM_CHANGE_STATUS_CHANGED /**< SIM card is changed */
212 } TelSimCardChangeStatus;
215 * @enum TelSimRefreshCommandType
216 * This enumeration defines the SIM card status
219 TEL_SIM_REFRESH_CMD_INIT_AND_FULL_FCN = 0x00, /**< command qualifier for REFRESH SIM INIT AND FULL FILE CHANGE_NOTIFICATION */
220 TEL_SIM_REFRESH_CMD_FCN = 0x01, /**< command qualifier for REFRESH FILE CHANGE NOTIFICATION */
221 TEL_SIM_REFRESH_CMD_INIT_AND_FCN = 0x02, /**< command qualifier for REFRESH SIM INIT AND FILE CHANGE NOTIFICATION */
222 TEL_SIM_REFRESH_CMD_INIT = 0x03, /**< command qualifier for REFRESH SIM INIT */
223 TEL_SIM_REFRESH_CMD_RESET = 0x04, /**< command qualifier for REFRESH SIM RESET */
224 TEL_SIM_REFRESH_CMD_3G_APPLICATION_RESET = 0x05, /**< command qualifier for REFRESH 3G APPLICATION RESET */
225 TEL_SIM_REFRESH_CMD_3G_SESSION_RESET = 0x06, /**< command qualifier for REFRESH 3G SESSION RESET */
226 TEL_SIM_REFRESH_CMD_UNSPECIFIED = 0xFF /**< command qualifier for REFRESH RESERVED */
227 }TelSimRefreshCommandType;
230 * @enum TelSimMailboxType
231 * This enum gives mailbox type.
234 TEL_SIM_MAILBOX_VOICE, /**< Mailbox identifier voice */
235 TEL_SIM_MAILBOX_FAX, /**< Mailbox identifier fax */
236 TEL_SIM_MAILBOX_EMAIL, /**< Mailbox identifier email */
237 TEL_SIM_MAILBOX_OTHER, /**< Mailbox identifier other */
238 TEL_SIM_MAILBOX_VIDEO /**< Mailbox identifier video */
242 * @enum TelSimCallForwardingType
243 * This enum gives Call forwarding type.
246 TEL_SIM_CALL_FORWARDING_VOICE, /**< Call forwarding identifier voice */
247 TEL_SIM_CALL_FORWARDING_FAX, /**< Call forwarding identifier fax */
248 TEL_SIM_CALL_FORWARDING_EMAIL, /**< Call forwarding identifier email */
249 TEL_SIM_CALL_FORWARDING_OTHER, /**< Call forwarding identifier other */
250 TEL_SIM_CALL_FORWARDING_VIDEO /**< Call forwarding identifier video */
251 } TelSimCallForwardingType;
254 * @enum TelSimAuthenticationType
255 * This is used for Authentication Procedure by using SIM.
258 TEL_SIM_AUTH_GSM, /**< GSM Authentication */
259 TEL_SIM_AUTH_GSM_CTX, /**< GSM CTX Authentication */
260 TEL_SIM_AUTH_3G_CTX, /**< 3G CTX Authentication */
261 TEL_SIM_AUTH_GBA, /**< GBA Authentication */
262 TEL_SIM_AUTH_GBA_NAF, /**< GBA NAF Authentication */
263 TEL_SIM_AUTH_IMS_AKA /**< IMS Authentication */
264 } TelSimAuthenticationType;
267 * @enum TelSimLockType
268 * This structure gives security lock type enum values
272 /**< PH-SIM (phone-SIM) locked.Lock Phone to SIM/UICC card
273 * (MT asks password when other than current SIM/UICC card inserted;
274 * MT may remember certain amount of previously used cards thus not
275 * requiring password when they are inserted
278 /**< PH-FSIM (phone-first-SIM) Lock Phone to the very
279 * First inserted SIM/UICC card(MT asks password when other than the
280 * first SIM/UICC card is inserted
283 /**< SIM Lock (PIN, PIN2, PUK, PUK2) Lock SIM/UICC card ( SIM asks
284 * password in ME power-up and when this command is issued */
286 /**< FDN - SIM card or active application in the UICC (GSM or USIM)
287 * fixed dialing memory feature */
288 TEL_SIM_LOCK_PN, /**< Network Personalization */
289 TEL_SIM_LOCK_PU, /**< Network subset Personalization */
290 TEL_SIM_LOCK_PP, /**< Service Provider Personalization */
291 TEL_SIM_LOCK_PC, /**< Corporate Personalization */
295 * @enum TelSimLockStatus
296 * This structure gives security lock key information enum values
299 TEL_SIM_LOCK_KEY_NOT_NEED, /**< key not need */
300 TEL_SIM_LOCK_KEY_PIN, /**< PIN required */
301 TEL_SIM_LOCK_KEY_PUK, /**< PUK required */
302 TEL_SIM_LOCK_KEY_PIN2, /**< PIN2 required */
303 TEL_SIM_LOCK_KEY_PUK2, /**< PUK2 required */
304 TEL_SIM_LOCK_PERM_BLOCKED /**< Permanent block SIM */
308 * @enum TelSimSpnDispCondition
309 * This enumeration defines Service Provider Name display condition type.
313 TEL_SIM_DISP_INVALID, /**< Invalid display condition */
314 TEL_SIM_DISP_SPN, /**< SPN display condition */
315 TEL_SIM_DISP_PLMN, /**< PLMN display condition */
316 TEL_SIM_DISP_SPN_PLMN /**< SPN/PLMN display condition */
317 } TelSimSpnDispCondition;
320 * This data structure defines plmn informations
323 unsigned int index; /**< Plmn list index */
324 char *plmn; /**< numeric operator name (MCCMNC) */
328 * This data structure defines plmn list
331 unsigned int count; /**< Number of service provider plmns in the list */
332 TelSimSpPlmn *list; /**< service provider plmns list */
336 * This data structure defines the status of sim initialization
339 TelSimCardStatus status; /**< Sim card status */
340 TelSimCardChangeStatus change_status; /**< Sim card change status */
341 } TelSimCardStatusInfo;
344 * This data structure defines the data for the Imsi information.
347 char mcc[TEL_SIM_MCC_MNC_LEN_MAX + 1]; /**< mobile country code 3 digits*/
348 char mnc[TEL_SIM_MCC_MNC_LEN_MAX + 1]; /**< mobile network code 2 or 3 digits*/
349 char msin[TEL_SIM_MSIN_LEN_MAX + 1]; /**< Mobile Station Identification Number */
353 * This data structure defines the data for the SIM ECC information.
356 char number[TEL_SIM_ECC_NUMBER_LEN_MAX + 1]; /**< Emergency Call Code. null termination used*/
357 char name[TEL_SIM_ECC_TEXT_MAX + 1]; /**< Alpha identifier */
358 TelSimEccEmergencyServiceInfo category; /**< ECC emergency service information */
362 * This data structure defines the data for the SIM ECC lists.
365 unsigned int count; /**< Total count for ECC list */
366 TelSimEcc list[TEL_SIM_ECC_LIST_MAX]; /**< List of emergency numbers */
371 char ext[TEL_SIM_EXT_RECORD_CNT_MAX + 1];
372 unsigned short next_record;
376 unsigned char plmn[6+1];
377 unsigned short lac_from;
378 unsigned short lac_to;
379 unsigned char rec_identifier;
384 TelSimOpl list[TEL_SIM_OPL_PNN_RECORD_CNT_MAX];
388 unsigned char full_name[TEL_SIM_NW_FULL_NAME_LEN_MAX + 1];
389 unsigned char short_name[TEL_SIM_NW_FULL_NAME_LEN_MAX + 1];
394 TelSimPnn list[TEL_SIM_OPL_PNN_RECORD_CNT_MAX];
398 unsigned char profile_id; /**< Profile Identity of the subscriber profile*/
399 TelSimMailboxType mb_type; /**< Mailbox type */
400 unsigned int alpha_id_len; /**< Mailbox Alpha Identifier length */
401 char alpha_id[TEL_SIM_ALPHA_ID_LEN_MAX]; /**< Mailbox Alpha Identifier */
402 char number[TEL_SIM_MBDN_NUM_LEN_MAX]; /**< Dialing Number/SSC String */
403 } TelSimMailBoxNumber;
406 * This data structure defines the data for the Mailbox lists.
409 unsigned int alpha_id_max_len; /**< Alpha id max length in SIM */
410 unsigned int count; /**< Number of mailbox count*/
411 TelSimMailBoxNumber list[TEL_SIM_MSP_CNT_MAX * TEL_SIM_MAILBOX_TYPE_MAX]; /**< Mailbox list info */
415 * This data structure defines the data for the Call Forwarding.
418 unsigned char profile_id; /**< Profile Identity of the subscriber profile*/
419 gboolean indication[TEL_SIM_CALL_FORWARDING_TYPE_MAX]; /**< 0: voice , 1 : fax, 2 : email, 3:other, 4 :video */
423 * This data structure defines the data for the Call Forwarding lists.
426 unsigned int profile_count; /**< Call forwarding list count in SIM */
427 TelSimCfis cf[TEL_SIM_MSP_CNT_MAX]; /**< Call forwarding list info in SIM */
431 * This data structure defines indication status for the Message Waiting.
434 gboolean indication; /**< indication status for the Message Waiting */
435 unsigned char count; /**< indication count for the Message Waiting */
436 } TelSimMsgWaitingIndicator;
439 * This data structure defines the data for the Message Waiting.
442 unsigned char profile_id; /**< Profile Identity of the subscriber profile */
443 gboolean count_valid; /**< whether count is valid or not (in case of cphs, count is not valid) */
444 TelSimMsgWaitingIndicator msg_waiting[TEL_SIM_MAILBOX_TYPE_MAX]; /**< 0: voice , 1 : fax, 2 : email, 3:other, 4 :video */
448 * This data structure defines the data for the Message Waiting lists.
451 unsigned int profile_count; /**< Message waiting list count in SIM */
452 TelSimMwis mw[TEL_SIM_MSP_CNT_MAX]; /**< Message waiting list info in SIM */
456 * This data structure defines the data for the MSISDN.
459 char *alpha_id; /**< MSISDN Alpha Identifier. If not exist, Null string will be returned */
460 char *num; /**< MSISDN number. If not exist, Null string will be returned*/
461 } TelSimSubscriberInfo;
464 * This data structure defines the data for the MSISDN lists.
467 unsigned int count; /**< MSISDN list count in SIM */
468 TelSimSubscriberInfo *list; /**< MSISDN list info in SIM */
472 * This data structure defines the data for the SPN.
475 TelSimSpnDispCondition display_condition; /**< display condition */
476 char spn[TEL_SIM_SPN_LEN_MAX + 1]; /**< SPN */
480 * This data structure defines the data for the CPHS Network Name.
483 char *full_name; /**< Short Network Operator Name */
484 char *short_name; /**< Long Network Operator Name */
491 TelSimLanguagePreferenceCode language;
492 char iccid[TEL_SIM_ICCID_LEN_MAX + 1];
493 TelSimMailboxList mb;
496 TelSimMsisdnList msisdn_list;
500 TelSimSpPlmnList spdi;
501 TelSimCphsNetName cphs_net;
506 /* '00' - no mailbox dialing number associated with message waiting indication group type.
507 'xx' - record number in EFMBDN associated with message waiting indication group type.
509 int voice_index; /**< voice mailbox identifier*/
510 int fax_index; /**< FAX mailbox identifier*/
511 int email_index; /**< email mailbox identifier*/
512 int other_index; /**< other mailbox identifier*/
513 int video_index; /**< video mailbox identifier*/
517 *This is used for authentication request procedure.
520 TelSimAuthenticationType auth_type; /**< Authentication type */
521 unsigned int rand_length; /**< the length of RAND */
522 unsigned int autn_length; /**< the length of AUTN. it is not used in case of GSM AUTH */
523 char rand_data[TEL_SIM_AUTH_MAX_REQ_DATA_LEN]; /**< RAND data */
524 char autn_data[TEL_SIM_AUTH_MAX_REQ_DATA_LEN]; /**< AUTN data. it is not used in case of GSM AUTH */
525 } TelSimAuthenticationData;
528 * @enum TelSimAuthenticationResult
529 * This is used to get detailed result for Authentication Procedure.
532 TEL_SIM_AUTH_NO_ERROR = 0x00, /**< ISIM no error */
533 TEL_SIM_AUTH_CANNOT_PERFORM, /**< status - can't perform authentication */
534 TEL_SIM_AUTH_SKIP_RESPONSE, /**< status - skip authentication response */
535 TEL_SIM_AUTH_MAK_CODE_FAILURE, /**< status - MAK(Multiple Activation Key) code failure */
536 TEL_SIM_AUTH_SQN_FAILURE, /**< status - SQN(SeQuenceNumber) failure */
537 TEL_SIM_AUTH_SYNCH_FAILURE, /**< status - synch failure */
538 TEL_SIM_AUTH_UNSUPPORTED_CONTEXT, /**< status - unsupported context */
539 TEL_SIM_AUTH_UNSPECIFIED /**< Unspecified error */
540 } TelSimAuthenticationResult;
543 * This is used for result data of authentication.
546 TelSimAuthenticationType auth_type; /**< authentication type */
547 TelSimAuthenticationResult detailed_result; /**<Detailed result for authentication procedure*/
548 unsigned int resp_length; /**< response length. IMS and 3G case, it stands for RES_AUTS. GSM case, it stands for SRES. */
549 char resp_data[TEL_SIM_AUTH_MAX_RESP_DATA_LEN]; /**< response data. IMS and 3G case, it stands for RES_AUTS. GSM case, it stands for SRES. */
550 unsigned int authentication_key_length; /**< the length of authentication key, Kc*/
551 char authentication_key[TEL_SIM_AUTH_MAX_RESP_DATA_LEN]; /**< the data of of authentication key, Kc*/
552 unsigned int cipher_length; /**< the length of cipher key length */
553 char cipher_data[TEL_SIM_AUTH_MAX_RESP_DATA_LEN]; /**< cipher key */
554 unsigned int integrity_length; /**< the length of integrity key length */
555 char integrity_data[TEL_SIM_AUTH_MAX_RESP_DATA_LEN]; /**< integrity key */
556 } TelSimAuthenticationResponse;
559 * @enum TelSimPowerState
560 * This enumeration defines the power state of SIM.
563 TEL_SIM_POWER_OFF = 0x00, /**< OFF */
564 TEL_SIM_POWER_ON = 0x01, /**< ON */
565 TEL_SIM_POWER_UNSPECIFIED = 0xFF /**< Unspecified */
569 * This is used to verify PIN code.
572 TelSimPinType pin_type; /**< Specifies the PIN type */
573 char *pw; /**< Pin password*/
577 * This is used to verify PUK code.
580 TelSimPukType puk_type; /**< Specifies the PUK type */
581 char *puk_pw; /**< Puk password */
582 char *new_pin_pw; /**< New corresponding pin password */
586 * This is used to change PIN code .
589 TelSimPinType pin_type; /**< Specifies the PIN type */
590 char *old_pw; /**< Current password */
591 char *new_pw; /**< New pin password */
592 } TelSimSecChangePinPw;
595 * This is used to PIN code verification.
598 TelSimPinType pin_type; /**< Specifies the PIN type */
599 unsigned int retry_count; /**< Number of attempts remaining for PIN verification */
600 } TelSimSecPinResult;
603 * This is used to PUK code verification.
606 TelSimPukType puk_type; /**< Specifies the PUK type */
607 unsigned int retry_count; /**< Number of attempts remaining for PUK verification */
608 } TelSimSecPukResult;
611 * This structure is used to enable/disable facility
614 TelSimLockType lock_type; /**< Facility type */
615 char *pw; /**< password */
619 * This structure is used to PIN/PUK verification
622 TelSimLockType type; /**< Specifies the PIN or PUK type.*/
623 unsigned int retry_count; /**< Number of attempts remaining for PIN/PUK verification.*/
624 } TelSimFacilityResult;
627 * This structure is used to enable/disable facility
630 TelSimLockType type; /**< Security lock type */
631 TelSimFacilityStatus f_status; /**< Lock status (enable/disable) */
636 * This structure is used to get information about LOCK_TYPE
639 TelSimLockType lock_type; /**< Lock type */
640 TelSimLockStatus lock_status; /**< Lock key */
641 unsigned int retry_count; /**< retry counts */
645 * This data structure defines the data for the apdu command.
648 unsigned int apdu_len; /**< SIM APDU length */
649 unsigned char apdu[TEL_SIM_APDU_LEN_MAX]; /**< SIM APDU data */
653 * This data structure defines the data for the Response of sending apdu.
656 unsigned int apdu_resp_len; /**< Response apdu data length */
657 unsigned char apdu_resp[TEL_SIM_APDU_RESP_LEN_MAX]; /**< Response apdu data */
661 * This data structure defines the data for the Response of ATR request.
664 unsigned int atr_len; /**< SIM ATR data length */
665 unsigned char atr[TEL_SIM_ATR_LEN_MAX]; /**< SIM ATR data */
669 * \defgroup TAPI_EVENT TAPI Event IDs
674 * \defgroup TEL_EVENT_SIM SIM Event IDs
681 * @section subscription Event Subscription
682 * @details Event can be subscribed with event id TEL_NOTI_SIM_STATUS
683 * @sa tapi_register_event_id
684 * @section handling Event Handling
685 * @details TAPI will invoke the registered callback (\ref TapiEvtCb) and return the following data:
686 * @retval handle #TelHandle used for registering the event
687 * @retval evt_id TEL_NOTI_SIM_STATUS
688 * @retval data \ref TelSimCardStatus
689 * @retval user_data user data passed while registering the event
691 #define TEL_NOTI_SIM_STATUS TELEPHONY_SIM_INTERFACE":card_status"
703 #endif /* __TEL_SIM_H__ */