tizen 2.3.1 release
[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  * Manual PLMN property
30  *
31  * Value: MCC+MNC or Empty(Unknown mode)
32  */
33 #define PROP_NET_MANUAL_PLMN  "manual_plmn"
34
35 /*
36  * Manual Selection status property
37  *
38  * Value: 'waiting' / 'success' / 'failure' / Empty(Unknown state)
39  */
40 #define PROP_NET_MANUAL_SELECTION_STATUS  "manual_selection_status"
41
42 /*
43  * Network Registration Reject Cause Property
44  *
45  * Value: LU registration reject cause strings
46  */
47 #define PROP_NET_REG_LU_REJECT_CAUSE  "reg_reject_cause"
48
49 /*
50  * Read mdn Property
51  *
52  * Value: mdn strings
53  */
54 #define PROP_NET_READ_MDN_FOR_ACTIVATION  "mdn_for_activation"
55
56 /*
57  * Read pESN Property
58  *
59  * Value: pESN strings
60  */
61 #define PROP_MODEM_READ_ESN_FOR_ACTIVATION  "esn_for_activation"
62
63
64
65 enum tcore_network_service_domain_type {
66         TCORE_NETWORK_SERVICE_DOMAIN_TYPE_CIRCUIT,
67         TCORE_NETWORK_SERVICE_DOMAIN_TYPE_PACKET
68 };
69
70 enum tcore_network_name_type {
71         TCORE_NETWORK_NAME_TYPE_SHORT,
72         TCORE_NETWORK_NAME_TYPE_FULL,
73         TCORE_NETWORK_NAME_TYPE_SPN,
74 };
75
76 enum tcore_network_name_priority {
77         TCORE_NETWORK_NAME_PRIORITY_UNKNOWN,
78         TCORE_NETWORK_NAME_PRIORITY_NETWORK,
79         TCORE_NETWORK_NAME_PRIORITY_SPN,
80         TCORE_NETWORK_NAME_PRIORITY_ANY,
81 };
82
83 enum tcore_network_operator_info_type {
84         TCORE_NETWORK_OPERATOR_INFO_TYPE_TS25_DB = 0,
85         TCORE_NETWORK_OPERATOR_INFO_TYPE_DELTA_DB,
86         TCORE_NETWORK_OPERATOR_INFO_TYPE_NITZ,
87         TCORE_NETWORK_OPERATOR_INFO_TYPE_EONS,
88 };
89
90 struct tcore_network_operator_info {
91         enum tcore_network_operator_info_type type;
92         char mcc[4];
93         char mnc[4];
94         char name[41];
95         char country[4];
96 };
97
98 struct tcore_network_operations {
99         TReturn (*search)(CoreObject *o, UserRequest *ur);
100         TReturn (*set_plmn_selection_mode)(CoreObject *o, UserRequest *ur);
101         TReturn (*get_plmn_selection_mode)(CoreObject *o, UserRequest *ur);
102         TReturn (*set_service_domain)(CoreObject *o, UserRequest *ur);
103         TReturn (*get_service_domain)(CoreObject *o, UserRequest *ur);
104         TReturn (*set_band)(CoreObject *o, UserRequest *ur);
105         TReturn (*get_band)(CoreObject *o, UserRequest *ur);
106         TReturn (*set_preferred_plmn)(CoreObject *o, UserRequest *ur);
107         TReturn (*get_preferred_plmn)(CoreObject *o, UserRequest *ur);
108         TReturn (*set_order)(CoreObject *o, UserRequest *ur);
109         TReturn (*get_order)(CoreObject *o, UserRequest *ur);
110         TReturn (*set_power_on_attach)(CoreObject *o, UserRequest *ur);
111         TReturn (*get_power_on_attach)(CoreObject *o, UserRequest *ur);
112         TReturn (*set_cancel_manual_search)(CoreObject *o, UserRequest *ur);
113         TReturn (*get_serving_network)(CoreObject *o, UserRequest *ur);
114         TReturn (*set_mode)(CoreObject *o, UserRequest *ur);
115         TReturn (*get_mode)(CoreObject *o, UserRequest *ur);
116         TReturn (*set_neighboring_cell_info)(CoreObject *o, UserRequest *ur);
117         TReturn (*get_neighboring_cell_info)(CoreObject *o, UserRequest *ur);
118         TReturn (*set_default_data_subscription)(CoreObject *o, UserRequest *ur);
119         TReturn (*get_default_data_subscription)(CoreObject *o, UserRequest *ur);
120         TReturn (*set_default_subscription)(CoreObject *o, UserRequest *ur);
121         TReturn (*get_default_subscription)(CoreObject *o, UserRequest *ur);
122         TReturn (*set_emergency_callback_mode)(CoreObject *o, UserRequest *ur); /* 3GPP2 spcefic */
123         TReturn (*set_roaming_preference)(CoreObject *o, UserRequest *ur); /* 3GPP2 spcefic */
124         TReturn (*get_roaming_preference)(CoreObject *o, UserRequest *ur); /* 3GPP2 spcefic */
125         TReturn (*get_subscription_info)(CoreObject *o, UserRequest *ur); /* 3GPP2 spcefic */
126 };
127
128
129 CoreObject* tcore_network_new(TcorePlugin *plugin, const char *name,
130                 struct tcore_network_operations *ops, TcoreHal *hal);
131 void        tcore_network_free(CoreObject *co);
132
133 void tcore_network_set_ops(CoreObject *co, struct tcore_network_operations *ops);
134
135 TReturn     tcore_network_set_plmn(CoreObject *co, const char *plmn);
136 char*       tcore_network_get_plmn(CoreObject *co);
137
138 TReturn     tcore_network_set_network_name(CoreObject *co,
139                 enum tcore_network_name_type type, const char *network_name);
140 char*       tcore_network_get_network_name(CoreObject *co,
141                 enum tcore_network_name_type type);
142
143 TReturn     tcore_network_set_network_name_priority(CoreObject *co,
144                 enum tcore_network_name_priority priority);
145 TReturn     tcore_network_get_network_name_priority(CoreObject *co,
146                 enum tcore_network_name_priority *priority);
147
148 TReturn     tcore_network_set_roaming_state(CoreObject *co, gboolean state);
149 gboolean    tcore_network_get_roaming_state(CoreObject *co);
150
151 TReturn     tcore_network_set_restricted_state(CoreObject *co, int state);
152 int         tcore_network_get_restricted_state(CoreObject *co);
153
154 TReturn     tcore_network_set_service_status(CoreObject *co,
155                 enum tcore_network_service_domain_type type,
156                 enum telephony_network_service_domain_status status);
157 TReturn     tcore_network_get_service_status(CoreObject *co,
158                 enum tcore_network_service_domain_type type,
159                 enum telephony_network_service_domain_status *result);
160
161 TReturn     tcore_network_set_access_technology(CoreObject *co,
162                 enum telephony_network_access_technology act);
163 TReturn     tcore_network_get_access_technology(CoreObject *co,
164                 enum telephony_network_access_technology *result);
165
166 TReturn     tcore_network_set_lac(CoreObject *co, unsigned int lac);
167 TReturn     tcore_network_get_lac(CoreObject *co, unsigned int *result);
168
169 TReturn     tcore_network_set_rac(CoreObject *co, unsigned int rac);
170 TReturn     tcore_network_get_rac(CoreObject *co, unsigned int *result);
171
172 TReturn     tcore_network_set_cell_id(CoreObject *co, unsigned int cell_id);
173 TReturn     tcore_network_get_cell_id(CoreObject *co, unsigned int *result);
174
175 TReturn         tcore_network_set_gsm_dtm_support(CoreObject *co, gboolean state);
176 gboolean        tcore_network_get_gsm_dtm_support(CoreObject *co);
177
178 TReturn     tcore_network_set_service_type(CoreObject *co,
179                 enum telephony_network_service_type service_type);
180 TReturn     tcore_network_get_service_type(CoreObject *co,
181                 enum telephony_network_service_type *result);
182
183 TReturn     tcore_network_operator_info_add(CoreObject *co,
184                 const struct tcore_network_operator_info *noi);
185
186 struct tcore_network_operator_info*
187             tcore_network_operator_info_find(CoreObject *co,
188                 const char *mcc, const char *mnc);
189
190 __END_DECLS
191
192 #endif