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.
38 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
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;
50 * @brief Enumeration for the type of SIM card .
54 TELEPHONY_SIM_APP_TYPE_SIM = 0x01, /**< SIM(GSM) Application */
55 TELEPHONY_SIM_APP_TYPE_USIM = 0x02, /**< USIM Application */
56 TELEPHONY_SIM_APP_TYPE_CSIM = 0x04, /**< CDMA Application */
57 TELEPHONY_SIM_APP_TYPE_ISIM = 0x08, /**< ISIM Application */
58 } telephony_sim_application_type_e;
62 * @brief Gets the Integrated Circuit Card IDentification (ICC-ID).
63 * @details The Integrated Circuit Card Identification number internationally identifies SIM cards.
65 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
67 * @privilege %http://tizen.org/privilege/telephony
69 * @remarks You must release @c icc_id using free().
71 * @param[in] handle The handle from telephony_init()
72 * @param[out] icc_id The Integrated Circuit Card Identification
74 * @return @c 0 on success,
75 * otherwise a negative error value
77 * @retval #TELEPHONY_ERROR_NONE Successful
78 * @retval #TELEPHONY_ERROR_INVALID_PARAMETER Invalid parameter
79 * @retval #TELEPHONY_ERROR_PERMISSION_DENIED Permission denied
80 * @retval #TELEPHONY_ERROR_NOT_SUPPORTED Not supported
81 * @retval #TELEPHONY_ERROR_OPERATION_FAILED Operation failed
82 * @retval #TELEPHONY_ERROR_SIM_NOT_AVAILABLE SIM is not available
84 * @pre The SIM state must be #TELEPHONY_SIM_STATE_AVAILABLE.
86 * @see telephony_sim_get_state()
88 int telephony_sim_get_icc_id(telephony_h handle, char **icc_id);
91 * @brief Gets the SIM Operator (MCC [3 digits] + MNC [2~3 digits]).
92 * @details The Operator is embedded in the SIM card.
94 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
96 * @privilege %http://tizen.org/privilege/telephony
98 * @remarks You must release @c sim_operator using free().
100 * @param[in] handle The handle from telephony_init()
101 * @param[out] sim_operator The SIM Operator
103 * @return @c 0 on success,
104 * otherwise a negative error value
106 * @retval #TELEPHONY_ERROR_NONE Successful
107 * @retval #TELEPHONY_ERROR_INVALID_PARAMETER Invalid parameter
108 * @retval #TELEPHONY_ERROR_PERMISSION_DENIED Permission denied
109 * @retval #TELEPHONY_ERROR_NOT_SUPPORTED Not supported
110 * @retval #TELEPHONY_ERROR_OPERATION_FAILED Operation failed
111 * @retval #TELEPHONY_ERROR_SIM_NOT_AVAILABLE SIM is not available
113 * @pre The SIM state must be #TELEPHONY_SIM_STATE_AVAILABLE.
115 * @see telephony_sim_get_state()
117 int telephony_sim_get_operator(telephony_h handle, char **sim_operator);
120 * @brief Gets the Mobile Subscription Identification Number (MSIN [9~10 digits]) of the SIM provider.
121 * @details This function gets Mobile Subscription Identification Number embedded in the SIM card.
123 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
125 * @privilege %http://tizen.org/privilege/telephony
127 * @remarks You must release @c msin using free().
129 * @param[in] handle The handle from telephony_init()
130 * @param[out] msin The Mobile Subscription Identification Number
132 * @return @c 0 on success,
133 * otherwise a negative error value
135 * @retval #TELEPHONY_ERROR_NONE Successful
136 * @retval #TELEPHONY_ERROR_INVALID_PARAMETER Invalid parameter
137 * @retval #TELEPHONY_ERROR_PERMISSION_DENIED Permission denied
138 * @retval #TELEPHONY_ERROR_NOT_SUPPORTED Not supported
139 * @retval #TELEPHONY_ERROR_OPERATION_FAILED Operation failed
140 * @retval #TELEPHONY_ERROR_SIM_NOT_AVAILABLE SIM is not available
142 * @pre The SIM state must be #TELEPHONY_SIM_STATE_AVAILABLE.
144 * @see telephony_sim_get_state()
146 int telephony_sim_get_msin(telephony_h handle, char **msin);
149 * @brief Gets the Service Provider Name (SPN) of the SIM card.
150 * @details This function gets Service Provider Name embedded in the SIM card.
151 * If this value is not stored in SIM card,
152 * negative error returned and @c NULL will be stored in @c spn.
154 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
156 * @privilege %http://tizen.org/privilege/telephony
158 * @remarks You must release @c spn using free().
160 * @param[in] handle The handle from telephony_init()
161 * @param[out] spn The Service Provider Name
163 * @return @c 0 on success,
164 * otherwise a negative error value
166 * @retval #TELEPHONY_ERROR_NONE Successful
167 * @retval #TELEPHONY_ERROR_INVALID_PARAMETER Invalid parameter
168 * @retval #TELEPHONY_ERROR_PERMISSION_DENIED Permission denied
169 * @retval #TELEPHONY_ERROR_NOT_SUPPORTED Not supported
170 * @retval #TELEPHONY_ERROR_OPERATION_FAILED Operation failed
171 * @retval #TELEPHONY_ERROR_SIM_NOT_AVAILABLE SIM is not available
173 * @pre The SIM state must be #TELEPHONY_SIM_STATE_AVAILABLE.
175 * @see telephony_sim_get_state()
177 int telephony_sim_get_spn(telephony_h handle, char **spn);
180 * @brief Checks whether the current SIM card is different from the previous SIM card.
182 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
184 * @privilege %http://tizen.org/privilege/telephony
186 * @param[in] handle The handle from telephony_init()
187 * @param[out] is_changed @c true if the current SIM card is different from the previous SIM card,
188 * otherwise @c false if the SIM card is not changed
190 * @return @c 0 on success,
191 * otherwise a negative error value
193 * @retval #TELEPHONY_ERROR_NONE Successful
194 * @retval #TELEPHONY_ERROR_INVALID_PARAMETER Invalid parameter
195 * @retval #TELEPHONY_ERROR_PERMISSION_DENIED Permission denied
196 * @retval #TELEPHONY_ERROR_NOT_SUPPORTED Not supported
197 * @retval #TELEPHONY_ERROR_OPERATION_FAILED Operation failed
198 * @retval #TELEPHONY_ERROR_SIM_NOT_AVAILABLE SIM is not available
200 * @pre The SIM state must be #TELEPHONY_SIM_STATE_AVAILABLE.
202 * @see telephony_sim_get_state()
204 int telephony_sim_is_changed(telephony_h handle, bool *is_changed);
207 * @brief Gets the state of the SIM.
209 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
211 * @privilege %http://tizen.org/privilege/telephony
213 * @param[in] handle The handle from telephony_init()
214 * @param[out] sim_state The current state of the SIM
216 * @return @c 0 on success,
217 * otherwise a negative error value
219 * @retval #TELEPHONY_ERROR_NONE Successful
220 * @retval #TELEPHONY_ERROR_INVALID_PARAMETER Invalid parameter
221 * @retval #TELEPHONY_ERROR_PERMISSION_DENIED Permission denied
222 * @retval #TELEPHONY_ERROR_NOT_SUPPORTED Not supported
223 * @retval #TELEPHONY_ERROR_OPERATION_FAILED Operation failed
225 int telephony_sim_get_state(telephony_h handle, telephony_sim_state_e *sim_state);
228 * @brief Gets the list of application on UICC.
232 * @privilege %http://tizen.org/privilege/telephony
234 * @param[in] handle The handle from telephony_init()
235 * @param[out] app_list The masking value for below values
236 * #TELEPHONY_SIM_APP_TYPE_SIM 0x01 GSM Application
237 * #TELEPHONY_SIM_APP_TYPE_USIM 0x02 USIM Application
238 * #TELEPHONY_SIM_APP_TYPE_CSIM 0x04 CSIM Application
239 * #TELEPHONY_SIM_APP_TYPE_ISIM 0x08 ISIM Application
241 * @return @c 0 on success,
242 * otherwise a negative error value
244 * @retval #TELEPHONY_ERROR_NONE Successful
245 * @retval #TELEPHONY_ERROR_INVALID_PARAMETER Invalid parameter
246 * @retval #TELEPHONY_ERROR_PERMISSION_DENIED Permission denied
247 * @retval #TELEPHONY_ERROR_NOT_SUPPORTED Not supported
248 * @retval #TELEPHONY_ERROR_OPERATION_FAILED Operation failed
250 int telephony_sim_get_application_list(telephony_h handle, unsigned int *app_list);
253 * @brief Gets the SIM card subscriber number.
254 * @details This function gets subscriber number embedded in the SIM card.
255 * This value contains MSISDN related to the subscriber.
256 * If this value is not stored in SIM card,
257 * negative error returned and @c NULL will be stored in @c subscriber_number.
259 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
261 * @privilege %http://tizen.org/privilege/telephony
263 * @remarks You must release @c subscriber_number using free().
265 * @param[in] handle The handle from telephony_init()
266 * @param[out] subscriber_number The subscriber number in the SIM
268 * @return @c 0 on success,
269 * otherwise a negative error value
271 * @retval #TELEPHONY_ERROR_NONE Successful
272 * @retval #TELEPHONY_ERROR_INVALID_PARAMETER Invalid parameter
273 * @retval #TELEPHONY_ERROR_PERMISSION_DENIED Permission denied
274 * @retval #TELEPHONY_ERROR_NOT_SUPPORTED Not supported
275 * @retval #TELEPHONY_ERROR_OPERATION_FAILED Operation failed
276 * @retval #TELEPHONY_ERROR_SIM_NOT_AVAILABLE SIM is not available
278 * @pre The SIM state must be #TELEPHONY_SIM_STATE_AVAILABLE.
280 * @see telephony_sim_get_state()
282 int telephony_sim_get_subscriber_number(telephony_h handle, char **subscriber_number);
285 * @brief Gets the Subscriber ID.
286 * @details This function gets subscriber ID encoded.
290 * @privilege %http://tizen.org/privilege/telephony
292 * @remarks You must release @c subscriber_id using free().
294 * @param[in] handle The handle from telephony_init()
295 * @param[out] subscriber_id The subscriber ID
297 * @retval #TELEPHONY_ERROR_NONE Successful
298 * @retval #TELEPHONY_ERROR_INVALID_PARAMETER Invalid parameter
299 * @retval #TELEPHONY_ERROR_PERMISSION_DENIED Permission denied
300 * @retval #TELEPHONY_ERROR_NOT_SUPPORTED Not supported
301 * @retval #TELEPHONY_ERROR_OPERATION_FAILED Operation failed
302 * @retval #TELEPHONY_ERROR_SIM_NOT_AVAILABLE SIM is not available
304 * @pre The SIM state must be #TELEPHONY_SIM_STATE_AVAILABLE.
306 * @see telephony_sim_get_state()
308 int telephony_sim_get_subscriber_id(telephony_h handle, char **subscriber_id);
318 #endif // __CAPI_TELEPHONY_SIM_H__