Tizen Native API
9.0
|
Wi-Fi Aware provides API to manage Wi-Fi Aware framework.
Required Header
#include <wifi-aware.h>
Overview
The Wi-Fi Aware API provides functions for initializing, enabling, and disabling Wi-Fi Aware functionalities. It allows users to create and destroy Wi-Fi Aware sessions, set callbacks for session termination notifications, stop sessions, and more. Additionally, there are functions available for publishing and subscribing to Wi-Fi Aware services, updating existing subscriptions, sending messages to peers, setting up data paths between peers, and managing security aspects of the data path. Overall, the Wi-Fi Aware API offers comprehensive control over Wi-Fi Aware operations and interactions.
Functions | |
int | wifi_aware_initialize (void) |
Initializes Wi-Fi Aware. | |
int | wifi_aware_deinitialize (void) |
Deinitializes Wi-Fi Aware. | |
int | wifi_aware_enable (wifi_aware_enabled_cb callback, void *user_data) |
Enables Wi-Fi Aware functions. | |
int | wifi_aware_disable (wifi_aware_disabled_cb callback, void *user_data) |
Disables Wi-Fi Aware functions. | |
int | wifi_aware_session_create (wifi_aware_session_type_e session_type, wifi_aware_session_h *session) |
Creates the Wi-Fi Aware Session. | |
int | wifi_aware_session_destroy (wifi_aware_session_h session) |
Destroys the Wi-Fi Aware Session. | |
int | wifi_aware_session_set_terminated_cb (wifi_aware_session_h session, wifi_aware_session_terminated_cb callback, void *user_data) |
Sets a callback function to notify session is terminated. | |
int | wifi_aware_session_unset_terminated_cb (wifi_aware_session_h session) |
Unsets the session terminated callback function. | |
int | wifi_aware_session_stop (wifi_aware_session_h session) |
Stops a Wi-Fi Aware session. | |
int | wifi_aware_session_publish (wifi_aware_session_h session, wifi_aware_publish_h publish, wifi_aware_published_cb callback, void *user_data) |
Publishes a Wi-Fi Aware service so that neighboring devices can find it. | |
int | wifi_aware_session_update_publish (wifi_aware_session_h session, wifi_aware_publish_h publish, wifi_aware_published_cb callback, void *user_data) |
Updates the configuration for a Wi-Fi Aware service that has already been published. | |
int | wifi_aware_session_subscribe (wifi_aware_session_h session, wifi_aware_subscribe_h subscribe, wifi_aware_subscribed_cb callback, void *user_data) |
Starts to find Wi-Fi Aware services. | |
int | wifi_aware_session_update_subscribe (wifi_aware_session_h session, wifi_aware_subscribe_h subscribe, wifi_aware_subscribed_cb callback, void *user_data) |
Updates the configuration for a Wi-Fi Aware service that has already been subscribed. | |
int | wifi_aware_session_set_service_discovered_cb (wifi_aware_session_h session, wifi_aware_service_discovered_cb callback, void *user_data) |
Sets a callback function to notify a service is discovered. | |
int | wifi_aware_session_unset_service_discovered_cb (wifi_aware_session_h session) |
Unsets the service discovered callback function. | |
int | wifi_aware_session_send_message (wifi_aware_session_h session, wifi_aware_peer_h peer, const unsigned char *message, size_t len, wifi_aware_send_message_result_cb callback, void *user_data) |
Sends the message to a peer. | |
int | wifi_aware_session_set_message_received_cb (wifi_aware_session_h session, wifi_aware_message_received_cb callback, void *user_data) |
Sets a callback function to deliver received message from a peer. | |
int | wifi_aware_session_unset_message_received_cb (wifi_aware_session_h session) |
Unsets a callback function for received message. | |
int | wifi_aware_peer_clone (wifi_aware_peer_h *cloned, wifi_aware_peer_h origin) |
Copies a Peer handle. | |
int | wifi_aware_peer_destroy (wifi_aware_peer_h peer) |
Destroys a Peer handle. | |
int | wifi_aware_peer_get_mac (wifi_aware_peer_h peer, unsigned char **mac) |
Gets the MAC address (NAN Management Interface) of Wi-Fi Aware peer. | |
int | wifi_aware_data_path_create (wifi_aware_session_h session, wifi_aware_peer_h peer, wifi_aware_data_path_h *data_path) |
Creates a handle to be used for Wi-Fi Aware Data Path. | |
int | wifi_aware_data_path_set_security (wifi_aware_data_path_h data_path, wifi_aware_security_type_e security_type) |
Sets a security type for Wi-Fi Aware Data Path. | |
int | wifi_aware_data_path_set_psk (wifi_aware_data_path_h data_path, const char *key) |
Sets a passphrase for Wi-Fi Aware Data Path. | |
int | wifi_aware_data_path_set_pmk (wifi_aware_data_path_h data_path, const unsigned char *key) |
Sets a PMK for Wi-Fi Aware Data Path. | |
int | wifi_aware_data_path_set_port (wifi_aware_data_path_h data_path, int port) |
Sets a port for Wi-Fi Aware Data Path. | |
int | wifi_aware_data_path_destroy (wifi_aware_data_path_h data_path) |
Destroys a handle for Wi-Fi Aware Data Path. | |
int | wifi_aware_data_path_open (wifi_aware_data_path_h data_path, wifi_aware_data_path_open_cb callback, void *user_data) |
Requests to open a Wi-Fi Aware Data Path. | |
int | wifi_aware_data_path_close (wifi_aware_data_path_h data_path) |
Closes a Wi-Fi Aware Data Path. | |
int | wifi_aware_data_path_get_peer_port (wifi_aware_data_path_h data_path, int *port) |
Gets a port of a peer. | |
int | wifi_aware_data_path_get_peer_ipv6_address (wifi_aware_data_path_h data_path, char **ipv6_address) |
Gets an IPv6 address of a peer. | |
int | wifi_aware_data_path_get_interface (wifi_aware_data_path_h data_path, char **interface) |
Gets Interface name for Wi-Fi Aware Data Path. | |
int | wifi_aware_data_path_set_terminated_cb (wifi_aware_data_path_h data_path, wifi_aware_data_path_terminated_cb callback, void *user_data) |
Sets a callback function to notify a Data Path termination. | |
int | wifi_aware_data_path_unset_terminated_cb (wifi_aware_data_path_h data_path) |
Unsets the Data Path terminated callback function. | |
Typedefs | |
typedef void * | wifi_aware_session_h |
Wi-Fi Aware Session. | |
typedef void * | wifi_aware_publish_h |
Handle for Wi-Fi Aware Publish configuration. | |
typedef void * | wifi_aware_subscribe_h |
Handle for Wi-Fi Aware Subscribe configuration. | |
typedef void * | wifi_aware_peer_h |
Handle for Wi-Fi Aware peer. | |
typedef void * | wifi_aware_data_path_h |
Handle for Wi-Fi Aware Data Path. | |
typedef void(* | wifi_aware_enabled_cb )(wifi_aware_error_e error, void *user_data) |
Called when Wi-Fi Aware is enabled. | |
typedef void(* | wifi_aware_disabled_cb )(wifi_aware_error_e error, void *user_data) |
Called when Wi-Fi Aware is disabled. | |
typedef void(* | wifi_aware_session_terminated_cb )(wifi_aware_session_h session, wifi_aware_termination_reason_e reason, void *user_data) |
Called when the Wi-Fi Aware Session has been lost. | |
typedef void(* | wifi_aware_published_cb )(wifi_aware_session_h session, wifi_aware_error_e error, void *user_data) |
Called when publish request is finished. | |
typedef void(* | wifi_aware_subscribed_cb )(wifi_aware_session_h session, wifi_aware_error_e error, void *user_data) |
Called when Subscribe request is finished. | |
typedef void(* | wifi_aware_service_discovered_cb )(wifi_aware_session_h session, wifi_aware_peer_h peer, const unsigned char *service_specific_info, size_t service_specific_info_len, int distance, void *user_data) |
Called whenever a matched service for the subscribe configurations is found. | |
typedef void(* | wifi_aware_send_message_result_cb )(wifi_aware_session_h session, wifi_aware_error_e error, void *user_data) |
Called when a message is sent to a peer. | |
typedef void(* | wifi_aware_message_received_cb )(wifi_aware_session_h session, wifi_aware_peer_h peer, const unsigned char *message, size_t len, void *user_data) |
Called whenever receiving a message from a peer. | |
typedef void(* | wifi_aware_data_path_open_cb )(wifi_aware_data_path_h data_path, wifi_aware_error_e error, void *user_data) |
Called when Data Path open request is done. | |
typedef void(* | wifi_aware_data_path_terminated_cb )(wifi_aware_data_path_h data_path, wifi_aware_termination_reason_e reason, void *user_data) |
Called when the Wi-Fi Aware Data Path has been lost. |
Typedef Documentation
typedef void* wifi_aware_data_path_h |
Handle for Wi-Fi Aware Data Path.
- Since :
- 9.0
typedef void(* wifi_aware_data_path_open_cb)(wifi_aware_data_path_h data_path, wifi_aware_error_e error, void *user_data) |
Called when Data Path open request is done.
The following error codes can be received:
WIFI_AWARE_ERROR_NONE Successful
WIFI_AWARE_ERROR_NOT_SUPPORTED Not supported
WIFI_AWARE_ERROR_PERMISSION_DENIED Permission denied
WIFI_AWARE_ERROR_INVALID_PARAMETER Invalid function parameter
WIFI_AWARE_ERROR_INVALID_OPERATION Invalid operation
WIFI_AWARE_ERROR_OPERATION_FAILED Operation failed
- Since :
- 9.0
- Remarks:
- The data_path should not be released.
- Parameters:
-
[in] data_path The Data Path handle [in] error The result of the open request [in] user_data The user data passed from request function
- See also:
- wifi_aware_data_path_open()
typedef void(* wifi_aware_data_path_terminated_cb)(wifi_aware_data_path_h data_path, wifi_aware_termination_reason_e reason, void *user_data) |
Called when the Wi-Fi Aware Data Path has been lost.
- Since :
- 9.0
- Remarks:
- The data_path should not be released.
- Parameters:
-
[in] data_path The terminated Data Path handle [in] reason The reason of termination [in] user_data The user data passed from request function
typedef void(* wifi_aware_disabled_cb)(wifi_aware_error_e error, void *user_data) |
Called when Wi-Fi Aware is disabled.
The following error codes can be received:
WIFI_AWARE_ERROR_NONE Successful
WIFI_AWARE_ERROR_NOT_SUPPORTED Not supported
WIFI_AWARE_ERROR_PERMISSION_DENIED Permission denied
WIFI_AWARE_ERROR_INVALID_PARAMETER Invalid function parameter
WIFI_AWARE_ERROR_INVALID_OPERATION Invalid operation
WIFI_AWARE_ERROR_OPERATION_FAILED Operation failed
- Since :
- 9.0
- Parameters:
-
[in] error The error code [in] user_data The user data passed from the request function
- See also:
- wifi_aware_disable()
typedef void(* wifi_aware_enabled_cb)(wifi_aware_error_e error, void *user_data) |
Called when Wi-Fi Aware is enabled.
The following error codes can be received:
WIFI_AWARE_ERROR_NONE Successful
WIFI_AWARE_ERROR_NOT_SUPPORTED Not supported
WIFI_AWARE_ERROR_PERMISSION_DENIED Permission denied
WIFI_AWARE_ERROR_INVALID_PARAMETER Invalid function parameter
WIFI_AWARE_ERROR_INVALID_OPERATION Invalid operation
WIFI_AWARE_ERROR_OPERATION_FAILED Operation failed
- Since :
- 9.0
- Parameters:
-
[in] error The error code [in] user_data The user data passed from the request function
- See also:
- wifi_aware_enable()
typedef void(* wifi_aware_message_received_cb)(wifi_aware_session_h session, wifi_aware_peer_h peer, const unsigned char *message, size_t len, void *user_data) |
Called whenever receiving a message from a peer.
- Since :
- 9.0
- Remarks:
- The session and peer should not be released.
- Parameters:
-
[in] session The Wi-Fi Aware Session handle [in] peer The peer who sent the message [in] message The message which is sent [in] len The length of the message [in] user_data The user data passed to the callback function
typedef void* wifi_aware_peer_h |
Handle for Wi-Fi Aware peer.
- Since :
- 9.0
typedef void* wifi_aware_publish_h |
Handle for Wi-Fi Aware Publish configuration.
- Since :
- 9.0
typedef void(* wifi_aware_published_cb)(wifi_aware_session_h session, wifi_aware_error_e error, void *user_data) |
Called when publish request is finished.
The following error codes can be received:
WIFI_AWARE_ERROR_NONE Successful
WIFI_AWARE_ERROR_NOT_SUPPORTED Not supported
WIFI_AWARE_ERROR_PERMISSION_DENIED Permission denied
WIFI_AWARE_ERROR_INVALID_PARAMETER Invalid function parameter
WIFI_AWARE_ERROR_INVALID_OPERATION Invalid operation
WIFI_AWARE_ERROR_OPERATION_FAILED Operation failed
- Since :
- 9.0
- Remarks:
- The session should not be released.
- Parameters:
-
[in] session The Wi-Fi Aware Session handle [in] error The error code [in] user_data The user data passed from request function
typedef void(* wifi_aware_send_message_result_cb)(wifi_aware_session_h session, wifi_aware_error_e error, void *user_data) |
Called when a message is sent to a peer.
The following error codes can be received:
WIFI_AWARE_ERROR_NONE Successful
WIFI_AWARE_ERROR_NOT_SUPPORTED Not supported
WIFI_AWARE_ERROR_PERMISSION_DENIED Permission denied
WIFI_AWARE_ERROR_INVALID_PARAMETER Invalid function parameter
WIFI_AWARE_ERROR_INVALID_OPERATION Invalid operation
WIFI_AWARE_ERROR_OPERATION_FAILED Operation failed
- Since :
- 9.0
- Remarks:
- The session should not be released.
- Parameters:
-
[in] session The Wi-Fi Aware Session handle [in] error The error code [in] user_data The user data passed from request function
typedef void(* wifi_aware_service_discovered_cb)(wifi_aware_session_h session, wifi_aware_peer_h peer, const unsigned char *service_specific_info, size_t service_specific_info_len, int distance, void *user_data) |
Called whenever a matched service for the subscribe configurations is found.
- Since :
- 9.0
- Remarks:
- If the publisher doesn't enabled ranging or the subscriber doesn't set both max and min distance,
distance would be negative value.
The session and peer should not be released.
- Parameters:
-
[in] session The Wi-Fi Aware Session handle [in] peer The found Peer information [in] service_specific_info Sequence of octets which were received from published service [in] service_specific_info_len The length of service_specific_info [in] distance The distance to the peer [in] user_data The user data passed to the callback function
typedef void* wifi_aware_session_h |
Wi-Fi Aware Session.
- Since :
- 9.0
typedef void(* wifi_aware_session_terminated_cb)(wifi_aware_session_h session, wifi_aware_termination_reason_e reason, void *user_data) |
Called when the Wi-Fi Aware Session has been lost.
- Since :
- 9.0
- Remarks:
- The session should not be released.
- Parameters:
-
[in] session The Wi-Fi Aware Session handle [in] reason The reason of termination [in] user_data The user data passed from request function
typedef void* wifi_aware_subscribe_h |
Handle for Wi-Fi Aware Subscribe configuration.
- Since :
- 9.0
typedef void(* wifi_aware_subscribed_cb)(wifi_aware_session_h session, wifi_aware_error_e error, void *user_data) |
Called when Subscribe request is finished.
The following error codes can be received:
WIFI_AWARE_ERROR_NONE Successful
WIFI_AWARE_ERROR_NOT_SUPPORTED Not supported
WIFI_AWARE_ERROR_PERMISSION_DENIED Permission denied
WIFI_AWARE_ERROR_INVALID_PARAMETER Invalid function parameter
WIFI_AWARE_ERROR_INVALID_OPERATION Invalid operation
WIFI_AWARE_ERROR_OPERATION_FAILED Operation failed
- Since :
- 9.0
- Remarks:
- The session should not be released.
- Parameters:
-
[in] session The Wi-Fi Aware Session handle [in] error The error code [in] user_data The user data passed from request function
- See also:
- wifi_aware_session_subscribe()
Enumeration Type Documentation
enum wifi_aware_error_e |
Enumeration for Wi-Fi Aware error code.
- Since :
- 9.0
- Enumerator:
Function Documentation
int wifi_aware_data_path_close | ( | wifi_aware_data_path_h | data_path | ) |
Closes a Wi-Fi Aware Data Path.
- Since :
- 9.0
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/network.set
- Parameters:
-
[in] data_path The Data Path handle
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
WIFI_AWARE_ERROR_NONE Successful WIFI_AWARE_ERROR_NOT_SUPPORTED Not supported WIFI_AWARE_ERROR_PERMISSION_DENIED Permission denied WIFI_AWARE_ERROR_INVALID_PARAMETER Invalid function parameter WIFI_AWARE_ERROR_NOT_INITIALIZED Not initialized WIFI_AWARE_ERROR_INVALID_OPERATION Invalid operation WIFI_AWARE_ERROR_OPERATION_FAILED Operation failed
- See also:
- wifi_aware_data_path_open()
int wifi_aware_data_path_create | ( | wifi_aware_session_h | session, |
wifi_aware_peer_h | peer, | ||
wifi_aware_data_path_h * | data_path | ||
) |
Creates a handle to be used for Wi-Fi Aware Data Path.
- Since :
- 9.0
- Remarks:
- The data_path should be released using wifi_aware_data_path_destroy().
- Parameters:
-
[in] session The Wi-Fi Aware Session handle [in] peer The Peer handle [out] data_path The Data Path handle
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
WIFI_AWARE_ERROR_NONE Successful WIFI_AWARE_ERROR_NOT_SUPPORTED Not supported WIFI_AWARE_ERROR_INVALID_PARAMETER Invalid function parameter WIFI_AWARE_ERROR_NOT_INITIALIZED Not initialized WIFI_AWARE_ERROR_OUT_OF_MEMORY Out of memory
- Here is an example of the usage:
wifi_aware_data_path_h data_path; int ret = 0; ret = wifi_aware_data_path_create(g_session, g_peer, &data_path); if (ret != WIFI_AWARE_ERROR_NONE) { printf("Failed to create data path\n"); return; } // Do stuff here for the data path wifi_aware_data_path_destroy(data_path);
- See also:
- wifi_aware_data_path_destroy()
int wifi_aware_data_path_destroy | ( | wifi_aware_data_path_h | data_path | ) |
Destroys a handle for Wi-Fi Aware Data Path.
- Since :
- 9.0
- Parameters:
-
[in] data_path The Data Path handle
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
WIFI_AWARE_ERROR_NONE Successful WIFI_AWARE_ERROR_NOT_SUPPORTED Not supported WIFI_AWARE_ERROR_INVALID_PARAMETER Invalid function parameter WIFI_AWARE_ERROR_NOT_INITIALIZED Not initialized
- See also:
- wifi_aware_data_path_create()
int wifi_aware_data_path_get_interface | ( | wifi_aware_data_path_h | data_path, |
char ** | interface | ||
) |
Gets Interface name for Wi-Fi Aware Data Path.
- Since :
- 9.0
- Remarks:
- The interface should be freed by using free().
- Parameters:
-
[in] data_path The Data Path handle [out] interface The interface name
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
WIFI_AWARE_ERROR_NONE Successful WIFI_AWARE_ERROR_NOT_SUPPORTED Not supported WIFI_AWARE_ERROR_INVALID_PARAMETER Invalid function parameter WIFI_AWARE_ERROR_NOT_INITIALIZED Not initialized WIFI_AWARE_ERROR_INVALID_OPERATION Invalid operation
- Here is an example of the usage:
int ret = 0; char *interface = NULL; ret = wifi_aware_data_path_get_interface(g_data_path, &interface); if (ret != WIFI_AWARE_ERROR_NONE) { printf("Failed to get interface name\n"); return; } // Do stuff here for the interface name free(interface);
int wifi_aware_data_path_get_peer_ipv6_address | ( | wifi_aware_data_path_h | data_path, |
char ** | ipv6_address | ||
) |
Gets an IPv6 address of a peer.
- Since :
- 9.0
- Remarks:
- The ipv6_address should be freed by using free().
- Parameters:
-
[in] data_path The Data Path handle [out] ipv6_address The IPv6 address of a peer
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
WIFI_AWARE_ERROR_NONE Successful WIFI_AWARE_ERROR_NOT_SUPPORTED Not supported WIFI_AWARE_ERROR_INVALID_PARAMETER Invalid function parameter WIFI_AWARE_ERROR_NOT_INITIALIZED Not initialized WIFI_AWARE_ERROR_INVALID_OPERATION Invalid operation
- Here is an example of the usage:
int ret = 0; char *ipv6 = NULL; ret = wifi_aware_data_path_get_peer_ipv6_address(g_data_path, &ipv6); if (ret != WIFI_AWARE_ERROR_NONE) { printf("Failed to get IPv6 address of the peer\n"); return; } // Do stuff here for the IPv6 address of the peer free(ipv6);
int wifi_aware_data_path_get_peer_port | ( | wifi_aware_data_path_h | data_path, |
int * | port | ||
) |
Gets a port of a peer.
- Since :
- 9.0
- Parameters:
-
[in] data_path The Data Path handle [out] port The port
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
WIFI_AWARE_ERROR_NONE Successful WIFI_AWARE_ERROR_NOT_SUPPORTED Not supported WIFI_AWARE_ERROR_INVALID_PARAMETER Invalid function parameter WIFI_AWARE_ERROR_NOT_INITIALIZED Not initialized WIFI_AWARE_ERROR_INVALID_OPERATION Invalid operation
int wifi_aware_data_path_open | ( | wifi_aware_data_path_h | data_path, |
wifi_aware_data_path_open_cb | callback, | ||
void * | user_data | ||
) |
Requests to open a Wi-Fi Aware Data Path.
- Since :
- 9.0
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/network.set
- Remarks:
- The callback will be always invoked whether the open request succeeds or fails.
- Parameters:
-
[in] data_path The Data Path handle [in] callback The callback function [in] user_data The user data passed to the callback function
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
WIFI_AWARE_ERROR_NONE Successful WIFI_AWARE_ERROR_NOT_SUPPORTED Not supported WIFI_AWARE_ERROR_PERMISSION_DENIED Permission denied WIFI_AWARE_ERROR_INVALID_PARAMETER Invalid function parameter WIFI_AWARE_ERROR_NOT_INITIALIZED Not initialized WIFI_AWARE_ERROR_INVALID_OPERATION Invalid operation WIFI_AWARE_ERROR_OPERATION_FAILED Operation failed
- See also:
- wifi_aware_data_path_close()
int wifi_aware_data_path_set_pmk | ( | wifi_aware_data_path_h | data_path, |
const unsigned char * | key | ||
) |
Sets a PMK for Wi-Fi Aware Data Path.
- Since :
- 9.0
- Remarks:
- The key can be used only when security type is WIFI_AWARE_SECURITY_TYPE_PMK.
- Parameters:
-
[in] data_path The Data Path handle [in] key Pairwise Master Key. Its length shall be of length 32.
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
WIFI_AWARE_ERROR_NONE Successful WIFI_AWARE_ERROR_NOT_SUPPORTED Not supported WIFI_AWARE_ERROR_INVALID_PARAMETER Invalid function parameter WIFI_AWARE_ERROR_NOT_INITIALIZED Not initialized WIFI_AWARE_ERROR_INVALID_OPERATION Invalid operation
- See also:
- wifi_aware_data_path_create()
int wifi_aware_data_path_set_port | ( | wifi_aware_data_path_h | data_path, |
int | port | ||
) |
Sets a port for Wi-Fi Aware Data Path.
- Since :
- 9.0
- Remarks:
- The port cannot be exceed 65535.
- Parameters:
-
[in] data_path The Data Path handle [in] port The port
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
WIFI_AWARE_ERROR_NONE Successful WIFI_AWARE_ERROR_NOT_SUPPORTED Not supported WIFI_AWARE_ERROR_INVALID_PARAMETER Invalid function parameter WIFI_AWARE_ERROR_NOT_INITIALIZED Not initialized
- See also:
- wifi_aware_data_path_create()
int wifi_aware_data_path_set_psk | ( | wifi_aware_data_path_h | data_path, |
const char * | key | ||
) |
Sets a passphrase for Wi-Fi Aware Data Path.
- Since :
- 9.0
- Remarks:
- The key can be used only when secure type is WIFI_AWARE_SECURITY_TYPE_PSK.
- Parameters:
-
[in] data_path The Data Path handle [in] key The passphrase
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
WIFI_AWARE_ERROR_NONE Successful WIFI_AWARE_ERROR_NOT_SUPPORTED Not supported WIFI_AWARE_ERROR_INVALID_PARAMETER Invalid function parameter WIFI_AWARE_ERROR_NOT_INITIALIZED Not initialized WIFI_AWARE_ERROR_INVALID_OPERATION Invalid operation
- See also:
- wifi_aware_data_path_create()
int wifi_aware_data_path_set_security | ( | wifi_aware_data_path_h | data_path, |
wifi_aware_security_type_e | security_type | ||
) |
Sets a security type for Wi-Fi Aware Data Path.
- Since :
- 9.0
- Parameters:
-
[in] data_path The Data Path handle [in] security_type The security type
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
WIFI_AWARE_ERROR_NONE Successful WIFI_AWARE_ERROR_NOT_SUPPORTED Not supported WIFI_AWARE_ERROR_INVALID_PARAMETER Invalid function parameter WIFI_AWARE_ERROR_NOT_INITIALIZED Not initialized
- See also:
- wifi_aware_data_path_create()
int wifi_aware_data_path_set_terminated_cb | ( | wifi_aware_data_path_h | data_path, |
wifi_aware_data_path_terminated_cb | callback, | ||
void * | user_data | ||
) |
Sets a callback function to notify a Data Path termination.
- Since :
- 9.0
- Parameters:
-
[in] data_path The Data Path handle [in] callback The callback function [in] user_data The user data passed to the callback function
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
WIFI_AWARE_ERROR_NONE Successful WIFI_AWARE_ERROR_NOT_SUPPORTED Not supported WIFI_AWARE_ERROR_INVALID_PARAMETER Invalid function parameter WIFI_AWARE_ERROR_NOT_INITIALIZED Not initialized
int wifi_aware_data_path_unset_terminated_cb | ( | wifi_aware_data_path_h | data_path | ) |
Unsets the Data Path terminated callback function.
- Since :
- 9.0
- Parameters:
-
[in] data_path The Data Path handle
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
WIFI_AWARE_ERROR_NONE Successful WIFI_AWARE_ERROR_NOT_SUPPORTED Not supported WIFI_AWARE_ERROR_INVALID_PARAMETER Invalid function parameter WIFI_AWARE_ERROR_NOT_INITIALIZED Not initialized
int wifi_aware_deinitialize | ( | void | ) |
Deinitializes Wi-Fi Aware.
- Since :
- 9.0
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
WIFI_AWARE_ERROR_NONE Successful WIFI_AWARE_ERROR_NOT_SUPPORTED Not supported WIFI_AWARE_ERROR_NOT_INITIALIZED Not initialized
- See also:
- wifi_aware_initialize()
int wifi_aware_disable | ( | wifi_aware_disabled_cb | callback, |
void * | user_data | ||
) |
Disables Wi-Fi Aware functions.
- Since :
- 9.0
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/network.set
- Parameters:
-
[in] callback The result of disable request is asynchronously delivered [in] user_data The user data passed to the callback function
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
WIFI_AWARE_ERROR_NONE Successful WIFI_AWARE_ERROR_NOT_SUPPORTED Not supported WIFI_AWARE_ERROR_PERMISSION_DENIED Permission denied WIFI_AWARE_ERROR_NOT_INITIALIZED Not initialized WIFI_AWARE_ERROR_INVALID_OPERATION Invalid operation WIFI_AWARE_ERROR_OPERATION_FAILED Operation failed
- See also:
- wifi_aware_enable()
int wifi_aware_enable | ( | wifi_aware_enabled_cb | callback, |
void * | user_data | ||
) |
Enables Wi-Fi Aware functions.
- Since :
- 9.0
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/network.set
- Remarks:
- If the enable request is successfully done, the application can get the MAC address.
- Parameters:
-
[in] callback The result of enable request is asynchronously delivered [in] user_data The user data passed to the callback function
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
WIFI_AWARE_ERROR_NONE Successful WIFI_AWARE_ERROR_NOT_SUPPORTED Not supported WIFI_AWARE_ERROR_PERMISSION_DENIED Permission denied WIFI_AWARE_ERROR_NOT_INITIALIZED Not initialized WIFI_AWARE_ERROR_ALREADY_ENABLED Already enabled WIFI_AWARE_ERROR_OPERATION_FAILED Operation failed WIFI_AWARE_ERROR_OUT_OF_MEMORY Out of memory
- See also:
- wifi_aware_disable()
int wifi_aware_initialize | ( | void | ) |
Initializes Wi-Fi Aware.
- Since :
- 9.0
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
WIFI_AWARE_ERROR_NONE Successful WIFI_AWARE_ERROR_NOT_SUPPORTED Not supported WIFI_AWARE_ERROR_ALREADY_INITIALIZED Already initialized WIFI_AWARE_ERROR_OPERATION_FAILED Operation failed WIFI_AWARE_ERROR_OUT_OF_MEMORY Out of memory
- See also:
- wifi_aware_deinitialize()
int wifi_aware_peer_clone | ( | wifi_aware_peer_h * | cloned, |
wifi_aware_peer_h | origin | ||
) |
Copies a Peer handle.
- Since :
- 9.0
- Remarks:
- The cloned should be released using wifi_aware_peer_destroy().
- Parameters:
-
[out] cloned The Peer handle copied from origin [in] origin The origin Peer handle
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
WIFI_AWARE_ERROR_NONE Successful WIFI_AWARE_ERROR_NOT_SUPPORTED Not supported WIFI_AWARE_ERROR_INVALID_PARAMETER Invalid function parameter WIFI_AWARE_ERROR_NOT_INITIALIZED Not initialized WIFI_AWARE_ERROR_OUT_OF_MEMORY Out of memory
- Here is an example of the usage:
wifi_aware_peer_h cloned_peer; int ret = 0; ret = wifi_aware_peer_clone(&cloned_peer, src_peer); if (ret != WIFI_AWARE_ERROR_NONE) { printf("Failed to clone the peer\n"); return; } // Do stuff here for cloned peer wifi_aware_peer_destroy(cloned_peer);
- See also:
- wifi_aware_peer_destroy()
int wifi_aware_peer_destroy | ( | wifi_aware_peer_h | peer | ) |
Destroys a Peer handle.
- Since :
- 9.0
- Parameters:
-
[in] peer The Peer handle
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
WIFI_AWARE_ERROR_NONE Successful WIFI_AWARE_ERROR_NOT_SUPPORTED Not supported WIFI_AWARE_ERROR_INVALID_PARAMETER Invalid function parameter WIFI_AWARE_ERROR_NOT_INITIALIZED Not initialized
- See also:
- wifi_aware_peer_clone()
int wifi_aware_peer_get_mac | ( | wifi_aware_peer_h | peer, |
unsigned char ** | mac | ||
) |
Gets the MAC address (NAN Management Interface) of Wi-Fi Aware peer.
- Since :
- 9.0
- Remarks:
- The mac should be freed using free().
- Parameters:
-
[in] peer The Peer handle [out] mac The MAC address of the peer
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
WIFI_AWARE_ERROR_NONE Successful WIFI_AWARE_ERROR_NOT_SUPPORTED Not supported WIFI_AWARE_ERROR_INVALID_PARAMETER Invalid function parameter WIFI_AWARE_ERROR_NOT_INITIALIZED Not initialized WIFI_AWARE_ERROR_OUT_OF_MEMORY Out of memory
- Here is an example of the usage:
peer_info *info = (peer_info *)data; unsigned char *mac = NULL; int ret = 0; ret = wifi_aware_peer_get_mac(info->peer, &mac); if (ret != WIFI_AWARE_ERROR_NONE) { printf("Failed to get mac of the peer\n"); return; } // Do stuff here for the mac free(mac);
int wifi_aware_session_create | ( | wifi_aware_session_type_e | session_type, |
wifi_aware_session_h * | session | ||
) |
Creates the Wi-Fi Aware Session.
- Since :
- 9.0
- Remarks:
- The session should be released using wifi_aware_session_destroy().
- Parameters:
-
[in] session_type The type of session [out] session The Wi-Fi Aware Session handle that is newly created on success
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
WIFI_AWARE_ERROR_NONE Successful WIFI_AWARE_ERROR_NOT_SUPPORTED Not supported WIFI_AWARE_ERROR_INVALID_PARAMETER Invalid function parameter WIFI_AWARE_ERROR_NOT_INITIALIZED Not initialized WIFI_AWARE_ERROR_OUT_OF_MEMORY Out of memory
- Here is an example of the usage:
int ret = 0; wifi_aware_session_h wifi_aware_session = NULL; ret = wifi_aware_session_create(WIFI_AWARE_SESSION_PUBLISH, &wifi_aware_session); if (ret != WIFI_AWARE_ERROR_NONE) { printf("Failed to create session\n"); return; } // Do stuff here for created session wifi_aware_session_destroy(wifi_aware_session);
- See also:
- wifi_aware_session_destroy()
int wifi_aware_session_destroy | ( | wifi_aware_session_h | session | ) |
Destroys the Wi-Fi Aware Session.
- Since :
- 9.0
- Parameters:
-
[in] session The Wi-Fi Aware Session handle
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
WIFI_AWARE_ERROR_NONE Successful WIFI_AWARE_ERROR_NOT_SUPPORTED Not supported WIFI_AWARE_ERROR_INVALID_PARAMETER Invalid function parameter WIFI_AWARE_ERROR_NOT_INITIALIZED Not initialized
- See also:
- wifi_aware_session_create()
int wifi_aware_session_publish | ( | wifi_aware_session_h | session, |
wifi_aware_publish_h | publish, | ||
wifi_aware_published_cb | callback, | ||
void * | user_data | ||
) |
Publishes a Wi-Fi Aware service so that neighboring devices can find it.
- Since :
- 9.0
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/network.set
- Parameters:
-
[in] session The Wi-Fi Aware Session handle [in] publish The Wi-Fi Aware Publish handle [in] callback The callback which gets called when a service is published [in] user_data The user data passed to the callback function
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
WIFI_AWARE_ERROR_NONE Successful WIFI_AWARE_ERROR_NOT_SUPPORTED Not supported WIFI_AWARE_ERROR_PERMISSION_DENIED Permission denied WIFI_AWARE_ERROR_INVALID_PARAMETER Invalid function parameter WIFI_AWARE_ERROR_NOT_INITIALIZED Not initialized WIFI_AWARE_ERROR_INVALID_OPERATION Invalid operation WIFI_AWARE_ERROR_OPERATION_FAILED Operation failed
- See also:
- wifi_aware_session_stop()
int wifi_aware_session_send_message | ( | wifi_aware_session_h | session, |
wifi_aware_peer_h | peer, | ||
const unsigned char * | message, | ||
size_t | len, | ||
wifi_aware_send_message_result_cb | callback, | ||
void * | user_data | ||
) |
Sends the message to a peer.
- Since :
- 9.0
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/network.set
- Parameters:
-
[in] session The Wi-Fi Aware Session handle [in] peer The peer who gets the message [in] message The message sent to a peer [in] len The length of the message [in] callback The callback function [in] user_data The user data passed to the callback function
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
WIFI_AWARE_ERROR_NONE Successful WIFI_AWARE_ERROR_NOT_SUPPORTED Not supported WIFI_AWARE_ERROR_PERMISSION_DENIED Permission denied WIFI_AWARE_ERROR_INVALID_PARAMETER Invalid function parameter WIFI_AWARE_ERROR_NOT_INITIALIZED Not initialized WIFI_AWARE_ERROR_INVALID_OPERATION Invalid operation WIFI_AWARE_ERROR_OPERATION_FAILED Operation failed WIFI_AWARE_ERROR_OUT_OF_MEMORY Out of memory
int wifi_aware_session_set_message_received_cb | ( | wifi_aware_session_h | session, |
wifi_aware_message_received_cb | callback, | ||
void * | user_data | ||
) |
Sets a callback function to deliver received message from a peer.
- Since :
- 9.0
- Parameters:
-
[in] session The Wi-Fi Aware Session handle [in] callback The callback function which gets called [in] user_data The user data passed to callback
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
WIFI_AWARE_ERROR_NONE Successful WIFI_AWARE_ERROR_NOT_SUPPORTED Not supported WIFI_AWARE_ERROR_INVALID_PARAMETER Invalid function parameter WIFI_AWARE_ERROR_NOT_INITIALIZED Not initialized
int wifi_aware_session_set_service_discovered_cb | ( | wifi_aware_session_h | session, |
wifi_aware_service_discovered_cb | callback, | ||
void * | user_data | ||
) |
Sets a callback function to notify a service is discovered.
- Since :
- 9.0
- Parameters:
-
[in] session The Wi-Fi Aware Session handle [in] callback The callback function to register [in] user_data The user data to be passed to the callback function
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
WIFI_AWARE_ERROR_NONE Successful WIFI_AWARE_ERROR_NOT_SUPPORTED Not supported WIFI_AWARE_ERROR_INVALID_PARAMETER Invalid function parameter WIFI_AWARE_ERROR_NOT_INITIALIZED Not initialized
int wifi_aware_session_set_terminated_cb | ( | wifi_aware_session_h | session, |
wifi_aware_session_terminated_cb | callback, | ||
void * | user_data | ||
) |
Sets a callback function to notify session is terminated.
- Since :
- 9.0
- Parameters:
-
[in] session The Wi-Fi Aware Session [in] callback The callback function to register [in] user_data The user data to be passed to the callback function
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
WIFI_AWARE_ERROR_NONE Successful WIFI_AWARE_ERROR_NOT_SUPPORTED Not supported WIFI_AWARE_ERROR_INVALID_PARAMETER Invalid function parameter WIFI_AWARE_ERROR_NOT_INITIALIZED Not initialized
int wifi_aware_session_stop | ( | wifi_aware_session_h | session | ) |
Stops a Wi-Fi Aware session.
- Since :
- 9.0
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/network.set
- Remarks:
- The function of the session, Publish or Subscribe, will be cancelled.
- Parameters:
-
[in] session The Wi-Fi Aware Session handle
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
WIFI_AWARE_ERROR_NONE Successful WIFI_AWARE_ERROR_NOT_SUPPORTED Not supported WIFI_AWARE_ERROR_PERMISSION_DENIED Permission denied WIFI_AWARE_ERROR_INVALID_PARAMETER Invalid function parameter WIFI_AWARE_ERROR_NOT_INITIALIZED Not initialized WIFI_AWARE_ERROR_INVALID_OPERATION Invalid operation WIFI_AWARE_ERROR_OPERATION_FAILED Operation failed
int wifi_aware_session_subscribe | ( | wifi_aware_session_h | session, |
wifi_aware_subscribe_h | subscribe, | ||
wifi_aware_subscribed_cb | callback, | ||
void * | user_data | ||
) |
Starts to find Wi-Fi Aware services.
- Since :
- 9.0
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/network.set
- Parameters:
-
[in] session The Wi-Fi Aware Session handle [in] subscribe The Wi-Fi Aware Subscribe handle [in] callback The callback which get called when request is finished [in] user_data The user data passed to the callback function
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
WIFI_AWARE_ERROR_NONE Successful WIFI_AWARE_ERROR_NOT_SUPPORTED Not supported WIFI_AWARE_ERROR_PERMISSION_DENIED Permission denied WIFI_AWARE_ERROR_INVALID_PARAMETER Invalid function parameter WIFI_AWARE_ERROR_NOT_INITIALIZED Not initialized WIFI_AWARE_ERROR_INVALID_OPERATION Invalid operation WIFI_AWARE_ERROR_OPERATION_FAILED Operation failed
- See also:
- wifi_aware_session_stop()
int wifi_aware_session_unset_message_received_cb | ( | wifi_aware_session_h | session | ) |
Unsets a callback function for received message.
- Since :
- 9.0
- Parameters:
-
[in] session The Wi-Fi Aware Session handle
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
WIFI_AWARE_ERROR_NONE Successful WIFI_AWARE_ERROR_NOT_SUPPORTED Not supported WIFI_AWARE_ERROR_INVALID_PARAMETER Invalid function parameter WIFI_AWARE_ERROR_NOT_INITIALIZED Not initialized
Unsets the service discovered callback function.
- Since :
- 9.0
- Parameters:
-
[in] session The Wi-Fi Aware Session handle
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
WIFI_AWARE_ERROR_NONE Successful WIFI_AWARE_ERROR_NOT_SUPPORTED Not supported WIFI_AWARE_ERROR_INVALID_PARAMETER Invalid function parameter WIFI_AWARE_ERROR_NOT_INITIALIZED Not initialized
int wifi_aware_session_unset_terminated_cb | ( | wifi_aware_session_h | session | ) |
Unsets the session terminated callback function.
- Since :
- 9.0
- Parameters:
-
[in] session The Wi-Fi Aware Session
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
WIFI_AWARE_ERROR_NONE Successful WIFI_AWARE_ERROR_NOT_SUPPORTED Not supported WIFI_AWARE_ERROR_INVALID_PARAMETER Invalid function parameter WIFI_AWARE_ERROR_NOT_INITIALIZED Not initialized
int wifi_aware_session_update_publish | ( | wifi_aware_session_h | session, |
wifi_aware_publish_h | publish, | ||
wifi_aware_published_cb | callback, | ||
void * | user_data | ||
) |
Updates the configuration for a Wi-Fi Aware service that has already been published.
- Since :
- 9.0
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/network.set
- Parameters:
-
[in] session The Wi-Fi Aware Session handle [in] publish The Wi-Fi Aware Publish handle [in] callback The callback which gets called when a service is updated [in] user_data The user data passed to the callback function
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
WIFI_AWARE_ERROR_NONE Successful WIFI_AWARE_ERROR_NOT_SUPPORTED Not supported WIFI_AWARE_ERROR_PERMISSION_DENIED Permission denied WIFI_AWARE_ERROR_INVALID_PARAMETER Invalid function parameter WIFI_AWARE_ERROR_NOT_INITIALIZED Not initialized WIFI_AWARE_ERROR_INVALID_OPERATION Invalid operation WIFI_AWARE_ERROR_OPERATION_FAILED Operation failed
- See also:
- wifi_aware_session_publish()
int wifi_aware_session_update_subscribe | ( | wifi_aware_session_h | session, |
wifi_aware_subscribe_h | subscribe, | ||
wifi_aware_subscribed_cb | callback, | ||
void * | user_data | ||
) |
Updates the configuration for a Wi-Fi Aware service that has already been subscribed.
- Since :
- 9.0
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/network.set
- Parameters:
-
[in] session The Wi-Fi Aware Session handle [in] subscribe The Wi-Fi Aware Subscribe handle [in] callback The callback which gets called when service is updated [in] user_data The user data passed to the callback function
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
WIFI_AWARE_ERROR_NONE Successful WIFI_AWARE_ERROR_NOT_SUPPORTED Not supported WIFI_AWARE_ERROR_PERMISSION_DENIED Permission denied WIFI_AWARE_ERROR_INVALID_PARAMETER Invalid function parameter WIFI_AWARE_ERROR_NOT_INITIALIZED Not initialized WIFI_AWARE_ERROR_INVALID_OPERATION Invalid operation WIFI_AWARE_ERROR_OPERATION_FAILED Operation failed
- See also:
- wifi_aware_session_subscribe()