78c63c073aaee4db422152b9dc88ac2bb5e115a0
[framework/telephony/libtcore.git] / include / co_network.h
1 /*
2  * libtcore
3  *
4  * Copyright (c) 2012 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 #ifndef __TCORE_CO_NETWORK_H__
22 #define __TCORE_CO_NETWORK_H__
23
24 #include <core_object.h>
25
26 __BEGIN_DECLS
27
28
29 enum tcore_network_service_domain_type {
30         TCORE_NETWORK_SERVICE_DOMAIN_TYPE_CIRCUIT,
31         TCORE_NETWORK_SERVICE_DOMAIN_TYPE_PACKET
32 };
33
34 enum tcore_network_name_type {
35         TCORE_NETWORK_NAME_TYPE_SHORT,
36         TCORE_NETWORK_NAME_TYPE_FULL,
37         TCORE_NETWORK_NAME_TYPE_SPN,
38 };
39
40 enum tcore_network_name_priority {
41         TCORE_NETWORK_NAME_PRIORITY_UNKNOWN,
42         TCORE_NETWORK_NAME_PRIORITY_NETWORK,
43         TCORE_NETWORK_NAME_PRIORITY_SPN,
44         TCORE_NETWORK_NAME_PRIORITY_ANY,
45 };
46
47 struct tcore_network_operator_info {
48         char mcc[4];
49         char mnc[4];
50         char name[41];
51         char country[4];
52 };
53
54 struct tcore_network_operations {
55         TReturn (*search)(CoreObject *o, UserRequest *ur);
56         TReturn (*set_plmn_selection_mode)(CoreObject *o, UserRequest *ur);
57         TReturn (*get_plmn_selection_mode)(CoreObject *o, UserRequest *ur);
58         TReturn (*set_service_domain)(CoreObject *o, UserRequest *ur);
59         TReturn (*get_service_domain)(CoreObject *o, UserRequest *ur);
60         TReturn (*set_band)(CoreObject *o, UserRequest *ur);
61         TReturn (*get_band)(CoreObject *o, UserRequest *ur);
62         TReturn (*set_preferred_plmn)(CoreObject *o, UserRequest *ur);
63         TReturn (*get_preferred_plmn)(CoreObject *o, UserRequest *ur);
64         TReturn (*set_order)(CoreObject *o, UserRequest *ur);
65         TReturn (*get_order)(CoreObject *o, UserRequest *ur);
66         TReturn (*set_power_on_attach)(CoreObject *o, UserRequest *ur);
67         TReturn (*get_power_on_attach)(CoreObject *o, UserRequest *ur);
68         TReturn (*set_cancel_manual_search)(CoreObject *o, UserRequest *ur);
69         TReturn (*get_serving_network)(CoreObject *o, UserRequest *ur);
70         TReturn (*set_mode)(CoreObject *o, UserRequest *ur);
71         TReturn (*get_mode)(CoreObject *o, UserRequest *ur);
72 };
73
74
75 CoreObject* tcore_network_new(TcorePlugin *plugin, const char *name,
76                 struct tcore_network_operations *ops, TcoreHal *hal);
77 void        tcore_network_free(CoreObject *co);
78
79 TReturn     tcore_network_set_plmn(CoreObject *co, const char *plmn);
80 char*       tcore_network_get_plmn(CoreObject *co);
81
82 TReturn     tcore_network_set_network_name(CoreObject *co,
83                 enum tcore_network_name_type type, const char *network_name);
84 char*       tcore_network_get_network_name(CoreObject *co,
85                 enum tcore_network_name_type type);
86
87 TReturn     tcore_network_set_network_name_priority(CoreObject *co,
88                 enum tcore_network_name_priority priority);
89 TReturn     tcore_network_get_network_name_priority(CoreObject *co,
90                 enum tcore_network_name_priority *priority);
91
92 TReturn     tcore_network_set_roaming_state(CoreObject *co, gboolean state);
93 gboolean    tcore_network_get_roaming_state(CoreObject *co);
94
95 TReturn     tcore_network_set_service_status(CoreObject *co,
96                 enum tcore_network_service_domain_type type,
97                 enum telephony_network_service_domain_status status);
98 TReturn     tcore_network_get_service_status(CoreObject *co,
99                 enum tcore_network_service_domain_type type,
100                 enum telephony_network_service_domain_status *result);
101
102 TReturn     tcore_network_set_access_technology(CoreObject *co,
103                 enum telephony_network_access_technology act);
104 TReturn     tcore_network_get_access_technology(CoreObject *co,
105                 enum telephony_network_access_technology *result);
106
107 TReturn     tcore_network_set_lac(CoreObject *co, unsigned int lac);
108 TReturn     tcore_network_get_lac(CoreObject *co, unsigned int *result);
109
110 TReturn     tcore_network_set_rac(CoreObject *co, unsigned int rac);
111 TReturn     tcore_network_get_rac(CoreObject *co, unsigned int *result);
112
113 TReturn     tcore_network_set_cell_id(CoreObject *co, unsigned int cell_id);
114 TReturn     tcore_network_get_cell_id(CoreObject *co, unsigned int *result);
115
116 TReturn     tcore_network_set_service_type(CoreObject *co,
117                 enum telephony_network_service_type service_type);
118 TReturn     tcore_network_get_service_type(CoreObject *co,
119                 enum telephony_network_service_type *result);
120
121 TReturn     tcore_network_operator_info_add(CoreObject *co,
122                 struct tcore_network_operator_info *noi);
123
124 struct tcore_network_operator_info*
125             tcore_network_operator_info_find(CoreObject *co,
126                 const char *mcc, const char *mnc);
127
128 __END_DECLS
129
130 #endif