Modified to get frequency info for bssid scan 31/269631/1 accepted/tizen/unified/20220126.213047 submit/tizen/20220125.082819
authorJaehyun Kim <jeik01.kim@samsung.com>
Wed, 19 Jan 2022 09:30:23 +0000 (18:30 +0900)
committerJaehyun Kim <jeik01.kim@samsung.com>
Wed, 19 Jan 2022 09:30:23 +0000 (18:30 +0900)
Change-Id: I01e0ce7948c92175487430abbd78e63755ca8b13
Signed-off-by: Jaehyun Kim <jeik01.kim@samsung.com>
packaging/net-config.spec
src/wifi-bssid-scan.c

index e4ccca1..9f95e25 100755 (executable)
@@ -1,6 +1,6 @@
 Name:          net-config
 Summary:       TIZEN Network Configuration service
-Version:       1.2.11
+Version:       1.2.12
 Release:       1
 Group:         System/Network
 License:       Apache-2.0
index 4846c3b..14e1974 100755 (executable)
@@ -40,6 +40,7 @@ typedef struct {
        int ssid_len;
        int rssi;
        int mode;
+       unsigned int frequency;
 } bssid_scan_info_s;
 
 typedef struct {
@@ -148,6 +149,7 @@ static void __netconfig_wifi_bssid_notify_scan_done(const char *interface_name)
        const char *prop_bssid = "bssid";
        const char *prop_rssi = "rssi";
        const char *prop_mode = "mode";
+       const char *prop_freq = "frequency";
        bssid_scan_data_s *scan_data = NULL;
 
        builder = g_variant_builder_new(G_VARIANT_TYPE("a{sv}"));
@@ -166,12 +168,14 @@ static void __netconfig_wifi_bssid_notify_scan_done(const char *interface_name)
                        int ssid_len = (int)bss_info->ssid_len;
                        int rssi = (int)bss_info->rssi;
                        int mode = (int)bss_info->mode;
+                       guint32 frequency = (guint32)bss_info->frequency;
                        int i = 0;
                        g_snprintf(bssid_buff, 18, "%02x:%02x:%02x:%02x:%02x:%02x",
                                        bss_info->bssid[0], bss_info->bssid[1], bss_info->bssid[2],
                                        bss_info->bssid[3], bss_info->bssid[4], bss_info->bssid[5]);
 
-                       DBG("BSS found; SSID %s, BSSID %s, RSSI %d MODE %d", ssid, bssid_str, rssi, mode);
+                       DBG("BSS found; SSID %s, BSSID %s, RSSI %d MODE %d, Frequency %d",
+                                       ssid, bssid_str, rssi, mode, frequency);
 
                        builder1 = g_variant_builder_new(G_VARIANT_TYPE("ay"));
                        for (i = 0; i < ssid_len; i++)
@@ -182,6 +186,7 @@ static void __netconfig_wifi_bssid_notify_scan_done(const char *interface_name)
                        g_variant_builder_add(builder, "{sv}", prop_bssid, g_variant_new_string(bssid_str));
                        g_variant_builder_add(builder, "{sv}", prop_rssi, g_variant_new_int32(rssi));
                        g_variant_builder_add(builder, "{sv}", prop_mode, g_variant_new_int32(mode));
+                       g_variant_builder_add(builder, "{sv}", prop_freq, g_variant_new_uint32(frequency));
                }
        }
 
@@ -264,6 +269,11 @@ static void __netconfig_wifi_bssid_get_bss_info_result(
 
                                signal = g_variant_get_int16(value);
                                bss_info->rssi = signal;
+                       } else if (g_strcmp0(key, "Frequency") == 0) {
+                               gint16 frequency;
+
+                               frequency = g_variant_get_uint16(value);
+                               bss_info->frequency = (unsigned int)frequency;
                        }
                }
        }