diff mbox

P2P : Start P2P Scan with the specified channel Over DBUS

Message ID 1482142350-2730-1-git-send-email-amit.purwar@samsung.com
State Accepted
Headers show

Commit Message

Amit Purwar Dec. 19, 2016, 10:12 a.m. UTC
This is to allow user to start P2P Find/Scan on particular frequency and then move social channels.
This support is already present on control socket.

Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
---
 wpa_supplicant/dbus/dbus_new_handlers_p2p.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Comments

Jouni Malinen Dec. 19, 2016, 8:56 p.m. UTC | #1
On Mon, Dec 19, 2016 at 03:42:30PM +0530, Amit Purwar wrote:
> This is to allow user to start P2P Find/Scan on particular frequency and then move social channels.
> This support is already present on control socket.

Thanks, applied with some cleanup.
diff mbox

Patch

diff --git a/wpa_supplicant/dbus/dbus_new_handlers_p2p.c b/wpa_supplicant/dbus/dbus_new_handlers_p2p.c
index f50420b..801e258 100644
--- a/wpa_supplicant/dbus/dbus_new_handlers_p2p.c
+++ b/wpa_supplicant/dbus/dbus_new_handlers_p2p.c
@@ -90,6 +90,7 @@  DBusMessage * wpas_dbus_handler_p2p_find(DBusMessage *message,
 	int num_req_dev_types = 0;
 	unsigned int i;
 	u8 *req_dev_types = NULL;
+	unsigned int freq = 0;
 
 	dbus_message_iter_init(message, &iter);
 	entry.key = NULL;
@@ -134,6 +135,9 @@  DBusMessage * wpas_dbus_handler_p2p_find(DBusMessage *message,
 				type = P2P_FIND_PROGRESSIVE;
 			else
 				goto error_clear;
+		} else if(os_strcmp(entry.key, "freq") == 0 &&
+				entry.type == DBUS_TYPE_INT32) {
+				freq = entry.uint32_value;
 		} else
 			goto error_clear;
 		wpa_dbus_dict_entry_clear(&entry);
@@ -142,7 +146,7 @@  DBusMessage * wpas_dbus_handler_p2p_find(DBusMessage *message,
 	wpa_s = wpa_s->global->p2p_init_wpa_s;
 
 	wpas_p2p_find(wpa_s, timeout, type, num_req_dev_types, req_dev_types,
-		      NULL, 0, 0, NULL, 0);
+		      NULL, 0, 0, NULL, freq);
 	os_free(req_dev_types);
 	return reply;