2c9f627064ac368513375e726c7e2e23328b8533
[platform/core/api/wifi.git] / include / wifi.h
1 /*
2  * Copyright (c) 2012-2013 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_WIFI_H__
18 #define __TIZEN_NETWORK_WIFI_H__
19
20 #include <tizen.h>
21
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25
26 /**
27  * @file wifi.h
28  */
29
30 /**
31 * @addtogroup CAPI_NETWORK_WIFI_MANAGER_MODULE
32 * @{
33 */
34
35 /**
36  * @brief Enumeration for the Wi-Fi error type.
37  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
38  */
39 typedef enum
40 {
41     WIFI_ERROR_NONE = TIZEN_ERROR_NONE,                                                 /**< Successful */
42     WIFI_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER,                       /**< Invalid parameter */
43     WIFI_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY,                               /**< Out of memory error */
44     WIFI_ERROR_INVALID_OPERATION = TIZEN_ERROR_INVALID_OPERATION,                       /**< Invalid operation */
45     WIFI_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED = TIZEN_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED, /**< Address family not supported */
46     WIFI_ERROR_OPERATION_FAILED = TIZEN_ERROR_WIFI|0x0301,                              /**< Operation failed */
47     WIFI_ERROR_NO_CONNECTION = TIZEN_ERROR_WIFI|0x0302,                                 /**< There is no connected AP */
48     WIFI_ERROR_NOW_IN_PROGRESS = TIZEN_ERROR_NOW_IN_PROGRESS,                           /**< Now in progress */
49     WIFI_ERROR_ALREADY_EXISTS = TIZEN_ERROR_WIFI|0x0303,                                /**< Already exists */
50     WIFI_ERROR_OPERATION_ABORTED = TIZEN_ERROR_WIFI|0x0304,                             /**< Operation is aborted */
51     WIFI_ERROR_DHCP_FAILED = TIZEN_ERROR_WIFI|0x0306,                                   /**< DHCP failed */
52     WIFI_ERROR_INVALID_KEY = TIZEN_ERROR_WIFI|0x0307,                                   /**< Invalid key */
53     WIFI_ERROR_NO_REPLY = TIZEN_ERROR_WIFI|0x0308,                                      /**< No reply */
54     WIFI_ERROR_SECURITY_RESTRICTED = TIZEN_ERROR_WIFI|0x0309,                           /**< Restricted by security system policy */
55     WIFI_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED,                       /**< Permission Denied */
56     WIFI_ERROR_NOT_SUPPORTED = TIZEN_ERROR_NOT_SUPPORTED                /**< Not Supported */
57 } wifi_error_e;
58
59 /**
60 * @}
61 */
62
63
64 /**
65 * @addtogroup CAPI_NETWORK_WIFI_MONITOR_MODULE
66 * @{
67 */
68
69 /**
70  * @brief Enumeration for the state of the Wi-Fi device.
71  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
72  */
73 typedef enum
74 {
75     WIFI_DEVICE_STATE_DEACTIVATED = 0,  /**< Wi-Fi is Deactivated */
76     WIFI_DEVICE_STATE_ACTIVATED = 1,    /**< Wi-Fi is activated */
77 } wifi_device_state_e;
78
79 /**
80  * @brief Enumeration for the state of the Wi-Fi connection.
81  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
82  */
83 typedef enum
84 {
85         WIFI_CONNECTION_STATE_FAILURE = -1,             /**< Connection failed state */
86         WIFI_CONNECTION_STATE_DISCONNECTED = 0,         /**< Disconnected state */
87         WIFI_CONNECTION_STATE_ASSOCIATION = 1,          /**< Association state */
88         WIFI_CONNECTION_STATE_CONFIGURATION = 2,        /**< Configuration state */
89         WIFI_CONNECTION_STATE_CONNECTED = 3,            /**< Connected state */
90 } wifi_connection_state_e;
91
92 /**
93  * @brief Enumeration for the RSSI level.
94  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
95  */
96 typedef enum
97 {
98     WIFI_RSSI_LEVEL_0 = 0,  /**< level 0 */
99     WIFI_RSSI_LEVEL_1 = 1,  /**< level 1 */
100     WIFI_RSSI_LEVEL_2 = 2,  /**< level 2 */
101     WIFI_RSSI_LEVEL_3 = 3,  /**< level 3 */
102     WIFI_RSSI_LEVEL_4 = 4,  /**< level 4 */
103 } wifi_rssi_level_e;
104
105 /**
106 * @}
107 */
108
109
110 /**
111 * @addtogroup CAPI_NETWORK_WIFI_AP_NETWORK_MODULE
112 * @{
113 */
114
115 /**
116  * @brief Enumeration for the Net IP configuration type.
117  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
118  */
119 typedef enum
120 {
121     WIFI_IP_CONFIG_TYPE_NONE = 0,       /**< Not defined */
122     WIFI_IP_CONFIG_TYPE_STATIC  = 1,    /**< Manual IP configuration */
123     WIFI_IP_CONFIG_TYPE_DYNAMIC = 2,    /**< Config IP using DHCP client*/
124     WIFI_IP_CONFIG_TYPE_AUTO = 3,       /**< Config IP from Auto IP pool (169.254/16). Later with DHCP client, if available */
125     WIFI_IP_CONFIG_TYPE_FIXED = 4,      /**< Indicates an IP address that can not be modified */
126 } wifi_ip_config_type_e;
127
128 /**
129  * @brief Enumeration for the address type.
130  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
131  */
132 typedef enum
133 {
134     WIFI_ADDRESS_FAMILY_IPV4 = 0,  /**< IPV4 Address family */
135     WIFI_ADDRESS_FAMILY_IPV6 = 1,  /**< IPV6 Address family */
136 } wifi_address_family_e;
137
138 /**
139  * @brief Enumeration for the proxy method type.
140  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
141  */
142 typedef enum
143 {
144     WIFI_PROXY_TYPE_DIRECT = 0, /**< Direct connection */
145     WIFI_PROXY_TYPE_AUTO = 1,   /**< Auto configuration(Use PAC file). If URL property is not set, DHCP/WPAD auto-discover will be tried */
146     WIFI_PROXY_TYPE_MANUAL  = 2 /**< Manual configuration */
147 } wifi_proxy_type_e;
148
149 /**
150 * @}
151 */
152
153
154 /**
155 * @addtogroup CAPI_NETWORK_WIFI_AP_SECURITY_MODULE
156 * @{
157 */
158
159 /**
160  * @brief Enumeration for Wi-Fi security type.
161  * @details The following security modes are used in infrastructure and ad-hoc mode.
162  * For now all EAP security mechanisms are provided only in infrastructure mode.
163  *
164  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
165  */
166 typedef enum
167 {
168     WIFI_SECURITY_TYPE_NONE = 0,        /**< Security disabled */
169     WIFI_SECURITY_TYPE_WEP = 1,         /**< WEP */
170     WIFI_SECURITY_TYPE_WPA_PSK = 2,     /**< WPA-PSK */
171     WIFI_SECURITY_TYPE_WPA2_PSK = 3,    /**< WPA2-PSK */
172     WIFI_SECURITY_TYPE_EAP = 4,         /**< EAP */
173 } wifi_security_type_e;
174
175 /**
176  * @brief Enumeration for Wi-Fi encryption type.
177  * @details The following encryption modes are used in infrastructure and ad-hoc mode.
178  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
179  */
180 typedef enum
181 {
182     WIFI_ENCRYPTION_TYPE_NONE = 0,              /**< Encryption disabled */
183     WIFI_ENCRYPTION_TYPE_WEP = 1,               /**< WEP */
184     WIFI_ENCRYPTION_TYPE_TKIP = 2,              /**< TKIP */
185     WIFI_ENCRYPTION_TYPE_AES = 3,               /**< AES */
186     WIFI_ENCRYPTION_TYPE_TKIP_AES_MIXED = 4,    /**< TKIP and AES are both supported */
187 } wifi_encryption_type_e;
188
189 /**
190 * @}
191 */
192
193
194 /**
195 * @addtogroup CAPI_NETWORK_WIFI_AP_SECURITY_EAP_MODULE
196 * @{
197 */
198
199 /**
200  * @brief Enumeration for EAP type.
201  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
202  */
203 typedef enum
204 {
205     WIFI_EAP_TYPE_PEAP = 0,     /**< EAP PEAP type */
206     WIFI_EAP_TYPE_TLS = 1,      /**< EAP TLS type */
207     WIFI_EAP_TYPE_TTLS = 2,     /**< EAP TTLS type */
208     WIFI_EAP_TYPE_SIM = 3,      /**< EAP SIM type */
209     WIFI_EAP_TYPE_AKA = 4,      /**< EAP AKA type */
210 } wifi_eap_type_e;
211
212 /**
213  * @brief Enumeration for EAP phase2 authentication type.
214  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
215  */
216 typedef enum
217 {
218     WIFI_EAP_AUTH_TYPE_NONE = 0,        /**< EAP phase2 authentication none */
219     WIFI_EAP_AUTH_TYPE_PAP = 1,         /**< EAP phase2 authentication PAP */
220     WIFI_EAP_AUTH_TYPE_MSCHAP = 2,      /**< EAP phase2 authentication MSCHAP */
221     WIFI_EAP_AUTH_TYPE_MSCHAPV2 = 3,    /**< EAP phase2 authentication MSCHAPv2 */
222     WIFI_EAP_AUTH_TYPE_GTC = 4,         /**< EAP phase2 authentication GTC */
223     WIFI_EAP_AUTH_TYPE_MD5 = 5,         /**< EAP phase2 authentication MD5 */
224 } wifi_eap_auth_type_e;
225
226 /**
227 * @}
228 */
229
230
231 /**
232 * @addtogroup CAPI_NETWORK_WIFI_AP_MODULE
233 * @{
234 */
235
236 /**
237  * @brief The Wi-Fi access point handle.
238  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
239  */
240 typedef void* wifi_ap_h;
241
242 /**
243 * @}
244 */
245
246 /**
247 * @addtogroup CAPI_NETWORK_WIFI_CONFIG_MODULE
248 * @{
249 */
250
251 /**
252  * @brief The Wi-Fi access point configuration handle
253  * @since_tizen 2.4
254  */
255 typedef void *wifi_config_h;
256
257 /**
258 * @}
259 */
260
261 /**
262 * @addtogroup CAPI_NETWORK_WIFI_MANAGER_MODULE
263 * @{
264 */
265
266 /**
267  * @brief Called when you get the found access point repeatedly.
268  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
269  * @remarks @a ap is valid only in this function. In order to use @a ap outside this function, you must copy the ap with wifi_ap_clone().
270  * @param[in]  ap  The access point
271  * @param[in]  user_data  The user data passed from the request function
272  * @return  @c true to continue with the next iteration of the loop, \n
273  *          otherwise @c false to break out of the loop
274  * @pre  wifi_foreach_found_aps() will invoke this callback.
275  * @pre  wifi_foreach_found_specific_aps() will invoke this callback.
276  * @see  wifi_foreach_found_aps()
277  * @see  wifi_foreach_found_specific_aps()
278  */
279 typedef bool(*wifi_found_ap_cb)(wifi_ap_h ap, void *user_data);
280
281 /**
282  * @brief Called when the scan is finished.
283  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
284  * @param[in] error_code  The error code
285  * @param[in] user_data The user data passed from the callback registration function
286  * @see wifi_scan()
287  * @see wifi_set_background_scan_cb()
288  * @see wifi_unset_background_scan_cb()
289  */
290 typedef void(*wifi_scan_finished_cb)(wifi_error_e error_code, void *user_data);
291
292 /**
293  * @brief Called after wifi_activate() or wifi_activate_with_wifi_picker_tested() is completed.
294  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
295  * @param[in] result  The result
296  * @param[in] user_data The user data passed from wifi_activate() and wifi_activate_with_wifi_picker_tested()
297  * @pre wifi_activate() or wifi_activate_with_wifi_picker_tested() will invoke this callback function.
298  * @see wifi_activate()
299  * @see wifi_activate_with_wifi_picker_tested()
300  */
301 typedef void(*wifi_activated_cb)(wifi_error_e result, void *user_data);
302
303 /**
304  * @brief Called after wifi_deactivate() is completed.
305  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
306  * @param[in] result  The result
307  * @param[in] user_data The user data passed from wifi_deactivate()
308  * @pre wifi_deactivate() will invoke this callback function.
309  * @see wifi_deactivate()
310  */
311 typedef void(*wifi_deactivated_cb)(wifi_error_e result, void *user_data);
312
313 /**
314  * @brief Called after either wifi_connect() or wifi_connect_by_wps_pbc() or wifi_connect_by_wps_pin() are completed.
315  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
316  * @param[in] result  The result
317  * @param[in] user_data The user data passed from either wifi_connect() or wifi_connect_by_wps_pbc() or wifi_connect_by_wps_pin()
318  * @pre Either wifi_connect() or wifi_connect_by_wps_pbc() or wifi_connect_by_wps_pin() will invoke this callback function.
319  * @see wifi_connect()
320  * @see wifi_connect_by_wps_pbc()
321  * @see wifi_connect_by_wps_pin()
322  */
323 typedef void(*wifi_connected_cb)(wifi_error_e result, void *user_data);
324
325 /**
326  * @brief Called after wifi_disconnect() is completed.
327  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
328  * @param[in] result  The result
329  * @param[in] user_data The user data passed from wifi_disconnect()
330  * @pre wifi_disconnect() will invoke this callback function.
331  * @see wifi_disconnect()
332  */
333 typedef void(*wifi_disconnected_cb)(wifi_error_e result, void *user_data);
334
335 /**
336 * @}
337 */
338
339
340 /**
341 * @addtogroup CAPI_NETWORK_WIFI_MONITOR_MODULE
342 * @{
343 */
344
345 /**
346  * @brief Called when the device state is changed.
347  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
348  * @param[in] state  The device state
349  * @param[in] user_data The user data passed from the callback registration function
350  * @see wifi_set_device_state_changed_cb()
351  * @see wifi_unset_device_state_changed_cb()
352  */
353 typedef void(*wifi_device_state_changed_cb)(wifi_device_state_e state, void *user_data);
354
355 /**
356  * @brief Called when the connection state is changed.
357  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
358  * @param[in] state  The connection state
359  * @param[in] ap  The access point
360  * @param[in] user_data The user data passed from the callback registration function
361  * @see wifi_set_connection_state_changed_cb()
362  * @see wifi_unset_connection_state_changed_cb()
363  */
364 typedef void(*wifi_connection_state_changed_cb)(wifi_connection_state_e state, wifi_ap_h ap, void *user_data);
365
366 /**
367  * @brief Called when the RSSI of connected Wi-Fi is changed.
368  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
369  * @param[in] rssi_level  The level of RSSI
370  * @param[in] user_data The user data passed from the callback registration function
371  * @see wifi_set_rssi_level_changed_cb()
372  * @see wifi_unset_rssi_level_changed_cb()
373  */
374 typedef void(*wifi_rssi_level_changed_cb)(wifi_rssi_level_e rssi_level, void *user_data);
375
376 /**
377 * @}
378 */
379
380 /**
381 * @addtogroup CAPI_NETWORK_WIFI_CONFIG_MODULE
382 * @{
383 */
384
385 /**
386  * @brief Called when you get the found access point configurations repeatedly.
387  * @since_tizen 2.4
388  * @remarks @a config is valid only in this function. In order to use @a config outside this function, you must copy the config with wifi_config_clone().
389  *
390  * @param[in]  config           The access point configuration handle
391  * @param[in]  user_data        The user data passed from the request function
392  *
393  * @return  @c true to continue with the next iteration of the loop, otherwise @c false to break out of the loop \n
394  * @pre  wifi_config_foreach_configuration() will invoke this callback.
395  * @see  wifi_config_foreach_configuration()
396  */
397 typedef bool (*wifi_config_list_cb)(const wifi_config_h config, void *user_data);
398
399 /**
400 * @}
401 */
402
403 /**
404 * @addtogroup CAPI_NETWORK_WIFI_MODULE
405 * @{
406 */
407
408 /**
409  * @brief Initializes Wi-Fi.
410  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
411  * @privlevel public
412  * @privilege %http://tizen.org/privilege/network.get
413  * @return @c 0 on success, otherwise negative error value
414  * @retval #WIFI_ERROR_NONE  Successful
415  * @retval #WIFI_ERROR_INVALID_OPERATION  Invalid operation
416  * @retval #WIFI_ERROR_OPERATION_FAILED  Operation failed
417  * @retval #WIFI_ERROR_PERMISSION_DENIED Permission Denied
418  * @retval #WIFI_ERROR_NOT_SUPPORTED    Not supported
419  */
420 int wifi_initialize(void);
421
422 /**
423  * @brief Deinitializes Wi-Fi.
424  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
425  * @return 0 on success, otherwise negative error value
426  * @retval #WIFI_ERROR_NONE  Successful
427  * @retval #WIFI_ERROR_INVALID_OPERATION  Invalid operation
428  * @retval #WIFI_ERROR_OPERATION_FAILED  Operation failed
429  * @retval #WIFI_ERROR_NOT_SUPPORTED    Not supported
430  */
431 int wifi_deinitialize(void);
432
433 /**
434 * @}
435 */
436
437
438 /**
439 * @addtogroup CAPI_NETWORK_WIFI_MANAGER_MODULE
440 * @{
441 */
442
443 /**
444  * @brief Activates Wi-Fi asynchronously.
445  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
446  * @privlevel public
447  * @privilege %http://tizen.org/privilege/network.set \n
448  *            %http://tizen.org/privilege/network.get
449  * @remark This API needs both privileges.
450  * @param[in] callback  The callback function to be called \n
451  *                      This can be @c NULL if you don't want to get the notification.
452  * @param[in] user_data The user data passed to the callback function
453  * @return 0 on success, otherwise negative error value
454  * @retval #WIFI_ERROR_NONE  Successful
455  * @retval #WIFI_ERROR_INVALID_OPERATION  Invalid operation
456  * @retval #WIFI_ERROR_OPERATION_FAILED  Operation failed
457  * @retval #WIFI_ERROR_SECURITY_RESTRICTED  Restricted by security system policy
458  * @retval #WIFI_ERROR_PERMISSION_DENIED Permission Denied
459  * @retval #WIFI_ERROR_NOT_SUPPORTED    Not supported
460  * @post wifi_activated_cb() will be invoked.
461  * @see wifi_activated_cb()
462  * @see wifi_deactivate()
463  */
464 int wifi_activate(wifi_activated_cb callback, void *user_data);
465
466 /**
467  * @brief Activates Wi-Fi asynchronously and displays Wi-Fi picker (popup) when Wi-Fi is not automatically connected.
468  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
469  * @privlevel public
470  * @privilege %http://tizen.org/privilege/network.set \n
471  *            %http://tizen.org/privilege/network.get
472  * @remark This API needs both privileges.
473  * @param[in] callback  The callback function to be called \n
474  *                      This can be @c NULL if you don't want to get the notification.
475  * @param[in] user_data The user data passed to the callback function
476  * @return 0 on success, otherwise negative error value
477  * @retval #WIFI_ERROR_NONE  Successful
478  * @retval #WIFI_ERROR_INVALID_OPERATION  Invalid operation
479  * @retval #WIFI_ERROR_OPERATION_FAILED  Operation failed
480  * @retval #WIFI_ERROR_SECURITY_RESTRICTED  Restricted by security system policy
481  * @retval #WIFI_ERROR_PERMISSION_DENIED Permission Denied
482  * @retval #WIFI_ERROR_NOT_SUPPORTED    Not supported
483  * @post wifi_activated_cb() will be invoked.
484  * @see wifi_activated_cb()
485  * @see wifi_deactivate()
486  */
487 int wifi_activate_with_wifi_picker_tested(wifi_activated_cb callback, void *user_data);
488
489 /**
490  * @brief Deactivates Wi-Fi asynchronously.
491  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
492  * @privlevel public
493  * @privilege %http://tizen.org/privilege/network.set \n
494  *            %http://tizen.org/privilege/network.get
495  * @remark This API needs both privileges.
496  * @param[in] callback  The callback function to be called \n
497  *                      This can be @c NULL if you don't want to get the notification.
498  * @param[in] user_data The user data passed to the callback function
499  * @return 0 on success, otherwise negative error value
500  * @retval #WIFI_ERROR_NONE  Successful
501  * @retval #WIFI_ERROR_INVALID_OPERATION  Invalid operation
502  * @retval #WIFI_ERROR_OPERATION_FAILED  Operation failed
503  * @retval #WIFI_ERROR_PERMISSION_DENIED Permission Denied
504  * @retval #WIFI_ERROR_NOT_SUPPORTED    Not supported
505  * @post wifi_deactivated_cb() will be invoked.
506  * @see wifi_deactivated_cb()
507  * @see wifi_activate()
508  */
509 int wifi_deactivate(wifi_deactivated_cb callback, void *user_data);
510
511 /**
512  * @brief Checks whether Wi-Fi is activated.
513  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
514  * @privlevel public
515  * @privilege %http://tizen.org/privilege/network.get
516  * @param[out] activated  @c ture if Wi-Fi is activated,
517  *                        otherwise @c false if Wi-Fi is not activated.
518  * @return 0 on success, otherwise negative error value
519  * @retval #WIFI_ERROR_NONE  Successful
520  * @retval #WIFI_ERROR_INVALID_PARAMETER  Invalid parameter
521  * @retval #WIFI_ERROR_OPERATION_FAILED  Operation failed
522  * @retval #WIFI_ERROR_PERMISSION_DENIED Permission Denied
523  * @retval #WIFI_ERROR_NOT_SUPPORTED    Not supported
524  */
525 int wifi_is_activated(bool* activated);
526
527 /**
528  * @brief Gets the local MAC address.
529  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
530  * @remarks You must release @a mac_address using free().
531  * @param[out] mac_address  The MAC address
532  * @return 0 on success, otherwise negative error value
533  * @retval #WIFI_ERROR_NONE  Successful
534  * @retval #WIFI_ERROR_INVALID_PARAMETER  Invalid parameter
535  * @retval #WIFI_ERROR_OPERATION_FAILED  Operation failed
536  * @retval #WIFI_ERROR_NOT_SUPPORTED    Not supported
537  */
538 int wifi_get_mac_address(char** mac_address);
539
540 /**
541  * @brief Gets the name of the network interface.
542  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
543  * @privlevel public
544  * @privilege %http://tizen.org/privilege/network.get
545  * @remarks You must release @a name using free().
546  * @param[out] name  The name of network interface
547  * @return 0 on success, otherwise negative error value
548  * @retval #WIFI_ERROR_NONE  Successful
549  * @retval #WIFI_ERROR_INVALID_PARAMETER  Invalid parameter
550  * @retval #WIFI_ERROR_OUT_OF_MEMORY  Out of memory
551  * @retval #WIFI_ERROR_OPERATION_FAILED  Operation failed
552  * @retval #WIFI_ERROR_PERMISSION_DENIED Permission Denied
553  * @retval #WIFI_ERROR_NOT_SUPPORTED    Not supported
554  */
555 int wifi_get_network_interface_name(char** name);
556
557 /**
558  * @brief Starts scan asynchronously.
559  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
560  * @privlevel public
561  * @privilege %http://tizen.org/privilege/network.set \n
562  *            %http://tizen.org/privilege/network.get
563  * @remark This API needs both privileges.
564  * @param[in] callback  The callback function to be called
565  * @param[in] user_data The user data passed to the callback function
566  * @return 0 on success, otherwise negative error value
567  * @retval #WIFI_ERROR_NONE  Successful
568  * @retval #WIFI_ERROR_INVALID_PARAMETER  Invalid parameter
569  * @retval #WIFI_ERROR_INVALID_OPERATION  Invalid operation
570  * @retval #WIFI_ERROR_OPERATION_FAILED  Operation failed
571  * @retval #WIFI_ERROR_PERMISSION_DENIED Permission Denied
572  * @retval #WIFI_ERROR_NOT_SUPPORTED    Not supported
573  * @post This function invokes wifi_scan_finished_cb().
574  */
575 int wifi_scan(wifi_scan_finished_cb callback, void *user_data);
576
577 /**
578  * @brief Starts specific ap scan, asynchronously.
579  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0
580  * @privlevel public
581  * @privilege %http://tizen.org/privilege/network.set \n
582  *               %http://tizen.org/privilege/network.get
583  * @remark This API needs both privileges.
584  * @param[in] essid     The essid of hidden ap
585  * @param[in] callback  The callback function to be called
586  * @param[in] user_data The user data passed to the callback function
587  * @return 0 on success, otherwise negative error value.
588  * @retval #WIFI_ERROR_NONE  Successful
589  * @retval #WIFI_ERROR_INVALID_PARAMETER  Invalid parameter
590  * @retval #WIFI_ERROR_INVALID_OPERATION  Invalid operation
591  * @retval #WIFI_ERROR_OPERATION_FAILED  Operation failed
592  * @retval #WIFI_ERROR_PERMISSION_DENIED Permission Denied
593  * @retval #WIFI_ERROR_NOT_SUPPORTED    Not supported
594  * @post This function invokes wifi_scan_finished_cb().
595  */
596 int wifi_scan_specific_ap(const char* essid, wifi_scan_finished_cb callback, void* user_data);
597
598 /**
599  * @brief Gets the handle of the connected access point.
600  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
601  * @privlevel public
602  * @privilege %http://tizen.org/privilege/network.get
603  * @remarks You must release @a handle using wifi_ap_destroy().
604  * @param[out] ap  The access point handle
605  * @return 0 on success, otherwise negative error value
606  * @retval #WIFI_ERROR_NONE  Successful
607  * @retval #WIFI_ERROR_INVALID_PARAMETER  Invalid parameter
608  * @retval #WIFI_ERROR_OUT_OF_MEMORY  Out of memory
609  * @retval #WIFI_ERROR_NO_CONNECTION  There is no connected AP
610  * @retval #WIFI_ERROR_PERMISSION_DENIED Permission Denied
611  * @retval #WIFI_ERROR_NOT_SUPPORTED    Not supported
612  */
613 int wifi_get_connected_ap(wifi_ap_h* ap);
614
615 /**
616  * @brief Gets the result of the scan.
617  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
618  * @privlevel public
619  * @privilege %http://tizen.org/privilege/network.get
620  * @param[in] callback  The callback to be called
621  * @param[in] user_data The user data passed to the callback function
622  * @return 0 on success, otherwise negative error value
623  * @retval #WIFI_ERROR_NONE  Successful
624  * @retval #WIFI_ERROR_INVALID_PARAMETER  Invalid parameter
625  * @retval #WIFI_ERROR_OPERATION_FAILED  Operation failed
626  * @retval #WIFI_ERROR_PERMISSION_DENIED Permission Denied
627  * @retval #WIFI_ERROR_NOT_SUPPORTED    Not supported
628  * @post This function invokes wifi_found_ap_cb().
629  */
630 int wifi_foreach_found_aps(wifi_found_ap_cb callback, void *user_data);
631
632 /**
633  * @brief Gets the result of specific ap scan.
634  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0
635  * @privlevel public
636  * @privilege %http://tizen.org/privilege/network.get
637  * @param[in] callback  The callback to be called
638  * @param[in] user_data The user data passed to the callback function
639  * @return 0 on success, otherwise negative error value.
640  * @retval #WIFI_ERROR_NONE  Successful
641  * @retval #WIFI_ERROR_INVALID_PARAMETER  Invalid parameter
642  * @retval #WIFI_ERROR_OPERATION_FAILED  Operation failed
643  * @retval #WIFI_ERROR_PERMISSION_DENIED Permission Denied
644  * @retval #WIFI_ERROR_NOT_SUPPORTED    Not supported
645  * @post This function invokes wifi_found_ap_cb().
646  * @see wifi_scan_specific_ap()
647  */
648 int wifi_foreach_found_specific_aps(wifi_found_ap_cb callback, void* user_data);
649
650 /**
651  * @brief Connects the access point asynchronously.
652  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
653  * @privlevel public
654  * @privilege %http://tizen.org/privilege/network.set \n
655  *            %http://tizen.org/privilege/network.get
656  * @remark This API needs both privileges.
657  * @param[in] ap  The access point handle
658  * @param[in] callback  The callback function to be called \n
659  *                      This can be @c NULL if you don't want to get the notification.
660  * @param[in] user_data The user data passed to the callback function
661  * @return 0 on success, otherwise negative error value
662  * @retval #WIFI_ERROR_NONE  Successful
663  * @retval #WIFI_ERROR_INVALID_OPERATION  Invalid operation
664  * @retval #WIFI_ERROR_INVALID_PARAMETER  Invalid parameter
665  * @retval #WIFI_ERROR_OPERATION_FAILED  Operation failed
666  * @retval #WIFI_ERROR_PERMISSION_DENIED Permission Denied
667  * @retval #WIFI_ERROR_NOT_SUPPORTED    Not supported
668  * @post This function invokes wifi_connected_cb().
669  * @see wifi_connected_cb()
670  * @see wifi_connect_by_wps_pbc()
671  * @see wifi_connect_by_wps_pin()
672  * @see wifi_disconnect()
673  */
674 int wifi_connect(wifi_ap_h ap, wifi_connected_cb callback, void *user_data);
675
676 /**
677  * @brief Disconnects the access point asynchronously.
678  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
679  * @privlevel public
680  * @privilege %http://tizen.org/privilege/network.set \n
681  *            %http://tizen.org/privilege/network.get
682  * @remark This API needs both privileges.
683  * @param[in] ap  The access point handle
684  * @param[in] callback  The callback function to be called \n
685  *                      This can be @c NULL if you don't want to get the notification.
686  * @param[in] user_data The user data passed to the callback function
687  * @return 0 on success, otherwise negative error value
688  * @retval #WIFI_ERROR_NONE  Successful
689  * @retval #WIFI_ERROR_INVALID_OPERATION  Invalid operation
690  * @retval #WIFI_ERROR_INVALID_PARAMETER  Invalid parameter
691  * @retval #WIFI_ERROR_OPERATION_FAILED  Operation failed
692  * @retval #WIFI_ERROR_PERMISSION_DENIED Permission Denied
693  * @retval #WIFI_ERROR_NOT_SUPPORTED    Not supported
694  * @post This function invokes wifi_disconnected_cb().
695  * @see wifi_disconnected_cb()
696  * @see wifi_connect_by_wps_pbc()
697  * @see wifi_connect_by_wps_pin()
698  * @see wifi_connect()
699  */
700 int wifi_disconnect(wifi_ap_h ap, wifi_disconnected_cb callback, void *user_data);
701
702 /**
703  * @brief Connects the access point with WPS PBC asynchronously.
704  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
705  * @privlevel public
706  * @privilege %http://tizen.org/privilege/network.profile \n
707  *            %http://tizen.org/privilege/network.get
708  * @remark This API needs both privileges.
709  * @param[in] ap  The access point handle
710  * @param[in] callback  The callback function to be called \n
711  *                      This can be NULL if you don't want to get the notification.
712  * @param[in] user_data The user data passed to the callback function
713  * @return 0 on success, otherwise negative error value
714  * @retval #WIFI_ERROR_NONE  Successful
715  * @retval #WIFI_ERROR_INVALID_OPERATION  Invalid operation
716  * @retval #WIFI_ERROR_INVALID_PARAMETER  Invalid parameter
717  * @retval #WIFI_ERROR_OPERATION_FAILED  Operation failed
718  * @retval #WIFI_ERROR_PERMISSION_DENIED Permission Denied
719  * @retval #WIFI_ERROR_NOT_SUPPORTED    Not supported
720  * @post This function invokes wifi_connected_cb().
721  * @see wifi_connected_cb()
722  * @see wifi_connect()
723  * @see wifi_disconnect()
724  * @see wifi_ap_is_wps_supported()
725  */
726 int wifi_connect_by_wps_pbc(wifi_ap_h ap, wifi_connected_cb callback, void *user_data);
727
728 /**
729  * @brief Connects the access point with WPS PIN asynchronously.
730  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
731  * @privlevel public
732  * @privilege %http://tizen.org/privilege/network.profile \n
733  *            %http://tizen.org/privilege/network.get
734  * @remark This API needs both privileges.
735  * @param[in] ap  The access point handle
736  * @param[in] pin  The WPS PIN is a non-NULL string with length greater than 0 and less than or equal to 8
737  * @param[in] callback  The callback function to be called (this can be NULL if you don't want to get the notification)
738  * @param[in] user_data The user data passed to the callback function
739  * @return 0 on success, otherwise negative error value
740  * @retval #WIFI_ERROR_NONE  Successful
741  * @retval #WIFI_ERROR_INVALID_OPERATION  Invalid operation
742  * @retval #WIFI_ERROR_INVALID_PARAMETER  Invalid parameter
743  * @retval #WIFI_ERROR_OPERATION_FAILED  Operation failed
744  * @retval #WIFI_ERROR_PERMISSION_DENIED Permission Denied
745  * @retval #WIFI_ERROR_NOT_SUPPORTED    Not supported
746  * @post This function invokes wifi_connected_cb().
747  * @see wifi_connected_cb()
748  * @see wifi_connect()
749  * @see wifi_disconnect()
750  * @see wifi_ap_is_wps_supported()
751  */
752 int wifi_connect_by_wps_pin(wifi_ap_h ap, const char *pin, wifi_connected_cb callback, void *user_data);
753
754 /**
755  * @brief Deletes the information of stored access point and disconnects it when it connected.
756  * @details If an AP is connected, then connection information will be stored.
757  * This information is used when a connection to that AP is established automatically.
758  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
759  * @privlevel public
760  * @privilege %http://tizen.org/privilege/network.profile \n
761 *             %http://tizen.org/privilege/network.get
762  * @remark This API needs both privileges.
763  * @param[in] ap  The access point handle
764  * @return 0 on success, otherwise negative error value
765  * @retval #WIFI_ERROR_NONE  Successful
766  * @retval #WIFI_ERROR_INVALID_OPERATION  Invalid operation
767  * @retval #WIFI_ERROR_INVALID_PARAMETER  Invalid parameter
768  * @retval #WIFI_ERROR_OPERATION_FAILED  Operation failed
769  * @retval #WIFI_ERROR_PERMISSION_DENIED Permission Denied
770  * @retval #WIFI_ERROR_NOT_SUPPORTED    Not supported
771  */
772 int wifi_forget_ap(wifi_ap_h ap);
773
774 /**
775 * @}
776 */
777
778
779 /**
780 * @addtogroup CAPI_NETWORK_WIFI_MONITOR_MODULE
781 * @{
782 */
783
784 /**
785  * @brief Gets the connection state.
786  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
787  * @privlevel public
788  * @privilege %http://tizen.org/privilege/network.get
789  * @param[out] connection_state  The connection state
790  * @return 0 on success, otherwise negative error value
791  * @retval #WIFI_ERROR_NONE  Successful
792  * @retval #WIFI_ERROR_INVALID_PARAMETER  Invalid parameter
793  * @retval #WIFI_ERROR_OPERATION_FAILED  Operation failed
794  * @retval #WIFI_ERROR_PERMISSION_DENIED Permission Denied
795  * @retval #WIFI_ERROR_NOT_SUPPORTED    Not supported
796  */
797 int wifi_get_connection_state(wifi_connection_state_e* connection_state);
798
799 /**
800  * @brief Registers the callback called when the device state is changed.
801  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
802  * @param[in] callback  The callback function to be called
803  * @param[in] user_data The user data passed to the callback function
804  * @return 0 on success, otherwise negative error value
805  * @retval #WIFI_ERROR_NONE  Successful
806  * @retval #WIFI_ERROR_INVALID_OPERATION  Invalid operation
807  * @retval #WIFI_ERROR_INVALID_PARAMETER   Invalid parameter
808  * @retval #WIFI_ERROR_NOT_SUPPORTED    Not supported
809  */
810 int wifi_set_device_state_changed_cb(wifi_device_state_changed_cb callback, void *user_data);
811
812 /**
813  * @brief Unregisters the callback called when the device state is changed.
814  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
815  * @return 0 on success, otherwise negative error value
816  * @retval #WIFI_ERROR_NONE  Successful
817  * @retval #WIFI_ERROR_INVALID_OPERATION  Invalid operation
818  * @retval #WIFI_ERROR_NOT_SUPPORTED    Not supported
819  */
820 int wifi_unset_device_state_changed_cb(void);
821
822 /**
823  * @brief Registers the callback called when the background scan is finished periodically.
824  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
825  * @param[in] callback  The callback function to be called
826  * @param[in] user_data The user data passed to the callback function
827  * @return 0 on success, otherwise negative error value
828  * @retval #WIFI_ERROR_NONE  Successful
829  * @retval #WIFI_ERROR_INVALID_OPERATION  Invalid operation
830  * @retval #WIFI_ERROR_INVALID_PARAMETER   Invalid parameter
831  * @retval #WIFI_ERROR_NOT_SUPPORTED    Not supported
832  */
833 int wifi_set_background_scan_cb(wifi_scan_finished_cb callback, void *user_data);
834
835 /**
836  * @brief Unregisters the callback called when the scan is finished periodically.
837  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
838  * @return 0 on success, otherwise negative error value
839  * @retval #WIFI_ERROR_NONE  Successful
840  * @retval #WIFI_ERROR_INVALID_OPERATION  Invalid operation
841  * @retval #WIFI_ERROR_NOT_SUPPORTED    Not supported
842  */
843 int wifi_unset_background_scan_cb(void);
844
845 /**
846  * @brief Registers the callback called when the connection state is changed.
847  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
848  * @param[in] callback  The callback function to be called
849  * @param[in] user_data The user data passed to the callback function
850  * @return 0 on success, otherwise negative error value
851  * @retval #WIFI_ERROR_NONE  Successful
852  * @retval #WIFI_ERROR_INVALID_OPERATION  Invalid operation
853  * @retval #WIFI_ERROR_INVALID_PARAMETER   Invalid parameter
854  * @retval #WIFI_ERROR_NOT_SUPPORTED    Not supported
855  */
856 int wifi_set_connection_state_changed_cb(wifi_connection_state_changed_cb callback, void *user_data);
857
858 /**
859  * @brief Unregisters the callback called when the connection state is changed.
860  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
861  * @return 0 on success, otherwise negative error value
862  * @retval #WIFI_ERROR_NONE  Successful
863  * @retval #WIFI_ERROR_INVALID_OPERATION  Invalid operation
864  * @retval #WIFI_ERROR_NOT_SUPPORTED    Not supported
865  */
866 int wifi_unset_connection_state_changed_cb(void);
867
868 /**
869  * @brief Registers callback called when the RSSI of connected Wi-Fi is changed.
870  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
871  * @param[in] callback  The callback function to be called
872  * @param[in] user_data The user data passed to the callback function
873  * @return 0 on success, otherwise negative error value
874  * @retval #WIFI_ERROR_NONE  Successful
875  * @retval #WIFI_ERROR_INVALID_OPERATION  Invalid operation
876  * @retval #WIFI_ERROR_INVALID_PARAMETER   Invalid parameter
877  * @retval #WIFI_ERROR_NOT_SUPPORTED    Not supported
878  */
879 int wifi_set_rssi_level_changed_cb(wifi_rssi_level_changed_cb callback, void *user_data);
880
881 /**
882  * @brief Unregisters callback called when the RSSI of connected Wi-Fi is changed.
883  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
884  * @return 0 on success, otherwise negative error value
885  * @retval #WIFI_ERROR_NONE  Successful
886  * @retval #WIFI_ERROR_INVALID_OPERATION  Invalid operation
887  * @retval #WIFI_ERROR_NOT_SUPPORTED    Not supported
888  */
889 int wifi_unset_rssi_level_changed_cb(void);
890
891 /**
892 * @}
893 */
894
895
896 /**
897 * @addtogroup CAPI_NETWORK_WIFI_AP_MODULE
898 * @{
899 */
900
901 /**
902  * @brief Creates the access point handle.
903  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
904  * @remarks You must release @a ap using wifi_ap_destroy().
905  * @param[in] essid  The ESSID (Extended Service Set Identifier) should be null-terminated and can be UTF-8 encoded
906  * @param[out] ap  The access point handle
907  * @return 0 on success, otherwise negative error value
908  * @retval #WIFI_ERROR_NONE  Successful
909  * @retval #WIFI_ERROR_INVALID_PARAMETER  Invalid parameter
910  * @retval #WIFI_ERROR_OUT_OF_MEMORY  Out of memory
911  * @retval #WIFI_ERROR_PERMISSION_DENIED Permission Denied
912  * @retval #WIFI_ERROR_NOT_SUPPORTED    Not supported
913  * @see wifi_ap_destroy()
914  */
915 int wifi_ap_create(const char* essid, wifi_ap_h* ap);
916
917 /**
918  * @brief Creates the hidden access point handle.
919  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
920  * @remarks You must release @a ap using wifi_ap_destroy().
921  * @param[in] essid  The ESSID (Extended Service Set Identifier) should be null-terminated and can be UTF-8 encoded
922  * @param[out] ap  The access point handle
923  * @return 0 on success, otherwise negative error value
924  * @retval #WIFI_ERROR_NONE  Successful
925  * @retval #WIFI_ERROR_INVALID_PARAMETER  Invalid parameter
926  * @retval #WIFI_ERROR_OUT_OF_MEMORY  Out of memory
927  * @retval #WIFI_ERROR_NOT_SUPPORTED    Not supported
928  * @see wifi_ap_destroy()
929  */
930 int wifi_ap_hidden_create(const char* essid, wifi_ap_h* ap);
931
932 /**
933  * @brief Destroys the access point handle.
934  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
935  * @param[in] ap  The access point handle
936  * @return 0 on success, otherwise negative error value
937  * @retval #WIFI_ERROR_NONE  Successful
938  * @retval #WIFI_ERROR_INVALID_PARAMETER  Invalid parameter
939  * @retval #WIFI_ERROR_NOT_SUPPORTED    Not supported
940  * @see wifi_ap_create()
941  */
942 int wifi_ap_destroy(wifi_ap_h ap);
943
944 /**
945  * @brief Clones the access point handle.
946  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
947  * @remarks You must release @a cloned_ap using wifi_ap_destroy().
948  * @param[out] cloned_ap  The cloned access point handle
949  * @param[in] origin  The origin access point handle
950  * @return 0 on success, otherwise negative error value
951  * @retval #WIFI_ERROR_NONE  Successful
952  * @retval #WIFI_ERROR_INVALID_PARAMETER  Invalid parameter
953  * @retval #WIFI_ERROR_OUT_OF_MEMORY  Out of memory
954  * @retval #WIFI_ERROR_NOT_SUPPORTED    Not supported
955  * @see wifi_ap_destroy()
956  */
957 int wifi_ap_clone(wifi_ap_h* cloned_ap, wifi_ap_h origin);
958
959 /**
960  * @brief Refreshes the access point information.
961  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
962  * @privlevel public
963  * @privilege %http://tizen.org/privilege/network.get
964  * @remarks You should call this function in order to get the current access point information, because the information can be changed.
965  * @param[in] ap  The access point handle
966  * @return 0 on success, otherwise negative error value
967  * @retval #WIFI_ERROR_NONE  Successful
968  * @retval #WIFI_ERROR_INVALID_PARAMETER  Invalid parameter
969  * @retval #WIFI_ERROR_OPERATION_FAILED  Operation failed
970  * @retval #WIFI_ERROR_OUT_OF_MEMORY  Out of memory
971  * @retval #WIFI_ERROR_PERMISSION_DENIED Permission Denied
972  * @retval #WIFI_ERROR_NOT_SUPPORTED    Not supported
973  */
974 int wifi_ap_refresh(wifi_ap_h ap);
975
976 /**
977 * @}
978 */
979
980
981 /**
982 * @addtogroup CAPI_NETWORK_WIFI_AP_NETWORK_MODULE
983 * @{
984 */
985
986 /**
987  * @brief Gets ESSID (Extended Service Set Identifier).
988  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
989  * @remarks You must release @a essid using free().
990  * @param[in] ap  The access point handle
991  * @param[out] essid  The ESSID
992  * @return 0 on success, otherwise negative error value
993  * @retval #WIFI_ERROR_NONE  Successful
994  * @retval #WIFI_ERROR_INVALID_PARAMETER  Invalid parameter
995  * @retval #WIFI_ERROR_OUT_OF_MEMORY  Out of memory
996  * @retval #WIFI_ERROR_NOT_SUPPORTED    Not supported
997  */
998 int wifi_ap_get_essid(wifi_ap_h ap, char** essid);
999
1000 /**
1001  * @brief Gets BSSID (Basic Service Set Identifier).
1002  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1003  * @remarks You must release @a bssid using free().
1004  * @param[in] ap  The access point handle
1005  * @param[out] bssid  The BSSID
1006  * @return 0 on success, otherwise negative error value
1007  * @retval #WIFI_ERROR_NONE  Successful
1008  * @retval #WIFI_ERROR_INVALID_PARAMETER  Invalid parameter
1009  * @retval #WIFI_ERROR_OUT_OF_MEMORY  Out of memory
1010  * @retval #WIFI_ERROR_NOT_SUPPORTED    Not supported
1011  */
1012 int wifi_ap_get_bssid(wifi_ap_h ap, char** bssid);
1013
1014 /**
1015  * @brief Gets the RSSI.
1016  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1017  * @param[in] ap  The access point handle
1018  * @param[out] rssi  The RSSI
1019  * @return 0 on success, otherwise negative error value
1020  * @retval #WIFI_ERROR_NONE  Successful
1021  * @retval #WIFI_ERROR_INVALID_PARAMETER  Invalid parameter
1022  * @retval #WIFI_ERROR_OPERATION_FAILED  Operation failed
1023  * @retval #WIFI_ERROR_NOT_SUPPORTED    Not supported
1024  */
1025 int wifi_ap_get_rssi(wifi_ap_h ap, int* rssi);
1026
1027 /**
1028  * @brief Gets the frequency band (MHz).
1029  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1030  * @param[in] ap  The access point handle
1031  * @param[out] frequency  The frequency
1032  * @return 0 on success, otherwise negative error value
1033  * @retval #WIFI_ERROR_NONE  Successful
1034  * @retval #WIFI_ERROR_INVALID_PARAMETER  Invalid parameter
1035  * @retval #WIFI_ERROR_OPERATION_FAILED  Operation failed
1036  * @retval #WIFI_ERROR_NOT_SUPPORTED    Not supported
1037  */
1038 int wifi_ap_get_frequency(wifi_ap_h ap, int* frequency);
1039
1040 /**
1041  * @brief Gets the max speed (Mbps).
1042  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1043  * @param[in] ap  The access point handle
1044  * @param[out] max_speed  The max speed
1045  * @return 0 on success, otherwise negative error value
1046  * @retval #WIFI_ERROR_NONE  Successful
1047  * @retval #WIFI_ERROR_INVALID_PARAMETER  Invalid parameter
1048  * @retval #WIFI_ERROR_OPERATION_FAILED  Operation failed
1049  * @retval #WIFI_ERROR_NOT_SUPPORTED    Not supported
1050  */
1051 int wifi_ap_get_max_speed(wifi_ap_h ap, int* max_speed);
1052
1053 /**
1054  * @brief Checks whether the access point is favorite or not.
1055  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1056  * @param[in] ap  The access point handle
1057  * @param[out] favorite  @c true if access point is favorite,
1058  *                       otherwise @c false if access point is not favorite
1059  * @return 0 on success, otherwise negative error value
1060  * @retval #WIFI_ERROR_NONE  Successful
1061  * @retval #WIFI_ERROR_INVALID_PARAMETER  Invalid parameter
1062  * @retval #WIFI_ERROR_OPERATION_FAILED  Operation failed
1063  * @retval #WIFI_ERROR_NOT_SUPPORTED    Not supported
1064  */
1065 int wifi_ap_is_favorite(wifi_ap_h ap, bool* favorite);
1066
1067 /**
1068  * @brief Checks whether the access point is passpoint or not.
1069  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1070  * @param[in] ap  The access point handle
1071  * @param[out] passpoint  @c ture if access point is passpoint,
1072  *                        otherwise @c false if access point is not passpoint.
1073  * @return 0 on success, otherwise negative error value
1074  * @retval #WIFI_ERROR_NONE  Successful
1075  * @retval #WIFI_ERROR_INVALID_PARAMETER  Invalid parameter
1076  * @retval #WIFI_ERROR_OPERATION_FAILED  Operation failed
1077  * @retval #WIFI_ERROR_NOT_SUPPORTED    Not supported
1078  */
1079 int wifi_ap_is_passpoint(wifi_ap_h ap, bool* passpoint);
1080
1081 /**
1082  * @brief Gets the connection state.
1083  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1084  * @param[in] ap  The access point handle
1085  * @param[out] state  The connection state
1086  * @return 0 on success, otherwise negative error value
1087  * @retval #WIFI_ERROR_NONE  Successful
1088  * @retval #WIFI_ERROR_INVALID_PARAMETER  Invalid parameter
1089  * @retval #WIFI_ERROR_OPERATION_FAILED  Operation failed
1090  * @retval #WIFI_ERROR_NOT_SUPPORTED   Not supported
1091  */
1092 int wifi_ap_get_connection_state(wifi_ap_h ap, wifi_connection_state_e* state);
1093
1094 /**
1095  * @brief Gets the config type of IP.
1096  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1097  * @param[in] ap  The access point handle
1098  * @param[in] address_family  The address family
1099  * @param[out] type  The type of IP config
1100  * @return 0 on success, otherwise negative error value
1101  * @retval #WIFI_ERROR_NONE  Successful
1102  * @retval #WIFI_ERROR_INVALID_PARAMETER  Invalid parameter
1103  * @retval #WIFI_ERROR_OPERATION_FAILED  Operation failed
1104  * @retval #WIFI_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED  Address family not supported
1105  * @retval #WIFI_ERROR_NOT_SUPPORTED   Not supported
1106  */
1107 int wifi_ap_get_ip_config_type(wifi_ap_h ap, wifi_address_family_e address_family, wifi_ip_config_type_e* type);
1108
1109 /**
1110  * @brief Sets the config type of IP.
1111  * @details If you set IP config type to #WIFI_IP_CONFIG_TYPE_STATIC,
1112  * then IP address, Gateway and Subnet mask will be set to the initial value "0.0.0.0".
1113  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1114  * @privlevel public
1115  * @privilege %http://tizen.org/privilege/network.profile \n
1116  *            %http://tizen.org/privilege/network.get
1117  * @remark This API needs both privileges.
1118  * @param[in] ap  The access point handle
1119  * @param[in] address_family  The address family
1120  * @param[in] type  The type of IP config
1121  * @return 0 on success, otherwise negative error value
1122  * @retval #WIFI_ERROR_NONE  Successful
1123  * @retval #WIFI_ERROR_INVALID_PARAMETER  Invalid parameter
1124  * @retval #WIFI_ERROR_OPERATION_FAILED  Operation failed
1125  * @retval #WIFI_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED  Address family not supported
1126  * @retval #WIFI_ERROR_PERMISSION_DENIED Permission Denied
1127  * @retval #WIFI_ERROR_NOT_SUPPORTED   Not supported
1128  */
1129 int wifi_ap_set_ip_config_type(wifi_ap_h ap, wifi_address_family_e address_family, wifi_ip_config_type_e type);
1130
1131 /**
1132  * @brief Gets the IP address.
1133  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1134  * @remarks You must release @a ip_address using free().
1135  * @param[in] ap  The access point handle
1136  * @param[in] address_family  The address family
1137  * @param[out] ip_address  The IP address
1138  * @return 0 on success, otherwise negative error value
1139  * @retval #WIFI_ERROR_NONE  Successful
1140  * @retval #WIFI_ERROR_INVALID_PARAMETER  Invalid parameter
1141  * @retval #WIFI_ERROR_OUT_OF_MEMORY  Out of memory
1142  * @retval #WIFI_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED  Address family not supported
1143  * @retval #WIFI_ERROR_NOT_SUPPORTED   Not supported
1144  */
1145 int wifi_ap_get_ip_address(wifi_ap_h ap, wifi_address_family_e address_family, char** ip_address);
1146
1147 /**
1148  * @brief Sets the IP address.
1149  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1150  * @privlevel public
1151  * @privilege %http://tizen.org/privilege/network.profile \n
1152  *            %http://tizen.org/privilege/network.get
1153  * @remark This API needs both privileges.
1154  * @param[in] ap  The access point handle
1155  * @param[in] address_family  The address family
1156  * @param[in] ip_address  The IP address; if you set this value to NULL, then the existing value will be deleted
1157  * @return 0 on success, otherwise negative error value
1158  * @retval #WIFI_ERROR_NONE  Successful
1159  * @retval #WIFI_ERROR_INVALID_PARAMETER  Invalid parameter
1160  * @retval #WIFI_ERROR_OPERATION_FAILED  Operation failed
1161  * @retval #WIFI_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED  Address family not supported
1162  * @retval #WIFI_ERROR_PERMISSION_DENIED Permission Denied
1163  * @retval #WIFI_ERROR_NOT_SUPPORTED   Not supported
1164  */
1165 int wifi_ap_set_ip_address(wifi_ap_h ap, wifi_address_family_e address_family, const char* ip_address);
1166
1167 /**
1168  * @brief Gets the subnet mask.
1169  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1170  * @remarks You must release @a subnet_mask using free().
1171  * @param[in] ap  The access point handle
1172  * @param[in] address_family  The address family
1173  * @param[out] subnet_mask  The subnet mask
1174  * @return 0 on success, otherwise negative error value
1175  * @retval #WIFI_ERROR_NONE  Successful
1176  * @retval #WIFI_ERROR_INVALID_PARAMETER  Invalid parameter
1177  * @retval #WIFI_ERROR_OUT_OF_MEMORY  Out of memory
1178  * @retval #WIFI_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED  Address family not supported
1179  * @retval #WIFI_ERROR_NOT_SUPPORTED   Not supported
1180  */
1181 int wifi_ap_get_subnet_mask(wifi_ap_h ap, wifi_address_family_e address_family, char** subnet_mask);
1182
1183 /**
1184  * @brief Sets the subnet mask.
1185  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1186  * @privlevel public
1187  * @privilege %http://tizen.org/privilege/network.profile \n
1188  *            %http://tizen.org/privilege/network.get
1189  * @remark This API needs both privileges.
1190  * @param[in] ap  The access point handle
1191  * @param[in] address_family  The address family
1192  * @param[in] subnet_mask  The subnet mask; if you set this value to NULL, then the existing value will be deleted
1193  * @return 0 on success, otherwise negative error value
1194  * @retval #WIFI_ERROR_NONE  Successful
1195  * @retval #WIFI_ERROR_INVALID_PARAMETER  Invalid parameter
1196  * @retval #WIFI_ERROR_OPERATION_FAILED  Operation failed
1197  * @retval #WIFI_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED  Address family not supported
1198  * @retval #WIFI_ERROR_PERMISSION_DENIED Permission Denied
1199  * @retval #WIFI_ERROR_NOT_SUPPORTED   Not supported
1200  */
1201 int wifi_ap_set_subnet_mask(wifi_ap_h ap, wifi_address_family_e address_family, const char* subnet_mask);
1202
1203 /**
1204  * @brief Gets the gateway address.
1205  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1206  * @remarks You must release @a gateway_address using free().
1207  * @param[in] ap  The access point handle
1208  * @param[in] address_family  The address family
1209  * @param[out] gateway_address  The gateway address
1210  * @return 0 on success, otherwise negative error value
1211  * @retval #WIFI_ERROR_NONE  Successful
1212  * @retval #WIFI_ERROR_INVALID_PARAMETER  Invalid parameter
1213  * @retval #WIFI_ERROR_OUT_OF_MEMORY  Out of memory
1214  * @retval #WIFI_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED  Address family not supported
1215  * @retval #WIFI_ERROR_NOT_SUPPORTED   Not supported
1216  */
1217 int wifi_ap_get_gateway_address(wifi_ap_h ap, wifi_address_family_e address_family, char** gateway_address);
1218
1219 /**
1220  * @brief Sets the gateway address.
1221  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1222  * @privlevel public
1223  * @privilege %http://tizen.org/privilege/network.profile \n
1224  *            %http://tizen.org/privilege/network.get
1225  * @remark This API needs both privileges.
1226  * @param[in] ap  The access point handle
1227  * @param[in] address_family  The address family
1228  * @param[in] gateway_address  The gateway address \n
1229  *                             If you set this value to @c NULL, then the existing value will be deleted.
1230  * @return 0 on success, otherwise negative error value
1231  * @retval #WIFI_ERROR_NONE  Successful
1232  * @retval #WIFI_ERROR_INVALID_PARAMETER  Invalid parameter
1233  * @retval #WIFI_ERROR_OPERATION_FAILED  Operation failed
1234  * @retval #WIFI_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED  Address family not supported
1235  * @retval #WIFI_ERROR_PERMISSION_DENIED Permission Denied
1236  * @retval #WIFI_ERROR_NOT_SUPPORTED   Not supported
1237  */
1238 int wifi_ap_set_gateway_address(wifi_ap_h ap, wifi_address_family_e address_family, const char* gateway_address);
1239
1240 /**
1241  * @brief Gets the proxy address.
1242  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1243  * @remarks You must release @a proxy_address using free().
1244  * @param[in] ap  The access point handle
1245  * @param[in] address_family  The address family
1246  * @param[out] proxy_address  The proxy address
1247  * @return 0 on success, otherwise negative error value
1248  * @retval #WIFI_ERROR_NONE  Successful
1249  * @retval #WIFI_ERROR_INVALID_PARAMETER  Invalid parameter
1250  * @retval #WIFI_ERROR_OUT_OF_MEMORY  Out of memory
1251  * @retval #WIFI_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED  Address family not supported
1252  * @retval #WIFI_ERROR_NOT_SUPPORTED   Not supported
1253  */
1254 int wifi_ap_get_proxy_address(wifi_ap_h ap, wifi_address_family_e address_family, char** proxy_address);
1255
1256 /**
1257  * @brief Sets the proxy address.
1258  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1259  * @privlevel public
1260  * @privilege %http://tizen.org/privilege/network.profile \n
1261  *            %http://tizen.org/privilege/network.get
1262  * @remark This API needs both privileges.
1263  * @param[in] ap  The access point handle
1264  * @param[in] address_family  The address family
1265  * @param[in] proxy_address  The proxy address \n
1266  *                           If you set this value to @c NULL, then the existing value will be deleted.
1267  * @return 0 on success, otherwise negative error value
1268  * @retval #WIFI_ERROR_NONE  Successful
1269  * @retval #WIFI_ERROR_INVALID_PARAMETER  Invalid parameter
1270  * @retval #WIFI_ERROR_OPERATION_FAILED  Operation failed
1271  * @retval #WIFI_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED  Address family not supported
1272  * @retval #WIFI_ERROR_PERMISSION_DENIED Permission Denied
1273  * @retval #WIFI_ERROR_NOT_SUPPORTED   Not supported
1274  */
1275 int wifi_ap_set_proxy_address(wifi_ap_h ap, wifi_address_family_e address_family, const char* proxy_address);
1276
1277 /**
1278  * @brief Gets the Proxy type.
1279  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1280  * @param[in] ap  The access point handle
1281  * @param[out] type  The type of proxy
1282  * @return 0 on success, otherwise negative error value
1283  * @retval #WIFI_ERROR_NONE  Successful
1284  * @retval #WIFI_ERROR_INVALID_PARAMETER  Invalid parameter
1285  * @retval #WIFI_ERROR_OPERATION_FAILED  Operation failed
1286  * @retval #WIFI_ERROR_NOT_SUPPORTED   Not supported
1287  */
1288 int wifi_ap_get_proxy_type(wifi_ap_h ap, wifi_proxy_type_e* type);
1289
1290 /**
1291  * @brief Sets the Proxy address.
1292  * @details If you set Proxy type to #WIFI_PROXY_TYPE_AUTO or #WIFI_PROXY_TYPE_MANUAL, then Proxy will be restored.
1293  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1294  * @privlevel public
1295  * @privilege %http://tizen.org/privilege/network.profile \n
1296  *            %http://tizen.org/privilege/network.get
1297  * @remark This API needs both privileges.
1298  * @param[in] ap  The access point handle
1299  * @param[in] proxy_type  The type of proxy
1300  * @return 0 on success, otherwise negative error value
1301  * @retval #WIFI_ERROR_NONE  Successful
1302  * @retval #WIFI_ERROR_INVALID_PARAMETER  Invalid parameter
1303  * @retval #WIFI_ERROR_OPERATION_FAILED  Operation failed
1304  * @retval #WIFI_ERROR_PERMISSION_DENIED Permission Denied
1305  * @retval #WIFI_ERROR_NOT_SUPPORTED   Not supported
1306  */
1307 int wifi_ap_set_proxy_type(wifi_ap_h ap, wifi_proxy_type_e proxy_type);
1308
1309 /**
1310  * @brief Gets the DNS address.
1311  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1312  * @remarks The allowance of DNS address is @c 2.You must release @a dns_address using free().
1313  * @param[in] ap  The access point handle
1314  * @param[in] order  The order of DNS address; it starts from 1, which means first DNS address
1315  * @param[in] address_family  The address family
1316  * @param[out] dns_address  The DNS address
1317  * @return 0 on success, otherwise negative error value
1318  * @retval #WIFI_ERROR_NONE  Successful
1319  * @retval #WIFI_ERROR_INVALID_PARAMETER  Invalid parameter
1320  * @retval #WIFI_ERROR_OUT_OF_MEMORY  Out of memory
1321  * @retval #WIFI_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED  Address family not supported
1322  * @retval #WIFI_ERROR_NOT_SUPPORTED   Not supported
1323  */
1324 int wifi_ap_get_dns_address(wifi_ap_h ap, int order, wifi_address_family_e address_family, char** dns_address);
1325
1326 /**
1327  * @brief Sets the DNS address.
1328  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1329  * @privlevel public
1330  * @privilege %http://tizen.org/privilege/network.profile \n
1331  *            %http://tizen.org/privilege/network.get
1332  * @remarks The allowance of DNS address is @c 2 \n
1333  *          This API needs both privileges.
1334  * @param[in] ap  The access point handle
1335  * @param[in] order  The order of DNS address \n
1336  *                   It starts from @c 1, which means first DNS address.
1337  * @param[in] address_family  The address family
1338  * @param[in] dns_address  The DNS address \n
1339  *                         If you set this value to @c NULL, then the existing value will be deleted.
1340  * @return 0 on success, otherwise negative error value
1341  * @retval #WIFI_ERROR_NONE  Successful
1342  * @retval #WIFI_ERROR_INVALID_PARAMETER  Invalid parameter
1343  * @retval #WIFI_ERROR_OPERATION_FAILED  Operation failed
1344  * @retval #WIFI_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED  Address family not supported
1345  * @retval #WIFI_ERROR_PERMISSION_DENIED Permission Denied
1346  * @retval #WIFI_ERROR_NOT_SUPPORTED   Not supported
1347  */
1348 int wifi_ap_set_dns_address(wifi_ap_h ap, int order, wifi_address_family_e address_family, const char* dns_address);
1349
1350 /**
1351 * @}
1352 */
1353
1354
1355 /**
1356 * @addtogroup CAPI_NETWORK_WIFI_AP_SECURITY_MODULE
1357 * @{
1358 */
1359
1360 /**
1361  * @brief Gets the Wi-Fi security mode.
1362  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1363  * @param[in] ap  The access point handle
1364  * @param[out] type  The type of Wi-Fi security
1365  * @return 0 on success, otherwise negative error value
1366  * @retval #WIFI_ERROR_NONE  Successful
1367  * @retval #WIFI_ERROR_INVALID_PARAMETER  Invalid parameter
1368  * @retval #WIFI_ERROR_OPERATION_FAILED  Operation failed
1369  * @retval #WIFI_ERROR_NOT_SUPPORTED   Not supported
1370  */
1371 int wifi_ap_get_security_type(wifi_ap_h ap, wifi_security_type_e* type);
1372
1373 /**
1374  * @brief Sets the Wi-Fi security mode.
1375  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1376  * @param[in] ap  The access point handle
1377  * @param[in] type  The type of Wi-Fi security
1378  * @return 0 on success, otherwise negative error value
1379  * @retval #WIFI_ERROR_NONE  Successful
1380  * @retval #WIFI_ERROR_INVALID_PARAMETER  Invalid parameter
1381  * @retval #WIFI_ERROR_OPERATION_FAILED  Operation failed
1382  * @retval #WIFI_ERROR_NOT_SUPPORTED   Not supported
1383  */
1384 int wifi_ap_set_security_type(wifi_ap_h ap, wifi_security_type_e type);
1385
1386 /**
1387  * @brief Gets the Wi-Fi encryption type.
1388  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1389  * @param[in] ap  The access point handle
1390  * @param[out] type  The type of Wi-Fi encryption
1391  * @return 0 on success, otherwise negative error value
1392  * @retval #WIFI_ERROR_NONE  Successful
1393  * @retval #WIFI_ERROR_INVALID_PARAMETER  Invalid parameter
1394  * @retval #WIFI_ERROR_OPERATION_FAILED  Operation failed
1395  * @retval #WIFI_ERROR_NOT_SUPPORTED   Not supported
1396  */
1397 int wifi_ap_get_encryption_type(wifi_ap_h ap, wifi_encryption_type_e* type);
1398
1399 /**
1400  * @brief Sets the Wi-Fi encryption type.
1401  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1402  * @param[in] ap  The access point handle
1403  * @param[in] type  The type of Wi-Fi encryption
1404  * @return 0 on success, otherwise negative error value
1405  * @retval #WIFI_ERROR_NONE  Successful
1406  * @retval #WIFI_ERROR_INVALID_PARAMETER  Invalid parameter
1407  * @retval #WIFI_ERROR_OPERATION_FAILED  Operation failed
1408  * @retval #WIFI_ERROR_NOT_SUPPORTED   Not supported
1409  */
1410 int wifi_ap_set_encryption_type(wifi_ap_h ap, wifi_encryption_type_e type);
1411
1412 /**
1413  * @brief Checks whether the passphrase is required or not.
1414  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1415  * @remarks This function is not valid if security type is #WIFI_SECURITY_TYPE_EAP.
1416  * @param[in] ap  The access point handle
1417  * @param[out] required  @c true if passphrase is required,
1418  *                       @c false if passphrase is not required.
1419  * @return 0 on success, otherwise negative error value
1420  * @retval #WIFI_ERROR_NONE  Successful
1421  * @retval #WIFI_ERROR_INVALID_PARAMETER  Invalid parameter
1422  * @retval #WIFI_ERROR_OPERATION_FAILED  Operation failed
1423  * @retval #WIFI_ERROR_NOT_SUPPORTED   Not supported
1424  */
1425 int wifi_ap_is_passphrase_required(wifi_ap_h ap, bool* required);
1426
1427 /**
1428  * @brief Sets the passphrase.
1429  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1430  * @param[in] ap  The access point handle
1431  * @param[in] passphrase  The passphrase of access point
1432  * @return 0 on success, otherwise negative error value
1433  * @retval #WIFI_ERROR_NONE  Successful
1434  * @retval #WIFI_ERROR_INVALID_PARAMETER  Invalid parameter
1435  * @retval #WIFI_ERROR_OPERATION_FAILED  Operation failed
1436  * @retval #WIFI_ERROR_NOT_SUPPORTED   Not supported
1437  */
1438 int wifi_ap_set_passphrase(wifi_ap_h ap, const char* passphrase);
1439
1440 /**
1441  * @brief Checks whether the WPS(Wi-Fi Protected Setup) is supported or not.
1442  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1443  * @param[in] ap  The access point handle
1444  * @param[out] supported  @c ture if WPS is supported,
1445  *                        otherwise @c false is WPS is not supported.
1446  * @return 0 on success, otherwise negative error value
1447  * @retval #WIFI_ERROR_NONE  Successful
1448  * @retval #WIFI_ERROR_INVALID_PARAMETER  Invalid parameter
1449  * @retval #WIFI_ERROR_OPERATION_FAILED  Operation failed
1450  * @retval #WIFI_ERROR_NOT_SUPPORTED   Not supported
1451  * @see wifi_connect_by_wps_pbc()
1452  * @see wifi_connect_by_wps_pin()
1453  */
1454 int wifi_ap_is_wps_supported(wifi_ap_h ap, bool* supported);
1455
1456 /**
1457 * @}
1458 */
1459
1460
1461 /**
1462 * @addtogroup CAPI_NETWORK_WIFI_AP_SECURITY_EAP_MODULE
1463 * @{
1464 */
1465
1466 /**
1467  * @brief Sets the passphrase of EAP.
1468  * @details You can set one of @a user_name and @a password as @c NULL.
1469  * In this case, the value of a parameter which is set as @c NULL will be the previous value.
1470  * But it is not allowed that both @a user_name and @a password are set as @c NULL.
1471  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1472  * @remarks This function is valid only if the EAP type is #WIFI_EAP_TYPE_PEAP or #WIFI_EAP_TYPE_TTLS.
1473  * @param[in] ap  The access point handle
1474  * @param[in] user_name  The user name \n
1475  *                       This value can be @c NULL.
1476  * @param[in] password  The password \n
1477  *                      This value can be @c NULL.
1478  * @return 0 on success, otherwise negative error value
1479  * @retval #WIFI_ERROR_NONE  Successful
1480  * @retval #WIFI_ERROR_INVALID_PARAMETER  Invalid parameter
1481  * @retval #WIFI_ERROR_INVALID_OPERATION  Invalid operation
1482  * @retval #WIFI_ERROR_NOT_SUPPORTED   Not supported
1483  */
1484 int wifi_ap_set_eap_passphrase(wifi_ap_h ap, const char* user_name, const char* password);
1485
1486 /**
1487  * @brief Gets the passphrase of EAP.
1488  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1489  * @remarks This function is valid only if the EAP type is #WIFI_EAP_TYPE_PEAP or #WIFI_EAP_TYPE_TTLS.
1490  *          You must release @a user_name using free().
1491  * @param[in] ap  The access point handle
1492  * @param[out] user_name  The user name
1493  * @param[out] is_password_set  @c ture if password is set,
1494  *                              otherwise @c flase if password is not set.
1495  * @return 0 on success, otherwise negative error value
1496  * @retval #WIFI_ERROR_NONE  Successful
1497  * @retval #WIFI_ERROR_INVALID_PARAMETER  Invalid parameter
1498  * @retval #WIFI_ERROR_OUT_OF_MEMORY  Out of memory
1499  * @retval #WIFI_ERROR_INVALID_OPERATION  Invalid operation
1500  * @retval #WIFI_ERROR_NOT_SUPPORTED   Not supported
1501  */
1502 int wifi_ap_get_eap_passphrase(wifi_ap_h ap, char** user_name, bool* is_password_set);
1503
1504 /**
1505  * @brief Gets the CA Certificate of EAP.
1506  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1507  * @remarks This function is valid only if the EAP type is #WIFI_EAP_TYPE_TLS.
1508  *          You must release @a file using free().
1509  * @param[in] ap  The access point handle
1510  * @param[out] file  The file path of CA Certificate
1511  * @return 0 on success, otherwise negative error value
1512  * @retval #WIFI_ERROR_NONE  Successful
1513  * @retval #WIFI_ERROR_INVALID_PARAMETER  Invalid parameter
1514  * @retval #WIFI_ERROR_OUT_OF_MEMORY  Out of memory
1515  * @retval #WIFI_ERROR_INVALID_OPERATION  Invalid operation
1516  * @retval #WIFI_ERROR_NOT_SUPPORTED   Not supported
1517  */
1518 int wifi_ap_get_eap_ca_cert_file(wifi_ap_h ap, char** file);
1519
1520 /**
1521  * @brief Sets the CA Certificate of EAP.
1522  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1523  * @remarks This function is valid only if the EAP type is #WIFI_EAP_TYPE_TLS.
1524  * @param[in] ap  The access point handle
1525  * @param[in] file  The file path of CA Certificate
1526  * @return 0 on success, otherwise negative error value
1527  * @retval #WIFI_ERROR_NONE  Successful
1528  * @retval #WIFI_ERROR_INVALID_PARAMETER  Invalid parameter
1529  * @retval #WIFI_ERROR_INVALID_OPERATION  Invalid operation
1530  * @retval #WIFI_ERROR_NOT_SUPPORTED   Not supported
1531  */
1532 int wifi_ap_set_eap_ca_cert_file(wifi_ap_h ap, const char* file);
1533
1534 /**
1535  * @brief Gets the Client Certificate of EAP.
1536  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1537  * @remarks This function is valid only if the EAP type is #WIFI_EAP_TYPE_TLS.
1538  *          You must release @a file using free().
1539  * @param[in] ap  The access point handle
1540  * @param[out] file  The file path of Client Certificate
1541  * @return 0 on success, otherwise negative error value
1542  * @retval #WIFI_ERROR_NONE  Successful
1543  * @retval #WIFI_ERROR_INVALID_PARAMETER  Invalid parameter
1544  * @retval #WIFI_ERROR_OUT_OF_MEMORY  Out of memory
1545  * @retval #WIFI_ERROR_INVALID_OPERATION  Invalid operation
1546  * @retval #WIFI_ERROR_NOT_SUPPORTED   Not supported
1547  */
1548 int wifi_ap_get_eap_client_cert_file(wifi_ap_h ap, char** file);
1549
1550 /**
1551  * @brief Sets the CA Certificate of EAP.
1552  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1553  * @remarks This function is valid only if the EAP type is #WIFI_EAP_TYPE_TLS.
1554  * @param[in] ap  The access point handle
1555  * @param[in] file  The file path of Client Certificate
1556  * @return 0 on success, otherwise negative error value
1557  * @retval #WIFI_ERROR_NONE  Successful
1558  * @retval #WIFI_ERROR_INVALID_PARAMETER  Invalid parameter
1559  * @retval #WIFI_ERROR_INVALID_OPERATION  Invalid operation
1560  * @retval #WIFI_ERROR_NOT_SUPPORTED   Not supported
1561  */
1562 int wifi_ap_set_eap_client_cert_file(wifi_ap_h ap, const char* file);
1563
1564 /**
1565  * @brief Gets the private key file of EAP.
1566  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1567  * @remarks This function is valid only if the EAP type is #WIFI_EAP_TYPE_TLS.
1568  *          You must release @a file using free().
1569  * @param[in] ap  The access point handle
1570  * @param[out] file  The file path of private key
1571  * @return 0 on success, otherwise negative error value
1572  * @retval #WIFI_ERROR_NONE  Successful
1573  * @retval #WIFI_ERROR_INVALID_PARAMETER  Invalid parameter
1574  * @retval #WIFI_ERROR_OUT_OF_MEMORY  Out of memory
1575  * @retval #WIFI_ERROR_INVALID_OPERATION  Invalid operation
1576  * @retval #WIFI_ERROR_NOT_SUPPORTED   Not supported
1577  */
1578 int wifi_ap_get_eap_private_key_file(wifi_ap_h ap, char** file);
1579
1580 /**
1581  * @brief Sets the private key information of EAP.
1582  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1583  * @remarks This function is valid only if the EAP type is #WIFI_EAP_TYPE_TLS.
1584  * @param[in] ap  The access point handle
1585  * @param[in] file  The file path of private key
1586  * @param[in] password  The password
1587  * @return 0 on success, otherwise negative error value
1588  * @retval #WIFI_ERROR_NONE  Successful
1589  * @retval #WIFI_ERROR_INVALID_PARAMETER  Invalid parameter
1590  * @retval #WIFI_ERROR_INVALID_OPERATION  Invalid operation
1591  * @retval #WIFI_ERROR_NOT_SUPPORTED   Not supported
1592  */
1593 int wifi_ap_set_eap_private_key_info(wifi_ap_h ap, const char* file, const char* password);
1594
1595 /**
1596  * @brief Gets the EAP type of Wi-Fi.
1597  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1598  * @param[in] ap  The access point handle
1599  * @param[out] type  The type of EAP
1600  * @return 0 on success, otherwise negative error value
1601  * @retval #WIFI_ERROR_NONE  Successful
1602  * @retval #WIFI_ERROR_INVALID_PARAMETER  Invalid parameter
1603  * @retval #WIFI_ERROR_INVALID_OPERATION  Invalid operation
1604  * @retval #WIFI_ERROR_OPERATION_FAILED  Operation failed
1605  * @retval #WIFI_ERROR_NOT_SUPPORTED   Not supported
1606  */
1607 int wifi_ap_get_eap_type(wifi_ap_h ap, wifi_eap_type_e* type);
1608
1609 /**
1610  * @brief Sets the EAP type of Wi-Fi.
1611  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1612  * @param[in] ap  The access point handle
1613  * @param[in] type  The type of EAP
1614  * @return 0 on success, otherwise negative error value
1615  * @retval #WIFI_ERROR_NONE  Successful
1616  * @retval #WIFI_ERROR_INVALID_PARAMETER  Invalid parameter
1617  * @retval #WIFI_ERROR_INVALID_OPERATION  Invalid operation
1618  * @retval #WIFI_ERROR_NOT_SUPPORTED   Not supported
1619  */
1620 int wifi_ap_set_eap_type(wifi_ap_h ap, wifi_eap_type_e type);
1621
1622 /**
1623  * @brief Gets the type of EAP phase2 authentication of Wi-Fi.
1624  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1625  * @param[in] ap  The access point handle
1626  * @param[out] type  The type of EAP phase2 authentication
1627  * @return 0 on success, otherwise negative error value
1628  * @retval #WIFI_ERROR_NONE  Successful
1629  * @retval #WIFI_ERROR_INVALID_PARAMETER  Invalid parameter
1630  * @retval #WIFI_ERROR_INVALID_OPERATION  Invalid operation
1631  * @retval #WIFI_ERROR_OPERATION_FAILED  Operation failed
1632  * @retval #WIFI_ERROR_NOT_SUPPORTED   Not supported
1633  */
1634 int wifi_ap_get_eap_auth_type(wifi_ap_h ap, wifi_eap_auth_type_e* type);
1635
1636 /**
1637  * @brief Sets the type of EAP phase2 authentication of Wi-Fi.
1638  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1639  * @param[in] ap  The access point handle
1640  * @param[in] type  The type of EAP phase2 authentication
1641  * @return 0 on success, otherwise negative error value
1642  * @retval #WIFI_ERROR_NONE  Successful
1643  * @retval #WIFI_ERROR_INVALID_PARAMETER  Invalid parameter
1644  * @retval #WIFI_ERROR_INVALID_OPERATION  Invalid operation
1645  * @retval #WIFI_ERROR_NOT_SUPPORTED   Not supported
1646  */
1647 int wifi_ap_set_eap_auth_type(wifi_ap_h ap, wifi_eap_auth_type_e type);
1648
1649 /**
1650 * @}
1651 */
1652
1653 /**
1654 * @addtogroup CAPI_NETWORK_WIFI_CONFIG_MODULE
1655 * @{
1656 */
1657
1658 /**
1659  * @brief Gets access point configuration handle.
1660  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0
1661  * @remarks You must release @a config using wifi_config_destroy().
1662  *
1663  * @param[in] name                              The access point name
1664  * @param[in] passphrase                The access point passphrase
1665  * @param[in] security_type             The access point security type
1666  * @param[out] config                   The access point configuration handle
1667  *
1668  * @return 0 on success, otherwise negative error value
1669  * @retval #WIFI_ERROR_NONE                                     Successful
1670  * @retval #WIFI_ERROR_INVALID_OPERATION        Invalid operation
1671  * @retval #WIFI_ERROR_INVALID_PARAMETER        Invalid parameter
1672  * @retval #WIFI_ERROR_OUT_OF_MEMORY            Out of memory
1673  * @retval #WIFI_ERROR_NOT_SUPPORTED            Not supported
1674  * @see wifi_config_destroy()
1675  * @pre This API needs wifi_initialize() before use
1676  */
1677 int wifi_config_create(const char *name, const char *passphrase, wifi_security_type_e security_type, wifi_config_h *config);
1678
1679 /**
1680  * @brief Clones the access point configuration handle.
1681  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0
1682  * @remarks You must release @a cloned_config using wifi_config_destroy().
1683  *
1684  * @param[in] origin                            The origin access point configuration handle
1685  * @param[out] cloned_config    The cloned access point configuration handle
1686  *
1687  * @return 0 on success, otherwise negative error value
1688  * @retval #WIFI_ERROR_NONE                                     Successful
1689  * @retval #WIFI_ERROR_INVALID_OPERATION        Invalid operation
1690  * @retval #WIFI_ERROR_INVALID_PARAMETER        Invalid parameter
1691  * @retval #WIFI_ERROR_OUT_OF_MEMORY            Out of memory
1692  * @retval #WIFI_ERROR_NOT_SUPPORTED            Not supported
1693  * @see wifi_config_destroy()
1694  */
1695 int wifi_config_clone(wifi_config_h origin, wifi_config_h *cloned_config);
1696
1697 /**
1698  * @brief Destroys the access point configuration handle.
1699  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0
1700  *
1701  * @param[in] config    The access point configuration handle
1702  *
1703  * @return 0 on success, otherwise negative error value
1704  * @retval #WIFI_ERROR_NONE                                     Successful
1705  * @retval #WIFI_ERROR_INVALID_OPERATION        Invalid operation
1706  * @retval #WIFI_ERROR_INVALID_PARAMETER        Invalid parameter
1707  * @retval #WIFI_ERROR_NOT_SUPPORTED            Not supported
1708  * @see wifi_config_create()
1709  * @see wifi_config_clone()
1710  */
1711 int wifi_config_destroy(wifi_config_h config);
1712
1713 /**
1714  * @brief Saves Wi-Fi configuration of access point.
1715  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0
1716  * @privlevel public
1717  * @privilege %http://tizen.org/privilege/network.profile
1718  *
1719  * @param[in] config    The access point configuration handle
1720  *
1721  * @return 0 on success, otherwise negative error value
1722  * @retval #WIFI_ERROR_NONE                                     Successful
1723  * @retval #WIFI_ERROR_INVALID_OPERATION        Invalid operation
1724  * @retval #WIFI_ERROR_INVALID_PARAMETER        Invalid parameter
1725  * @retval #WIFI_ERROR_PERMISSION_DENIED        Permission denied
1726  * @retval #WIFI_ERROR_NOT_SUPPORTED            Not supported
1727  * @see wifi_config_create()
1728  */
1729 int wifi_config_save_configuration(wifi_config_h config);
1730
1731 /**
1732  * @brief Gets the result of access point configurations repeatedly.
1733  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0
1734  * @privlevel public
1735  * @privilege %http://tizen.org/privilege/network.profile
1736  *
1737  * @param[in] callback          The callback to be called
1738  * @param[in] user_data         The user data passed to the callback function
1739  *
1740  * @return 0 on success, otherwise negative error value
1741  * @retval #WIFI_ERROR_NONE                                     Successful
1742  * @retval #WIFI_ERROR_INVALID_OPERATION        Invalid operation
1743  * @retval #WIFI_ERROR_INVALID_PARAMETER        Invalid parameter
1744  * @retval #WIFI_ERROR_PERMISSION_DENIED        Permission denied
1745  * @retval #WIFI_ERROR_OUT_OF_MEMORY            Out of memory
1746  * @retval #WIFI_ERROR_NOT_SUPPORTED            Not supported
1747  * @pre This API needs wifi_initialize() before use.
1748  * @post This function invokes wifi_config_list_cb().
1749  */
1750 int wifi_config_foreach_configuration(wifi_config_list_cb callback, void *user_data);
1751
1752 /**
1753  * @brief Gets the name of access point from configuration.
1754  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0
1755  * @remarks You must release @a name using free().
1756  *
1757  * @param[in] config    The access point configuration handle
1758  * @param[out] name             The name of access point
1759  *
1760  * @return 0 on success, otherwise negative error value
1761  * @retval #WIFI_ERROR_NONE                                     Successful
1762  * @retval #WIFI_ERROR_INVALID_OPERATION        Invalid operation
1763  * @retval #WIFI_ERROR_INVALID_PARAMETER        Invalid parameter
1764  * @retval #WIFI_ERROR_OUT_OF_MEMORY            Out of memory
1765  * @retval #WIFI_ERROR_NOT_SUPPORTED            Not supported
1766  */
1767 int wifi_config_get_name(wifi_config_h config, char **name);
1768
1769 /**
1770  * @brief Gets the security type of access point from configuration.
1771  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0
1772  *
1773  * @param[in] config                    The access point configuration handle
1774  * @param[out] security_type    The security type of access point
1775  *
1776  * @return 0 on success, otherwise negative error value
1777  * @retval #WIFI_ERROR_NONE                                     Successful
1778  * @retval #WIFI_ERROR_INVALID_OPERATION        Invalid operation
1779  * @retval #WIFI_ERROR_INVALID_PARAMETER        Invalid parameter
1780  * @retval #WIFI_ERROR_NOT_SUPPORTED            Not supported
1781  */
1782 int wifi_config_get_security_type(wifi_config_h config, wifi_security_type_e *security_type);
1783
1784 /**
1785  * @brief Sets access point proxy address configuration.
1786  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0
1787  * @privlevel public
1788  * @privilege %http://tizen.org/privilege/network.profile
1789  *
1790  * @param[in] config                    The access point configuration handle
1791  * @param[in] address_family    The address family
1792  * @param[in] proxy_address             The proxy address
1793  *
1794  * @return 0 on success, otherwise negative error value
1795  * @retval #WIFI_ERROR_NONE                                     Successful
1796  * @retval #WIFI_ERROR_INVALID_OPERATION        Invalid operation
1797  * @retval #WIFI_ERROR_INVALID_PARAMETER        Invalid parameter
1798  * @retval #WIFI_ERROR_PERMISSION_DENIED        Permission denied
1799  * @retval #WIFI_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED Not supported address family
1800  * @retval #WIFI_ERROR_NOT_SUPPORTED            Not supported
1801  */
1802 int wifi_config_set_proxy_address(wifi_config_h config, wifi_address_family_e address_family, const char *proxy_address);
1803
1804 /**
1805  * @brief Gets the proxy address of access point from configuration.
1806  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0
1807  * @remarks You must release @a proxy_address using free().
1808  *
1809  * @param[in] config                    The access point configuration handle
1810  * @param[out] address_family   The address family
1811  * @param[out] proxy_address    The proxy address
1812  *
1813  * @return 0 on success, otherwise negative error value
1814  * @retval #WIFI_ERROR_NONE                                     Successful
1815  * @retval #WIFI_ERROR_INVALID_OPERATION        Invalid operation
1816  * @retval #WIFI_ERROR_INVALID_PARAMETER        Invalid parameter
1817  * @retval #WIFI_ERROR_OUT_OF_MEMORY            Out of memory
1818  * @retval #WIFI_ERROR_NOT_SUPPORTED            Not supported
1819  */
1820 int wifi_config_get_proxy_address(wifi_config_h config, wifi_address_family_e *address_family, char **proxy_address);
1821
1822 /**
1823  * @brief Sets the hidden property of access point from the configuration.
1824  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0
1825  * @privlevel public
1826  * @privilege %http://tizen.org/privilege/network.profile
1827  *
1828  * @param[in] config            The access point configuration handle
1829  * @param[in] is_hidden         true to enable and false to disable
1830  *
1831  * @return 0 on success, otherwise negative error value
1832  * @retval #WIFI_ERROR_NONE                                     Successful
1833  * @retval #WIFI_ERROR_INVALID_OPERATION        Invalid operation
1834  * @retval #WIFI_ERROR_INVALID_PARAMETER        Invalid parameter
1835  * @retval #WIFI_ERROR_PERMISSION_DENIED        Permission denied
1836  * @retval #WIFI_ERROR_NOT_SUPPORTED            Not supported
1837  */
1838 int wifi_config_set_hidden_ap_property(wifi_config_h config, bool is_hidden);
1839
1840 /**
1841  * @brief Gets the hidden property of access point from the configuration.
1842  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0
1843  *
1844  * @param[in] config            The access point configuration handle
1845  * @param[out] is_hidden        The hidden property of access point
1846  *
1847  * @return 0 on success, otherwise negative error value
1848  * @retval #WIFI_ERROR_NONE                                     Successful
1849  * @retval #WIFI_ERROR_INVALID_OPERATION        Invalid operation
1850  * @retval #WIFI_ERROR_INVALID_PARAMETER        Invalid parameter
1851  * @retval #WIFI_ERROR_NOT_SUPPORTED            Not supported
1852  */
1853 int wifi_config_get_hidden_ap_property(wifi_config_h config, bool *is_hidden);
1854
1855 /**
1856  * @brief Gets access point anonymous identity from configuration.
1857  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0
1858  * @remarks You must release @a anonymous_identity using free().
1859  *
1860  * @param[in] config                            The access point configuration handle
1861  * @param[out] anonymous_identity       The anonymous identity of access point
1862  *
1863  * @return 0 on success, otherwise negative error value
1864  * @retval #WIFI_ERROR_NONE                                     Successful
1865  * @retval #WIFI_ERROR_INVALID_PARAMETER        Invalid parameter
1866  */
1867 int wifi_config_get_eap_anonymous_identity(wifi_config_h config, char** anonymous_identity);
1868
1869 /**
1870  * @brief Sets access point anonymous identity to configuration.
1871  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0
1872  * @privlevel public
1873  * @privilege %http://tizen.org/privilege/network.profile
1874  *
1875  * @param[in] config                            The access point configuration handle
1876  * @param[in] anonymous_identity        The anonymous identity
1877  *
1878  * @return 0 on success, otherwise negative error value
1879  * @retval #WIFI_ERROR_NONE                                     Successful
1880  * @retval #WIFI_ERROR_INVALID_PARAMETER        Invalid parameter
1881  * @retval #WIFI_ERROR_PERMISSION_DENIED        Permission Denied
1882  */
1883 int wifi_config_set_eap_anonymous_identity(wifi_config_h config, const char* anonymous_identity);
1884
1885 /**
1886  * @brief Gets access point cacert file from configuration.
1887  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0
1888  * @remarks You must release @a ca_cert using free().
1889  * @remarks The mediastorage privilege http://tizen.org/privilege/mediastorage is needed \n
1890  *                       if @a image_path is relevant to media storage.\n
1891  *                       The externalstorage privilege http://tizen.org/privilege/externalstorage is needed \n
1892  *                       if @a image_path is relevant to external storage.
1893  *
1894  * @param[in] config            The access point configuration handle
1895  * @param[out] ca_cert          The certification authority(CA) certificates file of access point
1896  *
1897  * @return 0 on success, otherwise negative error value
1898  * @retval #WIFI_ERROR_NONE                                     Successful
1899  * @retval #WIFI_ERROR_INVALID_PARAMETER        Invalid parameter
1900  */
1901 int wifi_config_get_eap_ca_cert_file(wifi_config_h config, char** ca_cert);
1902
1903 /**
1904  * @brief Sets access point cacert file to configuration.
1905  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0
1906  * @privlevel public
1907  * @privilege %http://tizen.org/privilege/network.profile
1908  * @remarks The mediastorage privilege http://tizen.org/privilege/mediastorage is needed \n
1909  *                       if @a image_path is relevant to media storage.\n
1910  *                       The externalstorage privilege http://tizen.org/privilege/externalstorage is needed \n
1911  *                       if @a image_path is relevant to external storage.
1912  *
1913  * @param[in] config            The access point configuration handle
1914  * @param[in] ca_cert           The certification authority(CA) certificates file of access point
1915  *
1916  * @return 0 on success, otherwise negative error value
1917  * @retval #WIFI_ERROR_NONE                                     Successful
1918  * @retval #WIFI_ERROR_INVALID_PARAMETER        Invalid parameter
1919  * @retval #WIFI_ERROR_PERMISSION_DENIED        Permission Denied
1920  */
1921 int wifi_config_set_eap_ca_cert_file(wifi_config_h config, const char* ca_cert);
1922
1923 /**
1924  * @brief Gets access point client cert file from configuration.
1925  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0
1926  * @remarks You must release @a client_crt using free().
1927  *
1928  * @param[in] config            The access point configuration handle
1929  * @param[out] client_crt       The certification authority(CA) certificates file of access point
1930  *
1931  * @return 0 on success, otherwise negative error value
1932  * @retval #WIFI_ERROR_NONE                                     Successful
1933  * @retval #WIFI_ERROR_INVALID_PARAMETER        Invalid parameter
1934  */
1935 int wifi_config_get_eap_client_cert_file(wifi_config_h config, char** client_cert);
1936
1937 /**
1938  * @brief Sets access point client cert file to configuration.
1939  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0
1940  * @privlevel public
1941  * @privilege %http://tizen.org/privilege/network.profile
1942  *
1943  * @param[in] config            The access point configuration handle
1944  * @param[in] private_key       The private key file
1945  * @param[in] client_crt                The certification authority(CA) certificates file of access point
1946  *
1947  * @return 0 on success, otherwise negative error value
1948  * @retval #WIFI_ERROR_NONE                                     Successful
1949  * @retval #WIFI_ERROR_INVALID_PARAMETER        Invalid parameter
1950  * @retval #WIFI_ERROR_PERMISSION_DENIED        Permission Denied
1951  */
1952 int wifi_config_set_eap_client_cert_file(wifi_config_h config, const char* private_key, const char* client_cert);
1953
1954 /**
1955  * @brief Gets access point identity from configuration.
1956  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0
1957  * @remarks You must release @a identity using free().
1958  *
1959  * @param[in] config            The access point configuration handle
1960  * @param[out] identity         The identity of access point
1961  *
1962  * @return 0 on success, otherwise negative error value
1963  * @retval #WIFI_ERROR_NONE                                     Successful
1964  * @retval #WIFI_ERROR_INVALID_PARAMETER        Invalid parameter
1965  */
1966 int wifi_config_get_eap_identity(wifi_config_h config, char** identity);
1967
1968 /**
1969  * @brief Sets access point identity to configuration.
1970  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0
1971  * @privlevel public
1972  * @privilege %http://tizen.org/privilege/network.profile
1973  *
1974  * @param[in] config            The access point configuration handle
1975  * @param[in] identity          The identity
1976  *
1977  * @return 0 on success, otherwise negative error value
1978  * @retval #WIFI_ERROR_NONE                                     Successful
1979  * @retval #WIFI_ERROR_INVALID_PARAMETER        Invalid parameter
1980  * @retval #WIFI_ERROR_PERMISSION_DENIED        Permission Denied
1981  */
1982 int wifi_config_set_eap_identity(wifi_config_h config, const char* identity);
1983
1984 /**
1985  * @brief Gets access point eap type from configuration.
1986  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0
1987  *
1988  * @param[in] config            The access point configuration handle
1989  * @param[out] eap_type The eap type of access point
1990  *
1991  * @return 0 on success, otherwise negative error value
1992  * @retval #WIFI_ERROR_NONE                                     Successful
1993  * @retval #WIFI_ERROR_INVALID_PARAMETER        Invalid parameter
1994  */
1995 int wifi_config_get_eap_type(wifi_config_h config, wifi_eap_type_e *eap_type);
1996
1997 /**
1998  * @brief Sets access point eap type to configuration.
1999  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0
2000  * @privlevel public
2001  * @privilege %http://tizen.org/privilege/network.profile
2002  *
2003  * @param[in] config            The access point configuration handle
2004  * @param[in] eap_type          The eap type
2005  *
2006  * @return 0 on success, otherwise negative error value
2007  * @retval #WIFI_ERROR_NONE                                     Successful
2008  * @retval #WIFI_ERROR_INVALID_PARAMETER        Invalid parameter
2009  * @retval #WIFI_ERROR_PERMISSION_DENIED        Permission Denied
2010  */
2011 int wifi_config_set_eap_type(wifi_config_h config, wifi_eap_type_e eap_type);
2012
2013 /**
2014  * @brief Gets access point eap auth type from configuration.
2015  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0
2016  *
2017  * @param[in] config                    The access point configuration handle
2018  * @param[out] eap_auth_type    The eap auth type of access point
2019  *
2020  * @return 0 on success, otherwise negative error value
2021  * @retval #WIFI_ERROR_NONE                                     Successful
2022  * @retval #WIFI_ERROR_INVALID_PARAMETER        Invalid parameter
2023  */
2024 int wifi_config_get_eap_auth_type(wifi_config_h config, wifi_eap_auth_type_e* eap_auth_type);
2025
2026 /**
2027  * @brief Sets access point eap auth type to configuration.
2028  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0
2029  * @privlevel public
2030  * @privilege %http://tizen.org/privilege/network.profile
2031  *
2032  * @param[in] config                    The access point configuration handle
2033  * @param[in] eap_auth_type     The eap auth type
2034  *
2035  * @return 0 on success, otherwise negative error value
2036  * @retval #WIFI_ERROR_NONE                                     Successful
2037  * @retval #WIFI_ERROR_INVALID_PARAMETER        Invalid parameter
2038  * @retval #WIFI_ERROR_PERMISSION_DENIED        Permission Denied
2039  */
2040 int wifi_config_set_eap_auth_type(wifi_config_h config, wifi_eap_auth_type_e eap_auth_type);
2041
2042 /**
2043  * @brief Gets access point subject match from configuration.
2044  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0
2045  * @remarks You must release @a subject_match using free().
2046  *
2047  * @param[in] config                    The access point configuration handle
2048  * @param[out] subject_match    The subject match of access point
2049  *
2050  * @return 0 on success, otherwise negative error value
2051  * @retval #WIFI_ERROR_NONE                                     Successful
2052  * @retval #WIFI_ERROR_INVALID_PARAMETER        Invalid parameter
2053  */
2054 int wifi_config_get_eap_subject_match(wifi_config_h config, char** subject_match);
2055
2056 /**
2057  * @brief Sets access point subject match to configuration.
2058  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0
2059  * @privlevel public
2060  * @privilege %http://tizen.org/privilege/network.profile
2061  *
2062  * @param[in] config                    The access point configuration handle
2063  * @param[in] subject_match     The subject match
2064  *
2065  * @return 0 on success, otherwise negative error value
2066  * @retval #WIFI_ERROR_NONE                                     Successful
2067  * @retval #WIFI_ERROR_INVALID_PARAMETER        Invalid parameter
2068  * @retval #WIFI_ERROR_PERMISSION_DENIED        Permission Denied
2069  */
2070 int wifi_config_set_eap_subject_match(wifi_config_h config, const char* subject_match);
2071
2072 /**
2073  * @}
2074  */
2075
2076 /**
2077  * @addtogroup CAPI_NETWORK_WIFI_TDLS_MODULE
2078  * @{
2079  */
2080
2081 /**
2082  * @brief Enumeration for the state of the Wi-Fi TDLS.
2083  * @since_tizen 3.0
2084  */
2085 typedef enum
2086 {
2087         WIFI_TDLS_STATE_DISCONNECTED = 0,  /**< Wi-Fi TDLS is Disconnected */
2088         WIFI_TDLS_STATE_CONNECTED = 1,     /**< Wi-Fi TDLS is Connected */
2089 } wifi_tdls_state_e;
2090
2091 /**
2092  * @brief Called when the WiFi TDLS state is changed.
2093  * @since_tizen 3.0
2094  *
2095  * @param[in] state  The TDLS state
2096  * @param[in] peer_mac_addr  MAC address of the TDLS peer
2097  * @param[in] user_data  The user data passed from the callback registration function
2098  * @see wifi_tdls_set_state_changed_cb()
2099  * @see wifi_tdls_unset_state_changed_cb()
2100  */
2101 typedef void(*wifi_tdls_state_changed_cb)(wifi_tdls_state_e state, char* peer_mac_addr, void* user_data);
2102
2103 /**
2104  * @brief Disconnects the connected peer.
2105  * @since_tizen 3.0
2106  * @privlevel public
2107  * @privilege %http://tizen.org/privilege/network.set
2108  *
2109  * @param[in] peer_mac_addr  The MAC address of the connected peer
2110  *
2111  * @return @c 0 on success, otherwise negative error value
2112  * @retval #WIFI_ERROR_NONE  Successful
2113  * @retval #WIFI_ERROR_INVALID_OPERATION  Invalid operation
2114  * @retval #WIFI_ERROR_INVALID_PARAMETER  Invalid parameter
2115  * @retval #WIFI_ERROR_OPERATION_FAILED  Operation failed
2116  * @retval #WIFI_ERROR_PERMISSION_DENIED Permission Denied
2117  * @retval #WIFI_ERROR_NOT_SUPPORTED     Not supported
2118  */
2119 int wifi_tdls_disconnect(const char* peer_mac_addr);
2120
2121 /**
2122  * @brief Gets Peer Mac address of Connected peer.
2123  * @since_tizen 3.0
2124  * @privlevel public
2125  * @privilege %http://tizen.org/privilege/network.get
2126  *
2127  * @remarks The @a peer_mac_addr should be freed using free().
2128  * @param[out] peer_mac_addr  The MAC address of the connected peer
2129  *
2130  * @return @c 0 on success, otherwise negative error value
2131  * @retval #WIFI_ERROR_NONE  Successful
2132  * @retval #WIFI_ERROR_INVALID_OPERATION  Invalid operation
2133  * @retval #WIFI_ERROR_INVALID_PARAMETER  Invalid parameter
2134  * @retval #WIFI_ERROR_OPERATION_FAILED  Operation failed
2135  * @retval #WIFI_ERROR_NO_CONNECTION     No active TDLS Connection
2136  * @retval #WIFI_ERROR_PERMISSION_DENIED Permission Denied
2137  * @retval #WIFI_ERROR_NOT_SUPPORTED     Not supported
2138  */
2139 int wifi_tdls_get_connected_peer(char** peer_mac_addr);
2140
2141 /**
2142  * @brief Registers the callback called when TDLS state is changed.
2143  * @since_tizen 3.0
2144  *
2145  * @param[in] callback  The callback function to be called
2146  * @param[in] user_data The user data passed to the callback function
2147  *
2148  * @return @c 0 on success, otherwise negative error value
2149  * @retval #WIFI_ERROR_NONE  Successful
2150  * @retval #WIFI_ERROR_INVALID_OPERATION  Invalid operation
2151  * @retval #WIFI_ERROR_INVALID_PARAMETER   Invalid parameter
2152  * @retval #WIFI_ERROR_NOT_SUPPORTED     Not supported
2153  */
2154 int wifi_tdls_set_state_changed_cb(wifi_tdls_state_changed_cb callback, void* user_data);
2155
2156 /**
2157  * @brief Unregisters the callback called when TDLS state is changed.
2158  * @since_tizen 3.0
2159  *
2160  * @return @c 0 on success, otherwise negative error value
2161  * @retval #WIFI_ERROR_NONE  Successful
2162  * @retval #WIFI_ERROR_INVALID_OPERATION  Invalid operation
2163  * @retval #WIFI_ERROR_NOT_SUPPORTED     Not supported
2164  */
2165 int wifi_tdls_unset_state_changed_cb(void);
2166
2167 /**
2168  * @}
2169  */
2170
2171 #ifdef __cplusplus
2172 }
2173 #endif
2174
2175 #endif /* __TIZEN_NETWORK_WIFI_H__ */