summaryrefslogtreecommitdiff
path: root/src/wifi-aware.c
diff options
context:
space:
mode:
authorSeonah Moon <seonah1.moon@samsung.com>2020-03-31 14:49:09 +0900
committerSeonah Moon <seonah1.moon@samsung.com>2020-03-31 14:49:09 +0900
commit7e22da95760a3a93ee30fede0d52c87abe7be0b4 (patch)
tree58d3b9843037698d34b7b119ad8a5bf78b1785bf /src/wifi-aware.c
parent7f8951676da2bfbbfcacc7787a4c15c6ac2d3ef7 (diff)
parent257b6f6bea8915bee1bf88c4a8e809da836ccb4a (diff)
downloadwifi-aware-7e22da95760a3a93ee30fede0d52c87abe7be0b4.tar.gz
wifi-aware-7e22da95760a3a93ee30fede0d52c87abe7be0b4.tar.bz2
wifi-aware-7e22da95760a3a93ee30fede0d52c87abe7be0b4.zip
Merge branch 'master' of github.sec.samsung.net:tizen-sys-con/capi-network-wifi-aware
Diffstat (limited to 'src/wifi-aware.c')
-rw-r--r--src/wifi-aware.c42
1 files changed, 10 insertions, 32 deletions
diff --git a/src/wifi-aware.c b/src/wifi-aware.c
index 4885a13..8f04318 100644
--- a/src/wifi-aware.c
+++ b/src/wifi-aware.c
@@ -73,6 +73,7 @@ API int wifi_aware_enable(wifi_aware_enabled_cb callback, void *user_data)
__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(_wifi_aware_is_enabled(), WIFI_AWARE_ERROR_INVALID_OPERATION, "Already enabled");
_add_enabled_callback(callback, user_data);
@@ -90,10 +91,7 @@ API int wifi_aware_disable()
__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(_wifi_aware_is_enabled() == 0,
- WIFI_AWARE_ERROR_INVALID_OPERATION,
- "_wifi_aware_is_enabled");
+ RET_VAL_IF(!_wifi_aware_is_enabled(), WIFI_AWARE_ERROR_INVALID_OPERATION, "Not enabled");
ret = _wifi_aware_disable_request();
RET_VAL_IF(ret != WIFI_AWARE_ERROR_NONE, ret, "_wifi_aware_disable_request");
@@ -266,20 +264,6 @@ API int wifi_aware_publish_set_match_filter(wifi_aware_publish_h publish,
return WIFI_AWARE_ERROR_NONE;
}
-API int wifi_aware_publish_set_enable_termination_event(
- wifi_aware_publish_h publish,
- bool enable)
-{
- __WIFI_AWARE_FUNC_ENTER__;
- CHECK_FEATURE_SUPPORTED(TIZEN_FEATURE_WIFI_AWARE);
- RET_VAL_IF(publish == NULL, WIFI_AWARE_ERROR_INVALID_PARAMETER, "wifi_aware_publish_h is NULL");
-
- _wifi_aware_publish_set_enable_termination_event(publish, enable);
-
- __WIFI_AWARE_FUNC_EXIT__;
- return WIFI_AWARE_ERROR_NONE;
-}
-
API int wifi_aware_publish_set_enable_ranging(
wifi_aware_publish_h publish,
bool enable)
@@ -303,6 +287,7 @@ API int wifi_aware_session_publish(wifi_aware_session_h session,
CHECK_FEATURE_SUPPORTED(TIZEN_FEATURE_WIFI_AWARE);
RET_VAL_IF(!_wifi_aware_is_initialized(), WIFI_AWARE_ERROR_NOT_INITIALIZED, "Not initialized");
+ RET_VAL_IF(!_wifi_aware_is_enabled(), WIFI_AWARE_ERROR_INVALID_OPERATION, "Not enabled");
RET_VAL_IF(session == NULL, WIFI_AWARE_ERROR_INVALID_PARAMETER, "wifi_aware_session_h is NULL");
RET_VAL_IF(publish == NULL, WIFI_AWARE_ERROR_INVALID_PARAMETER, "wifi_aware_publish_h is NULL");
@@ -322,6 +307,7 @@ API int wifi_aware_session_update_publish(wifi_aware_session_h session,
CHECK_FEATURE_SUPPORTED(TIZEN_FEATURE_WIFI_AWARE);
RET_VAL_IF(!_wifi_aware_is_initialized(), WIFI_AWARE_ERROR_NOT_INITIALIZED, "Not initialized");
+ RET_VAL_IF(!_wifi_aware_is_enabled(), WIFI_AWARE_ERROR_INVALID_OPERATION, "Not enabled");
RET_VAL_IF(session == NULL, WIFI_AWARE_ERROR_INVALID_PARAMETER, "wifi_aware_session_h is NULL");
RET_VAL_IF(publish == NULL, WIFI_AWARE_ERROR_INVALID_PARAMETER, "wifi_aware_publish_h is NULL");
@@ -450,20 +436,6 @@ API int wifi_aware_subscribe_set_match_filter(
return WIFI_AWARE_ERROR_NONE;
}
-API int wifi_aware_subscribe_set_enable_termination_event(
- wifi_aware_subscribe_h subscribe,
- bool enable)
-{
- __WIFI_AWARE_FUNC_ENTER__;
- CHECK_FEATURE_SUPPORTED(TIZEN_FEATURE_WIFI_AWARE);
- RET_VAL_IF(subscribe == NULL, WIFI_AWARE_ERROR_INVALID_PARAMETER, "wifi_aware_subscribe_h is NULL");
-
- _wifi_aware_subscribe_set_enable_termination_event(subscribe, enable);
-
- __WIFI_AWARE_FUNC_EXIT__;
- return WIFI_AWARE_ERROR_NONE;
-}
-
API int wifi_aware_session_subscribe(wifi_aware_session_h session,
wifi_aware_subscribe_h subscribe,
wifi_aware_subscribed_cb callback, void *user_data)
@@ -473,6 +445,7 @@ API int wifi_aware_session_subscribe(wifi_aware_session_h session,
CHECK_FEATURE_SUPPORTED(TIZEN_FEATURE_WIFI_AWARE);
RET_VAL_IF(!_wifi_aware_is_initialized(), WIFI_AWARE_ERROR_NOT_INITIALIZED, "Not initialized");
+ RET_VAL_IF(!_wifi_aware_is_enabled(), WIFI_AWARE_ERROR_INVALID_OPERATION, "Not enabled");
RET_VAL_IF(session == NULL, WIFI_AWARE_ERROR_INVALID_PARAMETER, "wifi_aware_session_h is NULL");
RET_VAL_IF(subscribe == NULL, WIFI_AWARE_ERROR_INVALID_PARAMETER, "wifi_aware_subscribe_h is NULL");
@@ -490,6 +463,7 @@ API int wifi_aware_session_stop(wifi_aware_session_h session)
CHECK_FEATURE_SUPPORTED(TIZEN_FEATURE_WIFI_AWARE);
RET_VAL_IF(!_wifi_aware_is_initialized(), WIFI_AWARE_ERROR_NOT_INITIALIZED, "Not initialized");
+ RET_VAL_IF(!_wifi_aware_is_enabled(), WIFI_AWARE_ERROR_INVALID_OPERATION, "Not enabled");
RET_VAL_IF(session == NULL, WIFI_AWARE_ERROR_INVALID_PARAMETER, "wifi_aware_session_h is NULL");
ret = _wifi_aware_session_cancel(session);
@@ -508,6 +482,7 @@ API int wifi_aware_session_update_subscribe(wifi_aware_session_h session,
CHECK_FEATURE_SUPPORTED(TIZEN_FEATURE_WIFI_AWARE);
RET_VAL_IF(!_wifi_aware_is_initialized(), WIFI_AWARE_ERROR_NOT_INITIALIZED, "Not initialized");
+ RET_VAL_IF(!_wifi_aware_is_enabled(), WIFI_AWARE_ERROR_INVALID_OPERATION, "Not enabled");
RET_VAL_IF(session == NULL, WIFI_AWARE_ERROR_INVALID_PARAMETER, "wifi_aware_session_h is NULL");
RET_VAL_IF(subscribe == NULL, WIFI_AWARE_ERROR_INVALID_PARAMETER, "wifi_aware_subscribe_h is NULL");
@@ -553,6 +528,7 @@ API int wifi_aware_session_send_message(wifi_aware_session_h session,
__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(!_wifi_aware_is_enabled(), WIFI_AWARE_ERROR_INVALID_OPERATION, "Not enabled");
RET_VAL_IF(session == NULL, WIFI_AWARE_ERROR_INVALID_PARAMETER, "wifi_aware_session_h is NULL");
RET_VAL_IF(peer == NULL, WIFI_AWARE_ERROR_INVALID_PARAMETER,
"wifi_aware_peer_h is NULL");
@@ -722,6 +698,7 @@ API int wifi_aware_data_path_open(wifi_aware_data_path_h data_path, wifi_aware_d
__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(!_wifi_aware_is_enabled(), WIFI_AWARE_ERROR_INVALID_OPERATION, "Not enabled");
RET_VAL_IF(data_path == NULL, WIFI_AWARE_ERROR_INVALID_PARAMETER, "Data path is NULL");
ret = _wifi_aware_data_path_open(data_path, callback, user_data);
@@ -737,6 +714,7 @@ API int wifi_aware_data_path_close(wifi_aware_data_path_h data_path)
__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(!_wifi_aware_is_enabled(), WIFI_AWARE_ERROR_INVALID_OPERATION, "Not enabled");
RET_VAL_IF(data_path == NULL, WIFI_AWARE_ERROR_INVALID_PARAMETER, "Data path is NULL");
ret = _wifi_aware_data_path_close(data_path);