Tizen Native API  3.0

The Wi-Fi API provides functions for monitoring the state of Wi-Fi.

Required Header

#include <wifi-manager.h>

Overview

The Wi-Fi Monitor allows monitoring the changes of Wi-Fi.

Related Features

This API is related with the following features:

  • http://tizen.org/feature/network.wifi
    It is recommended to design applications with regard to features, for reliability.
    You can check if a device supports the related features for this API by using System Information, and control your application's actions accordingly.
    To ensure your application is only running on the device with specific features, please define the features in your manifest file using the manifest editor in the SDK.
    More details on using features in your application can be found in the Feature List.

Functions

int wifi_manager_get_connection_state (wifi_manager_h wifi, wifi_manager_connection_state_e *connection_state)
 Gets the connection state.
int wifi_manager_set_device_state_changed_cb (wifi_manager_h wifi, wifi_manager_device_state_changed_cb callback, void *user_data)
 Registers the callback called when the device state is changed.
int wifi_manager_unset_device_state_changed_cb (wifi_manager_h wifi)
 Unregisters the callback called when the device state is changed.
int wifi_manager_set_background_scan_cb (wifi_manager_h wifi, wifi_manager_scan_finished_cb callback, void *user_data)
 Registers the callback called when the background scan is finished.
int wifi_manager_unset_background_scan_cb (wifi_manager_h wifi)
 Unregisters the callback called when the scan is finished.
int wifi_manager_set_connection_state_changed_cb (wifi_manager_h wifi, wifi_manager_connection_state_changed_cb callback, void *user_data)
 Registers the callback called when the connection state is changed.
int wifi_manager_unset_connection_state_changed_cb (wifi_manager_h wifi)
 Unregisters the callback called when the connection state is changed.
int wifi_manager_set_rssi_level_changed_cb (wifi_manager_h wifi, wifi_manager_rssi_level_changed_cb callback, void *user_data)
 Registers callback called when the RSSI of connected Wi-Fi is changed.
int wifi_manager_unset_rssi_level_changed_cb (wifi_manager_h wifi)
 Unregisters callback called when the RSSI of connected Wi-Fi is changed.

Typedefs

typedef void(* wifi_manager_device_state_changed_cb )(wifi_manager_device_state_e state, void *user_data)
 Called when the device state is changed.
typedef void(* wifi_manager_connection_state_changed_cb )(wifi_manager_connection_state_e state, wifi_manager_ap_h ap, void *user_data)
 Called when the connection state is changed.
typedef void(* wifi_manager_rssi_level_changed_cb )(wifi_manager_rssi_level_e rssi_level, void *user_data)
 Called when the RSSI of connected Wi-Fi is changed.

Typedef Documentation

Called when the connection state is changed.

Since :
3.0
Parameters:
[in]stateThe connection state
[in]apThe access point
[in]user_dataThe user data passed from the callback registration function
See also:
wifi_manager_set_connection_state_changed_cb()
wifi_manager_unset_connection_state_changed_cb()
typedef void(* wifi_manager_device_state_changed_cb)(wifi_manager_device_state_e state, void *user_data)

Called when the device state is changed.

Since :
3.0
Parameters:
[in]stateThe device state
[in]user_dataThe user data passed from the callback registration function
See also:
wifi_manager_set_device_state_changed_cb()
wifi_manager_unset_device_state_changed_cb()
typedef void(* wifi_manager_rssi_level_changed_cb)(wifi_manager_rssi_level_e rssi_level, void *user_data)

Called when the RSSI of connected Wi-Fi is changed.

Since :
3.0
Parameters:
[in]rssi_levelThe level of RSSI
[in]user_dataThe user data passed from the callback registration function
See also:
wifi_manager_set_rssi_level_changed_cb()
wifi_manager_unset_rssi_level_changed_cb()

Enumeration Type Documentation

Enumeration for the state of the Wi-Fi connection.

Since :
3.0
Enumerator:
WIFI_MANAGER_CONNECTION_STATE_FAILURE 

Connection failed state

WIFI_MANAGER_CONNECTION_STATE_DISCONNECTED 

Disconnected state

WIFI_MANAGER_CONNECTION_STATE_ASSOCIATION 

Association state

WIFI_MANAGER_CONNECTION_STATE_CONFIGURATION 

Configuration state

WIFI_MANAGER_CONNECTION_STATE_CONNECTED 

Connected state

Enumeration for the state of the Wi-Fi device.

Since :
3.0
Enumerator:
WIFI_MANAGER_DEVICE_STATE_DEACTIVATED 

Wi-Fi is Deactivated

WIFI_MANAGER_DEVICE_STATE_ACTIVATED 

Wi-Fi is activated

Enumeration for the RSSI level.

Since :
3.0
Enumerator:
WIFI_MANAGER_RSSI_LEVEL_0 

level 0

