Tizen Native API  8.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:

  • http://tizen.org/feature/network.wifi.tdls

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.
int wifi_manager_set_ip_conflict_cb (wifi_manager_h wifi, wifi_manager_ip_conflict_cb callback, void *user_data)
 Registers the callback called when IP conflict state is changed.
int wifi_manager_unset_ip_conflict_cb (wifi_manager_h wifi)
 Unregisters the callback called when IP conflict state is changed.
int wifi_manager_set_ip_conflict_detect_enable (wifi_manager_h wifi, bool detect)
 Enables or disables IP conflict detection.
int wifi_manager_ip_conflict_detect_is_enabled (wifi_manager_h wifi, bool *state)
 Checks whether IP conflict detection is enabled.
int wifi_manager_get_ip_conflict_state (wifi_manager_h wifi, wifi_manager_ip_conflict_state_e *state)
 Gets the state of the IP conflict.
int wifi_manager_is_5ghz_band_supported (wifi_manager_h wifi, bool *supported)
 Gets whether 5Ghz Wi-Fi band is supported.
int wifi_manager_is_6ghz_band_supported (wifi_manager_h wifi, bool *supported)
 Gets whether 6Ghz Wi-Fi band is supported.

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.

Since :
4.0
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

Gets the state of the IP conflict.

Since :
5.0
Privilege Level:
public
Privilege:
http://tizen.org/privilege/network.get
Parameters:
[in]wifiThe Wi-Fi handle
[out]stateThe current state of IP conflict
Returns:
0 on success, otherwise negative error value
Return values:
WIFI_MANAGER_ERROR_NONESuccessful
WIFI_MANAGER_ERROR_NOT_INITIALIZEDNot initialized
WIFI_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
WIFI_MANAGER_ERROR_OPERATION_FAILEDOperation failed
WIFI_MANAGER_ERROR_PERMISSION_DENIEDPermission Denied
WIFI_MANAGER_ERROR_NOT_SUPPORTEDNot supported

Checks whether IP conflict detection is enabled.

Since :
5.0
Privilege Level:
public
Privilege:
http://tizen.org/privilege/network.get
Parameters:
[in]wifiThe Wi-Fi handle
[out]statetrue if IP conflict detection is enabled, otherwise false if IP conflict detection is disabled.
Returns:
0 on success, otherwise negative error value
Return values:
WIFI_MANAGER_ERROR_NONESuccessful
WIFI_MANAGER_ERROR_NOT_INITIALIZEDNot initialized
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_is_5ghz_band_supported ( wifi_manager_h  wifi,
bool *  supported 
)

Gets whether 5Ghz Wi-Fi band is supported.

Since :
5.5
Privilege Level:
public
Privilege:
http://tizen.org/privilege/network.get
Parameters:
[in]wifiThe Wi-Fi handle
[out]supportedtrue if 5Ghz Wi-Fi band is supported, otherwise false if 5Ghz Wi-Fi band is not supported.
Returns:
0 on success, otherwise negative error value
Return values:
WIFI_MANAGER_ERROR_NONESuccessful
WIFI_MANAGER_ERROR_NOT_INITIALIZEDNot initialized
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_is_6ghz_band_supported ( wifi_manager_h  wifi,
bool *  supported 
)

Gets whether 6Ghz Wi-Fi band is supported.

Since :
8.0
Privilege Level:
public
Privilege:
http://tizen.org/privilege/network.get
Parameters:
[in]wifiThe Wi-Fi handle
[out]supportedtrue if 6Ghz Wi-Fi band is supported, otherwise false if 6Ghz Wi-Fi band is not supported.
Returns:
0 on success, otherwise negative error value
Return values:
WIFI_MANAGER_ERROR_NONESuccessful
WIFI_MANAGER_ERROR_NOT_INITIALIZEDNot initialized
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_ip_conflict_cb ( wifi_manager_h  wifi,
wifi_manager_ip_conflict_cb  callback,
void *  user_data 
)

Registers the callback called when IP conflict state is changed.

Since :
5.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_NOT_INITIALIZEDNot initialized
WIFI_MANAGER_ERROR_INVALID_OPERATIONInvalid operation
WIFI_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
WIFI_MANAGER_ERROR_NOT_SUPPORTEDNot supported

Enables or disables IP conflict detection.

Since :
5.0
Privilege Level:
public
Privilege:
http://tizen.org/privilege/network.set
Parameters:
[in]wifiThe Wi-Fi handle
[in]detectTrue or false boolean to enable or disable
Returns:
0 on success, otherwise negative error value
Return values:
WIFI_MANAGER_ERROR_NONESuccessful
WIFI_MANAGER_ERROR_NOT_INITIALIZEDNot initialized
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_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_NOT_INITIALIZEDNot initialized
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_NOT_INITIALIZEDNot initialized
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_NOT_INITIALIZEDNot initialized
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_NOT_INITIALIZEDNot initialized
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_NOT_INITIALIZEDNot initialized
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_NOT_INITIALIZEDNot initialized
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_NOT_INITIALIZEDNot initialized
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_NOT_INITIALIZEDNot initialized
WIFI_MANAGER_ERROR_INVALID_OPERATIONInvalid operation
WIFI_MANAGER_ERROR_OPERATION_FAILEDOperation failed
WIFI_MANAGER_ERROR_PERMISSION_DENIEDPermission Denied

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_NOT_INITIALIZEDNot initialized
WIFI_MANAGER_ERROR_INVALID_OPERATIONInvalid operation

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_NOT_INITIALIZEDNot initialized
WIFI_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
WIFI_MANAGER_ERROR_INVALID_OPERATIONInvalid operation
WIFI_MANAGER_ERROR_NOT_SUPPORTEDNot supported

Unregisters the callback called when IP conflict state is changed.

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