[MERGED] osmo-gsm-tester[master]: ofono_client: Allow other ifaces in some methods

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Thu May 4 20:56:39 UTC 2017


Neels Hofmeyr has submitted this change and it was merged.

Change subject: ofono_client: Allow other ifaces in some methods
......................................................................


ofono_client: Allow other ifaces in some methods

Change-Id: Ic6df1e9c3f8948f694182bd2924753ae3cbe99ee
---
M src/osmo_gsm_tester/ofono_client.py
1 file changed, 5 insertions(+), 4 deletions(-)

Approvals:
  Neels Hofmeyr: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/osmo_gsm_tester/ofono_client.py b/src/osmo_gsm_tester/ofono_client.py
index 65a8791..b6c5628 100644
--- a/src/osmo_gsm_tester/ofono_client.py
+++ b/src/osmo_gsm_tester/ofono_client.py
@@ -28,6 +28,7 @@
 glib_main_ctx = glib_main_loop.get_context()
 bus = SystemBus()
 
+I_MODEM = 'org.ofono.Modem'
 I_NETREG = 'org.ofono.NetworkRegistration'
 I_SMS = 'org.ofono.MessageManager'
 
@@ -73,13 +74,13 @@
     def ki(self):
         return self.conf.get('ki')
 
-    def _dbus_set_bool(self, name, bool_val):
+    def _dbus_set_bool(self, name, bool_val, iface=I_MODEM):
         # to make sure any pending signals are received before we send out more DBus requests
         test.poll()
 
         val = bool(bool_val)
         self.log('Setting', name, val)
-        self.dbus_obj().SetProperty(name, Variant('b', val))
+        self.dbus_obj()[iface].SetProperty(name, Variant('b', val))
 
         test.wait(self.property_is, name, bool_val)
 
@@ -102,8 +103,8 @@
         self._on_interfaces_change(self.properties().get('Interfaces'))
         return self._dbus_obj
 
-    def properties(self):
-        return self.dbus_obj().GetProperties()
+    def properties(self, iface=I_MODEM):
+        return self.dbus_obj()[iface].GetProperties()
 
     def _on_property_change(self, name, value):
         if name == 'Interfaces':

-- 
To view, visit https://gerrit.osmocom.org/2472
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic6df1e9c3f8948f694182bd2924753ae3cbe99ee
Gerrit-PatchSet: 6
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>



More information about the gerrit-log mailing list