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>
This commit is contained in:
MAYANK HAARIT 2015-06-12 11:27:19 +00:00 committed by Jouni Malinen
parent f4a234a169
commit b649c0afd4
4 changed files with 43 additions and 0 deletions

View File

@ -306,6 +306,16 @@ fi.w1.wpa_supplicant1.CreateInterface.
</dl>
</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>

View File

@ -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,
{

View File

@ -1600,6 +1600,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

View File

@ -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);