mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-27 23:20:12 +01:00
wifi: convert scanning to new supplicant interface
This commit is contained in:
parent
848f9f4261
commit
6ecb45ddf0
1 changed files with 27 additions and 1 deletions
|
|
@ -950,23 +950,49 @@ scan_request_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data)
|
|||
g_clear_error (&err);
|
||||
}
|
||||
|
||||
static void
|
||||
destroy_gvalue (gpointer data)
|
||||
{
|
||||
GValue *value = (GValue *) data;
|
||||
|
||||
g_value_unset (value);
|
||||
g_slice_free (GValue, value);
|
||||
}
|
||||
|
||||
static GValue *
|
||||
string_to_gvalue (const char *str)
|
||||
{
|
||||
GValue *val = g_slice_new0 (GValue);
|
||||
|
||||
g_value_init (val, G_TYPE_STRING);
|
||||
g_value_set_string (val, str);
|
||||
return val;
|
||||
}
|
||||
|
||||
gboolean
|
||||
nm_supplicant_interface_request_scan (NMSupplicantInterface * self)
|
||||
{
|
||||
NMSupplicantInterfacePrivate *priv;
|
||||
NMSupplicantInfo *info;
|
||||
DBusGProxyCall *call;
|
||||
GHashTable *hash;
|
||||
|
||||
g_return_val_if_fail (NM_IS_SUPPLICANT_INTERFACE (self), FALSE);
|
||||
|
||||
priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self);
|
||||
|
||||
/* Scan parameters */
|
||||
hash = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, destroy_gvalue);
|
||||
g_hash_table_insert (hash, "Type", string_to_gvalue ("active"));
|
||||
|
||||
info = nm_supplicant_info_new (self, priv->iface_proxy, priv->other_pcalls);
|
||||
call = dbus_g_proxy_begin_call (priv->iface_proxy, "scan",
|
||||
call = dbus_g_proxy_begin_call (priv->iface_proxy, "Scan",
|
||||
scan_request_cb,
|
||||
info,
|
||||
nm_supplicant_info_destroy,
|
||||
DBUS_TYPE_G_MAP_OF_VARIANT, hash,
|
||||
G_TYPE_INVALID);
|
||||
g_hash_table_destroy (hash);
|
||||
nm_supplicant_info_set_call (info, call);
|
||||
|
||||
return call != NULL;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue