commit 7ef165035e916c0401be5b36f84e7eb5ee3bc571
parent 88f23097968cb4d65993de16b8e51457d727f3bc
Author: James Prestwood <prestwoj@gmail.com>
Date: Tue, 4 Jan 2022 10:18:55 -0800
auto-t: iwd.py: add DPP utilities
Diffstat:
1 file changed, 36 insertions(+), 0 deletions(-)
diff --git a/autotests/util/iwd.py b/autotests/util/iwd.py
@@ -40,6 +40,7 @@ IWD_P2P_PEER_INTERFACE = 'net.connman.iwd.p2p.Peer'
IWD_P2P_SERVICE_MANAGER_INTERFACE = 'net.connman.iwd.p2p.ServiceManager'
IWD_P2P_WFD_INTERFACE = 'net.connman.iwd.p2p.Display'
IWD_STATION_DEBUG_INTERFACE = 'net.connman.iwd.StationDebug'
+IWD_DPP_INTERFACE = 'net.connman.iwd.DeviceProvisioning'
IWD_AGENT_MANAGER_PATH = '/net/connman/iwd'
IWD_TOP_LEVEL_PATH = '/'
@@ -270,6 +271,20 @@ class StationDebug(IWDDBusAbstract):
self._last_event_data = None
self._last_event = None
+class DeviceProvisioning(IWDDBusAbstract):
+ '''
+ Class represents net.connman.iwd.DeviceProvisioning
+ '''
+ _iface_name = IWD_DPP_INTERFACE
+
+ def start_enrollee(self):
+ return self._iface.StartEnrollee()
+
+ def start_configurator(self):
+ return self._iface.StartConfigurator()
+
+ def stop(self):
+ self._iface.Stop()
class Device(IWDDBusAbstract):
'''
@@ -283,6 +298,7 @@ class Device(IWDDBusAbstract):
self._station_if = None
self._station_props = None
self._station_debug_obj = None
+ self._dpp_obj = None
IWDDBusAbstract.__init__(self, *args, **kwargs)
@@ -304,6 +320,17 @@ class Device(IWDDBusAbstract):
return self._station_if
@property
+ def _device_provisioning(self):
+ if self._properties['Mode'] != 'station':
+ self._prop_proxy.Set(IWD_DEVICE_INTERFACE, 'Mode', 'station')
+
+ if self._dpp_obj is None:
+ self._dpp_obj = DeviceProvisioning(object_path=self._object_path,
+ namespace=self._namespace)
+
+ return self._dpp_obj
+
+ @property
def _station_debug(self):
if self._properties['Mode'] != 'station':
self._prop_proxy.Set(IWD_DEVICE_INTERFACE, 'Mode', 'station')
@@ -637,6 +664,15 @@ class Device(IWDDBusAbstract):
def wait_for_event(self, event, timeout=10):
self._station_debug.wait_for_event(event, timeout)
+ def dpp_start_enrollee(self):
+ return self._device_provisioning.start_enrollee()
+
+ def dpp_start_configurator(self):
+ return self._device_provisioning.start_configurator()
+
+ def dpp_stop(self):
+ return self._device_provisioning.stop()
+
def __str__(self, prefix = ''):
return prefix + 'Device: ' + self.device_path + '\n'\
+ prefix + '\tName:\t\t' + self.name + '\n'\