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)
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.
31 #ifndef NETWORK_INTERFACE
32 #define NETWORK_INTERFACE
34 typedef struct _NetworkInterface NetworkInterface
;
37 typedef struct _NetworkProvider
{
45 * @brief Network interface
47 struct _NetworkInterface
{
51 * @brief Provider's name
53 GString
*provider_name
;
56 * @brief Provider status
62 //TODO remove these/modify them to comply with freesmartphone's xml/modify freesmartphone's xml
63 void (*set_operator
) (NetworkInterface
*network
,
67 void (*query_current_operator
) (NetworkInterface
*network
,
69 void (*query_signal_strength
) (NetworkInterface
*network
,
73 * @brief Registers to network
75 * @param modem pointer to modem struct
76 * @param ipc_data ipc data
78 void (*register_network
) (NetworkInterface
*network
,
82 * @brief Unregisters from network
84 * @param modem pointer to modem struct
85 * @param ipc_data ipc data
87 void (*unregister
) (NetworkInterface
*network
,
91 * @brief Gets network status
93 * @param modem pointer to modem struct
94 * @param ipc_data ipc data
96 void (*get_status
) (NetworkInterface
*network
,
100 * @brief Lists providers
102 * @param modem pointer to modem struct
103 * @param ipc_data ipc data
105 void (*list_providers
) (NetworkInterface
*network
,
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
,
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
,
136 typedef struct _NetworkIPCInterface NetworkIPCInterface
;
138 struct _NetworkIPCInterface
{
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
,
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
,
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
172 void (*get_status_reply
) (NetworkIPCInterface
*network_ipc
,
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
,
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
,
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
,
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
,
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
,
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
,
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
,
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
,
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
,
276 /*********************Signals**********************************/
278 * @brief Status signal
280 * @param modem pointer to modem struct
281 * @param provider_name
283 * @param strength signal strength
285 void (*status
) (NetworkIPCInterface
*network_ipc
,
289 * @brief Subscriber numbers
291 * @param modem pointer to modem struct
294 void (*subscriber_numbers
) (NetworkIPCInterface
*network_ipc
,
295 const char **number
);