Wireless Daemon for Linux
 help / color / mirror / Atom feed
From: James Prestwood <prestwoj at gmail.com>
To: iwd at lists.01.org
Subject: [PATCH 10/12] auto-t: wpas.py: handle enrollee as responder
Date: Tue, 18 Jan 2022 13:25:10 -0800	[thread overview]
Message-ID: <20220118212512.2017977-10-prestwoj@gmail.com> (raw)
In-Reply-To: 20220118212512.2017977-1-prestwoj@gmail.com

[-- Attachment #1: Type: text/plain, Size: 1644 bytes --]

This adds support for wpa_supplicant to generate its own URI and
start presence announcements (DPP_CHIRP).
---
 autotests/util/wpas.py | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/autotests/util/wpas.py b/autotests/util/wpas.py
index c8e65179..995bdad1 100644
--- a/autotests/util/wpas.py
+++ b/autotests/util/wpas.py
@@ -239,10 +239,17 @@ class Wpas:
     def set(self, key, value, **kwargs):
         self._ctrl_request('SET ' + key + ' ' + value, **kwargs)
 
-    def dpp_enrollee_start(self, uri=None):
+    def dpp_enrollee_start(self, uri=None, oper_and_channel=None):
+        if not oper_and_channel:
+            oper_and_channel = '81/1'
+
         self._rx_data = []
-        self._ctrl_request('DPP_BOOTSTRAP_GEN type=qrcode')
-        self.wait_for_result()
+        self._ctrl_request('DPP_BOOTSTRAP_GEN type=qrcode chan=%s' % oper_and_channel)
+        self._dpp_qr_id = self.wait_for_result()
+        self._ctrl_request('DPP_BOOTSTRAP_GET_URI %s' % self._dpp_qr_id)
+        self._dpp_uri = self.wait_for_result()
+
+        print("DPP Enrollee QR: %s" % self._dpp_uri)
 
         if uri:
             self._rx_data = []
@@ -250,6 +257,10 @@ class Wpas:
             self._dpp_qr_id = self.wait_for_result()
             self._rx_data = []
             self._ctrl_request('DPP_AUTH_INIT peer=%s role=enrollee' % self._dpp_qr_id)
+        else:
+            self._ctrl_request('DPP_CHIRP own=%s iter=100' % self._dpp_qr_id)
+
+        return self._dpp_uri
 
     def dpp_configurator_create(self, uri):
         self._rx_data = []
-- 
2.31.1

                 reply	other threads:[~2022-01-18 21:25 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220118212512.2017977-10-prestwoj@gmail.com \
    --to=iwd@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox