Check if Wi-Fi Aware is initialized or not
authorSeonah Moon <seonah1.moon@samsung.com>
Thu, 16 Apr 2020 03:56:07 +0000 (12:56 +0900)
committerSeonah Moon <seonah1.moon@samsung.com>
Thu, 16 Apr 2020 03:56:07 +0000 (12:56 +0900)
include/wifi-aware.h
src/wifi-aware-private.c
src/wifi-aware.c

index 48595af..fc69747 100644 (file)
@@ -203,6 +203,7 @@ int wifi_aware_deinitialize();
  * @retval #WIFI_AWARE_ERROR_NONE
  * @retval #WIFI_AWARE_ERROR_INVALID_PARAMETER
  * @retval #WIFI_AWARE_ERROR_OUT_OF_MEMORY
+ * @retval #WIFI_AWARE_ERROR_NOT_INITIALIZED
  * @see wifi_aware_publish_destroy()
  */
 int wifi_aware_publish_create(wifi_aware_publish_h *publish);
@@ -214,6 +215,7 @@ int wifi_aware_publish_create(wifi_aware_publish_h *publish);
  * @return 0 on success, otherwise a negative error value
  * @retval #WIFI_AWARE_ERROR_NONE
  * @retval #WIFI_AWARE_ERROR_INVALID_PARAMETER
+ * @retval #WIFI_AWARE_ERROR_NOT_INITIALIZED
  * @see wifi_aware_publish_create()
  */
 int wifi_aware_publish_destroy(wifi_aware_publish_h publish);
@@ -226,6 +228,7 @@ int wifi_aware_publish_destroy(wifi_aware_publish_h publish);
  * @retval #WIFI_AWARE_ERROR_NONE
  * @retval #WIFI_AWARE_ERROR_INVALID_PARAMETER
  * @retval #WIFI_AWARE_ERROR_OUT_OF_MEMORY
+ * @retval #WIFI_AWARE_ERROR_NOT_INITIALIZED
  * @see wifi_aware_subscribe_destroy()
  */
 int wifi_aware_subscribe_create(wifi_aware_subscribe_h *subscribe);
@@ -237,6 +240,7 @@ int wifi_aware_subscribe_create(wifi_aware_subscribe_h *subscribe);
  * @return 0 on success, otherwise a negative error value
  * @retval #WIFI_AWARE_ERROR_NONE
  * @retval #WIFI_AWARE_ERROR_INVALID_PARAMETER
+ * @retval #WIFI_AWARE_ERROR_NOT_INITIALIZED
  * @see wifi_aware_subscribe_create()
  */
 int wifi_aware_subscribe_destroy(wifi_aware_subscribe_h subscribe);
@@ -249,6 +253,7 @@ int wifi_aware_subscribe_destroy(wifi_aware_subscribe_h subscribe);
  * @return 0 on success, otherwise a negative error value
  * @retval #WIFI_AWARE_ERROR_NONE
  * @retval #WIFI_AWARE_ERROR_INVALID_PARAMETER
+ * @retval #WIFI_AWARE_ERROR_NOT_INITIALIZED
  * @see wifi_aware_publish_create()
  */
 int wifi_aware_publish_set_ttl(wifi_aware_publish_h publish, unsigned short ttl);
@@ -261,6 +266,7 @@ int wifi_aware_publish_set_ttl(wifi_aware_publish_h publish, unsigned short ttl)
  * @return 0 on success, otherwise a negative error value
  * @retval #WIFI_AWARE_ERROR_NONE
  * @retval #WIFI_AWARE_ERROR_INVALID_PARAMETER
+ * @retval #WIFI_AWARE_ERROR_NOT_INITIALIZED
  * @see wifi_aware_publish_create()
  */
 int wifi_aware_publish_set_type(wifi_aware_publish_h publish, wifi_aware_publish_type_e publish_type);
