summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rwxr-xr-xtest/list-operators40
1 files changed, 40 insertions, 0 deletions
diff --git a/test/list-operators b/test/list-operators
new file mode 100755
index 00000000..3e9e4082
--- /dev/null
+++ b/test/list-operators
@@ -0,0 +1,40 @@
+#!/usr/bin/python
+
+import dbus
+
+bus = dbus.SystemBus()
+
+manager = dbus.Interface(bus.get_object('org.ofono', '/'),
+ 'org.ofono.Manager')
+
+properties = manager.GetProperties()
+
+for path in properties["Modems"]:
+ modem = dbus.Interface(bus.get_object('org.ofono', path),
+ 'org.ofono.Modem')
+
+ properties = modem.GetProperties()
+
+ print "[ %s ]" % (path)
+
+ if "org.ofono.NetworkRegistration" not in properties["Interfaces"]:
+ continue
+
+ netreg = dbus.Interface(bus.get_object('org.ofono', path),
+ 'org.ofono.NetworkRegistration')
+
+ properties = netreg.GetProperties()
+
+ for path in properties["AvailableOperators"]:
+ operator = dbus.Interface(bus.get_object('org.ofono', path),
+ 'org.ofono.NetworkOperator')
+
+ properties = operator.GetProperties()
+
+ print " [ %s ]" % (path)
+
+ for key in properties.keys():
+ val = str(properties[key])
+ print " %s = %s" % (key, val)
+
+ print