Tizen Native API  4.0

The TDLS APIs for managing TDLS.

Required Header

#include <wifi-manager.h>

Overview

The TDLS APIs for managing TDLS.

Required Header

This API is related with the following features:

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 featuring your application can be found from Feature Element.

Functions

int wifi_manager_tdls_set_discovered_cb (wifi_manager_h wifi, wifi_manager_tdls_discovered_cb callback, void *user_data)
 Registers the callback called when a TDLS device is found.
int wifi_manager_tdls_unset_discovered_cb (wifi_manager_h wifi)
 Unregisters the callback called when TDLS device is found.
int wifi_manager_tdls_start_discovery (wifi_manager_h wifi, const char *peer_mac_addr)
 Discovers devices that support TDLS.
int wifi_manager_tdls_connect (wifi_manager_h wifi, const char *peer_mac_addr)
 Connects to a peer device.
int wifi_manager_tdls_disconnect (wifi_manager_h wifi, const char *peer_mac_addr)
 Disconnects the connected peer.
int wifi_manager_tdls_get_connected_peer (wifi_manager_h wifi, char **peer_mac_addr)
 Gets Peer Mac address of Connected peer.
int wifi_manager_tdls_set_state_changed_cb (wifi_manager_h wifi, wifi_manager_tdls_state_changed_cb callback, void *user_data)
 Registers the callback called when TDLS state is changed.
int wifi_manager_tdls_unset_state_changed_cb (wifi_manager_h wifi)
 Unregisters the callback called when TDLS state is changed.
int wifi_manager_tdls_enable_channel_switching (wifi_manager_h wifi, const char *peer_mac_addr, int freq)
 Enables a TDLS channel switching request.
int wifi_manager_tdls_disable_channel_switching (wifi_manager_h wifi, const char *peer_mac_addr)
 Disables a TDLS channel switching request.

Typedefs

typedef void(* wifi_manager_tdls_state_changed_cb )(wifi_manager_tdls_state_e state, char *peer_mac_addr, void *user_data)
 Called when the Wi-Fi TDLS state is changed.
typedef void(* wifi_manager_tdls_discovered_cb )(wifi_manager_tdls_discovery_state_e state, char *peer_mac_addr, void *user_data)
 Called when the Wi-Fi TDLS is discovered.

Typedef Documentation

typedef void(* wifi_manager_tdls_discovered_cb)(wifi_manager_tdls_discovery_state_e state, char *peer_mac_addr, void *user_data)

Called when the Wi-Fi TDLS is discovered.

Remarks:
peer_mac_addr is usable only in the callback. To use outside the callback, make a copy.
Parameters:
[in]stateThe TDLS state
[in]peer_mac_addrThe MAC address of the TDLS peer
[in]user_dataThe user data passed from the callback registration function
See also:
wifi_manager_tdls_set_discovered_cb()
wifi_manager_tdls_unset_discovered_cb()
typedef void(* wifi_manager_tdls_state_changed_cb)(wifi_manager_tdls_state_e state, char *peer_mac_addr, void *user_data)

Called when the Wi-Fi TDLS state is changed.

Since :
3.0
Parameters:
[in]stateThe TDLS state
[in]peer_mac_addrThe MAC address of the TDLS peer
[in]user_dataThe user data passed from the callback registration function
See also:
wifi_manager_tdls_set_state_changed_cb()
wifi_manager_tdls_unset_state_changed_cb()

Enumeration Type Documentation

Enumeration for the state of the Wi-Fi TDLS.

Since :
3.0
Enumerator:
WIFI_MANAGER_TDLS_STATE_DISCONNECTED 

Wi-Fi TDLS is Disconnected

WIFI_MANAGER_TDLS_STATE_CONNECTED 

Wi-Fi TDLS is Connected


Function Documentation

int wifi_manager_tdls_connect ( wifi_manager_h  wifi,
const char *  peer_mac_addr 
)

Connects to a peer device.

Since :
4.0
Privilege Level:
public
Privilege:
http://tizen.org/privilege/network.set
Parameters:
[in]wifiThe Wi-Fi handle
[in]peer_mac_addrThe MAC address of the peer device to be connected
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_OPERATION_FAILEDOperation failed
WIFI_MANAGER_ERROR_PERMISSION_DENIEDPermission Denied
WIFI_MANAGER_ERROR_NOT_SUPPORTEDNot supported
int wifi_manager_tdls_disable_channel_switching ( wifi_manager_h  wifi,
const char *  peer_mac_addr 
)

