All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Prestwood <prestwoj@gmail.com>
To: iwd@lists.01.org
Subject: [PATCH 3/7] auto-t: iwd.py: add autoconnect property/StationDebug
Date: Thu, 12 Aug 2021 13:38:08 -0700	[thread overview]
Message-ID: <20210812203812.738060-3-prestwoj@gmail.com> (raw)
In-Reply-To: <20210812203812.738060-1-prestwoj@gmail.com>

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

---
 autotests/util/iwd.py | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/autotests/util/iwd.py b/autotests/util/iwd.py
index 1785081f..5d041e57 100755
--- a/autotests/util/iwd.py
+++ b/autotests/util/iwd.py
@@ -226,6 +226,21 @@ class AdHocDevice(IWDDBusAbstract):
     def connected_peers(self):
         return self._properties['ConnectedPeers']
 
+class StationDebug(IWDDBusAbstract):
+    '''
+        Class represents net.connman.iwd.StationDebug
+    '''
+    _iface_name = IWD_STATION_DEBUG_INTERFACE
+
+    def __init__(self, *args, **kwargs):
+        self._debug_props = None
+        self._debug_iface = None
+
+        IWDDBusAbstract.__init__(self, *args, **kwargs)
+
+    @property
+    def autoconnect(self):
+        return self._properties['AutoConnect']
 
 class Device(IWDDBusAbstract):
     '''
@@ -238,6 +253,7 @@ class Device(IWDDBusAbstract):
         self._wps_manager_if = None
         self._station_if = None
         self._station_props = None
+        self._station_debug = None
         IWDDBusAbstract.__init__(self, *args, **kwargs)
 
     @property
@@ -354,6 +370,21 @@ class Device(IWDDBusAbstract):
         props = self._station_properties()
         return bool(props['Scanning'])
 
+    @property
+    def autoconnect(self):
+        if not self._station_debug:
+            self._station_debug = StationDebug(self._object_path)
+
+        return self._station_debug.autoconnect
+
+    @autoconnect.setter
+    def autoconnect(self, value):
+        if not self._station_debug:
+            self._station_debug = StationDebug(self._object_path)
+
+        self._station_debug._prop_proxy.Set(IWD_STATION_DEBUG_INTERFACE,
+                                            'AutoConnect', value)
+
     def scan(self):
         '''Schedule a network scan.
 
-- 
2.31.1

  parent reply	other threads:[~2021-08-12 20:38 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-12 20:38 [PATCH 1/7] station: make autoconnect settable via debug interface James Prestwood
2021-08-12 20:38 ` [PATCH 2/7] station: disable autoconnect when in developer mode James Prestwood
2021-08-12 20:38 ` James Prestwood [this message]
2021-08-12 20:38 ` [PATCH 4/7] auto-t: iwd.py: make scan_if_needed True by default James Prestwood
2021-08-12 20:38 ` [PATCH 5/7] auto-t: make hwsim registration off " James Prestwood
2021-08-12 20:38 ` [PATCH 6/7] auto-t: update all tests to remove bad scanning logic James Prestwood
2021-08-12 20:38 ` [PATCH 7/7] auto-t: set autoconnect=True for tests that need it James Prestwood
2021-08-12 21:59 ` [PATCH 1/7] station: make autoconnect settable via debug interface Denis Kenzior

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=20210812203812.738060-3-prestwoj@gmail.com \
    --to=prestwoj@gmail.com \
    --cc=iwd@lists.01.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.