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:
57 * - This function passes the
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 * The event associated is TAPI_EVENT_NETWORK_SELECT_CNF and there is no data associated with this event. Asynchronous return status
73 * is indicated by #TelNetworkOperationCause_t.
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>
98 * ret_status = tel_select_network_automatic(&RequestId);
109 /*================================================================================================*/
110 int tel_select_network_automatic(TapiHandle *handle, tapi_response_cb callback, void *user_data);
113 * @brief This function requests the lower layers to select the network (PLMN) which has been selected by the user from the Network List
114 * displayed to the User.
116 * @par Sync (or) Async:
117 * This is an Asynchronous API.
119 * This function makes Dbus method call to Telephony Sever and returns immediate value.
120 * However it just means that the API request has been transfered to the CP successfully.
121 * The actual operation result is being delivered in the corresponding event asynchronously.
123 * @par Important Notes:
124 * - This function passes the .
130 * - handle from tel_init().
136 * @param [in] callback
137 * - To register callback function for result.
139 * @param [in] user_data
140 * - user_data for user specification.
142 * @par Async Response Message:
143 * The event associated is TAPI_EVENT_NETWORK_SELECT_CNF and there is no data associated with this event. Asynchronous return status
144 * is indicated by #TelNetworkOperationCause_t.
147 * - A dbus connection is established with #tel_init
148 * - The application name is registered with #tel_register_app_name
149 * - The application is registered events to listen asynchronous response with #tel_register_event
150 * - A event loop is running to listen events
155 * @return Return Type (int) \n
156 * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n
157 * - Refer #TapiResult_t for failure and error code
158 * @par Prospective Clients:
162 * #include <ITapiNetwork.h>
166 * unsigned int plmn = 0;
170 * ret_status = tel_select_network_manual(Plmn, &RequestId);
181 /*================================================================================================*/
182 int tel_select_network_manual(TapiHandle *handle, const char *plmn, int act, tapi_response_cb callback, void *user_data);
185 * @brief This function sends a request to do manual network selection to search for the available networks and provide the
186 * Network List to the User/Application.
188 * @par Sync (or) Async:
189 * This is an Asynchronous API.
191 * This function makes Dbus method call to Telephony Sever and returns immediate value.
192 * However it just means that the API request has been transfered to the CP successfully.
193 * The actual operation result is being delivered in the corresponding event asynchronously.
195 * @par Important Notes:
202 * - handle from tel_init().
204 * @param [in] callback
205 * - To register callback function for result.
207 * @param [in] user_data
208 * - user_data for user specification.
210 * @par Async Response Message:
211 * The event associated is TAPI_EVENT_NETWORK_SEARCH_CNF and the event data is #TelNetworkPlmnList_t.
212 * Asynchronous return status is indicated by #TelNetworkOperationCause_t.
215 * - A dbus connection is established with #tel_init
216 * - The application name is registered with #tel_register_app_name
217 * - The application is registered events to listen asynchronous response with #tel_register_event
218 * - A event loop is running to listen events
221 * - In the available network list, user can select one of the networks successfully.
223 * @return Return Type (int) \n
224 * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n
225 * - Refer #TapiResult_t for failure and error code
226 * @par Prospective Clients:
230 * #include <ITapiNetwork.h>
236 * ret_status = tel_search_network(&RequestId);
247 /*================================================================================================*/
248 int tel_search_network(TapiHandle *handle, tapi_response_cb callback, void *user_data);
251 * @brief This function requests for the present network selection mode i.e. automatic or manual.
253 * @par Sync (or) Async:
254 * This is an Asynchronous API.
256 * This function makes Dbus method call to Telephony Sever and returns immediate value.
257 * However it just means that the API request has been transfered to the CP successfully.
258 * The actual operation result is being delivered in the corresponding event asynchronously.
260 * @par Important Notes:
267 * - handle from tel_init().
269 * @param [in] callback
270 * - To register callback function for result.
272 * @param [in] user_data
273 * - user_data for user specification.
275 * @par Async Response Message:
276 * The event associated is TAPI_EVENT_NETWORK_GETSELECTIONMODE_CNF and the event data is #TelNetworkSelectionMode_t.
277 * Asynchronous return status is indicated by #TelNetworkOperationCause_t.
280 * - A dbus connection is established with #tel_init
281 * - The application name is registered with #tel_register_app_name
282 * - The application is registered events to listen asynchronous response with #tel_register_event
283 * - A event loop is running to listen events
288 * @return Return Type (int) \n
289 * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n
290 * - Refer #TapiResult_t for failure and error code
291 * @par Prospective Clients:
295 * #include <ITapiNetwork.h>
300 * // GET THE SELECTION MODE
301 * ret_status = tel_get_network_selection_mode (&RequestId);
313 /*================================================================================================*/
314 int tel_get_network_selection_mode(struct tapi_handle *handle, tapi_response_cb callback, void *user_data);
317 * @brief This function is called when User/application wants to configure the service domain to only CS or Only PS or Both.
318 * This API triggers the underlying protocol stack to do register with Network for only CS services or only PS services
319 * or both based on the option set using this API.
321 * @par Sync (or) Async:
322 * This is an Asynchronous API.
324 * This function makes Dbus method call to Telephony Sever and returns immediate value.
325 * However it just means that the API request has been transfered to the CP successfully.
326 * The actual operation result is being delivered in the corresponding event asynchronously.
328 * @par Important Notes:
336 * - handle from tel_init().
338 * @param[in] ServiceDomain
339 * - Specifies the type of Service domain (Packet switch, circuit switch,etc)
341 * @param [in] callback
342 * - To register callback function for result.
344 * @param [in] user_data
345 * - user_data for user specification.
347 * @par Async Response Message:
348 * The event associated is TAPI_EVENT_NETWORK_SET_SVC_DOMAIN_CNF and there is no event data associated with this event
349 * and asynchronous return status is indicated by #TelNetworkOperationCause_t.
352 * - A dbus connection is established with #tel_init
353 * - The application name is registered with #tel_register_app_name
354 * - The application is registered events to listen asynchronous response with #tel_register_event
355 * - A event loop is running to listen events
360 * @return Return Type (int) \n
361 * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n
362 * - Refer #TapiResult_t for failure and error code
364 * @par Prospective Clients:
368 * #include <ITapiNetwork.h>
373 * // SET NETWORK SERVICE DOMAIN
374 * TelNetworkServiceDomain_t ServiceDomain = TAPI_NETWORK_SERVICE_DOMAIN_AUTOMATIC;
376 * ret_status = tel_set_network_service_domain (ServiceDomain, &RequestId);
387 /*================================================================================================*/
388 int tel_set_network_service_domain(TapiHandle *handle, TelNetworkServiceDomain_t domain,
389 tapi_response_cb callback, void *user_data);
392 * @brief This function requests for the present network service domain i.e. CS or PS or both or automatic.
394 * @par Sync (or) Async:
395 * This is an Asynchronous API.
397 * This function makes Dbus method call to Telephony Sever and returns immediate value.
398 * However it just means that the API request has been transfered to the CP successfully.
399 * The actual operation result is being delivered in the corresponding event asynchronously.
401 * @par Important Notes:
408 * - handle from tel_init().
410 * @param [in] callback
411 * - To register callback function for result.
413 * @param [in] user_data
414 * - user_data for user specification.
416 * @par Async Response Message:
417 * The event associated is TAPI_EVENT_NETWORK_GET_SVC_DOMAIN_CNF and the event data is #TelNetworkServiceDomain_t.
418 * Asynchronous return status is indicated by #TelNetworkOperationCause_t.
421 * - A dbus connection is established with #tel_init
422 * - The application name is registered with #tel_register_app_name
423 * - The application is registered events to listen asynchronous response with #tel_register_event
424 * - A event loop is running to listen events
429 * @return Return Type (int) \n
430 * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n
431 * - Refer #TapiResult_t for failure and error code
432 * @par Prospective Clients:
436 * #include <ITapiNetwork.h>
441 * // GET NETWORK SERVICE DOMAIN
442 * ret_status = tel_get_network_service_domain (&RequestId);
454 /*================================================================================================*/
455 int tel_get_network_service_domain(TapiHandle *handle, tapi_response_cb callback, void *user_data);
459 * @brief This function is invoked to set the network band and allows the underlying OEM provider to scan the set band.
461 * This function makes Dbus method call to Telephony Sever and returns immediate value.
462 * However it just means that the API request has been transfered to the CP successfully.
463 * The actual operation result is being delivered in the corresponding event asynchronously.
465 * @par Sync (or) Async:
466 * This is an Asynchronous API.
468 * @par Important Notes:
476 * - handle from tel_init().
479 * - Band preference indicates the band provide to be preferred or select the band.
482 * - This enumeration defines different network Bands that user can choose.
484 * @param [in] callback
485 * - To register callback function for result.
487 * @param [in] user_data
488 * - user_data for user specification.
490 * @par Async Response Message:
491 * The event associated is TAPI_EVENT_NETWORK_SETNWBAND_CNF and there is no event data associated with this event and asynchronous
492 * return status is indicated by #TelNetworkOperationCause_t.
495 * - A dbus connection is established with #tel_init
496 * - The application name is registered with #tel_register_app_name
497 * - The application is registered events to listen asynchronous response with #tel_register_event
498 * - A event loop is running to listen events
503 * @return Return Type (int) \n
504 * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n
505 * - Refer #TapiResult_t for failure and error code
506 * @par Prospective Clients:
510 * #include <ITapiNetwork.h>
515 * TelNetworkBandPreferred_t BandMode = TAPI_NETWORK_BAND_MODE_PREFERRED;
516 * TelNetworkBand_t Band = TAPI_NETWORK_BAND_TYPE_GSM_900_1800;
518 * // SET NETWORK BAND
519 * ret_status = tel_set_network_band (BandMode, Band, &RequestId);
532 /*================================================================================================*/
533 int tel_set_network_band(TapiHandle *handle, TelNetworkBandPreferred_t mode,
534 TelNetworkBand_t band, tapi_response_cb callback, void *user_data);
537 * @brief This function requests for the present network band.
539 * This function makes Dbus method call to Telephony Sever and returns immediate value.
540 * However it just means that the API request has been transfered to the CP successfully.
541 * The actual operation result is being delivered in the corresponding event asynchronously.
543 * @par Sync (or) Async:
544 * This is an Asynchronous API.
546 * @par Important Notes:
554 * - handle from tel_init().
556 * @param [in] callback
557 * - To register callback function for result.
559 * @param [in] user_data
560 * - user_data for user specification.
562 * @par Async Response Message:
563 * The event associated is TAPI_EVENT_NETWORK_GETNWBAND_CNF and the event data is #TelNetworkBand_t.
564 * Asynchronous return status is indicated by #TelNetworkOperationCause_t.
567 * - A dbus connection is established with #tel_init
568 * - The application name is registered with #tel_register_app_name
569 * - The application is registered events to listen asynchronous response with #tel_register_event
570 * - A event loop is running to listen events
575 * @return Return Type (int) \n
576 * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n
577 * - Refer #TapiResult_t for failure and error code
578 * @par Prospective Clients:
582 * #include <ITapiNetwork.h>
587 * // GET NETWORK BAND
588 * ret_status = tel_get_network_band(&RequestId);
601 /*================================================================================================*/
602 int tel_get_network_band(TapiHandle *handle, tapi_response_cb callback, void *user_data);
605 * @brief This function is invoked to set the network preferred plmn
607 * This function makes Dbus method call to Telephony Sever and returns immediate value.
608 * However it just means that the API request has been transfered to the CP successfully.
609 * The actual operation result is being delivered in the corresponding event asynchronously.
611 * @par Sync (or) Async:
612 * This is an Asynchronous API.
614 * @par Important Notes:
622 * - handle from tel_init().
624 * @param[in] operation
625 * - Operation indicates the operation to be done on preferred plmn .
628 * - This gives the plmn Info.
630 * @param [in] callback
631 * - To register callback function for result.
633 * @param [in] user_data
634 * - user_data for user specification.
636 * @par Async Response Message:
637 * The event associated is TAPI_EVENT_NETWORK_SETPREFFPLMN_CNF and there is no event data associated with this event and asynchronous
638 * return status is indicated by #TelNetworkOperationCause_t.
641 * - A dbus connection is established with #tel_init
642 * - The application name is registered with #tel_register_app_name
643 * - The application is registered events to listen asynchronous response with #tel_register_event
644 * - A event loop is running to listen events
649 * @return Return Type (int) \n
650 * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n
651 * - Refer #TapiResult_t for failure and error code
652 * @par Prospective Clients:
656 * #include <ITapiNetwork.h>
661 * TelNetworkPreferredPlmnOp_t Operation = TAPI_NETWORK_PREF_PLMN_ADD;
662 * TelNetworkPreferredPlmnInfo_t PrefPlmnInfo;
664 * memset(&PrefPlmnInfo, 0, sizeof(TelNetworkPreferredPlmnInfo_t));
665 * PrefPlmnInfo.Index = 0;
666 * PrefPlmnInfo.SystemType = TAPI_NETWORK_SYSTEM_GSM;
667 * unsigned char *plmn = "45454";
668 * memcpy(PrefPlmnInfo.Plmn, plmn, strlen(plmn));
670 * // SET PREFERRED PLMN
671 * ret_status = tel_set_network_preferred_plmn(Operation, PrefPlmnInfo, &RequestId);
684 /*================================================================================================*/
685 int tel_set_network_preferred_plmn(TapiHandle *handle, TelNetworkPreferredPlmnOp_t operation,
686 TelNetworkPreferredPlmnInfo_t *info, tapi_response_cb callback, void *user_data);
689 * @brief This function is invoked to get the preferred plmn list
691 * This function makes Dbus method call to Telephony Sever and returns immediate value.
692 * However it just means that the API request has been transfered to the CP successfully.
693 * The actual operation result is being delivered in the corresponding event asynchronously.
695 * @par Sync (or) Async:
696 * This is an Asynchronous API.
698 * @par Important Notes:
705 * - handle from tel_init().
707 * @param [in] callback
708 * - To register callback function for result.
710 * @param [in] user_data
711 * - user_data for user specification.
714 * @par Async Response Message:
715 * The event associated is TAPI_EVENT_NETWORK_GETPREFFPLMN_CNF and event data associated with this event is #TelNetworkPreferredPlmnList_t
716 * and asynchronous return status is indicated by #TelNetworkOperationCause_t.
719 * - A dbus connection is established with #tel_init
720 * - The application name is registered with #tel_register_app_name
721 * - The application is registered events to listen asynchronous response with #tel_register_event
722 * - A event loop is running to listen events
727 * @return Return Type (int) \n
728 * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n
729 * - Refer #TapiResult_t for failure and error code
730 * @par Prospective Clients:
734 * #include <ITapiNetwork.h>
739 * // GET NETWORK PREFERRED PLMN
740 * ret_status = tel_get_network_preferred_plmn(&RequestId);
753 /*================================================================================================*/
754 int tel_get_network_preferred_plmn(TapiHandle *handle, tapi_response_cb callback, void *user_data);
758 * @brief This function is called to cancel the triggered manual network search.
760 * @par Sync (or) Async:
761 * This is an Asynchronous API.
763 * @par Important Notes:
770 * - handle from tel_init().
772 * @param [in] callback
773 * - To register callback function for result.
775 * @param [in] user_data
776 * - user_data for user specification.
778 * @par Async Response Message:
779 * The event associated is TAPI_EVENT_NETWORK_CANCELMANUALSEARCH_CNF and there is no event data associated with this event
780 * and asynchronous return status is indicated by #TelNetworkOperationCause_t.
783 * - Manual network search is already triggered.
788 * @return Return Type (int) \n
789 * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n
790 * - Refer #TapiResult_t for failure and error code
792 * @par Prospective Clients:
797 /*================================================================================================*/
798 int tel_cancel_network_manual_search(TapiHandle *handle, tapi_response_cb callback, void *user_data);
801 * @brief This function is called to get network serving.
803 * @par Sync (or) Async:
804 * This is an Asynchronous API.
806 * @par Important Notes:
813 * - handle from tel_init().
815 * @param [in] callback
816 * - To register callback function for result.
818 * @param [in] user_data
819 * - user_data for user specification.
821 * @par Async Response Message:
822 * The event associated is TAPI_EVENT_NETWORK_CANCELMANUALSEARCH_CNF and there is no event data associated with this event
823 * and asynchronous return status is indicated by #TelNetworkOperationCause_t.
830 * @return Return Type (int) \n
831 * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n
832 * - Refer #TapiResult_t for failure and error code
834 * @par Prospective Clients:
838 /*================================================================================================*/
839 int tel_get_network_serving(TapiHandle *handle, tapi_response_cb callback, void *user_data);
842 * @brief This function is called to set network mode.
844 * @par Sync (or) Async:
845 * This is an Asynchronous API.
847 * @par Important Notes:
854 * - handle from tel_init().
858 * @param [in] callback
859 * - To register callback function for result.
861 * @param [in] user_data
862 * - user_data for user specification.
864 * @par Async Response Message:
865 * The event associated is TAPI_EVENT_NETWORK_CANCELMANUALSEARCH_CNF and there is no event data associated with this event
866 * and asynchronous return status is indicated by #TelNetworkOperationCause_t.
873 * @return Return Type (int) \n
874 * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n
875 * - Refer #TapiResult_t for failure and error code
877 * @par Prospective Clients:
881 /*================================================================================================*/
882 int tel_set_network_mode(TapiHandle *handle, int mode, tapi_response_cb callback, void *user_data);
885 * @brief This function is called to get network mode.
887 * @par Sync (or) Async:
888 * This is an Asynchronous API.
890 * @par Important Notes:
897 * - handle from tel_init().
899 * @param [in] callback
900 * - To register callback function for result.
902 * @param [in] user_data
903 * - user_data for user specification.
905 * @par Async Response Message:
906 * The event associated is TAPI_EVENT_NETWORK_CANCELMANUALSEARCH_CNF and there is no event data associated with this event
907 * and asynchronous return status is indicated by #TelNetworkOperationCause_t.
914 * @return Return Type (int) \n
915 * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n
916 * - Refer #TapiResult_t for failure and error code
918 * @par Prospective Clients:
922 /*================================================================================================*/
923 int tel_get_network_mode(TapiHandle *handle, tapi_response_cb callback, void *user_data);
926 * @brief This function is called to get neighboring cell info.
928 * @par Sync (or) Async:
929 * This is an Asynchronous API.
931 * @par Important Notes:
938 * - handle from tel_init().
940 * @param [in] callback
941 * - To register callback function for result.
943 * @param [in] user_data
944 * - user_data for user specification.
946 * @par Async Response Message:
947 * - The event data is #TelNetworkNeighboringCellInfo_t.
954 * @return Return Type (int) \n
955 * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n
956 * - Refer #TapiResult_t for failure and error code
958 * @par Prospective Clients:
962 /*================================================================================================*/
963 int tel_get_network_neighboring_cell_info(TapiHandle *handle, tapi_response_cb callback, void *user_data);
969 #endif /* _ITAPI_NETWORK_H_ */