Remove 'reserved (wifi ap)' type
[platform/core/api/tethering.git] / include / tethering.h
1 /*
2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17 #ifndef __TIZEN_NETWORK_TETHERING_H__
18 #define __TIZEN_NETWORK_TETHERING_H__
19
20 #include <tizen.h>
21 #include <time.h>
22
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26
27 /**
28  * @file tethering.h
29  */
30
31 /**
32  * @addtogroup CAPI_NETWORK_TETHERING_MANAGER_MODULE
33  * @{
34  */
35
36 /**
37  * @brief The tethering handle.
38  * @since_tizen 2.3
39  */
40 typedef void * tethering_h;
41
42 /**
43  * @brief Enumeration for the tethering.
44  * @since_tizen 2.3
45  */
46 typedef enum {
47     TETHERING_ERROR_NONE = TIZEN_ERROR_NONE,  /**< Successful */
48     TETHERING_ERROR_NOT_PERMITTED = TIZEN_ERROR_NOT_PERMITTED,  /**< Operation not permitted */
49     TETHERING_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER,  /**< Invalid parameter */
50     TETHERING_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY,  /**< Out of memory */
51     TETHERING_ERROR_RESOURCE_BUSY = TIZEN_ERROR_RESOURCE_BUSY,  /**< Resource busy */
52     TETHERING_ERROR_NOT_ENABLED = TIZEN_ERROR_TETHERING | 0x0501,  /**< Not enabled */
53     TETHERING_ERROR_OPERATION_FAILED = TIZEN_ERROR_TETHERING | 0x0502,  /**< Operation failed */
54     TETHERING_ERROR_INVALID_OPERATION = TIZEN_ERROR_INVALID_OPERATION, /**< Invalid operation */
55     TETHERING_ERROR_NOT_SUPPORT_API = TIZEN_ERROR_NOT_SUPPORTED, /**< API is not supported */
56     TETHERING_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED,  /**< Permission denied */
57 } tethering_error_e;
58
59 /**
60  * @brief Enumeration for the type of tethering.
61  * @since_tizen 2.3
62  */
63 typedef enum {
64     TETHERING_TYPE_ALL = 0,  /**< All type */
65     TETHERING_TYPE_USB,  /**< USB type */
66     TETHERING_TYPE_WIFI,  /**< Wi-Fi type */
67     TETHERING_TYPE_BT,  /**< BT type */
68 } tethering_type_e;
69
70 /**
71  * @brief Enumeration for the cause of disabling the tethering.
72  * @since_tizen 2.3
73  */
74 typedef enum
75 {
76     TETHERING_DISABLED_BY_USB_DISCONNECTION = 0,  /**< Disabled due to usb disconnection */
77     TETHERING_DISABLED_BY_FLIGHT_MODE,  /**< Disabled due to flight mode */
78     TETHERING_DISABLED_BY_LOW_BATTERY,  /**< Disabled due to low battery */
79     TETHERING_DISABLED_BY_NETWORK_CLOSE,  /**< Disabled due to pdp network close */
80     TETHERING_DISABLED_BY_TIMEOUT,  /**< Disabled due to timeout */
81     TETHERING_DISABLED_BY_OTHERS,  /**< Disabled by other apps */
82     TETHERING_DISABLED_BY_REQUEST,  /**< Disabled by your request */
83     TETHERING_DISABLED_BY_WIFI_ON,  /**< Disabled due to Wi-Fi on */
84     TETHERING_DISABLED_BY_BT_OFF,  /**< Disabled due to Bluetooth off */
85 } tethering_disabled_cause_e;
86
87 /**
88  * @}
89  */
90
91
92 /**
93  * @addtogroup CAPI_NETWORK_TETHERING_WIFI_MODULE
94  * @{
95  */
96
97 /**
98  * @brief Enumeration for the Wi-Fi security.
99  * @since_tizen 2.3
100  */
101 typedef enum {
102     TETHERING_WIFI_SECURITY_TYPE_NONE = 0,  /**< No Security type */
103     TETHERING_WIFI_SECURITY_TYPE_WPA2_PSK,  /**< WPA2_PSK */
104 } tethering_wifi_security_type_e;
105
106 /**
107   * @brief Enumeration for the Wi-Fi mode
108   * @since_tizen 3.0
109   */
110 typedef enum {
111         TETHERING_WIFI_MODE_TYPE_B = 0,  /**< mode b */
112         TETHERING_WIFI_MODE_TYPE_G,  /**< mode g */
113         TETHERING_WIFI_MODE_TYPE_A,  /**< mode a */
114         TETHERING_WIFI_MODE_TYPE_AD, /**< mode ad */
115 } tethering_wifi_mode_type_e;
116
117 /**
118  * @}
119  */
120
121
122 /**
123  * @addtogroup CAPI_NETWORK_TETHERING_CLIENT_MODULE
124  * @{
125  */
126
127 /**
128  * @brief The tethering client handle.
129  * @since_tizen 2.3
130  */
131 typedef void * tethering_client_h;
132
133 /**
134  * @brief Enumeration for address family.
135  * @since_tizen 2.3
136  */
137 typedef enum {
138     TETHERING_ADDRESS_FAMILY_IPV4 = 0,  /**< IPV4 Address type */
139 } tethering_address_family_e;
140
141 /**
142  * @}
143  */
144
145
146 /**
147  * @addtogroup CAPI_NETWORK_TETHERING_MANAGER_MODULE
148  * @{
149  */
150
151 /**
152  * @brief Called when the tethering is enabled.
153  * @since_tizen 2.3
154  * @param[in]  result  The result of enabling the tethering
155  * @param[in]  type  The tethering type
156  * @param[in]  is_requested  Indicates whether this change is requested
157  * @param[in]  user_data  The user data passed from tethering_set_enabled_cb()
158  * @pre  If you register callback function using tethering_set_enabled_cb(), this will be invoked when the tethering is enabled.
159  * @see tethering_enable()
160  * @see tethering_unset_enabled_cb()
161  */
162 typedef void (*tethering_enabled_cb)(tethering_error_e result, tethering_type_e type, bool is_requested, void *user_data);
163
164 /**
165  * @brief Called when the tethering is disabled.
166  * @since_tizen 2.3
167  * @param[in]  result  The result of disabling the tethering
168  * @param[in]  type  The tethering type
169  * @param[in]  cause  The cause of disabling
170  * @param[in]  user_data  The user data passed from tethering_set_disabled_cb()
171  * @pre  If you register callback function using tethering_set_disabled_cb(), this will be invoked when the tethering is disabled.
172  * @see tethering_set_disabled_cb()
173  * @see tethering_unset_disabled_cb()
174  */
175 typedef void (*tethering_disabled_cb)(tethering_error_e result, tethering_type_e type, tethering_disabled_cause_e cause, void *user_data);
176
177 /**
178  * @brief Called when the connection state is changed.
179  * @since_tizen 2.3
180  * @remarks @a client is valid only in this function. In order to use it outside this function, a user must copy the client with tethering_client_clone().
181  * @param[in]  client  The client of which connection state is changed
182  * @param[in]  opened  @c true when connection is opened, otherwise false
183  * @param[in]  user_data  The user data passed from tethering_set_connection_state_changed_cb()
184  * @pre  If you register callback function using tethering_set_connection_state_changed_cb(), this will be invoked when the connection state is changed.
185  * @see tethering_set_connection_state_changed_cb()
186  * @see tethering_unset_connection_state_changed_cb()
187  */
188 typedef void (*tethering_connection_state_changed_cb)(tethering_client_h client, bool opened, void *user_data);
189
190 /**
191  * @brief Called when you get the connected client repeatedly.
192  * @since_tizen 2.3
193  * @remarks @a client is valid only in this function. In order to use the client outside this function, a user must copy the client with tethering_client_clone().
194  * @param[in]  client  The connected client
195  * @param[in]  user_data  The user data passed from the request function
196  * @return  @c true to continue with the next iteration of the loop, \n @c false to break out of the loop
197  * @pre  tethering_foreach_connected_clients() will invoke this callback.
198  * @see  tethering_foreach_connected_clients()
199  */
200 typedef bool(*tethering_connected_client_cb)(tethering_client_h client, void *user_data);
201
202 /**
203  * @brief Called when you get the data usage.
204  * @since_tizen 2.3
205  * @param[in]  result  The result of getting the data usage
206  * @param[in]  received_data  The usage of received data
207  * @param[in]  sent_data  The usage of sent data
208  * @param[in]  user_data  The user data passed from the request function
209  * @pre  tethering_get_data_usage() will invoked this callback.
210  */
211 typedef void (*tethering_data_usage_cb)(tethering_error_e result, unsigned long long received_data, unsigned long long sent_data, void *user_data);
212
213 /**
214  * @brief Called when the security type of Wi-Fi tethering is changed.
215  * @since_tizen 2.3
216  * @param[in]  changed_type  The changed security type of Wi-Fi tethering
217  * @param[in]  user_data  The user data passed from the register function
218  * @see tethering_wifi_set_security_type_changed_cb()
219  * @see tethering_wifi_unset_security_type_changed_cb()
220  */
221 typedef void (*tethering_wifi_security_type_changed_cb)(tethering_wifi_security_type_e changed_type, void *user_data);
222
223 /**
224  * @brief Called when the visibility of SSID is changed.
225  * @since_tizen 2.3
226  * @param[in]  changed_visible  The changed visibility of SSID
227  * @param[in]  user_data  The user data passed from the register function
228  * @see tethering_wifi_set_ssid_visibility_changed_cb()
229  * @see tethering_wifi_unset_ssid_visibility_changed_cb()
230  */
231 typedef void (*tethering_wifi_ssid_visibility_changed_cb)(bool changed_visible, void *user_data);
232
233 /**
234  * @brief Called when the passphrase of Wi-Fi tethering is changed.
235  * @since_tizen 2.3
236  * @param[in]  user_data  The user data passed from the register function
237  * @see tethering_wifi_set_passphrase_changed_cb()
238  * @see tethering_wifi_unset_passphrase_changed_cb()
239  */
240 typedef void (*tethering_wifi_passphrase_changed_cb)(void *user_data);
241
242 /**
243  * @brief Called when the settings are reloaded.
244  * @since_tizen 2.3
245  * @param[in]  result  The result of reloading the settings
246  * @param[in]  user_data  The user data passed from the request function
247  * @pre  tethering_wifi_reload_settings() will invoke this callback.
248  */
249 typedef void (*tethering_wifi_settings_reloaded_cb)(tethering_error_e result, void *user_data);
250
251 /**
252  * @brief Creates the handle for tethering.
253  * @since_tizen 2.3
254  * @privlevel platform
255  * @privilege %http://tizen.org/privilege/tethering.admin
256  * @remarks The @a tethering must be released using tethering_destroy().
257  * @param[out]  tethering  A handle of a new mobile ap handle on success
258  * @return  0 on success, otherwise a negative error value
259  * @retval  #TETHERING_ERROR_NONE  Successful
260  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
261  * @retval  #TETHERING_ERROR_OUT_OF_MEMORY  Out of memory
262  * @retval  #TETHERING_ERROR_NOT_SUPPORT_API  API is not supported
263  * @see  tethering_destroy()
264  */
265 int tethering_create(tethering_h *tethering);
266
267 /**
268  * @brief Destroys the handle for tethering.
269  * @since_tizen 2.3
270  * @privlevel platform
271  * @privilege %http://tizen.org/privilege/tethering.admin
272  * @param[in]  tethering  The tethering handle
273  * @return  0 on success, otherwise a negative error value
274  * @retval  #TETHERING_ERROR_NONE  Successful
275  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
276  * @see  tethering_create()
277  */
278 int tethering_destroy(tethering_h tethering);
279
280 /**
281  * @brief Enables the tethering, asynchronously.
282  * @since_tizen 2.3
283  * @privlevel platform
284  * @privilege %http://tizen.org/privilege/tethering.admin
285  * @param[in]  tethering  The tethering handle
286  * @param[in]  type  The tethering type
287  * @return 0 on success, otherwise negative error value
288  * @retval  #TETHERING_ERROR_NONE  Successful
289  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
290  * @post tethering_enabled_cb() will be invoked.
291  * @see  tethering_is_enabled()
292  * @see  tethering_disable()
293  */
294 int tethering_enable(tethering_h tethering, tethering_type_e type);
295
296 /**
297  * @brief Disables the tethering, asynchronously.
298  * @since_tizen 2.3
299  * @privlevel platform
300  * @privilege %http://tizen.org/privilege/tethering.admin
301  * @param[in]  tethering  The tethering handle
302  * @param[in]  type  The tethering type
303  * @return 0 on success, otherwise negative error value
304  * @retval  #TETHERING_ERROR_NONE  Successful
305  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
306  * @post tethering_disabled_cb() will be invoked.
307  * @see  tethering_is_enabled()
308  * @see  tethering_enable()
309  */
310 int tethering_disable(tethering_h tethering, tethering_type_e type);
311
312 /**
313  * @brief Checks whether the tethering is enabled or not.
314  * @since_tizen 2.3
315  * @privlevel platform
316  * @privilege %http://tizen.org/privilege/tethering.admin
317  * @param[in]  tethering  The tethering handle
318  * @param[in]  type  The tethering type
319  * @return  @c true if tethering is enabled, \n @c false if tethering is disabled
320  */
321 bool tethering_is_enabled(tethering_h tethering, tethering_type_e type);
322
323 /**
324  * @brief Gets the MAC address of local device as "FC:A1:3E:D6:B1:B1".
325  * @since_tizen 2.3
326  * @privlevel platform
327  * @privilege %http://tizen.org/privilege/tethering.admin
328  * @remarks @a mac_address must be released using free().
329  * @param[in]  tethering  The tethering handle
330  * @param[in]  type  The tethering type
331  * @param[out]  mac_address  The MAC address
332  * @return  0 on success, otherwise a negative error value
333  * @retval  #TETHERING_ERROR_NONE  Successful
334  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
335  * @retval  #TETHERING_ERROR_OUT_OF_MEMORY  Out of memory
336  * @retval  #TETHERING_ERROR_OPERATION_FAILED  Operation failed
337  * @retval  #TETHERING_ERROR_NOT_ENABLED  Not enabled
338  * @pre  The tethering must be enabled.
339  * @see  tethering_is_enabled()
340  * @see  tethering_enable()
341  */
342 int tethering_get_mac_address(tethering_h tethering, tethering_type_e type, char **mac_address);
343
344 /**
345  * @brief Gets the name of network interface (e.g. usb0).
346  * @since_tizen 2.3
347  * @privlevel platform
348  * @privilege %http://tizen.org/privilege/tethering.admin
349  * @remarks @a interface_name must be released using free().
350  * @param[in]  tethering  The tethering handle
351  * @param[in]  type  The tethering type
352  * @param[out]  interface_name  The name of the network interface
353  * @return 0 on success, otherwise negative error value
354  * @retval  #TETHERING_ERROR_NONE  Successful
355  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
356  * @retval  #TETHERING_ERROR_OUT_OF_MEMORY  Out of memory
357  * @retval  #TETHERING_ERROR_OPERATION_FAILED  Operation failed
358  * @retval  #TETHERING_ERROR_NOT_ENABLED  Not enabled
359  * @pre  The tethering must be enabled.
360  * @see  tethering_is_enabled()
361  * @see  tethering_enable()
362  */
363 int tethering_get_network_interface_name(tethering_h tethering, tethering_type_e type, char **interface_name);
364
365 /**
366  * @brief Gets the local IP address.
367  * @since_tizen 2.3
368  * @privlevel platform
369  * @privilege %http://tizen.org/privilege/tethering.admin
370  * @remarks @a ip_address must be released using free().
371  * @param[in]  tethering  The tethering handle
372  * @param[in]  type  The tethering type
373  * @param[in]  address_family  The address family of IP address (currently, #TETHERING_ADDRESS_FAMILY_IPV4 is only supported)
374  * @param[out]  ip_address  The local IP address
375  * @return 0 on success, otherwise negative error value
376  * @retval  #TETHERING_ERROR_NONE  Successful
377  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
378  * @retval  #TETHERING_ERROR_OUT_OF_MEMORY  Out of memory
379  * @retval  #TETHERING_ERROR_OPERATION_FAILED  Operation failed
380  * @retval  #TETHERING_ERROR_NOT_ENABLED  Not enabled
381  * @pre  The tethering must be enabled.
382  * @see  tethering_is_enabled()
383  * @see  tethering_enable()
384  */
385 int tethering_get_ip_address(tethering_h tethering, tethering_type_e type, tethering_address_family_e address_family, char **ip_address);
386
387 /**
388  * @brief Gets the Gateway address.
389  * @since_tizen 2.3
390  * @privlevel platform
391  * @privilege %http://tizen.org/privilege/tethering.admin
392  * @remarks @a gateway_address must be released using free().
393  * @param[in]  tethering  The tethering handle
394  * @param[in]  type  The tethering type
395  * @param[in]  address_family  The address family of IP address (currently, #TETHERING_ADDRESS_FAMILY_IPV4 is only supported)
396  * @param[out]  gateway_address  The local IP address
397  * @return 0 on success, otherwise negative error value
398  * @retval  #TETHERING_ERROR_NONE  Successful
399  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
400  * @retval  #TETHERING_ERROR_OUT_OF_MEMORY  Out of memory
401  * @retval  #TETHERING_ERROR_OPERATION_FAILED  Operation failed
402  * @retval  #TETHERING_ERROR_NOT_ENABLED  Not enabled
403  * @pre  The tethering must be enabled.
404  * @see  tethering_is_enabled()
405  * @see  tethering_enable()
406  */
407 int tethering_get_gateway_address(tethering_h tethering, tethering_type_e type, tethering_address_family_e address_family, char **gateway_address);
408
409 /**
410  * @brief Gets the Subnet Mask.
411  * @since_tizen 2.3
412  * @privlevel platform
413  * @privilege %http://tizen.org/privilege/tethering.admin
414  * @remarks @a subnet_mask must be released using free().
415  * @param[in]  tethering  The tethering handle
416  * @param[in]  type  The tethering type
417  * @param[in]  address_family  The address family of IP address (currently, #TETHERING_ADDRESS_FAMILY_IPV4 is only supported)
418  * @param[out]  subnet_mask  The local IP address
419  * @return 0 on success, otherwise negative error value
420  * @retval  #TETHERING_ERROR_NONE  Successful
421  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
422  * @retval  #TETHERING_ERROR_OUT_OF_MEMORY  Out of memory
423  * @retval  #TETHERING_ERROR_OPERATION_FAILED  Operation failed
424  * @retval  #TETHERING_ERROR_NOT_ENABLED  Not enabled
425  * @pre  The tethering must be enabled.
426  * @see  tethering_is_enabled()
427  * @see  tethering_enable()
428  */
429 int tethering_get_subnet_mask(tethering_h tethering, tethering_type_e type, tethering_address_family_e address_family, char **subnet_mask);
430
431 /**
432  * @brief Gets the data usage.
433  * @since_tizen 2.3
434  * @privlevel platform
435  * @privilege %http://tizen.org/privilege/tethering.admin
436  * @param[in]  tethering  The tethering handle
437  * @param[out]  usage  The data usage
438  * @return 0 on success, otherwise negative error value
439  * @retval  #TETHERING_ERROR_NONE  Successful
440  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
441  * @retval  #TETHERING_ERROR_OPERATION_FAILED  Operation failed
442  * @retval  #TETHERING_ERROR_NOT_ENABLED  Not enabled
443  * @pre  The tethering must be enabled.
444  * @see  tethering_is_enabled()
445  * @see  tethering_enable()
446  */
447 int tethering_get_data_usage(tethering_h tethering, tethering_data_usage_cb callback, void *user_data);
448
449 /**
450  * @brief Gets the clients which are connected.
451  * @since_tizen 2.3
452  * @privlevel platform
453  * @privilege %http://tizen.org/privilege/tethering.admin
454  * @param[in]  tethering  The tethering handle
455  * @param[in]  type  The tethering type
456  * @param[in]  callback  The callback function to invoke
457  * @param[in]  user_data  The user data to be passed to the callback function
458  * @retval  #TETHERING_ERROR_NONE  Successful
459  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
460  * @retval  #TETHERING_ERROR_NOT_ENABLED  Not enabled
461  * @retval  #TETHERING_ERROR_OPERATION_FAILED  Operation failed
462  * @pre  The tethering must be enabled.
463  * @see  tethering_is_enabled()
464  * @see  tethering_enable()
465  */
466 int tethering_foreach_connected_clients(tethering_h tethering, tethering_type_e type, tethering_connected_client_cb callback, void *user_data);
467
468 /**
469  * @brief Registers the callback function, which is called when tethering is enabled.
470  * @since_tizen 2.3
471  * @privlevel platform
472  * @privilege %http://tizen.org/privilege/tethering.admin
473  * @param[in]  tethering  The tethering handle
474  * @param[in]  type  The tethering type
475  * @param[in]  callback  The callback function to invoke
476  * @param[in]  user_data  The user data to be passed to the callback function
477  * @retval  #TETHERING_ERROR_NONE  Successful
478  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
479  * @see  tethering_unset_enabled_cb()
480  */
481 int tethering_set_enabled_cb(tethering_h tethering, tethering_type_e type, tethering_enabled_cb callback, void *user_data);
482
483 /**
484  * @brief Unregisters the callback function, which is called when tethering is enabled.
485  * @since_tizen 2.3
486  * @privlevel platform
487  * @privilege %http://tizen.org/privilege/tethering.admin
488  * @param[in]  tethering  The tethering handle
489  * @param[in]  type  The tethering type
490  * @retval  #TETHERING_ERROR_NONE  Successful
491  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
492  * @see  tethering_set_enabled_cb()
493  */
494 int tethering_unset_enabled_cb(tethering_h tethering, tethering_type_e type);
495
496 /**
497  * @brief Registers the callback function called when tethering is disabled.
498  * @since_tizen 2.3
499  * @privlevel platform
500  * @privilege %http://tizen.org/privilege/tethering.admin
501  * @param[in]  tethering  The tethering handle
502  * @param[in]  type  The tethering type
503  * @param[in]  callback  The callback function to invoke
504  * @param[in]  user_data  The user data to be passed to the callback function
505  * @retval  #TETHERING_ERROR_NONE  Successful
506  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
507  * @see  tethering_unset_disabled_cb()
508  */
509 int tethering_set_disabled_cb(tethering_h tethering, tethering_type_e type, tethering_disabled_cb callback, void *user_data);
510
511 /**
512  * @brief Unregisters the callback function, which is called when tethering is disabled.
513  * @since_tizen 2.3
514  * @privlevel platform
515  * @privilege %http://tizen.org/privilege/tethering.admin
516  * @param[in]  tethering  The tethering handle
517  * @param[in]  type  The tethering type
518  * @retval  #TETHERING_ERROR_NONE  Successful
519  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
520  * @see  tethering_set_disabled_cb()
521  */
522 int tethering_unset_disabled_cb(tethering_h tethering, tethering_type_e type);
523
524 /**
525  * @brief Registers the callback function, which is called when the state of connection is changed.
526  * @since_tizen 2.3
527  * @privlevel platform
528  * @privilege %http://tizen.org/privilege/tethering.admin
529  * @param[in]  tethering  The tethering handle
530  * @param[in]  type  The tethering type
531  * @param[in]  callback  The callback function to invoke
532  * @param[in]  user_data  The user data to be passed to the callback function
533  * @retval  #TETHERING_ERROR_NONE  Successful
534  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
535  * @see  tethering_unset_connection_state_changed_cb_cb()
536  */
537 int tethering_set_connection_state_changed_cb(tethering_h tethering, tethering_type_e type, tethering_connection_state_changed_cb callback, void *user_data);
538
539 /**
540  * @brief Unregisters the callback function, which is called when the state of connection is changed.
541  * @since_tizen 2.3
542  * @privlevel platform
543  * @privilege %http://tizen.org/privilege/tethering.admin
544  * @param[in]  tethering  The tethering handle
545  * @param[in]  type  The tethering type
546  * @retval  #TETHERING_ERROR_NONE  Successful
547  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
548  * @see  tethering_set_connection_state_changed_cb()
549  */
550 int tethering_unset_connection_state_changed_cb(tethering_h tethering, tethering_type_e type);
551
552 /**
553  * @brief Registers the callback function, which is called when the security type of Wi-Fi tethering is changed.
554  * @since_tizen 2.3
555  * @privlevel platform
556  * @privilege %http://tizen.org/privilege/tethering.admin
557  * @param[in]  tethering  The tethering handle
558  * @param[in]  callback  The callback function to invoke
559  * @param[in]  user_data  The user data to be passed to the callback function
560  * @retval  #TETHERING_ERROR_NONE  Successful
561  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
562  * @see  tethering_wifi_unset_security_type_changed_cb()
563  */
564 int tethering_wifi_set_security_type_changed_cb(tethering_h tethering, tethering_wifi_security_type_changed_cb callback, void *user_data);
565
566 /**
567  * @brief Unregisters the callback function, which is called when the security type of Wi-Fi tethering is changed.
568  * @since_tizen 2.3
569  * @privlevel platform
570  * @privilege %http://tizen.org/privilege/tethering.admin
571  * @param[in]  tethering  The tethering handle
572  * @param[in]  type  The tethering type
573  * @retval  #TETHERING_ERROR_NONE  Successful
574  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
575  * @see  tethering_wifi_set_security_type_changed_cb()
576  */
577 int tethering_wifi_unset_security_type_changed_cb(tethering_h tethering);
578
579 /**
580  * @brief Registers the callback function , which iscalled when the visibility of SSID is changed.
581  * @since_tizen 2.3
582  * @privlevel platform
583  * @privilege %http://tizen.org/privilege/tethering.admin
584  * @param[in]  tethering  The tethering handle
585  * @param[in]  callback  The callback function to invoke
586  * @param[in]  user_data  The user data to be passed to the callback function
587  * @retval  #TETHERING_ERROR_NONE  Successful
588  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
589  * @see  tethering_wifi_unset_ssid_visibility_changed_cb_cb()
590  */
591 int tethering_wifi_set_ssid_visibility_changed_cb(tethering_h tethering, tethering_wifi_ssid_visibility_changed_cb callback, void *user_data);
592
593 /**
594  * @brief Unregisters the callback function, which is called when the visibility of SSID is changed.
595  * @since_tizen 2.3
596  * @privlevel platform
597  * @privilege %http://tizen.org/privilege/tethering.admin
598  * @param[in]  tethering  The tethering handle
599  * @retval  #TETHERING_ERROR_NONE  Successful
600  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
601  * @see  tethering_wifi_set_ssid_visibility_changed_cb()
602  */
603 int tethering_wifi_unset_ssid_visibility_changed_cb(tethering_h tethering);
604
605 /**
606  * @brief Registers the callback function, which is called when the passphrase of Wi-Fi tethering is changed.
607  * @since_tizen 2.3
608  * @privlevel platform
609  * @privilege %http://tizen.org/privilege/tethering.admin
610  * @param[in]  tethering  The tethering handle
611  * @param[in]  callback  The callback function to invoke
612  * @param[in]  user_data  The user data to be passed to the callback function
613  * @retval  #TETHERING_ERROR_NONE  Successful
614  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
615  * @see  tethering_wifi_unset_passphrase_changed_cb()
616  */
617 int tethering_wifi_set_passphrase_changed_cb(tethering_h tethering, tethering_wifi_passphrase_changed_cb callback, void *user_data);
618
619 /**
620  * @brief Unregisters the callback function, which is called when the passphrase of Wi-Fi tethering is changed.
621  * @since_tizen 2.3
622  * @privlevel platform
623  * @privilege %http://tizen.org/privilege/tethering.admin
624  * @param[in]  tethering  The tethering handle
625  * @retval  #TETHERING_ERROR_NONE  Successful
626  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
627  * @see  tethering_wifi_set_passphrase_changed_cb()
628  */
629 int tethering_wifi_unset_passphrase_changed_cb(tethering_h tethering);
630
631 /**
632  * @}
633  */
634
635
636 /**
637  * @addtogroup CAPI_NETWORK_TETHERING_WIFI_MODULE
638  * @{
639  */
640
641 /**
642  * @brief Sets the security type of Wi-Fi tethering.
643  * @since_tizen 2.3
644  * @privlevel platform
645  * @privilege %http://tizen.org/privilege/tethering.admin
646  * @remarks This change is applied next time Wi-Fi tethering is enabled.
647  * @param[in]  tethering  The tethering handle
648  * @param[in]  type  The security type
649  * @return 0 on success, otherwise negative error value
650  * @retval  #TETHERING_ERROR_NONE  Successful
651  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
652  * @retval  #TETHERING_ERROR_OPERATION_FAILED  Operation failed
653  * @see  tethering_wifi_get_security_type()
654  */
655 int tethering_wifi_set_security_type(tethering_h tethering, tethering_wifi_security_type_e type);
656
657 /**
658  * @brief Gets the security type of Wi-Fi tethering.
659  * @since_tizen 2.3
660  * @privlevel platform
661  * @privilege %http://tizen.org/privilege/tethering.admin
662  * @param[in]  tethering  The tethering handle
663  * @param[out]  type  The security type
664  * @return 0 on success, otherwise negative error value
665  * @retval  #TETHERING_ERROR_NONE  Successful
666  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
667  * @retval  #TETHERING_ERROR_OPERATION_FAILED  Operation failed
668  * @see  tethering_wifi_set_security_type()
669  */
670 int tethering_wifi_get_security_type(tethering_h tethering, tethering_wifi_security_type_e *type);
671
672 /**
673  * @brief Sets the SSID (service set identifier).
674  * @details The SSID cannot exceed 32 bytes. If SSID is not set, device name is used as SSID.
675  * @since_tizen 2.3
676  * @privlevel platform
677  * @privilege %http://tizen.org/privilege/tethering.admin
678  * @remarks This change is applied next time Wi-Fi tethering is enabled with same @a tethering handle.
679  * @param[in]  tethering  The tethering handle
680  * @param[in]  ssid  The SSID
681  * @return 0 on success, otherwise negative error value
682  * @retval  #TETHERING_ERROR_NONE  Successful
683  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
684  * @retval  #TETHERING_ERROR_OUT_OF_MEMORY  Out of memory
685  */
686 int tethering_wifi_set_ssid(tethering_h tethering, const char *ssid);
687
688 /**
689  * @brief Gets the SSID (service set identifier).
690  * @since_tizen 2.3
691  * @privlevel platform
692  * @privilege %http://tizen.org/privilege/tethering.admin
693  * @remarks @a ssid must be released using free().
694  * @param[in]  tethering  The tethering handle
695  * @param[out]  ssid  The SSID
696  * @return 0 on success, otherwise negative error value
697  * @retval  #TETHERING_ERROR_NONE  Successful
698  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
699  * @retval  #TETHERING_ERROR_OUT_OF_MEMORY  Out of memory
700  * @retval  #TETHERING_ERROR_OPERATION_FAILED  Operation failed
701  */
702 int tethering_wifi_get_ssid(tethering_h tethering, char **ssid);
703
704 /**
705  * @brief Sets the visibility of SSID (service set identifier).
706  * @details If the visibility is set to invisible, then the SSID of this device is hidden and Wi-Fi scan will not find the device.
707  * @since_tizen 2.3
708  * @privlevel platform
709  * @privilege %http://tizen.org/privilege/tethering.admin
710  * @remarks This change is applied next time Wi-Fi tethering is enabled.
711  * @param[in]  tethering  The tethering handle
712  * @param[in]  visible  The visibility of SSID: (@c true = visible, @c false = invisible)
713  * @return 0 on success, otherwise negative error value
714  * @retval  #TETHERING_ERROR_NONE  Successful
715  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
716  * @retval  #TETHERING_ERROR_OPERATION_FAILED  Operation failed
717  * @see  tethering_wifi_get_ssid_visibility()
718  */
719 int tethering_wifi_set_ssid_visibility(tethering_h tethering, bool visible);
720
721 /**
722  * @brief Gets the visibility of SSID (service set identifier).
723  * @details If the visibility is set to invisible, then the SSID of this device is hidden and Wi-Fi scan will not find the device.
724  * @since_tizen 2.3
725  * @privlevel platform
726  * @privilege %http://tizen.org/privilege/tethering.admin
727  * @param[in]  tethering  The tethering handle
728  * @param[out]  visible  The visibility of SSID: (@c true = visible, @c false = invisible)
729  * @return 0 on success, otherwise negative error value
730  * @retval  #TETHERING_ERROR_NONE  Successful
731  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
732  * @retval  #TETHERING_ERROR_OPERATION_FAILED  Operation failed
733  * @see  tethering_wifi_set_ssid_visibility()
734  */
735 int tethering_wifi_get_ssid_visibility(tethering_h tethering, bool *visible);
736
737 /**
738  * @brief Sets the passphrase.
739  * @since_tizen 2.3
740  * @privlevel platform
741  * @privilege %http://tizen.org/privilege/tethering.admin
742  * @remarks This change is applied next time Wi-Fi tethering is enabled.
743  * @param[in]  tethering  The tethering handle
744  * @param[in]  passphrase  The passphrase
745  * @return 0 on success, otherwise negative error value
746  * @retval  #TETHERING_ERROR_NONE  Successful
747  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
748  * @retval  #TETHERING_ERROR_OPERATION_FAILED  Operation failed
749  * @see  tethering_wifi_get_passphrase()
750  */
751 int tethering_wifi_set_passphrase(tethering_h tethering, const char *passphrase);
752
753 /**
754  * @brief Gets the passphrase.
755  * @since_tizen 2.3
756  * @privlevel platform
757  * @privilege %http://tizen.org/privilege/tethering.admin
758  * @remarks @a passphrase must be released using free().
759  * @param[in]  tethering  The tethering handle
760  * @param[out]  passphrase  The passphrase
761  * @return 0 on success, otherwise negative error value
762  * @retval  #TETHERING_ERROR_NONE  Successful
763  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
764  * @retval  #TETHERING_ERROR_OUT_OF_MEMORY  Out of memory
765  * @retval  #TETHERING_ERROR_OPERATION_FAILED  Operation failed
766  * @see  tethering_wifi_set_passphrase()
767  */
768 int tethering_wifi_get_passphrase(tethering_h tethering, char **passphrase);
769
770 /**
771  * @brief Reloads the settings (SSID / Passphrase / Security type / SSID visibility).
772  * @since_tizen 2.3
773  * @privlevel platform
774  * @privilege %http://tizen.org/privilege/tethering.admin
775  * @remarks Connected devices via Wi-Fi tethering or MobileAP will be disconnected when the settings are reloaded.
776  * @param[in]  tethering  The tethering handle
777  * @param[in]  callback  The callback function to invoke
778  * @param[in]  user_data  The user data to be passed to the callback function
779  * @return 0 on success, otherwise negative error value
780  * @retval  #TETHERING_ERROR_NONE  Successful
781  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
782  * @retval  #TETHERING_ERROR_OPERATION_FAILED  Operation failed
783  */
784 int tethering_wifi_reload_settings(tethering_h tethering, tethering_wifi_settings_reloaded_cb callback, void *user_data);
785
786 /**
787  * @brief Gets the mac_filter for Wi-Fi Tethering.
788  * @details If you set the mac_filter to enable, then the device can be allowed/blocked based on mac-address.
789  * By default mac_filter is set to false.
790  * @since_tizen 3.0
791  * @privlevel platform
792  * @privilege %http://tizen.org/privilege/tethering.admin
793  * @param[in]  tethering  The handle of tethering
794  * @param[out]  mac_filter The mac filter: (@c true = enable, @c false = disable)
795  * @return 0 on success, otherwise negative error value.
796  * @retval  #TETHERING_ERROR_NONE  Successful
797  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
798  * @retval  #TETHERING_ERROR_NOT_SUPPORTED  API is not supported
799  * @retval  #TETHERING_ERROR_PERMISSION_DENIED  Permission Denied
800  * @see  tethering_mobileap_set_mac_filter()
801  */
802 int tethering_wifi_get_mac_filter(tethering_h tethering, bool *mac_filter);
803
804 /**
805  * @brief Sets the mac-filter for Wi-Fi Tethering.
806  * @details If you set the mac_filter to enable, then the device can be allowed/blocked based on mac-address.
807  * By default mac_filter is set to @c false.
808  * @since_tizen 3.0
809  * @privlevel platform
810  * @privilege %http://tizen.org/privilege/tethering.admin
811  * @remarks This change is applied next time Wi-Fi tethering is enabled.
812  * @param[in]  tethering  The tethering handle
813  * @param[in]  mac_filter  The mac filter: (@c true = enable, @c false = disable)
814  * @return 0 on success, otherwise negative error value
815  * @retval  #TETHERING_ERROR_NONE  Successful
816  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
817  * @retval  #TETHERING_ERROR_OPERATION_FAILED  Operation failed
818  * @retval  #TETHERING_ERROR_NOT_SUPPORTED  API is not supported
819  * @retval  #TETHERING_ERROR_PERMISSION_DENIED  Permission Denied
820  * @see  tethering_mobileap_get_mac_filter()
821  */
822 int tethering_wifi_set_mac_filter(tethering_h tethering, bool mac_filter);
823
824 /**
825  * @brief Adds the mac-address to the allowed client list.
826  * @details AP can allow the client by adding clients mac-address to the allowed list.
827  * @since_tizen 3.0
828  * @privlevel platform
829  * @privilege %http://tizen.org/privilege/tethering.admin
830  * @param[in]  tethering  The handle of tethering
831  * @param[in]  mac  The mac address
832  * @return 0 on success, otherwise negative error value.
833  * @retval  #TETHERING_ERROR_NONE  Successful
834  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
835  * @retval  #TETHERING_ERROR_NOT_SUPPORTED  API is not supported
836  * @retval  #TETHERING_ERROR_PERMISSION_DENIED  Permission Denied
837  * @see  tethering_mobileap_set_mac_filter()
838  */
839 int tethering_wifi_add_allowed_mac_list(tethering_h tethering, const char *mac);
840
841 /**
842  * @brief Removes the mac-address from the allowed client list.
843  * @details Removes the mac-address from the allowed client list.
844  * @since_tizen 3.0
845  * @privlevel platform
846  * @privilege %http://tizen.org/privilege/tethering.admin
847  * @param[in]  tethering  The handle of tethering
848  * @param[in]  mac  The mac address
849  * @return 0 on success, otherwise negative error value.
850  * @retval  #TETHERING_ERROR_NONE  Successful
851  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
852  * @retval  #TETHERING_ERROR_NOT_SUPPORTED  API is not supported
853  * @retval  #TETHERING_ERROR_PERMISSION_DENIED  Permission Denied
854  * @see  tethering_mobileap_set_mac_filter()
855  */
856 int tethering_wifi_remove_allowed_mac_list(tethering_h tethering, const char *mac);
857 /**
858  * @brief Gets the mac-addresses from the allowed client list.
859  * @details Gets the mac-addresses from the allowed client list.
860  * @since_tizen 3.0
861  * @privlevel platform
862  * @privilege %http://tizen.org/privilege/tethering.admin
863  * @param[in]  tethering  The handle of tethering
864  * @param[out]  allowed_mac_list  list of allowed mac addresses list
865  * @return 0 on success, otherwise negative error value.
866  * @retval  #TETHERING_ERROR_NONE  Successful
867  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
868  * @retval  #TETHERING_ERROR_NOT_SUPPORTED  API is not supported
869  * @retval  #TETHERING_ERROR_PERMISSION_DENIED  Permission Denied
870  * @see  tethering_mobileap_set_mac_filter()
871  */
872 int tethering_wifi_get_allowed_mac_list(tethering_h tethering, void **allowed_mac_list);
873
874 /**
875  * @brief Adds the mac-address to the blocked(black list) client list.
876  * @details AP can disallow the client by adding clients mac-address to the blocked list.
877  * @since_tizen 3.0
878  * @privlevel platform
879  * @privilege %http://tizen.org/privilege/tethering.admin
880  * @param[in]  tethering  The handle of tethering
881  * @param[in]  mac  The mac address
882  * @return 0 on success, otherwise negative error value.
883  * @retval  #TETHERING_ERROR_NONE  Successful
884  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
885  * @retval  #TETHERING_ERROR_NOT_SUPPORTED  API is not supported
886  * @retval  #TETHERING_ERROR_PERMISSION_DENIED  Permission Denied
887  * @see  tethering_mobileap_set_mac_filter()
888  */
889 int tethering_wifi_add_blocked_mac_list(tethering_h tethering, const char *mac);
890
891 /**
892  * @brief Removes the mac-address from the blocked(black list) client list.
893  * @details Removes the mac-address from the blocked client list.
894  * @since_tizen 3.0
895  * @privlevel platform
896  * @privilege %http://tizen.org/privilege/tethering.admin
897  * @param[in]  tethering  The handle of tethering
898  * @param[in]  mac  The mac address
899  * @return 0 on success, otherwise negative error value.
900  * @retval  #TETHERING_ERROR_NONE  Successful
901  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
902  * @retval  #TETHERING_ERROR_NOT_SUPPORTED  API is not supported
903  * @retval  #TETHERING_ERROR_PERMISSION_DENIED  Permission Denied
904  * @see  tethering_mobileap_set_mac_filter()
905  */
906 int tethering_wifi_remove_blocked_mac_list(tethering_h tethering, const char *mac);
907
908 /**
909  * @brief Gets the mac-addresses from the blocked client list.
910  * @details Get the mac-addresses from the blocked client list.
911  * @since_tizen 3.0
912  * @privlevel platform
913  * @privilege %http://tizen.org/privilege/tethering.admin
914  * @param[in]  tethering  The handle of tethering
915  * @param[out]  blocked_mac_list  list of blocked mac addresses list
916  * @return 0 on success, otherwise negative error value.
917  * @retval  #TETHERING_ERROR_NONE  Successful
918  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
919  * @retval  #TETHERING_ERROR_NOT_SUPPORTED  API is not supported
920  * @retval  #TETHERING_ERROR_PERMISSION_DENIED  Permission Denied
921  * @see  tethering_mobileap_set_mac_filter()
922  */
923 int tethering_wifi_get_blocked_mac_list(tethering_h tethering, void **blocked_mac_list);
924
925 /**
926  * @brief Enables/disables the dhcp server.
927  * @since_tizen 3.0
928  * @privlevel platform
929  * @privilege %http://tizen.org/privilege/tethering.admin
930  * @details Enable/disable the dhcp server.
931  * @param[in]  tethering  The handle of tethering
932  * @param[in]  enable  Enable/disable the dhcp server
933  * @return 0 on success, otherwise negative error value.
934  * @retval  #TETHERING_ERROR_NONE  Successful
935  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
936  */
937 int tethering_wifi_enable_dhcp(tethering_h tethering, bool enable);
938
939 /**
940  * @brief Enables the dhcp server with the address range.
941  * @since_tizen 3.0
942  * @privlevel platform
943  * @privilege %http://tizen.org/privilege/tethering.admin
944  * @details Enable the dhcp server with the address range.
945  * @param[in]  tethering  The handle of tethering
946  * @param[in]  rangestart Start address range
947  * @param[in]  rangestop  End address range
948  * @return 0 on success, otherwise negative error value.
949  * @retval  #TETHERING_ERROR_NONE  Successful
950  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
951  */
952 int tethering_wifi_set_dhcp_range(tethering_h tethering, char *rangestart, char *rangestop);
953
954 /**
955  * @brief Checks whether the dhcp is enabled or not.
956  * @since_tizen 3.0
957  * @privlevel platform
958  * @privilege %http://tizen.org/privilege/tethering.admin
959  * @param[in]  tethering  The tethering handle
960  * @param[out] dhcp_enabled  @c true if dhcp is enabled, \n @c false if dhcp is disabled
961  * @return  0 on success, otherwise a negative error value
962  * @retval  #TETHERING_ERROR_NONE  Successful
963  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
964  */
965 int tethering_wifi_is_dhcp_enabled(tethering_h tethering, bool *dhcp_enabled);
966
967 /**
968  * @brief Sets the Channel for Wi-Fi.
969  * @details The Channel should be in between 1-14. If channel is not set, Wi-Fi sets default channel.
970  * @since_tizen 3.0
971  * @privlevel platform
972  * @privilege %http://tizen.org/privilege/tethering.admin
973  * @param[in]  tethering  The tethering handle
974  * @param[in]  channel  The channel number
975  * @return 0 on success, otherwise negative error value
976  * @retval  #TETHERING_ERROR_NONE  Successful
977  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
978  */
979 int tethering_wifi_set_channel(tethering_h tethering, int channel);
980
981 /**
982  * @brief Gets the channel for Wi-Fi.
983  * @details If channel is not set, Wi-Fi gets default channel.
984  * @since_tizen 3.0
985  * @privlevel platform
986  * @privilege %http://tizen.org/privilege/tethering.admin
987  * @param[in]  tethering  The tethering handle
988  * @param[out]  channel  The channel number
989  * @return 0 on success, otherwise negative error value
990  * @retval  #TETHERING_ERROR_NONE  Successful
991  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
992  * @see  tethering_wifi_set_channel()
993  */
994 int tethering_wifi_get_channel(tethering_h tethering, int *channel);
995
996 /**
997  * @brief Sets the mode for Wi-Fi.
998  * @details The mobile AP mode (ex: b only, g only, ad, a). If mode is not set, Wi-Fi sets default mode.
999  * @since_tizen 3.0
1000  * @privlevel platform
1001  * @privilege %http://tizen.org/privilege/tethering.admin
1002  * @param[in]  tethering  The tethering handle
1003  * @param[in]  type     The mobile AP mode
1004  * @return 0 on success, otherwise negative error value
1005  * @retval  #TETHERING_ERROR_NONE  Successful
1006  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
1007  */
1008 int tethering_wifi_set_mode(tethering_h tethering, tethering_wifi_mode_type_e type);
1009
1010 /**
1011  * @brief Gets the mode for Wi-Fi.
1012  * @details If the mode is not set, Wi-Fi gets default mode.
1013  * @since_tizen 3.0
1014  * @privlevel platform
1015  * @privilege %http://tizen.org/privilege/tethering.admin
1016  * @remarks @a mode must be released using free().
1017  * @param[in]  tethering  The tethering handle
1018  * @param[out]  type  The mode of Wi-Fi AP
1019  * @return 0 on success, otherwise negative error value
1020  * @retval  #TETHERING_ERROR_NONE  Successful
1021  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
1022  * @see  tethering_wifi_set_mode()
1023  */
1024 int tethering_wifi_get_mode(tethering_h tethering, tethering_wifi_mode_type_e *type);
1025
1026 /**
1027  * @}
1028  */
1029
1030
1031 /**
1032  * @addtogroup CAPI_NETWORK_TETHERING_CLIENT_MODULE
1033  * @{
1034  */
1035
1036 /**
1037  * @brief Clones the handle of a client.
1038  * @since_tizen 2.3
1039  * @privlevel platform
1040  * @privilege %http://tizen.org/privilege/tethering.admin
1041  * @remarks @a dest must be release using tethering_client_destroy().
1042  * @param[out]  dest  The cloned client handle
1043  * @param[in]  origin  The origin client handle
1044  * @return  0 on success, otherwise a negative error value
1045  * @retval  #TETHERING_ERROR_NONE  Successful
1046  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
1047  * @retval  #TETHERING_ERROR_OUT_OF_MEMORY  Out of memory
1048  * @see  tethering_client_destroy()
1049  */
1050 int tethering_client_clone(tethering_client_h *dest, tethering_client_h origin);
1051
1052 /**
1053  * @brief Destroys the handle of a client.
1054  * @since_tizen 2.3
1055  * @privlevel platform
1056  * @privilege %http://tizen.org/privilege/tethering.admin
1057  * @param[in]  client  The client handle
1058  * @return  0 on success, otherwise a negative error value
1059  * @retval  #TETHERING_ERROR_NONE  Successful
1060  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
1061  * @see  tethering_client_clone()
1062  */
1063 int tethering_client_destroy(tethering_client_h client);
1064
1065 /**
1066  * @brief  Gets the tethering type of client.
1067  * @since_tizen 2.3
1068  * @privlevel platform
1069  * @privilege %http://tizen.org/privilege/tethering.admin
1070  * @param[in]  client  The handle of client
1071  * @param[out]  type  The type of tethering
1072  * @return  0 on success, otherwise a negative error value.
1073  * @retval  #TETHERING_ERROR_NONE  Successful
1074  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
1075  * @see  tethering_usb_get_connected_client()
1076  * @see  tethering_connection_state_changed_cb()
1077  */
1078 int tethering_client_get_tethering_type(tethering_client_h client, tethering_type_e *type);
1079
1080 /**
1081  * @brief Gets the name of a client.
1082  * @since_tizen 2.3
1083  * @privlevel platform
1084  * @privilege %http://tizen.org/privilege/tethering.admin
1085  * @remarks @a name must be released using free().
1086  * @param[in]  client  The client handle
1087  * @param[out]  name  The name of the client
1088  * @return  0 on success, otherwise a negative error value
1089  * @retval  #TETHERING_ERROR_NONE  Successful
1090  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
1091  * @retval  #TETHERING_ERROR_OUT_OF_MEMORY  Out of memory
1092  * @see  tethering_usb_get_connected_client()
1093  * @see  tethering_connection_state_changed_cb()
1094  */
1095 int tethering_client_get_name(tethering_client_h client, char **name);
1096
1097 /**
1098  * @brief Gets the IP address of a client.
1099  * @since_tizen 2.3
1100  * @privlevel platform
1101  * @privilege %http://tizen.org/privilege/tethering.admin
1102  * @remarks @a ip_address must be released using free().
1103  * @param[in]  client  The client handle
1104  * @param[in]  address_family  The address family of IP address. Currently, #TETHERING_ADDRESS_FAMILY_IPV4 is only supported
1105  * @param[out]  ip_address  The IP address
1106  * @return  0 on success, otherwise a negative error value
1107  * @retval  #TETHERING_ERROR_NONE  Successful
1108  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
1109  * @retval  #TETHERING_ERROR_OUT_OF_MEMORY  Out of memory
1110  * @see  tethering_usb_get_connected_client()
1111  * @see  tethering_connection_state_changed_cb()
1112  */
1113 int tethering_client_get_ip_address(tethering_client_h client, tethering_address_family_e address_family, char **ip_address);
1114
1115 /**
1116  * @brief Gets the MAC address of a client such as "FC:A1:3E:D6:B1:B1".
1117  * @since_tizen 2.3
1118  * @privlevel platform
1119  * @privilege %http://tizen.org/privilege/tethering.admin
1120  * @remarks @a mac_address must be released using free().
1121  * @param[in]  client  The client handle
1122  * @param[out]  mac_address  The MAC address
1123  * @return  0 on success, otherwise a negative error value
1124  * @retval  #TETHERING_ERROR_NONE  Successful
1125  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
1126  * @retval  #TETHERING_ERROR_OUT_OF_MEMORY  Out of memory
1127  * @see  tethering_usb_get_connected_client()
1128  * @see  tethering_connection_state_changed_cb()
1129  */
1130 int tethering_client_get_mac_address(tethering_client_h client, char **mac_address);
1131
1132 /**
1133  * @brief Gets the connection time of a client.
1134  * @since_tizen 2.3
1135  * @privlevel platform
1136  * @privilege %http://tizen.org/privilege/tethering.admin
1137  * @param[in] client The client handle
1138  * @param[out]  time  The connected time of the client
1139  * @return  0 on success, otherwise a negative error value
1140  * @retval  #TETHERING_ERROR_NONE  Successful
1141  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
1142  * @see  tethering_usb_get_connected_client()
1143  * @see  tethering_connection_state_changed_cb()
1144  */
1145 int tethering_client_get_time(tethering_client_h client, time_t *timestamp);
1146
1147 /**
1148  * @}
1149  */
1150
1151
1152 #ifdef __cplusplus
1153  }
1154 #endif
1155
1156 #endif /* __TIZEN_NETWORK_TETHERING_H__ */
1157
1158