Disables a TDLS channel switching request.

Since :
4.0
Privilege Level:
public
Privilege:
http://tizen.org/privilege/network.set
Parameters:
[in]wifiThe Wi-Fi handle
[in]peer_mac_addrThe MAC address of the connected TDLS peer
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_PERMISSION_DENIEDPermission denied
WIFI_MANAGER_ERROR_NOT_SUPPORTEDNot supported
int wifi_manager_tdls_disconnect ( wifi_manager_h  wifi,
const char *  peer_mac_addr 
)

Disconnects the connected peer.

Since :
3.0
Privilege Level:
public
Privilege:
http://tizen.org/privilege/network.set
Parameters:
[in]wifiThe Wi-Fi handle
[in]peer_mac_addrThe MAC address of the connected peer
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_OPERATION_FAILEDOperation failed
WIFI_MANAGER_ERROR_PERMISSION_DENIEDPermission Denied
WIFI_MANAGER_ERROR_NOT_SUPPORTEDNot supported
int wifi_manager_tdls_enable_channel_switching ( wifi_manager_h  wifi,
const char *  peer_mac_addr,
int  freq 
)

Enables a TDLS channel switching request.

Since :
4.0
Privilege Level:
public
Privilege:
http://tizen.org/privilege/network.set
Parameters:
[in]wifiThe Wi-Fi handle
[in]peer_mac_addrThe MAC address of the connected TDLS peer
[in]freqThe new frequency [MHz]
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_PERMISSION_DENIEDPermission denied
WIFI_MANAGER_ERROR_NOT_SUPPORTEDNot supported
int wifi_manager_tdls_get_connected_peer ( wifi_manager_h  wifi,
char **  peer_mac_addr 
)

Gets Peer Mac address of Connected peer.

Since :
3.0
Privilege Level:
public
Privilege:
http://tizen.org/privilege/network.get
Remarks:
The peer_mac_addr should be freed using free().
Parameters:
[in]wifiThe Wi-Fi handle
[out]peer_mac_addrThe MAC address of the connected peer
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_OPERATION_FAILEDOperation failed
WIFI_MANAGER_ERROR_NO_CONNECTIONNo active TDLS Connection
WIFI_MANAGER_ERROR_PERMISSION_DENIEDPermission Denied
WIFI_MANAGER_ERROR_NOT_SUPPORTEDNot supported

Registers the callback called when a TDLS device is found.

Since :
4.0
Parameters:
[in]wifiThe Wi-Fi 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 TDLS state is changed.

Since :
3.0
Parameters:
[in]wifiThe Wi-Fi 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
int wifi_manager_tdls_start_discovery ( wifi_manager_h  wifi,
const char *  peer_mac_addr 
)

Discovers devices that support TDLS.

Since :
4.0
Privilege Level:
public
Privilege:
http://tizen.org/privilege/network.set
Parameters:
[in]wifiThe Wi-Fi handle
[in]peer_mac_addrThe MAC address (e.g., ff:ff:ff:ff:ff:ff, AA:BB:CC:DD:EE:FF) of the peer to be discovered
Returns:
0 on success, otherwise negative error value
Return values:
WIFI_MANAGER_ERROR_NONESuccessful
WIFI_MANAGER_ERROR_INVALID_OPERATIONInvalid operation
WIFI_MANAGER_ERROR_OPERATION_FAILEDOperation failed
WIFI_MANAGER_ERROR_PERMISSION_DENIEDPermission Denied
WIFI_MANAGER_ERROR_NOT_SUPPORTEDNot supported

Unregisters the callback called when TDLS device is found.

Since :
4.0
Parameters:
[in]wifiThe Wi-Fi handle
Returns:
0 on success, otherwise negative error value
Return values:
WIFI_MANAGER_ERROR_NONESuccessful
WIFI_MANAGER_ERROR_INVALID_OPERATIONInvalid operation
WIFI_MANAGER_ERROR_NOT_SUPPORTEDNot supported

Unregisters the callback called when TDLS state is changed.

Since :
3.0
Parameters:
[in]wifiThe Wi-Fi 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