P2P: Add P2P Cancel method over D-Bus interface

This patch adds P2P Cancel method over
fi.w1.wpa_supplicant1.Interface.P2PDevice dbus interface.

Signed-off-by: Nishant Chaprana <n.chaprana@samsung.com>
This commit is contained in:
Nishant Chaprana 2015-05-26 10:35:47 +05:30 committed by Jouni Malinen
parent 2a8e3f35ef
commit 333039596e
4 changed files with 34 additions and 0 deletions

View file

@ -1073,6 +1073,11 @@ Interface for performing P2P (Wi-Fi Peer-to-Peer) P2P Device operations.
</dl> </dl>
</li> </li>
<li>
<h3>Cancel ( nothing ) --> nothing</h3>
<p>Stop ongoing P2P group formation operation.</p>
</li>
<li> <li>
<h3>Invite ( a{sv} : args ) --> nothing</h3> <h3>Invite ( a{sv} : args ) --> nothing</h3>
<p>Invite a peer to join an already operating group or to re-invoke a persistent group.</p> <p>Invite a peer to join an already operating group or to re-invoke a persistent group.</p>

View file

@ -2648,6 +2648,12 @@ static const struct wpa_dbus_method_desc wpas_dbus_interface_methods[] = {
END_ARGS END_ARGS
} }
}, },
{ "Cancel", WPAS_DBUS_NEW_IFACE_P2PDEVICE,
(WPADBusMethodHandler) wpas_dbus_handler_p2p_cancel,
{
END_ARGS
}
},
{ "Invite", WPAS_DBUS_NEW_IFACE_P2PDEVICE, { "Invite", WPAS_DBUS_NEW_IFACE_P2PDEVICE,
(WPADBusMethodHandler) wpas_dbus_handler_p2p_invite, (WPADBusMethodHandler) wpas_dbus_handler_p2p_invite,
{ {

View file

@ -575,6 +575,26 @@ inv_args:
} }
/**
* wpas_dbus_handler_p2p_cancel - Cancel P2P group formation
* @message: Pointer to incoming dbus message
* @wpa_s: %wpa_supplicant data structure
* Returns: NULL on success or DBus error on failure
*
* Handler for "Cancel" method call. Returns NULL if P2P cancel succeeds or DBus
* error on P2P cancel failure
*/
DBusMessage * wpas_dbus_handler_p2p_cancel(DBusMessage *message,
struct wpa_supplicant *wpa_s)
{
if (wpas_p2p_cancel(wpa_s))
return wpas_dbus_error_unknown_error(message,
"P2P cancel failed");
return NULL;
}
DBusMessage * wpas_dbus_handler_p2p_invite(DBusMessage *message, DBusMessage * wpas_dbus_handler_p2p_invite(DBusMessage *message,
struct wpa_supplicant *wpa_s) struct wpa_supplicant *wpa_s)
{ {

View file

@ -46,6 +46,9 @@ DBusMessage *wpas_dbus_handler_p2p_connect(
DBusMessage *message, DBusMessage *message,
struct wpa_supplicant *wpa_s); struct wpa_supplicant *wpa_s);
DBusMessage * wpas_dbus_handler_p2p_cancel(DBusMessage *message,
struct wpa_supplicant *wpa_s);
DBusMessage *wpas_dbus_handler_p2p_invite( DBusMessage *wpas_dbus_handler_p2p_invite(
DBusMessage *message, DBusMessage *message,
struct wpa_supplicant *wpa_s); struct wpa_supplicant *wpa_s);