|
Tizen Native API
10.0
|
The TDLS API offers functionalities for managing TDLS.
Required Header
#include <wifi-manager.h>
Overview
The The TDLS API offers functionalities for managing TDLS.
Related Features
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.
This callback function is registered using `wifi_manager_tdls_set_discovered_cb()` and will be called when the TDLS discovery process is completed.
- Since :
- 4.0
- Remarks:
- peer_mac_addr is usable only in the callback. To use outside the callback, make a copy.
- Parameters:
-
[in] state The TDLS state [in] peer_mac_addr The MAC address of the TDLS peer [in] user_data The user data passed from the callback registration function
| 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.
This callback function is registered using `wifi_manager_tdls_set_state_changed_cb()` and will be called whenever the state of a TDLS connection changes.
- Since :
- 3.0
- Parameters:
-
[in] state The TDLS state [in] peer_mac_addr The MAC address of the TDLS peer [in] user_data The user data passed from the callback registration function
Enumeration Type Documentation
Function Documentation
| 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.
This function retrieves the current state of the IP conflict detection feature. The IP conflict state indicates whether there is an IP address conflict with other devices on the same network.
- Since :
- 5.0
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/network.get
- Parameters:
-
[in] wifi The Wi-Fi handle [out] state The current state of IP conflict
- Returns:
- 0 on success, otherwise negative error value
- Return values:
-
WIFI_MANAGER_ERROR_NONE Successful WIFI_MANAGER_ERROR_NOT_INITIALIZED Not initialized WIFI_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter WIFI_MANAGER_ERROR_OPERATION_FAILED Operation failed WIFI_MANAGER_ERROR_PERMISSION_DENIED Permission Denied WIFI_MANAGER_ERROR_NOT_SUPPORTED Not supported
| int wifi_manager_ip_conflict_detect_is_enabled | ( | wifi_manager_h | wifi, |
| bool * | state | ||
| ) |
Checks whether IP conflict detection is enabled.
This function checks if the IP conflict detection feature is enabled on the device. If the feature is enabled, the function sets the state parameter to true; otherwise, it sets it to false.
- Since :
- 5.0
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/network.get
- Parameters:
-
[in] wifi The Wi-Fi handle [out] state trueif IP conflict detection is enabled, otherwisefalseif IP conflict detection is disabled.
- Returns:
- 0 on success, otherwise negative error value
- Return values:
-
WIFI_MANAGER_ERROR_NONE Successful WIFI_MANAGER_ERROR_NOT_INITIALIZED Not initialized WIFI_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter WIFI_MANAGER_ERROR_OPERATION_FAILED Operation failed WIFI_MANAGER_ERROR_PERMISSION_DENIED Permission Denied WIFI_MANAGER_ERROR_NOT_SUPPORTED Not supported
| int wifi_manager_is_5ghz_band_supported | ( | wifi_manager_h | wifi, |
| bool * | supported | ||
| ) |
Gets whether 5Ghz Wi-Fi band is supported.
This function checks if the device supports the 5Ghz Wi-Fi band. If the device supports it, the function sets the supported parameter to true; otherwise, it sets it to false.
- Since :
- 5.5
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/network.get
- Parameters:
-
[in] wifi The Wi-Fi handle [out] supported trueif 5Ghz Wi-Fi band is supported, otherwisefalseif 5Ghz Wi-Fi band is not supported.
- Returns:
- 0 on success, otherwise negative error value
- Return values:
-
WIFI_MANAGER_ERROR_NONE Successful WIFI_MANAGER_ERROR_NOT_INITIALIZED Not initialized WIFI_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter WIFI_MANAGER_ERROR_OPERATION_FAILED Operation failed WIFI_MANAGER_ERROR_PERMISSION_DENIED Permission Denied WIFI_MANAGER_ERROR_NOT_SUPPORTED Not supported
| int wifi_manager_is_6ghz_band_supported | ( | wifi_manager_h | wifi, |
| bool * | supported | ||
| ) |
Gets whether 6Ghz Wi-Fi band is supported.
This function checks if the device supports the 6Ghz Wi-Fi band. If the device supports it, the function sets the supported parameter to true; otherwise, it sets it to false.
- Since :
- 8.0
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/network.get
- Parameters:
-
[in] wifi The Wi-Fi handle [out] supported trueif 6Ghz Wi-Fi band is supported, otherwisefalseif 6Ghz Wi-Fi band is not supported.
- Returns:
- 0 on success, otherwise negative error value
- Return values:
-
WIFI_MANAGER_ERROR_NONE Successful WIFI_MANAGER_ERROR_NOT_INITIALIZED Not initialized WIFI_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter WIFI_MANAGER_ERROR_OPERATION_FAILED Operation failed WIFI_MANAGER_ERROR_PERMISSION_DENIED Permission Denied WIFI_MANAGER_ERROR_NOT_SUPPORTED Not 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.
This function registers a callback function to receive notifications about changes in the IP conflict state. When the IP conflict state changes, the provided callback function will be called with the new state as an argument.
- Since :
- 5.0
- Parameters:
-
[in] wifi The Wi-Fi handle [in] callback The callback function to be called [in] user_data The user data passed to the callback function
- Returns:
- 0 on success, otherwise negative error value
- Return values:
-
WIFI_MANAGER_ERROR_NONE Successful WIFI_MANAGER_ERROR_NOT_INITIALIZED Not initialized WIFI_MANAGER_ERROR_INVALID_OPERATION Invalid operation WIFI_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter WIFI_MANAGER_ERROR_NOT_SUPPORTED Not supported
| int wifi_manager_set_ip_conflict_detect_enable | ( | wifi_manager_h | wifi, |
| bool | detect | ||
| ) |
Enables or disables IP conflict detection.
This function enables or disables the IP conflict detection feature on the device. When enabled, the device periodically checks for IP address conflicts with other devices on the same network.
- Since :
- 5.0
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/network.set
- Parameters:
-
[in] wifi The Wi-Fi handle [in] detect True or false boolean to enable or disable
- Returns:
0on success, otherwise negative error value
- Return values:
-
WIFI_MANAGER_ERROR_NONE Successful WIFI_MANAGER_ERROR_NOT_INITIALIZED Not initialized WIFI_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter WIFI_MANAGER_ERROR_INVALID_OPERATION Invalid operation WIFI_MANAGER_ERROR_PERMISSION_DENIED Permission denied WIFI_MANAGER_ERROR_NOT_SUPPORTED Not supported
| int wifi_manager_tdls_connect | ( | wifi_manager_h | wifi, |
| const char * | peer_mac_addr | ||
| ) |
Connects to a peer device.
This function establishes a TDLS (802.11z) connection with the specified peer device. The MAC address of the peer device to be connected must be provided as an argument.
- Since :
- 4.0
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/network.set
- Parameters:
-
[in] wifi The Wi-Fi handle [in] peer_mac_addr The MAC address of the peer device to be connected
- Returns:
0on success, otherwise negative error value
- Return values:
-
WIFI_MANAGER_ERROR_NONE Successful WIFI_MANAGER_ERROR_NOT_INITIALIZED Not initialized WIFI_MANAGER_ERROR_INVALID_OPERATION Invalid operation WIFI_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter WIFI_MANAGER_ERROR_OPERATION_FAILED Operation failed WIFI_MANAGER_ERROR_PERMISSION_DENIED Permission Denied WIFI_MANAGER_ERROR_NOT_SUPPORTED Not supported
| int wifi_manager_tdls_disable_channel_switching | ( | wifi_manager_h | wifi, |
| const char * | peer_mac_addr | ||
| ) |
Disables a TDLS channel switching request.
This function disables the TDLS (802.11z) channel switching request for the specified TDLS peer. Channel switching allows the two peers to switch to a different channel to improve communication performance.
- Since :
- 4.0
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/network.set
- Parameters:
-
[in] wifi The Wi-Fi handle [in] peer_mac_addr The MAC address of the connected TDLS peer
- Returns:
0on success, otherwise negative error value
- Return values:
-
WIFI_MANAGER_ERROR_NONE Successful WIFI_MANAGER_ERROR_NOT_INITIALIZED Not initialized WIFI_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter WIFI_MANAGER_ERROR_INVALID_OPERATION Invalid operation WIFI_MANAGER_ERROR_PERMISSION_DENIED Permission denied WIFI_MANAGER_ERROR_NOT_SUPPORTED Not supported
| int wifi_manager_tdls_disconnect | ( | wifi_manager_h | wifi, |
| const char * | peer_mac_addr | ||
| ) |
Disconnects the connected peer.
This function disconnects the currently connected TDLS (802.11z) peer. The MAC address of the peer to be disconnected must be provided as an argument.
- Since :
- 3.0
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/network.set
- Parameters:
-
[in] wifi The Wi-Fi handle [in] peer_mac_addr The MAC address of the connected peer
- Returns:
0on success, otherwise negative error value
- Return values:
-
WIFI_MANAGER_ERROR_NONE Successful WIFI_MANAGER_ERROR_NOT_INITIALIZED Not initialized WIFI_MANAGER_ERROR_INVALID_OPERATION Invalid operation WIFI_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter WIFI_MANAGER_ERROR_OPERATION_FAILED Operation failed WIFI_MANAGER_ERROR_PERMISSION_DENIED Permission Denied WIFI_MANAGER_ERROR_NOT_SUPPORTED Not 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.
This function enables the TDLS (802.11z) channel switching request for the specified TDLS peer. Channel switching allows the two peers to switch to a different channel to improve communication performance.
- Since :
- 4.0
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/network.set
- Parameters:
-
[in] wifi The Wi-Fi handle [in] peer_mac_addr The MAC address of the connected TDLS peer [in] freq The new frequency [MHz]
- Returns:
0on success, otherwise negative error value
- Return values:
-
WIFI_MANAGER_ERROR_NONE Successful WIFI_MANAGER_ERROR_NOT_INITIALIZED Not initialized WIFI_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter WIFI_MANAGER_ERROR_INVALID_OPERATION Invalid operation WIFI_MANAGER_ERROR_PERMISSION_DENIED Permission denied WIFI_MANAGER_ERROR_NOT_SUPPORTED Not supported
| int wifi_manager_tdls_get_connected_peer | ( | wifi_manager_h | wifi, |
| char ** | peer_mac_addr | ||
| ) |
Gets Peer Mac address of Connected peer.
This function retrieves the MAC address of the currently connected TDLS (802.11z) peer. The MAC address is returned as a null-terminated string and must be freed by the caller after use
- 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] wifi The Wi-Fi handle [out] peer_mac_addr The MAC address of the connected peer
- Returns:
0on success, otherwise negative error value
- Return values:
-
WIFI_MANAGER_ERROR_NONE Successful WIFI_MANAGER_ERROR_NOT_INITIALIZED Not initialized WIFI_MANAGER_ERROR_INVALID_OPERATION Invalid operation WIFI_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter WIFI_MANAGER_ERROR_OPERATION_FAILED Operation failed WIFI_MANAGER_ERROR_NO_CONNECTION No active TDLS Connection WIFI_MANAGER_ERROR_PERMISSION_DENIED Permission Denied WIFI_MANAGER_ERROR_NOT_SUPPORTED Not supported
| 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.
This function registers a callback function to receive notifications about discovered TDLS (802.11z) devices. When a TDLS device is found, the provided callback function will be called with the device information as an argument.
- Since :
- 4.0
- Parameters:
-
[in] wifi The Wi-Fi handle [in] callback The callback function to be called [in] user_data The user data passed to the callback function
- Returns:
0on success, otherwise negative error value
- Return values:
-
WIFI_MANAGER_ERROR_NONE Successful WIFI_MANAGER_ERROR_NOT_INITIALIZED Not initialized WIFI_MANAGER_ERROR_INVALID_OPERATION Invalid operation WIFI_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter WIFI_MANAGER_ERROR_NOT_SUPPORTED Not supported
| 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.
This function registers a callback function to receive notifications about changes in the TDLS (802.11z) state. When the TDLS state changes, the provided callback function will be called with the new state as an argument.
- Since :
- 3.0
- Parameters:
-
[in] wifi The Wi-Fi handle [in] callback The callback function to be called [in] user_data The user data passed to the callback function
- Returns:
0on success, otherwise negative error value
- Return values:
-
WIFI_MANAGER_ERROR_NONE Successful WIFI_MANAGER_ERROR_NOT_INITIALIZED Not initialized WIFI_MANAGER_ERROR_INVALID_OPERATION Invalid operation WIFI_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter WIFI_MANAGER_ERROR_NOT_SUPPORTED Not supported
| int wifi_manager_tdls_start_discovery | ( | wifi_manager_h | wifi, |
| const char * | peer_mac_addr | ||
| ) |
Discovers devices that support TDLS.
This function initiates a discovery process to find TDLS (802.11z)-capable devices within range. The MAC address of the peer device to be discovered can be optionally provided as an argument.
- Since :
- 4.0
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/network.set
- Parameters:
-
[in] wifi The Wi-Fi handle [in] peer_mac_addr The MAC address (e.g., ff:ff:ff:ff:ff:ff, AA:BB:CC:DD:EE:FF) of the peer to be discovered
- Returns:
0on success, otherwise negative error value
- Return values:
-
WIFI_MANAGER_ERROR_NONE Successful WIFI_MANAGER_ERROR_NOT_INITIALIZED Not initialized WIFI_MANAGER_ERROR_INVALID_OPERATION Invalid operation WIFI_MANAGER_ERROR_OPERATION_FAILED Operation failed WIFI_MANAGER_ERROR_PERMISSION_DENIED Permission Denied
| int wifi_manager_tdls_unset_discovered_cb | ( | wifi_manager_h | wifi | ) |
Unregisters the callback called when TDLS device is found.
This function unregisters the callback that was previously registered using wifi_manager_tdls_set_discovered_cb(). After calling this function, the application will no longer receive notifications about discovered TDLS devices.
- Since :
- 4.0
- Parameters:
-
[in] wifi The Wi-Fi handle
- Returns:
0on success, otherwise negative error value
- Return values:
-
WIFI_MANAGER_ERROR_NONE Successful WIFI_MANAGER_ERROR_NOT_INITIALIZED Not initialized WIFI_MANAGER_ERROR_INVALID_OPERATION Invalid operation
Unregisters the callback called when TDLS state is changed.
This function unregisters the callback that was previously registered using wifi_manager_tdls_set_state_changed_cb(). After calling this function, the application will no longer receive notifications about changes in the TDLS state.
- Since :
- 3.0
- Parameters:
-
[in] wifi The Wi-Fi handle
- Returns:
0on success, otherwise negative error value
- Return values:
-
WIFI_MANAGER_ERROR_NONE Successful WIFI_MANAGER_ERROR_NOT_INITIALIZED Not initialized WIFI_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter WIFI_MANAGER_ERROR_INVALID_OPERATION Invalid operation WIFI_MANAGER_ERROR_NOT_SUPPORTED Not supported
| int wifi_manager_unset_ip_conflict_cb | ( | wifi_manager_h | wifi | ) |
Unregisters the callback called when IP conflict state is changed.
This function unregisters the callback that was previously registered using wifi_manager_set_ip_conflict_cb(). After calling this function, the application will no longer receive notifications about changes in the IP conflict state.
- Since :
- 5.0
- Parameters:
-
[in] wifi The Wi-Fi handle
- Returns:
- 0 on success, otherwise negative error value
- Return values:
-
WIFI_MANAGER_ERROR_NONE Successful WIFI_MANAGER_ERROR_NOT_INITIALIZED Not initialized WIFI_MANAGER_ERROR_INVALID_OPERATION Invalid operation WIFI_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter WIFI_MANAGER_ERROR_NOT_SUPPORTED Not supported