mirror of git://git.sysmocom.de/ofono
Add test script for listing all operator details
This commit is contained in:
parent
3d2d259578
commit
7aec65b526
|
@ -143,7 +143,8 @@ test_files = test/test-manager test/test-modem test/test-voicecall \
|
|||
test/test-call-forwarding test/test-call-barring \
|
||||
test/test-ss-control-cb test/test-ss-control-cf \
|
||||
test/test-ss-control-cs \
|
||||
test/monitor-ofono test/list-modems test/enable-modem
|
||||
test/monitor-ofono test/list-modems test/enable-modem \
|
||||
test/list-operators
|
||||
|
||||
EXTRA_DIST = src/genbuiltin src/ofono.conf $(doc_files) $(test_files)
|
||||
|
||||
|
|
|
@ -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
|
Loading…
Reference in New Issue