Tizen Native API
|
The Wi-Fi API provides functions for managing Wi-Fi.
#include <wifi.h>
The Wi-Fi Manager provides functions for managing Wi-Fi. Using the Wi-Fi Manager, you can implement features that allow the users of your application to:
This API is related with the following features:
Functions | |
int | wifi_activate (wifi_activated_cb callback, void *user_data) TIZEN_DEPRECATED_API |
Activates Wi-Fi asynchronously. | |
int | wifi_activate_with_wifi_picker_tested (wifi_activated_cb callback, void *user_data) TIZEN_DEPRECATED_API |
Activates Wi-Fi asynchronously and displays Wi-Fi picker (popup) when Wi-Fi is not automatically connected. | |
int | wifi_deactivate (wifi_deactivated_cb callback, void *user_data) TIZEN_DEPRECATED_API |
Deactivates Wi-Fi asynchronously. | |
int | wifi_is_activated (bool *activated) TIZEN_DEPRECATED_API |
Checks whether Wi-Fi is activated. | |
int | wifi_get_mac_address (char **mac_address) TIZEN_DEPRECATED_API |
Gets the local MAC address. | |
int | wifi_get_network_interface_name (char **name) TIZEN_DEPRECATED_API |
Gets the name of the network interface. | |
int | wifi_scan (wifi_scan_finished_cb callback, void *user_data) TIZEN_DEPRECATED_API |
Starts scan asynchronously. | |
int | wifi_scan_specific_ap (const char *essid, wifi_scan_finished_cb callback, void *user_data) TIZEN_DEPRECATED_API |
Starts specific ap scan, asynchronously. | |
int | wifi_get_connected_ap (wifi_ap_h *ap) TIZEN_DEPRECATED_API |
Gets the handle of the connected access point. | |
int | wifi_foreach_found_aps (wifi_found_ap_cb callback, void *user_data) TIZEN_DEPRECATED_API |
Gets the result of the scan. | |
int | wifi_foreach_found_specific_aps (wifi_found_ap_cb callback, void *user_data) TIZEN_DEPRECATED_API |
Gets the result of specific ap scan. | |
int | wifi_connect (wifi_ap_h ap, wifi_connected_cb callback, void *user_data) TIZEN_DEPRECATED_API |
Connects the access point asynchronously. | |
int | wifi_disconnect (wifi_ap_h ap, wifi_disconnected_cb callback, void *user_data) TIZEN_DEPRECATED_API |
Disconnects the access point asynchronously. | |
int | wifi_connect_by_wps_pbc (wifi_ap_h ap, wifi_connected_cb callback, void *user_data) TIZEN_DEPRECATED_API |
Connects the access point with WPS PBC asynchronously. | |
int | wifi_connect_by_wps_pin (wifi_ap_h ap, const char *pin, wifi_connected_cb callback, void *user_data) TIZEN_DEPRECATED_API |
Connects the access point with WPS PIN asynchronously. | |
int | wifi_forget_ap (wifi_ap_h ap) TIZEN_DEPRECATED_API |
Deletes the information of stored access point and disconnects it when it connected. | |
Typedefs | |
typedef bool(* | wifi_found_ap_cb )(wifi_ap_h ap, void *user_data) |
Called when you get the found access point repeatedly. | |
typedef void(* | wifi_scan_finished_cb )(wifi_error_e error_code, void *user_data) |
Called when the scan is finished. | |
typedef void(* | wifi_activated_cb )(wifi_error_e result, void *user_data) |
Called after wifi_activate() or wifi_activate_with_wifi_picker_tested() is completed. | |
typedef void(* | wifi_deactivated_cb )(wifi_error_e result, void *user_data) |
Called after wifi_deactivate() is completed. | |
typedef void(* | wifi_connected_cb )(wifi_error_e result, void *user_data) |
Called after either wifi_connect() or wifi_connect_by_wps_pbc() or wifi_connect_by_wps_pin() are completed. | |
typedef void(* | wifi_disconnected_cb )(wifi_error_e result, void *user_data) |
Called after wifi_disconnect() is completed. |
typedef void(* wifi_activated_cb)(wifi_error_e result, void *user_data) |
Called after wifi_activate() or wifi_activate_with_wifi_picker_tested() is completed.
[in] | result | The result |
[in] | user_data | The user data passed from wifi_activate() and wifi_activate_with_wifi_picker_tested() |
typedef void(* wifi_connected_cb)(wifi_error_e result, void *user_data) |
Called after either wifi_connect() or wifi_connect_by_wps_pbc() or wifi_connect_by_wps_pin() are completed.
[in] | result | The result |
[in] | user_data | The user data passed from either wifi_connect() or wifi_connect_by_wps_pbc() or wifi_connect_by_wps_pin() |
typedef void(* wifi_deactivated_cb)(wifi_error_e result, void *user_data) |
Called after wifi_deactivate() is completed.
[in] | result | The result |
[in] | user_data | The user data passed from wifi_deactivate() |
typedef void(* wifi_disconnected_cb)(wifi_error_e result, void *user_data) |
Called after wifi_disconnect() is completed.
[in] | result | The result |
[in] | user_data | The user data passed from wifi_disconnect() |
typedef bool(* wifi_found_ap_cb)(wifi_ap_h ap, void *user_data) |
Called when you get the found access point repeatedly.
[in] | ap | The access point |
[in] | user_data | The user data passed from the request function |
true
to continue with the next iteration of the loop, false
to break out of the loop typedef void(* wifi_scan_finished_cb)(wifi_error_e error_code, void *user_data) |
Called when the scan is finished.
[in] | error_code | The error code |
[in] | user_data | The user data passed from the callback registration function |
enum wifi_error_e |
Enumeration for the Wi-Fi error type.
int wifi_activate | ( | wifi_activated_cb | callback, |
void * | user_data | ||
) |
Activates Wi-Fi asynchronously.
[in] | callback | The callback function to be called This can be NULL if you don't want to get the notification. |
[in] | user_data | The user data passed to the callback function |
WIFI_ERROR_NONE | Successful |
WIFI_ERROR_INVALID_OPERATION | Invalid operation |
WIFI_ERROR_OPERATION_FAILED | Operation failed |
WIFI_ERROR_SECURITY_RESTRICTED | Restricted by security system policy |
WIFI_ERROR_PERMISSION_DENIED | Permission Denied |
WIFI_ERROR_NOT_SUPPORTED | Not supported |
int wifi_activate_with_wifi_picker_tested | ( | wifi_activated_cb | callback, |
void * | user_data | ||
) |
Activates Wi-Fi asynchronously and displays Wi-Fi picker (popup) when Wi-Fi is not automatically connected.
[in] | callback | The callback function to be called This can be NULL if you don't want to get the notification. |
[in] | user_data | The user data passed to the callback function |
WIFI_ERROR_NONE | Successful |
WIFI_ERROR_INVALID_OPERATION | Invalid operation |
WIFI_ERROR_OPERATION_FAILED | Operation failed |
WIFI_ERROR_SECURITY_RESTRICTED | Restricted by security system policy |
WIFI_ERROR_PERMISSION_DENIED | Permission Denied |
WIFI_ERROR_NOT_SUPPORTED | Not supported |
int wifi_connect | ( | wifi_ap_h | ap, |
wifi_connected_cb | callback, | ||
void * | user_data | ||
) |
Connects the access point asynchronously.
[in] | ap | The access point handle |
[in] | callback | The callback function to be called This can be NULL if you don't want to get the notification. |
[in] | user_data | The user data passed to the callback function |
WIFI_ERROR_NONE | Successful |
WIFI_ERROR_INVALID_OPERATION | Invalid operation |
WIFI_ERROR_INVALID_PARAMETER | Invalid parameter |
WIFI_ERROR_OPERATION_FAILED | Operation failed |
WIFI_ERROR_PERMISSION_DENIED | Permission Denied |
WIFI_ERROR_NOT_SUPPORTED | Not supported |
int wifi_connect_by_wps_pbc | ( | wifi_ap_h | ap, |
wifi_connected_cb | callback, | ||
void * | user_data | ||
) |
Connects the access point with WPS PBC asynchronously.
[in] | ap | The access point handle |
[in] | callback | The callback function to be called This can be NULL if you don't want to get the notification. |
[in] | user_data | The user data passed to the callback function |
WIFI_ERROR_NONE | Successful |
WIFI_ERROR_INVALID_OPERATION | Invalid operation |
WIFI_ERROR_INVALID_PARAMETER | Invalid parameter |
WIFI_ERROR_OPERATION_FAILED | Operation failed |
WIFI_ERROR_PERMISSION_DENIED | Permission Denied |
WIFI_ERROR_NOT_SUPPORTED | Not supported |
int wifi_connect_by_wps_pin | ( | wifi_ap_h | ap, |
const char * | pin, | ||
wifi_connected_cb | callback, | ||
void * | user_data | ||
) |
Connects the access point with WPS PIN asynchronously.
[in] | ap | The access point handle |
[in] | pin | The WPS PIN is a non-NULL string with length greater than 0 and less than or equal to 8 |
[in] | callback | The callback function to be called (this can be NULL if you don't want to get the notification) |
[in] | user_data | The user data passed to the callback function |
WIFI_ERROR_NONE | Successful |
WIFI_ERROR_INVALID_OPERATION | Invalid operation |
WIFI_ERROR_INVALID_PARAMETER | Invalid parameter |
WIFI_ERROR_OPERATION_FAILED | Operation failed |
WIFI_ERROR_PERMISSION_DENIED | Permission Denied |
WIFI_ERROR_NOT_SUPPORTED | Not supported |
int wifi_deactivate | ( | wifi_deactivated_cb | callback, |
void * | user_data | ||
) |
Deactivates Wi-Fi asynchronously.
[in] | callback | The callback function to be called This can be NULL if you don't want to get the notification. |
[in] | user_data | The user data passed to the callback function |
WIFI_ERROR_NONE | Successful |
WIFI_ERROR_INVALID_OPERATION | Invalid operation |
WIFI_ERROR_OPERATION_FAILED | Operation failed |
WIFI_ERROR_PERMISSION_DENIED | Permission Denied |
WIFI_ERROR_NOT_SUPPORTED | Not supported |
int wifi_disconnect | ( | wifi_ap_h | ap, |
wifi_disconnected_cb | callback, | ||
void * | user_data | ||
) |
Disconnects the access point asynchronously.
[in] | ap | The access point handle |
[in] | callback | The callback function to be called This can be NULL if you don't want to get the notification. |
[in] | user_data | The user data passed to the callback function |
WIFI_ERROR_NONE | Successful |
WIFI_ERROR_INVALID_OPERATION | Invalid operation |
WIFI_ERROR_INVALID_PARAMETER | Invalid parameter |
WIFI_ERROR_OPERATION_FAILED | Operation failed |
WIFI_ERROR_PERMISSION_DENIED | Permission Denied |
WIFI_ERROR_NOT_SUPPORTED | Not supported |
int wifi_foreach_found_aps | ( | wifi_found_ap_cb | callback, |
void * | user_data | ||
) |
Gets the result of the scan.
[in] | callback | The callback to be called |
[in] | user_data | The user data passed to the callback function |
WIFI_ERROR_NONE | Successful |
WIFI_ERROR_INVALID_PARAMETER | Invalid parameter |
WIFI_ERROR_OPERATION_FAILED | Operation failed |
WIFI_ERROR_PERMISSION_DENIED | Permission Denied |
WIFI_ERROR_NOT_SUPPORTED | Not supported |
int wifi_foreach_found_specific_aps | ( | wifi_found_ap_cb | callback, |
void * | user_data | ||
) |
Gets the result of specific ap scan.
[in] | callback | The callback to be called |
[in] | user_data | The user data passed to the callback function |
WIFI_ERROR_NONE | Successful |
WIFI_ERROR_INVALID_PARAMETER | Invalid parameter |
WIFI_ERROR_OPERATION_FAILED | Operation failed |
WIFI_ERROR_PERMISSION_DENIED | Permission Denied |
WIFI_ERROR_NOT_SUPPORTED | Not supported |
int wifi_forget_ap | ( | wifi_ap_h | ap | ) |
Deletes the information of stored access point and disconnects it when it connected.
If an AP is connected, then connection information will be stored. This information is used when a connection to that AP is established automatically.
[in] | ap | The access point handle |
WIFI_ERROR_NONE | Successful |
WIFI_ERROR_INVALID_OPERATION | Invalid operation |
WIFI_ERROR_INVALID_PARAMETER | Invalid parameter |
WIFI_ERROR_OPERATION_FAILED | Operation failed |
WIFI_ERROR_PERMISSION_DENIED | Permission Denied |
WIFI_ERROR_NOT_SUPPORTED | Not supported |
int wifi_get_connected_ap | ( | wifi_ap_h * | ap | ) |
Gets the handle of the connected access point.
[out] | ap | The access point handle |
WIFI_ERROR_NONE | Successful |
WIFI_ERROR_INVALID_PARAMETER | Invalid parameter |
WIFI_ERROR_OUT_OF_MEMORY | Out of memory |
WIFI_ERROR_NO_CONNECTION | There is no connected AP |
WIFI_ERROR_PERMISSION_DENIED | Permission Denied |
WIFI_ERROR_NOT_SUPPORTED | Not supported |
int wifi_get_mac_address | ( | char ** | mac_address | ) |
Gets the local MAC address.
[out] | mac_address | The MAC address |
WIFI_ERROR_NONE | Successful |
WIFI_ERROR_INVALID_PARAMETER | Invalid parameter |
WIFI_ERROR_OPERATION_FAILED | Operation failed |
WIFI_ERROR_NOT_SUPPORTED | Not supported |
int wifi_get_network_interface_name | ( | char ** | name | ) |
Gets the name of the network interface.
[out] | name | The name of network interface |
WIFI_ERROR_NONE | Successful |
WIFI_ERROR_INVALID_PARAMETER | Invalid parameter |
WIFI_ERROR_OUT_OF_MEMORY | Out of memory |
WIFI_ERROR_OPERATION_FAILED | Operation failed |
WIFI_ERROR_PERMISSION_DENIED | Permission Denied |
WIFI_ERROR_NOT_SUPPORTED | Not supported |
int wifi_is_activated | ( | bool * | activated | ) |
Checks whether Wi-Fi is activated.
[out] | activated | ture if Wi-Fi is activated, otherwise false if Wi-Fi is not activated. |
WIFI_ERROR_NONE | Successful |
WIFI_ERROR_INVALID_PARAMETER | Invalid parameter |
WIFI_ERROR_OPERATION_FAILED | Operation failed |
WIFI_ERROR_PERMISSION_DENIED | Permission Denied |
WIFI_ERROR_NOT_SUPPORTED | Not supported |
int wifi_scan | ( | wifi_scan_finished_cb | callback, |
void * | user_data | ||
) |
Starts scan asynchronously.
[in] | callback | The callback function to be called |
[in] | user_data | The user data passed to the callback function |
WIFI_ERROR_NONE | Successful |
WIFI_ERROR_INVALID_PARAMETER | Invalid parameter |
WIFI_ERROR_INVALID_OPERATION | Invalid operation |
WIFI_ERROR_OPERATION_FAILED | Operation failed |
WIFI_ERROR_PERMISSION_DENIED | Permission Denied |
WIFI_ERROR_NOT_SUPPORTED | Not supported |
int wifi_scan_specific_ap | ( | const char * | essid, |
wifi_scan_finished_cb | callback, | ||
void * | user_data | ||
) |
Starts specific ap scan, asynchronously.
[in] | essid | The essid of hidden ap |
[in] | callback | The callback function to be called |
[in] | user_data | The user data passed to the callback function |
WIFI_ERROR_NONE | Successful |
WIFI_ERROR_INVALID_PARAMETER | Invalid parameter |
WIFI_ERROR_INVALID_OPERATION | Invalid operation |
WIFI_ERROR_OPERATION_FAILED | Operation failed |
WIFI_ERROR_PERMISSION_DENIED | Permission Denied |
WIFI_ERROR_NOT_SUPPORTED | Not supported |