Revise wifi_is_activated() to fix performance issue
authorJaehyun Kim <jeik01.kim@samsung.com>
Mon, 18 Mar 2013 16:16:15 +0000 (01:16 +0900)
committerJaehyun Kim <jeik01.kim@samsung.com>
Sat, 23 Mar 2013 11:29:41 +0000 (20:29 +0900)
debian/changelog
packaging/capi-network-wifi.spec
src/libnetwork.c

index a964e74..02b8591 100644 (file)
@@ -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 <jeik01.kim@samsung.com>  Tue, 19 Mar 2013 01:01:15 +0900
+
 capi-network-wifi (0.1.2-15) unstable; urgency=low
 
   * Added specific(hidden) scan support
index 7efe7ab..1d10355 100644 (file)
@@ -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
index 87740c4..a09e63a 100755 (executable)
@@ -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;
 }