D-Bus: Add 'freq' option to P2P Find method to specify starting channel

This allows user to start P2P Find/Scan on a particular frequency and
then move to scanning social channels. This support is already present
on control socket.

Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
This commit is contained in:
Amit Purwar 2016-12-19 15:42:30 +05:30 committed by Jouni Malinen
parent 74d29544f1
commit 4e118c847b
2 changed files with 7 additions and 1 deletions

View file

@ -1297,6 +1297,7 @@ Interface for performing P2P (Wi-Fi Peer-to-Peer) P2P Device operations.
<tr><td>Timeout</td><td>i</td><td>Timeout for operating in seconds</td><td>no</td></tr>
<tr><td>RequestedDeviceTypes</td><td>aay</td><td>WPS Device Types to search for</td><td>no</td></tr>
<tr><td>DiscoveryType</td><td>s</td><td>"start_with_full" (default, if not specified), "social", "progressive"</td><td>no</td></tr>
<tr><td>freq</td><td>i</td><td>Initial scan channel (frequency in MHz) for the start_with_full case to limit the initial scan to the specified channel</td><td>no</td></tr>
</table>
</dd>
</dl>

View file

@ -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,10 @@ 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 ||
entry.type == DBUS_TYPE_UINT32)) {
freq = entry.uint32_value;
} else
goto error_clear;
wpa_dbus_dict_entry_clear(&entry);
@ -142,7 +147,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;