Source code upload
[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
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25
26 /**
27  * @addtogroup CAPI_NETWORK_TETHERING_MANAGER_MODULE
28  * @{
29  */
30
31 /**
32  * @brief The handle for tethering.
33  */
34 typedef void * tethering_h;
35
36 /**
37  * @brief Enumeration for the tethering.
38  */
39 typedef enum {
40     TETHERING_ERROR_NONE = TIZEN_ERROR_NONE,  /**< Successful */
41     TETHERING_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER,  /**< Invalid parameter */
42     TETHERING_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY,  /**< Out of memory */
43     TETHERING_ERROR_RESOURCE_BUSY = TIZEN_ERROR_RESOURCE_BUSY,  /**< Resource busy */
44     TETHERING_ERROR_NOT_ENABLED = TIZEN_ERROR_NETWORK_CLASS | 0x0501,  /**< Not enabled */
45     TETHERING_ERROR_OPERATION_FAILED = TIZEN_ERROR_NETWORK_CLASS | 0x0502,  /**< Operation failed */
46     TETHERING_ERROR_INVALID_OPERATION = TIZEN_ERROR_INVALID_OPERATION, /**< Invalid operation */
47 } tethering_error_e;
48
49 /**
50  * @brief Enumeration for the type of tethering.
51  */
52 typedef enum {
53     TETHERING_TYPE_ALL = 0,  /**< All type */
54     TETHERING_TYPE_USB,  /**< USB type */
55     TETHERING_TYPE_WIFI,  /**< Wi-Fi type */
56     TETHERING_TYPE_BT,  /**< BT type */
57 } tethering_type_e;
58
59 /**
60  * @brief Enumeration for the cause of disabling the tethering.
61  */
62 typedef enum
63 {
64     TETHERING_DISABLED_BY_USB_DISCONNECTION = 0,  /**< Disabled due to usb disconnection */
65     TETHERING_DISABLED_BY_FLIGHT_MODE,  /**< Disabled due to flight mode */
66     TETHERING_DISABLED_BY_LOW_BATTERY,  /**< Disabled due to low battery */
67     TETHERING_DISABLED_BY_NETWORK_CLOSE,  /**< Disabled due to pdp network close */
68     TETHERING_DISABLED_BY_TIMEOUT,  /**< Disabled due to timeout */
69     TETHERING_DISABLED_BY_MDM_ON,  /**< Disabled due to mdm on */
70     TETHERING_DISABLED_BY_OTHERS,  /**< Disabled by other apps */
71     TETHERING_DISABLED_BY_REQUEST,  /**< Disabled by your request */
72     TETHERING_DISABLED_BY_WIFI_ON,  /**< Disabled due to Wi-Fi on */
73     TETHERING_DISABLED_BY_BT_OFF,  /**< Disabled due to Bluetooth off */
74 } tethering_disabled_cause_e;
75
76 /**
77  * @}
78  */
79
80
81 /**
82  * @addtogroup CAPI_NETWORK_TETHERING_WIFI_MODULE
83  * @{
84  */
85
86 /**
87  * @brief Enumeration for the Wi-Fi security.
88  */
89 typedef enum {
90     TETHERING_WIFI_SECURITY_TYPE_NONE = 0,  /**< No Security type */
91     TETHERING_WIFI_SECURITY_TYPE_WPA2_PSK,  /**< WPA2_PSK */
92 } tethering_wifi_security_type_e;
93
94 /**
95  * @}
96  */
97
98
99 /**
100  * @addtogroup CAPI_NETWORK_TETHERING_CLIENT_MODULE
101  * @{
102  */
103
104 /**
105  * @brief The handle for tethering client.
106  */
107 typedef void * tethering_client_h;
108
109 /**
110  * @brief Enumerations of Address family
111  */
112 typedef enum {
113     TETHERING_ADDRESS_FAMILY_IPV4 = 0,  /**< IPV4 Address type */
114 } tethering_address_family_e;
115
116 /**
117  * @}
118  */
119
120
121 /**
122  * @addtogroup CAPI_NETWORK_TETHERING_MANAGER_MODULE
123  * @{
124  */
125
126 /**
127  * @brief  Called when the tethering is enabled.
128  * @param[in]  result  The result of enabling the tethering
129  * @param[in]  type  The type of tethering
130  * @param[in]  is_requested  Indicates whether this change is requested by you
131  * @param[in]  user_data  The user data passed from tethering_set_enabled_cb()
132  * @pre  If you register callback function using tethering_set_enabled_cb(), this will be invoked when the tethering is enabled.
133  * @see tethering_enable()
134  * @see tethering_unset_enabled_cb()
135  */
136 typedef void (*tethering_enabled_cb)(tethering_error_e result, tethering_type_e type, bool is_requested, void *user_data);
137
138 /**
139  * @brief  Called when the tethering is disabled.
140  * @param[in]  result  The result of disabling the tethering
141  * @param[in]  type  The type of tethering
142  * @param[in]  cause  The cause of disabling
143  * @param[in]  user_data  The user data passed from tethering_set_disabled_cb()
144  * @pre  If you register callback function using tethering_set_disabled_cb(), this will be invoked when the tethering is disabled.
145  * @see tethering_set_disabled_cb()
146  * @see tethering_unset_disabled_cb()
147  */
148 typedef void (*tethering_disabled_cb)(tethering_error_e result, tethering_type_e type, tethering_disabled_cause_e cause, void *user_data);
149
150 /**
151  * @brief  Called when the connection state is changed.
152  * @remakrs  @c tethering_client_h is valid only in this function. In order to use it outside this function, you must copy the client with tethering_client_clone().
153  * @param[in]  client  The client of which connection state is changed
154  * @param[in]  opened  @c true when connection is opened, otherwise false
155  * @param[in]  user_data  The user data passed from tethering_set_connection_state_changed_cb()
156  * @pre  If you register callback function using tethering_set_connection_state_changed_cb(), this will be invoked when the connection state is changed.
157  * @see tethering_set_connection_state_changed_cb()
158  * @see tethering_unset_connection_state_changed_cb()
159  */
160 typedef void (*tethering_connection_state_changed_cb)(tethering_client_h client, bool opened, void *user_data);
161
162 /**
163  * @brief Called when you get the connected client repeatedly.
164  * @remarks  @a client is valid only in this function. In order to use the client outside this function, you must copy the client with tethering_client_clone().
165  * @param[in]  client  The connected client
166  * @param[in]  user_data  The user data passed from the request function
167  * @return  @c true to continue with the next iteration of the loop, \n @c false to break out of the loop
168  * @pre  tethering_foreach_connected_clients() will invoke this callback.
169  * @see  tethering_foreach_connected_clients()
170  */
171 typedef bool(*tethering_connected_client_cb)(tethering_client_h client, void *user_data);
172
173 /**
174  * @brief  Called when you get the data usage.
175  * @param[in]  result  The result of getting the data usage
176  * @param[in]  received_data  The usage of received data
177  * @param[in]  sent_data  The usage of sent data
178  * @param[in]  user_data  The user data passed from the request function
179  * @pre  tethering_get_data_usage() will invoked this callback
180  */
181 typedef void (*tethering_data_usage_cb)(tethering_error_e result, unsigned long long received_data, unsigned long long sent_data, void *user_data);
182
183 /**
184  * @brief  Creates the handle of tethering.
185  * @remarks  The @a tethering must be released tethering_destroy() by you.
186  * @param[out]  tethering  A handle of a new mobile ap handle on success
187  * @return  0 on success, otherwise a negative error value.
188  * @retval  #TETHERING_ERROR_NONE  Successful
189  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
190  * @retval  #TETHERING_ERROR_OUT_OF_MEMORY  Out of memory
191  * @see  tethering_destroy()
192  */
193 int tethering_create(tethering_h *tethering);
194
195 /**
196  * @brief  Destroys the handle of tethering.
197  * @param[in]  tethering  The handle of tethering
198  * @return  0 on success, otherwise a negative error value.
199  * @retval  #TETHERING_ERROR_NONE  Successful
200  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
201  * @see  tethering_create()
202  */
203 int tethering_destroy(tethering_h tethering);
204
205 /**
206  * @brief Enables the tethering, asynchronously.
207  * @param[in]  tethering  The handle of tethering
208  * @param[in]  type  The type of tethering
209  * @return 0 on success, otherwise negative error value.
210  * @retval  #TETHERING_ERROR_NONE  Successful
211  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
212  * @post tethering_enabled_cb() will be invoked.
213  * @see  tethering_is_enabled()
214  * @see  tethering_disable()
215  */
216 int tethering_enable(tethering_h tethering, tethering_type_e type);
217
218 /**
219  * @brief Disables the tethering, asynchronously.
220  * @param[in]  tethering  The handle of tethering
221  * @param[in]  type  The type of tethering
222  * @return 0 on success, otherwise negative error value.
223  * @retval  #TETHERING_ERROR_NONE  Successful
224  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
225  * @post tethering_disabled_cb() will be invoked.
226  * @see  tethering_is_enabled()
227  * @see  tethering_enable()
228  */
229 int tethering_disable(tethering_h tethering, tethering_type_e type);
230
231 /**
232  * @brief  Checks whetehr the tethering is enabled or not.
233  * @param[in]  tethering  The handle of tethering
234  * @param[in]  type  The type of tethering
235  * @return  @c true if tethering is enabled, \n @c false if tethering is disabled.
236  */
237 bool tethering_is_enabled(tethering_h tethering, tethering_type_e type);
238
239 /**
240  * @brief  Gets the MAC address of local device as "FC:A1:3E:D6:B1:B1".
241  * @remarks @a mac_address must be released with free() by you.
242  * @param[in]  tethering  The handle of tethering
243  * @param[in]  type  The type of tethering
244  * @param[out]  mac_address  The MAC address
245  * @return  0 on success, otherwise a negative error value.
246  * @retval  #TETHERING_ERROR_NONE  Successful
247  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
248  * @retval  #TETHERING_ERROR_OUT_OF_MEMORY  Out of memory
249  * @retval  #TETHERING_ERROR_OPERATION_FAILED  Operation failed
250  * @retval  #TETHERING_ERROR_NOT_ENABLED  Not enabled
251  * @pre  tethering must be enabled.
252  * @see  tethering_is_enabled()
253  * @see  tethering_enable()
254  */
255 int tethering_get_mac_address(tethering_h tethering, tethering_type_e type, char **mac_address);
256
257 /**
258  * @brief Gets the name of network interface. For example, usb0.
259  * @remarks @a interface_name must be released with free() by you.
260  * @param[in]  tethering  The handle of tethering
261  * @param[in]  type  The type of tethering
262  * @param[out]  interface_name  The name of network interface
263  * @return 0 on success, otherwise negative error value.
264  * @retval  #TETHERING_ERROR_NONE  Successful
265  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
266  * @retval  #TETHERING_ERROR_OUT_OF_MEMORY  Out of memory
267  * @retval  #TETHERING_ERROR_OPERATION_FAILED  Operation failed
268  * @retval  #TETHERING_ERROR_NOT_ENABLED  Not enabled
269  * @pre  tethering must be enabled.
270  * @see  tethering_is_enabled()
271  * @see  tethering_enable()
272  */
273 int tethering_get_network_interface_name(tethering_h tethering, tethering_type_e type, char **interface_name);
274
275 /**
276  * @brief Gets the local IP address.
277  * @remarks @a ip_address must be released with free() by you.
278  * @param[in]  tethering  The handle of tethering
279  * @param[in]  type  The type of tethering
280  * @param[in]  address_family  The address family of IP address. Currently, #TETHERING_ADDRESS_FAMILY_IPV4 is only supported.
281  * @param[out]  ip_address  The local IP address
282  * @return 0 on success, otherwise negative error value.
283  * @retval  #TETHERING_ERROR_NONE  Successful
284  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
285  * @retval  #TETHERING_ERROR_OUT_OF_MEMORY  Out of memory
286  * @retval  #TETHERING_ERROR_OPERATION_FAILED  Operation failed
287  * @retval  #TETHERING_ERROR_NOT_ENABLED  Not enabled
288  * @pre  tethering must be enabled.
289  * @see  tethering_is_enabled()
290  * @see  tethering_enable()
291  */
292 int tethering_get_ip_address(tethering_h tethering, tethering_type_e type, tethering_address_family_e address_family, char **ip_address);
293
294 /**
295  * @brief Gets the Gateway address.
296  * @remarks @a gateway_address must be released with free() by you.
297  * @param[in]  tethering  The handle of tethering
298  * @param[in]  type  The type of tethering
299  * @param[in]  address_family  The address family of IP address. Currently, #TETHERING_ADDRESS_FAMILY_IPV4 is only supported.
300  * @param[out]  gateway_address  The local IP address
301  * @return 0 on success, otherwise negative error value.
302  * @retval  #TETHERING_ERROR_NONE  Successful
303  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
304  * @retval  #TETHERING_ERROR_OUT_OF_MEMORY  Out of memory
305  * @retval  #TETHERING_ERROR_OPERATION_FAILED  Operation failed
306  * @retval  #TETHERING_ERROR_NOT_ENABLED  Not enabled
307  * @pre  tethering must be enabled.
308  * @see  tethering_is_enabled()
309  * @see  tethering_enable()
310  */
311 int tethering_get_gateway_address(tethering_h tethering, tethering_type_e type, tethering_address_family_e address_family, char **gateway_address);
312
313 /**
314  * @brief Gets the Subnet Mask.
315  * @remarks @a subnet_mask must be released with free() by you.
316  * @param[in]  tethering  The handle of tethering
317  * @param[in]  type  The type of tethering
318  * @param[in]  address_family  The address family of IP address. Currently, #TETHERING_ADDRESS_FAMILY_IPV4 is only supported.
319  * @param[out]  subnet_mask  The local IP address
320  * @return 0 on success, otherwise negative error value.
321  * @retval  #TETHERING_ERROR_NONE  Successful
322  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
323  * @retval  #TETHERING_ERROR_OUT_OF_MEMORY  Out of memory
324  * @retval  #TETHERING_ERROR_OPERATION_FAILED  Operation failed
325  * @retval  #TETHERING_ERROR_NOT_ENABLED  Not enabled
326  * @pre  tethering must be enabled.
327  * @see  tethering_is_enabled()
328  * @see  tethering_enable()
329  */
330 int tethering_get_subnet_mask(tethering_h tethering, tethering_type_e type, tethering_address_family_e address_family, char **subnet_mask);
331
332 /**
333  * @brief Gets the data usage.
334  * @param[in]  tethering  The handle of tethering
335  * @param[out]  usage  The data usage
336  * @return 0 on success, otherwise negative error value.
337  * @retval  #TETHERING_ERROR_NONE  Successful
338  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
339  * @retval  #TETHERING_ERROR_OPERATION_FAILED  Operation failed
340  * @retval  #TETHERING_ERROR_NOT_ENABLED  Not enabled
341  * @pre  tethering must be enabled.
342  * @see  tethering_is_enabled()
343  * @see  tethering_enable()
344  */
345 int tethering_get_data_usage(tethering_h tethering, tethering_data_usage_cb callback, void *user_data);
346
347 /**
348  * @brief Gets the client which is connected by USB tethering.
349  * @param[in]  tethering  The handle of tethering
350  * @param[in]  type  The type of tethering
351  * @param[in]  callback  The callback function to invoke
352  * @param[in]  user_data  The user data to be passed to the callback function
353  * @retval  #TETHERING_ERROR_NONE  Successful
354  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
355  * @retval  #TETHERING_ERROR_NOT_ENABLED  Not enabled
356  * @retval  #TETHERING_ERROR_OPERATION_FAILED  Operation failed
357  * @pre  tethering must be enabled.
358  * @see  tethering_is_enabled()
359  * @see  tethering_enable()
360  */
361 int tethering_foreach_connected_clients(tethering_h tethering, tethering_type_e type, tethering_connected_client_cb callback, void *user_data);
362
363 /**
364  * @brief Registers the callback function called when tethering is enabled.
365  * @param[in]  tethering  The handle of tethering
366  * @param[in]  type  The type of tethering
367  * @param[in]  callback  The callback function to invoke
368  * @param[in]  user_data  The user data to be passed to the callback function
369  * @retval  #TETHERING_ERROR_NONE  Successful
370  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
371  * @see  tethering_unset_enabled_cb()
372  */
373 int tethering_set_enabled_cb(tethering_h tethering, tethering_type_e type, tethering_enabled_cb callback, void *user_data);
374
375 /**
376  * @brief Unregisters the callback function called when tethering is disabled.
377  * @param[in]  tethering  The handle of tethering
378  * @param[in]  type  The type of tethering
379  * @retval  #TETHERING_ERROR_NONE  Successful
380  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
381  * @see  tethering_set_enabled_cb()
382  */
383 int tethering_unset_enabled_cb(tethering_h tethering, tethering_type_e type);
384
385 /**
386  * @brief Registers the callback function called when tethering is disabled.
387  * @param[in]  tethering  The handle of tethering
388  * @param[in]  type  The type of tethering
389  * @param[in]  callback  The callback function to invoke
390  * @param[in]  user_data  The user data to be passed to the callback function
391  * @retval  #TETHERING_ERROR_NONE  Successful
392  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
393  * @see  tethering_unset_disabled_cb()
394  */
395 int tethering_set_disabled_cb(tethering_h tethering, tethering_type_e type, tethering_disabled_cb callback, void *user_data);
396
397 /**
398  * @brief Unregisters the callback function called when tethering is disabled.
399  * @param[in]  tethering  The handle of tethering
400  * @param[in]  type  The type of tethering
401  * @retval  #TETHERING_ERROR_NONE  Successful
402  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
403  * @see  tethering_set_disabled_cb()
404  */
405 int tethering_unset_disabled_cb(tethering_h tethering, tethering_type_e type);
406
407 /**
408  * @brief Registers the callback function called when the state of connection is changed.
409  * @param[in]  tethering  The handle of tethering
410  * @param[in]  type  The type of tethering
411  * @param[in]  callback  The callback function to invoke
412  * @param[in]  user_data  The user data to be passed to the callback function
413  * @retval  #TETHERING_ERROR_NONE  Successful
414  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
415  * @see  tethering_unset_connection_state_changed_cb_cb()
416  */
417 int tethering_set_connection_state_changed_cb(tethering_h tethering, tethering_type_e type, tethering_connection_state_changed_cb callback, void *user_data);
418
419 /**
420  * @brief Unregisters the callback function called when the state of connection is changed.
421  * @param[in]  tethering  The handle of tethering
422  * @param[in]  type  The type of tethering
423  * @retval  #TETHERING_ERROR_NONE  Successful
424  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
425  * @see  tethering_set_connection_state_changed_cb()
426  */
427 int tethering_unset_connection_state_changed_cb(tethering_h tethering, tethering_type_e type);
428
429 /**
430  * @}
431  */
432
433
434 /**
435  * @addtogroup CAPI_NETWORK_TETHERING_WIFI_MODULE
436  * @{
437  */
438
439 /**
440  * @brief Sets the security type of Wi-Fi tethering.
441  * @remarks You must set this value when Wi-Fi tethering is disabled.
442  * @param[in]  tethering  The handle of tethering
443  * @param[in]  type  The security type
444  * @return 0 on success, otherwise negative error value.
445  * @retval  #TETHERING_ERROR_NONE  Successful
446  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
447  * @retval  #TETHERING_ERROR_OPERATION_FAILED  Operation failed
448  * @retval  #TETHERING_ERROR_INVALID_OPERATION  Invalid operation
449  * @pre  Wi-Fi tethering must be disabled.
450  * @see  tethering_is_enabled()
451  * @see  tethering_wifi_get_security_type()
452  */
453 int tethering_wifi_set_security_type(tethering_h tethering, tethering_wifi_security_type_e type);
454
455 /**
456  * @brief Gets the security type of Wi-Fi tethering.
457  * @param[in]  tethering  The handle of tethering
458  * @param[out]  type  The security type
459  * @return 0 on success, otherwise negative error value.
460  * @retval  #TETHERING_ERROR_NONE  Successful
461  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
462  * @retval  #TETHERING_ERROR_OPERATION_FAILED  Operation failed
463  * @see  tethering_wifi_set_security_type()
464  */
465 int tethering_wifi_get_security_type(tethering_h tethering, tethering_wifi_security_type_e *type);
466
467 /**
468  * @brief Gets the SSID (service set identifier).
469  * @remarks @a ssid must be released with free() by you.
470  * @param[in]  tethering  The handle of tethering
471  * @param[out]  ssid  The SSID
472  * @return 0 on success, otherwise negative error value.
473  * @retval  #TETHERING_ERROR_NONE  Successful
474  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
475  * @retval  #TETHERING_ERROR_OUT_OF_MEMORY  Out of memory
476  * @retval  #TETHERING_ERROR_OPERATION_FAILED  Operation failed
477  */
478 int tethering_wifi_get_ssid(tethering_h tethering, char **ssid);
479
480 /**
481  * @brief Sets the visibility of SSID(service set identifier).
482  * @details If you set the visibility invisible, then the SSID of this device is hidden. So, Wi-Fi scan can't find your device.
483  * @remarks You must set this value when Wi-Fi tethering is disabled.
484  * @param[in]  tethering  The handle of tethering
485  * @param[in]  visible  The visibility of SSID: (@c true = visible, @c false = invisible)
486  * @return 0 on success, otherwise negative error value.
487  * @retval  #TETHERING_ERROR_NONE  Successful
488  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
489  * @retval  #TETHERING_ERROR_OPERATION_FAILED  Operation failed
490  * @retval  #TETHERING_ERROR_INVALID_OPERATION  Invalid operation
491  * @pre  Wi-Fi tethering must be disabled.
492  * @see  tethering_is_enabled()
493  * @see  tethering_wifi_get_ssid_visibility()
494  */
495 int tethering_wifi_set_ssid_visibility(tethering_h tethering, bool visible);
496
497 /**
498  * @brief Gets the visibility of SSID(service set identifier).
499  * @details If the visibility is set invisible, then the SSID of this device is hidden. So, Wi-Fi scan can't find your device.
500  * @param[in]  tethering  The handle of tethering
501  * @param[out]  visible  The visibility of SSID: (@c true = visible, @c false = invisible)
502  * @return 0 on success, otherwise negative error value.
503  * @retval  #TETHERING_ERROR_NONE  Successful
504  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
505  * @retval  #TETHERING_ERROR_OPERATION_FAILED  Operation failed
506  * @see  tethering_wifi_set_ssid_visibility()
507  */
508 int tethering_wifi_get_ssid_visibility(tethering_h tethering, bool *visible);
509
510 /**
511  * @brief Sets the passphrase.
512  * @remarks You must set this value when Wi-Fi tethering is disabled.
513  * @param[in]  tethering  The handle of tethering
514  * @param[in]  passphrase  The passphrase
515  * @return 0 on success, otherwise negative error value.
516  * @retval  #TETHERING_ERROR_NONE  Successful
517  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
518  * @retval  #TETHERING_ERROR_OPERATION_FAILED  Operation failed
519  * @retval  #TETHERING_ERROR_INVALID_OPERATION  Invalid operation
520  * @pre  Wi-Fi tethering must be disabled.
521  * @see  tethering_is_enabled()
522  * @see  tethering_wifi_get_passphrase()
523  */
524 int tethering_wifi_set_passphrase(tethering_h tethering, const char *passphrase);
525
526 /**
527  * @brief Gets the passphrase.
528  * @remarks @a passphrase must be released with free() by you.
529  * @param[in]  tethering  The handle of tethering
530  * @param[out]  passphrase  The passphrase
531  * @return 0 on success, otherwise negative error value.
532  * @retval  #TETHERING_ERROR_NONE  Successful
533  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
534  * @retval  #TETHERING_ERROR_OUT_OF_MEMORY  Out of memory
535  * @retval  #TETHERING_ERROR_OPERATION_FAILED  Operation failed
536  * @see  tethering_wifi_set_passphrase()
537  */
538 int tethering_wifi_get_passphrase(tethering_h tethering, char **passphrase);
539
540 /**
541  * @}
542  */
543
544
545 /**
546  * @addtogroup CAPI_NETWORK_TETHERING_CLIENT_MODULE
547  * @{
548  */
549
550 /**
551  * @brief  Clones the handle of client.
552  * @remarks  The @cloned_client must be release tethering_client_destroy() by you.
553  * @param[out]  dest  The cloned client handle
554  * @param[in]  origin  The origin client handle
555  * @return  0 on success, otherwise a negative error value.
556  * @retval  #TETHERING_ERROR_NONE  Successful
557  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
558  * @retval  #TETHERING_ERROR_OUT_OF_MEMORY  Out of memory
559  * @see  tethering_client_destroy()
560  */
561 int tethering_client_clone(tethering_client_h *dest, tethering_client_h origin);
562
563 /**
564  * @brief  Destroys the handle of client.
565  * @param[in]  client  The handle of client
566  * @return  0 on success, otherwise a negative error value.
567  * @retval  #TETHERING_ERROR_NONE  Successful
568  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
569  * @see  tethering_client_clone()
570  */
571 int tethering_client_destroy(tethering_client_h client);
572
573 /**
574  * @brief  Gets the tethering type of client.
575  * @param[in]  client  The handle of client
576  * @param[out]  type  The type of tethering
577  * @return  0 on success, otherwise a negative error value.
578  * @retval  #TETHERING_ERROR_NONE  Successful
579  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
580  * @see  tethering_usb_get_connected_client()
581  * @see  tethering_connection_state_changed_cb()
582  */
583 int tethering_client_get_tethering_type(tethering_client_h client, tethering_type_e *type);
584
585 /**
586  * @brief  Gets the name of client.
587  * @remarks @a name must be released with free() by you.
588  * @param[in]  client  The handle of client
589  * @param[out]  name  The name of client
590  * @return  0 on success, otherwise a negative error value.
591  * @retval  #TETHERING_ERROR_NONE  Successful
592  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
593  * @retval  #TETHERING_ERROR_OUT_OF_MEMORY  Out of memory
594  * @see  tethering_usb_get_connected_client()
595  * @see  tethering_connection_state_changed_cb()
596  */
597 int tethering_client_get_name(tethering_client_h client, char **name);
598
599 /**
600  * @brief  Gets the IP address of client.
601  * @remarks @a ip_address must be released with free() by you.
602  * @param[in]  client  The handle of client
603  * @param[in]  address_family  The address family of IP address. Currently, #TETHERING_ADDRESS_FAMILY_IPV4 is only supported.
604  * @param[out]  ip_address  The IP address
605  * @return  0 on success, otherwise a negative error value.
606  * @retval  #TETHERING_ERROR_NONE  Successful
607  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
608  * @retval  #TETHERING_ERROR_OUT_OF_MEMORY  Out of memory
609  * @see  tethering_usb_get_connected_client()
610  * @see  tethering_connection_state_changed_cb()
611  */
612 int tethering_client_get_ip_address(tethering_client_h client, tethering_address_family_e address_family, char **ip_address);
613
614 /**
615  * @brief  Gets the MAC address of client such as "FC:A1:3E:D6:B1:B1".
616  * @remarks @a mac_address must be released with free() by you.
617  * @param[in]  client  The handle of client
618  * @param[out]  mac_address  The MAC address
619  * @return  0 on success, otherwise a negative error value.
620  * @retval  #TETHERING_ERROR_NONE  Successful
621  * @retval  #TETHERING_ERROR_INVALID_PARAMETER  Invalid parameter
622  * @retval  #TETHERING_ERROR_OUT_OF_MEMORY  Out of memory
623  * @see  tethering_usb_get_connected_client()
624  * @see  tethering_connection_state_changed_cb()
625  */
626 int tethering_client_get_mac_address(tethering_client_h client, char **mac_address);
627
628 /**
629  * @}
630  */
631
632
633 #ifdef __cplusplus
634  }
635 #endif
636
637 #endif /* __TIZEN_NETWORK_TETHERING_H__ */
638
639