Convert DOS endings to Linux endings on LICENSE file
[platform/core/telephony/libtapi.git] / include / ITapiModem.h
1 /*
2  * libslp-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  * @internal
23  * @ingroup             TelephonyAPI
24  * @addtogroup  MODEM_TAPI      POWER
25  * @{
26  *
27  * These APIs allow an application to accomplish the following services: @n
28  * - Process power command @n
29  * - Reset the phone power (on / off), @n
30  * - Process airplane mode @n
31  */
32
33 #ifndef _ITAPI_MODEM_H_
34 #define _ITAPI_MODEM_H_
35
36 #include <tapi_common.h>
37 #include <TelDefines.h>
38 #include <TelPower.h>
39 #include <TelMisc.h>
40 #include "ITapiPS.h"
41
42 #ifdef __cplusplus
43 extern "C" {
44 #endif
45
46 /**
47  *
48  * @brief  This API is used to turn power off or on the modem.
49  *
50  * @par Sync (or) Async:
51  * This is a Synchronous API.
52  *
53  * @par Important Notes:
54  * -NONE
55  *
56  * @warning
57  * - None.
58  *
59  *
60  * @param [in] handle
61  * - handle from tel_init()
62  *
63  * @param [in] cmd
64  * - This index value is the power command as #tapi_power_phone_cmd_t.
65  *
66  * @param [in] callback
67  *   - To register callback function for result of this function.
68  *
69  * @param [in] user_data
70  *   - user data for user specification
71  *
72  * @par Async Response Message:
73  * - None
74  *
75  *
76  * @pre
77  *  - None.
78  *
79  * @post
80  *  - None.
81  *
82  * @return Return Type (int) \n
83  * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n
84  * - Otherwise it provides an error code (Refer #TapiResult_t)
85  *
86  * @par Prospective Clients:
87  * External Apps.
88  *
89  *
90  */
91 int tel_process_power_command(TapiHandle *handle, tapi_power_phone_cmd_t cmd, tapi_response_cb callback, void *user_data);
92
93 /**
94  *
95  * @brief  This API is used to enter or leave airplane mode
96  *
97  * @par Sync (or) Async:
98  * This is a Asynchronous API.
99  *
100  * @par Important Notes:
101  * -NONE
102  *
103  * @warning
104  * - None.
105  *
106  *
107  * @param [in] handle
108  * - handle from tel_init()
109  *
110  * @param [in] mode
111  * - This mode value is the flight flag #tapi_power_flight_mode_type_t.
112  *
113  * @param [in] callback
114  *   - To register callback function for result of this function.
115  *
116  * @param [in] user_data
117  *   - user data for user specification
118  *
119  * @par Async Response Message:
120  * The event associated is TAPI_EVENT_MODEM_FLIGHT_MODE_RESP  and the event data is #tapi_power_flight_mode_resp_type_t.
121  * Asynchronous return status is always TAPI_API_SUCCESS.
122  *
123  * @pre
124  *  - None.
125  *
126  * @post
127  *  - None.
128  *
129  * @return Return Type (int) \n
130  * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n
131  * - Otherwise it provides an error code (Refer #TapiResult_t)
132  *
133  * @par Prospective Clients:
134  * External Apps.
135  *
136  *
137  */
138 int tel_set_flight_mode(TapiHandle *handle, tapi_power_flight_mode_type_t mode, tapi_response_cb callback, void *user_data);
139
140 int tel_get_flight_mode(TapiHandle *handle, tapi_response_cb callback, void *user_data);
141
142 /**
143  *
144  * @brief  This function is invoked to Get ME version information.
145  *
146  * @par Sync (or) Async:
147  * This is a synchronous API.
148  *
149  * @par Important Notes:
150  * - None.
151  *
152  * @warning
153  * - None.
154  *
155  * @param [in] handle
156  * - handle from tel_init()
157  *
158  * @param [in] callback
159  *   - To register callback function for result of this function.
160  *
161  * @param [in] user_data
162  *   - user data for user specification
163  *
164  * @par Async Response Message:
165  * - NA
166  *
167  * @pre
168  *  - None.
169  *
170  * @post
171  *  - None.
172  *
173  * @return Return Type (int) \n
174  * - Integer '0' ( same with TAPI_API_SUCCESS )  - indicating that the operation has completed successfully. \n
175  * - Negative integer : it provides an error code (Refer #TapiResult_t)
176  *
177  * @par Prospective Clients:
178  * External Apps.
179  *
180  */
181 int tel_get_misc_me_version(TapiHandle *handle, tapi_response_cb callback, void *user_data);
182
183 /**
184  *
185  * @brief This function is to get misc me version
186  *
187  * @par Sync (or) Async:
188  * This is a Synchronous API.
189  *
190  * @par Important Notes:
191  * - None.
192  *
193  * @warning
194  * - None.
195  *
196  * @param [in] handle
197  * - handle from tel_init()
198  *
199  * @par Async Response Message:
200  * - Na
201  *
202  * @pre
203  *  - None.
204  *
205  * @post
206  *  - None.
207  *
208  * @return Return Type ( TelMiscVersionInformation * ) \n
209  * - Misc Version Information
210  *
211  * @par Prospective Clients:
212  * External Apps.
213  *
214  */
215
216
217 TelMiscVersionInformation *tel_get_misc_me_version_sync(TapiHandle *handle);
218
219
220 /**
221  *
222  * @brief  This function is invoked to Get ME IMEI/ESN/MEID for each phone type.
223  *
224  * @par Sync (or) Async:
225  * This is a synchronous API.
226  *
227  * @par Important Notes:
228  * - None.
229  *
230  * @warning
231  * - None.
232  *
233  * @param [in] handle
234  * - handle from tel_init()
235  *
236  * @param [in] callback
237  *   - To register callback function for result of this function.
238  *
239  * @param [in] user_data
240  *   - user data for user specification
241  *
242  * @par Async Response Message:
243  * - NA
244  *
245  * @pre
246  *  - None.
247  *
248  * @post
249  *  - None.
250  *
251  * @return Return Type (int) \n
252  * - Integer '0' ( same with TAPI_API_SUCCESS )  - indicating that the operation has completed successfully. \n
253  * - Negative integer : it provides an error code (Refer #TapiResult_t)
254  *
255  * @par Prospective Clients:
256  * External Apps.
257  *
258  */
259 int tel_get_misc_me_sn(TapiHandle *handle, tapi_response_cb callback, void *user_data);
260
261 /**
262  *
263  * @brief This function is to get misc me Sereal Number
264  *
265  * This function makes Dbus method call to Telephony Sever and returns immediate value.
266  * However it just means that the API request has been transfered to the CP successfully.
267  * The actual operation result is being delivered in the corresponding event asynchronously.
268  *
269  * @par Sync (TapiHandle *handle, or) Async:
270  * This is a Synchronous API.
271  *
272  * @par Important Notes:
273  *  - None.
274  *
275  * @warning
276  * 
277  *
278  * @param [in] handle
279  * - handle from tel_init()
280  *
281  * @pre
282  * - None.
283  *
284  * @post
285  * - None.
286  *
287  * @return Return Type (char*) \n
288  * - Sereal Number string
289  *
290  * @par Prospective Clients:
291  * Embedded call application
292  *
293  * @see None.
294  *
295  * @remarks
296  * - None
297  *
298  *
299  */
300
301 char *tel_get_misc_me_sn_sync(TapiHandle *handle);
302
303 /**
304  *
305  * @brief This function is to get misc me imei
306  *
307  * @par Sync (or) Async:
308  * This is a Asynchronous API.
309  *
310  * @par Important Notes:
311  * - None.
312  *
313  * @warning
314  * - None.
315  *
316  * @param [in] handle
317  * - handle from tel_init()
318  *
319  * @param [in] callback
320  *   - To register callback function for result of this function.
321  *
322  * @param [in] user_data
323  *   - user data for user specification
324  *
325  * @par Async Response Message:
326  * - IMEI
327  *
328  * @pre
329  *  - None.
330  *
331  * @post
332  *  - None.
333  *
334  * @return Return Type (int) \n
335  * - Integer '0' ( same with TAPI_API_SUCCESS )  - indicating that the operation has completed successfully. \n
336  * - Negative integer : it provides an error code (Refer #TapiResult_t)
337  *
338  * @par Prospective Clients:
339  * External Apps.
340  *
341  */
342
343 int tel_get_misc_me_imei(TapiHandle *handle, tapi_response_cb callback, void *user_data);
344
345 /**
346  *
347  * @brief This function is to get misc me imei
348  *
349  * This function makes Dbus method call to Telephony Sever and returns immediate value.
350  * However it just means that the API request has been transfered to the CP successfully.
351  * The actual operation result is being delivered in the corresponding event asynchronously.
352  *
353  * @par Sync (TapiHandle *handle, or) Async:
354  * This is a Synchronous API.
355  *
356  * @par Important Notes:
357  *  - None.
358  *
359  * @warning
360  * 
361  *
362  * @param [in] handle
363  * - handle from tel_init()
364  *
365  *
366  * @pre
367  * - None.
368  *
369  * @post
370  * - None.
371  *
372  * @return Return Type (char*) \n
373  * - IMEI string
374  *
375  * @par Prospective Clients:
376  * Embedded call application
377  *
378  * @see None.
379  *
380  * @remarks
381  * - None
382  *
383  *
384  */
385
386 char *tel_get_misc_me_imei_sync(TapiHandle *handle);
387
388 /**
389  *
390  * @brief This function is to check modem power status
391  *
392  * This function makes Dbus method call to Telephony Sever and returns immediate value.
393  * However it just means that the API request has been transfered to the CP successfully.
394  * The actual operation result is being delivered in the corresponding event asynchronously.
395  *
396  * @par Sync (TapiHandle *handle, or) Async:
397  * This is a Asynchronous API.
398  *
399  * @par Important Notes:
400  *  - None.
401  *
402  * @warning
403  *
404  *
405  * @param [in] handle
406  * - handle from tel_init()
407  *
408  * @param [out] result
409  * - result of checking modem power status.
410  *
411  * @par Async Response Message:
412  * - 
413  *
414  * @pre
415  * - None.
416  *
417  * @post
418  * - None.
419  *
420  * @return Return Type (TapiHandle *handle, int) \n
421  * - 0 - indicating that the operation has completed successfully. \n
422  * - Else it will return failure and error code (TapiHandle *handle, Refer Doxygen doc or #TapiResult_t)
423  *
424  * @par Prospective Clients:
425  * Embedded call application
426  *
427  * @see None.
428  *
429  * @remarks
430  * - None
431  *
432  *
433  */
434
435 int tel_check_modem_power_status(TapiHandle *handle, int *result);
436
437 /**
438  *
439  * @brief This function is to control modem dun pin
440  *
441  * This function makes Dbus method call to Telephony Sever and returns immediate value.
442  * However it just means that the API request has been transfered to the CP successfully.
443  * The actual operation result is being delivered in the corresponding event asynchronously.
444  *
445  * @par Sync (TapiHandle *handle, or) Async:
446  * This is a Asynchronous API.
447  *
448  * @par Important Notes:
449  *  - None.
450  *
451  * @warning
452  *
453  *
454  * @param [in] handle
455  * - handle from tel_init()
456  *
457  * @param [in] pincontrol
458  * - pin control inforamation
459  *
460  * @param [in] callback
461  * - To register callback function for result of this function.
462  *
463  * @param [in] user_data
464  * - user data for user specification
465  *
466  * @par Async Response Message:
467  * - None.
468  *
469  * @pre
470  * - None.
471  *
472  * @post
473  * - None.
474  *
475  * @return Return Type (TapiHandle *handle, int) \n
476  * - 0 - indicating that the operation has completed successfully. \n
477  * - Else it will return failure and error code (TapiHandle *handle, Refer Doxygen doc or #TapiResult_t)
478  *
479  * @par Prospective Clients:
480  * Embedded call application
481  *
482  * @see None.
483  *
484  * @remarks
485  * - None
486  *
487  *
488  */
489
490 int tel_control_modem_dun_pin_ctrl(TapiHandle *handle, tapi_ps_btdun_pincontrol *pincontrol, tapi_response_cb callback, void *user_data);
491
492 #ifdef __cplusplus
493 }
494 #endif
495
496 #endif  /* _ITAPI_MODEM_H_ */
497
498 /**
499  * @}
500  */