@@ -274,6 +280,7 @@ int wifi_aware_publish_set_type(wifi_aware_publish_h publish, wifi_aware_publish
  * @return 0 on success, otherwise a negative error value
  * @retval #WIFI_AWARE_ERROR_NONE
  * @retval #WIFI_AWARE_ERROR_INVALID_PARAMETER
+ * @retval #WIFI_AWARE_ERROR_NOT_INITIALIZED
  * @see wifi_aware_publish_create()
  */
 int wifi_aware_publish_set_service_name(wifi_aware_publish_h publish, const char *service_name);
@@ -286,6 +293,7 @@ int wifi_aware_publish_set_service_name(wifi_aware_publish_h publish, const char
  * @param[in] len The length of service specific information
  * @return 0 on success, otherwise a negative error value
  * @retval #WIFI_AWARE_ERROR_NONE
+ * @retval #WIFI_AWARE_ERROR_NOT_INITIALIZED
  * @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);
@@ -299,6 +307,7 @@ int wifi_aware_publish_set_service_specific_info(wifi_aware_publish_h publish, c
  * @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
+ * @retval #WIFI_AWARE_ERROR_NOT_INITIALIZED
  * @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);
@@ -311,6 +320,7 @@ int wifi_aware_publish_set_match_filter(wifi_aware_publish_h publish, const unsi
  *                   otherwise @c false if ranging is disabled.
  * @return 0 on success, otherwise a negative error value
  * @retval #WIFI_AWARE_ERROR_NONE
+ * @retval #WIFI_AWARE_ERROR_NOT_INITIALIZED
  * @see wifi_aware_publish_create()
  */
 int wifi_aware_publish_enable_ranging(wifi_aware_publish_h publish, bool enable);
@@ -328,6 +338,7 @@ int wifi_aware_publish_enable_ranging(wifi_aware_publish_h publish, bool enable)
  * @return 0 on success, otherwise a negative error value
  * @retval #WIFI_AWARE_ERROR_NONE
  * @retval #WIFI_AWARE_ERROR_INVALID_PARAMETER
+ * @retval #WIFI_AWARE_ERROR_NOT_INITIALIZED
  * @see wifi_aware_subscrbie_create()
  */
 int wifi_aware_subscribe_set_ttl(wifi_aware_subscribe_h subscribe, unsigned short ttl);
@@ -340,6 +351,7 @@ int wifi_aware_subscribe_set_ttl(wifi_aware_subscribe_h subscribe, unsigned shor
  * @return 0 on success, otherwise a negative error value
  * @retval #WIFI_AWARE_ERROR_NONE
  * @retval #WIFI_AWARE_ERROR_INVALID_PARAMETER
+ * @retval #WIFI_AWARE_ERROR_NOT_INITIALIZED
  * @see wifi_aware_subscrbie_create()
  */
 int wifi_aware_subscribe_set_type(wifi_aware_subscribe_h subscribe, wifi_aware_subscribe_type_e subscribe_type);
@@ -353,6 +365,7 @@ int wifi_aware_subscribe_set_type(wifi_aware_subscribe_h subscribe, wifi_aware_s
  * @return 0 on success, otherwise a negative error value
  * @retval #WIFI_AWARE_ERROR_NONE
  * @retval #WIFI_AWARE_ERROR_INVALID_PARAMETER
+ * @retval #WIFI_AWARE_ERROR_NOT_INITIALIZED
  * @see wifi_aware_subscrbie_create()
  */
 int wifi_aware_subscribe_set_service_name(wifi_aware_subscribe_h subscribe, const char *service_name);
@@ -366,6 +379,7 @@ int wifi_aware_subscribe_set_service_name(wifi_aware_subscribe_h subscribe, cons
  * @return 0 on success, otherwise a negative error value
  * @retval #WIFI_AWARE_ERROR_NONE
  * @retval #WIFI_AWARE_ERROR_INVALID_PARAMETER
+ * @retval #WIFI_AWARE_ERROR_NOT_INITIALIZED
  * @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);
@@ -380,6 +394,7 @@ int wifi_aware_subscribe_set_service_specific_info(wifi_aware_subscribe_h subscr
  * @return 0 on success, otherwise a negative error value
  * @retval #WIFI_AWARE_ERROR_NONE
  * @retval #WIFI_AWARE_ERROR_INVALID_PARAMETER
+ * @retval #WIFI_AWARE_ERROR_NOT_INITIALIZED
  * @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);
@@ -393,6 +408,7 @@ int wifi_aware_subscribe_set_match_filter(wifi_aware_subscribe_h subscribe, cons
  * @return 0 on success, otherwise a negative error value
  * @retval #WIFI_AWARE_ERROR_NONE
  * @retval #WIFI_AWARE_ERROR_INVALID_PARAMETER
+ * @retval #WIFI_AWARE_ERROR_NOT_INITIALIZED
  * @see wifi_aware_subscrbie_create()
  */
 int wifi_aware_subscribe_set_max_distance(wifi_aware_subscribe_h subscribe, int distance);
@@ -406,6 +422,7 @@ int wifi_aware_subscribe_set_max_distance(wifi_aware_subscribe_h subscribe, int
  * @return 0 on success, otherwise a negative error value
  * @retval #WIFI_AWARE_ERROR_NONE
  * @retval #WIFI_AWARE_ERROR_INVALID_PARAMETER
+ * @retval #WIFI_AWARE_ERROR_NOT_INITIALIZED
  * @see wifi_aware_subscrbie_create()
  */
 int wifi_aware_subscribe_set_min_distance(wifi_aware_subscribe_h subscribe, int distance);
@@ -430,11 +447,11 @@ typedef void(*wifi_aware_enabled_cb)(wifi_aware_error_e error, void *user_data);
  * @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
- * @retval #WIFI_AWARE_ERROR_NOT_INITIALIZED
  * @retval #WIFI_AWARE_ERROR_ALREADY_ENABLED
  * @retval #WIFI_AWARE_ERROR_OUT_OF_MEMORY
  * @retval #WIFI_AWARE_ERROR_OPERATION_FAILED
  * @retval #WIFI_AWARE_ERROR_PERMISSION_DENIED
+ * @retval #WIFI_AWARE_ERROR_NOT_INITIALIZED
  * @see wifi_aware_disable()
  */
 int wifi_aware_enable(wifi_aware_enabled_cb callback, void *user_data);
@@ -446,10 +463,10 @@ int wifi_aware_enable(wifi_aware_enabled_cb callback, void *user_data);
  * @privilege %http://tizen.org/privilege/network.set
  * @return 0 on success, otherwise a negative error value
  * @retval #WIFI_AWARE_ERROR_NONE
- * @retval #WIFI_AWARE_ERROR_NOT_INITIALIZED
  * @retval #WIFI_AWARE_ERROR_INVALID_OPERATION
  * @retval #WIFI_AWARE_ERROR_OPERATION_FAILED
  * @retval #WIFI_AWARE_ERROR_PERMISSION_DENIED
+ * @retval #WIFI_AWARE_ERROR_NOT_INITIALIZED
  * @see wifi_aware_enable()
  */
 int wifi_aware_disable();
@@ -461,9 +478,9 @@ 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
- * @retval #WIFI_AWARE_ERROR_NOT_INITIALIZED
  * @retval #WIFI_AWARE_ERROR_OUT_OF_MEMORY
  * @retval #WIFI_AWARE_ERROR_INVALID_PARAMETER
+ * @retval #WIFI_AWARE_ERROR_NOT_INITIALIZED
  * @see wifi_aware_session_destroy()
  */
 int wifi_aware_session_create(wifi_aware_session_type_e session_type, wifi_aware_session_h *session);
@@ -474,8 +491,8 @@ int wifi_aware_session_create(wifi_aware_session_type_e session_type, wifi_aware
  * @param[in] session The Wi-Fi Aware Session handle
  * @return 0 on success, otherwise a negative error value
  * @retval #WIFI_AWARE_ERROR_NONE
- * @retval #WIFI_AWARE_ERROR_NOT_INITIALIZED
  * @retval #WIFI_AWARE_ERROR_INVALID_PARAMETER
+ * @retval #WIFI_AWARE_ERROR_NOT_INITIALIZED
  * @see wifi_aware_session_create()
  */
 int wifi_aware_session_destroy(wifi_aware_session_h session);
@@ -500,8 +517,8 @@ typedef void(*wifi_aware_session_terminated_cb)(wifi_aware_session_h session,
  * @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
- * @retval #WIFI_AWARE_ERROR_NOT_INITIALIZED
  * @retval #WIFI_AWARE_ERROR_INVALID_PARAMETER
+ * @retval #WIFI_AWARE_ERROR_NOT_INITIALIZED
  * @see wifi_aware_session_unset_terminated_cb()
  */
 int wifi_aware_session_set_terminated_cb(wifi_aware_session_h session,
@@ -513,8 +530,8 @@ int wifi_aware_session_set_terminated_cb(wifi_aware_session_h session,
  * @param[in] session The Wi-Fi Aware Session
  * @return 0 on success, otherwise a negative error value
  * @retval #WIFI_AWARE_ERROR_NONE
- * @retval #WIFI_AWARE_ERROR_NOT_INITIALIZED
  * @retval #WIFI_AWARE_ERROR_INVALID_PARAMETER
+ * @retval #WIFI_AWARE_ERROR_NOT_INITIALIZED
  * @see wifi_aware_session_set_terminated_cb()
  */
 int wifi_aware_session_unset_terminated_cb(wifi_aware_session_h session);
@@ -528,11 +545,11 @@ int wifi_aware_session_unset_terminated_cb(wifi_aware_session_h session);
  * @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
- * @retval #WIFI_AWARE_ERROR_NOT_INITIALIZED
  * @retval #WIFI_AWARE_ERROR_INVALID_PARAMETER
  * @retval #WIFI_AWARE_ERROR_INVALID_OPERATION
  * @retval #WIFI_AWARE_ERROR_OPERATION_FAILED
  * @retval #WIFI_AWARE_ERROR_PERMISSION_DENIED
+ * @retval #WIFI_AWARE_ERROR_NOT_INITIALIZED
  * @see wifi_aware_session_publish()
  * @see wifi_aware_session_subscribe()
  */
@@ -561,11 +578,11 @@ typedef void(*wifi_aware_published_cb)(wifi_aware_session_h session,
  * @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
- * @retval #WIFI_AWARE_ERROR_NOT_INITIALIZED
  * @retval #WIFI_AWARE_ERROR_INVALID_PARAMETER
  * @retval #WIFI_AWARE_ERROR_INVALID_OPERATION
  * @retval #WIFI_AWARE_ERROR_OPERATION_FAILED
  * @retval #WIFI_AWARE_ERROR_PERMISSION_DENIED
+ * @retval #WIFI_AWARE_ERROR_NOT_INITIALIZED
  * @see wifi_aware_session_stop()
  */
 int wifi_aware_session_publish(wifi_aware_session_h session,
@@ -584,11 +601,11 @@ int wifi_aware_session_publish(wifi_aware_session_h session,
  * @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
- * @retval #WIFI_AWARE_ERROR_NOT_INITIALIZED
  * @retval #WIFI_AWARE_ERROR_INVALID_PARAMETER
  * @retval #WIFI_AWARE_ERROR_INVALID_OPERATION
  * @retval #WIFI_AWARE_ERROR_OPERATION_FAILED
  * @retval #WIFI_AWARE_ERROR_PERMISSION_DENIED
+ * @retval #WIFI_AWARE_ERROR_NOT_INITIALIZED
  * @see wifi_aware_session_publish()
  */
 int wifi_aware_session_update_publish(wifi_aware_session_h session,
@@ -617,11 +634,11 @@ typedef void(*wifi_aware_subscribed_cb)(wifi_aware_session_h session,
  * @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
- * @retval #WIFI_AWARE_ERROR_NOT_INITIALIZED
  * @retval #WIFI_AWARE_ERROR_INVALID_PARAMETER
  * @retval #WIFI_AWARE_ERROR_INVALID_OPERATION
  * @retval #WIFI_AWARE_ERROR_OPERATION_FAILED
  * @retval #WIFI_AWARE_ERROR_PERMISSION_DENIED
+ * @retval #WIFI_AWARE_ERROR_NOT_INITIALIZED
  * @see wifi_aware_session_stop()
  */
 int wifi_aware_session_subscribe(wifi_aware_session_h,
@@ -639,11 +656,11 @@ int wifi_aware_session_subscribe(wifi_aware_session_h,
  * @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
- * @retval #WIFI_AWARE_ERROR_NOT_INITIALIZED
  * @retval #WIFI_AWARE_ERROR_INVALID_PARAMETER
  * @retval #WIFI_AWARE_ERROR_INVALID_OPERATION
  * @retval #WIFI_AWARE_ERROR_OPERATION_FAILED
  * @retval #WIFI_AWARE_ERROR_PERMISSION_DENIED
+ * @retval #WIFI_AWARE_ERROR_NOT_INITIALIZED
  * @see wifi_aware_session_subscribe()
  */
 int wifi_aware_session_update_subscribe(wifi_aware_session_h session,
@@ -677,8 +694,8 @@ typedef void(*wifi_aware_service_discovered_cb)(wifi_aware_session_h session,
  * @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
- * @retval #WIFI_AWARE_ERROR_NOT_INITIALIZED
  * @retval #WIFI_AWARE_ERROR_INVALID_PARAMETER
+ * @retval #WIFI_AWARE_ERROR_NOT_INITIALIZED
  * @see wifi_aware_session_unset_service_discovered_cb()
  */
 int wifi_aware_session_set_service_discovered_cb(wifi_aware_session_h session,
@@ -690,8 +707,8 @@ int wifi_aware_session_set_service_discovered_cb(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
- * @retval #WIFI_AWARE_ERROR_NOT_INITIALIZED
  * @retval #WIFI_AWARE_ERROR_INVALID_PARAMETER
+ * @retval #WIFI_AWARE_ERROR_NOT_INITIALIZED
  * @see wifi_aware_session_set_service_discovered_cb()
  */
 int wifi_aware_session_unset_service_discovered_cb(wifi_aware_session_h session);
@@ -719,12 +736,12 @@ typedef void(*wifi_aware_send_message_result_cb)(wifi_aware_session_h session,
  * @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
- * @retval #WIFI_AWARE_ERROR_NOT_INITIALIZED
  * @retval #WIFI_AWARE_ERROR_INVALID_OPERATION
  * @retval #WIFI_AWARE_ERROR_INVALID_PARAMETER
  * @retval #WIFI_AWARE_ERROR_OUT_OF_MEMORY
  * @retval #WIFI_AWARE_ERROR_OPERATION_FAILED
  * @retval #WIFI_AWARE_ERROR_PERMISSION_DENIED
+ * @retval #WIFI_AWARE_ERROR_NOT_INITIALIZED
  */
 int wifi_aware_session_send_message(
                wifi_aware_session_h session,
@@ -756,6 +773,7 @@ typedef void(*wifi_aware_message_received_cb)(
  * @return 0 on success, otherwise a negative error value
  * @retval #WIFI_AWARE_ERROR_NONE
  * @retval #WIFI_AWARE_ERROR_INVALID_PARAMETER
+ * @retval #WIFI_AWARE_ERROR_NOT_INITIALIZED
  * @see wifi_aware_session_unset_message_received_cb()
  */
 int wifi_aware_session_set_message_received_cb(wifi_aware_session_h session,
@@ -768,6 +786,7 @@ int wifi_aware_session_set_message_received_cb(wifi_aware_session_h session,
  * @return 0 on success, otherwise a negative error value
  * @retval #WIFI_AWARE_ERROR_NONE
  * @retval #WIFI_AWARE_ERROR_INVALID_PARAMETER
+ * @retval #WIFI_AWARE_ERROR_NOT_INITIALIZED
  * @see wifi_aware_session_set_message_received_cb()
  */
 int wifi_aware_session_unset_message_received_cb(wifi_aware_session_h session);
@@ -780,9 +799,9 @@ int wifi_aware_session_unset_message_received_cb(wifi_aware_session_h session);
  * @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
- * @retval #WIFI_AWARE_ERROR_NOT_INITIALIZED
  * @retval #WIFI_AWARE_ERROR_INVALID_PARAMETER
  * @retval #WIFI_AWARE_ERROR_OUT_OF_MEMORY
+ * @retval #WIFI_AWARE_ERROR_NOT_INITIALIZED
  * @see wifi_aware_peer_destroy()
  */
 int wifi_aware_peer_clone(wifi_aware_peer_h *cloned, wifi_aware_peer_h origin);
@@ -793,8 +812,8 @@ int wifi_aware_peer_clone(wifi_aware_peer_h *cloned, wifi_aware_peer_h origin);
  * @param[in] peer The Peer handle
  * @return 0 on success, otherwise a negative error value
  * @retval #WIFI_AWARE_ERROR_NONE
- * @retval #WIFI_AWARE_ERROR_NOT_INITIALIZED
  * @retval #WIFI_AWARE_ERROR_INVALID_PARAMETER
+ * @retval #WIFI_AWARE_ERROR_NOT_INITIALIZED
  * @see wifi_aware_peer_clone()
  */
 int wifi_aware_peer_destroy(wifi_aware_peer_h peer);
@@ -807,9 +826,9 @@ int wifi_aware_peer_destroy(wifi_aware_peer_h peer);
  * @param[out] mac The MAC address of the peer
  * @return 0 on success, otherwise a negative error value
  * @retval #WIFI_AWARE_ERROR_NONE
- * @retval #WIFI_AWARE_ERROR_NOT_INITIALIZED
  * @retval #WIFI_AWARE_ERROR_INVALID_PARAMETER
  * @retval #WIFI_AWARE_ERROR_OUT_OF_MEMORY
+ * @retval #WIFI_AWARE_ERROR_NOT_INITIALIZED
  */
 int wifi_aware_peer_get_mac(wifi_aware_peer_h peer, unsigned char **mac);
 
@@ -831,9 +850,9 @@ typedef enum {
  * @param[out] data_path The Data Path handle
  * @return 0 on success, otherwise a negative error value
  * @retval #WIFI_AWARE_ERROR_NONE
- * @retval #WIFI_AWARE_ERROR_NOT_INITIALIZED
  * @retval #WIFI_AWARE_ERROR_INVALID_PARAMETER
  * @retval #WIFI_AWARE_ERROR_OUT_OF_MEMORY
+ * @retval #WIFI_AWARE_ERROR_NOT_INITIALIZED
  * @see wifi_aware_data_path_destroy()
  */
 int wifi_aware_data_path_create(wifi_aware_session_h session, wifi_aware_peer_h peer,
@@ -847,6 +866,7 @@ int wifi_aware_data_path_create(wifi_aware_session_h session, wifi_aware_peer_h
  * @return 0 on success, otherwise a negative error value
  * @retval #WIFI_AWARE_ERROR_NONE
  * @retval #WIFI_AWARE_ERROR_INVALID_PARAMETER
+ * @retval #WIFI_AWARE_ERROR_NOT_INITIALIZED
  * @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);
@@ -861,6 +881,7 @@ int wifi_aware_data_path_set_security(wifi_aware_data_path_h data_path, wifi_awa
  * @retval #WIFI_AWARE_ERROR_NONE
  * @retval #WIFI_AWARE_ERROR_INVALID_PARAMETER
  * @retval #WIFI_AWARE_ERROR_INVALID_OPERATION
+ * @retval #WIFI_AWARE_ERROR_NOT_INITIALIZED
  * @see wifi_aware_data_path_create()
  */
 int wifi_aware_data_path_set_psk(wifi_aware_data_path_h data_path, const char *key);
@@ -875,6 +896,7 @@ int wifi_aware_data_path_set_psk(wifi_aware_data_path_h data_path, const char *k
  * @retval #WIFI_AWARE_ERROR_NONE
  * @retval #WIFI_AWARE_ERROR_INVALID_PARAMETER
  * @retval #WIFI_AWARE_ERROR_INVALID_OPERATION
+ * @retval #WIFI_AWARE_ERROR_NOT_INITIALIZED
  * @see wifi_aware_data_path_create()
  */
 int wifi_aware_data_path_set_pmk(wifi_aware_data_path_h data_path, const unsigned char *key);
@@ -888,6 +910,7 @@ int wifi_aware_data_path_set_pmk(wifi_aware_data_path_h data_path, const unsigne
  * @return 0 on success, otherwise a negative error value
  * @retval #WIFI_AWARE_ERROR_NONE
  * @retval #WIFI_AWARE_ERROR_INVALID_PARAMETER
+ * @retval #WIFI_AWARE_ERROR_NOT_INITIALIZED
  * @see wifi_aware_data_path_create()
  */
 int wifi_aware_data_path_set_port(wifi_aware_data_path_h data_path, int port);
@@ -898,8 +921,8 @@ int wifi_aware_data_path_set_port(wifi_aware_data_path_h data_path, int port);
  * @param[in] data_path The Data Path handle
  * @return 0 on success, otherwise a negative error value
  * @retval #WIFI_AWARE_ERROR_NONE
- * @retval #WIFI_AWARE_ERROR_NOT_INITIALIZED
  * @retval #WIFI_AWARE_ERROR_INVALID_PARAMETER
+ * @retval #WIFI_AWARE_ERROR_NOT_INITIALIZED
  * @see wifi_aware_data_path_create()
  */
 int wifi_aware_data_path_destroy(wifi_aware_data_path_h data_path);
@@ -927,11 +950,11 @@ typedef void(*wifi_aware_data_path_open_cb)(wifi_aware_data_path_h data_path, wi
  * @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
- * @retval #WIFI_AWARE_ERROR_NOT_INITIALIZED
  * @retval #WIFI_AWARE_ERROR_INVALID_OPERATION
  * @retval #WIFI_AWARE_ERROR_INVALID_PARAMETER
  * @retval #WIFI_AWARE_ERROR_OPERATION_FAILED
  * @retval #WIFI_AWARE_ERROR_PERMISSION_DENIED
+ * @retval #WIFI_AWARE_ERROR_NOT_INITIALIZED
  * @see wifi_aware_data_path_close()
  */
 int wifi_aware_data_path_open(wifi_aware_data_path_h data_path,
@@ -944,11 +967,11 @@ int wifi_aware_data_path_open(wifi_aware_data_path_h data_path,
  * @privilege %http://tizen.org/privilege/network.set
  * @param[in] data_path The Data Path handle
  * @retval #WIFI_AWARE_ERROR_NONE
- * @retval #WIFI_AWARE_ERROR_NOT_INITIALIZED
  * @retval #WIFI_AWARE_ERROR_INVALID_OPERATION
  * @retval #WIFI_AWARE_ERROR_INVALID_PARAMETER
  * @retval #WIFI_AWARE_ERROR_OPERATION_FAILED
  * @retval #WIFI_AWARE_ERROR_PERMISSION_DENIED
+ * @retval #WIFI_AWARE_ERROR_NOT_INITIALIZED
  * @see wifi_aware_data_path_open()
  */
 int wifi_aware_data_path_close(wifi_aware_data_path_h data_path);
@@ -960,9 +983,9 @@ int wifi_aware_data_path_close(wifi_aware_data_path_h data_path);
  * @param[out] port     The port
  * @return 0 on success, otherwise a negative error value
  * @retval #WIFI_AWARE_ERROR_NONE
- * @retval #WIFI_AWARE_ERROR_NOT_INITIALIZED
  * @retval #WIFI_AWARE_ERROR_INVALID_PARAMETER
  * @retval #WIFI_AWARE_ERROR_INVALID_OPERATION
+ * @retval #WIFI_AWARE_ERROR_NOT_INITIALIZED
  */
 int wifi_aware_data_path_get_peer_port(wifi_aware_data_path_h data_path, int* port);
 
@@ -974,9 +997,9 @@ int wifi_aware_data_path_get_peer_port(wifi_aware_data_path_h data_path, int* po
  * @param[out] ipv6_address The IPv6 address of a peer
  * @return 0 on success, otherwise a negative error value
  * @retval #WIFI_AWARE_ERROR_NONE
- * @retval #WIFI_AWARE_ERROR_NOT_INITIALIZED
  * @retval #WIFI_AWARE_ERROR_INVALID_PARAMETER
  * @retval #WIFI_AWARE_ERROR_INVALID_OPERATION
+ * @retval #WIFI_AWARE_ERROR_NOT_INITIALIZED
  */
 int wifi_aware_data_path_get_peer_ipv6_address(wifi_aware_data_path_h data_path, char **ipv6_address);
 
@@ -988,9 +1011,9 @@ int wifi_aware_data_path_get_peer_ipv6_address(wifi_aware_data_path_h data_path,
  * @param[out] interface The interface name
  * @return 0 on success, otherwise a negative error value
  * @retval #WIFI_AWARE_ERROR_NONE
- * @retval #WIFI_AWARE_ERROR_NOT_INITIALIZED
  * @retval #WIFI_AWARE_ERROR_INVALID_PARAMETER
  * @retval #WIFI_AWARE_ERROR_INVALID_OPERATION
+ * @retval #WIFI_AWARE_ERROR_NOT_INITIALIZED
  */
 int wifi_aware_data_path_get_interface(wifi_aware_data_path_h data_path, char **interface);
 
@@ -1013,8 +1036,8 @@ typedef void(*wifi_aware_data_path_terminated_cb)(wifi_aware_data_path_h data_pa
  * @param[in] user_data The user data paseed to the callback function
  * @return 0 on success, otherwise a negative error value
  * @retval #WIFI_AWARE_ERROR_NONE
- * @retval #WIFI_AWARE_ERROR_NOT_INITIALIZED
  * @retval #WIFI_AWARE_ERROR_INVALID_PARAMETER
+ * @retval #WIFI_AWARE_ERROR_NOT_INITIALIZED
  * @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);
@@ -1025,8 +1048,8 @@ int wifi_aware_data_path_set_terminated_cb(wifi_aware_data_path_h data_path, wif
  * @param[in] data_path The Data Path handle
  * @return 0 on success, otherwise a negative error value
  * @retval #WIFI_AWARE_ERROR_NONE
- * @retval #WIFI_AWARE_ERROR_NOT_INITIALIZED
  * @retval #WIFI_AWARE_ERROR_INVALID_PARAMETER
+ * @retval #WIFI_AWARE_ERROR_NOT_INITIALIZED
  * @see wifi_aware_data_path_set_terminated_cb()
  */
 int wifi_aware_data_path_unset_terminated_cb(wifi_aware_data_path_h data_path);
index efb8241..452b9ee 100644 (file)
@@ -575,7 +575,7 @@ int _wifi_aware_init()
 int _wifi_aware_deinit()
 {
        if (!__is_init) {
-               WIFI_AWARE_LOGE("Already initialized");
+               WIFI_AWARE_LOGE("Not initialized");
                return WIFI_AWARE_ERROR_NOT_INITIALIZED;
        }
 
index 7eeb294..e0008d0 100644 (file)
@@ -160,6 +160,7 @@ API int wifi_aware_publish_create(wifi_aware_publish_h *publish)
 
        __WIFI_AWARE_FUNC_ENTER__;
        CHECK_FEATURE_SUPPORTED(TIZEN_FEATURE_WIFI_AWARE);
+       RET_VAL_IF(!_wifi_aware_is_initialized(), WIFI_AWARE_ERROR_NOT_INITIALIZED, "Not initialized");
 
        ret = _wifi_aware_publish_handle_create(publish);
        RET_VAL_IF(ret != WIFI_AWARE_ERROR_NONE, ret, "Fail to create publish handle");
@@ -175,6 +176,7 @@ API int wifi_aware_publish_destroy(wifi_aware_publish_h publish)
 {
        __WIFI_AWARE_FUNC_ENTER__;
        CHECK_FEATURE_SUPPORTED(TIZEN_FEATURE_WIFI_AWARE);
+       RET_VAL_IF(!_wifi_aware_is_initialized(), WIFI_AWARE_ERROR_NOT_INITIALIZED, "Not initialized");
        RET_VAL_IF(publish == NULL, WIFI_AWARE_ERROR_INVALID_PARAMETER, "wifi_aware_publish_h is NULL");
 
        g_free(publish);
@@ -187,6 +189,7 @@ API int wifi_aware_publish_set_ttl(wifi_aware_publish_h publish, unsigned short
 {
        __WIFI_AWARE_FUNC_ENTER__;
        CHECK_FEATURE_SUPPORTED(TIZEN_FEATURE_WIFI_AWARE);
+       RET_VAL_IF(!_wifi_aware_is_initialized(), WIFI_AWARE_ERROR_NOT_INITIALIZED, "Not initialized");
        RET_VAL_IF(publish == NULL, WIFI_AWARE_ERROR_INVALID_PARAMETER, "wifi_aware_publish_h is NULL");
 
        _wifi_aware_publish_set_ttl(publish, ttl);
@@ -200,6 +203,7 @@ API int wifi_aware_publish_set_type(wifi_aware_publish_h publish,
 {
        __WIFI_AWARE_FUNC_ENTER__;
        CHECK_FEATURE_SUPPORTED(TIZEN_FEATURE_WIFI_AWARE);
+       RET_VAL_IF(!_wifi_aware_is_initialized(), WIFI_AWARE_ERROR_NOT_INITIALIZED, "Not initialized");
        RET_VAL_IF(publish == NULL, WIFI_AWARE_ERROR_INVALID_PARAMETER, "wifi_aware_publish_h is NULL");
        RET_VAL_IF(publish_type != WIFI_AWARE_PUBLISH_TYPE_UNSOLICITED
                        && publish_type != WIFI_AWARE_PUBLISH_TYPE_SOLICITED,
@@ -217,6 +221,7 @@ API int wifi_aware_publish_set_service_name(wifi_aware_publish_h publish,
        __WIFI_AWARE_FUNC_ENTER__;
        int len = 0;
        CHECK_FEATURE_SUPPORTED(TIZEN_FEATURE_WIFI_AWARE);
+       RET_VAL_IF(!_wifi_aware_is_initialized(), WIFI_AWARE_ERROR_NOT_INITIALIZED, "Not initialized");
        RET_VAL_IF(publish == NULL, WIFI_AWARE_ERROR_INVALID_PARAMETER, "wifi_aware_publish_h is NULL");
 
        len = strlen(service_name);
@@ -236,6 +241,7 @@ API int wifi_aware_publish_set_service_specific_info(wifi_aware_publish_h publis
 {
        __WIFI_AWARE_FUNC_ENTER__;
        CHECK_FEATURE_SUPPORTED(TIZEN_FEATURE_WIFI_AWARE);
+       RET_VAL_IF(!_wifi_aware_is_initialized(), WIFI_AWARE_ERROR_NOT_INITIALIZED, "Not initialized");
        RET_VAL_IF(publish == NULL, WIFI_AWARE_ERROR_INVALID_PARAMETER, "wifi_aware_publish_h is NULL");
 
        if (len > WIFI_AWARE_MAX_SERVICE_SPECIFIC_INFO_LEN) {
@@ -255,6 +261,7 @@ API int wifi_aware_publish_set_match_filter(wifi_aware_publish_h publish,
 {
        __WIFI_AWARE_FUNC_ENTER__;
        CHECK_FEATURE_SUPPORTED(TIZEN_FEATURE_WIFI_AWARE);
+       RET_VAL_IF(!_wifi_aware_is_initialized(), WIFI_AWARE_ERROR_NOT_INITIALIZED, "Not initialized");
        RET_VAL_IF(publish == NULL, WIFI_AWARE_ERROR_INVALID_PARAMETER, "wifi_aware_publish_h is NULL");
 
        if (len > WIFI_AWARE_MAX_MATCH_FILTER_LEN) {
@@ -274,6 +281,7 @@ API int wifi_aware_publish_enable_ranging(
 {
        __WIFI_AWARE_FUNC_ENTER__;
        CHECK_FEATURE_SUPPORTED(TIZEN_FEATURE_WIFI_AWARE);
+       RET_VAL_IF(!_wifi_aware_is_initialized(), WIFI_AWARE_ERROR_NOT_INITIALIZED, "Not initialized");
        RET_VAL_IF(publish == NULL, WIFI_AWARE_ERROR_INVALID_PARAMETER, "wifi_aware_publish_h is NULL");
 
        _wifi_aware_publish_enable_ranging(publish, enable);
@@ -330,6 +338,7 @@ API int wifi_aware_subscribe_create(wifi_aware_subscribe_h *subscribe)
 
        __WIFI_AWARE_FUNC_ENTER__;
        CHECK_FEATURE_SUPPORTED(TIZEN_FEATURE_WIFI_AWARE);
+       RET_VAL_IF(!_wifi_aware_is_initialized(), WIFI_AWARE_ERROR_NOT_INITIALIZED, "Not initialized");
 
        ret = _wifi_aware_subscribe_handle_create(subscribe);
        RET_VAL_IF(ret != WIFI_AWARE_ERROR_NONE, ret, "Fail to create subscribe handle");
@@ -346,6 +355,7 @@ API int wifi_aware_subscribe_destroy(
 {
        __WIFI_AWARE_FUNC_ENTER__;
        CHECK_FEATURE_SUPPORTED(TIZEN_FEATURE_WIFI_AWARE);
+       RET_VAL_IF(!_wifi_aware_is_initialized(), WIFI_AWARE_ERROR_NOT_INITIALIZED, "Not initialized");
        RET_VAL_IF(subscribe == NULL, WIFI_AWARE_ERROR_INVALID_PARAMETER, "wifi_aware_subscribe_h is NULL");
 
        g_free(subscribe);
@@ -360,6 +370,7 @@ API int wifi_aware_subscribe_set_ttl(
 {
        __WIFI_AWARE_FUNC_ENTER__;
        CHECK_FEATURE_SUPPORTED(TIZEN_FEATURE_WIFI_AWARE);
+       RET_VAL_IF(!_wifi_aware_is_initialized(), WIFI_AWARE_ERROR_NOT_INITIALIZED, "Not initialized");
        RET_VAL_IF(subscribe == NULL, WIFI_AWARE_ERROR_INVALID_PARAMETER, "wifi_aware_subscribe_h is NULL");
 
        _wifi_aware_subscribe_set_ttl(subscribe, ttl);
@@ -374,6 +385,7 @@ API int wifi_aware_subscribe_set_type(
 {
        __WIFI_AWARE_FUNC_ENTER__;
        CHECK_FEATURE_SUPPORTED(TIZEN_FEATURE_WIFI_AWARE);
+       RET_VAL_IF(!_wifi_aware_is_initialized(), WIFI_AWARE_ERROR_NOT_INITIALIZED, "Not initialized");
        RET_VAL_IF(subscribe == NULL, WIFI_AWARE_ERROR_INVALID_PARAMETER, "wifi_aware_subscribe_h is NULL");
        RET_VAL_IF(subscribe_type != WIFI_AWARE_SUBSCRIBE_TYPE_PASSIVE
                        && subscribe_type != WIFI_AWARE_SUBSCRIBE_TYPE_ACTIVE,
@@ -392,6 +404,7 @@ API int wifi_aware_subscribe_set_service_name(
        __WIFI_AWARE_FUNC_ENTER__;
        int len = 0;
        CHECK_FEATURE_SUPPORTED(TIZEN_FEATURE_WIFI_AWARE);
+       RET_VAL_IF(!_wifi_aware_is_initialized(), WIFI_AWARE_ERROR_NOT_INITIALIZED, "Not initialized");
        RET_VAL_IF(subscribe == NULL, WIFI_AWARE_ERROR_INVALID_PARAMETER, "wifi_aware_subscribe_h is NULL");
 
        len = strlen(service_name);
@@ -412,6 +425,7 @@ API int wifi_aware_subscribe_set_service_specific_info(
 {
        __WIFI_AWARE_FUNC_ENTER__;
        CHECK_FEATURE_SUPPORTED(TIZEN_FEATURE_WIFI_AWARE);
+       RET_VAL_IF(!_wifi_aware_is_initialized(), WIFI_AWARE_ERROR_NOT_INITIALIZED, "Not initialized");
        RET_VAL_IF(subscribe == NULL, WIFI_AWARE_ERROR_INVALID_PARAMETER, "wifi_aware_subscribe_h is NULL");
 
        if (len > WIFI_AWARE_MAX_SERVICE_SPECIFIC_INFO_LEN) {
@@ -432,6 +446,7 @@ API int wifi_aware_subscribe_set_match_filter(
 {
        __WIFI_AWARE_FUNC_ENTER__;
        CHECK_FEATURE_SUPPORTED(TIZEN_FEATURE_WIFI_AWARE);
+       RET_VAL_IF(!_wifi_aware_is_initialized(), WIFI_AWARE_ERROR_NOT_INITIALIZED, "Not initialized");
        RET_VAL_IF(subscribe == NULL, WIFI_AWARE_ERROR_INVALID_PARAMETER, "wifi_aware_subscribe_h is NULL");
 
        if (len > WIFI_AWARE_MAX_MATCH_FILTER_LEN) {
@@ -449,6 +464,7 @@ API int wifi_aware_subscribe_set_max_distance(wifi_aware_subscribe_h subscribe,
 {
        __WIFI_AWARE_FUNC_ENTER__;
        CHECK_FEATURE_SUPPORTED(TIZEN_FEATURE_WIFI_AWARE);
+       RET_VAL_IF(!_wifi_aware_is_initialized(), WIFI_AWARE_ERROR_NOT_INITIALIZED, "Not initialized");
        RET_VAL_IF(subscribe == NULL, WIFI_AWARE_ERROR_INVALID_PARAMETER, "wifi_aware_subscribe_h is NULL");
        RET_VAL_IF(distance <= 0, WIFI_AWARE_ERROR_INVALID_PARAMETER, "Distance should be positive value");
 
@@ -462,6 +478,7 @@ API int wifi_aware_subscribe_set_min_distance(wifi_aware_subscribe_h subscribe,
 {
        __WIFI_AWARE_FUNC_ENTER__;
        CHECK_FEATURE_SUPPORTED(TIZEN_FEATURE_WIFI_AWARE);
+       RET_VAL_IF(!_wifi_aware_is_initialized(), WIFI_AWARE_ERROR_NOT_INITIALIZED, "Not initialized");
        RET_VAL_IF(subscribe == NULL, WIFI_AWARE_ERROR_INVALID_PARAMETER, "wifi_aware_subscribe_h is NULL");
        RET_VAL_IF(distance < 0, WIFI_AWARE_ERROR_INVALID_PARAMETER, "Distance should be zero or positive value");