4 * Copyright (c) 2011 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 Network_TAPI NETWORK
27 * @file ITapiNetwork.h
29 @brief This file serves as a "C" header file defines functions for Tapi Network\n
30 It contains a sample set of function prototypes that would be required by applications.
33 #ifndef _ITAPI_NETWORK_H_
34 #define _ITAPI_NETWORK_H_
36 #include <tapi_common.h>
38 #include <TelDefines.h>
39 #include <TelNetwork.h>
47 * @brief This function requests the lower layers to select the network automatically
49 * @par Sync (or) Async:
50 * This is an Asynchronous API.
52 * This function makes Dbus method call to Telephony Sever and returns immediate value.
53 * However it just means that the API request has been transfered to the CP successfully.
54 * The actual operation result is being delivered in the corresponding event asynchronously.
56 * @par Important Notes:
63 * - handle from tel_init().
65 * @param [in] callback
66 * - To register callback function for result.
68 * @param [in] user_data
69 * - user_data for user specification.
71 * @par Async Response Message:
72 * Asynchronous return status is indicated by #TelNetworkOperationCause_t.
73 * There is no data associated with the response.
76 * - A dbus connection is established with #tel_init
77 * - The application name is registered with #tel_register_app_name
78 * - The application is registered events to listen asynchronous response with #tel_register_event
79 * - A event loop is running to listen events
84 * @return Return Type (int) \n
85 * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n
86 * - Refer #TapiResult_t for failure and error code
88 * @par Prospective Clients:
92 * #include <ITapiNetwork.h>
96 * tapi_response_cb callback;
99 * //SET NETWORK SELECTION AUTOMATIC MODE
100 * ret_status = tel_select_network_automatic(handle, callback, user_data);
111 /*================================================================================================*/
112 int tel_select_network_automatic(TapiHandle *handle, tapi_response_cb callback, void *user_data);
115 * @brief This function requests the lower layers to select the network (PLMN) which has been selected by the user from the Network List
116 * displayed to the User.
118 * @par Sync (or) Async:
119 * This is an Asynchronous API.
121 * This function makes Dbus method call to Telephony Sever and returns immediate value.
122 * However it just means that the API request has been transfered to the CP successfully.
123 * The actual operation result is being delivered in the corresponding event asynchronously.
125 * @par Important Notes:
132 * - handle from tel_init().
135 * - User selected PLMN.
138 * - User selected Access Technology.
140 * @param [in] callback
141 * - To register callback function for result.
143 * @param [in] user_data
144 * - user_data for user specification.
146 * @par Async Response Message:
147 * Asynchronous return status is indicated by #TelNetworkOperationCause_t.
148 * There is no data associated with the response.
151 * - A dbus connection is established with #tel_init
152 * - The application name is registered with #tel_register_app_name
153 * - The application is registered events to listen asynchronous response with #tel_register_event
154 * - A event loop is running to listen events
159 * @return Return Type (int) \n
160 * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n
161 * - Refer #TapiResult_t for failure and error code
162 * @par Prospective Clients:
166 * #include <ITapiNetwork.h>
169 * unsigned int plmn = 0;
170 * TapiHandle *handle;
173 * tapi_response_cb callback;
176 * //SET NETWORK SELECTION MANUAL MODE
178 * act = 0x1; //For GSM.
179 * ret_status = tel_select_network_manual(handle, plmn, act, callback, user_data);
190 /*================================================================================================*/
191 int tel_select_network_manual(TapiHandle *handle, const char *plmn, int act, tapi_response_cb callback, void *user_data);
194 * @brief This function sends a request to do manual network search for the available networks and provide the
195 * Network List to the User/Application.
197 * @par Sync (or) Async:
198 * This is an Asynchronous API.
200 * This function makes Dbus method call to Telephony Sever and returns immediate value.
201 * However it just means that the API request has been transfered to the CP successfully.
202 * The actual operation result is being delivered in the corresponding event asynchronously.
204 * @par Important Notes:
211 * - handle from tel_init().
213 * @param [in] callback
214 * - To register callback function for result.
216 * @param [in] user_data
217 * - user_data for user specification.
219 * @par Async Response Message:
220 * Asynchronous return status is indicated by #TelNetworkOperationCause_t.
221 * Data associated with the response is #TelNetworkPlmnList_t.
224 * - A dbus connection is established with #tel_init
225 * - The application name is registered with #tel_register_app_name
226 * - The application is registered events to listen asynchronous response with #tel_register_event
227 * - A event loop is running to listen events
230 * - In the available network list, user can select one of the networks successfully.
232 * @return Return Type (int) \n
233 * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n
234 * - Refer #TapiResult_t for failure and error code
235 * @par Prospective Clients:
239 * #include <ITapiNetwork.h>
242 * TapiHandle *handle;
243 * tapi_response_cb callback;
247 * ret_status = tel_search_network(handle, callback, user_data);
258 /*================================================================================================*/
259 int tel_search_network(TapiHandle *handle, tapi_response_cb callback, void *user_data);
262 * @brief This function requests for the present network selection mode i.e. automatic or manual.
264 * @par Sync (or) Async:
265 * This is an Asynchronous API.
267 * This function makes Dbus method call to Telephony Sever and returns immediate value.
268 * However it just means that the API request has been transfered to the CP successfully.
269 * The actual operation result is being delivered in the corresponding event asynchronously.
271 * @par Important Notes:
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:
287 * Asynchronous return status is indicated by #TelNetworkOperationCause_t.
288 * Data associated with the response is #TelNetworkSelectionMode_t.
291 * - A dbus connection is established with #tel_init
292 * - The application name is registered with #tel_register_app_name
293 * - The application is registered events to listen asynchronous response with #tel_register_event
294 * - A event loop is running to listen events
299 * @return Return Type (int) \n
300 * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n
301 * - Refer #TapiResult_t for failure and error code
302 * @par Prospective Clients:
306 * #include <ITapiNetwork.h>
309 * TapiHandle *handle;
310 * tapi_response_cb callback;
313 * // GET NETWORK SELECTION MODE
314 * ret_status = tel_get_network_selection_mode (handle, callback, user_data);
326 /*================================================================================================*/
327 int tel_get_network_selection_mode(struct tapi_handle *handle, tapi_response_cb callback, void *user_data);
330 * @brief This function is called when User/application wants to configure the service domain to only CS or only PS or Both.
331 * This API triggers the underlying protocol stack to do register with Network for only CS services or only PS services
332 * or both based on the option set using this API.
334 * @par Sync (or) Async:
335 * This is an Asynchronous API.
337 * This function makes Dbus method call to Telephony Sever and returns immediate value.
338 * However it just means that the API request has been transfered to the CP successfully.
339 * The actual operation result is being delivered in the corresponding event asynchronously.
341 * @par Important Notes:
349 * - handle from tel_init().
351 * @param[in] ServiceDomain
352 * - Specifies the type of Service domain (Packet switch, Circuit switch or both)
354 * @param [in] callback
355 * - To register callback function for result.
357 * @param [in] user_data
358 * - user_data for user specification.
360 * @par Async Response Message:
361 * The event associated is TAPI_EVENT_NETWORK_SET_SVC_DOMAIN_CNF and there is no event data associated with this event
362 * and asynchronous return status is indicated by #TelNetworkOperationCause_t.
365 * - A dbus connection is established with #tel_init
366 * - The application name is registered with #tel_register_app_name
367 * - The application is registered events to listen asynchronous response with #tel_register_event
368 * - A event loop is running to listen events
373 * @return Return Type (int) \n
374 * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n
375 * - Refer #TapiResult_t for failure and error code
377 * @par Prospective Clients:
381 * #include <ITapiNetwork.h>
384 * TapiHandle *handle;
385 * TelNetworkServiceDomain_t domain;
386 * tapi_response_cb callback;
389 * // SET NETWORK SERVICE DOMAIN
390 * domain = TAPI_NETWORK_SERVICE_DOMAIN_AUTOMATIC;
392 * ret_status = tel_set_network_service_domain (handle, domain, callback, user_data);
403 /*================================================================================================*/
404 int tel_set_network_service_domain(TapiHandle *handle, TelNetworkServiceDomain_t domain,
405 tapi_response_cb callback, void *user_data);
408 * @brief This function requests for the present network service domain i.e. CS or PS or both or automatic.
410 * @par Sync (or) Async:
411 * This is an Asynchronous API.
413 * This function makes Dbus method call to Telephony Sever and returns immediate value.
414 * However it just means that the API request has been transfered to the CP successfully.
415 * The actual operation result is being delivered in the corresponding event asynchronously.
417 * @par Important Notes:
424 * - handle from tel_init().
426 * @param [in] callback
427 * - To register callback function for result.
429 * @param [in] user_data
430 * - user_data for user specification.
432 * @par Async Response Message:
433 * Asynchronous return status is indicated by #TelNetworkOperationCause_t.
434 * Data associated with the response is #TelNetworkServiceDomain_t.
437 * - A dbus connection is established with #tel_init
438 * - The application name is registered with #tel_register_app_name
439 * - The application is registered events to listen asynchronous response with #tel_register_event
440 * - A event loop is running to listen events
445 * @return Return Type (int) \n
446 * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n
447 * - Refer #TapiResult_t for failure and error code
448 * @par Prospective Clients:
452 * #include <ITapiNetwork.h>
455 * TapiHandle *handle;
456 * tapi_response_cb callback;
459 * // GET NETWORK SERVICE DOMAIN
460 * ret_status = tel_get_network_service_domain (handle, callback, user_data);
472 /*================================================================================================*/
473 int tel_get_network_service_domain(TapiHandle *handle, tapi_response_cb callback, void *user_data);
477 * @brief This function is invoked to set the network band and allows the underlying OEM provider to scan the set band.
479 * This function makes Dbus method call to Telephony Sever and returns immediate value.
480 * However it just means that the API request has been transfered to the CP successfully.
481 * The actual operation result is being delivered in the corresponding event asynchronously.
483 * @par Sync (or) Async:
484 * This is an Asynchronous API.
486 * @par Important Notes:
494 * - handle from tel_init().
497 * - Band preference indicates the band provided to be preferred or selected band.
500 * - This enumeration defines different network bands that user can choose.
502 * @param [in] callback
503 * - To register callback function for result.
505 * @param [in] user_data
506 * - user_data for user specification.
508 * @par Async Response Message:
509 * The event associated is TAPI_EVENT_NETWORK_SETNWBAND_CNF and there is no event data associated with this event and asynchronous
510 * return status is indicated by #TelNetworkOperationCause_t.
513 * - A dbus connection is established with #tel_init
514 * - The application name is registered with #tel_register_app_name
515 * - The application is registered events to listen asynchronous response with #tel_register_event
516 * - A event loop is running to listen events
521 * @return Return Type (int) \n
522 * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n
523 * - Refer #TapiResult_t for failure and error code
524 * @par Prospective Clients:
528 * #include <ITapiNetwork.h>
531 * TapiHandle *handle;
532 * TelNetworkBandPreferred_t mode;
533 * TelNetworkBand_t band;
534 * tapi_response_cb callback;
537 * mode = TAPI_NETWORK_BAND_MODE_PREFERRED;
538 * band = TAPI_NETWORK_BAND_TYPE_GSM_900_1800;
540 * // SET NETWORK BAND
541 * ret_status = tel_set_network_band (handle, mode, band, callback, user_data);
554 /*================================================================================================*/
555 int tel_set_network_band(TapiHandle *handle, TelNetworkBandPreferred_t mode,
556 TelNetworkBand_t band, tapi_response_cb callback, void *user_data);
559 * @brief This function requests for the present network band.
561 * This function makes Dbus method call to Telephony Sever and returns immediate value.
562 * However it just means that the API request has been transfered to the CP successfully.
563 * The actual operation result is being delivered in the corresponding event asynchronously.
565 * @par Sync (or) Async:
566 * This is an Asynchronous API.
568 * @par Important Notes:
576 * - handle from tel_init().
578 * @param [in] callback
579 * - To register callback function for result.
581 * @param [in] user_data
582 * - user_data for user specification.
584 * @par Async Response Message:
585 * Asynchronous return status is indicated by #TelNetworkOperationCause_t.
586 * Data associated with the response is #TelNetworkBand_t.
589 * - A dbus connection is established with #tel_init
590 * - The application name is registered with #tel_register_app_name
591 * - The application is registered events to listen asynchronous response with #tel_register_event
592 * - A event loop is running to listen events
597 * @return Return Type (int) \n
598 * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n
599 * - Refer #TapiResult_t for failure and error code
600 * @par Prospective Clients:
604 * #include <ITapiNetwork.h>
607 * TapiHandle *handle;
608 * tapi_response_cb callback;
611 * // GET NETWORK BAND
612 * ret_status = tel_get_network_band(handle, callback, user_data);
625 /*================================================================================================*/
626 int tel_get_network_band(TapiHandle *handle, tapi_response_cb callback, void *user_data);
629 * @brief This function is invoked to set the network preferred plmn
631 * This function makes Dbus method call to Telephony Sever and returns immediate value.
632 * However it just means that the API request has been transfered to the CP successfully.
633 * The actual operation result is being delivered in the corresponding event asynchronously.
635 * @par Sync (or) Async:
636 * This is an Asynchronous API.
638 * @par Important Notes:
646 * - handle from tel_init().
648 * @param[in] operation
649 * - Operation indicates the operation to be done on preferred plmn .
652 * - This gives the plmn Info.
654 * @param [in] callback
655 * - To register callback function for result.
657 * @param [in] user_data
658 * - user_data for user specification.
660 * @par Async Response Message:
661 * The event associated is TAPI_EVENT_NETWORK_SETPREFFPLMN_CNF and there is no event data associated with this event and asynchronous
662 * return status is indicated by #TelNetworkOperationCause_t.
665 * - A dbus connection is established with #tel_init
666 * - The application name is registered with #tel_register_app_name
667 * - The application is registered events to listen asynchronous response with #tel_register_event
668 * - A event loop is running to listen events
673 * @return Return Type (int) \n
674 * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n
675 * - Refer #TapiResult_t for failure and error code
676 * @par Prospective Clients:
680 * #include <ITapiNetwork.h>
683 * TapiHandle *handle;
684 * TelNetworkPreferredPlmnOp_t operation;
685 * TelNetworkPreferredPlmnInfo_t info;
686 * tapi_response_cb callback;
689 * unsigned char *plmn = "45454";
691 * operation = TAPI_NETWORK_PREF_PLMN_ADD;
692 * memset(&info, 0, sizeof(TelNetworkPreferredPlmnInfo_t));
694 * info.SystemType = TAPI_NETWORK_SYSTEM_GSM;
695 * memcpy(info.Plmn, plmn, strlen(plmn));
697 * // SET NETWORK PREFERRED PLMN
698 * ret_status = tel_set_network_preferred_plmn(handle, operation, &info, callback, user_data);
711 /*================================================================================================*/
712 int tel_set_network_preferred_plmn(TapiHandle *handle, TelNetworkPreferredPlmnOp_t operation,
713 TelNetworkPreferredPlmnInfo_t *info, tapi_response_cb callback, void *user_data);
716 * @brief This function is invoked to get the preferred plmn list
718 * This function makes Dbus method call to Telephony Sever and returns immediate value.
719 * However it just means that the API request has been transfered to the CP successfully.
720 * The actual operation result is being delivered in the corresponding event asynchronously.
722 * @par Sync (or) Async:
723 * This is an Asynchronous API.
725 * @par Important Notes:
732 * - handle from tel_init().
734 * @param [in] callback
735 * - To register callback function for result.
737 * @param [in] user_data
738 * - user_data for user specification.
741 * @par Async Response Message:
742 * Asynchronous return status is indicated by #TelNetworkOperationCause_t.
743 * Data associated with the response is #TelNetworkPreferredPlmnList_t.
746 * - A dbus connection is established with #tel_init
747 * - The application name is registered with #tel_register_app_name
748 * - The application is registered events to listen asynchronous response with #tel_register_event
749 * - A event loop is running to listen events
754 * @return Return Type (int) \n
755 * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n
756 * - Refer #TapiResult_t for failure and error code
757 * @par Prospective Clients:
761 * #include <ITapiNetwork.h>
764 * TapiHandle *handle;
765 * tapi_response_cb callback;
768 * // GET NETWORK PREFERRED PLMN
769 * ret_status = tel_get_network_preferred_plmn(handle, callback, user_data);
782 /*================================================================================================*/
783 int tel_get_network_preferred_plmn(TapiHandle *handle, tapi_response_cb callback, void *user_data);
787 * @brief This function is called to cancel the triggered manual network search.
789 * @par Sync (or) Async:
790 * This is an Asynchronous API.
792 * @par Important Notes:
799 * - handle from tel_init().
801 * @param [in] callback
802 * - To register callback function for result.
804 * @param [in] user_data
805 * - user_data for user specification.
807 * @par Async Response Message:
808 * Asynchronous return status is indicated by #TelNetworkOperationCause_t.
809 * There is no data associated with the response.
812 * - Manual network search is already triggered.
817 * @return Return Type (int) \n
818 * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n
819 * - Refer #TapiResult_t for failure and error code
821 * @par Prospective Clients:
825 * #include <ITapiNetwork.h>
828 * TapiHandle *handle;
829 * tapi_response_cb callback;
832 * // CANCEL NETWORK MANUAL SEARCH
833 * ret_status = tel_cancel_network_manual_search(handle, callback, user_data);
844 /*================================================================================================*/
845 int tel_cancel_network_manual_search(TapiHandle *handle, tapi_response_cb callback, void *user_data);
848 * @brief This function is called to get network serving information
850 * @par Sync (or) Async:
851 * This is an Asynchronous API.
853 * @par Important Notes:
860 * - handle from tel_init().
862 * @param [in] callback
863 * - To register callback function for result.
865 * @param [in] user_data
866 * - user_data for user specification.
868 * @par Async Response Message:
869 * Asynchronous return status is indicated by #TelNetworkOperationCause_t.
870 * Data associated with the response is #TelNetworkServing_t.
877 * @return Return Type (int) \n
878 * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n
879 * - Refer #TapiResult_t for failure and error code
881 * @par Prospective Clients:
885 * #include <ITapiNetwork.h>
888 * TapiHandle *handle;
889 * tapi_response_cb callback;
892 * // GET NETWORK SERVING
893 * ret_status = tel_get_network_serving(handle, callback, user_data);
905 /*================================================================================================*/
906 int tel_get_network_serving(TapiHandle *handle, tapi_response_cb callback, void *user_data);
909 * @brief This function is called to set network mode.
911 * @par Sync (or) Async:
912 * This is an Asynchronous API.
914 * @par Important Notes:
921 * - handle from tel_init().
924 * - Specifies the network mode (GSM only or WCDMA only or Automatic etc)
926 * @param [in] callback
927 * - To register callback function for result.
929 * @param [in] user_data
930 * - user_data for user specification.
932 * @par Async Response Message:
933 * Asynchronous return status is indicated by #TelNetworkOperationCause_t.
934 * There is no data associated with the response.
941 * @return Return Type (int) \n
942 * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n
943 * - Refer #TapiResult_t for failure and error code
945 * @par Prospective Clients:
949 * #include <ITapiNetwork.h>
952 * TapiHandle *handle;
954 * tapi_response_cb callback;
957 * mode = 0x01; //GSM mode
958 * // SET NETWORK MODE
959 * ret_status = tel_set_network_mode(handle, mode, callback, user_data);
970 /*================================================================================================*/
971 int tel_set_network_mode(TapiHandle *handle, int mode, tapi_response_cb callback, void *user_data);
974 * @brief This function is called to get network mode.
976 * @par Sync (or) Async:
977 * This is an Asynchronous API.
979 * @par Important Notes:
986 * - handle from tel_init().
988 * @param [in] callback
989 * - To register callback function for result.
991 * @param [in] user_data
992 * - user_data for user specification.
994 * @par Async Response Message:
995 * Asynchronous return status is indicated by #TelNetworkOperationCause_t.
996 * Data associated with the response is GSM only or WCDMA only or Automatic etc.
1003 * @return Return Type (int) \n
1004 * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n
1005 * - Refer #TapiResult_t for failure and error code
1007 * @par Prospective Clients:
1011 * #include <ITapiNetwork.h>
1014 * TapiHandle *handle;
1015 * tapi_response_cb callback;
1018 * // GET NETWORK MODE
1019 * ret_status = tel_get_network_mode(handle, callback, user_data);
1030 /*================================================================================================*/
1031 int tel_get_network_mode(TapiHandle *handle, tapi_response_cb callback, void *user_data);
1034 * @brief This function is called to get neighboring cell info.
1036 * @par Sync (or) Async:
1037 * This is an Asynchronous API.
1039 * @par Important Notes:
1045 * @param [in] handle
1046 * - handle from tel_init().
1048 * @param [in] callback
1049 * - To register callback function for result.
1051 * @param [in] user_data
1052 * - user_data for user specification.
1054 * @par Async Response Message:
1055 * Asynchronous return status is indicated by #TelNetworkOperationCause_t.
1056 * Data associated with the response is #TelNetworkNeighboringCellInfo_t.
1063 * @return Return Type (int) \n
1064 * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n
1065 * - Refer #TapiResult_t for failure and error code
1067 * @par Prospective Clients:
1071 * #include <ITapiNetwork.h>
1074 * TapiHandle *handle;
1075 * tapi_response_cb callback;
1078 * // GET NETWORK NEIGHBORING CELL INFO
1079 * ret_status = tel_get_network_neighboring_cell_info(handle, callback, user_data);
1090 /*================================================================================================*/
1091 int tel_get_network_neighboring_cell_info(TapiHandle *handle, tapi_response_cb callback, void *user_data);
1097 #endif /* _ITAPI_NETWORK_H_ */