From: taesubkim Date: Tue, 9 Aug 2016 03:53:05 +0000 (+0900) Subject: Check the wifi state when active & deactive X-Git-Tag: submit/tizen/20160809.065304^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F57%2F83057%2F1;p=platform%2Fcore%2Fapi%2Fwifi.git Check the wifi state when active & deactive Change-Id: Ic7cfb01de0fbe852c837a7238284100a0651bb63 Signed-off-by: Taesub Kim --- diff --git a/packaging/capi-network-wifi.spec b/packaging/capi-network-wifi.spec index d323055..dd9821d 100755 --- a/packaging/capi-network-wifi.spec +++ b/packaging/capi-network-wifi.spec @@ -1,6 +1,6 @@ Name: capi-network-wifi Summary: Network Wi-Fi library in TIZEN C API -Version: 1.0.77 +Version: 1.0.78 Release: 1 Group: System/Network License: Apache-2.0 diff --git a/test/wifi_test.c b/test/wifi_test.c index 2f61cbf..a809dfe 100755 --- a/test/wifi_test.c +++ b/test/wifi_test.c @@ -1080,14 +1080,21 @@ int test_wifi_activate(void) { int rv = 0; - rv = wifi_activate(__test_activated_callback, NULL); + bool state = false; - if (rv != WIFI_ERROR_NONE) { - printf("Fail to activate Wi-Fi device [%s]\n", __test_convert_error_to_string(rv)); - return -1; - } + rv = wifi_is_activated(&state); + + if(state != true) { + rv = wifi_activate(__test_activated_callback, NULL); - printf("Success to activate Wi-Fi device\n"); + if (rv != WIFI_ERROR_NONE) { + printf("Fail to activate Wi-Fi device [%s]", __test_convert_error_to_string(rv)); + return -1; + } + } + else { + __test_activated_callback(WIFI_ERROR_NONE, NULL); + } return 1; } @@ -1095,15 +1102,21 @@ int test_wifi_activate(void) int test_wifi_deactivate(void) { int rv = 0; + bool state = false; - rv = wifi_deactivate(__test_deactivated_callback, NULL); + rv = wifi_is_activated(&state); - if (rv != WIFI_ERROR_NONE) { - printf("Fail to deactivate Wi-Fi device [%s]\n", __test_convert_error_to_string(rv)); - return -1; - } + if(state == true) { + rv = wifi_deactivate(__test_deactivated_callback, NULL); - printf("Success to deactivate Wi-Fi device\n"); + if (rv != WIFI_ERROR_NONE) { + printf("Fail to deactivate Wi-Fi device [%s]\n", __test_convert_error_to_string(rv)); + return -1; + } + } + else { + __test_deactivated_callback(WIFI_ERROR_NONE, NULL); + } return 1; }