net-client: No need to update wifi info from supplicant 41/113641/1 accepted/tizen/common/20170210.170547 accepted/tizen/ivi/20170214.011047 accepted/tizen/mobile/20170214.010850 accepted/tizen/tv/20170214.010930 accepted/tizen/unified/20170309.032700 accepted/tizen/wearable/20170214.011016 submit/tizen/20170210.072732 submit/tizen/20170210.083740 submit/tizen_unified/20170308.100406
authorSaurav Babu <saurav.babu@samsung.com>
Wed, 8 Feb 2017 08:22:24 +0000 (13:52 +0530)
committerSaurav Babu <saurav.babu@samsung.com>
Wed, 8 Feb 2017 08:22:24 +0000 (13:52 +0530)
In case when there are multiple Wi-Fi networks with same SSID then
ConnMan only has one profile which is the profile for Connected AP. This
makes obsolete to update the information of Connected AP as ConnMan
already has updated information corresponding to connected AP.

Change-Id: I5e0d611a0ddb5a02e1e0ac48e20fe7be95f40669
Signed-off-by: Saurav Babu <saurav.babu@samsung.com>
src/network-profile-intf.c

index 288d69e1a971ff09b666ef777f33bcc7ff7367cd..8d4584438baa86a02c74f31e01ad1ade6ddc07f2 100755 (executable)
@@ -1145,106 +1145,6 @@ static wlan_eap_auth_type_t __convert_eap_auth_from_string(const char *eap_auth)
                return WLAN_SEC_EAP_AUTH_NONE;
 }
 
-static int __net_update_connected_wifi_info(net_profile_info_t* ProfInfo)
-{
-       static char ifname[NET_MAX_DEVICE_NAME_LEN+1] = { '\0', };
-       static char interface_path[DBUS_OBJECT_PATH_MAX] = { '\0', };
-       char current_bss_path[DBUS_OBJECT_PATH_MAX] = { '\0', };
-       net_err_t Error = NET_ERR_NONE;
-       GVariant *params = NULL;
-       GVariant *reply = NULL;
-       GVariant *value = NULL;
-       GVariantIter *iter = NULL;
-       gchar *key = NULL;
-       const char *path = NULL;
-
-       /* Get proper interface */
-       if (g_strcmp0(ProfInfo->ProfileInfo.Wlan.net_info.DevName, ifname) != 0) {
-               g_strlcpy(ifname, ProfInfo->ProfileInfo.Wlan.net_info.DevName,
-                               NET_MAX_DEVICE_NAME_LEN+1);
-
-               params = g_variant_new("(s)", ifname);
-               reply = _net_invoke_dbus_method(SUPPLICANT_SERVICE, SUPPLICANT_PATH,
-                               SUPPLICANT_INTERFACE, "GetInterface", params, &Error);
-               if (reply == NULL) {
-                       ifname[0] = '\0';
-                       NETWORK_LOG(NETWORK_ERROR, "Failed to get Wi-Fi interface");
-                       return Error;
-               }
-               g_variant_get(reply, "(o)", &path);
-               g_strlcpy(interface_path, path, DBUS_OBJECT_PATH_MAX);
-
-               g_variant_unref(reply);
-       }
-
-       /* Get CurrentBSS object path */
-       params = g_variant_new("(ss)", SUPPLICANT_IFACE_INTERFACE, "CurrentBSS");
-       reply = _net_invoke_dbus_method(SUPPLICANT_SERVICE, interface_path,
-                       DBUS_PROPERTIES_INTERFACE, "Get", params, &Error);
-       if (reply == NULL) {
-               NETWORK_LOG(NETWORK_ERROR, "Failed to get CurrentBSS");
-               return Error;
-       }
-       g_variant_get(reply, "(v)", &value);
-       path = g_variant_get_string(value, NULL);
-       g_strlcpy(current_bss_path, path, DBUS_OBJECT_PATH_MAX);
-
-       g_variant_unref(value);
-       g_variant_unref(reply);
-
-       /* Get Wi-Fi information */
-       params = g_variant_new("(s)", SUPPLICANT_IFACE_BSS);
-       reply = _net_invoke_dbus_method(SUPPLICANT_SERVICE, current_bss_path,
-                       DBUS_PROPERTIES_INTERFACE, "GetAll", params, &Error);
-       if (reply == NULL) {
-               NETWORK_LOG(NETWORK_ERROR, "Failed to get Wi-Fi information");
-               return Error;
-       }
-       g_variant_get(reply, "(a{sv})", &iter);
-       while (g_variant_iter_loop(iter, "{sv}", &key, &value)) {
-               if (g_strcmp0(key, "BSSID") == 0) {
-                       gsize bssid_len = 0;
-                       const gchar *bssid = NULL;
-
-                       bssid =
-                               g_variant_get_fixed_array(value, &bssid_len, sizeof(guchar));
-                       if (bssid && bssid_len == 6)
-                               snprintf(ProfInfo->ProfileInfo.Wlan.bssid, 18,
-                                               "%02x:%02x:%02x:%02x:%02x:%02x",
-                                               bssid[0], bssid[1], bssid[2],
-                                               bssid[3], bssid[4], bssid[5]);
-
-               } else if (g_strcmp0(key, "Signal") == 0) {
-                       ProfInfo->ProfileInfo.Wlan.Strength =
-                                       (unsigned char)(120 + g_variant_get_int16(value));
-
-                       if (ProfInfo->ProfileInfo.Wlan.Strength > 100)
-                               ProfInfo->ProfileInfo.Wlan.Strength = 100;
-
-               } else if (g_strcmp0(key, "Frequency") == 0) {
-                       ProfInfo->ProfileInfo.Wlan.frequency =
-                                       (unsigned int)g_variant_get_uint16(value);
-
-               } else if (g_strcmp0(key, "Rates") == 0) {
-                       GVariantIter *iter_sub = NULL;
-                       guint32 value_sub;
-
-                       g_variant_get(value, "au", &iter_sub);
-                       while (g_variant_iter_loop(iter_sub, "u", &value_sub)) {
-                               ProfInfo->ProfileInfo.Wlan.max_rate = (unsigned int)value_sub;
-                               break;
-                       }
-
-                       g_variant_iter_free(iter_sub);
-               }
-       }
-
-       g_variant_iter_free(iter);
-       g_variant_unref(reply);
-
-       return Error;
-}
-
 static int __net_extract_wifi_info(GVariantIter *array, net_profile_info_t* ProfInfo)
 {
        net_err_t Error = NET_ERR_NONE;
@@ -1425,14 +1325,6 @@ static int __net_extract_wifi_info(GVariantIter *array, net_profile_info_t* Prof
                        Error = __net_extract_common_info(key, var, ProfInfo);
        }
 
-       /* If there are multiple Wi-Fi networks which have the same SSID,
-        * and one of them is connected, we need to get the connected one
-        * rather than ConnMan grouped properties.
-        */
-       if (ProfInfo->ProfileState == NET_STATE_TYPE_READY ||
-                       ProfInfo->ProfileState == NET_STATE_TYPE_ONLINE)
-               Error = __net_update_connected_wifi_info(ProfInfo);
-
        __NETWORK_FUNC_EXIT__;
        return Error;
 }