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;
} 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) {
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);
/* 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,
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");
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);