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