[MERGED] osmo-gsm-tester[master]: modem: Fallback to automatic registration if manual one is n...

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/.

Pau Espin Pedrol gerrit-no-reply at lists.osmocom.org
Wed Nov 8 10:12:08 UTC 2017


Pau Espin Pedrol has submitted this change and it was merged.

Change subject: modem: Fallback to automatic registration if manual one is not supported by modem
......................................................................


modem: Fallback to automatic registration if manual one is not supported by modem

Some modems such as the gobi 2000 doesn't support the Register() method
in /operator path. If the method returns a NotSupported error, fallback
to automatic registration.

Change-Id: Ibc322317db634a5380573de88a56eb53fd92e67b
---
M src/osmo_gsm_tester/modem.py
1 file changed, 8 insertions(+), 1 deletion(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/osmo_gsm_tester/modem.py b/src/osmo_gsm_tester/modem.py
index bff62bb..cb4a8de 100644
--- a/src/osmo_gsm_tester/modem.py
+++ b/src/osmo_gsm_tester/modem.py
@@ -502,7 +502,14 @@
             return
         dbus_op = systembus_get(matching_op_path)
         self.log('Registering with operator', matching_op_path, mcc_mnc)
-        dbus_call_dismiss_error(self, 'org.ofono.Error.InProgress', dbus_op.Register)
+        try:
+            dbus_call_dismiss_error(self, 'org.ofono.Error.InProgress', dbus_op.Register)
+        except GLib.Error as e:
+            if Gio.DBusError.is_remote_error(e) and Gio.DBusError.get_remote_error(e) == 'org.ofono.Error.NotSupported':
+                self.log('modem does not support manual registering, attempting automatic registering')
+                self.scan_cb_register_automatic(scanned_operators, mcc_mnc)
+                return
+            raise e
 
     def cancel_pending_dbus_methods(self):
         self.cancellable.cancel()

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ibc322317db634a5380573de88a56eb53fd92e67b
Gerrit-PatchSet: 2
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol <pespin at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Pau Espin Pedrol <pespin at sysmocom.de>



More information about the gerrit-log mailing list