4 * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Ja-young Gu <jygu@samsung.com>
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
12 * http://www.apache.org/licenses/LICENSE-2.0
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.
23 * @ingroup TelephonyAPI
24 * @addtogroup SIM_TAPI SIM
29 @brief This file serves as a "C" header file defines functions for Tapi SIM Services.\n
30 It contains a sample set of function prototypes that would be required by applications.
37 #include <tapi_common.h>
40 #include <TelDefines.h>
48 * @brief This API is used to get SIM Card Initialization status and SIM Card Identification.
49 * Most of modules which require SIM data should check SIM status before using it definitely.
51 * @par Sync (or) Async:
52 * This is a Synchronous API.
54 * @par Important Notes:
55 * - Card Identification value is available in TAPI_SIM_STATUS_SIM_INIT_COMPLETED case only.
61 * - handle from tel_init().
63 * @param [out] sim_status
64 * - This parameter returns SIM initialization status from Telephony server boot up time.
65 * First, You can find sim existance if returned value are not in TAPI_SIM_STATUS_CARD_NOT_PRESENT and TAPI_SIM_STATUS_CARD_REMOVED.
67 * @param [out] card_changed
68 * - This parameter returns sim card identification value when sim_status is TAPI_SIM_STATUS_SIM_INIT_COMPLETED.
69 * - card_changed value just present whether current inserted SIM card differs with previous SIM or not.
71 * @par Async Response Message:
80 * @return Return Type (int)
81 * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n
82 * - Negative integer : it provides an error code (Refer #TapiResult_t)
84 * @par Prospective Clients:
90 * #include <ITapiSim.h>
92 * int err_code = TAPI_API_SUCCESS;
93 * TelSimCardStatus_t status = 0x00;
94 * int b_card_changed = 0;
96 * // GET SIM INIT INFORMATION
97 * err_code = tel_get_sim_init_info(&status, &b_card_changed);
104 /*================================================================================================*/
105 int tel_get_sim_init_info(TapiHandle *handle, TelSimCardStatus_t *sim_status, int *card_changed);
108 * @brief This function is a synchronous API which gets the Card Type whether Card is a SIM or a USIM.
110 * @par Sync (or) Async:
111 * This is a synchronous function.
113 * @par Important Notes:
120 * - handle from tel_init().
122 * @param [out] card_type
123 * This parameter returns the SIM card type information like whether it is GSM SIM card or USIM or it is of unknown type.
125 * - TAPI_SIM_CARD_TYPE_UNKNOWN
126 * - TAPI_SIM_CARD_TYPE_GSM
127 * - TAPI_SIM_CARD_TYPE_USIM
129 * @par Async Response Message:
138 * @return Return Type (int) \n
139 * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n
140 * - Negative integer : it provides an error code (Refer #TapiResult_t)
142 * @par Prospective Clients:
148 * #include <ITapiSim.h>
150 * TelSimCardType_t cardInfo; //unkwon, sim(normally gsm), usim(normally umts)
151 * err_code = tel_get_sim_type(&cardInfo);
158 /*================================================================================================*/
159 int tel_get_sim_type(TapiHandle *handle, TelSimCardType_t *card_type);
162 * @brief This function is a synchronous API gets the IMSI information.
164 * @par Sync (or) Async:
165 * This is a synchronous function.
167 * @par Important Notes:
168 * - IMSI value is the value that security needs.
174 * - handle from tel_init().
177 * This parameter returns the IMSI information. Refer #TelSimImsiInfo_t
179 * @par Async Response Message:
183 * - User can get valid return value or make operations after SIM init complete(card status is TAPI_SIM_STATUS_SIM_INIT_COMPLETED).
189 * @return Return Type (int) \n
190 * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n
191 * - Negative integer : it provides an error code (Refer #TapiResult_t)
193 * @par Prospective Clients:
199 * #include <ITapiSim.h>
201 * TelSimImsiInfo_t sim_imsi_info; // mcc, mnc, msisdn
202 * err_code = tel_get_sim_imsi(&sim_imsi_info);
208 /*================================================================================================*/
209 int tel_get_sim_imsi(TapiHandle *handle, TelSimImsiInfo_t *imsi);
212 * @brief This function is a synchronous API used to get ECC(SIM) or UECC(USIM) data.
214 * @par Sync (or) Async:
215 * This is a synchronous function.
217 * @par Important Notes:
224 * - handle from tel_init().
227 * - This parameter returns
228 * the SIM emergency call code information like ecc length, service type etc
229 * and number of ECC records.
231 * @par Async Response Message:
235 * - User can get valid return value or make operations after SIM init complete(card status is TAPI_SIM_STATUS_SIM_INIT_COMPLETED).
241 * @return Return Type (int) \n
242 * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n
243 * - Negative integer : it provides an error code (Refer #TapiResult_t)
245 * @par Prospective Clients:
251 * #include <ITapiSim.h>
252 * int ecc_rec_count = 0; // count in sim card
254 * TelSimEccData_t ecc_info = {{{0,}}};
255 * err_code = tel_get_sim_ecc(&ecc_info, &ecc_rec_count);
261 /*================================================================================================*/
262 int tel_get_sim_ecc(TapiHandle *handle, TelSimEccList_t *ecc);
265 * @brief This function is a synchronous API gets a Unique identification number of the (U)ICC.
266 * ICC means Integrated Circuit Card.
268 * @par Sync (or) Async:
269 * This is a synchronous function.
271 * @par Important Notes:
272 * - IC Card number value is the value that security needs.
278 * - handle from tel_init().
280 * @param [in] callback
281 * - To register callback function for result.
283 * @param [in] user_data
284 * - user_data for user specification.
286 * @par Async Response Message:
290 * - User can get valid return value or make operations after SIM init complete(card status is TAPI_SIM_STATUS_SIM_INIT_COMPLETED).
296 * @return Return Type (int) \n
297 * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n
298 * - Negative integer : it provides an error code (Refer #TapiResult_t)
300 * @par Prospective Clients:
306 * #include <ITapiSim.h>
308 * TelSimIccIdInfo_t icc_data; // this struct consists of number length and number.
309 * err_code = tel_get_sim_iccid(&icc_data);
315 /*================================================================================================*/
316 int tel_get_sim_iccid(TapiHandle *handle, tapi_response_cb callback, void *user_data);
319 * @brief This API is used to get the language preference(indication) information.
321 * @par Sync (or) Async:
322 * This is a synchronous function.
324 * @par Important Notes:
331 * - handle from tel_init().
333 * @param [in] callback
334 * - To register callback function for result.
336 * @param [in] user_data
337 * - user_data for user specification.
339 * @par Async Response Message:
343 * - User can get valid return value or make operations after SIM init complete(card status is TAPI_SIM_STATUS_SIM_INIT_COMPLETED).
349 * @return Return Type (int) \n
350 * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n
351 * - Negative integer : it provides an error code (Refer #TapiResult_t)
353 * @par Prospective Clients:
359 * #include <ITapiSim.h>
361 * TelSimLanguageInfo_t li_info = {0,};
362 * err_code = tel_get_sim_language(&li_info); // you can find language info with li_info variable
368 /*================================================================================================*/
369 int tel_get_sim_language(TapiHandle *handle, tapi_response_cb callback, void *user_data);
373 * @brief This API is used to update the language preference information to SIM card.
375 * This function makes Dbus method call to Telephony Sever and returns immediate value.
376 * However it just means that the API request has been transfered to the CP successfully.
377 * The actual operation result is being delivered in the corresponding event asynchronously.
379 * @par Sync (or) Async:
380 * This is a Asynchronous function.
382 * @par Important Notes:
383 * - This function update SIM Language information directly and can effect device language setting. Use carefully.
389 * - handle from tel_init().
391 * @param [in] language
392 * This parameter returns the language preference information.
394 * @param [in] callback
395 * - To register callback function for result.
397 * @param [in] user_data
398 * - user_data for user specification.
400 * @par Async Response Message:
401 * The event associated is TAPI_EVENT_SIM_SET_LANGUAGE_CNF.
402 * Asynchronous return status is indicated by #TelSimAccessResult_t.
405 * - A dbus connection is established with #tel_init
406 * - The application name is registered with #tel_register_app_name
407 * - The application is registered events to listen asynchronous response with #tel_register_event
408 * - A event loop is running to listen events
409 * - User can get valid return value or make operations after SIM init complete(card status is TAPI_SIM_STATUS_SIM_INIT_COMPLETED).
415 * @return Return Type (int) \n
416 * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n
417 * - Negative integer : it provides an error code (Refer #TapiResult_t)
419 * @par Prospective Clients:
425 * #include <ITapiSim.h>
427 * int request_id = 0;
428 * TelSimLanguagePreferenceCode_t language = 0x00; //init
429 * language = TAPI_SIM_LP_ENGLISH; //language value
430 * err_code = tel_set_sim_language(language, &request_id);
436 /*================================================================================================*/
437 int tel_set_sim_language(TapiHandle *handle, TelSimLanguagePreferenceCode_t language, tapi_response_cb callback, void *user_data);
440 * @brief This API is used to get the SIM Call forwarding indication related data(EF-CFIS and CPHS case).
441 * this data is required for Call forwarding related functionality in handset.
443 * @par Sync (or) Async:
444 * This is a synchronous function.
446 * @par Important Notes:
453 * - handle from tel_init().
455 * @param [in] callback
456 * - To register callback function for result.
458 * @param [in] user_data
459 * - user_data for user specification.
461 * @par Async Response Message:
465 * - User can get valid return value or make operations after SIM init complete(card status is TAPI_SIM_STATUS_SIM_INIT_COMPLETED).
471 * @return Return Type (int) \n
472 * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n
473 * - Negative integer : it provides an error code (Refer #TapiResult_t)
475 * @par Prospective Clients:
481 * #include <ITapiSim.h>
482 * TelSimCallForwarding_s cf_data;
483 * TapiResult_t err_code = 0;
484 * err_code = tel_get_sim_callforwarding_info(&cf_data);
485 * if(err_code == TAPI_API_SUCCESS) {
486 * if(cf_data.b_cphs) { //b_cphs means current SIM is for CPHS or not.
487 * printf("Current SIM is CPHS");
489 * printf("Current SIM is not CPHS but 3GPP");
492 * printf("TAPI API FAIL: Error Code [0x%x]",err_code);
499 /*================================================================================================*/
500 int tel_get_sim_callforwarding_info(TapiHandle *handle, tapi_response_cb callback, void *user_data);
502 int tel_set_sim_callforwarding_info(TapiHandle *handle, TelSimCallForwardingReq_t *req_cf, tapi_response_cb callback, void *user_data);
505 * @brief This API is used to get the SIM message waiting indication related data(EF-MWIS and CPHS case).
506 * this data is required for Message waiting related functionality in handset.
508 * @par Sync (or) Async:
509 * This is a synchronous function.
511 * @par Important Notes:
518 * - handle from tel_init().
520 * @param [in] callback
521 * - To register callback function for result.
523 * @param [in] user_data
524 * - user_data for user specification.
526 * @par Async Response Message:
530 * - User can get valid return value or make operations after SIM init complete(card status is TAPI_SIM_STATUS_SIM_INIT_COMPLETED).
536 * @return Return Type (int) \n
537 * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n
538 * - Negative integer : it provides an error code (Refer #TapiResult_t)
540 * @par Prospective Clients:
546 * #include <ITapiSim.h>
547 * TelSimMessageWaiting_s mw_data;
548 * TapiResult_t err_code = 0;
549 * err_code = tel_get_sim_messagewaiting_info(&mw_data);
550 * if(err_code == TAPI_API_SUCCESS) {
551 * if(mw_data.b_cphs) { //b_cphs means current SIM is for CPHS or not.
552 * printf("Current SIM is CPHS");
554 * printf("Current SIM is not CPHS but 3GPP");
557 * printf("TAPI API FAIL: Error Code [0x%x]",err_code);
564 /*================================================================================================*/
565 int tel_get_sim_messagewaiting_info(TapiHandle *handle, tapi_response_cb callback, void *user_data);
567 int tel_set_sim_messagewaiting_info(TapiHandle *handle, TelSimMessageWaitingReq_t *req_mw, tapi_response_cb callback, void *user_data);
570 * @brief This API is used to get the SIM mailbox related data(EF-MBDN, MBDI and CPHS case).
571 * this data is required for Mailbox related functionality in handset.
573 * @par Sync (or) Async:
574 * This is a synchronous function.
576 * @par Important Notes:
583 * - handle from tel_init().
585 * @param [in] callback
586 * - To register callback function for result.
588 * @param [in] user_data
589 * - user_data for user specification.
591 * @par Async Response Message:
595 * - User can get valid return value or make operations after SIM init complete(card status is TAPI_SIM_STATUS_SIM_INIT_COMPLETED).
601 * @return Return Type (int) \n
602 * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n
603 * - Negative integer : it provides an error code (Refer #TapiResult_t)
605 * @par Prospective Clients:
611 * #include <ITapiSim.h>
612 * TelSimMailboxNumbers_s mbox;
613 * TapiResult_t err_code = 0;
614 * err_code = tel_get_sim_mailbox_info(&mbox);
615 * if(err_code == TAPI_API_SUCCESS) {
616 * if(mbox.b_cphs) { //b_cphs means current SIM is for CPHS or not.
617 * printf("Current SIM is CPHS");
619 * printf("Current SIM is not CPHS but 3GPP");
622 * printf("TAPI API FAIL: Error Code [0x%x]",err_code);
629 /*================================================================================================*/
630 int tel_get_sim_mailbox_info(TapiHandle *handle, tapi_response_cb callback, void *user_data);
632 int tel_set_sim_mailbox_info(TapiHandle *handle, TelSimMailBoxNumber_t *req_mb, tapi_response_cb callback, void *user_data);
635 * @brief This API is used to get the SIM CPHS specific data.
636 * this data is required for CPHS related functionality in handset.
638 * @par Sync (or) Async:
639 * This is an Synchronous API.
641 * @par Important Notes:
648 * - handle from tel_init().
650 * @param [in] callback
651 * - To register callback function for result.
653 * @param [in] user_data
654 * - user_data for user specification.
656 * @par Async Response Message:
660 * - User can get valid return value or make operations after SIM init complete(card status is TAPI_SIM_STATUS_SIM_INIT_COMPLETED).
665 * @return Return Type (int) \n
666 * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n
667 * - Negative integer : it provides an error code (Refer #TapiResult_t)
669 * @par Prospective Clients:
675 * #include <ITapiSim.h>
676 * TelSimCphsLocalInfo_t cphs_data;
677 * TapiResult_t err_code = 0;
678 * err_code = tel_get_sim_cphs_info(&cphs_data);
679 * if(err_code == TAPI_API_SUCCESS) {
680 * if(cphs_data.b_used) { //b_used means current SIM is for CPHS or not.
681 * printf("Current SIM is CPHS");
683 * printf("Current SIM is not CPHS but 3GPP");
686 * printf("TAPI API FAIL: Error Code [0x%x]",err_code);
693 /*================================================================================================*/
694 int tel_get_sim_cphs_info(TapiHandle *handle, tapi_response_cb callback, void *user_data);
697 * @brief This API is used to get the SIM MSISDN data. Regarding 3GPP specification, Current value is optional.
699 * @par Sync (or) Async:
700 * This is an Synchronous API.
702 * @par Important Notes:
709 * - handle from tel_init().
711 * @param [in] callback
712 * - To register callback function for result.
714 * @param [in] user_data
715 * - user_data for user specification.
717 * @par Async Response Message:
721 * - User can get valid return value or make operations after SIM init complete(card status is TAPI_SIM_STATUS_SIM_INIT_COMPLETED).
726 * @return Return Type (int) \n
727 * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n
728 * - Negative integer : it provides an error code (Refer #TapiResult_t)
730 * @par Prospective Clients:
736 * #include <ITapiSim.h>
737 * TelSimSubscriberInfo_t msisdn;
738 * TapiResult_t err_code = 0;
739 * err_code = tel_get_sim_msisdn(&msisdn);
740 * if(err_code == TAPI_API_SUCCESS)
742 * printf(" ============================================");
743 * printf("name[%s]",msisdn.name);
744 * printf("num[%s]",msisdn.num);
745 * if(msisdn.name == '\0';) //If current SIM does not have, Null string will be returned.
746 * printf("name is null string");
748 * if(msisdn.num == '\0';) //If current SIM does not have, Null string will be returned.
749 * printf("number is null string");
753 * printf("TAPI API FAIL: Error Code [0x%x]",err_code);
761 /*================================================================================================*/
762 int tel_get_sim_msisdn(TapiHandle *handle, tapi_response_cb callback, void *user_data);
765 * @brief This API is used to get the SIM OPLMNWACT(Operator controlled PLMN Selector with Access Technology) data. Regarding 3GPP specification, Current value is optional.
767 * @par Sync (or) Async:
768 * This is an Synchronous API.
770 * @par Important Notes:
777 * - handle from tel_init().
779 * @param [in] callback
780 * - To register callback function for result.
782 * @param [in] user_data
783 * - user_data for user specification.
785 * @par Async Response Message:
789 * - User can get valid return value or make operations after SIM init complete(card status is TAPI_SIM_STATUS_SIM_INIT_COMPLETED).
794 * @return Return Type (int) \n
795 * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n
796 * - Negative integer : it provides an error code (Refer #TapiResult_t)
798 * @par Prospective Clients:
810 /*================================================================================================*/
811 int tel_get_sim_oplmnwact(TapiHandle *handle, tapi_response_cb callback, void *user_data);
814 * @brief This API is used to get the SIM SPN data. Regarding 3GPP specification, Current value is optional.
816 * @par Sync (or) Async:
817 * This is an Synchronous API.
819 * @par Important Notes:
826 * - handle from tel_init().
828 * @param [in] callback
829 * - To register callback function for result.
831 * @param [in] user_data
832 * - user_data for user specification.
834 * @par Async Response Message:
838 * - User can get valid return value or make operations after SIM init complete(card status is TAPI_SIM_STATUS_SIM_INIT_COMPLETED).
843 * @return Return Type (int) \n
844 * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n
845 * - Negative integer : it provides an error code (Refer #TapiResult_t)
847 * @par Prospective Clients:
859 /*================================================================================================*/
860 int tel_get_sim_spn(TapiHandle *handle, tapi_response_cb callback, void *user_data);
863 * @brief This API is used to get the SIM CPHS NETNAME data.
865 * @par Sync (or) Async:
866 * This is an Synchronous API.
868 * @par Important Notes:
875 * - handle from tel_init().
877 * @param [in] callback
878 * - To register callback function for result.
880 * @param [in] user_data
881 * - user_data for user specification.
883 * @par Async Response Message:
887 * - User can get valid return value or make operations after SIM init complete(card status is TAPI_SIM_STATUS_SIM_INIT_COMPLETED).
892 * @return Return Type (int) \n
893 * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n
894 * - Negative integer : it provides an error code (Refer #TapiResult_t)
896 * @par Prospective Clients:
908 /*================================================================================================*/
909 int tel_get_sim_cphs_netname(TapiHandle *handle, tapi_response_cb callback, void *user_data);
912 * @brief This API is used to execute the authentication procedure by using SIM.
914 * This function makes Dbus method call to Telephony Sever and returns immediate value.
915 * However it just means that the API request has been transfered to the CP successfully.
916 * The actual operation result is being delivered in the corresponding event asynchronously.
917 * This function supports IMS, 3G and GSM authentication.
919 * @par Sync (or) Async:
920 * This is an Asynchronous API.
922 * @par Important Notes:
929 * - handle from tel_init().
931 * @param[in] authentication_data
932 * - This input has the authentication code to be validated by ISIM,3G and GSM application in the SIM card. #TelSimAuthenticationData_t
934 * @param [in] callback
935 * - To register callback function for result.
937 * @param [in] user_data
938 * - user_data for user specification.
940 * @par Async Response Message:
941 * -The event associated is TAPI_SIM_EVENT_AUTHENTICATION_CNF and the event data is #TelSimAuthenticationResponse_t.
942 * Asynchronous return status is indicated by #TelSimAccessResult_t.
945 * - A dbus connection is established with #tel_init
946 * - The application name is registered with #tel_register_app_name
947 * - The application is registered events to listen asynchronous response with #tel_register_event
948 * - A event loop is running to listen events
953 * @return Return Type (int) \n
954 * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n
955 * - Negative integer : it provides an error code (Refer #TapiResult_t)
957 * @par Prospective Clients:
963 * #include <ITapiSim.h>
965 * int request_id = 0;
966 * TelSimAuthenticationData_t pAuthenticationData;
967 * strcpy((char*)pAuthenticationData.rand_data, "username@operator.com"); //access data
968 * pAuthenticationData.rand_length= strlen("username@operator.com");
969 * strcpy((char*)pAuthenticationData.autn_data, "+1-212-555-12345"); // auth data
970 * pAuthenticationData.autn_length = strlen("+1-212-555-12345");
971 * err_code = tel_req_sim_authentication(&pAuthenticationData,&request_id);
977 /*================================================================================================*/
978 int tel_req_sim_authentication(TapiHandle *handle, TelSimAuthenticationData_t *authentication_data, tapi_response_cb callback, void *user_data);
983 * @brief This function performs PIN1/PIN2/SIM LOCK verification. This function performs PIN verification based on the pin type passed along with pin data.
984 * PIN1 code : The SIM card has its own password is to check access permissions
985 * SIM Lock code : Between Device and the SIM card using a SIM password is only available on certain handsets to be used to authorize.
987 * This function makes Dbus method call to Telephony Sever and returns immediate value.
988 * However it just means that the API request has been transfered to the CP successfully.
989 * The actual operation result is being delivered in the corresponding event asynchronously.
991 * @par Sync (or) Async:
992 * This is an Asynchronous API.
994 * @par Important Notes:
995 * - Based on Pin status (PIN/PUK/SIM LOCK) is blocked, an unsolicited event TAPI_EVENT_SIM_STATUS_IND is published to Applications on Device boot time.
996 * - if pin status is PUK, you should use #tel_verify_sim_puks instead of this API.
1001 * @param [in] handle
1002 * - handle from tel_init().
1004 * @param[in] pin_data
1005 * -PIN code, entered by the user. you should make all parameters.
1007 * @param [in] callback
1008 * - To register callback function for result.
1010 * @param [in] user_data
1011 * - user_data for user specification.
1013 * @par Async Response Message:
1014 * The event associated is TAPI_EVENT_SIM_VERIFY_SEC_CNF and the event data is #TelSimSecResult_t.
1015 * Asynchronous return status is indicated by #TelSimPinOperationResult_t.
1016 * If returned status is TAPI_SIM_PIN_OPERATION_SUCCESS, Verification successes.
1017 * If returned status is TAPI_SIM_PIN_INCORRECT_PASSWORD, Verification fails and you can check retry count by using event data #TelSimSecResult_t.
1020 * - Initialize Dbus connection with #tel_init
1021 * - Register caller's application name with #tel_register_app_name
1022 * - Register telephony events to listen
1023 * - A event loop is running to listen events
1024 * - This API is used when #TelSimCardStatus_t is TAPI_SIM_STATUS_SIM_PIN_REQUIRED or TAPI_SIM_STATUS_SIM_LOCK_REQUIRED on boot time.
1025 * - Currently there`s no proper scenario for PIN2 verification by using this API.
1030 * @return Return Type (int) \n
1031 * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n
1032 * - Negative integer : it provides an error code (Refer #TapiResult_t)
1034 * @par Prospective Clients:
1040 * #include <ITapiSim.h>
1042 * int request_id = 0;
1043 * err_code = TAPI_API_SUCCESS; // 0
1044 * int length = TAPI_SIM_PIN_LENGTH+1;
1045 * char init_pin_val[length] ;
1047 * strcpy(init_pin_val, PIN1_NORMAL);
1049 * TelSimSecPw_t pin_data = {0,};
1051 * pin_data.type = TAPI_SIM_PTYPE_PIN1;
1052 * pin_data.pw_len = strlen(init_pin_val);
1054 * printf("pw_len[%d]", pin_data.pw_len);
1056 * pin_data.pw = (char*)malloc(length);
1057 * memcpy(pin_data.pw,init_pin_val,length);
1059 * err_code = tel_verifiy_sim_pins(&pin_data, &request_id);
1066 /*================================================================================================*/
1067 int tel_verifiy_sim_pins(TapiHandle *handle, const TelSimSecPw_t *pin_data, tapi_response_cb callback, void *user_data);
1071 * @brief This function performs unblock PIN1/PIN2 operation based on PUK information passed along with
1072 * unblock information entered by the user.
1073 * If you get sim card status(TAPI_SIM_STATUS_SIM_PUK_REQUIRED) by using #tel_get_sim_init_info on boot time
1074 * or (TAPI_SIM_PIN_STATUS_BLOCKED) by using #tel_get_sim_security_status after normal initialization for specific operation,
1075 * you may unblock PIN1/PIN2.
1077 * This function makes Dbus method call to Telephony Sever and returns immediate value.
1078 * However it just means that the API request has been transfered to the CP successfully.
1079 * The actual operation result is being delivered in the corresponding event asynchronously.
1081 * @par Sync (or) Async:
1082 * This is an Asynchronous API.
1084 * @par Important Notes:
1085 * - Based on Pin status (PIN1/PIN2) is blocked, an unsolicited event TAPI_EVENT_SIM_STATUS_IND
1086 * is published to Applications on boot time also.
1089 * - If you fail to unblock PIN til given retry count, Your SIM card be permanent block status.
1091 * @param [in] handle
1092 * - handle from tel_init().
1094 * @param[in] puk_data
1095 * -Specifies unblocking PIN password #TelSimSecPw_t
1097 * @param[in] new_pin_data
1098 * -Specifies PIN password which you want to use after unblocking operation #TelSimSecPw_t
1100 * @param [in] callback
1101 * - To register callback function for result.
1103 * @param [in] user_data
1104 * - user_data for user specification.
1106 * @par Async Response Message:
1107 * The event associated is TAPI_EVENT_SIM_VERIFY_PUK_CNF and the event data is #TelSimSecResult_t.
1108 * Asynchronous return status is indicated by #TelSimPinOperationResult_t.
1109 * If returned status is TAPI_SIM_PIN_OPERATION_SUCCESS, Verification successes.
1110 * If returned status is TAPI_SIM_PUK_INCORRECT_PASSWORD, Verification fails and you can check retry count by using event data #TelSimSecResult_t.
1113 * - Initialize Dbus connection with #tel_init
1114 * - Register caller's application name with #tel_register_app_name
1115 * - Register telephony events to listen
1116 * - A event loop is running to listen events
1117 * - PIN1 or PIN2 status should be TAPI_SIM_PIN_STATUS_BLOCKED and Card status should be TAPI_SIM_STATUS_SIM_PUK_REQUIRED on boot time.
1120 * - After Success on unblocking for PIN1 or PIN2, each pin check facility is enabled even if previous facility is disabled.
1122 * @return Return Type (int) \n
1123 * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n
1124 * - Negative integer : it provides an error code (Refer #TapiResult_t)
1126 * @par Prospective Clients:
1132 * #include <ITapiSim.h>
1134 * int request_id = 0;
1135 * err_code = TAPI_API_SUCCESS; // 0
1136 * int length = TAPI_SIM_PIN_LENGTH+1;
1138 * char init_pin_val[length];
1139 * char init_puk_val[length];
1141 * strcpy(init_pin_val, PIN1_NORMAL);
1142 * strcpy(init_puk_val, PUK1_NORMAL);
1144 * TelSimSecPw_t puk_data = {0,};
1145 * TelSimSecPw_t new_pin_data = {0,};
1147 * puk_data.type = TAPI_SIM_PTYPE_PUK1; // 0x00
1148 * puk_data.pw_len = length;
1149 * puk_data.pw_len = strlen(init_puk_val);
1150 * printf("pw_len[%d]", puk_data.pw_len);
1151 * memcpy(puk_data.pw,init_pin_val,length);
1153 * new_pin_data.type = TAPI_SIM_PTYPE_PIN1; // 0x00
1154 * new_pin_data.pw_len = strlen(init_pin_val);
1155 * printf("pw_len[%d]", new_pin_data.pw_len);
1156 * new_pin_data.pw = (char*)malloc(length);
1157 * memcpy(new_pin_data.pw,init_pin_val,length);
1159 * err_code = tel_verify_sim_puks(&puk_data, &new_pin_data, &request_id);
1166 /*================================================================================================*/
1167 int tel_verify_sim_puks(TapiHandle *handle, const TelSimSecPw_t *puk_data, const TelSimSecPw_t *new_pin_data, tapi_response_cb callback, void *user_data);
1171 * @brief This function changes PIN1/PIN2 code based on the pin type passed along with old pin data and new pin data.
1173 * This function makes Dbus method call to Telephony Sever and returns immediate value.
1174 * However it just means that the API request has been transfered to the CP successfully.
1175 * The actual operation result is being delivered in the corresponding event asynchronously.
1177 * @par Sync (or) Async:
1178 * This is an Asynchronous API.
1180 * @par Important Notes:
1181 * - User should fill up pin type equally both old_pin and new_pin.
1186 * @param [in] handle
1187 * - handle from tel_init().
1189 * @param[in] old_pin
1190 * -Old pin code, entered by the user. #TelSimSecPw_t
1192 * @param[in] new_pin
1193 * -New pin code, entered by the user. #TelSimSecPw_t
1195 * @param [in] callback
1196 * - To register callback function for result.
1198 * @param [in] user_data
1199 * - user_data for user specification.
1201 * @par Async Response Message:
1202 * The event associated is TAPI_EVENT_SIM_CHANGE_PINS_CNF and the event data is #TelSimSecResult_t.
1203 * Asynchronous return status is indicated by #TelSimPinOperationResult_t.
1204 * If returned status is TAPI_SIM_PIN_OPERATION_SUCCESS, Change operation finish successfully.
1205 * If returned status is TAPI_SIM_PIN_INCORRECT_PASSWORD, Change operation fails and you can check retry count by using event data #TelSimSecResult_t.
1208 * - Initialize Dbus connection with #tel_init
1209 * - Register caller's application name with #tel_register_app_name
1210 * - Register telephony events to listen
1211 * - A event loop is running to listen events
1212 * - User can get valid return value or make operations after SIM init complete(card status is TAPI_SIM_STATUS_SIM_INIT_COMPLETED).
1213 * - PIN which user want to change check facility should be enabled.
1218 * @return Return Type (int) \n
1219 * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n
1220 * - Negative integer : it provides an error code (Refer #TapiResult_t)
1222 * @par Prospective Clients:
1228 * #include <ITapiSim.h>
1230 * int request_id = 0;
1231 * err_code = TAPI_API_SUCCESS; // 0
1232 * int length = TAPI_SIM_PIN_LENGTH+1;
1233 * char init_old_pin_val[length] ;
1234 * char init_new_pin_val[length];
1236 * memset(&init_old_pin_val, 0 , length);
1237 * memset(&init_new_pin_val, 0 , length);
1239 * TelSimSecPw_t old_pin = {0,};
1240 * TelSimSecPw_t new_pin = {0,};
1242 * strcpy(init_old_pin_val, PIN1_ORG);
1244 * old_pin.type = TAPI_SIM_PTYPE_PIN1;
1245 * old_pin.pw_len = strlen(init_old_pin_val);
1246 * printf("pw_len[%d]", old_pin.pw_len);
1247 * old_pin.pw = (char*)malloc(length);
1248 * memcpy(old_pin.pw,init_old_pin_val,length);
1250 * strcpy(init_new_pin_val, PIN1_NEW);
1252 * new_pin.type = TAPI_SIM_PTYPE_PIN1;
1253 * new_pin.pw_len = strlen(init_new_pin_val);
1254 * printf("pw_len[%d]", new_pin.pw_len);
1255 * new_pin.pw = (char*)malloc(length);
1256 * memcpy(new_pin.pw,init_new_pin_val,length);
1258 * err_code = tel_change_sim_pins(&old_pin, &new_pin, &request_id);
1265 /*================================================================================================*/
1266 int tel_change_sim_pins(TapiHandle *handle, const TelSimSecPw_t *old_pin, const TelSimSecPw_t *new_pin, tapi_response_cb callback, void *user_data);
1269 * @brief This API is used to disable the SIM facility.
1271 * @par Sync (or) Async:
1272 * This is an Asynchronous API.
1274 * @par Important Notes:
1280 * @param [in] handle
1281 * - handle from tel_init().
1284 * - a structure which contains facility type and password.
1286 * @param [in] callback
1287 * - To register callback function for result.
1289 * @param [in] user_data
1290 * - user_data for user specification.
1298 * @return Return Type (int) \n
1299 * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n
1300 * - Negative integer : it provides an error code (Refer #TapiResult_t)
1302 * @par Prospective Clients:
1314 /*================================================================================================*/
1315 int tel_disable_sim_facility(TapiHandle *handle, TelSimFacilityPw_t *pw, tapi_response_cb callback, void *user_data);
1318 * @brief This API is used to enable the SIM facility.
1320 * @par Sync (or) Async:
1321 * This is an Asynchronous API.
1323 * @par Important Notes:
1329 * @param [in] handle
1330 * - handle from tel_init().
1333 * - a structure which contains facility type and password.
1335 * @param [in] callback
1336 * - To register callback function for result.
1338 * @param [in] user_data
1339 * - user_data for user specification.
1347 * @return Return Type (int) \n
1348 * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n
1349 * - Negative integer : it provides an error code (Refer #TapiResult_t)
1351 * @par Prospective Clients:
1363 /*================================================================================================*/
1364 int tel_enable_sim_facility(TapiHandle *handle, TelSimFacilityPw_t *pw, tapi_response_cb callback, void *user_data);
1368 * @brief This API is used to get the SIM facility.
1370 * @par Sync (or) Async:
1371 * This is an Asynchronous API.
1373 * @par Important Notes:
1379 * @param [in] handle
1380 * - handle from tel_init().
1383 * - type of security lock type enum values.
1385 * @param [in] callback
1386 * - To register callback function for result.
1388 * @param [in] user_data
1389 * - user_data for user specification.
1397 * @return Return Type (int) \n
1398 * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n
1399 * - Negative integer : it provides an error code (Refer #TapiResult_t)
1401 * @par Prospective Clients:
1413 /*================================================================================================*/
1414 int tel_get_sim_facility(TapiHandle *handle, TelSimLockType_t type, tapi_response_cb callback, void *user_data);
1417 * @brief This API is used to get the SIM LOCK TYPE info.
1419 * @par Sync (or) Async:
1420 * This is an Asynchronous API.
1422 * @par Important Notes:
1428 * @param [in] handle
1429 * - handle from tel_init().
1432 * - type of security lock type enum values.
1434 * @param [in] callback
1435 * - To register callback function for result.
1437 * @param [in] user_data
1438 * - user_data for user specification.
1446 * @return Return Type (int) \n
1447 * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n
1448 * - Negative integer : it provides an error code (Refer #TapiResult_t)
1450 * @par Prospective Clients:
1462 /*================================================================================================*/
1463 int tel_get_sim_lock_info(TapiHandle *handle, TelSimLockType_t type, tapi_response_cb callback, void *user_data);
1467 * @brief This function provides common interface for accessing SIM data based on USIM generic command in ETSI TS 102 221
1468 * and 3GPP TS 31.102 Characteristics of the Universal Subscriber Identity Module (USIM) application.
1469 * This API provides only interface to send APDU. User should know well APDU usage.
1471 * This function makes Dbus method call to Telephony Sever and returns immediate value.
1472 * However it just means that the API request has been transfered to the CP successfully.
1473 * The actual operation result is being delivered in the corresponding event asynchronously.
1475 * @par Sync (or) Async:
1476 * This is an Asynchronous API.
1478 * @par Important Notes:
1484 * @param [in] handle
1485 * - handle from tel_init().
1487 * @param[in] apdu_data
1489 * @param [in] callback
1490 * - To register callback function for result.
1492 * @param [in] user_data
1493 * - user_data for user specification.
1495 * @par Async Response Message:
1496 * The event associated is TAPI_EVENT_SIM_APDU_CNF and the event data is #TelSimApduResp_t.
1497 * Asynchronous return status is indicated by #TelSimAccessResult_t.
1500 * - A dbus connection is established with #tel_init
1501 * - The application name is registered with #tel_register_app_name
1502 * - The application is registered events to listen asynchronous response with #tel_register_event
1503 * - A event loop is running to listen events
1504 * - User can get valid return value or make operations after SIM init complete(card status is TAPI_SIM_STATUS_SIM_INIT_COMPLETED).
1510 * @return Return Type (int) \n
1511 * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n
1512 * - Negative integer : it provides an error code (Refer #TapiResult_t)
1514 * @par Prospective Clients:
1520 * #include <ITapiSim.h>
1522 * int request_id = 0;
1523 * TelSimApdu_t apdu = {0,};
1524 * int tmp_apdu[5] = {0xa,5,6,7,8};
1525 * apdu.apdu_len = 5; //user should check
1528 * // REQUEST SIM ACCESS
1529 * err_code = tel_req_sim_apdu((const TelSimRSimReq_t*)&rsim, &request_id);
1535 /*================================================================================================*/
1536 int tel_req_sim_apdu(TapiHandle *handle, TelSimApdu_t* apdu_data, tapi_response_cb callback, void *user_data);
1540 * @brief This function provides common interface to get SIM ATR(Answer To Reset) value.
1542 * This function makes Dbus method call to Telephony Sever and returns immediate value.
1543 * However it just means that the API request has been transfered to the CP successfully.
1544 * The actual operation result is being delivered in the corresponding event asynchronously.
1546 * @par Sync (or) Async:
1547 * This is an Asynchronous API.
1549 * @par Important Notes:
1555 * @param [in] handle
1556 * - handle from tel_init().
1558 * @param [in] callback
1559 * - To register callback function for result.
1561 * @param [in] user_data
1562 * - user_data for user specification.
1564 * @par Async Response Message:
1565 * The event associated is TAPI_EVENT_SIM_ATR_CNF and the event data is #TelSimAtrResp_t.
1566 * Asynchronous return status is indicated by #TelSimAccessResult_t.
1569 * - A dbus connection is established with #tel_init
1570 * - The application name is registered with #tel_register_app_name
1571 * - The application is registered events to listen asynchronous response with #tel_register_event
1572 * - A event loop is running to listen events
1573 * - User can get valid return value or make operations after SIM init complete(card status is TAPI_SIM_STATUS_SIM_INIT_COMPLETED).
1579 * @return Return Type (int) \n
1580 * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n
1581 * - Negative integer : it provides an error code (Refer #TapiResult_t)
1583 * @par Prospective Clients:
1589 * #include <ITapiSim.h>
1591 * int request_id = 0;
1593 * // REQUEST SIM ATR
1594 * err_code = tel_req_sim_atr(&request_id);
1600 /*================================================================================================*/
1601 int tel_req_sim_atr(TapiHandle *handle, tapi_response_cb callback, void *user_data);
1607 #endif /* _ITAPI_SIM_H_ */