Modified to get frequency info for bssid scan 32/269632/1 accepted/tizen/unified/20220126.213031 submit/tizen/20220125.082819
authorJaehyun Kim <jeik01.kim@samsung.com>
Wed, 19 Jan 2022 09:33:36 +0000 (18:33 +0900)
committerJaehyun Kim <jeik01.kim@samsung.com>
Wed, 19 Jan 2022 09:33:36 +0000 (18:33 +0900)
Change-Id: I10faff5cb734e796134b0f676baf519ba6d410b3
Signed-off-by: Jaehyun Kim <jeik01.kim@samsung.com>
packaging/capi-network-wifi-manager.spec
src/network_interface.h
src/network_signal.c
src/wifi_internal.c
tools/manager-test/wman_test_ap.c

index 61ea80b..38006c3 100644 (file)
@@ -1,6 +1,6 @@
 Name:          capi-network-wifi-manager
 Summary:       Network Wi-Fi library in TIZEN C API
-Version:       1.3.14
+Version:       1.3.15
 Release:       0
 Group:         System/Network
 License:       Apache-2.0
index fbbb8ce..caef5e7 100644 (file)
@@ -192,6 +192,7 @@ typedef struct {
        char bssid[WIFI_MAC_ADDR_LEN + 1];
        int rssi;
        int mode;
+       unsigned int freq;
 } net_bssid_scan_bss_info_s;
 
 typedef struct {
index 2e2ef0d..a46a075 100644 (file)
@@ -340,10 +340,12 @@ static int __net_handle_wifi_bssid_scan_rsp(network_info_s *network_info,
        const gchar *bssid = NULL;
        gsize ssid_len;
        int rssi = -89;
+       unsigned int freq = 0;
        int mode = 0;
        gboolean ssid_found = FALSE;
        gboolean bssid_found = FALSE;
        gboolean rssi_found = FALSE;
+       gboolean freq_found = FALSE;
        gboolean mode_found = FALSE;
        char *interface_name = NULL;
 
@@ -362,13 +364,17 @@ static int __net_handle_wifi_bssid_scan_rsp(network_info_s *network_info,
                } else if (g_strcmp0(key, "rssi") == 0) {
                        rssi = g_variant_get_int32(value);
                        rssi_found = TRUE;
+               } else if (g_strcmp0(key, "frequency") == 0) {
+                       freq = g_variant_get_uint32(value);
+                       freq_found = TRUE;
                } else if (g_strcmp0(key, "mode") == 0) {
                        mode = g_variant_get_int32(value);
                        mode_found = TRUE;
                }
 
                if (ssid_found == TRUE && bssid_found == TRUE &&
-                       rssi_found == TRUE && mode_found == TRUE) {
+                       rssi_found == TRUE && mode_found == TRUE &&
+                       freq_found == TRUE) {
                        net_bssid_scan_bss_info_s *bss = NULL;
                        bss = g_try_new0(net_bssid_scan_bss_info_s, 1);
                        if (bss == NULL) {
@@ -383,11 +389,13 @@ static int __net_handle_wifi_bssid_scan_rsp(network_info_s *network_info,
                        memcpy(bss->ssid, ssid, ssid_len);
                        g_strlcpy(bss->bssid, bssid, WIFI_MAC_ADDR_LEN + 1);
                        bss->rssi = rssi;
+                       bss->freq = freq;
                        bss->mode = mode;
                        bss_info_list = g_slist_append(bss_info_list, bss);
 
                        ssid_found = bssid_found = FALSE;
                        rssi_found = mode_found = FALSE;
+                       freq_found = FALSE;
                }
        }
        g_variant_iter_free(iter);
index 3a1cc7d..3b50982 100644 (file)
@@ -479,6 +479,7 @@ static void __update_bss_profile_iterator(wifi_manager_handle_s *wifi_handle,
                /* we receive the negative value of RSSI from the wpa supplicant.
                 * so modify the rssi value in same manner as done in connman. */
                profile->Strength = 120 + ap->rssi;
+               profile->frequency = ap->freq;
 
                wifi_handle->bss_profile_iterator =
                        g_slist_append(wifi_handle->bss_profile_iterator,
index 348c769..b473189 100644 (file)
@@ -1392,6 +1392,7 @@ static bool __test_get_bssid_scan_list(wifi_manager_ap_h ap, void *user_data)
        char *bssid;
        char *essid;
        int rssi;
+       int freq;
 
        if (wifi_manager_ap_get_bssid(ap, &bssid) != WIFI_MANAGER_ERROR_NONE) {
                printf("Failed to get bssid for ap\n");
@@ -1411,8 +1412,15 @@ static bool __test_get_bssid_scan_list(wifi_manager_ap_h ap, void *user_data)
                return false;
        }
 
-       printf("bssid : %s, essid : %s, rssi : %d\n",
-               bssid, essid, rssi);
+       if (wifi_manager_ap_get_frequency(ap, &freq) != WIFI_MANAGER_ERROR_NONE) {
+               printf("Failed to get frequency for ap\n");
+               free(bssid);
+               free(essid);
+               return false;
+       }
+
+       printf("bssid: %s, essid: %s, rssi: %d, frequency: %d\n",
+               bssid, essid, rssi, freq);
 
        free(bssid);
        free(essid);