From 652940adaa0b1a2f9a306748f708d088815c37ca Mon Sep 17 00:00:00 2001 From: Jaehyun Kim Date: Tue, 19 Mar 2013 01:16:15 +0900 Subject: [PATCH] Revise wifi_is_activated() to fix performance issue --- debian/changelog | 8 ++++++++ packaging/capi-network-wifi.spec | 2 +- src/libnetwork.c | 23 ++++++----------------- 3 files changed, 15 insertions(+), 18 deletions(-) diff --git a/debian/changelog b/debian/changelog index a964e74..02b8591 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +capi-network-wifi (0.1.2-16) unstable; urgency=low + + * Revise wifi_is_activated() to fix performance issue + * Git: framework/api/wifi + * Tag: capi-network-wifi_0.1.2-16 + + -- JaeHyun Kim Tue, 19 Mar 2013 01:01:15 +0900 + capi-network-wifi (0.1.2-15) unstable; urgency=low * Added specific(hidden) scan support diff --git a/packaging/capi-network-wifi.spec b/packaging/capi-network-wifi.spec index 7efe7ab..1d10355 100644 --- 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: 0.1.2_15 +Version: 0.1.2_16 Release: 1 Group: System/Network License: Apache-2.0 diff --git a/src/libnetwork.c b/src/libnetwork.c index 87740c4..a09e63a 100755 --- a/src/libnetwork.c +++ b/src/libnetwork.c @@ -610,28 +610,17 @@ bool _wifi_libnet_check_profile_name_validity(const char *profile_name) bool _wifi_libnet_get_wifi_device_state(wifi_device_state_e *device_state) { - net_wifi_state_t wlan_state; - net_profile_name_t profile_name; + net_tech_info_t tech_info; - if (net_get_wifi_state(&wlan_state, &profile_name) != NET_ERR_NONE) { - WIFI_LOG(WIFI_ERROR, "Error!! net_get_wifi_state() failed.\n"); + if (net_get_technology_properties(NET_DEVICE_WIFI, &tech_info) != NET_ERR_NONE) { + WIFI_LOG(WIFI_ERROR, "Error!! net_get_technology_properties() failed.\n"); return false; } - switch (wlan_state) { - case WIFI_OFF: - *device_state = WIFI_DEVICE_STATE_DEACTIVATED; - break; - case WIFI_ON: - case WIFI_CONNECTING: - case WIFI_CONNECTED: - case WIFI_DISCONNECTING: + if (tech_info.powered) *device_state = WIFI_DEVICE_STATE_ACTIVATED; - break; - default : - WIFI_LOG(WIFI_ERROR, "Error!! Unknown state\n"); - return false; - } + else + *device_state = WIFI_DEVICE_STATE_DEACTIVATED; return true; } -- 2.7.4