diff options
author | Dan Williams <dcbw@redhat.com> | 2009-10-09 16:17:13 -0700 |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2009-10-09 16:17:13 -0700 |
commit | 91171cdae295352011252d28d3d777960d0d876a (patch) | |
tree | 647a38f9c6e61cea264f1fdaa3ba109e030b7206 /test | |
parent | a088f12956763eb99a8f8b37934cf038a0b14cc0 (diff) |
cdma: implement generic registration state handling
Diffstat (limited to 'test')
-rwxr-xr-x | test/mm-test.py | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/test/mm-test.py b/test/mm-test.py index 67769c57..9a7be763 100755 --- a/test/mm-test.py +++ b/test/mm-test.py @@ -35,6 +35,16 @@ def get_cdma_band_class(band_class): else: return "Unknown" +def get_reg_state(state): + if state == 1: + return "registered (roaming unknown)" + elif state == 2: + return "registered on home network" + elif state == 4: + return "registered on roaming network" + else: + return "unknown" + def inspect_cdma(proxy, dump_private): cdma = dbus.Interface(proxy, dbus_interface=MM_DBUS_INTERFACE_MODEM_CDMA) @@ -45,8 +55,14 @@ def inspect_cdma(proxy, dump_private): except dbus.exceptions.DBusException: esn = "<unavailable>" + print "" print "ESN: %s" % esn - print "-------------------" + + try: + state = cdma.GetRegistrationState() + print "Registration: %s" % get_reg_state (state) + except dbus.exceptions.DBusException, e: + print "Error reading registration state: %s" % e try: info = cdma.GetServingSystem() |