2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef __CAPI_TELEPHONY_SIM_H__
18 #define __CAPI_TELEPHONY_SIM_H__
20 #include "telephony_common.h"
27 * @file telephony_sim.h
28 * @brief This file contains the SIM APIs and related enumerations.
32 * @addtogroup CAPI_TELEPHONY_INFORMATION_SIM
37 * @brief Enumeration for the state of SIM card.
42 TELEPHONY_SIM_STATE_UNAVAILABLE, /**< SIM is not available on this device */
43 TELEPHONY_SIM_STATE_LOCKED, /**< SIM is locked */
44 TELEPHONY_SIM_STATE_AVAILABLE, /**< SIM is available on this device */
45 TELEPHONY_SIM_STATE_UNKNOWN, /**< SIM is in transition between states */
46 } telephony_sim_state_e;
49 * @brief Gets the Integrated Circuit Card IDentification (ICC-ID).
50 * @details The Integrated Circuit Card Identification number internationally identifies SIM cards.
54 * @privilege %http://tizen.org/privilege/telephony
56 * @remarks You must release @c icc_id using free().
58 * @param[in] handle The handle from telephony_init()
59 * @param[out] icc_id The Integrated Circuit Card Identification
61 * @return @c 0 on success,
62 * otherwise a negative error value
64 * @retval #TELEPHONY_ERROR_NONE Successful
65 * @retval #TELEPHONY_ERROR_INVALID_PARAMETER Out of memory
66 * @retval #TELEPHONY_ERROR_PERMISSION_DENIED Permission denied
67 * @retval #TELEPHONY_ERROR_NOT_SUPPORTED Not supported
68 * @retval #TELEPHONY_ERROR_OPERATION_FAILED Invalid parameter
69 * @retval #TELEPHONY_ERROR_SIM_NOT_AVAILABLE SIM is not available
71 * @pre The SIM state must be #TELEPHONY_SIM_STATE_AVAILABLE.
73 * @see telephony_sim_get_state()
75 int telephony_sim_get_icc_id(telephony_h handle, char **icc_id);
78 * @brief Gets the SIM Operator (MCC [3 digits] + MNC [2~3 digits]).
79 * @details The Operator is embedded in the SIM card.
83 * @privilege %http://tizen.org/privilege/telephony
85 * @remarks You must release @c sim_operator using free().
87 * @param[in] handle The handle from telephony_init()
88 * @param[out] sim_operator The SIM Operator
90 * @return @c 0 on success,
91 * otherwise a negative error value
93 * @retval #TELEPHONY_ERROR_NONE Successful
94 * @retval #TELEPHONY_ERROR_INVALID_PARAMETER Out of memory
95 * @retval #TELEPHONY_ERROR_PERMISSION_DENIED Permission denied
96 * @retval #TELEPHONY_ERROR_NOT_SUPPORTED Not supported
97 * @retval #TELEPHONY_ERROR_OPERATION_FAILED Invalid parameter
98 * @retval #TELEPHONY_ERROR_SIM_NOT_AVAILABLE SIM is not available
100 * @pre The SIM state must be #TELEPHONY_SIM_STATE_AVAILABLE.
102 * @see telephony_sim_get_state()
104 int telephony_sim_get_operator(telephony_h handle, char **sim_operator);
107 * @brief Gets the Mobile Subscription Identification Number (MSIN [9~10 digits]) of the SIM provider.
108 * @details This function gets Mobile Subscription Identification Number embedded in the SIM card.
112 * @privilege %http://tizen.org/privilege/telephony
114 * @remarks You must release @c msin using free().
116 * @param[in] handle The handle from telephony_init()
117 * @param[out] msin The Mobile Subscription Identification Number
119 * @return @c 0 on success,
120 * otherwise a negative error value
122 * @retval #TELEPHONY_ERROR_NONE Successful
123 * @retval #TELEPHONY_ERROR_INVALID_PARAMETER Out of memory
124 * @retval #TELEPHONY_ERROR_PERMISSION_DENIED Permission denied
125 * @retval #TELEPHONY_ERROR_NOT_SUPPORTED Not supported
126 * @retval #TELEPHONY_ERROR_OPERATION_FAILED Invalid parameter
127 * @retval #TELEPHONY_ERROR_SIM_NOT_AVAILABLE SIM is not available
129 * @pre The SIM state must be #TELEPHONY_SIM_STATE_AVAILABLE.
131 * @see telephony_sim_get_state()
133 int telephony_sim_get_msin(telephony_h handle, char **msin);
136 * @brief Gets the Service Provider Name (SPN) of the SIM card.
137 * @details This function gets Service Provider Name embedded in the SIM card.
138 * If this value is not stored in SIM card, @c NULL will be returned.
142 * @privilege %http://tizen.org/privilege/telephony
144 * @remarks You must release @c spn using free().
146 * @param[in] handle The handle from telephony_init()
147 * @param[out] spn The Service Provider Name
149 * @return @c 0 on success,
150 * otherwise a negative error value
152 * @retval #TELEPHONY_ERROR_NONE Successful
153 * @retval #TELEPHONY_ERROR_INVALID_PARAMETER Out of memory
154 * @retval #TELEPHONY_ERROR_PERMISSION_DENIED Permission denied
155 * @retval #TELEPHONY_ERROR_NOT_SUPPORTED Not supported
156 * @retval #TELEPHONY_ERROR_OPERATION_FAILED Invalid parameter
157 * @retval #TELEPHONY_ERROR_SIM_NOT_AVAILABLE SIM is not available
159 * @pre The SIM state must be #TELEPHONY_SIM_STATE_AVAILABLE.
161 * @see telephony_sim_get_state()
163 int telephony_sim_get_spn(telephony_h handle, char **spn);
166 * @brief Checks whether the current SIM card is different from the previous SIM card.
170 * @privilege %http://tizen.org/privilege/telephony
172 * @param[in] handle The handle from telephony_init()
173 * @param[out] is_changed @c true if the current SIM card is different from the previous SIM card,
174 * otherwise @c false if the SIM card is not changed
176 * @return @c 0 on success,
177 * otherwise a negative error value
179 * @retval #TELEPHONY_ERROR_NONE Successful
180 * @retval #TELEPHONY_ERROR_INVALID_PARAMETER Out of memory
181 * @retval #TELEPHONY_ERROR_PERMISSION_DENIED Permission denied
182 * @retval #TELEPHONY_ERROR_NOT_SUPPORTED Not supported
183 * @retval #TELEPHONY_ERROR_OPERATION_FAILED Invalid parameter
184 * @retval #TELEPHONY_ERROR_SIM_NOT_AVAILABLE SIM is not available
186 * @pre The SIM state must be #TELEPHONY_SIM_STATE_AVAILABLE.
188 * @see telephony_sim_get_state()
190 int telephony_sim_is_changed(telephony_h handle, bool *is_changed);
193 * @brief Gets the state of the SIM.
197 * @privilege %http://tizen.org/privilege/telephony
199 * @param[in] handle The handle from telephony_init()
200 * @param[out] sim_state The current state of the SIM
202 * @return @c 0 on success,
203 * otherwise a negative error value
205 * @retval #TELEPHONY_ERROR_NONE Successful
206 * @retval #TELEPHONY_ERROR_INVALID_PARAMETER Out of memory
207 * @retval #TELEPHONY_ERROR_PERMISSION_DENIED Permission denied
208 * @retval #TELEPHONY_ERROR_NOT_SUPPORTED Not supported
209 * @retval #TELEPHONY_ERROR_OPERATION_FAILED Invalid parameter
211 int telephony_sim_get_state(telephony_h handle, telephony_sim_state_e *sim_state);
214 * @brief Gets the SIM card subscriber number.
215 * @details This function gets subscriber number embedded in the SIM card.
216 * This value contains MSISDN related to the subscriber.
217 * If this value is not stored in SIM card, @c NULL will be returned.
221 * @privilege %http://tizen.org/privilege/telephony
223 * @remarks You must release @c subscriber_number using free().
225 * @param[in] handle The handle from telephony_init()
226 * @param[out] subscriber_number The subscriber number in the SIM
228 * @return @c 0 on success,
229 * otherwise a negative error value
231 * @retval #TELEPHONY_ERROR_NONE Successful
232 * @retval #TELEPHONY_ERROR_INVALID_PARAMETER Out of memory
233 * @retval #TELEPHONY_ERROR_PERMISSION_DENIED Permission denied
234 * @retval #TELEPHONY_ERROR_NOT_SUPPORTED Not supported
235 * @retval #TELEPHONY_ERROR_OPERATION_FAILED Invalid parameter
236 * @retval #TELEPHONY_ERROR_SIM_NOT_AVAILABLE SIM is not available
238 * @pre The SIM state must be #TELEPHONY_SIM_STATE_AVAILABLE.
240 * @see telephony_sim_get_state()
242 int telephony_sim_get_subscriber_number(telephony_h handle, char **subscriber_number);
252 #endif // __CAPI_TELEPHONY_SIM_H__