} net_vsie_frames_e;
typedef struct {
+ char bssid[18];
+ int strength;
+ int frequency;
+} net_profile_bssid_list_s;
+
+typedef struct {
char ProfileName[NET_PROFILE_NAME_LEN_MAX+1]; /** Profile name */
net_state_type_e ProfileState; /** Service state */
char essid[NET_WLAN_ESSID_LEN+1]; /** ESSID */
GSList *vsie_list; /** List of Vendor Specific Information Element of AP*/
int assoc_status_code; /** Supplicant WiFi Association Status Code */
char country_code[NET_WLAN_COUNTRY_CODE_LEN]; /** Country code received from AP */
+ GSList *bssid_list; /** List if BSSID, strength and frequency of AP **/
} net_profile_info_s;
typedef struct {
if (value != NULL)
g_strlcpy(ProfInfo->country_code, value, NET_WLAN_COUNTRY_CODE_LEN);
+ } else if (g_strcmp0(key, "BSSID.List") == 0) {
+ GVariantIter *iter_sub = NULL;
+ net_profile_bssid_list_s *bssid_list = NULL;
+ g_variant_get(var, "a{sv}", &iter_sub);
+
+ while (g_variant_iter_loop(iter_sub, "{sv}", &value, &var)) {
+ if (g_strcmp0(value, "BSSID") == 0) {
+ bssid_list = (net_profile_bssid_list_s *)g_try_malloc0(sizeof(net_profile_bssid_list_s));
+
+ if (bssid_list) {
+ value = g_variant_get_string(var, NULL);
+
+ if (value != NULL)
+ g_strlcpy(bssid_list->bssid, value, 18);
+ else
+ WIFI_LOG(WIFI_ERROR, "Value is empty");
+ } else {
+ WIFI_LOG(WIFI_ERROR, "Failed to allocate memory.");
+ break;
+ }
+ } else if (bssid_list && g_strcmp0(value, "Strength") == 0) {
+ bssid_list->strength = (int)g_variant_get_uint16(var);
+ } else if (bssid_list && g_strcmp0(value, "Frequency") == 0) {
+ bssid_list->frequency = (int)g_variant_get_uint16(var);
+ ProfInfo->bssid_list = g_slist_append(ProfInfo->bssid_list, bssid_list);
+ }
+ }
+ g_variant_iter_free(iter_sub);
} else
Error = __net_extract_common_info(key, var, ProfInfo);
}
return WIFI_MANAGER_ERROR_NONE;
}
+EXPORT_API int wifi_manager_foreach_found_bssid(wifi_manager_ap_h ap,
+ wifi_manager_found_bssid_cb callback, void *user_data)
+{
+ __NETWORK_CAPI_FUNC_ENTER__;
+
+ CHECK_FEATURE_SUPPORTED(WIFI_FEATURE);
+
+ if (_wifi_check_ap_validity(ap) == false || callback == NULL) {
+ WIFI_LOG(WIFI_ERROR, "Invalid parameter\n");
+ __NETWORK_CAPI_FUNC_EXIT__;
+ return WIFI_MANAGER_ERROR_INVALID_PARAMETER;
+ }
+
+ net_profile_info_s *profile_info = ap;
+
+ bool rv;
+ GSList *list;
+ for (list = profile_info->bssid_list; list; list = list->next) {
+ net_profile_bssid_list_s *bssid_list = (net_profile_bssid_list_s *)list->data;
+
+ rv = callback((const char *)bssid_list->bssid, (bssid_list->strength - 120), bssid_list->frequency, user_data);
+ if (rv == false)
+ break;
+ }
+ g_slist_free_full(profile_info->bssid_list, g_free);
+ profile_info->bssid_list = NULL;
+
+ __NETWORK_CAPI_FUNC_EXIT__;
+ return WIFI_MANAGER_ERROR_NONE;
+}
+
/* Wi-Fi security information ************************************************/
EXPORT_API int wifi_manager_ap_get_security_type(wifi_manager_ap_h ap,
wifi_manager_security_type_e *type)
return true;
}
+static bool __test_found_bssid_list_callback(const char *bssid, int rssi, int freq, void *user_data)
+{
+ printf("-> BSSID : %s, RSSI : %d, Frequency : %d\n", bssid, rssi, freq);
+ return true;
+}
+
static bool __test_found_print_ap_info_callback(wifi_manager_ap_h ap, void *user_data)
{
int rv, address_type = 0;
} else
printf("Fail to get BSSID\n");
+ if (wifi_manager_foreach_found_bssid(ap, __test_found_bssid_list_callback, NULL) != WIFI_MANAGER_ERROR_NONE)
+ printf("Fail to get BSSID list data\n");
+
if (wifi_manager_ap_get_rssi(ap, &int_value) == WIFI_MANAGER_ERROR_NONE)
printf("RSSI : %d\n", int_value);
else