3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-26 02:19:26 +01:00

auto-t: wpas.py: handle enrollee as responder

This adds support for wpa_supplicant to generate its own URI and
start presence announcements (DPP_CHIRP).
This commit is contained in:
James Prestwood 2022-02-22 14:28:45 -08:00 committed by Denis Kenzior
parent 69c1a1ba7c
commit cfb0987eb5

View File

@ -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 = []