WIFI_MANAGER_RSSI_LEVEL_1 

level 1

WIFI_MANAGER_RSSI_LEVEL_2 

level 2

WIFI_MANAGER_RSSI_LEVEL_3 

level 3

WIFI_MANAGER_RSSI_LEVEL_4 

level 4


Function Documentation

Gets the connection state.

Since :
3.0
Privilege Level:
public
Privilege:
http://tizen.org/privilege/network.get
Parameters:
[in]wifiThe wifi handle
[out]connection_stateThe connection state
Returns:
0 on success, otherwise negative error value
Return values:
WIFI_MANAGER_ERROR_NONESuccessful
WIFI_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
WIFI_MANAGER_ERROR_OPERATION_FAILEDOperation failed
WIFI_MANAGER_ERROR_PERMISSION_DENIEDPermission Denied
WIFI_MANAGER_ERROR_NOT_SUPPORTEDNot supported
int wifi_manager_set_background_scan_cb ( wifi_manager_h  wifi,
wifi_manager_scan_finished_cb  callback,
void *  user_data 
)

Registers the callback called when the background scan is finished.

Since :
3.0
Parameters:
[in]wifiThe wifi handle
[in]callbackThe callback function to be called
[in]user_dataThe user data passed to the callback function
Returns:
0 on success, otherwise negative error value
Return values:
WIFI_MANAGER_ERROR_NONESuccessful
WIFI_MANAGER_ERROR_INVALID_OPERATIONInvalid operation
WIFI_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
WIFI_MANAGER_ERROR_NOT_SUPPORTEDNot supported

Registers the callback called when the connection state is changed.

Since :
3.0
Parameters:
[in]wifiThe wifi handle
[in]callbackThe callback function to be called
[in]user_dataThe user data passed to the callback function
Returns:
0 on success, otherwise negative error value
Return values:
WIFI_MANAGER_ERROR_NONESuccessful
WIFI_MANAGER_ERROR_INVALID_OPERATIONInvalid operation
WIFI_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
WIFI_MANAGER_ERROR_NOT_SUPPORTEDNot supported

Registers the callback called when the device state is changed.

Since :
3.0
Parameters:
[in]wifiThe wifi handle
[in]callbackThe callback function to be called
[in]user_dataThe user data passed to the callback function
Returns:
0 on success, otherwise negative error value
Return values:
WIFI_MANAGER_ERROR_NONESuccessful
WIFI_MANAGER_ERROR_INVALID_OPERATIONInvalid operation
WIFI_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
WIFI_MANAGER_ERROR_NOT_SUPPORTEDNot supported

Registers callback called when the RSSI of connected Wi-Fi is changed.

Since :
3.0
Parameters:
[in]wifiThe wifi handle
[in]callbackThe callback function to be called
[in]user_dataThe user data passed to the callback function
Returns:
0 on success, otherwise negative error value
Return values:
WIFI_MANAGER_ERROR_NONESuccessful
WIFI_MANAGER_ERROR_INVALID_OPERATIONInvalid operation
WIFI_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
WIFI_MANAGER_ERROR_NOT_SUPPORTEDNot supported

Unregisters the callback called when the scan is finished.

Since :
3.0
Parameters:
[in]wifiThe wifi handle
Returns:
0 on success, otherwise negative error value
Return values:
WIFI_MANAGER_ERROR_NONESuccessful
WIFI_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
WIFI_MANAGER_ERROR_INVALID_OPERATIONInvalid operation
WIFI_MANAGER_ERROR_NOT_SUPPORTEDNot supported

Unregisters the callback called when the connection state is changed.

Since :
3.0
Parameters:
[in]wifiThe wifi handle
Returns:
0 on success, otherwise negative error value
Return values:
WIFI_MANAGER_ERROR_NONESuccessful
WIFI_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
WIFI_MANAGER_ERROR_INVALID_OPERATIONInvalid operation
WIFI_MANAGER_ERROR_NOT_SUPPORTEDNot supported

Unregisters the callback called when the device state is changed.

Since :
3.0
Parameters:
[in]wifiThe wifi handle
Returns:
0 on success, otherwise negative error value
Return values:
WIFI_MANAGER_ERROR_NONESuccessful
WIFI_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
WIFI_MANAGER_ERROR_INVALID_OPERATIONInvalid operation
WIFI_MANAGER_ERROR_NOT_SUPPORTEDNot supported

Unregisters callback called when the RSSI of connected Wi-Fi is changed.

Since :
3.0
Parameters:
[in]wifiThe wifi handle
Returns:
0 on success, otherwise negative error value
Return values:
WIFI_MANAGER_ERROR_NONESuccessful
WIFI_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
WIFI_MANAGER_ERROR_INVALID_OPERATIONInvalid operation
WIFI_MANAGER_ERROR_NOT_SUPPORTEDNot supported