This is useful so stop wpa_supplicant retrying to associate when we
will not want to.
---
 gsupplicant/gsupplicant.h |    2 ++
 gsupplicant/supplicant.c  |   25 +++++++++++++++++++++++++
 2 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/gsupplicant/gsupplicant.h b/gsupplicant/gsupplicant.h
index 49815e1..0f0a084 100644
--- a/gsupplicant/gsupplicant.h
+++ b/gsupplicant/gsupplicant.h
@@ -200,6 +200,8 @@ unsigned int 
g_supplicant_interface_get_mode(GSupplicantInterface *interface);
 unsigned int g_supplicant_interface_get_max_scan_ssids(
                                        GSupplicantInterface *interface);
 
+int g_supplicant_interface_disable_selected_network(GSupplicantInterface 
*interface);
+
 /* Network API */
 struct _GSupplicantNetwork;
 
diff --git a/gsupplicant/supplicant.c b/gsupplicant/supplicant.c
index 183e341..f5af525 100644
--- a/gsupplicant/supplicant.c
+++ b/gsupplicant/supplicant.c
@@ -743,6 +743,31 @@ unsigned int g_supplicant_interface_get_max_scan_ssids(
        return interface->max_scan_ssids;
 }
 
+static void set_network_enabled(DBusMessageIter *iter, void *user_data)
+{
+       dbus_bool_t enable = *(dbus_bool_t *)user_data;
+
+       dbus_message_iter_append_basic(iter, DBUS_TYPE_BOOLEAN, &enable);
+}
+
+int g_supplicant_interface_disable_selected_network(GSupplicantInterface 
*interface)
+{
+       dbus_bool_t disable = FALSE;
+
+       if (interface == NULL)
+               return -1;
+
+       if (interface->network_path == NULL)
+               return -1;
+
+       SUPPLICANT_DBG(" ");
+
+       return supplicant_dbus_property_set(interface->network_path,
+                               SUPPLICANT_INTERFACE ".Network",
+                               "Enabled", DBUS_TYPE_BOOLEAN_AS_STRING,
+                               set_network_enabled, NULL, &disable);
+}
+
 GSupplicantInterface *g_supplicant_network_get_interface(
                                        GSupplicantNetwork *network)
 {
-- 
1.7.3.4

_______________________________________________
connman mailing list
[email protected]
http://lists.connman.net/listinfo/connman

Reply via email to