---
 gsupplicant/gsupplicant.h |    3 +++
 gsupplicant/supplicant.c  |   23 +++++++++++++++++++++++
 2 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/gsupplicant/gsupplicant.h b/gsupplicant/gsupplicant.h
index 49815e1..c710679 100644
--- a/gsupplicant/gsupplicant.h
+++ b/gsupplicant/gsupplicant.h
@@ -200,6 +200,9 @@ unsigned int 
g_supplicant_interface_get_mode(GSupplicantInterface *interface);
 unsigned int g_supplicant_interface_get_max_scan_ssids(
                                        GSupplicantInterface *interface);
 
+int g_supplicant_interface_enable_selected_network(GSupplicantInterface 
*interface,
+                                                       dbus_bool_t enable);
+
 /* Network API */
 struct _GSupplicantNetwork;
 
diff --git a/gsupplicant/supplicant.c b/gsupplicant/supplicant.c
index 183e341..1c360fb 100644
--- a/gsupplicant/supplicant.c
+++ b/gsupplicant/supplicant.c
@@ -743,6 +743,29 @@ 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_enable_selected_network(GSupplicantInterface 
*interface,
+                                                       dbus_bool_t enable)
+{
+       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, &enable);
+}
+
 GSupplicantInterface *g_supplicant_network_get_interface(
                                        GSupplicantNetwork *network)
 {
-- 
1.7.7

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

Reply via email to