void *g_supplicant_network_get_wifi_vsie(GSupplicantNetwork *network);
const unsigned char *g_supplicant_network_get_countrycode(GSupplicantNetwork
*network);
+void *g_supplicant_network_get_bssid_list(GSupplicantNetwork *network);
#endif
struct _GSupplicantCallbacks {
void *user_data;
};
+#if defined TIZEN_EXT
+struct g_connman_bssids {
+ char bssid[18];
+ uint16_t strength;
+ uint16_t frequency;
+};
+#endif
+
static int network_remove(struct interface_data *data);
static inline void debug(const char *format, ...)
return vsie_list;
}
+
+static void update_bssid_list(gpointer key, gpointer value, gpointer user_data)
+{
+ struct g_supplicant_bss *bss = value;
+ struct g_connman_bssids *bssids = NULL;
+ char buff[18];
+ GSList **list = (GSList **)user_data;
+
+ bssids = (struct g_connman_bssids *)g_try_malloc0(sizeof(struct g_connman_bssids));
+
+ if (bssids) {
+ g_snprintf(buff, 18, "%02x:%02x:%02x:%02x:%02x:%02x",
+ bss->bssid[0], bss->bssid[1], bss->bssid[2], bss->bssid[3],
+ bss->bssid[4], bss->bssid[5]);
+
+ memcpy(bssids->bssid, buff, 18);
+ bssids->bssid[17] = '\0';
+ bssids->strength = bss->signal;
+ bssids->strength += 120;
+
+ if (bssids->strength > 100)
+ bssids->strength = 100;
+
+ bssids->frequency = bss->frequency;
+ *list = g_slist_append(*list, bssids);
+ } else
+ SUPPLICANT_DBG("Failed to allocate memory");
+}
+
+void *g_supplicant_network_get_bssid_list(GSupplicantNetwork *network)
+{
+ GSList *bssid_list = NULL;
+
+ if (g_hash_table_size(network->bss_table) < 1)
+ return NULL;
+
+ g_hash_table_foreach(network->bss_table, update_bssid_list, &bssid_list);
+
+ return bssid_list;
+}
#endif
static void merge_network(GSupplicantNetwork *network)
};
+#if defined TIZEN_EXT
+struct connman_bssids {
+ char bssid[18];
+ uint16_t strength;
+ uint16_t frequency;
+};
+#endif
+
#define CONNMAN_NETWORK_PRIORITY_LOW -100
#define CONNMAN_NETWORK_PRIORITY_DEFAULT 0
#define CONNMAN_NETWORK_PRIORITY_HIGH 100
int connman_network_set_countrycode(struct connman_network *network, const
unsigned char *country_code);
unsigned char *connman_network_get_countrycode(struct connman_network *network);
+int connman_network_set_bssid_list(struct connman_network *network,
+ GSList *bssids);
+void *connman_network_get_bssid_list(struct connman_network *network);
#endif
int connman_network_set_name(struct connman_network *network,
g_supplicant_network_get_keymgmt(supplicant_network));
connman_network_set_bool(network, "WiFi.HS20AP",
g_supplicant_network_is_hs20AP(supplicant_network));
+ connman_network_set_bssid_list(network,
+ (GSList *)g_supplicant_network_get_bssid_list(supplicant_network));
#endif
connman_network_set_available(network, true);
connman_network_set_string(network, "WiFi.Mode", mode);
uint16_t frequency;
bool wps;
const unsigned char *country_code;
+ GSList *bssid_list;
#endif
interface = g_supplicant_network_get_interface(network);
connman_network_set_bool(connman_network, "WiFi.WPS", wps);
country_code = g_supplicant_network_get_countrycode(network);
connman_network_set_countrycode(connman_network, country_code);
+ bssid_list = (GSList *)g_supplicant_network_get_bssid_list(network);
+ connman_network_set_bssid_list(connman_network, bssid_list);
#endif
}
*/
char *phase1;
unsigned char country_code[WIFI_COUNTRY_CODE_LEN];
+ GSList *bssid_list;
#endif
} wifi;
g_free(network->wifi.pin_wps);
#if defined TIZEN_EXT
g_slist_free_full(network->wifi.vsie_list, g_free);
+ g_slist_free_full(network->wifi.bssid_list, g_free);
#endif
g_free(network->path);
g_free(network->group);
return (unsigned char *)network->wifi.country_code;
}
+int connman_network_set_bssid_list(struct connman_network *network,
+ GSList *bssids)
+{
+ network->wifi.bssid_list = bssids;
+
+ return 0;
+}
+
+void *connman_network_get_bssid_list(struct connman_network *network)
+{
+ return network->wifi.bssid_list;
+}
#endif
int connman_network_set_nameservers(struct connman_network *network,
DBUS_TYPE_STRING, &str);
}
}
+
+static void append_bssid_info(DBusMessageIter *iter, void *user_data)
+{
+ GSList *bssid_list = NULL;
+ struct connman_network *network = user_data;
+ struct connman_bssids *bssids;
+ char bssid_buf[18] = {0,};
+ char *bssid_str = bssid_buf;
+
+ bssid_list = (GSList *)connman_network_get_bssid_list(network);
+ if(bssid_list) {
+ GSList *list;
+ for (list = bssid_list; list; list = list->next) {
+ bssids = (struct connman_bssids *)list->data;
+ memcpy(bssid_str, bssids->bssid, 18);
+
+ connman_dbus_dict_append_basic(iter, "BSSID",
+ DBUS_TYPE_STRING, &bssid_str);
+
+ connman_dbus_dict_append_basic(iter, "Strength",
+ DBUS_TYPE_UINT16, &bssids->strength);
+
+ connman_dbus_dict_append_basic(iter, "Frequency",
+ DBUS_TYPE_UINT16, &bssids->frequency);
+ }
+ }
+}
#endif
static void append_properties(DBusMessageIter *dict, dbus_bool_t limited,
break;
case CONNMAN_SERVICE_TYPE_WIFI:
#if defined TIZEN_EXT
- if (service->network != NULL)
+ if (service->network != NULL) {
append_wifi_ext_info(dict, service->network);
+ connman_dbus_dict_append_dict(dict, "BSSID.List",
+ append_bssid_info, service->network);
+ }
connman_dbus_dict_append_dict(dict, "Ethernet",
append_ethernet, service);