* @return 0 on success, otherwise a negative error value
* @retval #WIFI_AWARE_ERROR_NONE
* @retval #WIFI_AWARE_ERROR_ALREADY_INITIALIZED
- * @see wifi_aware_deinitialize
+ * @see wifi_aware_deinitialize()
*/
int wifi_aware_initialize();
* @since_tizen 6.0
* @return 0 on success, otherwise a negative error value
* @retval #WIFI_AWARE_ERROR_NONE
- * @see wifi_aware_initialize
+ * @see wifi_aware_initialize()
*/
int wifi_aware_deinitialize();
/**
- * @brief Create a Publish request.
+ * @brief Creates a Publish request.
* @since_tizen 6.0
* @param[out] publish The Wi-Fi Aware Publish handle.
* @return 0 on success, otherwise a negative error value
* @retval #WIFI_AWARE_ERROR_NONE
- * @see wifi_aware_publish_destroy
+ * @see wifi_aware_publish_destroy()
*/
int wifi_aware_publish_create(wifi_aware_publish_h *publish);
/**
- * @brief Destroy a Publish request.
+ * @brief Destroys a Publish request.
* @since_tizen 6.0
* @param[in] publish The Wi-Fi Aware Publish handle.
* @return 0 on success, otherwise a negative error value
* @retval #WIFI_AWARE_ERROR_NONE
- * @see wifi_aware_publish_create
+ * @see wifi_aware_publish_create()
*/
int wifi_aware_publish_destroy(wifi_aware_publish_h publish);
/**
- * @brief Create a Subscribe request.
+ * @brief Creates a Subscribe request.
* @since_tizen 6.0
* @param[out] subscribe The Wi-Fi Aware Subscribe handle.
* @return 0 on success, otherwise a negative error value
* @retval #WIFI_AWARE_ERROR_NONE
- * @see wifi_aware_subscribe_destroy
+ * @see wifi_aware_subscribe_destroy()
*/
int wifi_aware_subscribe_create(wifi_aware_subscribe_h *subscribe);
/**
- * @brief Destroy a Subscribe request.
+ * @brief Destroys a Subscribe request.
* @since_tizen 6.0
* @param[in] subscribe The Wi-Fi Aware Subscribe handle.
* @return 0 on success, otherwise a negative error value
* @retval #WIFI_AWARE_ERROR_NONE
- * @see wifi_aware_subscribe_create
+ * @see wifi_aware_subscribe_create()
*/
int wifi_aware_subscribe_destroy(wifi_aware_subscribe_h subscribe);
* @param[in] ttl The lifetime(seconds) of publish session. 0 means forever until canceled.
* @return 0 on success, otherwise a negative error value
* @retval #WIFI_AWARE_ERROR_NONE
+ * @see wifi_aware_publish_create()
*/
int wifi_aware_publish_set_ttl(wifi_aware_publish_h publish, unsigned short ttl);
/**
- * @brief Set the type of the service as solicited or unsolicited.
+ * @brief Sets the type of the service as solicited or unsolicited.
* @since_tizen 6.0
* @param[in] publish The Wi-Fi Aware Publish handle
* @param[in] publish_type The Publish type
* @return 0 on success, otherwise a negative error value
* @retval #WIFI_AWARE_ERROR_NONE
+ * @see wifi_aware_publish_create()
*/
int wifi_aware_publish_set_type(wifi_aware_publish_h publish, wifi_aware_publish_type_e publish_type);
/**
- * @brief Set the name of the service. The length should be less than or equal to 255
+ * @brief Sets the name of the service.
* @since_tizen 6.0
+ * @remark The length should be less than or equal to 255.
* @param[in] publish The Wi-Fi Aware Publish handle
* @param[in] service_name UTF-8 name which identifies the service
* @return 0 on success, otherwise a negative error value
* @retval #WIFI_AWARE_ERROR_NONE
+ * @see wifi_aware_publish_create()
*/
int wifi_aware_publish_set_service_name(wifi_aware_publish_h publish, const char *service_name);
/**
- * @brief Set the specific information for the service.
+ * @brief Sets the specific information for the service.
* @since_tizen 6.0
* @param[in] publish The Wi-Fi Aware Publish handle
* @param[in] service_specific_info The Sequence of values that are conveyed in the Publish message
* @param[in] len The length of service specific information
* @return 0 on success, otherwise a negative error value
* @retval #WIFI_AWARE_ERROR_NONE
+ * @see wifi_aware_publish_create()
*/
int wifi_aware_publish_set_service_specific_info(wifi_aware_publish_h publish, const unsigned char *service_specific_info, size_t len);
/**
- * @brief Set the match filter of the service.
+ * @brief Sets the match filter of the service.
* @since_tizen 6.0
* @param[in] publish The Wi-Fi Aware Publish handle
* @param[in] match_filter An ordered sequence of <length, value> pairs
* @remark The match filter is used to decide whether accepting a subscribe request or not.
* @return 0 on success, otherwise a negative error value
* @retval #WIFI_AWARE_ERROR_NONE
+ * @see wifi_aware_publish_create()
*/
int wifi_aware_publish_set_match_filter(wifi_aware_publish_h publish, const unsigned char *match_filter, size_t len);
/**
- * @brief Set whether the ranging function is supported or not.
+ * @brief Sets whether the ranging function is supported or not.
* @since_tizen 6.0
* @param[in] publish The Wi-Fi Aware Publish handle
* @param[in] enable @c ture if ranging is enabled,
* otherwise @c false if ranging is disabled.
* @return 0 on success, otherwise a negative error value
* @retval #WIFI_AWARE_ERROR_NONE
+ * @see wifi_aware_publish_create()
*/
int wifi_aware_publish_enable_ranging(wifi_aware_publish_h publish, bool enable);
* 0 means forever until wifi_aware_service_discovered_cb.
* @return 0 on success, otherwise a negative error value
* @retval #WIFI_AWARE_ERROR_NONE
+ * @see wifi_aware_subscrbie_create()
*/
int wifi_aware_subscribe_set_ttl(wifi_aware_subscribe_h subscribe, unsigned short ttl);
* @param[in] subscribe_type The Subscribe type
* @return 0 on success, otherwise a negative error value
* @retval #WIFI_AWARE_ERROR_NONE
+ * @see wifi_aware_subscrbie_create()
*/
int wifi_aware_subscribe_set_type(wifi_aware_subscribe_h subscribe, wifi_aware_subscribe_type_e subscribe_type);
/**
- * @brief Set the name of the service.
+ * @brief Sets the name of the service.
* @since_tizen 6.0
* @param[in] subscribe The Wi-Fi Aware Subscribe handle
* @param[in] service_name UTF-8 name which identifies the service
* @remark The length should be less than or equal to 255
* @return 0 on success, otherwise a negative error value
* @retval #WIFI_AWARE_ERROR_NONE
+ * @see wifi_aware_subscrbie_create()
*/
int wifi_aware_subscribe_set_service_name(wifi_aware_subscribe_h subscribe, const char *service_name);
* @param[in] len The length of service specific information
* @return 0 on success, otherwise a negative error value
* @retval #WIFI_AWARE_ERROR_NONE
+ * @see wifi_aware_subscrbie_create()
*/
int wifi_aware_subscribe_set_service_specific_info(wifi_aware_subscribe_h subscribe, const unsigned char *service_specific_info, size_t len);
* @remark The match filter is used to decide whether accepting a subscribe request or not.
* @return 0 on success, otherwise a negative error value
* @retval #WIFI_AWARE_ERROR_NONE
+ * @see wifi_aware_subscrbie_create()
*/
int wifi_aware_subscribe_set_match_filter(wifi_aware_subscribe_h subscribe, const unsigned char *match_filter, size_t len);
* @param[in] distance The max distance between found services
* @return 0 on success, otherwise a negative error value
* @retval #WIFI_AWARE_ERROR_NONE
+ * @see wifi_aware_subscrbie_create()
*/
int wifi_aware_subscribe_set_max_distance(wifi_aware_subscribe_h subscribe, int distance);
* @param[in] distance The min distance between found services
* @return 0 on success, otherwise a negative error value
* @retval #WIFI_AWARE_ERROR_NONE
+ * @see wifi_aware_subscrbie_create()
*/
int wifi_aware_subscribe_set_min_distance(wifi_aware_subscribe_h subscribe, int distance);
* @param[in] user_data The user data passed from the request function
* @return 0 on success, otherwise a negative error value
* @retval #WIFI_AWARE_ERROR_NONE
+ * @see wifi_aware_enable()
*/
typedef void(*wifi_aware_enabled_cb)(wifi_aware_error_e error, void *user_data);
/**
* @brief Enables Wi-Fi Aware functions.
- * If Wi-Fi Aware is already enabled, the callback to return success is immediately invoked.
* @remarks If the enable request is sucessfully done, the application can get the MAC address.
- * TODO: Does an application need to know MAC address (NMI)?
* @since_tizen 6.0
* @param[in] callback The result of enable request is asynchrously delivered
* @param[in] user_data The user data passed to the callback function
* @return 0 on success, otherwise a negative error value
* @retval #WIFI_AWARE_ERROR_NONE
+ * @see wifi_aware_disable()
*/
int wifi_aware_enable(wifi_aware_enabled_cb callback, void *user_data);
* @since_tizen 6.0
* @return 0 on success, otherwise a negative error value
* @retval #WIFI_AWARE_ERROR_NONE
+ * @see wifi_aware_enable()
*/
int wifi_aware_disable();
* @param[out] session The Wi-Fi Aware Session handle that is newly created on success
* @return 0 on success, otherwise a negative error value
* @retval #WIFI_AWARE_ERROR_NONE
+ * @see wifi_aware_session_destroy()
*/
int wifi_aware_session_create(wifi_aware_session_type_e session_type, wifi_aware_session_h *session);
* @param[in] session The Wi-Fi Aware Session handle
* @return 0 on success, otherwise a negative error value
* @retval #WIFI_AWARE_ERROR_NONE
+ * @see wifi_aware_session_create()
*/
int wifi_aware_session_destroy(wifi_aware_session_h session);
* @param[in] session The Wi-Fi Aware Session handle
* @param[in] reason The reason of termination
* @param[in] user_data The user data passed from request function
+ * @see wifi_aware_session_set_terminated_cb()
+ * @see wifi_aware_session_unset_terminated_cb()
*/
typedef void(*wifi_aware_session_terminated_cb)(wifi_aware_session_h session,
wifi_aware_termination_reason_e reason, void *user_data);
* @param[in] user_data The user data to be passed to the callback function
* @return 0 on success, otherwise a negative error value
* @retval #WIFI_AWARE_ERROR_NONE
+ * @see wifi_aware_session_unset_terminated_cb()
*/
int wifi_aware_session_set_terminated_cb(wifi_aware_session_h session,
wifi_aware_session_terminated_cb callback, void *user_data);
/**
- * @brief Unregisters the terminated callback function.
+ * @brief Unregisters the session terminated callback function.
* @since_tizen 6.0
* @param[in] session The Wi-Fi Aware Session
* @return 0 on success, otherwise a negative error value
* @retval #WIFI_AWARE_ERROR_NONE
+ * @see wifi_aware_session_set_terminated_cb()
*/
int wifi_aware_session_unset_terminated_cb(wifi_aware_session_h session);
/**
+ * @brief Stops a Wi-Fi Aware session.
+ * @since_tizen 6.0
+ * @param[in] session The Wi-Fi Aware Session handle
+ * @remark The function of the session, Publish or Subscribe, will be cancelled.
+ * @return 0 on success, otherwise a negative error value
+ * @retval #WIFI_AWARE_ERROR_NONE
+ * @see wifi_aware_session_publish()
+ * @see wifi_aware_session_subscribe()
+ */
+int wifi_aware_session_stop(wifi_aware_session_h session);
+
+/**
* @brief Called when publish request is finished.
* @since_tizen 6.0
* @param[in] session The Wi-Fi Aware Session handle
* @param[in] error The error code
* @param[in] user_data The user data passed from request function
- * @return 0 on success, otherwise a negative error value
* @retval #WIFI_AWARE_ERROR_NONE
* @see wifi_aware_session_publish()
* @see wifi_aware_session_update_publish()
/**
* @brief Publishes a Wi-Fi Aware service so that neighboring devices can find it.
* @since_tizen 6.0
- * @param[in] sesssion
- * @param[in] publish
- * @param[in] callback
- * @param[in] user_data
+ * @param[in] sesssion The Wi-Fi Aware Session handle
+ * @param[in] publish The Wi-Fi Aware Publish handle
+ * @param[in] callback The callback which gets called when a service is published
+ * @param[in] user_data The user data passed to the callback function
* @return 0 on success, otherwise a negative error value
* @retval #WIFI_AWARE_ERROR_NONE
+ * @see wifi_aware_session_stop()
*/
int wifi_aware_session_publish(wifi_aware_session_h session,
wifi_aware_publish_h publish,
void *user_data);
/**
- * @brief Update the configuration for a Wi-Fi Aware service that has already been published.
+ * @brief Updates the configuration for a Wi-Fi Aware service that has already been published.
* @since_tizen 6.0
- * @param[in] sesssion
- * @param[in] publish
- * @param[in] callback
- * @param[in] user_data
+ * @param[in] sesssion The Wi-Fi Aware Session handle
+ * @param[in] publish The Wi-Fi Aware Publish handle
+ * @param[in] callback The callback which gets called when a service is updated
+ * @param[in] user_data The user data passed to the callback function
* @return 0 on success, otherwise a negative error value
* @retval #WIFI_AWARE_ERROR_NONE
+ * @see wifi_aware_session_publish()
*/
int wifi_aware_session_update_publish(wifi_aware_session_h session,
wifi_aware_publish_h publish,
wifi_aware_published_cb callback, void *user_data);
/**
- * @brief
+ * @brief Called when Subscribe request is finished.
* @since_tizen 6.0
- * @param[in] session
- * @param[in] error
- * @param[in] user_data
- * @return 0 on success, otherwise a negative error value
+ * @param[in] session The Wi-Fi Aware Session handle
+ * @param[in] error The error code
+ * @param[in] user_data The user data passed from request function
* @retval #WIFI_AWARE_ERROR_NONE
+ * @see wifi_aware_session_subscribe()
*/
typedef void(*wifi_aware_subscribed_cb)(wifi_aware_session_h session,
wifi_aware_error_e error, void *user_data);
/**
- * @brief Start to find Wi-Fi Aware services.
+ * @brief Starts to find Wi-Fi Aware services.
* @since_tizen 6.0
- * @param[in] session
- * @param[in] subscribe
- * @param[in] callback
- * @param[in] user_data
+ * @param[in] session The Wi-Fi Aware Session handle
+ * @param[in] subscribe The Wi-Fi Aware Subscribe handle
+ * @param[in] callback The callback which get called when request is finished
+ * @param[in] user_data The user data passed to the callback function
* @return 0 on success, otherwise a negative error value
* @retval #WIFI_AWARE_ERROR_NONE
+ * @see wifi_aware_session_stop()
*/
int wifi_aware_session_subscribe(wifi_aware_session_h,
wifi_aware_subscribe_h subscribe,
wifi_aware_subscribed_cb callback, void *user_data);
/**
- * @brief Stop a Wi-Fi Aware session. The function of the session, Publish or Subscribe, will be cancelled.
+ * @brief Updates the configuration for a Wi-Fi Aware service that has already been subscribed.
* @since_tizen 6.0
- * @param[in] session
- * @return 0 on success, otherwise a negative error value
- * @retval #WIFI_AWARE_ERROR_NONE
- */
-int wifi_aware_session_stop(wifi_aware_session_h session);
-
-/**
- * @brief Update the configuration for a Wi-Fi Aware service that has already been subscribed.
- * @since_tizen 6.0
- * @param[in] session
- * @param[in] subscribe
- * @param[in] callback
- * @param[in] user_data
+ * @param[in] session The Wi-Fi Aware Session handle
+ * @param[in] subscribe The Wi-Fi Aware Subscribe handle
+ * @param[in] callback The callback which gets called when service is updated
+ * @param[in] user_data The user data passed to the callback function
* @return 0 on success, otherwise a negative error value
* @retval #WIFI_AWARE_ERROR_NONE
+ * @see wifi_aware_session_subscribe()
*/
int wifi_aware_session_update_subscribe(wifi_aware_session_h session,
wifi_aware_subscribe_h subscribe,
wifi_aware_subscribed_cb callback, void *user_data);
/**
- * @brief
+ * @brief Called whenever a matched service for the subscribe configurations is found.
* @since_tizen 6.0
- * @param[in] session
- * @param[in] peer
- * @param[in] service_specific_info
- * @param[in] service_specific_info_len
- * @param[in] distance
- * @return 0 on success, otherwise a negative error value
+ * @remkar If ranging is not supported or not enabled, @a distance would be 0.
+ * @param[in] session The Wi-Fi Aware Session handle
+ * @param[in] peer The found Peer information
+ * @param[in] service_specific_info Sequence of octets which were received from published service
+ * @param[in] service_specific_info_len The length of @a service_specific_info
+ * @param[in] distance The distance to the peer
* @retval #WIFI_AWARE_ERROR_NONE
+ * @see wifi_aware_session_set_service_discovered_cb()
+ * @see wifi_aware_session_unset_service_discovered_cb()
*/
typedef void(*wifi_aware_service_discovered_cb)(wifi_aware_session_h session,
wifi_aware_peer_h peer,
void *user_data);
/**
- * @brief
+ * @brief Registers a callback function to notify a service is discovered.
* @since_tizen 6.0
- * @param[in] session
- * @param[in] callback
- * @param[in] user_data
+ * @param[in] session The Wi-Fi Aware Session handle
+ * @param[in] callback The callback function to register
+ * @param[in] user_data The user data to be passed to the callback function
* @return 0 on success, otherwise a negative error value
* @retval #WIFI_AWARE_ERROR_NONE
+ * @see wifi_aware_session_unset_service_discovered_cb()
*/
int wifi_aware_session_set_service_discovered_cb(wifi_aware_session_h session,
wifi_aware_service_discovered_cb callback, void *user_data);
/**
- * @brief
+ * @brief Unregisters the service discovered callback function.
* @since_tizen 6.0
- * @param[in] session
- * @param[in] user_data
+ * @param[in] session The Wi-Fi Aware Session handle
* @return 0 on success, otherwise a negative error value
* @retval #WIFI_AWARE_ERROR_NONE
+ * @see wifi_aware_session_set_service_discovered_cb()
*/
int wifi_aware_session_unset_service_discovered_cb(wifi_aware_session_h session);
/**
- * @brief
+ * @brief Called when a message is sent to a peer.
* @since_tizen 6.0
- * @param[in] error
- * @param[in] session
- * @param[in] user_data
+ * @param[in] session The Wi-Fi Aware Session handle
+ * @param[in] error The error code
+ * @param[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);
/**
- * @brief
+ * @brief Sends the message to a peer
* @since_tizen 6.0
- * @param[in] session
- * @param[in] peer
- * @param[in] message
- * @param[in] len
- * @param[in] callback
- * @param[in] user_data
+ * @param[in] session The Wi-Fi Aware Session handle
+ * @param[in] peer The peer who gets the message
+ * @param[in] message The message sent to a peer
+ * @param[in] len The length of the message
+ * @param[in] callback The callback function
+ * @param[in] user_data The user data passed to the callback function
* @return 0 on success, otherwise a negative error value
* @retval #WIFI_AWARE_ERROR_NONE
*/
wifi_aware_send_message_result_cb callback, void *user_data);
/**
- * @brief
+ * @brief Called whenever receiving a message from a peer.
* @since_tizen 6.0
- * @param[in] session
- * @param[in] peer
- * @param[in] message
- * @param[in] len
- * @return 0 on success, otherwise a negative error value
+ * @param[in] session The Wi-Fi Aware Session handle
+ * @param[in] peer The peer who sent the message
+ * @param[in] message The message which is sent
+ * @param[in] len The length of the message
* @retval #WIFI_AWARE_ERROR_NONE
+ * @see wifi_aware_session_set_message_received_cb()
+ * @see wifi_aware_session_unset_message_received_cb()
*/
typedef void(*wifi_aware_message_received_cb)(
wifi_aware_session_h session,
const unsigned char *message, size_t len, void *user_data);
/**
- * @brief
+ * @brief Registers a callback function to deliver received message from a peer.
* @since_tizen 6.0
- * @param[in] session
- * @param[in] callback
- * @param[in] user_data
+ * @param[in] session The Wi-Fi Aware Session handle
+ * @param[in] callback The callback function which gets called
+ * @param[in] user_data The user data paseed to @a callback
* @return 0 on success, otherwise a negative error value
* @retval #WIFI_AWARE_ERROR_NONE
+ * @see wifi_aware_session_unset_message_received_cb()
*/
int wifi_aware_session_set_message_received_cb(wifi_aware_session_h session,
wifi_aware_message_received_cb callback, void *user_data);
/**
- * @brief
+ * @brief Unregisters a callback function for received message.
* @since_tizen 6.0
- * @param[in] session
+ * @param[in] session The Wi-Fi Aware Session handle
* @return 0 on success, otherwise a negative error value
* @retval #WIFI_AWARE_ERROR_NONE
+ * @see wifi_aware_session_set_message_received_cb()
*/
int wifi_aware_session_unset_message_received_cb(wifi_aware_session_h session);
/**
- * @brief
+ * @brief Copies a Peer handle.
* @since_tizen 6.0
- * @param[out] cloned
- * @param[in] origin
+ * @param[out] cloned The Peer handle copied from @a origin
+ * @param[in] origin The origin Peer handle
+ * @remark The cloned Peer handle has to be freed by wifi_aware_peer_destroy()
* @return 0 on success, otherwise a negative error value
* @retval #WIFI_AWARE_ERROR_NONE
+ * @see wifi_aware_peer_destroy()
*/
int wifi_aware_peer_clone(wifi_aware_peer_h *cloned, wifi_aware_peer_h origin);
/**
- * @brief
+ * @brief Destroys a Peer handle
* @since_tizen 6.0
- * @param[in] peer
+ * @param[in] peer The Peer handle
* @return 0 on success, otherwise a negative error value
* @retval #WIFI_AWARE_ERROR_NONE
+ * @see wifi_aware_peer_clone()
*/
int wifi_aware_peer_destroy(wifi_aware_peer_h peer);
/**
- * @brief Get the MAC address (NAN Management Interface) of Wi-Fi Aware peer.
+ * @brief Gets the MAC address (NAN Management Interface) of Wi-Fi Aware peer.
* @remarks @a mac should be freed using free().
* @since_tizen 6.0
- * @param[in] peer
- * @param[out] mac
+ * @param[in] peer The Peer handle
+ * @param[out] mac The MAC address of the peer
+ * @return 0 on success, otherwise a negative error value
*/
int wifi_aware_peer_get_mac(wifi_aware_peer_h peer, unsigned char **mac);
+/**
+ * @brief Enumeration for Wi-Fi Aware security type.
+ * @since_tizen 6.0
+ */
typedef enum {
WIFI_AWARE_SECURITY_TYPE_OPEN,
WIFI_AWARE_SECURITY_TYPE_PSK,
} wifi_aware_security_type_e;
/**
- * @brief Create a handle to be used for Wi-Fi Aware Data Path
+ * @brief Creates a handle to be used for Wi-Fi Aware Data Path.
* @since_tizen 6.0
- * @param[in] session
- * @param[in] peer
- * @param[out] data_path
+ * @param[in] session The Wi-Fi Aware Session handle
+ * @param[in] peer The Peer handle
+ * @param[out] data_path The Data Path handle
+ * @return 0 on success, otherwise a negative error value
+ * @see wifi_aware_data_path_destroy()
*/
int wifi_aware_data_path_create(wifi_aware_session_h session, wifi_aware_peer_h peer,
wifi_aware_data_path_h *data_path);
/**
- * @brief Set a security type
+ * @brief Sets a security type for Wi-Fi Aware Data Path.
* @since_tizen 6.0
- * @param[in] data_path
- * @param[in] security_type
+ * @param[in] data_path The Data Path handle
+ * @param[in] security_type The security type
+ * @return 0 on success, otherwise a negative error value
+ * @see 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);
/**
- * @brief Set a passphrase for Wi-Fi Aware Data Path. It can be used only when secury_type is WIFI_AWARE_SECURITY_TYPE_PSK.
+ * @brief Sets a passphrase for Wi-Fi Aware Data Path.
* @since_tizen 6.0
- * @param[in] data_path
- * @param[in] key
+ * @param[in] data_path The Data Path handle
+ * @param[in] key The passphrase
+ * @remark @a key can be used only when secury type is WIFI_AWARE_SECURITY_TYPE_PSK.
+ * @return 0 on success, otherwise a negative error value
+ * @see wifi_aware_data_path_create()
*/
int wifi_aware_data_path_set_psk(wifi_aware_data_path_h data_path, const char *key);
/**
- * @brief Set a PMK for Wi-Fi Aware Data Path. It can be used only when secury_type is WIFI_AWARE_SECURITY_TYPE_PMK.
+ * @brief Sets a PMK for Wi-Fi Aware Data Path.
* @since_tizen 6.0
+ * @remkar @key can be used only when security type is WIFI_AWARE_SECURITY_TYPE_PMK.
* @param[in] data_path
* @param[in] key Pairwise Master Key. Its length shall be of length 32.
+ * @return 0 on success, otherwise a negative error value
+ * @see wifi_aware_data_path_create()
*/
int wifi_aware_data_path_set_pmk(wifi_aware_data_path_h data_path, const unsigned char *key);
// only for responder
/**
- * @brief
- * @remarks This is only for Data Path Responder
+ * @brief Sets a port for Wi-Fi Aware Data Path.
* @since_tizen 6.0
- * @param[in] data_path
- * @param[in] port
+ * @param[in] data_path The Data Path handle
+ * @param[in] port The port
+ * @remarks This is only for Data Path Responder.\n
+ * @a port cannot be exceed 65535.
* @return 0 on success, otherwise a negative error value
* @retval #WIFI_AWARE_ERROR_NONE
+ * @see wifi_aware_data_path_create()
*/
int wifi_aware_data_path_set_port(wifi_aware_data_path_h data_path, int port);
// We are considering to add wifi_aware_data_path_set_ip_address().
/**
- * @brief Destroy a handle for Wi-Fi Aware Data Path
+ * @brief Destroys a handle for Wi-Fi Aware Data Path.
* @since_tizen 6.0
- * @param[in] data_path
+ * @param[in] data_path The Data Path handle
+ * @return 0 on success, otherwise a negative error value
+ * @see wifi_aware_data_path_create()
*/
int wifi_aware_data_path_destroy(wifi_aware_data_path_h data_path);
/**
- * @brief This callback is invoked when wifi_aware_data_path_open is done with a result (success/failure)
+ * @brief Called when Data Path open request is done.
* @since_tizen 6.0
- * @param[in] data_path
- * @param[in] error
- * @param[in] mac peer's NDI (NAN Data Interface)
- * @param[in] user_data
+ * @param[in] data_path The Data Path handle
+ * @param[in] error The result of the open request
+ * @param[in] mac The peer's NDI (NAN Data Interface)
+ * @param[in] user_data The user data passed from request function
+ * @see wifi_aware_data_path_open()
*/
typedef void(*wifi_aware_data_path_open_cb)(wifi_aware_data_path_h data_path, wifi_aware_error_e error,
void *user_data);
/**
- * @brief Start to open a Wi-Fi Aware Data Path.
+ * @brief Starts to open a Wi-Fi Aware Data Path.
* @remarks The @a callback will be always invoked whether the open request succeeds or fails.
* @since_tizen 6.0
- * @param[in] data_path
- * @param[in] callback
- * @param[in] user_data
+ * @param[in] data_path The Data Path handle
+ * @param[in] callback The callback function
+ * @param[in] user_data The user data passed to the callback function
+ * @return 0 on success, otherwise a negative error value
+ * @see wifi_aware_data_path_close()
*/
int wifi_aware_data_path_open(wifi_aware_data_path_h data_path,
wifi_aware_data_path_open_cb callback, void *user_data);
/**
- * @brief Close a Wi-Fi Aware Data Path.
+ * @brief Closes a Wi-Fi Aware Data Path.
* @since_tizen 6.0
- * @param[in] data_path
+ * @param[in] data_path The Data Path handle
+ * @see wifi_aware_data_path_open()
*/
int wifi_aware_data_path_close(wifi_aware_data_path_h data_path);
/**
- * @brief
- * @remarks This is only for Data Path Initiator
+ * @brief Gets a port of a peer.
+ * @remarks This is only for Data Path Initiator.
* @since_tizen 6.0
- * @param[in]
- * @param[out]
- * @return
+ * @param[in] data_path The Data Path handle
+ * @param[out] port The port
+ * @return 0 on success, otherwise a negative error value
* @retval #WIFI_AWARE_ERROR_NONE
*/
int wifi_aware_data_path_get_peer_port(wifi_aware_data_path_h data_path, int* port);
/**
- * @brief
- * @remarks This is only for Data Path Initiator
+ * @brief Gets an IPv6 address of a peer
+ * @remarks This is only for Data Path Initiator.
* @remarks @a ipv6_address should be freed by using free().
* @since_tizen 6.0
- * @param[in]
- * @param[out]
- * @return
+ * @param[in] data_path The Data Path handle
+ * @param[out] ipv6_address The IPv6 address of a peer
+ * @return 0 on success, otherwise a negative error value
* @retval #WIFI_AWARE_ERROR_NONE
*/
int wifi_aware_data_path_get_peer_ipv6_address(wifi_aware_data_path_h data_path, char **ipv6_address);
/**
- * @brief
+ * @brief Gets Interface name for Wi-Fi Aware Data Path
* @remarks @a interface should be freed by using free().
* @since_tizen 6.0
- * @param[in]
- * @param[out]
- * @return
+ * @param[in] data_path The Data Path handle
+ * @param[out] interface The interface name
+ * @return 0 on success, otherwise a negative error value
* @retval #WIFI_AWARE_ERROR_NONE
*/
int wifi_aware_data_path_get_interface(wifi_aware_data_path_h data_path, char **interface);
-// get peer NDI?
-
/**
- * @brief Callback to notify that the Wi-Fi Aware Data Path has been lost.
+ * @brief Called when the Wi-Fi Aware Data Path has been lost.
* @since_tizen 6.0
- * @param[in] data_path
- * @param[in] reason
- * @param[in] user_data
+ * @param[in] data_path The terminated Data Path handle
+ * @param[in] reason The reason of termination
+ * @param[in] user_data The user data passed from request function
+ * @see wifi_aware_data_path_set_terminated_cb()
+ * @see wifi_aware_data_path_unset_terminated_cb()
*/
typedef void(*wifi_aware_data_path_terminated_cb)(wifi_aware_data_path_h data_path, wifi_aware_termination_reason_e reason, void *user_data);
/**
- * @brief
+ * @brief Registers a callback function to notify a Data Path termination.
* @since_tizen 6.0
- * @param[in] data_path
- * @param[in] callback
- * @param[in] user_data
+ * @param[in] data_path The Data Path handle
+ * @param[in] callback The callback function
+ * @param[in] user_data The user data paseed to the callback function
+ * @return 0 on success, otherwise a negative error value
+ * @see wifi_aware_data_path_unset_terminated_cb()
*/
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);
/**
- * @brief
+ * @brief Unregisters the Data Path terminated callback function.
* @since_tizen 6.0
- * @param[in] data_path
+ * @param[in] data_path The Data Path handle
+ * @return 0 on success, otherwise a negative error value
+ * @see wifi_aware_data_path_set_terminated_cb()
*/
int wifi_aware_data_path_unset_terminated_cb(wifi_aware_data_path_h data_path);
-
-// TODO
-// DataUpdate
-
-
-// Can APIs to get peer information using wifi_aware_peer_h?
-// wifi_aware_peer_get_mac_address(): Which mac address should this API show, NMI or NDI?
-
-
-//
-// callback for termination notification
-
-
-// network state changed
-//
-
-// What should be used for the first parameter???
-/*
-typedef void(*wifi_aware_changed_mac_address_cb)(unsigned char *mac, size_t len);
-
-int wifi_aware_set_changed_mac_address_cb(wifi_aware_changed_mac_address_cb callback);
-*/
-
/**
* @}
*/