Fixed typo in error message.
[gsmd2.git] / src / network_interface.h
blob0b85fb9617a24507a0eeb0ec97cff2afb7bbb1de
1 /*
2 * network_interface.h
4 * Copyright(C) 2007,2008 Ixonos Plc
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2, or (at your option)
9 * any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Boston, MA 02111.
22 * Written by
23 * Jukka Honkela
24 * Yi Zheng
25 * Matti Katila
26 * Vesa Pikki
27 * Heikki Paajanen
31 #ifndef NETWORK_INTERFACE
32 #define NETWORK_INTERFACE
34 typedef struct _NetworkInterface NetworkInterface;
37 typedef struct _NetworkProvider {
38 gint index;
39 gchar *status;
40 gchar *name;
41 gchar *nickname;
42 } NetworkProvider;
44 /**
45 * @brief Network interface
47 struct _NetworkInterface {
48 gpointer priv;
50 /**
51 * @brief Provider's name
53 GString *provider_name;
55 /**
56 * @brief Provider status
58 GString *status;
62 //TODO remove these/modify them to comply with freesmartphone's xml/modify freesmartphone's xml
63 void (*set_operator) (NetworkInterface *network,
64 gpointer ipc_data,
65 const char* operator,
66 gboolean locked);
67 void (*query_current_operator) (NetworkInterface *network,
68 gpointer ipc_data);
69 void (*query_signal_strength) (NetworkInterface *network,
70 gpointer ipc_data);
72 /**
73 * @brief Registers to network
75 * @param modem pointer to modem struct
76 * @param ipc_data ipc data
78 void (*register_network) (NetworkInterface *network,
79 gpointer ipc_data);
81 /**
82 * @brief Unregisters from network
84 * @param modem pointer to modem struct
85 * @param ipc_data ipc data
87 void (*unregister) (NetworkInterface *network,
88 gpointer ipc_data);
90 /**
91 * @brief Gets network status
93 * @param modem pointer to modem struct
94 * @param ipc_data ipc data
96 void (*get_status) (NetworkInterface *network,
97 gpointer ipc_data);
99 /**
100 * @brief Lists providers
102 * @param modem pointer to modem struct
103 * @param ipc_data ipc data
105 void (*list_providers) (NetworkInterface *network,
106 gpointer ipc_data);
109 * @brief Registers with provider
111 * @param modem pointer to modem struct
112 * @param ipc_data ipc data
113 * @param index provider's index
115 void (*register_with_provider) (NetworkInterface *network,
116 gpointer ipc_data,
117 int index);
121 * @brief Get country code
123 * @param modem pointer to modem struct
124 * @param ipc_data ipc data
125 * @param index provider's index
127 void (*get_country_code) (NetworkInterface *network,
128 gpointer ipc_data);
136 typedef struct _NetworkIPCInterface NetworkIPCInterface;
138 struct _NetworkIPCInterface {
140 gpointer priv;
143 /*********************Replies to methods*****************/
146 * @brief Reply to "register_network" method call
148 * @param modem pointer to modem struct
149 * @param ipc_data ipc data
151 void (*register_network_reply) (NetworkIPCInterface *network_ipc,
152 gpointer ipc_data);
155 * @brief Reply to "unregister" method call
157 * @param modem pointer to modem struct
158 * @param ipc_data ipc data
160 void (*unregister_reply) (NetworkIPCInterface *network_ipc,
161 gpointer ipc_data);
164 * @brief Reply to "get_status" method call
166 * @param modem pointer to modem struct
167 * @param ipc_data ipc data
168 * @param provider_name
169 * @param status
170 * @param strength
172 void (*get_status_reply) (NetworkIPCInterface *network_ipc,
173 gpointer ipc_data,
174 GHashTable *status);
177 * @brief Reply to "list_providers" method call
179 * @param modem pointer to modem struct
180 * @param ipc_data ipc data
181 * @param providers list of network providers
183 void (*list_providers_reply) (NetworkIPCInterface *network_ipc,
184 gpointer ipc_data,
185 GArray *providers);
188 * @brief Reply to "register_with_provider" method call
190 * @param modem pointer to modem struct
191 * @param ipc_data ipc data
193 void (*register_with_provider_reply) (NetworkIPCInterface *network_ipc,
194 gpointer ipc_data);
198 * @brief Reply to "get_country_code" method call
200 * @param modem pointer to modem struct
201 * @param ipc_data ipc data
203 void (*get_country_code_reply) (NetworkIPCInterface *network_ipc,
204 gpointer ipc_data,
205 const gchar *dial_code);
211 /*********************Method errors**********************************/
214 * @brief Error reply to "register_network" method call
216 * @param modem pointer to modem struct
217 * @param ipc_data ipc data
219 void (*register_network_error) (NetworkIPCInterface *network_ipc,
220 gpointer ipc_data,
221 GError *error);
224 * @brief Error reply to "unregister" method call
226 * @param modem pointer to modem struct
227 * @param ipc_data ipc data
229 void (*unregister_error) (NetworkIPCInterface *network_ipc,
230 gpointer ipc_data,
231 GError *error);
234 * @brief Error reply to "get_status" method call
236 * @param modem pointer to modem struct
237 * @param ipc_data ipc data
239 void (*get_status_error) (NetworkIPCInterface *network_ipc,
240 gpointer ipc_data,
241 GError *error);
244 * @brief Error reply to "list_providers" method call
246 * @param modem pointer to modem struct
247 * @param ipc_data ipc data
249 void (*list_providers_error) (NetworkIPCInterface *network_ipc,
250 gpointer ipc_data,
251 GError *error);
254 * @brief Error reply to "register_with_provider" method call
256 * @param modem pointer to modem struct
257 * @param ipc_data ipc data
259 void (*register_with_provider_error) (NetworkIPCInterface *network_ipc,
260 gpointer ipc_data,
261 GError *error);
264 * @brief Error reply to "get_country_code" method call
266 * @param modem pointer to modem struct
267 * @param ipc_data ipc data
269 void (*get_country_code_error) (NetworkIPCInterface *network_ipc,
270 gpointer ipc_data,
271 GError *error);
276 /*********************Signals**********************************/
278 * @brief Status signal
280 * @param modem pointer to modem struct
281 * @param provider_name
282 * @param status
283 * @param strength signal strength
285 void (*status) (NetworkIPCInterface *network_ipc,
286 GHashTable *status);
289 * @brief Subscriber numbers
291 * @param modem pointer to modem struct
292 * @param number
294 void (*subscriber_numbers) (NetworkIPCInterface *network_ipc,
295 const char **number);
300 #endif