aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMAYANK HAARIT <mayank.h@samsung.com>2015-06-12 11:27:19 (GMT)
committerJouni Malinen <j@w1.fi>2015-06-14 08:33:54 (GMT)
commitb649c0afd4c5adf04fe5986b8bb2d70746ce7fac (patch)
tree44b58a42029bd6f9b1459097e232487d4594677a
parentf4a234a1696d44bde31fdfdffcd06cbb27eb631d (diff)
downloadhostap-b649c0afd4c5adf04fe5986b8bb2d70746ce7fac.zip
hostap-b649c0afd4c5adf04fe5986b8bb2d70746ce7fac.tar.gz
hostap-b649c0afd4c5adf04fe5986b8bb2d70746ce7fac.tar.bz2
dbus: Add Reconnect command to D-Bus Interface
This has same behavior as the ctrl_iface RECONNECT command. Signed-off-by: Mayank Haarit <mayank.h@samsung.com> Signed-off-by: Purushottam Kushwaha <p.kushwaha@samsung.com>
-rw-r--r--doc/dbus.doxygen10
-rw-r--r--wpa_supplicant/dbus/dbus_new.c6
-rw-r--r--wpa_supplicant/dbus/dbus_new_handlers.c24
-rw-r--r--wpa_supplicant/dbus/dbus_new_handlers.h3
4 files changed, 43 insertions, 0 deletions
diff --git a/doc/dbus.doxygen b/doc/dbus.doxygen
index be7f51a..7355dbb 100644
--- a/doc/dbus.doxygen
+++ b/doc/dbus.doxygen
@@ -307,6 +307,16 @@ fi.w1.wpa_supplicant1.CreateInterface.
</li>
<li>
+ <h3>Reconnect ( ) --> nothing</h3>
+ <p>Attempt reconnection and connect if in disconnected state.</p>
+ <h4>Possible errors</h4>
+ <dl>
+ <dt>fi.w1.wpa_supplicant1.InterfaceDisabled</dt>
+ <dd>The interface is disabled.</dd>
+ </dl>
+ </li>
+
+ <li>
<h3>AddBlob ( s : name, ay : data ) --> nothing</h3>
<p>Adds a blob to the interface.</p>
<h4>Arguments</h4>
diff --git a/wpa_supplicant/dbus/dbus_new.c b/wpa_supplicant/dbus/dbus_new.c
index fb674d4..0696666 100644
--- a/wpa_supplicant/dbus/dbus_new.c
+++ b/wpa_supplicant/dbus/dbus_new.c
@@ -2552,6 +2552,12 @@ static const struct wpa_dbus_method_desc wpas_dbus_interface_methods[] = {
END_ARGS
}
},
+ { "Reconnect", WPAS_DBUS_NEW_IFACE_INTERFACE,
+ (WPADBusMethodHandler) wpas_dbus_handler_reconnect,
+ {
+ END_ARGS
+ }
+ },
{ "RemoveNetwork", WPAS_DBUS_NEW_IFACE_INTERFACE,
(WPADBusMethodHandler) wpas_dbus_handler_remove_network,
{
diff --git a/wpa_supplicant/dbus/dbus_new_handlers.c b/wpa_supplicant/dbus/dbus_new_handlers.c
index 97db9a8..2a7e2cf 100644
--- a/wpa_supplicant/dbus/dbus_new_handlers.c
+++ b/wpa_supplicant/dbus/dbus_new_handlers.c
@@ -1601,6 +1601,30 @@ DBusMessage * wpas_dbus_handler_reattach(DBusMessage *message,
/**
+ * wpas_dbus_handler_reconnect - Reconnect if disconnected
+ * @message: Pointer to incoming dbus message
+ * @wpa_s: wpa_supplicant structure for a network interface
+ * Returns: InterfaceDisabled DBus error message if disabled
+ * or NULL otherwise.
+ *
+ * Handler function for "Reconnect" method call of network interface.
+ */
+DBusMessage * wpas_dbus_handler_reconnect(DBusMessage *message,
+ struct wpa_supplicant *wpa_s)
+{
+ if (wpa_s->wpa_state == WPA_INTERFACE_DISABLED) {
+ return dbus_message_new_error(message,
+ WPAS_DBUS_ERROR_IFACE_DISABLED,
+ "This interface is disabled");
+ }
+
+ if (wpa_s->disconnected)
+ wpas_request_connection(wpa_s);
+ return NULL;
+}
+
+
+/**
* wpas_dbus_handler_remove_network - Remove a configured network
* @message: Pointer to incoming dbus message
* @wpa_s: wpa_supplicant structure for a network interface
diff --git a/wpa_supplicant/dbus/dbus_new_handlers.h b/wpa_supplicant/dbus/dbus_new_handlers.h
index 9afdc05..50f72ec 100644
--- a/wpa_supplicant/dbus/dbus_new_handlers.h
+++ b/wpa_supplicant/dbus/dbus_new_handlers.h
@@ -107,6 +107,9 @@ DBusMessage * wpas_dbus_handler_reassociate(DBusMessage *message,
DBusMessage * wpas_dbus_handler_reattach(DBusMessage *message,
struct wpa_supplicant *wpa_s);
+DBusMessage * wpas_dbus_handler_reconnect(DBusMessage *message,
+ struct wpa_supplicant *wpa_s);
+
DBusMessage * wpas_dbus_handler_remove_network(DBusMessage *message,
struct wpa_supplicant *wpa_s);